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.config['user_agent'] + ' '
|
||||||
+ self.bot.http.user_agent
|
+ self.bot.http.user_agent
|
||||||
})
|
})
|
||||||
|
|
||||||
async def __local_check(self, context):
|
async def __local_check(self, context):
|
||||||
return (
|
if not context.guild:
|
||||||
context.guild
|
await context.send(
|
||||||
and context.author.guild_permissions.manage_emojis)
|
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()
|
@commands.command()
|
||||||
async def add(self, context, *args):
|
async def add(self, context, *args):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue