From 6ebfa3e0d7c28d367a827a85bf5459254e4a8541 Mon Sep 17 00:00:00 2001 From: hikariatama Date: Wed, 27 Jul 2022 17:54:55 +0000 Subject: [PATCH] Fix empty reply markup patcher --- hikka/inline/form.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/hikka/inline/form.py b/hikka/inline/form.py index 4b27d09..8f58e0c 100644 --- a/hikka/inline/form.py +++ b/hikka/inline/form.py @@ -53,6 +53,10 @@ VERIFICATION_EMOJIES = list( ) +class Placeholder: + """Placeholder""" + + class Form(InlineUnit): async def form( self, @@ -239,10 +243,10 @@ class Form(InlineUnit): and not ttl ): logger.debug("Patching form reply markup with empty data") - base_reply_markup = reply_markup.copy() + base_reply_markup = copy.deepcopy(reply_markup) or None reply_markup = self._validate_markup({"text": "­", "data": "­"}) else: - base_reply_markup = None + base_reply_markup = Placeholder() if ( not any( @@ -332,7 +336,7 @@ class Form(InlineUnit): msg = InlineMessage(self, unit_id, inline_message_id) - if base_reply_markup: + if not isinstance(base_reply_markup, Placeholder): await msg.edit(text, reply_markup=base_reply_markup) return msg