Fixed error message in the delete command and added multiple owner formatting

master
Joey Hines 2019-02-02 09:37:45 -06:00
parent a9fb0b1ce9
commit 0593318df5
2 changed files with 15 additions and 10 deletions

View File

@ -1,4 +1,3 @@
def formatted_item_listing(item):
return "{} {} for {}D".format(item["amount"], item["item_name"], item["price"])
@ -9,8 +8,8 @@ def formatted_location(location):
else:
tunnel = ""
return '**{}** @ **{}** {}Owner(s): **{}**'.format(location["name"], formatted_position(location), tunnel,
formatted_owners(location))
return '**{}** @ **{}** {}{}'.format(location["name"], formatted_position(location), tunnel,
formatted_owners(location))
def formatted_tunnel(tunnel):
@ -34,10 +33,15 @@ def formatted_owners(location):
if "owner" in location:
if len(location["owner"]) == 0:
owner_list = location["owner"][0]["name"]
owner_list = 'Owner: **{}**'
owner_list = owner_list.format(location["owner"][0]["name"])
else:
owner_list = location["owner"][0]["name"]
for owner in location["owner"][1:]:
owner_list += ", " + owner["name"]
owner_list = 'Owners: **{}**'
owners = location["owner"][0]["name"]
for owner in location["owner"][1:3]:
owners += ", " + owner["name"]
owner_list = owner_list.format(owners)
return owner_list

View File

@ -161,12 +161,13 @@ class GeoffreyCommands:
location = run_command(self.base_url, self.api_token, "POST", "delete", name=name,
discord_uuid=ctx.message.author.id)
await ctx.send("{}, **{}** has been deleted from Geoffrey, good riddance.".format(ctx.message.author.mention,
location))
await ctx.send("{}, **{}** has been deleted from Geoffrey, good riddance.".format(ctx.message.author.mention
, location))
except Exception as e:
error_list = [
{"error": "LocationLookUpError",
"message": "{}, you do not have a location by the name you ding dong goober."}
"message": "{}, you do not have a location by the name you ding dong goober.".format(
ctx.message.author)}
]
msg = check_error(e, error_list)