Class DiscordRelayEvent

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

public class DiscordRelayEvent extends Event implements Cancellable
Fired before a message is relayed to Minecraft.

Note: This event has no guarantee of the thread it is fired on, please use Event.isAsynchronous()} to see if this event is off the main Bukkit thread.

  • Constructor Details

    • DiscordRelayEvent

      public DiscordRelayEvent(InteractionMember member, InteractionChannel channel, List<String> groupNames, String rawMessage, String formattedMessage, List<net.ess3.api.IUser> viewers)
      Parameters:
      member - The member that sent the message.
      channel - The channel the message was sent in.
      groupNames - The message type keys which will be used to determine which player group the message should be sent to.
      rawMessage - The raw message sent from Discord.
      formattedMessage - The formatted message that will be sent to Minecraft.
      viewers - The users that will see this relayed message.
  • Method Details

    • getMember

      public InteractionMember getMember()
      Gets the Discord member that sent the message.
      Returns:
      The member that sent the message.
    • getChannel

      public InteractionChannel getChannel()
      Gets the Discord channel the message was sent in.
      Returns:
      The channel the message was sent in.
    • getGroupNames

      public List<String> getGroupNames()
      Gets the message type group keys.
      Returns:
      The message type group keys.
    • getRawMessage

      public String getRawMessage()
      Gets the raw message sent from Discord.
      Returns:
      The raw message sent from Discord.
    • getFormattedMessage

      public String getFormattedMessage()
      Gets the formatted message that will be sent to Minecraft.
      Returns:
      The formatted message.
    • setFormattedMessage

      public void setFormattedMessage(String formattedMessage)
      Sets the formatted message that will be sent to Minecraft.
      Parameters:
      formattedMessage - The formatted message.
    • getViewers

      public List<net.ess3.api.IUser> getViewers()
      Gets the users that will be sent the relayed message. The returned list is mutable. Removing a player from it will hide the message from them.
      Returns:
      The mutable list of users.
    • isCancelled

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

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

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

      public static HandlerList getHandlerList()