Add Choices and Autocomplete #8
@ -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
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user