🐛 修复 post_handler_data 为 None 的问题

This commit is contained in:
洛水居室 2022-10-14 14:10:27 +08:00
parent f77c6528d2
commit c29fb1b58d
No known key found for this signature in database
GPG Key ID: C9DE87DA724B88FC

View File

@ -111,7 +111,10 @@ class Post(Plugin.Conversation, BasePlugin.Conversation):
@bot_admins_rights_check
@error_callable
async def callback_query_start(self, update: Update, context: CallbackContext) -> int:
post_handler_data: PostHandlerData = context.chat_data.get("post_handler_data")
post_handler_data = context.chat_data.get("post_handler_data")
if post_handler_data is None:
post_handler_data = PostHandlerData()
context.chat_data["post_handler_data"] = post_handler_data
callback_query = update.callback_query
user = callback_query.from_user
message = callback_query.message