So I'm trying to make a /link command where you can link your discord account to your minecraft account.
Code: ```
define new bot named "Bot":
token: ""
intents: default intents
policy: all
auto reconnect: true
compression: none
discord command link [<text>]:
prefixes: !
trigger:
if arg-1 is not set:
if {_discord.%event-member%.linked} is false
reply with "Linked with ..."
set {_discord.%event-member%.linked} to true
set {_discord.%event-member%.account} to none
else if {_discord.%event-member%.linked} is true:
reply with "You are already linked to %{_discord.%event-member%.account}%!"
command /link:
trigger:
if {_minecraft.%player's uuid%.linked} is true:
send "&4You are already linked to {_minecraft.%player's uuid%.account}"
else if {_minecraft.%player's uuid%.linked} is false:
while true:
set {_code} to "%random integer between 0 and 9%%random integer between 0 and 9%%random integer between 0 and 9%%random integer between 0 and 9%%random integer between 0 and 9%"
if {_code.list} contains {_code}:
send "&bYour personal code is &a%{_code}%&b. Go into discord and run !link <code> to link your account. &4Do not show this code to anyone"
add "%{_code}%:%player's display name%" to {_code.data}