diff --git a/geoffrey/Commands.py b/geoffrey/Commands.py index 3a78fce..0e1dfb2 100644 --- a/geoffrey/Commands.py +++ b/geoffrey/Commands.py @@ -241,8 +241,6 @@ class Commands: except DataError: session.rollback() raise DatabaseValueError - except IndexError: - raise LocationLookUpError finally: session.close() @@ -253,7 +251,7 @@ class Commands: try: player = self.get_player(session, discord_uuid=discord_uuid, mc_uuid=mc_uuid) - location = self.interface.find_location_by_name_and_owner(session, player, loc_name)[0] + location = self.get_location(session, player, loc_name) if location.tunnel is not None: location.tunnel.tunnel_direction = TunnelDirection.str_to_tunnel_dir(tunnel_direction) diff --git a/geoffrey/cogs/Delete_Commands.py b/geoffrey/cogs/Delete_Commands.py index 3cb4044..8f2b2fd 100644 --- a/geoffrey/cogs/Delete_Commands.py +++ b/geoffrey/cogs/Delete_Commands.py @@ -47,11 +47,10 @@ class Delete_Commands: await ctx.send('{}, **{}** has been removed from the inventory of **{}**.'. format(ctx.message.author.mention, item, shop_name)) + except LocationLookUpError: + await ctx.send('{}, you do not have a shop called **{}**.'.format(ctx.message.author.mention, shop)) except NoLocationsInDatabase: - if shop is None: - await ctx.send('{}, you do have any shops in the database.'.format(ctx.message.author.mention)) - else: - await ctx.send('{}, you do not have a shop called **{}**.'.format(ctx.message.author.mention, shop)) + await ctx.send('{}, you do have any shops in the database.'.format(ctx.message.author.mention)) except EntryNameNotUniqueError: await ctx.send('{}, you have more than one shop in the database, please specify a shop name.' .format(ctx.message.author.mention))