use query.edit_message_text to simplify telegram class

This commit is contained in:
Matthias 2024-02-12 06:29:42 +01:00
parent 8ca905b45f
commit fd737af69d

View File

@ -1777,13 +1777,9 @@ class Telegram(RPCHandler):
msg += f"\nUpdated: {datetime.now().ctime()}" msg += f"\nUpdated: {datetime.now().ctime()}"
if not query.message: if not query.message:
return return
chat_id = query.message.chat_id
message_id = query.message.message_id
try: try:
await self._app.bot.edit_message_text( await query.edit_message_text(
chat_id=chat_id,
message_id=message_id,
text=msg, text=msg,
parse_mode=parse_mode, parse_mode=parse_mode,
reply_markup=reply_markup reply_markup=reply_markup