summaryrefslogtreecommitdiffstats
path: root/tele.py
blob: c7d980b71b8a8d36a471f05754916ded5fc30d3f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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()

if __name__ == "__main__":
    client.start()