from pyrogram import Client
import asyncio
api_id = 12226412
api_hash = 'd5daaa12ee70b63473da315dfffab088'
chat_id = "BotFather"
app = Client("1", api_id=api_id, api_hash=api_hash, system_version="1.8.0 (324)")
async def boti_s_botfathera():
async with app:
await app.send_message(chat_id, "/start")
await asyncio.sleep(2)
await app.send_message(chat_id , '/mybots')
async for message in app.get_chat_history(chat_id, limit=5):
if message.reply_markup:
if hasattr(message.reply_markup, 'selective'):
None
else:
for row in message.reply_markup.inline_keyboard:
for button in row:
await message.click(button.text)
await asyncio.sleep(1)
async for message2 in app.get_chat_history(chat_id, limit=2):
if message2.reply_markup:
for row2 in message2.reply_markup.inline_keyboard:
for button2 in row2:
if button2.text == "API Token":
await message2.click(button2.text)
async for message3 in app.get_chat_history(chat_id, limit=2):
print(f"{message3.text}\n\n====")
app.run(boti_s_botfathera())