Skip to content

Commit 3918f6e

Browse files
committed
feat: add version and commit information to help text in start command
1 parent 8d44b43 commit 3918f6e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

bot/handle_start.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
package bot
22

33
import (
4+
"fmt"
5+
46
"github.com/celestix/gotgproto/dispatcher"
57
"github.com/celestix/gotgproto/ext"
68
"github.com/krau/SaveAny-Bot/common"
@@ -17,6 +19,7 @@ func start(ctx *ext.Context, update *ext.Update) error {
1719

1820
const helpText string = `
1921
Save Any Bot - 转存你的 Telegram 文件
22+
版本: %s , 提交: %s
2023
命令:
2124
/start - 开始使用
2225
/help - 显示帮助
@@ -32,6 +35,6 @@ Save Any Bot - 转存你的 Telegram 文件
3235
`
3336

3437
func help(ctx *ext.Context, update *ext.Update) error {
35-
ctx.Reply(update, ext.ReplyTextString(helpText), nil)
38+
ctx.Reply(update, ext.ReplyTextString(fmt.Sprintf(helpText, common.Version, common.GitCommit[:7])), nil)
3639
return dispatcher.EndGroups
3740
}

0 commit comments

Comments
 (0)