diff --git a/log.py b/log.py index 5c216f1..ed138e1 100755 --- a/log.py +++ b/log.py @@ -5,6 +5,21 @@ from config import * client = TelegramClient('telelog', api_id, api_hash) @client.on(events.NewMessage) + +async def edit(event): + msg = event.raw_text + if event.sender_id != myid: + return + + if msg.startswith('.tl.alive'): + rpl = "Telelog alive and well!" + await event.edit(rpl) + + if msg.startswith('.tl.log'): + chat = str(msg.split()[1]) + f = open(chat) + await event.edit(f.read()) + async def log(event): if event.is_private: if event.sender_id != myid: