Package net.kautler.command.api.event
Class MessageEvent<M>
- java.lang.Object
-
- net.kautler.command.api.event.MessageEvent<M>
-
- Type Parameters:
M- the class of the message payload
- Direct Known Subclasses:
CommandNotAllowedEventJavacord,CommandNotFoundEventJavacord
public class MessageEvent<M> extends Object
A base event with a message as payload that is sent asynchronously via the CDI event mechanism. It can be handled using@ObservesAsync.- See Also:
@ObservesAsync
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMessageEvent(M message, String prefix, String usedAlias)Constructs a new message event with the given message, prefix, and used alias as payload.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MgetMessage()Returns the message payload of this message event.StringgetPrefix()Returns the command prefix that was used to trigger the command.StringgetUsedAlias()Returns the alias that was used to trigger the command.StringtoString()
-
-
-
Constructor Detail
-
MessageEvent
protected MessageEvent(M message, String prefix, String usedAlias)
Constructs a new message event with the given message, prefix, and used alias as payload.- Parameters:
message- the message payload of this message eventprefix- the command prefix that was used to trigger the commandusedAlias- the alias that was used to trigger the command
-
-
Method Detail
-
getMessage
public M getMessage()
Returns the message payload of this message event.- Returns:
- the message payload of this message event
-
getPrefix
public String getPrefix()
Returns the command prefix that was used to trigger the command.- Returns:
- the command prefix that was used to trigger the command
-
getUsedAlias
public String getUsedAlias()
Returns the alias that was used to trigger the command.- Returns:
- the alias that was used to trigger the command
-
-