mirror of
https://github.com/krau/SaveAny-Bot.git
synced 2026-08-25 02:00:59 +08:00
fix: add UserID to link message and enforce default storage setting in silent handler
This commit is contained in:
@@ -102,6 +102,7 @@ func handleLinkMessage(ctx *ext.Context, update *ext.Update) error {
|
|||||||
Status: types.Pending,
|
Status: types.Pending,
|
||||||
File: file,
|
File: file,
|
||||||
StorageName: user.DefaultStorage,
|
StorageName: user.DefaultStorage,
|
||||||
|
UserID: user.ChatID,
|
||||||
FileChatID: linkChat.GetID(),
|
FileChatID: linkChat.GetID(),
|
||||||
FileMessageID: messageID,
|
FileMessageID: messageID,
|
||||||
ReplyMessageID: replied.ID,
|
ReplyMessageID: replied.ID,
|
||||||
|
|||||||
@@ -88,6 +88,10 @@ func silent(ctx *ext.Context, update *ext.Update) error {
|
|||||||
logger.L.Errorf("获取用户失败: %s", err)
|
logger.L.Errorf("获取用户失败: %s", err)
|
||||||
return dispatcher.EndGroups
|
return dispatcher.EndGroups
|
||||||
}
|
}
|
||||||
|
if !user.Silent && user.DefaultStorage == "" {
|
||||||
|
ctx.Reply(update, ext.ReplyTextString("请先使用 /storage 设置默认存储位置"), nil)
|
||||||
|
return dispatcher.EndGroups
|
||||||
|
}
|
||||||
user.Silent = !user.Silent
|
user.Silent = !user.Silent
|
||||||
if err := dao.UpdateUser(user); err != nil {
|
if err := dao.UpdateUser(user); err != nil {
|
||||||
logger.L.Errorf("更新用户失败: %s", err)
|
logger.L.Errorf("更新用户失败: %s", err)
|
||||||
|
|||||||
Reference in New Issue
Block a user