diff --git a/app/bot/middleware.py b/app/bot/middleware.py index 4ab1273..f926c4a 100644 --- a/app/bot/middleware.py +++ b/app/bot/middleware.py @@ -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 diff --git a/app/client_bot/routers/content.py b/app/client_bot/routers/content.py index a1ae536..ec89420 100644 --- a/app/client_bot/routers/content.py +++ b/app/client_bot/routers/content.py @@ -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 diff --git a/app/client_bot/routers/index.py b/app/client_bot/routers/index.py index 607f5fa..88baa39 100644 --- a/app/client_bot/routers/index.py +++ b/app/client_bot/routers/index.py @@ -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) diff --git a/app/client_bot/routers/stars.py b/app/client_bot/routers/stars.py index 7c8dafc..fecc175 100644 --- a/app/client_bot/routers/stars.py +++ b/app/client_bot/routers/stars.py @@ -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) \ No newline at end of file +router.pre_checkout_query.register(t_pre_checkout_query_stars_processing) diff --git a/app/core/models/_telegram/templates/player.py b/app/core/models/_telegram/templates/player.py index e8a469e..b8127ec 100644 --- a/app/core/models/_telegram/templates/player.py +++ b/app/core/models/_telegram/templates/player.py @@ -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( diff --git a/locale/en/LC_MESSAGES/sanic_telegram_bot.mo b/locale/en/LC_MESSAGES/sanic_telegram_bot.mo index 243cbdb..fc1e807 100644 Binary files a/locale/en/LC_MESSAGES/sanic_telegram_bot.mo and b/locale/en/LC_MESSAGES/sanic_telegram_bot.mo differ diff --git a/locale/en/LC_MESSAGES/sanic_telegram_bot.po b/locale/en/LC_MESSAGES/sanic_telegram_bot.po index 3db50c2..2a16c31 100644 --- a/locale/en/LC_MESSAGES/sanic_telegram_bot.po +++ b/locale/en/LC_MESSAGES/sanic_telegram_bot.po @@ -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!"