pub struct CreateSticker<'a> { /* private fields */ }
Expand description
A builder to create a guild sticker
Implementations§
Source§impl<'a> CreateSticker<'a>
impl<'a> CreateSticker<'a>
Sourcepub fn new(name: impl Into<String>, file: CreateAttachment) -> Self
pub fn new(name: impl Into<String>, file: CreateAttachment) -> Self
Creates a new builder with the given data. All of this builder’s fields are required.
Sourcepub fn name(self, name: impl Into<String>) -> Self
pub fn name(self, name: impl Into<String>) -> Self
Set the name of the sticker, replacing the current value as set in Self::new
.
Note: Must be between 2 and 30 characters long.
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
Set the description of the sticker.
Note: Must be empty or 2-100 characters.
The Discord name of a unicode emoji representing the sticker’s expression.
Note: Max 200 characters long.
Sourcepub fn file(self, file: CreateAttachment) -> Self
pub fn file(self, file: CreateAttachment) -> Self
Set the sticker file. Replaces the current value as set in Self::new
.
Note: Must be a PNG, APNG, or Lottie JSON file, max 500 KB.
Sourcepub fn audit_log_reason(self, reason: &'a str) -> Self
pub fn audit_log_reason(self, reason: &'a str) -> Self
Sets the request’s audit log reason.
Trait Implementations§
Source§impl Builder for CreateSticker<'_>
impl Builder for CreateSticker<'_>
Source§fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
self,
cache_http: impl 'async_trait + CacheHttp,
ctx: Self::Context<'life0>,
) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a new sticker in the guild with the data set, if any.
Note: Requires the Create Guild Expressions permission.
§Errors
If the cache
is enabled, returns a ModelError::InvalidPermissions
if the current user
lacks permission. Otherwise returns Error::Http
, as well as if invalid data is given.
Source§type Context<'ctx> = GuildId
type Context<'ctx> = GuildId
type Built = Sticker
Source§impl<'a> Clone for CreateSticker<'a>
impl<'a> Clone for CreateSticker<'a>
Source§fn clone(&self) -> CreateSticker<'a>
fn clone(&self) -> CreateSticker<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more