Add interactive features
This commit is contained in:
parent
1f1da3ee5d
commit
116a6d7deb
15
log.py
15
log.py
@ -5,6 +5,21 @@ from config import *
|
|||||||
client = TelegramClient('telelog', api_id, api_hash)
|
client = TelegramClient('telelog', api_id, api_hash)
|
||||||
|
|
||||||
@client.on(events.NewMessage)
|
@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):
|
async def log(event):
|
||||||
if event.is_private:
|
if event.is_private:
|
||||||
if event.sender_id != myid:
|
if event.sender_id != myid:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user