edit player ui

This commit is contained in:
user 2025-05-03 16:00:30 +03:00
parent 3d9e7c7966
commit 11e2645aa9
2 changed files with 17 additions and 17 deletions

View File

@ -76,7 +76,7 @@ async def indexer_loop(memory, platform_found: bool, seqno: int) -> [bool, int]:
).order_by(desc(WalletConnection.id)).first()
wallet_owner_user = wallet_owner_connection.user
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._telegram_bot, chat_id=wallet_owner_user.telegram_id, user=wallet_owner_user, db_session=session)
await wallet_owner_bot.send_message(
user.translated('p_licenseWasBought').format(
username=user.front_format(),

View File

@ -132,22 +132,22 @@ class PlayerTemplates:
# Add thumbnail if cover content is available
template_kwargs['thumbnail'] = URLInputFile(cover_content.web_url)
if self.bot_id == 1:
if self.bot_id == 1: pass
# Buttons for sharing and opening in app
inline_keyboard_array.append([
{
'text': self.user.translated('shareVideo_button'),
'switch_inline_query': f"Q{user_existing_license.onchain_address}" if user_existing_license else f"C{content.cid.serialize_v2()}",
},
{
'text': self.user.translated('shareLink_button'),
'url': f"https://t.me/share/url?text={urllib.parse.quote(content_share_link['text'])}&url={urllib.parse.quote(content_share_link['url'])}"
}
])
inline_keyboard_array.append([{
'text': self.user.translated('openTrackInApp_button'),
'url': f"https://t.me/{CLIENT_TELEGRAM_BOT_USERNAME}/content?startapp={content.cid.serialize_v2()}"
}])
# inline_keyboard_array.append([
# {
# 'text': self.user.translated('shareVideo_button'),
# 'switch_inline_query': f"Q{user_existing_license.onchain_address}" if user_existing_license else f"C{content.cid.serialize_v2()}",
# },
# {
# 'text': self.user.translated('shareLink_button'),
# 'url': f"https://t.me/share/url?text={urllib.parse.quote(content_share_link['text'])}&url={urllib.parse.quote(content_share_link['url'])}"
# }
# ])
# inline_keyboard_array.append([{
# 'text': self.user.translated('openTrackInApp_button'),
# 'url': f"https://t.me/{CLIENT_TELEGRAM_BOT_USERNAME}/content?startapp={content.cid.serialize_v2()}"
# }])
else:
# Buttons for viewing as a client and opening contract
inline_keyboard_array.append([{
@ -203,7 +203,7 @@ class PlayerTemplates:
await self.delete_message(kmsg.message_id)
r = await tg_process_template(
self, text, message_id=message_id, **template_kwargs,
self, text + '\n\n' + f"""<code><a href="https://t.me/MY_Web3Bot/content?startapp={content.cid.serialize_v2()}">🌐 Открыть на MY</a></code>""", message_id=message_id, **template_kwargs,
keyboard=get_inline_keyboard([*inline_keyboard_array, *extra_buttons]) if inline_keyboard_array else None,
message_type=f'content/{content_type}',
message_meta={'content_sha256': content_meta['hash']} if local_content else {},