from telethon import TelegramClient
from telethon import events
import asyncio

import time

api_id = 1054981
api_hash = '341e29114e1bb38d1fda9f1a22b59b28'

client = None
with TelegramClient('a', api_id, api_hash) as client:

    #client = TelegramClient('a', api_id, api_hash)

    @client.on(events.NewMessage)
    async def new_message_handler(event):
        print(event)
        msg = await event.reply('.')
        await msg.delete()

    async def main():
        pass#await bot.send_message(, 'hello')

    loop = asyncio.get_event_loop()
    loop.create_task(main())

    print('bot started')
    client.run_until_disconnected()
Edit
Pub: 30 May 2021 12:29 UTC
Views: 26