Fixed issue where users could register in PMs and with `me`

master
Joey Hines 2019-09-29 07:47:45 -05:00
parent 79a5efa984
commit 6a45fe217a
1 changed files with 9 additions and 3 deletions

View File

@ -496,8 +496,9 @@ class GeoffreyCommands(commands.Cog):
message = ["{}, you have the following locations:".format(ctx.message.author.mention)] message = ["{}, you have the following locations:".format(ctx.message.author.mention)]
for location in locations: if locations:
message.append(formatted_location(location)) for location in locations:
message.append(formatted_location(location))
await self.bot.send_list(ctx, message) await self.bot.send_list(ctx, message)
@ -507,9 +508,14 @@ class GeoffreyCommands(commands.Cog):
{}register {}register
""" """
errors = { 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, await run_command(ctx, self.api_url, self.api_token, "POST", "register", errors=errors,
player_name=ctx.message.author.display_name, player_name=ctx.message.author.display_name,
discord_uuid=ctx.message.author.id) discord_uuid=ctx.message.author.id)