Added error handling for owner only commands

pull/8/head
sgoudham 4 years ago
parent f24bf0ecb2
commit fc9dbdfcf9

@ -346,6 +346,8 @@ async def on_command_error(ctx, args2):
await on_command_permission(ctx)
elif isinstance(args2, commands.BotMissingPermissions):
await on_bot_forbidden(ctx, args2)
elif isinstance(args2, commands.NotOwner):
await on_not_owner(ctx)
# Async def for handling command bad argument error
@ -400,6 +402,13 @@ async def on_command_missing_argument(ctx):
await ctx.send(embed=embed)
# Async def for handling permission errors
async def on_not_owner(ctx):
# Send an error message to the user saying that they don't have permission to use this command
embed = Embed(description="**❌ Owner Only Command ❌**")
await ctx.send(embed=embed)
# Run the bot, allowing it to come online
try:
client.run(API_TOKEN)

Loading…
Cancel
Save