client = TelegramClient('session_name', api_id, api_hash)
client = TelegramClient('session_name', api_id, api_hash, system_version="4.16.30-vxCUSTOM")
from telethon import TelegramClient, events
# Укажите свои авторизационные данные
api_id = 'YOUR_API_ID'
api_hash = 'YOUR_API_HASH'
client = TelegramClient('sessaion_name', api_id, api_hash)
@client.on(events.NewMessage(from_users='@user_name_bot'))
async def handler(event):
if event.message.reply_markup:
for button in event.message.reply_markup.rows:
for b in button.buttons:
if b.text == 'TEXT_BUTTON':
print('Mini App URL:', b.url)
async def main():
await client.start()
print("Client created.")
await client.run_until_disconnected()
client.loop.run_until_complete(main())
async def qq(msg: types.Message):
await msg.answer(f"@{msg.from_user.first_name}")