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): class UserDataMiddleware(BaseMiddleware):
async def __call__(self, handler, event, data): 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: if not update_body:
return return

View File

@ -174,7 +174,7 @@ async def t_inline_query_node_content(query: types.InlineQuery, memory=None, use
content_share_link = { content_share_link = {
'text': user.translated('p_shareLinkContext').format(title=' '.join(audio_title)), '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 # Create inline query result using decrypted content's file_id

View File

@ -22,6 +22,9 @@ closing_router = Router()
@closing_router.message() @closing_router.message()
async def t_index(message: types.Message, **extra): 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') return await message.answer(extra['user'].translated('error_unknownCommand'), parse_mode='html')
main_router.include_routers(closing_router) main_router.include_routers(closing_router)

View File

@ -25,4 +25,4 @@ async def t_pre_checkout_query_stars_processing(pre_checkout_query: types.PreChe
router.pre_checkout_query.register(t_pre_checkout_query_stars_processing) router.pre_checkout_query.register(t_pre_checkout_query_stars_processing)

View File

@ -71,7 +71,7 @@ class PlayerTemplates:
content_share_link = { content_share_link = {
'text': self.user.translated('p_shareLinkContext').format(title=content_metadata_json.get('name', "")), '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( preview_content = db_session.query(StoredContent).filter(

View File

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