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 protected
MessageEvent(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 M
getMessage()
Returns the message payload of this message event.String
getPrefix()
Returns the command prefix that was used to trigger the command.String
getUsedAlias()
Returns the alias that was used to trigger the command.String
toString()
-
-
-
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
-
-