uniborg/stdplugins/sp_h.py

40 lines
1.7 KiB
Python
Raw Normal View History

2018-09-13 20:54:57 +00:00
import asyncio
2018-08-26 21:28:26 +00:00
from telethon import events
from telethon.tl import types
2018-09-13 20:54:57 +00:00
EPIC_MEME = (
"""
"""
)
@borg.on(events.NewMessage(pattern=r"^h$"))
2018-08-26 21:28:26 +00:00
async def on_h(event):
2018-09-13 20:54:57 +00:00
message = await event.reply(
file=types.InputDocument(421851232546587302, -6059663575626880183))
async def del_filter(del_event):
if del_event.chat_id and del_event.chat_id != event.chat_id:
return False
return del_event.deleted_id == message.id
fut = borg.await_event(events.MessageDeleted, del_filter)
try:
await asyncio.wait_for(fut, timeout=5)
await event.reply(EPIC_MEME)
except asyncio.TimeoutError:
pass