Class ChannelAdmin

java.lang.Object
com.github.mafelp.discord.ChannelAdmin

public class ChannelAdmin extends Object
The class that manages the discord channels, whose messages are relayed to the minecraft server and vise versa
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static 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

    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 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(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 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
      responder - 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

      public static void broadcastMessage(org.bukkit.entity.Player messageAuthor, 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