Class DiscordPlatform
java.lang.Object
net.lucypoulton.squirtgun.discord.DiscordPlatform
- All Implemented Interfaces:
net.lucypoulton.squirtgun.platform.Platform
- Direct Known Subclasses:
HostedDiscordPlatform
,StandaloneDiscordPlatform
public abstract class DiscordPlatform
extends Object
implements net.lucypoulton.squirtgun.platform.Platform
A Platform implementation for a JDA instance.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DiscordPlatform(net.dv8tion.jda.api.JDA jda, String commandPrefix)
-
Method Summary
Modifier and TypeMethodDescriptionnet.lucypoulton.squirtgun.platform.AuthMode
Authentication mode is not relevant to Discord so always returns offlineList<net.lucypoulton.squirtgun.platform.audience.SquirtgunPlayer>
abstract @Nullable DiscordUser
Gets a DiscordUser from a user's Minecraft username.abstract @Nullable DiscordUser
Gets a DiscordUser from a user's Minecraft UUID.net.dv8tion.jda.api.JDA
jda()
void
log(net.kyori.adventure.text.Component component)
name()
void
registerCommand(net.lucypoulton.squirtgun.command.node.CommandNode<?> node, net.lucypoulton.squirtgun.format.FormatProvider provider)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.lucypoulton.squirtgun.platform.Platform
getConfigPath, getConsole, getEventManager, getLogger, getTaskScheduler
-
Constructor Details
-
DiscordPlatform
- Parameters:
jda
- the JDA instance to use to provide bot functionalitycommandPrefix
- the prefix to use for commands
-
-
Method Details
-
jda
public net.dv8tion.jda.api.JDA jda() -
name
- Specified by:
name
in interfacenet.lucypoulton.squirtgun.platform.Platform
-
getAuthMode
public net.lucypoulton.squirtgun.platform.AuthMode getAuthMode()Authentication mode is not relevant to Discord so always returns offline- Specified by:
getAuthMode
in interfacenet.lucypoulton.squirtgun.platform.Platform
- Returns:
AuthMode.OFFLINE
-
getPlayer
Gets a DiscordUser from a user's Minecraft UUID.- Specified by:
getPlayer
in interfacenet.lucypoulton.squirtgun.platform.Platform
- Parameters:
uuid
- the UUID of the player to get- Returns:
- a SquirtgunPlayer if the user is known and has a linked Discord account, otherwise null
-
getPlayer
Gets a DiscordUser from a user's Minecraft username.- Specified by:
getPlayer
in interfacenet.lucypoulton.squirtgun.platform.Platform
- Parameters:
name
- the name of the player to get- Returns:
- a SquirtgunPlayer if the user is known has a linked Discord account, otherwise null
-
getOnlinePlayers
- Specified by:
getOnlinePlayers
in interfacenet.lucypoulton.squirtgun.platform.Platform
- Returns:
- an empty list - this method is not applicable to Discord
-
registerCommand
public void registerCommand(net.lucypoulton.squirtgun.command.node.CommandNode<?> node, net.lucypoulton.squirtgun.format.FormatProvider provider)- Specified by:
registerCommand
in interfacenet.lucypoulton.squirtgun.platform.Platform
-
log
public void log(net.kyori.adventure.text.Component component)- Specified by:
log
in interfacenet.lucypoulton.squirtgun.platform.Platform
-
audiences
-