Class DiscordChatMessageEvent
java.lang.Object
org.bukkit.event.Event
net.essentialsx.api.v2.events.discord.DiscordChatMessageEvent
- All Implemented Interfaces:
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Constructor Summary
ConstructorDescriptionDiscordChatMessageEvent
(Player player, String message, net.essentialsx.api.v2.ChatType chatType) -
Method Summary
Modifier and TypeMethodDescriptionnet.essentialsx.api.v2.ChatType
Type of chat of the original message.static HandlerList
@NotNull HandlerList
The message being sent in this chat event.The player which caused this chat message.boolean
void
setCancelled
(boolean cancel) void
setMessage
(String message) Sets the message of this event, and thus the chat message relayed to Discord.Methods inherited from class org.bukkit.event.Event
getEventName, isAsynchronous
-
Constructor Details
-
Method Details
-
getPlayer
The player which caused this chat message.- Returns:
- the player who caused the event.
-
getMessage
The message being sent in this chat event.- Returns:
- the message of this event.
-
setMessage
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 interfaceCancellable
-
setCancelled
public void setCancelled(boolean cancel) - Specified by:
setCancelled
in interfaceCancellable
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-