pattern=r"/start"))
async def h(event):
m = event.chat.id
await event.send_message(m,f"hi")
Do I need to put it run_until_disconnected()?
obviously. without run_until_disconnected it won't listen for updates
Put it at the end of the code?
ConnectionError('Cannot send requests while disconnected')
remove the with app: and de-indent everything
Good. There is no error, but the bot is not working
me code from telethon.sync import TelegramClient de1 = ### api id de2 = "###" api hash de3 = "###" token app = TelegramClient('bot', de1, de2).start(bot_token=de3) @app.on( events.NewMessage( outgoing=True, pattern=r"/start")) async def y(event): m = event.chat.id await event.send_message(m,f"hi .") print("Run") app.run_until_disconnected()
don't use telethon.sync
What do I use?
just telethon..
done, but does not work
is it a bot or a user that you are running your script on
do you know what outgoing=True does?
instead outgoing correct?
Обсуждают сегодня