Class Step
java.lang.Object
de.chojo.jdautil.conversation.elements.Step
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic Step.Builderbutton(String prompt, Consumer<ButtonDialog> buttons) Create a new step builder with a message promptgetActions(ILocalizer localizer, Guild guild) Get the action rows for this stephandleButton(InteractionContext context) Handles a button interactionhandleMessage(ConversationContext message) Handles a messagebooleanChecks for a button handlerbooleanChecks for a message handlerstatic Step.Buildermessage(String prompt, Function<ConversationContext, Result> handle) Create a new step builder with a message promptprompt()Get the prompt
-
Method Details
-
message
Create a new step builder with a message prompt- Parameters:
prompt- prompt to sendhandle- handles the input and returns aResult- Returns:
- new builder instance
-
button
Create a new step builder with a message prompt- Parameters:
prompt- prompt to sendbuttons- aButtonDialog- Returns:
- new builder instance
-
handleMessage
Handles a message- Parameters:
message- message context- Returns:
- result
-
handleButton
Handles a button interaction- Parameters:
context- interaction context- Returns:
- result
-
hasMessage
public boolean hasMessage()Checks for a message handler- Returns:
- true if there is one
-
prompt
-
hasButtons
public boolean hasButtons()Checks for a button handler- Returns:
- true if there is one
-
getActions
Get the action rows for this step- Parameters:
localizer- localizer for button and message contentguild- guild- Returns:
- list of action rows
-