pub struct LabelBuilder { /* private fields */ }Expand description
Implementations§
Source§impl LabelBuilder
impl LabelBuilder
Sourcepub fn new(label: impl Into<CompactString>, field: impl Into<Component>) -> Self
pub fn new(label: impl Into<CompactString>, field: impl Into<Component>) -> Self
Creates a label label around field: a text input, a select menu, a file upload, a
radio group, a checkbox group or a checkbox.
discord.js counterpart: new LabelBuilder().setLabel(…).set…Component(…).
Sourcepub fn description(self, description: impl Into<CompactString>) -> Self
pub fn description(self, description: impl Into<CompactString>) -> Self
Sets the smaller text under the label (at most 100 characters).
discord.js counterpart: setDescription.
Source§impl LabelBuilder
impl LabelBuilder
Sourcepub fn id(self, id: i32) -> Self
pub fn id(self, id: i32) -> Self
Sets the component’s numeric identifier (Discord generates one otherwise); it must be unique in the message or modal.
discord.js counterpart: setId.
Sourcepub fn build(self) -> Result<Component, ValidationError>
pub fn build(self) -> Result<Component, ValidationError>
Checks the component (and what it contains) and returns it.
discord.js counterpart: toJSON of the component builders.
§Errors
The first ValidationError found; see the type docs
for the rules.
Sourcepub fn build_unchecked(self) -> Component
pub fn build_unchecked(self) -> Component
Returns the component without any check (D-180).
discord.js counterpart: toJSON of the component builders with validation off (disableValidators).