This commit is contained in:
user 2024-04-05 14:28:26 +03:00
parent 6127fc588e
commit eff4d99dbe
1 changed files with 11 additions and 0 deletions

View File

@ -1,6 +1,7 @@
async def tg_process_template( async def tg_process_template(
chat_wrap: 'Wrapped_CBot', chat_wrap: 'Wrapped_CBot',
text, keyboard=None, message_id=None, content_id=None, text, keyboard=None, message_id=None, content_id=None,
message_type='common', message_meta={},
photo=None, audio=None, video=None, document=None, **kwargs photo=None, audio=None, video=None, document=None, **kwargs
): ):
if (photo or video or audio or document) and message_id: if (photo or video or audio or document) and message_id:
@ -25,6 +26,8 @@ async def tg_process_template(
caption=text, caption=text,
reply_markup=keyboard, reply_markup=keyboard,
content_id=content_id, content_id=content_id,
message_type=message_type,
message_meta=message_meta,
**kwargs **kwargs
) )
elif audio: elif audio:
@ -33,6 +36,8 @@ async def tg_process_template(
caption=text, caption=text,
reply_markup=keyboard, reply_markup=keyboard,
content_id=content_id, content_id=content_id,
message_type=message_type,
message_meta=message_meta,
**kwargs **kwargs
) )
elif video: elif video:
@ -41,6 +46,8 @@ async def tg_process_template(
caption=text, caption=text,
reply_markup=keyboard, reply_markup=keyboard,
content_id=content_id, content_id=content_id,
message_type=message_type,
message_meta=message_meta,
**kwargs **kwargs
) )
elif document: elif document:
@ -49,12 +56,16 @@ async def tg_process_template(
caption=text, caption=text,
reply_markup=keyboard, reply_markup=keyboard,
content_id=content_id, content_id=content_id,
message_type=message_type,
message_meta=message_meta,
**kwargs **kwargs
) )
else: else:
return await chat_wrap.send_message( return await chat_wrap.send_message(
text, text,
reply_markup=keyboard, reply_markup=keyboard,
message_type=message_type,
message_meta=message_meta,
**kwargs **kwargs
) )