Dab *has* to be a standard plugin

master
Lonami 2019-06-08 10:15:51 +02:00
parent 1dd6e63d6a
commit 6d67ebad06
1 changed files with 39 additions and 0 deletions

View File

@ -0,0 +1,39 @@
import random
from telethon import events, types, functions, utils
def choser(cmd, pack, blacklist={}):
docs = None
@borg.on(events.NewMessage(pattern=rf'\.{cmd}', outgoing=True))
async def handler(event):
await event.delete()
nonlocal docs
if docs is None:
docs = [
utils.get_input_document(x)
for x in (await borg(functions.messages.GetStickerSetRequest(types.InputStickerSetShortName(pack)))).documents
if x.id not in blacklist
]
await event.respond(file=random.choice(docs))
choser('brain', 'supermind')
choser('dab', 'DabOnHaters', {
1653974154589768377,
1653974154589768312,
1653974154589767857,
1653974154589768311,
1653974154589767816,
1653974154589767939,
1653974154589767944,
1653974154589767912,
1653974154589767911,
1653974154589767910,
1653974154589767909,
1653974154589767863,
1653974154589767852,
1653974154589768677
})