#[non_exhaustive]pub struct Sticker {
pub id: StickerId,
pub pack_id: Option<StickerPackId>,
pub name: String,
pub description: Option<String>,
pub tags: Vec<String>,
pub kind: StickerType,
pub format_type: StickerFormatType,
pub available: bool,
pub guild_id: Option<GuildId>,
pub user: Option<User>,
pub sort_value: Option<u64>,
}
Expand description
A sticker sent with a message.
Bots cannot send stickers.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.id: StickerId
The unique ID given to this sticker.
pack_id: Option<StickerPackId>
The unique ID of the pack the sticker is from.
name: String
The name of the sticker.
description: Option<String>
Description of the sticker
For guild stickers, the Discord name of a unicode emoji representing the sticker’s expression. For standard stickers, a list of related expressions.
kind: StickerType
The type of sticker.
format_type: StickerFormatType
The type of sticker format.
available: bool
Whether or not this guild sticker can be used, may be false due to loss of Server Boosts.
guild_id: Option<GuildId>
Id of the guild that owns this sticker.
user: Option<User>
User that uploaded the sticker. This will be None
if the current user
does not have the Manage Emojis and Stickers permission.
sort_value: Option<u64>
A sticker’s sort order within a pack.
Implementations
sourceimpl Sticker
impl Sticker
sourcepub async fn delete(&self, http: impl AsRef<Http>) -> Result<()>
Available on crate feature model
only.
pub async fn delete(&self, http: impl AsRef<Http>) -> Result<()>
model
only.Deletes a Sticker
by Id from the guild.
Requires the Manage Emojis and Stickers permission.
Errors
Returns Error::Http
if the current user lacks permission
to delete the sticker.
sourcepub async fn edit<F>(&self, http: impl AsRef<Http>, f: F) -> Result<Sticker> where
F: FnOnce(&mut EditSticker) -> &mut EditSticker,
Available on crate feature model
only.
pub async fn edit<F>(&self, http: impl AsRef<Http>, f: F) -> Result<Sticker> where
F: FnOnce(&mut EditSticker) -> &mut EditSticker,
model
only.Edits a sticker, optionally setting its fields.
Requires the Manage Emojis and Stickers permission.
Examples
Rename a sticker:
guild.edit_sticker(&context, StickerId(7), |r| r.name("Bun bun meow"));
Errors
Returns Error::Http
if the current user lacks permission.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Sticker
impl<'de> Deserialize<'de> for Sticker
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Sticker
impl Send for Sticker
impl Sync for Sticker
impl Unpin for Sticker
impl UnwindSafe for Sticker
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more