pub struct ThumbnailBuilder { /* private fields */ }Expand description
Builds a thumbnail: a small image, the accessory of a section.
The URL is a link (http://, https://) or a file uploaded with the message
(attachment://name.png); other schemes are rejected although Discord accepts them, since
it cannot show them (D-190, D-205). The description (alt text) has 1-1024 characters.
discord.js counterpart: ThumbnailBuilder.
Implementations§
Source§impl ThumbnailBuilder
impl ThumbnailBuilder
Sourcepub fn new(url: impl Into<CompactString>) -> Self
pub fn new(url: impl Into<CompactString>) -> Self
Creates a thumbnail showing url.
discord.js counterpart: new ThumbnailBuilder().setURL(…).
Sourcepub fn description(self, description: impl Into<CompactString>) -> Self
pub fn description(self, description: impl Into<CompactString>) -> Self
Sets the alt text (1-1024 characters).
discord.js counterpart: setDescription.
Source§impl ThumbnailBuilder
impl ThumbnailBuilder
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).