fix middleware

This commit is contained in:
user 2025-03-01 13:54:46 +03:00
parent 45af09da0d
commit 10cb581b34
7 changed files with 10 additions and 7 deletions

View File

@ -9,7 +9,7 @@ from datetime import datetime
class UserDataMiddleware(BaseMiddleware):
async def __call__(self, handler, event, data):
update_body = event.message or event.callback_query or event.inline_query
update_body = event.message or event.callback_query or event.inline_query or event.pre_checkout_query
if not update_body:
return

View File

@ -174,7 +174,7 @@ async def t_inline_query_node_content(query: types.InlineQuery, memory=None, use
content_share_link = {
'text': user.translated('p_shareLinkContext').format(title=' '.join(audio_title)),
'url': f"https://t.me/{CLIENT_TELEGRAM_BOT_USERNAME}?start=C{content.cid.serialize_v2()}"
'url': f"https://t.me/{CLIENT_TELEGRAM_BOT_USERNAME}/content?startapp=C{content.cid.serialize_v2()}"
}
# Create inline query result using decrypted content's file_id

View File

@ -22,6 +22,9 @@ closing_router = Router()
@closing_router.message()
async def t_index(message: types.Message, **extra):
if message.write_access_allowed:
return
return await message.answer(extra['user'].translated('error_unknownCommand'), parse_mode='html')
main_router.include_routers(closing_router)

View File

@ -71,7 +71,7 @@ class PlayerTemplates:
content_share_link = {
'text': self.user.translated('p_shareLinkContext').format(title=content_metadata_json.get('name', "")),
'url': f"https://t.me/{CLIENT_TELEGRAM_BOT_USERNAME}?start=C{content.cid.serialize_v2()}"
'url': f"https://t.me/{CLIENT_TELEGRAM_BOT_USERNAME}/content?startapp=C{content.cid.serialize_v2()}"
}
preview_content = db_session.query(StoredContent).filter(

View File

@ -126,10 +126,10 @@ msgstr ""
#: app/core/models/_telegram/templates/player.py:74
#: app/client_bot/routers/content.py:129
msgid "shareTrack_button"
msgstr "🎶 Поделиться треком"
msgstr "🎶 Поделиться"
msgid "shareVideo_button"
msgstr "🎬 Поделиться видео"
msgstr "🎬 Поделиться"
#: app/core/models/_telegram/templates/player.py:79
msgid "viewTrackAsClient_button"
@ -190,7 +190,7 @@ msgstr ""
msgid "shareLink_button"
msgstr "🔗 Поделиться ссылкой"
msgstr "🔗 Поделиться"
msgid "p_shareLinkContext"
msgstr "🎉 Наслаждайтесь {title} на MY!"