added Tests for choices
This commit is contained in:
parent
9d3a6b8b85
commit
445190db89
@ -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(
|
||||
name = "foo",
|
||||
description = "foo bar is very fooby",
|
||||
type = SlashCommandOptionType.STRING
|
||||
type = SlashCommandOptionType.STRING,
|
||||
choiceEnum = TestChoiceEnum.class
|
||||
)
|
||||
}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user