Created
July 1, 2022 07:04
-
-
Save RobiMez/0c2b32716891b89352934461aa9b302d to your computer and use it in GitHub Desktop.
snippet of code that makes a pack outta quotly stickers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
await event.delete() | |
entitty = await ubi.get_entity('<id here>') | |
quotes = ubi.iter_messages(entity=entitty,from_user="@QuotLyBot") | |
count = 0 | |
stk = [] | |
async for quote in quotes: | |
if quote.message == '': | |
print(quote.stringify()) | |
if isinstance(quote.media, MessageMediaDocument): | |
# print(quote.media.document.id) | |
# print('reeee\n\n') | |
# print(quote.media.document.stringify()) | |
count += 1 | |
stk.append(quote.media) | |
mm = await ubi.send_message(entitty , f'Packing {count} stickers ...') | |
packs = 1 | |
for i in range(0, len(stk), 119): | |
# if it isnt the first pack | |
# publish it before moving into the next pack | |
if packs != 1: | |
# publish the pack | |
await ubi.send_message('@stickers', '/publish') | |
await ubi.send_message('@stickers', '/skip') | |
await ubi.send_message('@stickers', f'R6S_braindeads_part_{packs}') | |
await mm.edit(f'Pack {packs} Created.') | |
# increase the pack number | |
await ubi.send_message('@stickers', '/newpack') | |
await ubi.send_message('@stickers', f'R6S braindeads part {packs}') | |
packs += 1 | |
# iterate for 119 stickers | |
snum = 0 | |
for sk in stk[i:i+119]: | |
snum += 1 | |
await mm.edit(f'Adding sticker # {snum} to Pack {packs-1}') | |
time.sleep(1) | |
await ubi.send_message('@stickers', file=sk) | |
await ubi.send_message('@stickers', "🏳️🌈") | |
await mm.edit(f'Finished creating packs.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment