mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-12-22 00:58:50 +01:00
Add method to get all linked players in DiscordLinkService (#5896)
Co-authored-by: Josh Roy <10731363+JRoy@users.noreply.github.com>
This commit is contained in:
parent
3203e97a5e
commit
f02eeecee8
@ -2,6 +2,7 @@ package net.essentialsx.api.v2.services.discordlink;
|
||||
|
||||
import net.essentialsx.api.v2.services.discord.InteractionMember;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
@ -82,4 +83,12 @@ public interface DiscordLinkService {
|
||||
* {@link InteractionMember}, otherwise false.
|
||||
*/
|
||||
boolean unlinkAccount(final InteractionMember member);
|
||||
|
||||
/**
|
||||
* Gets a map of all linked players, where the key is the Minecraft UUID and the value is the Discord ID.
|
||||
* The returned map is immutable and cannot be modified.
|
||||
*
|
||||
* @return an immutable map of all linked players.
|
||||
*/
|
||||
Map<String, String> getAllLinkedPlayers();
|
||||
}
|
||||
|
@ -8,6 +8,7 @@ import net.essentialsx.api.v2.services.discord.InteractionMember;
|
||||
import net.essentialsx.api.v2.services.discordlink.DiscordLinkService;
|
||||
import net.essentialsx.discordlink.rolesync.RoleSyncManager;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Random;
|
||||
@ -162,4 +163,9 @@ public class AccountLinkManager implements IEssentialsModule, DiscordLinkService
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> getAllLinkedPlayers() {
|
||||
return Collections.unmodifiableMap(storage.getRawStorageMap());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user