Struct twilight_util::builder::embed::EmbedFooterBuilder
source · pub struct EmbedFooterBuilder(/* private fields */);
Available on crate feature
builder
only.Expand description
Create an embed footer with a builder.
This can be passed into EmbedBuilder::footer
.
Implementations§
sourcepub fn new(text: impl Into<String>) -> Self
pub fn new(text: impl Into<String>) -> Self
Create a new embed footer builder.
Refer to FOOTER_TEXT_LENGTH
for the maximum number of UTF-16 code
points that can be in a footer’s text.
sourcepub fn build(self) -> EmbedFooter
pub fn build(self) -> EmbedFooter
Build into an embed footer.
sourcepub fn icon_url(self, image_source: ImageSource) -> Self
pub fn icon_url(self, image_source: ImageSource) -> Self
Add a footer icon.
Examples
Create a footer by Twilight with a URL to an image of its logo:
use twilight_util::builder::embed::{EmbedFooterBuilder, ImageSource};
let icon_url =
ImageSource::url("https://raw.githubusercontent.com/twilight-rs/twilight/main/logo.png")?;
let footer = EmbedFooterBuilder::new("Twilight")
.icon_url(icon_url)
.build();
Trait Implementations§
source§fn clone(&self) -> EmbedFooterBuilder
fn clone(&self) -> EmbedFooterBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§fn from(builder: EmbedFooterBuilder) -> Self
fn from(builder: EmbedFooterBuilder) -> Self
Convert an embed footer builder into an embed footer.
This is equivalent to calling EmbedFooterBuilder::build
.
source§fn eq(&self, other: &EmbedFooterBuilder) -> bool
fn eq(&self, other: &EmbedFooterBuilder) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.