mirror of
https://github.com/uhIgnacio/EmoteManager.git
synced 2024-08-15 02:23:13 +00:00
cogs/emoji: flesh out local_check and add on_command_error
This commit is contained in:
parent
c5152309a6
commit
a94dcbb2b5
1 changed files with 18 additions and 3 deletions
|
@ -31,10 +31,25 @@ class Emotes:
|
|||
self.bot.config['user_agent'] + ' '
|
||||
+ self.bot.http.user_agent
|
||||
})
|
||||
|
||||
async def __local_check(self, context):
|
||||
return (
|
||||
context.guild
|
||||
and context.author.guild_permissions.manage_emojis)
|
||||
if not context.guild:
|
||||
await context.send(
|
||||
f'{utils.SUCCESS_EMOTES[False]} Sorry, this command may only be used in a server.')
|
||||
return False
|
||||
|
||||
if not context.author.guild_permissions.manage_emojis:
|
||||
await context.send(
|
||||
f'{utils.SUCCESS_EMOTES[False]} '
|
||||
"Sorry, you don't have enough permissions to run this command. "
|
||||
'You need the Manage Emojis permission.')
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
async def on_command_error(self, context, error):
|
||||
if isinstance(error, errors.EmoteManagerError):
|
||||
await context.send(str(error))
|
||||
|
||||
@commands.command()
|
||||
async def add(self, context, *args):
|
||||
|
|
Loading…
Reference in a new issue