This commit is contained in:
shoopea 2020-06-22 11:09:11 +02:00
parent 8720e79422
commit a609dd236f

16
bot.go
View File

@ -22,11 +22,27 @@ func BotHandlers(b *tb.Bot) {
func botPause(m *tb.Message) { func botPause(m *tb.Message) {
forcePaused = true forcePaused = true
paused = true
px := PacketAdminRCon{
Packet: Packet{PType: AdminPacketAdminRCon},
Command: "pause",
}
_, err := conn.Write(px.Bytes())
logErrorDebug(err, "botPause : conn.Write")
return return
} }
func botUnpause(m *tb.Message) { func botUnpause(m *tb.Message) {
forcePaused = false forcePaused = false
if pause && len(clients) > 1 {
paused = false
px := PacketAdminRCon{
Packet: Packet{PType: AdminPacketAdminRCon},
Command: "unpause",
}
_, err := conn.Write(px.Bytes())
logErrorDebug(err, "botUnpause : conn.Write")
}
return return
} }