fix
This commit is contained in:
parent
78e1ff6cb2
commit
d60430646b
|
|
@ -3,7 +3,7 @@ from base64 import b64decode
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from base58 import b58encode
|
from base58 import b58encode
|
||||||
from sqlalchemy import and_
|
from sqlalchemy import and_, desc
|
||||||
from tonsdk.boc import Cell
|
from tonsdk.boc import Cell
|
||||||
from tonsdk.utils import Address
|
from tonsdk.utils import Address
|
||||||
|
|
||||||
|
|
@ -57,14 +57,14 @@ async def indexer_loop(memory, platform_found: bool, seqno: int) -> [bool, int]:
|
||||||
session, licensed_content
|
session, licensed_content
|
||||||
)
|
)
|
||||||
|
|
||||||
for wallet_owner_connection in session.query(WalletConnection).filter_by(wallet_address=licensed_content.owner_address).all():
|
for wallet_owner_connection in session.query(WalletConnection).filter_by(wallet_address=licensed_content.owner_address).order_by(desc(WalletConnection.id)).first():
|
||||||
wallet_owner_user = wallet_owner_connection.user
|
wallet_owner_user = wallet_owner_connection.user
|
||||||
if wallet_owner_user.telegram_id:
|
if wallet_owner_user.telegram_id:
|
||||||
wallet_owner_bot = Wrapped_CBotChat(memory._client_telegram_bot, chat_id=wallet_owner_user.telegram_id, user=wallet_owner_user, db_session=session)
|
wallet_owner_bot = Wrapped_CBotChat(memory._client_telegram_bot, chat_id=wallet_owner_user.telegram_id, user=wallet_owner_user, db_session=session)
|
||||||
await wallet_owner_bot.send_message(
|
await wallet_owner_bot.send_message(
|
||||||
user.translated('p_licenseWasBought').format(
|
user.translated('p_licenseWasBought').format(
|
||||||
username=user.front_format(),
|
username=user.front_format(),
|
||||||
nft_address=f'"{new_license.onchain_address}"',
|
nft_address=f'"https://tonviewer.com/{new_license.onchain_address}"',
|
||||||
content_title=content_metadata.get('name', 'Unknown'),
|
content_title=content_metadata.get('name', 'Unknown'),
|
||||||
),
|
),
|
||||||
message_type='notification',
|
message_type='notification',
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue