修复签到时自动删除的目标消息不存在的错误

This commit is contained in:
洛水.山岭居室 2022-05-02 16:51:41 +08:00
parent f2302641a7
commit e73fbd9cde

View File

@ -84,8 +84,10 @@ class Sign(BasePlugins):
else: else:
sign = await self._start_sign(user_info, user_info.service) sign = await self._start_sign(user_info, user_info.service)
reply_message = await message.reply_text(sign) reply_message = await message.reply_text(sign)
if filters.ChatType.GROUPS.filter(update.callback_query.message): if filters.ChatType.GROUPS.filter(reply_message):
self._add_delete_message_job(context, reply_message.chat_id, reply_message.message_id) self._add_delete_message_job(context, reply_message.chat_id, reply_message.message_id)
if filters.ChatType.GROUPS.filter(message):
self._add_delete_message_job(context, message.chat_id, message.message_id)
return ConversationHandler.END return ConversationHandler.END
async def command_result(self, update: Update, context: CallbackContext) -> int: async def command_result(self, update: Update, context: CallbackContext) -> int: