feat(command): add wrapper implementations of option ranges
This commit is contained in:
parent
d2eec8b07c
commit
996f854ff7
@ -56,6 +56,10 @@ public class Discord4JConverterSpec implements CommandConverter.Spec<Application
|
|||||||
.description(option.description())
|
.description(option.description())
|
||||||
.required(option.required())
|
.required(option.required())
|
||||||
.autocomplete(option.autocomplete())
|
.autocomplete(option.autocomplete())
|
||||||
|
.minLength(Double.valueOf(option.range().min()).intValue())
|
||||||
|
.minValue(option.range().min())
|
||||||
|
.maxLength(Double.valueOf(option.range().max()).intValue())
|
||||||
|
.maxValue(option.range().max())
|
||||||
.choices(choices)
|
.choices(choices)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,10 @@ public class JavacordConverterSpec implements CommandConverter.Spec<SlashCommand
|
|||||||
.setDescription(option.description())
|
.setDescription(option.description())
|
||||||
.setRequired(option.required())
|
.setRequired(option.required())
|
||||||
.setAutocompletable(option.autocomplete())
|
.setAutocompletable(option.autocomplete())
|
||||||
|
.setMinLength(Double.valueOf(option.range().min()).longValue())
|
||||||
|
.setDecimalMinValue(option.range().min())
|
||||||
|
.setMaxLength(Double.valueOf(option.range().max()).longValue())
|
||||||
|
.setDecimalMaxValue(option.range().max())
|
||||||
.setChoices(choices)
|
.setChoices(choices)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user