missing argument error handling

This commit is contained in:
TheTechRobo 2021-06-18 19:11:09 -04:00
parent dffb5257f9
commit f345a5cf89
1 changed files with 7 additions and 4 deletions

11
bot.py
View File

@ -118,13 +118,16 @@ async def on_command_error(ctx, error):
await ctx.send(random.choice(potentialMessages))
print('\nSomeone tried to do a command that was on cooldown')
return
if isinstance(error, commands.MissingRequiredArgument):
await ctx.send(f"You seem to be missing a required argument \"{str(error).split(' ')[0]}\". Run `{PREFIX}help [command]` for more information.")
await ctx.send(f"_{error}_")
return
if isinstance(error, hypierror.HypixelApiDown):
await ctx.send(":warning: Oops! :warning:\nWe couldn't contact the hypixel API. Is the service down?")
return
else:
await ctx.send(error)
await ctx.send(isinstance(error,hypierror.HypixelApiDown))
raise(error)
await ctx.send(error)
await ctx.send(isinstance(error,hypierror.HypixelApiDown))
raise(error)
# }}}
# {{{ Run bot
if __name__ == "__main__":