mirror of https://github.com/coddrago/Heroku
Fix empty reply markup patcher
parent
56e0430f70
commit
6ebfa3e0d7
|
@ -53,6 +53,10 @@ VERIFICATION_EMOJIES = list(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class Placeholder:
|
||||||
|
"""Placeholder"""
|
||||||
|
|
||||||
|
|
||||||
class Form(InlineUnit):
|
class Form(InlineUnit):
|
||||||
async def form(
|
async def form(
|
||||||
self,
|
self,
|
||||||
|
@ -239,10 +243,10 @@ class Form(InlineUnit):
|
||||||
and not ttl
|
and not ttl
|
||||||
):
|
):
|
||||||
logger.debug("Patching form reply markup with empty data")
|
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": ""})
|
reply_markup = self._validate_markup({"text": "", "data": ""})
|
||||||
else:
|
else:
|
||||||
base_reply_markup = None
|
base_reply_markup = Placeholder()
|
||||||
|
|
||||||
if (
|
if (
|
||||||
not any(
|
not any(
|
||||||
|
@ -332,7 +336,7 @@ class Form(InlineUnit):
|
||||||
|
|
||||||
msg = InlineMessage(self, unit_id, inline_message_id)
|
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)
|
await msg.edit(text, reply_markup=base_reply_markup)
|
||||||
|
|
||||||
return msg
|
return msg
|
||||||
|
|
Loading…
Reference in New Issue