1
0
Fork 0
mirror of https://github.com/uhIgnacio/EmoteManager.git synced 2024-08-15 02:23:13 +00:00

add "list static" and "list animated"

This commit is contained in:
bmintz 2018-11-09 18:31:32 +00:00
parent cfb51bf8b4
commit b48ced2508

View file

@ -205,13 +205,26 @@ class Emotes:
await context.send(f'Emote \:{old_name}: successfully renamed to \:{new_name}:') await context.send(f'Emote \:{old_name}: successfully renamed to \:{new_name}:')
@commands.command() @commands.command()
async def list(self, context): async def list(self, context, animated=''):
"""A list of all emotes on this server. """A list of all emotes on this server.
The list shows each emote and its raw form. The list shows each emote and its raw form.
If "animated" is provided, only show animated emotes.
If "static" is provided, only show static emotes.
Otherwise, show all emotes.
""" """
animated = animated.lower()
if animated == 'animated':
pred = lambda e: e.animated
elif animated == 'static':
pred = lambda e: not e.animated
else:
pred = lambda e: True
emotes = sorted( emotes = sorted(
filter(lambda e: e.require_colons, context.guild.emojis), filter(pred, context.guild.emojis),
key=lambda e: e.name.lower()) key=lambda e: e.name.lower())
processed = [] processed = []