Get replied message text"""
reply: Message = await message.get_reply_message()
text = reply.text if (reply and reply.text) else ""
await utils.answer(message, f"{utils.escape_html(text)}")
@loader.command(ru_doc="<реплай на сообщение> Получить кнопки сообщения")
async def reply_markup(self, message: Message) -> None:
""" Get replied message reply markup (buttons)"""
reply: Message = await message.get_reply_message()
if not reply:
await utils.answer(message, self.strings("no_reply"))
return
reply_markup = reply.reply_markup
if not reply_markup or not isinstance(reply_markup, ReplyInlineMarkup):
await utils.answer(message, self.strings("no_reply_markup"))
return
buttons = []
for row in reply_markup.rows:
buttons.extend(row.buttons)
text = ""
for button in buttons:
if isinstance(button, KeyboardButtonCallback):
value = button.data.decode("utf-8")
value_type = "data"
elif isinstance(button, KeyboardButtonUrl):
value = button.url
value_type = "url"
else:
text += f" - {button.text}\n"
continue
text += f" - {button.text} - {value_type}: {value}\n"
await utils.answer(message, self.strings("reply_markup_cmd_text").format(text))
@loader.command()
async def entity_link(self, message: Message) -> None:
"""