🐛 Fix issue of incorrect parameters being passed when calling add_delete_message_job

This commit is contained in:
洛水居室 2023-03-26 16:12:11 +08:00
parent 87354ce417
commit 139c6758ae
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC
5 changed files with 10 additions and 10 deletions

View File

@ -104,7 +104,7 @@ class PluginFuncs:
job_queue = self.application.job_queue or context.job_queue
if job_queue is None:
if job_queue is None or chat is None:
raise RuntimeError
return job_queue.run_once(

View File

@ -142,16 +142,16 @@ class AbyssPlugin(Plugin):
reply_message = await message.reply_text(
"未查询到您所绑定的账号信息,请先私聊派蒙绑定账号", reply_markup=InlineKeyboardMarkup(buttons)
)
self.add_delete_message_job(reply_message.chat_id)
self.add_delete_message_job(message.chat_id)
self.add_delete_message_job(reply_message)
self.add_delete_message_job(message)
else:
await message.reply_text("未查询到您所绑定的账号信息,请先绑定账号", reply_markup=InlineKeyboardMarkup(buttons))
return
except TooManyRequestPublicCookies:
reply_message = await message.reply_text("查询次数太多,请您稍后重试")
if filters.ChatType.GROUPS.filter(message):
self.add_delete_message_job(reply_message.chat_id)
self.add_delete_message_job(message.chat_id)
self.add_delete_message_job(reply_message)
self.add_delete_message_job(message)
return
async def reply_message_func(content: str) -> None:

View File

@ -183,5 +183,5 @@ class BirthdayPlugin(Plugin):
text = "没有领取到生日画片哦 ~ 可能是已经领取过了"
reply_message = await message.reply_text(text)
if filters.ChatType.GROUPS.filter(reply_message):
self.add_delete_message_job(message.chat_id)
self.add_delete_message_job(reply_message.chat_id)
self.add_delete_message_job(message)
self.add_delete_message_job(reply_message)

View File

@ -87,7 +87,7 @@ class Sign(Plugin):
reply_message = await message.reply_text(msg)
if filters.ChatType.GROUPS.filter(message):
self.add_delete_message_job(reply_message, delay=30)
self.add_delete_message_job(message.chat_id, delay=30)
self.add_delete_message_job(message, delay=30)
return
logger.info("用户 %s[%s] 每日签到命令请求", user.full_name, user.id)
if filters.ChatType.GROUPS.filter(message):
@ -118,7 +118,7 @@ class Sign(Plugin):
)
self.add_delete_message_job(reply_message, delay=30)
self.add_delete_message_job(message.chat_id, delay=30)
self.add_delete_message_job(message, delay=30)
else:
await message.reply_text("未查询到您所绑定的账号信息,请先绑定账号", reply_markup=InlineKeyboardMarkup(buttons))
except NeedChallenge as exc:

View File

@ -241,7 +241,7 @@ class WishSimulatorPlugin(Plugin):
reply_message = await message.reply_text("出错了呜呜呜 ~ 卡池部分数据未找到!")
if filters.ChatType.GROUPS.filter(message):
self.add_delete_message_job(reply_message, name="wish_simulator")
self.add_delete_message_job(message.chat_id, name="wish_simulator")
self.add_delete_message_job(message, name="wish_simulator")
return
player_gacha_banner_info = player_gacha_info.get_banner_info(banner)
template_data = {