Now I am sending a message to the user, and if the user sends a message with four buttons, the first one is pressed and the code does not stop working (it waits for a message from the user further). How can I make the code stop after clicking on the first button?
import random
from telethon import TelegramClient, events
api_id = 109258102341
api_hash = 'k12iy5k2u43v51ui34'
client = TelegramClient('waererfer', api_id, api_hash)
@client.on(events.NewMessage(chats=('@username')))
async def normal_handler(event):
if event.message.button_count == 4:
await event.message.click(0)
client.start()
client.send_message('@username', 'Hello')
client.run_until_disconnected()