修复转发跳收藏;修复若干小bug

This commit is contained in:
dela
2026-02-05 21:29:48 +08:00
parent 098fd57c19
commit 270369ae0a
6 changed files with 96 additions and 11 deletions

View File

@@ -42,6 +42,24 @@ func (b *Bot) handleCatDel(c tele.Context) error {
return c.Reply(fmt.Sprintf("✅ 分类 [%s] 已删除", name))
}
func (b *Bot) handleCatRename(c tele.Context) error {
args := strings.Fields(c.Message().Payload)
if len(args) < 2 {
return c.Reply("用法: /cat_rename <旧名称> <新名称>\n例如: /cat_rename iOS Apple")
}
oldName := args[0]
newName := args[1]
if err := b.storage.RenameCategory(oldName, newName); err != nil {
return c.Reply(fmt.Sprintf("❌ 重命名失败: %v", err))
}
b.toc.TriggerUpdate()
return c.Reply(fmt.Sprintf("✅ 分类 [%s] 已重命名为 [%s]", oldName, newName))
}
func (b *Bot) handleCatList(c tele.Context) error {
categories, err := b.storage.ListCategories()
if err != nil {