From 3918f6eee2f817fe06d77b775657adaf582c66f8 Mon Sep 17 00:00:00 2001 From: krau <71133316+krau@users.noreply.github.com> Date: Sat, 22 Mar 2025 15:45:34 +0800 Subject: [PATCH] feat: add version and commit information to help text in start command --- bot/handle_start.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot/handle_start.go b/bot/handle_start.go index 74b433f..4fc80d9 100644 --- a/bot/handle_start.go +++ b/bot/handle_start.go @@ -1,6 +1,8 @@ package bot import ( + "fmt" + "github.com/celestix/gotgproto/dispatcher" "github.com/celestix/gotgproto/ext" "github.com/krau/SaveAny-Bot/common" @@ -17,6 +19,7 @@ func start(ctx *ext.Context, update *ext.Update) error { const helpText string = ` Save Any Bot - 转存你的 Telegram 文件 +版本: %s , 提交: %s 命令: /start - 开始使用 /help - 显示帮助 @@ -32,6 +35,6 @@ Save Any Bot - 转存你的 Telegram 文件 ` func help(ctx *ext.Context, update *ext.Update) error { - ctx.Reply(update, ext.ReplyTextString(helpText), nil) + ctx.Reply(update, ext.ReplyTextString(fmt.Sprintf(helpText, common.Version, common.GitCommit[:7])), nil) return dispatcher.EndGroups }