Add Choices and Autocomplete #8

Open
tueem wants to merge 9 commits from feat/choices into dev
2 changed files with 22 additions and 1 deletions
Showing only changes of commit 445190db89 - Show all commits

@ -0,0 +1,20 @@
package net.tomatentum.marinara.test;
import net.tomatentum.marinara.interaction.commands.ChoiceValueProvider;
public enum TestChoiceEnum implements ChoiceValueProvider<String> {
TestValue("testValue"),
FooBar("fooBar"),
Spongebob("spongebob");
private String value;
private TestChoiceEnum(String value) {
this.value = value;
}
@Override
public String getChoiceValue() {
return value;
}
}

@ -20,7 +20,8 @@ public class TestCommand implements InteractionHandler {
@SlashCommandOption( @SlashCommandOption(
name = "foo", name = "foo",
description = "foo bar is very fooby", description = "foo bar is very fooby",
type = SlashCommandOptionType.STRING type = SlashCommandOptionType.STRING,
choiceEnum = TestChoiceEnum.class
) )
} }
) )