pub struct StickerManager<'a, B: Backend> { /* private fields */ }Expand description
The stickers of one guild. Returned by Context::stickers.
discord.js counterpart: GuildStickerManager (guild.stickers).
Implementations§
Source§impl<'a, B: Backend> StickerManager<'a, B>
impl<'a, B: Backend> StickerManager<'a, B>
Sourcepub const fn guild_id(self) -> GuildId
pub const fn guild_id(self) -> GuildId
The guild these stickers belong to.
discord.js counterpart: GuildStickerManager#guild.
Sourcepub fn cache(self) -> Option<GuildView<'a, StickerId, Sticker, B>>
pub fn cache(self) -> Option<GuildView<'a, StickerId, Sticker, B>>
The cached stickers of the guild, if the client has a cache.
discord.js counterpart: GuildStickerManager#cache.
Sourcepub fn fetch(
self,
sticker_id: StickerId,
) -> Fetch<Arc<Sticker>, impl Future<Output = Result<Arc<Sticker>, Error>> + Send + 'a>
pub fn fetch( self, sticker_id: StickerId, ) -> Fetch<Arc<Sticker>, impl Future<Output = Result<Arc<Sticker>, Error>> + Send + 'a>
A sticker: the cached one, or Get Guild Sticker, whose result is cached.
discord.js counterpart: GuildStickerManager#fetch(id).
§Errors
Returns the REST error if Discord was asked and the request failed.
Sourcepub async fn list(self) -> Result<Collection<StickerId, Arc<Sticker>>, Error>
pub async fn list(self) -> Result<Collection<StickerId, Arc<Sticker>>, Error>
Every sticker of the guild (List Guild Stickers); the stickers are cached.
discord.js counterpart: GuildStickerManager#fetch().
§Errors
Returns the REST error if the request failed.
Sourcepub async fn create(
self,
body: &CreateGuildSticker,
reason: Option<&str>,
) -> Result<Arc<Sticker>, Error>
pub async fn create( self, body: &CreateGuildSticker, reason: Option<&str>, ) -> Result<Arc<Sticker>, Error>
Uploads a sticker (Create Guild Sticker); it is cached.
discord.js counterpart: GuildStickerManager#create.
§Errors
Returns the REST error if the request failed (it needs CREATE_EXPRESSIONS; the file
must be a PNG, APNG, GIF or Lottie JSON of at most 512 KiB).
Sourcepub async fn edit(
self,
sticker_id: StickerId,
body: &ModifyGuildSticker,
reason: Option<&str>,
) -> Result<Arc<Sticker>, Error>
pub async fn edit( self, sticker_id: StickerId, body: &ModifyGuildSticker, reason: Option<&str>, ) -> Result<Arc<Sticker>, Error>
Changes a sticker’s name, description or tags (Modify Guild Sticker); the result is cached.
discord.js counterpart: GuildStickerManager#edit / Sticker#edit.
§Errors
Returns the REST error if the request failed.
Sourcepub async fn delete(
self,
sticker_id: StickerId,
reason: Option<&str>,
) -> Result<(), Error>
pub async fn delete( self, sticker_id: StickerId, reason: Option<&str>, ) -> Result<(), Error>
Deletes a sticker (Delete Guild Sticker). The
cache is updated by the GUILD_STICKERS_UPDATE event that follows (D-236).
discord.js counterpart: GuildStickerManager#delete / Sticker#delete.
§Errors
Returns the REST error if the request failed.
Trait Implementations§
Source§impl<B: Backend> Clone for StickerManager<'_, B>
impl<B: Backend> Clone for StickerManager<'_, B>
impl<B: Backend> Copy for StickerManager<'_, B>
Auto Trait Implementations§
impl<'a, B> !RefUnwindSafe for StickerManager<'a, B>
impl<'a, B> !UnwindSafe for StickerManager<'a, B>
impl<'a, B> Freeze for StickerManager<'a, B>
impl<'a, B> Send for StickerManager<'a, B>
impl<'a, B> Sync for StickerManager<'a, B>
impl<'a, B> Unpin for StickerManager<'a, B>
impl<'a, B> UnsafeUnpin for StickerManager<'a, B>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Classify for T
impl<T> Classify for T
type Classified = T
fn classify(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more