refactor: replace logger usage with common.Log for consistent logging

This commit is contained in:
krau
2025-03-21 21:07:53 +08:00
parent 65fee89e14
commit ed0837a89b
27 changed files with 152 additions and 158 deletions
+3 -3
View File
@@ -5,14 +5,14 @@ import (
"github.com/celestix/gotgproto/dispatcher"
"github.com/celestix/gotgproto/ext"
"github.com/krau/SaveAny-Bot/common"
"github.com/krau/SaveAny-Bot/dao"
"github.com/krau/SaveAny-Bot/logger"
)
func silent(ctx *ext.Context, update *ext.Update) error {
user, err := dao.GetUserByChatID(update.GetUserChat().GetID())
if err != nil {
logger.L.Errorf("获取用户失败: %s", err)
common.Log.Errorf("获取用户失败: %s", err)
return dispatcher.EndGroups
}
if !user.Silent && user.DefaultStorage == "" {
@@ -21,7 +21,7 @@ func silent(ctx *ext.Context, update *ext.Update) error {
}
user.Silent = !user.Silent
if err := dao.UpdateUser(user); err != nil {
logger.L.Errorf("更新用户失败: %s", err)
common.Log.Errorf("更新用户失败: %s", err)
ctx.Reply(update, ext.ReplyTextString("更新用户失败"), nil)
return dispatcher.EndGroups
}