Last active
April 7, 2023 09:11
-
-
Save Soheab/892f9d950dd1f5da289144a09831c9c3 to your computer and use it in GitHub Desktop.
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
# for testing: | |
# import collections | |
# emoji = collections.namedtuple("emo", ["animated"])(False) | |
emoji = ... # some (Partial)Emoji object | |
guild = ... # some Guild object | |
emojis = guild.emojis | |
total = len(guild.emojis) | |
limit = guild.emoji_limit | |
animated = sum(1 for e in emojis if e.animated) | |
regular = sum(1 for e in emojis if not e.animated) | |
total_slots = limit*2 - total | |
animated_slots = limit - animated | |
regular_slots = limit - regular | |
print(f"{total_slots=}\n{animated_slots=}\n{regular_slots=}") | |
if not total_slots: | |
print("Not slots available!") | |
if emoji.animated and not animated_slots: | |
print("No slots available for animated emojis") | |
elif not emoji.animated and not regular_slots: | |
print("No slots available for regular emojis") | |
else: | |
what = f"{animated_slots} animated" if emoji.animated else f"{regular_slots} regular" | |
print(f"fine to add, {what} slots available") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment