From 7ccc0877a152c35ef6933e3e3e998d91a212ad26 Mon Sep 17 00:00:00 2001 From: Anton Petrov <63284142+Psychosoc1al@users.noreply.github.com> Date: Wed, 3 Dec 2025 16:43:37 +0300 Subject: Add "Last Online" printing for Telegram bot (#3593) --- web/service/tgbot.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'web/service') 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) -- cgit v1.2.3