From 71403d83a44a4f1d9c13ea823ffa5b0bdac7f2c2 Mon Sep 17 00:00:00 2001 From: shoopea Date: Wed, 5 Feb 2020 18:27:12 +0800 Subject: [PATCH] versioning --- bot.go | 3 ++- main.go | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bot.go b/bot.go index f4e81b2..63efeda 100644 --- a/bot.go +++ b/bot.go @@ -297,7 +297,7 @@ func botGetClients(m *tb.Message) { if clt, ok := getLockedClient(m.Chat.ID, false); ok { clt.Mux.Unlock() muxClients.RLock() - var ret string + ret = fmt.Sprintf("Version %s (%s)", githash, buildstamp) for id, c := range clients { if c.Active { ret = fmt.Sprintf("%s%s | UserID : %d | TelegramID : %d (online)\n", ret, c.Login, c.CWUserID64, id) @@ -305,6 +305,7 @@ func botGetClients(m *tb.Message) { ret = fmt.Sprintf("%s%s | UserID : %d | TelegramID : %d (offline)\n", ret, c.Login, c.CWUserID64, id) } } + ret = fmt.Sprintf("%s", ret) muxClients.RUnlock() c := TGCommand{ diff --git a/main.go b/main.go index 60f8d82..a1365fe 100644 --- a/main.go +++ b/main.go @@ -21,7 +21,7 @@ var ( config = flag.String("config", "config.json", "config file path") initdb = flag.Bool("initdb", false, "initialize bot database") githash string - buildstamp time.Time + buildstamp string db *sql.DB bot *tb.Bot