diff --git a/stdplugins/randomsticker.py b/stdplugins/randomsticker.py new file mode 100644 index 0000000..2aa47e5 --- /dev/null +++ b/stdplugins/randomsticker.py @@ -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 +}) \ No newline at end of file