VarArgs

annotation class VarArgs(val value: Int, val numRequired: Int = 1)(source)

Generates N command options from the specified @SlashOption or @TextOption.

The target parameter must be of type List.

You can configure how many arguments are required with numRequired.

See @MentionsString for a way to get a list of mentionable (user/member/role/channel...) without a vararg, using a single string.

Note: You are limited to one vararg parameter in text commands.

See also

TextCommandVariationBuilder.optionVararg
SlashCommandBuilder.optionVararg

@MentionsString

Properties

Link copied to clipboard
val numRequired: Int = 1

The number of required options for this vararg.

Link copied to clipboard
val value: Int

The number of times this option needs to appear, which must be between 1 and {@value CommandData#MAX_OPTIONS}.