Package com.github.mafelp.discord
Class ChannelAdmin
java.lang.Object
com.github.mafelp.discord.ChannelAdmin
public class ChannelAdmin
extends java.lang.Object
The class that manages the discord channels, whose messages are relayed to the
minecraft server and vise versa
-
Constructor Summary
Constructors Constructor Description ChannelAdmin()
-
Method Summary
Modifier and Type Method Description static void
broadcastMessage(org.bukkit.entity.Player messageAuthor, java.lang.String message)
Sends an embed with the message string to all channels returned by getMessageChannels()static org.javacord.api.entity.channel.ServerTextChannel
createChannel(java.lang.String name, org.javacord.api.entity.server.Server server, java.lang.String topic, org.javacord.api.entity.message.embed.EmbedBuilder successEmbed, org.javacord.api.entity.channel.TextChannel successChannel, org.javacord.api.entity.message.embed.EmbedBuilder welcomeEmbed)
Creates a channel to send the minecraft messages to.protected static java.util.List<org.javacord.api.entity.channel.Channel>
getMessageChannels()
gets all the channels whose IDs were defined in the config.ymlMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ChannelAdmin
public ChannelAdmin()
-
-
Method Details
-
getMessageChannels
protected static java.util.List<org.javacord.api.entity.channel.Channel> 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(java.lang.String name, org.javacord.api.entity.server.Server server, java.lang.String topic, org.javacord.api.entity.message.embed.EmbedBuilder successEmbed, org.javacord.api.entity.channel.TextChannel successChannel, org.javacord.api.entity.message.embed.EmbedBuilder welcomeEmbed) throws java.util.concurrent.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 completionsuccessChannel
- the channel successEmbed is sent towelcomeEmbed
- the embed to sent to the newly created channel- Returns:
- the newly created channel
- Throws:
java.util.concurrent.CompletionException
-
broadcastMessage
public static void broadcastMessage(org.bukkit.entity.Player messageAuthor, java.lang.String message)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
-