Search in sources :

Example 1 with SlashCommandEventBuilder

use of org.togetherjava.tjbot.jda.SlashCommandEventBuilder in project TJ-Bot by Together-Java.

the class TagCommandTest method triggerSlashCommand.

@NotNull
private SlashCommandEvent triggerSlashCommand(@NotNull String id, @Nullable Member userToReplyTo) {
    SlashCommandEventBuilder builder = jdaTester.createSlashCommandEvent(command).setOption(TagCommand.ID_OPTION, id);
    if (userToReplyTo != null) {
        builder.setOption(TagCommand.REPLY_TO_USER_OPTION, userToReplyTo);
    }
    SlashCommandEvent event = builder.build();
    command.onSlashCommand(event);
    return event;
}
Also used : SlashCommandEventBuilder(org.togetherjava.tjbot.jda.SlashCommandEventBuilder) SlashCommandEvent(net.dv8tion.jda.api.events.interaction.SlashCommandEvent) NotNull(org.jetbrains.annotations.NotNull)

Aggregations

SlashCommandEvent (net.dv8tion.jda.api.events.interaction.SlashCommandEvent)1 NotNull (org.jetbrains.annotations.NotNull)1 SlashCommandEventBuilder (org.togetherjava.tjbot.jda.SlashCommandEventBuilder)1