added Tests for choices

This commit is contained in:
tueem 2024-12-16 12:49:51 +01:00
parent 9d3a6b8b85
commit 445190db89
Signed by: tueem
GPG Key ID: 65C8667EC17A88FB
2 changed files with 22 additions and 1 deletions

@ -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
)
}
)