mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-07-12 07:51:30 +08:00
feat: update bot commands and help
This commit is contained in:
@@ -70,17 +70,22 @@ func Init(ctx context.Context) {
|
|||||||
client.API().BotsSetBotCommands(ctx, &tg.BotsSetBotCommandsRequest{
|
client.API().BotsSetBotCommands(ctx, &tg.BotsSetBotCommandsRequest{
|
||||||
Scope: &tg.BotCommandScopeDefault{},
|
Scope: &tg.BotCommandScopeDefault{},
|
||||||
})
|
})
|
||||||
|
commands := []tg.BotCommand{
|
||||||
|
{Command: "start", Description: "开始使用"},
|
||||||
|
{Command: "help", Description: "显示帮助"},
|
||||||
|
{Command: "silent", Description: "开启/关闭静默模式"},
|
||||||
|
{Command: "storage", Description: "设置默认存储端"},
|
||||||
|
{Command: "save", Description: "保存文件"},
|
||||||
|
{Command: "dir", Description: "管理存储文件夹"},
|
||||||
|
{Command: "rule", Description: "管理规则"},
|
||||||
|
}
|
||||||
|
if config.Cfg.Telegram.Userbot.Enable {
|
||||||
|
commands = append(commands, tg.BotCommand{Command: "watch", Description: "监听聊天"})
|
||||||
|
commands = append(commands, tg.BotCommand{Command: "unwatch", Description: "取消监听聊天"})
|
||||||
|
}
|
||||||
_, err = client.API().BotsSetBotCommands(ctx, &tg.BotsSetBotCommandsRequest{
|
_, err = client.API().BotsSetBotCommands(ctx, &tg.BotsSetBotCommandsRequest{
|
||||||
Scope: &tg.BotCommandScopeDefault{},
|
Scope: &tg.BotCommandScopeDefault{},
|
||||||
Commands: []tg.BotCommand{
|
Commands: commands,
|
||||||
{Command: "start", Description: "开始使用"},
|
|
||||||
{Command: "help", Description: "显示帮助"},
|
|
||||||
{Command: "silent", Description: "开启/关闭静默模式"},
|
|
||||||
{Command: "storage", Description: "设置默认存储端"},
|
|
||||||
{Command: "save", Description: "保存所回复的文件"},
|
|
||||||
{Command: "dir", Description: "管理存储文件夹"},
|
|
||||||
{Command: "rule", Description: "管理规则"},
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
resultChan <- struct {
|
resultChan <- struct {
|
||||||
client *gotgproto.Client
|
client *gotgproto.Client
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ Save Any Bot - 转存你的 Telegram 文件
|
|||||||
/silent - 开关静默模式
|
/silent - 开关静默模式
|
||||||
/storage - 设置默认存储位置
|
/storage - 设置默认存储位置
|
||||||
/save [自定义文件名] - 保存文件
|
/save [自定义文件名] - 保存文件
|
||||||
|
/dir - 管理存储目录
|
||||||
|
/rule - 管理规则
|
||||||
|
|
||||||
使用帮助: https://sabot.unv.app/usage/
|
使用帮助: https://sabot.unv.app/usage/
|
||||||
`
|
`
|
||||||
|
|||||||
Reference in New Issue
Block a user