From 1060501c9d9711f780b562cd9ae7fbcb5bb8fa87 Mon Sep 17 00:00:00 2001 From: tema Date: Sun, 9 Oct 2022 20:15:51 +0300 Subject: [PATCH] fix group send --- handlers/groups/main.py | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/handlers/groups/main.py b/handlers/groups/main.py index a8a1dce..16e6d5e 100644 --- a/handlers/groups/main.py +++ b/handlers/groups/main.py @@ -39,8 +39,23 @@ async def get_replace_on_chat(message: types.Message): user_id=str(message.from_user.id), username=str(message.from_user.username) )) - - data = get_about_replacements() + try: + data = get_about_replacements() + if 'image' in data: + await bot.send_photo( + message.chat.id, + io.BytesIO( + base64.b64decode( + data["data"]['all'] + ) + ), + parse_mode="Markdown", + ) + return + except Exception as e: + logging.error(e) + await bot.send_message(message.chat.id, "Error") + return group = get_group(message.chat.id) if group is not None: