From 8f6e60f650fd3643803e8c7b85e10337c5d88187 Mon Sep 17 00:00:00 2001 From: user Date: Fri, 5 Apr 2024 21:59:08 +0300 Subject: [PATCH] fix --- app/core/models/_telegram/wrapped_bot.py | 4 ++ app/core/models/user/wallet_mixin.py | 5 +- locale/en/LC_MESSAGES/sanic_telegram_bot.mo | Bin 1784 -> 2567 bytes locale/en/LC_MESSAGES/sanic_telegram_bot.po | 74 +++++++++++++++++--- 4 files changed, 70 insertions(+), 13 deletions(-) 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 bc58acbb2ab155c011c441339972ccb9ef978cd1..1c71a66ab769e814f31af01b3dcb1545a7e99b14 100644 GIT binary patch delta 1232 zcmZvZO=uHA6vroNtlC<&wOZ>3jupQpr6Qs=hJH{{sIAo0fFNNvnUK|WXWgA`jim$% zQVN2Hr3gi+2ah5`J$M(vn+Gp?5iA~55DTJs^#3NCs?~wn-|Tzy@&CW~vuV1u@~$N@ z%P`t8cVK?N+>7}rh7U$hoUul*7o_}ounoK#aSGgw|2eP)d;+$D&%tK!4M^udgKNPb z;3kmO>3oH?VnKm@AYI%I?gmG|4p4zxz@7mzMU)HAjV+zEDpr$K!%;siK__%yfyY*@`$AGi&C z0bT(GxMvMxMQ{crLrW1`P=*ZtkAaPNpUq%#6r2S~`Acv;_!evcKZ4}+8wex1yue=r zRn>c-i8WzrVIVx|K?YF(J*Z94qTeV|DRHmvKe?m|{5fD|d91^VT7*h#p_HKBGtB}4y9*&=E_DhB* zw8BVnn2&dL&>K3~>-XChRMzY)Cl>C+&&JyOf-<+Op7??_zOLWPq9kMN}p5veQxl`G9MG3Z%K#CB3C8B6;(CKGZF%* zv|LFYF9x<<+k1qUWxyRF3Y0}Fa9t!fnd-FC43#Ka-gSM@jY`NZhnFid@c6i4+d?II zZ&3*kdkj^*aNNQZrr?HYL&tvwXmvFiNwzrm;On!yJY}Xwf48Alm{g~kW{dZ4^Q?Z4 u!cKUizSMY;dQ&wT&esnlhh5l&x@zm$B{Zp;WlQtnLq6)-(kRq!WxoJhB^kZ| delta 447 zcmX}oJud`N6oBC~A3F?|wI)_VF-nO7g+_>2otCI~XH{fJV#TU9HW8KTnnFS-`~bN_09C)Dp=(Z??w!Jlm2v%B>ejxs)tp-4;0*+dP;nP_I7VTr}Js2e{xBAfVv=?1RI zEOi-men0aF+tjBxgoT{Q3Wj)(5l-TiC$i4@vPNf)fos&i@Qix%59EA-G\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"