This commit is contained in:
shoopea 2020-06-22 11:13:07 +02:00
parent fb86db548e
commit 8b3f670b5a

20
bot.go
View File

@ -22,13 +22,18 @@ func BotHandlers(b *tb.Bot) {
func botPause(m *tb.Message) {
forcePaused = true
paused = true
px := PacketAdminRCon{
Packet: Packet{PType: AdminPacketAdminRCon},
Command: "pause",
if !paused {
paused = true
px := PacketAdminRCon{
Packet: Packet{PType: AdminPacketAdminRCon},
Command: "pause",
}
_, err := conn.Write(px.Bytes())
logErrorDebug(err, "botPause : conn.Write")
sendChat(-436055948, "Game paused.")
} else {
sendChat(-436055948, "Game already paused.")
}
_, err := conn.Write(px.Bytes())
logErrorDebug(err, "botPause : conn.Write")
return
}
@ -42,6 +47,9 @@ func botUnpause(m *tb.Message) {
}
_, err := conn.Write(px.Bytes())
logErrorDebug(err, "botUnpause : conn.Write")
sendChat(-436055948, "Game unpaused.")
} else {
sendChat(-436055948, "Game already unpaused.")
}
return
}