How to use TextInput.Builder? Can someone to write code example for me? Ill be happy! Thank you #2302
Answered
by
cattyngmd
VVriter
asked this question in
Questions and Help
Replies: 2 comments 1 reply
-
@Override public void onSlashCommandInteraction(@NotNull SlashCommandInteractionEvent event) {
if (event.getName().equals("input")) {
event.replyModal(
Modal.create("simple_modal", "Application")
.addActionRow(
TextInput.create("simple_input", "Input", TextInputStyle.SHORT).build()
).build()
).queue();
}
}
@Override public void onModalInteraction(@NotNull ModalInteractionEvent event) {
if (event.getModalId().equals("simple_modal")) {
event.reply(event.getValue("simple_input").getAsString()).queue();
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
VVriter
-
|
Пасиба русские хакеры 🥸 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Help me pls :)
Beta Was this translation helpful? Give feedback.
All reactions