summaryrefslogtreecommitdiffstats
path: root/tele.py
blob: 2dc356223908fa98acf57d3f66ef4c42b45e5ca5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import aioconsole
import logging
import telethon
import credentials
import cursed

logging.basicConfig(
        format='[%(levelname) 5s/%(asctime)s] %(name)s: %(message)s',
        level=logging.WARNING
)
client = telethon.TelegramClient(
        "first_test",
        credentials.API_ID,
        credentials.API_HASH
)

@client.on(telethon.events.NewMessage)
async def new_message(event):
    messages.append(event.raw_text)
    redraw(messages)