From d9cd30ae33848c5854467a3faa4353fdb650c94b Mon Sep 17 00:00:00 2001 From: user Date: Wed, 22 Jan 2025 20:11:50 +0300 Subject: [PATCH] buttons etc --- app/client_bot/routers/content.py | 7 ++++++- app/core/models/_telegram/templates/player.py | 2 +- locale/en/LC_MESSAGES/sanic_telegram_bot.mo | Bin 2839 -> 2892 bytes locale/en/LC_MESSAGES/sanic_telegram_bot.po | 5 ++++- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/client_bot/routers/content.py b/app/client_bot/routers/content.py index 2ab9248..41fd712 100644 --- a/app/client_bot/routers/content.py +++ b/app/client_bot/routers/content.py @@ -126,6 +126,8 @@ async def t_inline_query_node_content(query: types.InlineQuery, memory=None, use if cover_content: result_kwargs['thumb_url'] = cover_content.web_url + content_type_declared = decrypted_content_meta.get('content_type', 'application/x-binary').split('/')[0] + content_list.append( types.InlineQueryResultAudio( id=f"NC_{content.id}", @@ -137,7 +139,10 @@ async def t_inline_query_node_content(query: types.InlineQuery, memory=None, use parse_mode='html', reply_markup=get_inline_keyboard([ [{ - 'text': user.translated('shareTrack_button'), + 'text': { + 'audio': user.translated('shareTrack_button'), + 'video': user.translated('shareVideo_button'), + }[content_type_declared], 'switch_inline_query': f"C{content.cid.serialize_v2()}" }], [{ diff --git a/app/core/models/_telegram/templates/player.py b/app/core/models/_telegram/templates/player.py index 36a998d..f99e310 100644 --- a/app/core/models/_telegram/templates/player.py +++ b/app/core/models/_telegram/templates/player.py @@ -100,7 +100,7 @@ class PlayerTemplates: if self.bot_id == 1: # Buttons for sharing and opening in app inline_keyboard_array.append([{ - 'text': self.user.translated('shareTrack_button'), + 'text': self.user.translated('shareVideo_button'), 'switch_inline_query': f"C{content.cid.serialize_v2()}", }]) inline_keyboard_array.append([{ diff --git a/locale/en/LC_MESSAGES/sanic_telegram_bot.mo b/locale/en/LC_MESSAGES/sanic_telegram_bot.mo index 1b66abd8be8bc3a137a3832884749e62c89d56fb..7498fa57c5282623c59ca9be026739e71b6e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ES/sanic_telegram_bot.po index 4cf4d01..3b150c3 100644 --- a/locale/en/LC_MESSAGES/sanic_telegram_bot.po +++ b/locale/en/LC_MESSAGES/sanic_telegram_bot.po @@ -117,6 +117,9 @@ msgstr "" msgid "shareTrack_button" msgstr "Share track" +msgid "shareVideo_button" +msgstr "Share video" + #: app/core/models/_telegram/templates/player.py:79 msgid "viewTrackAsClient_button" msgstr "Open in player" @@ -150,7 +153,7 @@ msgstr "Error: content price is not set" #: app/client_bot/routers/content.py:133 msgid "viewTrack_button" -msgstr "Buy track" +msgstr "Open in mini-app" #: app/client_bot/routers/content.py:138 msgid "cancelPurchase_button"