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