hashtag notify fixes
This commit is contained in:
parent
d60430646b
commit
00afde49a5
|
|
@ -57,18 +57,21 @@ 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).order_by(desc(WalletConnection.id)).first():
|
wallet_owner_connection = session.query(WalletConnection).filter_by(
|
||||||
wallet_owner_user = wallet_owner_connection.user
|
wallet_address=licensed_content.owner_address,
|
||||||
if wallet_owner_user.telegram_id:
|
invalidated=False
|
||||||
wallet_owner_bot = Wrapped_CBotChat(memory._client_telegram_bot, chat_id=wallet_owner_user.telegram_id, user=wallet_owner_user, db_session=session)
|
).order_by(desc(WalletConnection.id)).first()
|
||||||
await wallet_owner_bot.send_message(
|
wallet_owner_user = wallet_owner_connection.user
|
||||||
user.translated('p_licenseWasBought').format(
|
if wallet_owner_user.telegram_id:
|
||||||
username=user.front_format(),
|
wallet_owner_bot = Wrapped_CBotChat(memory._client_telegram_bot, chat_id=wallet_owner_user.telegram_id, user=wallet_owner_user, db_session=session)
|
||||||
nft_address=f'"https://tonviewer.com/{new_license.onchain_address}"',
|
await wallet_owner_bot.send_message(
|
||||||
content_title=content_metadata.get('name', 'Unknown'),
|
user.translated('p_licenseWasBought').format(
|
||||||
),
|
username=user.front_format(),
|
||||||
message_type='notification',
|
nft_address=f'"https://tonviewer.com/{new_license.onchain_address}"',
|
||||||
)
|
content_title=content_metadata.get('name', 'Unknown'),
|
||||||
|
),
|
||||||
|
message_type='notification',
|
||||||
|
)
|
||||||
except BaseException as e:
|
except BaseException as e:
|
||||||
make_log("IndexerSendNewLicense", f"Error: {e}" + '\n' + traceback.format_exc(), level="error")
|
make_log("IndexerSendNewLicense", f"Error: {e}" + '\n' + traceback.format_exc(), level="error")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ class PlayerTemplates:
|
||||||
inline_keyboard_array = []
|
inline_keyboard_array = []
|
||||||
extra_buttons = []
|
extra_buttons = []
|
||||||
else:
|
else:
|
||||||
text = ' '.join([f"#{_h}" for _h in content_metadata_json.get('hashtags', [])]).strip()
|
text = content_metadata_json.get('description').strip()
|
||||||
|
|
||||||
user_wallet_address = self.user.wallet_address(self.db_session)
|
user_wallet_address = self.user.wallet_address(self.db_session)
|
||||||
have_access = (
|
have_access = (
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue