Remember inline_message_id of form in case it gets unloaded before the result is returned

pull/1/head
Hikari 2022-04-16 20:27:13 +00:00
parent 69c64072c3
commit fa1ff8527a
No known key found for this signature in database
GPG Key ID: 5FA52ACBB2AD964D
1 changed files with 3 additions and 1 deletions

View File

@ -212,6 +212,8 @@ class Form(InlineUnit):
if status_message and not message.out: if status_message and not message.out:
await status_message.delete() await status_message.delete()
inline_message_id = self._forms[form_uid]["inline_message_id"]
if not any( if not any(
any("callback" in button or "input" in button for button in row) any("callback" in button or "input" in button for button in row)
for row in reply_markup for row in reply_markup
@ -222,7 +224,7 @@ class Form(InlineUnit):
"doesn't contain any button callbacks" "doesn't contain any button callbacks"
) )
return InlineMessage(self, form_uid, self._forms[form_uid]["inline_message_id"]) return InlineMessage(self, form_uid, inline_message_id)
async def _form_inline_handler(self, inline_query: InlineQuery) -> None: async def _form_inline_handler(self, inline_query: InlineQuery) -> None:
for form in self._forms.copy().values(): for form in self._forms.copy().values():