Skip to content

SelectionBuilder

SelectionBuilder is used to construct a selection (dropdown) component for a Discord message.

Properties

Type

SelectionBuilder.Type  :: table

An enumeration of selection types.

  • TextSelection: 3
  • UserSelection: 5
  • RoleSelection: 6
  • MentionableSelection: 7
  • ChannelSelection: 8

ChannelType

SelectionBuilder.ChannelType  :: table

An enumeration of channel types.

  • GuildText: 0
  • DirectMessage: 1
  • GuildVoice: 2
  • GroupDirectMessage: 3
  • GuildCategory: 4
  • GuildAnnouncement: 5
  • AnnouncementThread: 10
  • PublicThread: 11
  • PrivateThread: 12
  • GuildStageVoice: 13
  • GuildDirectory: 14
  • GuildForum: 15

Methods

setType

SelectionBuilder : setType (

     selectionType: number
)  -> Builders.Interface.SelectionBuilder

Sets the type of the selection.

setChannelTypes

SelectionBuilder : setChannelTypes (

     ...: number
)  -> Builders.Interface.SelectionBuilder

Sets the channel types for the selection.

setPlaceholder

SelectionBuilder : setPlaceholder (

     placeholderText: string
)  -> Builders.Interface.SelectionBuilder

Sets the placeholder text for the selection.

setDisabled

SelectionBuilder : setDisabled (

     isDisabled: boolean
)  -> Builders.Interface.SelectionBuilder

Sets whether the selection is disabled.

setMinValues

SelectionBuilder : setMinValues (

     minValue: number
)  -> Builders.Interface.SelectionBuilder

Sets the minimum number of values that must be selected.

setMaxValues

SelectionBuilder : setMaxValues (

     maxValue: number
)  -> Builders.Interface.SelectionBuilder

Sets the maximum number of values that can be selected.

addChoice

SelectionBuilder : addChoice (

     choiceName: string
     choiceValue: string
     choiceDescription: string
     isDefault: boolean
     emojiId: string?
     emojiName: string?
)  -> Builders.Interface.SelectionBuilder

Adds a choice to the selection.

destroyChoice

SelectionBuilder : destroyChoice (

     choiceName: string
)  -> Builders.Interface.SelectionBuilder

Removes a choice from the selection.

toPayloadObject

SelectionBuilder : toPayloadObject ()  -> Network.Resolvable

Converts the selection to a JSON object that can be sent to the Discord API.

Functions

new

SelectionBuilder . new (

     selectionId: string
)  -> ()

Creates a new instance of SelectionBuilder.