diff --git a/app/core/models/_telegram/wrapped_bot.py b/app/core/models/_telegram/wrapped_bot.py index ab509ce..b4c1b5e 100644 --- a/app/core/models/_telegram/wrapped_bot.py +++ b/app/core/models/_telegram/wrapped_bot.py @@ -146,6 +146,7 @@ class Wrapped_CBotChat(T, PlayerTemplates): r = await self._bot.send_photo( self._chat_id, file_id, + parse_mode='html', **kwargs ) return await self.return_result(r, message_type=message_type, message_meta=message_meta, content_id=content_id) @@ -160,6 +161,7 @@ class Wrapped_CBotChat(T, PlayerTemplates): r = await self._bot.send_document( self._chat_id, file_id, + parse_mode='html', **kwargs ) return await self.return_result(r, message_type=message_type, message_meta=message_meta, content_id=content_id) @@ -174,6 +176,7 @@ class Wrapped_CBotChat(T, PlayerTemplates): r = await self._bot.send_video( self._chat_id, file_id, + parse_mode='html', **kwargs ) return await self.return_result(r, message_type=message_type, message_meta=message_meta, content_id=content_id) @@ -188,6 +191,7 @@ class Wrapped_CBotChat(T, PlayerTemplates): r = await self._bot.send_audio( self._chat_id, file_id, + parse_mode='html', **kwargs ) return await self.return_result(r, message_type=message_type, message_meta=message_meta, content_id=content_id) diff --git a/app/core/models/user/wallet_mixin.py b/app/core/models/user/wallet_mixin.py index 7303510..7d0a4f2 100644 --- a/app/core/models/user/wallet_mixin.py +++ b/app/core/models/user/wallet_mixin.py @@ -21,15 +21,16 @@ class WalletMixin: page_id = -1 page_size = 100 have_next_page = True + user_wallet_address = self.wallet_address(db_session) while have_next_page: page_id += 1 - nfts_list = await toncenter.get_nft_items(limit=100, offset=page_id * page_size) + nfts_list = await toncenter.get_nft_items(limit=100, offset=page_id * page_size, owner_address=user_wallet_address) if len(nfts_list) >= page_size: have_next_page = True for nft_item in nfts_list: try: - make_log(self, f"Scanning onchain NFT: {nft_item}", level='info') + # make_log(self, f"Scanning onchain NFT: {nft_item}", level='info') item_address = Address(nft_item['address']).to_string(1, 1, 1) owner_address = Address(nft_item['owner_address']).to_string(1, 1, 1) diff --git a/locale/en/LC_MESSAGES/sanic_telegram_bot.mo b/locale/en/LC_MESSAGES/sanic_telegram_bot.mo index bc58acb..1c71a66 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 6c113fd..65bdc74 100644 --- a/locale/en/LC_MESSAGES/sanic_telegram_bot.po +++ b/locale/en/LC_MESSAGES/sanic_telegram_bot.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2024-03-10 12:02+0300\n" +"POT-Creation-Date: 2024-04-05 21:50+0300\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -18,7 +18,7 @@ msgstr "" "Content-Transfer-Encoding: 8bit\n" #: app/bot/routers/home.py:16 app/bot/routers/home.py:15 -#: app/client_bot/routers/home.py:15 +#: app/client_bot/routers/home.py:15 app/client_bot/routers/home.py:17 msgid "home_menu" msgstr "" "Hi, {name}!\n" @@ -28,14 +28,17 @@ msgstr "" "You logged as {wallet_address}" #: app/bot/routers/home.py:20 app/client_bot/routers/home.py:20 +#: app/client_bot/routers/home.py:22 msgid "ownedContent_button" msgstr "📊 My content" #: app/bot/routers/home.py:24 app/client_bot/routers/home.py:24 +#: app/client_bot/routers/home.py:26 msgid "disconnectWallet_button" msgstr "🔌 Disconnect wallet" #: app/bot/routers/home.py:35 app/client_bot/routers/home.py:35 +#: app/client_bot/routers/home.py:37 msgid "connectWalletsList_menu" msgstr "" "/ Welcome to MY [🔴]\n" @@ -43,11 +46,12 @@ msgstr "" "Please select the wallet you want to connect to the bot:" #: app/bot/routers/index.py:23 app/bot/routers/index.py:22 -#: app/client_bot/routers/index.py:18 +#: app/client_bot/routers/index.py:18 app/client_bot/routers/index.py:23 msgid "error_unknownCommand" msgstr "Unknown command, please try again or press /start" #: app/bot/routers/content.py:16 app/bot/routers/content.py:12 +#: app/bot/routers/content.py:21 msgid "ownedContent_menu" msgstr "" "📊 My content\n" @@ -55,23 +59,25 @@ msgstr "" "Here you can see the list of your content." #: app/bot/routers/content.py:21 app/bot/routers/content.py:17 +#: app/bot/routers/content.py:47 msgid "webApp_uploadContent_button" msgstr "📤 Upload content" #: app/bot/routers/content.py:27 app/bot/routers/content.py:23 +#: app/bot/routers/content.py:53 app/bot/routers/content.py:68 msgid "back_button" msgstr "◀️ Back" -#: app/bot/routers/tonconnect.py:80 +#: app/bot/routers/tonconnect.py:80 app/client_bot/routers/tonconnect.py:82 msgid "tonconnectInit_menu" msgstr "🔌 Press the button below to connect your wallet" #: app/bot/routers/tonconnect.py:101 app/bot/routers/tonconnect.py:105 -#: app/bot/routers/tonconnect.py:107 +#: app/bot/routers/tonconnect.py:107 app/client_bot/routers/tonconnect.py:109 msgid "p_successConnectWallet" msgstr "✅ Wallet connected successfully" -#: app/api/routes/_blockchain.py:143 +#: app/api/routes/_blockchain.py:143 app/api/routes/_blockchain.py:142 msgid "p_tonconnectTransactionRequested" msgstr "" "⏳ Transaction requested\n" @@ -79,22 +85,68 @@ msgstr "" "👉 Please confirm the transaction in your wallet" #: app/api/routes/_blockchain.py:146 +#: app/core/models/_telegram/templates/player.py:108 +#: app/api/routes/_blockchain.py:145 msgid "gotoWallet_button" msgstr "Open wallet" #: app/api/routes/_blockchain.py:150 app/bot/routers/tonconnect.py:90 #: app/core/background/indexer_service.py:141 app/bot/routers/tonconnect.py:92 +#: app/core/background/indexer_service.py:156 app/api/routes/_blockchain.py:149 +#: app/client_bot/routers/tonconnect.py:94 msgid "home_button" msgstr "◀️ Back" -#: app/bot/routers/tonconnect.py:86 +#: app/bot/routers/tonconnect.py:86 app/client_bot/routers/tonconnect.py:88 msgid "tonconnectOpenWallet_button" msgstr "[Connect wallet]" #: app/core/background/indexer_service.py:134 +#: app/core/background/indexer_service.py:149 msgid "p_contentWasIndexed" -msgstr "🎉 Your new content was uploaded successfully!" -"\n\n" -"🔗 {item_address} on the blockchain" -"\n\n" +msgstr "" +"🎉 Your new content was uploaded successfully!\n" +"\n" +"🔗 {item_address} on " +"the blockchain\n" +"\n" "Now you can manage it in My content section" + +#: app/core/models/_telegram/templates/player.py:74 +#: app/client_bot/routers/content.py:129 +msgid "shareTrack_button" +msgstr "Share track" + +#: app/core/models/_telegram/templates/player.py:79 +msgid "viewTrackAsClient_button" +msgstr "Open in player" + +#: app/core/models/_telegram/templates/player.py:86 +msgid "p_playerContext_unsupportedContent" +msgstr "⚠️ Unsupported content" + +#: app/core/models/_telegram/templates/player.py:111 +msgid "p_playerContext_purchaseRequested" +msgstr "Confirm the purchase in your wallet. After that, you will be able to " +"listen to the full track version." + +#: app/core/models/_telegram/templates/player.py:114 +msgid "buyTrackListenLicense_button" +msgstr "Buy license ({price} TON)" + +#: app/core/models/_telegram/templates/player.py:117 +msgid "p_playerContext_preview" +msgstr "It's a preview version of the track. To listen to the full version, " +"you need to buy a license." + +#: app/client_bot/routers/content.py:32 +msgid "error_contentNotFound" +msgstr "Error: content not found" + +#: app/client_bot/routers/content.py:37 +msgid "error_contentPrice" +msgstr "Error: content price is not set" + +#: app/client_bot/routers/content.py:133 +msgid "viewTrack_button" +msgstr "View track"