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.yml

    Methods 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.CompletionException
      Creates a channel to send the minecraft messages to.
      Parameters:
      name - name of the channel
      server - server on which to create the channel on
      topic - the topic the channel should have
      successEmbed - the embed to be sent into successChannel after completion
      successChannel - the channel successEmbed is sent to
      welcomeEmbed - 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 chat
      message - the message String to broadcast to the channels