Fixed missing parameters not being handled on on_command_error

master
Joey Hines 2019-05-14 08:02:14 -05:00
parent 21eb7f513c
commit 3911daa430
2 changed files with 11 additions and 3 deletions

View File

@ -88,6 +88,14 @@ class GeoffreyBot(commands.Bot):
elif hasattr(error, "original") and isinstance(error.original, request_exception.ConnectionError):
error_str = "Unable to connect to the database. Hopefully someone is working on this..."
await self.send_error_message("Can't connect to the GeoffreyAPI, is it offline?")
elif hasattr(error, "original"):
e = error.original.args[0]
if e == "TypeError":
error_str = "Well bud, you got this far. Good job! But you still h*cked up the syntax:"
for line in self.help_dict[ctx.command.name]:
error_str += line
if error_str is '':
await self.send_error_message(

View File

@ -353,7 +353,7 @@ class GeoffreyCommands(commands.Cog):
"ItemNotFound": "your farm does not produce **{}**. Try again buddy boy.".format(resource_name)
}
farm = await run_command(ctx, self.base_url, self.api_token, "POST", "delete_item", errors=errors,
farm = await run_command(ctx, self.base_url, self.api_token, "POST", "delete_resource", errors=errors,
resource=resource_name,
farm_name=farm_name, discord_uuid=ctx.message.author.id)
@ -413,7 +413,7 @@ class GeoffreyCommands(commands.Cog):
"InvalidLookUpError": "{} is not a valid tunnel direction ya gub".format(new_tunnel_direction)
}
location = run_command(ctx, self.base_url, self.api_token, "POST", "edit_tunnel", errors=errors,
location = await run_command(ctx, self.base_url, self.api_token, "POST", "edit_tunnel", errors=errors,
tunnel_direction=new_tunnel_direction, tunnel_number=new_tunnel_number,
loc_name=loc_name, discord_uuid=ctx.message.author.id)
@ -537,7 +537,7 @@ class GeoffreyCommands(commands.Cog):
{}register
"""
errors = {
"PlayerinDBError": "you are already registered with Geoffrey you ding dong."
"PlayerInDBError": "you are already registered with Geoffrey you ding dong."
}
await run_command(ctx, self.base_url, self.api_token, "POST", "register", errors=errors,