Class DiscordMessageBroadcast

java.lang.Object
java.lang.Thread
com.github.mafelp.discord.DiscordMessageBroadcast
All Implemented Interfaces:
Runnable

public class DiscordMessageBroadcast extends Thread
The Thread to handle sending of discord messages, to not hang the server on Message Sending.
  • Field Details

    • messageAuthor

      private final org.bukkit.entity.Player messageAuthor
      The person, who sent the message.
    • command

      private final String command
      The command that is being executed.
    • message

      private final String message
      What the player has sent.
    • broadcastType

      private final BroadcastType broadcastType
      The type of the broadcast.
  • Constructor Details

    • DiscordMessageBroadcast

      public DiscordMessageBroadcast(org.bukkit.entity.Player messageAuthor, String message)
      Constructor to define this thread as a message broadcast.
      Parameters:
      messageAuthor - The person, who sent the message.
      message - The message, the messageAuthor has sent.
    • DiscordMessageBroadcast

      public DiscordMessageBroadcast(String command)
      Constructor to define this thread as a command-info broadcast by the server.
      Parameters:
      command - The command that was executed.
    • DiscordMessageBroadcast

      public DiscordMessageBroadcast(String command, org.bukkit.entity.Player player)
      The constructor to define this thread as a command-info broadcast by a player.
      Parameters:
      command - The command the player executed.
      player - The player who executed the command.
  • Method Details

    • run

      public void run()
      The executing method to run the thread and sent all the messages.
      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread
    • sendMessages

      private void sendMessages(org.javacord.api.entity.message.embed.EmbedBuilder embed)
      Sends the give embed to all configured channels.
      Parameters:
      embed - The embed to send to the different channels.
    • messageBroadcast

      private void messageBroadcast()
      The method to send a chat message.
    • serverCommandBroadcast

      private void serverCommandBroadcast()
      The method to send a server command embed.
    • playerCommandBroadcast

      private void playerCommandBroadcast()
      The method to send a player command embed.