This commit is contained in:
shoopea 2019-07-09 16:01:02 +08:00
parent 4a1b9f531c
commit aed75d7084

10
bot.go
View File

@ -167,9 +167,12 @@ func botGetClients(m *tb.Message) {
}
if _, ok := clientsKeepAlive.Load(m.Chat.ID); ok {
var ret string
clientsCW.Range(func(k, v interface{}) bool {
c := v.(*ChatWarsClient)
ret = fmt.Sprintf("%s%s | UserID : %d | TelegramID : %d\n", ret, c.UserID64, c.TelegramID64)
clientsKeepAlive.Range(func(k, v interface{}) bool {
ka := v.(*MQKeepAlive)
if v2, ok2 := clientsCW.Load(ka.UserID64); ok2 {
clt := v2.(*ChatWarsClient)
ret = fmt.Sprintf("%s%s | UserID : %d | TelegramID : %d\n", ret, ka.Nickname, clt.UserID64, ka.UserID64)
}
return true
})
c := TGCommand{
@ -177,6 +180,7 @@ func botGetClients(m *tb.Message) {
Text: ret,
FromMsgID64: int64(m.ID),
FromChatID64: m.Chat.ID,
ParseMode: cmdParseModeHTML,
}
TGCmdQueue <- c
} else {