Class MentionPrefixTransformerJavacord
- java.lang.Object
-
- net.kautler.command.api.prefix.javacord.MentionPrefixTransformerJavacord
-
- All Implemented Interfaces:
CommandContextTransformer<Message>
public abstract class MentionPrefixTransformerJavacord extends Object implements CommandContextTransformer<Message>
A base class for having a mention of the Javacord-based bot as command prefix. To use it, create a trivial subclass of this class and make it a discoverable CDI bean, for example by annotating it with@ApplicationScoped
, and add the@InPhase
qualifier withBEFORE_PREFIX_COMPUTATION
as argument.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.kautler.command.api.CommandContextTransformer
CommandContextTransformer.InPhase, CommandContextTransformer.InPhases, CommandContextTransformer.Phase
-
-
Constructor Summary
Constructors Constructor Description MentionPrefixTransformerJavacord()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
toString()
<T extends Message>
CommandContext<T>transform(CommandContext<T> commandContext, CommandContextTransformer.Phase phase)
Transforms the given command context in the givenphase
.
-
-
-
Method Detail
-
transform
public <T extends Message> CommandContext<T> transform(CommandContext<T> commandContext, CommandContextTransformer.Phase phase)
Description copied from interface:CommandContextTransformer
Transforms the given command context in the givenphase
. The fields of the given command context can be empty depending on the current phase. The fields that are set in the returned command context can cause future phases to be skipped if the according data is already computed in an earlier phase. The description of the single phases specifies which fields in the given command context should be set and which fields in the returned command context should be set and the respective effect that is caused by this. The returned value must not benull
.- Specified by:
transform
in interfaceCommandContextTransformer<Message>
- Type Parameters:
T
- the class of the messages for which this transformer is triggered- Parameters:
commandContext
- the command context to be transformed, usually populated according to the phase description, but not necessarilyphase
- the phase this transformer is currently called in- Returns:
- the transformed command context
- See Also:
CommandContextTransformer.Phase
-
-