Skip to content

Commit 26e344a

Browse files
committed
refactor: remove unused conversation handling code and simplify delDir function parameters
1 parent 8f07440 commit 26e344a

File tree

3 files changed

+2
-78
lines changed

3 files changed

+2
-78
lines changed

bot/handle_add_task.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
)
2323

2424
func AddToQueue(ctx *ext.Context, update *ext.Update) error {
25-
// TODO: 回调数据用户独立鉴权 (处理 bot 在群聊中的情况)
2625
if !slice.Contain(config.Cfg.GetUsersID(), update.CallbackQuery.UserID) {
2726
ctx.AnswerCallback(&tg.MessagesSetBotCallbackAnswerRequest{
2827
QueryID: update.CallbackQuery.QueryID,

bot/handle_conversation.go

Lines changed: 0 additions & 75 deletions
This file was deleted.

bot/handle_dir.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func dirCmd(ctx *ext.Context, update *ext.Update) error {
7777
ctx.Reply(update, ext.ReplyTextString("路径ID无效"), nil)
7878
return dispatcher.EndGroups
7979
}
80-
return delDir(ctx, update, user, dirID)
80+
return delDir(ctx, update, dirID)
8181
default:
8282
ctx.Reply(update, ext.ReplyTextString("未知操作"), nil)
8383
return dispatcher.EndGroups
@@ -99,7 +99,7 @@ func addDir(ctx *ext.Context, update *ext.Update, user *dao.User, storageName, p
9999
return dispatcher.EndGroups
100100
}
101101

102-
func delDir(ctx *ext.Context, update *ext.Update, user *dao.User, dirID int) error {
102+
func delDir(ctx *ext.Context, update *ext.Update, dirID int) error {
103103
if err := dao.DeleteDirByID(uint(dirID)); err != nil {
104104
common.Log.Errorf("删除路径失败: %s", err)
105105
ctx.Reply(update, ext.ReplyTextString("删除路径失败"), nil)

0 commit comments

Comments
 (0)