diff --git a/stdplugins/sp_h.py b/stdplugins/sp_h.py index 934c94b..bdee5a0 100644 --- a/stdplugins/sp_h.py +++ b/stdplugins/sp_h.py @@ -1,8 +1,39 @@ +import asyncio from telethon import events from telethon.tl import types -@borg.on(events.NewMessage(pattern=r"^h$", outgoing=False)) +EPIC_MEME = ( +""" +⢠⠤⢠⢄⠠⡤⢀⠤⠀⠀⠀⠀⢀⣔⢔⢔⢕⢔⢕⢔⢐⢀⠀⠀⠀⠀⠀⠀ +⠸⠥⠸⠁⠠⠧⠘⠤⠀⠀⠀⣐⢗⢕⢗⢕⢕⢕⢕⢔⢑⢐⢀⠀⠀⠀⠀⠀ +⢰⠑⢱⢸⠭⢰⠑⢱⢸⠭⢐⣟⣗⣕⢗⣗⢑⢕⢑⢕⢑⠐⢑⢐⢐⢐⢀⠀ +⢨⢄⢨⢨⢩⢌⢠⠬⢨⠉⢐⣟⢗⢕⢑⣿⣷⣕⣑⠕⢑⢐⣗⠐⢐⢐⢐⢐ +⠸⠜⠘⠜⠸⠜⠸⠥⠨⢀⢐⢑⢕⢕⢑⢛⣿⣿⣷⣔⣴⡟⠓⠀⢀⢔⢑⠑ +⠀⠀⠀⠀⠀⠀⠀⠀⢐⢗⢑⠐⠐⢷⣷⣷⣿⣿⣿⣿⣿⢕⢐⢔⢑⢔⠁⠀ +⠀⠀⠀⠀⠀⠀⠀⠰⢗⢕⢗⢕⢕⢔⠙⢟⢿⣕⣷⣟⣗⣔⠀⠀⠀⠀⠀⠀ +⠀⠀⠀⠀⠀⠘⢶⠄⠀⠐⠁⠐⠁⠀⠀⢀⣐⣖⢷⣟⣷⣿⣷⣔⣀⠀⠀⠀ +⠀⠀⠀⠀⠀⠀⢘⣗⣴⣴⠀⠀⠀⢀⣴⣿⣿⢟⢗⢛⣿⣟⣟⣟⣿⣟⣗⠀ +⠀⠀⠀⠀⠀⠀⢐⣿⣿⣿⡇⠀⢐⣿⣿⣟⣗⢐⢐⣔⣿⣗⣷⣟⣿⣟⣿⣗ +⠀⠀⠀⠀⠀⠀⢰⣿⣿⣟⣁⢐⢿⣟⣿⣿⣗⠐⢐⣟⣿⣟⣟⣟⣷⣟⣿⣗ +⠀⠀⠀⠀⠀⠀⢙⣟⣿⣿⣷⣗⣖⣿⣿⣟⢑⠐⢐⣟⣗⣟⣗⣗⢗⠟⢓⣑ +⠀⠀⠀⠀⠀⠀⠐⠑⠛⠛⠛⠑⠓⠙⠛⠓⠁⠐⠐⠛⠓⠛⠓⠓⠑⠒⠓⠛ +""" +) + +@borg.on(events.NewMessage(pattern=r"^h$")) async def on_h(event): - await borg.send_message(await event.get_input_chat(), '', - file=types.InputDocument(421851232546587302, -6059663575626880183), - reply_to=event.message.id) + 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 +