diff options
| author | Anton Petrov <63284142+Psychosoc1al@users.noreply.github.com> | 2025-12-03 16:43:37 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-03 16:43:37 +0300 |
| commit | 7ccc0877a152c35ef6933e3e3e998d91a212ad26 (patch) | |
| tree | c00cce044f0f9be1df341b9795e045e8eeb2ba07 /web/service | |
| parent | ad659e48cf78f6bbd60192c463ef19fb62dec4f8 (diff) | |
Add "Last Online" printing for Telegram bot (#3593)
Diffstat (limited to 'web/service')
| -rw-r--r-- | web/service/tgbot.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/web/service/tgbot.go b/web/service/tgbot.go index 1573b2bf..cac49dd9 100644 --- a/web/service/tgbot.go +++ b/web/service/tgbot.go @@ -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) |
