Skip to content

Command Options

addUserOption

Parameters
  • setName(name: string) — The option’s API name (lowercase, no spaces).
  • setDescription(description: string) — Description shown in Discord.
  • setRequired(required: boolean) — Whether this option must be provided.
Interaction Access

Use interaction.options.getUser(name) or interaction.options.getMember(name).

  • getUser(name: string) — Returns a User object (even if not in the guild).
  • getMember(name: string) — Returns a GuildMember object if the user is in the guild, otherwise null.

addStringOption

Parameters
  • setName(name: string)
  • setDescription(description: string)
  • setMinLength(length: number)
  • setMaxLength(length: number)
  • setChoices(choices: Array<{ name: string; value: string }>)
  • setAutocomplete(enabled: boolean)
  • setRequired(required: boolean)
Interaction Access

Use interaction.options.getString(name) — Returns a string.

addChannelOption

Parameters
  • setName(name: string)
  • setDescription(description: string)
  • addChannelTypes(types: ChannelType[])
  • setRequired(required: boolean)
Interaction Access

Use interaction.options.getChannel(name) — Returns a GuildChannel object.

addMentionableOption

Parameters
  • setName(name: string)
  • setDescription(description: string) — Accepts User, Role, or Channel.
Interaction Access

Use interaction.options.getMentionable(name) — Returns a Member, User or Role object depending on what was selected.

addIntegerOption

Parameters
  • setName(name: string)
  • setDescription(description: string)
  • setMinValue(min: number)
  • setMaxValue(max: number)
  • setChoices(choices: Array<{ name: string; value: number }>)
  • setAutocomplete(enabled: boolean)
  • setRequired(required: boolean)
Interaction Access

Use interaction.options.getInteger(name) — Returns a number (integer).

addNumberOption

Parameters
  • setName(name: string)
  • setDescription(description: string)
  • setMinValue(min: number)
  • setMaxValue(max: number)
  • setChoices(choices: Array<{ name: string; value: number }>)
  • setAutocomplete(enabled: boolean)
  • setRequired(required: boolean)
Interaction Access

Use interaction.options.getNumber(name) — Returns a number (including decimals).

addBooleanOption

Parameters
  • setName(name: string)
  • setDescription(description: string)
  • setRequired(required: boolean)
Interaction Access

Use interaction.options.getBoolean(name) — Returns a boolean (true/false).

addAttachmentOption

Parameters
  • setName(name: string)
  • setDescription(description: string)
  • setRequired(required: boolean)
Interaction Access

Use interaction.options.getAttachment(name) — Returns an Attachment object with url, name, size, etc.