diff --git a/GeoffreyBot/geoffrey_api.py b/GeoffreyBot/geoffrey_api.py index 7113371..5bbf51f 100644 --- a/GeoffreyBot/geoffrey_api.py +++ b/GeoffreyBot/geoffrey_api.py @@ -496,8 +496,9 @@ class GeoffreyCommands(commands.Cog): message = ["{}, you have the following locations:".format(ctx.message.author.mention)] - for location in locations: - message.append(formatted_location(location)) + if locations: + for location in locations: + message.append(formatted_location(location)) await self.bot.send_list(ctx, message) @@ -507,9 +508,14 @@ 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.", + "UsernameLookupFailed": "could not find a MC user from your username. Have a mod update your nickname." } + if ctx.message.guild is None: + await ctx.send("{}, You can not register for geoffrey in the DMs!".format(ctx.message.author.mention)) + return + await run_command(ctx, self.api_url, self.api_token, "POST", "register", errors=errors, player_name=ctx.message.author.display_name, discord_uuid=ctx.message.author.id)