buttons etc

This commit is contained in:
user 2025-01-22 20:11:50 +03:00
parent 18cf8f9954
commit d9cd30ae33
4 changed files with 11 additions and 3 deletions

View File

@ -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()}"
}],
[{

View File

@ -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([{

View File

@ -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"