cogs/emoji.remove: support removing multiple emotes
This commit is contained in:
parent
69ae7f8bb4
commit
5d13b2fec6
|
@ -176,10 +176,18 @@ class Emotes:
|
||||||
reason=f'Created by {utils.format_user(self.bot, author_id)}')
|
reason=f'Created by {utils.format_user(self.bot, author_id)}')
|
||||||
|
|
||||||
@commands.command()
|
@commands.command()
|
||||||
async def remove(self, context, name):
|
async def remove(self, context, *names):
|
||||||
emote = await self.disambiguate(context, name)
|
"""Remove an emote from this server.
|
||||||
await emote.delete(reason=f'Removed by {utils.format_user(self.bot, context.author.id)}')
|
|
||||||
await context.send(f'Emote \:{emote.name}: successfully removed.')
|
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()
|
@commands.command()
|
||||||
async def rename(self, context, old_name, new_name):
|
async def rename(self, context, old_name, new_name):
|
||||||
|
|
Loading…
Reference in New Issue