Package com.github.mafelp.discord
Class ChannelAdmin
java.lang.Object
com.github.mafelp.discord.ChannelAdmin
The class that manages the discord channels, whose messages are relayed to the
minecraft server and vise versa
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
broadcastMessage(org.bukkit.entity.Player messageAuthor, String message)
Sends an embed with the message string to all channels returned by getMessageChannels()static org.javacord.api.entity.channel.ServerTextChannel
createChannel(String name, org.javacord.api.entity.server.Server server, String topic, org.javacord.api.entity.message.embed.EmbedBuilder successEmbed, org.javacord.api.interaction.callback.InteractionImmediateResponseBuilder responder, org.javacord.api.entity.message.embed.EmbedBuilder welcomeEmbed)
Creates a channel to send the minecraft messages to.protected static List<org.javacord.api.entity.channel.Channel>
gets all the channels whose IDs were defined in the config.yml
-
Constructor Details
-
ChannelAdmin
public ChannelAdmin()
-
-
Method Details
-
getMessageChannels
gets all the channels whose IDs were defined in the config.yml- Returns:
- list of all channels of the ids
-
createChannel
public static org.javacord.api.entity.channel.ServerTextChannel createChannel(String name, org.javacord.api.entity.server.Server server, String topic, org.javacord.api.entity.message.embed.EmbedBuilder successEmbed, org.javacord.api.interaction.callback.InteractionImmediateResponseBuilder responder, org.javacord.api.entity.message.embed.EmbedBuilder welcomeEmbed) throws CompletionExceptionCreates a channel to send the minecraft messages to.- Parameters:
name
- name of the channelserver
- server on which to create the channel ontopic
- the topic the channel should havesuccessEmbed
- the embed to be sent into successChannel after completionresponder
- The slash command responder to send the success message to.welcomeEmbed
- the embed to sent to the newly created channel- Returns:
- the newly created channel
- Throws:
CompletionException
-
broadcastMessage
Sends an embed with the message string to all channels returned by getMessageChannels()- Parameters:
messageAuthor
- messageAuthor who sent the message to the minecraft chatmessage
- the message String to broadcast to the channels
-