Skip to content

Commit

Permalink
fix: use "value" for name of main param of @Choice
Browse files Browse the repository at this point in the history
  • Loading branch information
qixils committed Jan 12, 2024
1 parent dc70c32 commit d14eff6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private net.dv8tion.jda.api.interactions.commands.Command.Choice[] createChoices
net.dv8tion.jda.api.interactions.commands.Command.Choice[] jdaChoices = new net.dv8tion.jda.api.interactions.commands.Command.Choice[choices.length];
for (int i = 0; i < choices.length; i++) {
Choice choice = choices[i];
String id = rootKey + choice.id() + ".name";
String id = rootKey + choice.value() + ".name";
SingleTranslation name = i18n.getSingle(id, i18n.getDefaultLocale());
if (name instanceof UnknownTranslation)
throw new IllegalStateException("Missing translation for choice " + id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
* While three different types of value methods are available for you to use, only the one matching the
* {@link Option#type() type} specified in your {@link Option @Option} annotation will be utilized.
* </p>
* The name of this choice is taken from the translation file(s) using the {@link #id() provided ID}.
* The name of this choice is taken from the translation file(s) using the {@link #value() provided ID}.
*/
@Target(ElementType.PARAMETER)
@Retention(RetentionPolicy.RUNTIME)
Expand All @@ -35,7 +35,7 @@
*
* @return choice ID
*/
String id();
String value();

/**
* The value of an {@link net.dv8tion.jda.api.interactions.commands.OptionType#INTEGER INTEGER} choice.
Expand Down

0 comments on commit d14eff6

Please sign in to comment.