diff --git a/bot.go b/bot.go index ed506a2..9d8d36e 100644 --- a/bot.go +++ b/bot.go @@ -22,11 +22,27 @@ func BotHandlers(b *tb.Bot) { func botPause(m *tb.Message) { forcePaused = true + paused = true + px := PacketAdminRCon{ + Packet: Packet{PType: AdminPacketAdminRCon}, + Command: "pause", + } + _, err := conn.Write(px.Bytes()) + logErrorDebug(err, "botPause : conn.Write") return } func botUnpause(m *tb.Message) { 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 }