mirror of
https://github.com/uhIgnacio/EmoteManager.git
synced 2024-08-15 02:23:13 +00:00
cogs/emoji.remove: support removing multiple emotes
This commit is contained in:
parent
69ae7f8bb4
commit
5d13b2fec6
1 changed files with 12 additions and 4 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue