Added support to re-register to add a discord uuid
+ With plugin support, users can be created without discord uuids + When a player wants to use geoffrey in discord, they just need to register in discorddoc_update
parent
9104ae9bd0
commit
c6fadd4a00
|
@ -151,7 +151,13 @@ def register(player_name, discord_uuid):
|
|||
mc_uuid = grab_UUID(player_name)
|
||||
|
||||
try:
|
||||
get_player(mc_uuid=mc_uuid)
|
||||
player = get_player(mc_uuid=mc_uuid)
|
||||
|
||||
if len(discord_uuid) != 0 and len(player.discord_uuid) == 0:
|
||||
player.discord_uuid = discord_uuid
|
||||
player.save()
|
||||
return player
|
||||
else:
|
||||
raise PlayerInDBError
|
||||
except PlayerNotFound:
|
||||
player = Player.objects.create(name=player_name, mc_uuid=mc_uuid, discord_uuid=discord_uuid)
|
||||
|
|
Loading…
Reference in New Issue