register now checks if a user with a nickname matching to the player is already on the server
parent
03f5c87334
commit
fdb51af5c2
|
@ -73,6 +73,12 @@ class Discord(discord.Client):
|
|||
nickname = player.username
|
||||
|
||||
if not player.is_banned:
|
||||
member = discord.utils.get(message.server.members, display_name=nickname)
|
||||
|
||||
if member is not None and member is not message.author:
|
||||
msg = "{0}, a member with that name is already exists, please contact the staff".format(message.author.mention)
|
||||
yield from self.discord_message(message.channel, msg)
|
||||
else:
|
||||
role = discord.utils.get(message.server.roles, name=self.member_role)
|
||||
msg = "Successfully added {0} as a {1}.".format(nickname, self.member_role)
|
||||
|
||||
|
|
Loading…
Reference in New Issue