test clients
This commit is contained in:
parent
db5e6b19d6
commit
4bbcfacedc
8
bot.go
8
bot.go
@ -299,11 +299,15 @@ func botGetClients(m *tb.Message) {
|
||||
muxClients.RLock()
|
||||
ret := fmt.Sprintf("<code>Version %s (%s)\n", githash, buildstamp)
|
||||
for id, c := range clients {
|
||||
chat, err := bot.ChatByID(strconv.FormatInt(c.CWUserID64, 10))
|
||||
logOnError(err, "botGetClients : ChatByID")
|
||||
var status string
|
||||
if c.Active {
|
||||
ret = fmt.Sprintf("%s%s | UserID : %d | TelegramID : %d (online)\n", ret, c.Login, c.CWUserID64, id)
|
||||
status = `online`
|
||||
} else {
|
||||
ret = fmt.Sprintf("%s%s | UserID : %d | TelegramID : %d (offline)\n", ret, c.Login, c.CWUserID64, id)
|
||||
status = `offline`
|
||||
}
|
||||
ret = fmt.Sprintf("%s%s (%s) | @%s (online)\n", ret, c.Login, c.Build, chat.Username)
|
||||
}
|
||||
ret = fmt.Sprintf("%s</code>", ret)
|
||||
muxClients.RUnlock()
|
||||
|
Loading…
Reference in New Issue
Block a user