Fixed link not sending code

This commit is contained in:
Teriuihi 2022-03-03 02:33:38 +01:00
parent ca303d267b
commit 56313ef3f9

View File

@ -54,12 +54,13 @@ public class Link implements SubCommand {
player.sendMessage(miniMessage.parse(Config.ALREADY_LINKED_ACCOUNTS));
return;
}
if (DiscordLink.getPlugin().getCache().getCode(player.getUniqueId()) != null) {
player.sendMessage(miniMessage.parse(Config.ALREADY_GOT_CODE));
String authCode = DiscordLink.getPlugin().getCache().getCode(player.getUniqueId());
if (authCode != null) {
player.sendMessage(miniMessage.parse(Config.ALREADY_GOT_CODE, Template.of("code", authCode)));
return;
}
String authCode = Utilities.getAuthKey();
authCode = Utilities.getAuthKey();
player.sendMessage(miniMessage.parse(Config.GIVE_CODE, Template.of("code", authCode)));
DiscordLink.getPlugin().getCache()