* refactor: a big refactor. wip * refactor: port handle file * refactor: place all handlers * fix: task info nil pointer * feat: enhance task progress tracking and context management * feat: cancel task * feat: stream mode * feat: silent mode * feat: dir cmd * refactor: remove unused old file * feat: rule cmd * feat: handle silent mode * feat: batch task * fix: batch task progress and temp file cleanup * refactor: update file creation and cleanup methods for better resource management * feat: add save command with silent mode handling * feat: message link * feat: update message prompts to include file count in storage selection * feat: slient save links * refactor: reduce dup code * feat: rule type * feat: chose dir * feat: refactor file handling and storage rules, improve error handling and logging * feat: rule mode * feat: telegraph pics * fix: tphpics nil pointer and inaccurate dirpath * feat: silent save telegraph * feat: add suffix to avoid file overwrite * feat: new storage telegram * chore: tidy go mod
31 lines
850 B
Go
31 lines
850 B
Go
package handlers
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/celestix/gotgproto/dispatcher"
|
|
"github.com/celestix/gotgproto/ext"
|
|
"github.com/krau/SaveAny-Bot/pkg/consts"
|
|
)
|
|
|
|
func handleHelpCmd(ctx *ext.Context, update *ext.Update) error {
|
|
const helpText string = `
|
|
Save Any Bot - 转存你的 Telegram 文件
|
|
版本: %s , 提交: %s
|
|
命令:
|
|
/start - 开始使用
|
|
/help - 显示帮助
|
|
/silent - 开关静默模式
|
|
/storage - 设置默认存储位置
|
|
/save [自定义文件名] - 保存文件
|
|
|
|
静默模式: 开启后 Bot 直接保存到收到的文件到默认位置, 不再询问
|
|
|
|
默认存储位置: 在静默模式下保存到的位置
|
|
|
|
向 Bot 发送(转发)文件, 或发送一个公开频道的消息链接以保存文件
|
|
`
|
|
ctx.Reply(update, ext.ReplyTextString(fmt.Sprintf(helpText, consts.Version, consts.GitCommit)), nil)
|
|
return dispatcher.EndGroups
|
|
}
|