update pause/unpause msg

This commit is contained in:
shoopea 2021-11-08 14:19:52 +08:00
parent 3194cb33db
commit 7db13a764c
3 changed files with 6 additions and 6 deletions

2
bot.go
View File

@ -84,7 +84,6 @@ func botPause(m *tb.Message) {
}
if !srv.Status.Paused {
srv.Pause()
bot.SendChat(bot.Config.ChatID, "Game paused.")
} else {
bot.SendChat(bot.Config.ChatID, "Game already paused.")
}
@ -104,7 +103,6 @@ func botUnpause(m *tb.Message) {
}
if !srv.NeedPause() {
srv.Unpause()
bot.SendChat(bot.Config.ChatID, "Game unpaused.")
} else {
bot.SendChat(bot.Config.ChatID, fmt.Sprintf("Cannot unpause : %s", srv.NeedPauseReason()))
}

2
ttd.go
View File

@ -589,6 +589,7 @@ func (s *ServerTTD) Pause() {
err := s.Send(px.Bytes())
s.ComputeClientTime()
bot.SendChat(cfg.Telegram.ChatID, "Game is paused.")
s.Status.Paused = true
logErrorDebug(err, "Server.Pause : Send()")
@ -610,6 +611,7 @@ func (s *ServerTTD) Unpause() {
err := s.Send(px.Bytes())
s.ComputeClientTime()
bot.SendChat(cfg.Telegram.ChatID, "Game is unpaused.")
s.Status.Paused = false
logErrorDebug(err, "Server.Unpause : Send()")

View File

@ -1,6 +1,6 @@
// Code generated by version.sh (@generated) DO NOT EDIT.
package main
var githash = "f56d25e"
var buildstamp = "2021-11-07_12:29:05"
var commits = "167"
var version = "f56d25e-b167 - 2021-11-07_12:29:05"
var githash = "3194cb3"
var buildstamp = "2021-11-08_06:19:35"
var commits = "168"
var version = "3194cb3-b168 - 2021-11-08_06:19:35"