🐛 修复一个BUG, 该BUG会导致将更新记录发送至任意群内 (#117)

This commit is contained in:
KimigaiiWuyi 2025-05-08 12:13:57 +08:00
parent 35f22965e7
commit b08e6ba79d
2 changed files with 8 additions and 2 deletions

View File

@ -44,17 +44,23 @@ class Subscribe(BaseModel, table=True):
sep: str = '\n', sep: str = '\n',
command_tips: str = '请输入以下命令之一:', command_tips: str = '请输入以下命令之一:',
command_start_text: str = '', command_start_text: str = '',
force_direct: bool = False,
): ):
for bot_id in gss.active_bot: for bot_id in gss.active_bot:
BOT = gss.active_bot[bot_id] BOT = gss.active_bot[bot_id]
if force_direct:
user_type = 'direct'
else:
user_type = self.user_type
ev = Event( ev = Event(
bot_id=self.bot_id, bot_id=self.bot_id,
user_id=self.user_id, user_id=self.user_id,
bot_self_id=self.bot_self_id, bot_self_id=self.bot_self_id,
user_type=self.user_type, # type: ignore user_type=user_type, # type: ignore
group_id=self.group_id, group_id=self.group_id,
real_bot_id=self.bot_id, real_bot_id=self.bot_id,
) )
bot = Bot(BOT, ev) bot = Bot(BOT, ev)
await bot.send_option( await bot.send_option(
reply, reply,

View File

@ -24,4 +24,4 @@ async def send_msg_to_master(
datas = await gs_subscribe.get_subscribe('主人用户') datas = await gs_subscribe.get_subscribe('主人用户')
if datas: if datas:
for subscribe in datas: for subscribe in datas:
await subscribe.send(message) await subscribe.send(message, force_direct=True)