This commit is contained in:
user 2024-04-05 21:59:08 +03:00
parent 6405baf251
commit 8f6e60f650
4 changed files with 70 additions and 13 deletions

View File

@ -146,6 +146,7 @@ class Wrapped_CBotChat(T, PlayerTemplates):
r = await self._bot.send_photo( r = await self._bot.send_photo(
self._chat_id, self._chat_id,
file_id, file_id,
parse_mode='html',
**kwargs **kwargs
) )
return await self.return_result(r, message_type=message_type, message_meta=message_meta, content_id=content_id) 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( r = await self._bot.send_document(
self._chat_id, self._chat_id,
file_id, file_id,
parse_mode='html',
**kwargs **kwargs
) )
return await self.return_result(r, message_type=message_type, message_meta=message_meta, content_id=content_id) 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( r = await self._bot.send_video(
self._chat_id, self._chat_id,
file_id, file_id,
parse_mode='html',
**kwargs **kwargs
) )
return await self.return_result(r, message_type=message_type, message_meta=message_meta, content_id=content_id) 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( r = await self._bot.send_audio(
self._chat_id, self._chat_id,
file_id, file_id,
parse_mode='html',
**kwargs **kwargs
) )
return await self.return_result(r, message_type=message_type, message_meta=message_meta, content_id=content_id) return await self.return_result(r, message_type=message_type, message_meta=message_meta, content_id=content_id)

View File

@ -21,15 +21,16 @@ class WalletMixin:
page_id = -1 page_id = -1
page_size = 100 page_size = 100
have_next_page = True have_next_page = True
user_wallet_address = self.wallet_address(db_session)
while have_next_page: while have_next_page:
page_id += 1 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: if len(nfts_list) >= page_size:
have_next_page = True have_next_page = True
for nft_item in nfts_list: for nft_item in nfts_list:
try: 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) item_address = Address(nft_item['address']).to_string(1, 1, 1)
owner_address = Address(nft_item['owner_address']).to_string(1, 1, 1) owner_address = Address(nft_item['owner_address']).to_string(1, 1, 1)

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \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" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -18,7 +18,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
#: app/bot/routers/home.py:16 app/bot/routers/home.py:15 #: 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" msgid "home_menu"
msgstr "" msgstr ""
"Hi, <b>{name}</b>!\n" "Hi, <b>{name}</b>!\n"
@ -28,14 +28,17 @@ msgstr ""
"You logged as <code>{wallet_address}</code>" "You logged as <code>{wallet_address}</code>"
#: app/bot/routers/home.py:20 app/client_bot/routers/home.py:20 #: app/bot/routers/home.py:20 app/client_bot/routers/home.py:20
#: app/client_bot/routers/home.py:22
msgid "ownedContent_button" msgid "ownedContent_button"
msgstr "📊 My content" msgstr "📊 My content"
#: app/bot/routers/home.py:24 app/client_bot/routers/home.py:24 #: app/bot/routers/home.py:24 app/client_bot/routers/home.py:24
#: app/client_bot/routers/home.py:26
msgid "disconnectWallet_button" msgid "disconnectWallet_button"
msgstr "🔌 Disconnect wallet" msgstr "🔌 Disconnect wallet"
#: app/bot/routers/home.py:35 app/client_bot/routers/home.py:35 #: app/bot/routers/home.py:35 app/client_bot/routers/home.py:35
#: app/client_bot/routers/home.py:37
msgid "connectWalletsList_menu" msgid "connectWalletsList_menu"
msgstr "" msgstr ""
"<b>/</b> Welcome to MY [🔴]\n" "<b>/</b> Welcome to MY [🔴]\n"
@ -43,11 +46,12 @@ msgstr ""
"Please select the wallet you want to connect to the bot:" "Please select the wallet you want to connect to the bot:"
#: app/bot/routers/index.py:23 app/bot/routers/index.py:22 #: 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" msgid "error_unknownCommand"
msgstr "Unknown command, please try again or press /start" 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:16 app/bot/routers/content.py:12
#: app/bot/routers/content.py:21
msgid "ownedContent_menu" msgid "ownedContent_menu"
msgstr "" msgstr ""
"📊 <b>My content</b>\n" "📊 <b>My content</b>\n"
@ -55,23 +59,25 @@ msgstr ""
"Here you can see the list of your content." "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:21 app/bot/routers/content.py:17
#: app/bot/routers/content.py:47
msgid "webApp_uploadContent_button" msgid "webApp_uploadContent_button"
msgstr "📤 Upload content" msgstr "📤 Upload content"
#: app/bot/routers/content.py:27 app/bot/routers/content.py:23 #: 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" msgid "back_button"
msgstr "◀️ Back" msgstr "◀️ Back"
#: app/bot/routers/tonconnect.py:80 #: app/bot/routers/tonconnect.py:80 app/client_bot/routers/tonconnect.py:82
msgid "tonconnectInit_menu" msgid "tonconnectInit_menu"
msgstr "🔌 Press the button below to connect your wallet" 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: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" msgid "p_successConnectWallet"
msgstr "✅ Wallet connected successfully" 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" msgid "p_tonconnectTransactionRequested"
msgstr "" msgstr ""
"⏳ <b>Transaction requested</b>\n" "⏳ <b>Transaction requested</b>\n"
@ -79,22 +85,68 @@ msgstr ""
"👉 Please confirm the transaction in your wallet" "👉 Please confirm the transaction in your wallet"
#: app/api/routes/_blockchain.py:146 #: app/api/routes/_blockchain.py:146
#: app/core/models/_telegram/templates/player.py:108
#: app/api/routes/_blockchain.py:145
msgid "gotoWallet_button" msgid "gotoWallet_button"
msgstr "Open wallet" msgstr "Open wallet"
#: app/api/routes/_blockchain.py:150 app/bot/routers/tonconnect.py:90 #: 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: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" msgid "home_button"
msgstr "◀️ Back" msgstr "◀️ Back"
#: app/bot/routers/tonconnect.py:86 #: app/bot/routers/tonconnect.py:86 app/client_bot/routers/tonconnect.py:88
msgid "tonconnectOpenWallet_button" msgid "tonconnectOpenWallet_button"
msgstr "[Connect wallet]" msgstr "[Connect wallet]"
#: app/core/background/indexer_service.py:134 #: app/core/background/indexer_service.py:134
#: app/core/background/indexer_service.py:149
msgid "p_contentWasIndexed" msgid "p_contentWasIndexed"
msgstr "🎉 <b>Your new content was uploaded successfully!</b>" msgstr ""
"\n\n" "🎉 <b>Your new content was uploaded successfully!</b>\n"
"🔗 <a href=\"https://tonviewer.com/{item_address}\">{item_address}</a> on the blockchain" "\n"
"\n\n" "🔗 <a href=\"https://tonviewer.com/{item_address}\">{item_address}</a> on "
"the blockchain\n"
"\n"
"Now you can manage it in <b>My content</b> section" "Now you can manage it in <b>My content</b> 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 "⚠️ <b>Unsupported content</b>"
#: 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 "<i>It's a preview version of the track. To listen to the full version, "
"you need to buy a license.</i>"
#: 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"