Class DiscordChatMessageEvent

java.lang.Object
org.bukkit.event.Event
net.essentialsx.api.v2.events.discord.DiscordChatMessageEvent
All Implemented Interfaces:
Cancellable

public class DiscordChatMessageEvent extends Event implements Cancellable
Fired before a chat message is about to be sent to a Discord channel. Should be used to block chat messages (such as staff channels) from appearing in Discord.
  • Constructor Details

    • DiscordChatMessageEvent

      public DiscordChatMessageEvent(Player player, String message, net.essentialsx.api.v2.ChatType chatType)
      Parameters:
      player - The player which caused this event.
      message - The message of this event.
  • Method Details

    • getPlayer

      public Player getPlayer()
      The player which caused this chat message.
      Returns:
      the player who caused the event.
    • getMessage

      public String getMessage()
      The message being sent in this chat event.
      Returns:
      the message of this event.
    • setMessage

      public void setMessage(String message)
      Sets the message of this event, and thus the chat message relayed to Discord.
      Parameters:
      message - the new message.
    • getChatType

      public net.essentialsx.api.v2.ChatType getChatType()
      Type of chat of the original message.
      Returns:
      type of chat of the original message.
    • isCancelled

      public boolean isCancelled()
      Specified by:
      isCancelled in interface Cancellable
    • setCancelled

      public void setCancelled(boolean cancel)
      Specified by:
      setCancelled in interface Cancellable
    • getHandlers

      @NotNull public @NotNull HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()