Skip to content
Discussion options

You must be logged in to vote
    @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();
       …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@ghost
Comment options

Answer selected by VVriter
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants