Class DiscordRelayEvent
java.lang.Object
org.bukkit.event.Event
net.essentialsx.api.v2.events.discord.DiscordRelayEvent
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorDescriptionDiscordRelayEvent
(InteractionMember member, InteractionChannel channel, List<String> groupNames, String rawMessage, String formattedMessage, List<net.ess3.api.IUser> viewers) -
Method Summary
Modifier and TypeMethodDescriptionGets the Discord channel the message was sent in.Gets the formatted message that will be sent to Minecraft.Gets the message type group keys.static HandlerList
@NotNull HandlerList
Gets the Discord member that sent the message.Gets the raw message sent from Discord.List
<net.ess3.api.IUser> Gets the users that will be sent the relayed message.boolean
void
setCancelled
(boolean cancelled) void
setFormattedMessage
(String formattedMessage) Sets the formatted message that will be sent to Minecraft.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
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
Gets the Discord member that sent the message.- Returns:
- The member that sent the message.
-
getChannel
Gets the Discord channel the message was sent in.- Returns:
- The channel the message was sent in.
-
getGroupNames
Gets the message type group keys.- Returns:
- The message type group keys.
-
getRawMessage
Gets the raw message sent from Discord.- Returns:
- The raw message sent from Discord.
-
getFormattedMessage
Gets the formatted message that will be sent to Minecraft.- Returns:
- The formatted message.
-
setFormattedMessage
Sets the formatted message that will be sent to Minecraft.- Parameters:
formattedMessage
- The formatted message.
-
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 interfaceCancellable
-
setCancelled
public void setCancelled(boolean cancelled) - Specified by:
setCancelled
in interfaceCancellable
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-