修复转发跳收藏;修复若干小bug
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user