mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-12-18 05:04:40 +03:00
Add "Last Online" printing for Telegram bot (#3593)
This commit is contained in:
@@ -2952,10 +2952,12 @@ func (t *Tgbot) clientInfoMsg(
|
||||
}
|
||||
|
||||
status := t.I18nBot("tgbot.offline")
|
||||
isOnline := false
|
||||
if p.IsRunning() {
|
||||
for _, online := range p.GetOnlineClients() {
|
||||
if online == traffic.Email {
|
||||
status = t.I18nBot("tgbot.online")
|
||||
isOnline = true
|
||||
break
|
||||
}
|
||||
}
|
||||
@@ -2968,6 +2970,9 @@ func (t *Tgbot) clientInfoMsg(
|
||||
}
|
||||
if printOnline {
|
||||
output += t.I18nBot("tgbot.messages.online", "Status=="+status)
|
||||
if !isOnline && traffic.LastOnline > 0 {
|
||||
output += t.I18nBot("tgbot.messages.lastOnline", "Time=="+time.UnixMilli(traffic.LastOnline).Format("2006-01-02 15:04:05"))
|
||||
}
|
||||
}
|
||||
if printActive {
|
||||
output += t.I18nBot("tgbot.messages.active", "Enable=="+active)
|
||||
|
||||
Reference in New Issue
Block a user