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

8
bot.go
View File

@ -22,6 +22,7 @@ func BotHandlers(b *tb.Bot) {
func botPause(m *tb.Message) {
forcePaused = true
if !paused {
paused = true
px := PacketAdminRCon{
Packet: Packet{PType: AdminPacketAdminRCon},
@ -29,6 +30,10 @@ func botPause(m *tb.Message) {
}
_, err := conn.Write(px.Bytes())
logErrorDebug(err, "botPause : conn.Write")
sendChat(-436055948, "Game paused.")
} else {
sendChat(-436055948, "Game already paused.")
}
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
}