#[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<u16>,
}
Expand description
A sticker sent with a message.
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
either the Create Guild Expressions nor the Manage Guild Expressions permission.
sort_value: Option<u16>
A sticker’s sort order within a pack.
Implementations§
Source§impl Sticker
impl Sticker
Sourcepub async fn delete(&self, http: impl AsRef<Http>) -> Result<()>
pub async fn delete(&self, http: impl AsRef<Http>) -> Result<()>
Deletes the Sticker
from its guild.
Note: If the sticker was created by the current user, requires either the Create Guild Expressions or the Manage Guild Expressions permission. Otherwise, the Manage Guild Expressions permission is required.
§Errors
Returns Error::Http
if the current user lacks permission to delete the sticker.
Sourcepub async fn edit(
&mut self,
cache_http: impl CacheHttp,
builder: EditSticker<'_>,
) -> Result<()>
pub async fn edit( &mut self, cache_http: impl CacheHttp, builder: EditSticker<'_>, ) -> Result<()>
Edits the sticker.
Note: If the sticker was created by the current user, requires either the Create Guild Expressions or the Manage Guild Expressions permission. Otherwise, the Manage Guild Expressions permission is required.
§Examples
Rename a sticker:
use serenity::builder::EditSticker;
let builder = EditSticker::new().name("Bun bun meow");
sticker.edit(&http, builder).await?;
§Errors
Returns Error::Http
if the current user lacks permission.