From 5d13b2fec6f8e7547e2224013e61691ede74cb6b Mon Sep 17 00:00:00 2001 From: bmintz Date: Mon, 30 Jul 2018 00:58:03 -0500 Subject: [PATCH] cogs/emoji.remove: support removing multiple emotes --- cogs/emoji.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cogs/emoji.py b/cogs/emoji.py index d2c8238..7c17c8d 100644 --- a/cogs/emoji.py +++ b/cogs/emoji.py @@ -176,10 +176,18 @@ class Emotes: reason=f'Created by {utils.format_user(self.bot, author_id)}') @commands.command() - async def remove(self, context, name): - emote = await self.disambiguate(context, name) - await emote.delete(reason=f'Removed by {utils.format_user(self.bot, context.author.id)}') - await context.send(f'Emote \:{emote.name}: successfully removed.') + async def remove(self, context, *names): + """Remove an emote from this server. + + names: the names of one or more emotes you'd like to remove. + """ + if len(names) == 1: + emote = await self.disambiguate(context, names[0]) + await emote.delete(reason=f'Removed by {utils.format_user(self.bot, context.author.id)}') + await context.send(f'Emote \:{emote.name}: successfully removed.') + else: + for name in names: + await context.invoke(self.remove, name) @commands.command() async def rename(self, context, old_name, new_name):