From 0830a0b2eb081be31078eeaa8f1ac04c61f44fc0 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 5 Apr 2024 13:47:56 +0300 Subject: [PATCH] fixes --- app/core/_utils/tg_process_template.py | 6 +++++- app/core/models/_telegram/templates/player.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/core/_utils/tg_process_template.py b/app/core/_utils/tg_process_template.py index db95f25..13c9df2 100644 --- a/app/core/_utils/tg_process_template.py +++ b/app/core/_utils/tg_process_template.py @@ -1,6 +1,6 @@ async def tg_process_template( chat_wrap: 'Wrapped_CBot', - text, keyboard=None, message_id=None, + text, keyboard=None, message_id=None, content_id=None, photo=None, audio=None, video=None, document=None, **kwargs ): if (photo or video or audio or document) and message_id: @@ -24,6 +24,7 @@ async def tg_process_template( photo, caption=text, reply_markup=keyboard, + content_id=content_id, **kwargs ) elif video: @@ -31,6 +32,7 @@ async def tg_process_template( video, caption=text, reply_markup=keyboard, + content_id=content_id, **kwargs ) elif document: @@ -38,12 +40,14 @@ async def tg_process_template( document, caption=text, reply_markup=keyboard, + content_id=content_id, **kwargs ) else: return await chat_wrap.send_message( text, reply_markup=keyboard, + content_id=content_id, **kwargs ) diff --git a/app/core/models/_telegram/templates/player.py b/app/core/models/_telegram/templates/player.py index 2359d81..bfaae4b 100644 --- a/app/core/models/_telegram/templates/player.py +++ b/app/core/models/_telegram/templates/player.py @@ -66,7 +66,7 @@ class PlayerTemplates: return await tg_process_template( self, text, message_id=message_id, **template_kwargs, keyboard=get_inline_keyboard([*inline_keyboard_array, *extra_buttons]) if inline_keyboard_array else None, - message_type=f'content/{content_type}', message_meta={'content_sha256': content_meta['hash']} + message_type=f'content/{content_type}', message_meta={'content_sha256': content_meta['hash']}, content_id=content.id )