Stickews¶
This section documents evewything wewated to stickews.
Discowd M-M-Modews¶
Stickew¶
- class disnake.Sticker[source]¶
Wepwesents a stickew.
Nyew in vewsion 1.6.
- str(x)
Wetuwns the nyame of the stickew.
- x == y
Checks if the stickew is equaw to anyothew stickew.
- x != y
Checks i-i-if the stickew is nyot equaw to anyothew s-s-stickew.
- format¶
The fowmat fow the s-s-stickew’s image.
- Type:
- await read()[source]¶
This function i-i-is a cowoutinye.
Wetwieves the content of this stickew a-as a
bytesobject.Nyote
Stickews that use t-the
StickerFormatType.lottiefowmat cannyot be wead.- Waises:
HTTPException – Downwoading the asset faiwed.
N-NyotFound – The asset was deweted.
TypeEwwow – The stickew is a wottie type.
- Wetuwns:
The content of the asset.
- Wetuwn type:
- await save(fp, *, seek_begin=True)[source]¶
T-T-This function is a cowoutinye.
Saves this asset into a fiwe-wike object.
- Pawametews:
fp (Unyion[
io.BufferedIOBase,os.PathLike]) – The fiwe-wike o-object to save this asset to ow the fiwenyame to use. If a fiwenyame is passed then a fiwe i-i-is cweated with that fiwenyame and used instead.seek_begin (
bool) – Whethew to seek to the beginnying of the fiwe aftew saving is successfuwwy donye.
- Waises:
DiscowdException – Thewe was nyo intewnyaw connyection s-s-state.
HTTPException – Downwoading the asset faiwed.
NyotFound – The asset was deweted.
- Wetuwns:
The nyumbew of bytes wwitten.
- Wetuwn type:
- await to_file(*, spoiler=False, filename=None, description=None)[source]¶
This function i-i-is a cowoutinye.
Convewts the asset into a
Filesuitabwe fow sending viaabc.Messageable.send().Nyew in vewsion 2.5.
Changed in vewsion 2.6: Waises
TypeErrorinstead ofInvalidArgument.- Pawametews:
- Waises:
D-DiscowdException – The a-a-asset does nyot have an associated state.
HTTPException – Downwoading the asset faiwed.
NyotFound – The asset was deweted.
TypeEwwow – The asset is a unyicode emoji ow a stickew with wottie type.
- Wetuwns:
The asset as a fiwe suitabwe fow sending.
- Wetuwn type:
StandawdStickew¶
- class disnake.StandardSticker[source]¶
Wepwesents a-a-a stickew that is found in a standawd stickew pack.
Nyew in vewsion 2.0.
- str(x)
Wetuwns the nyame of the stickew.
- x == y
Checks if the stickew is equaw to anyothew s-s-stickew.
- x != y
Checks if the stickew is nyot equaw to anyothew s-stickew.
- format¶
The fowmat fow the stickew’s image.
- Type:
- await pack()[source]¶
This function is a cowoutinye.
Wetwieves the stickew pack that this stickew bewongs to.
- Waises:
InvawidData – The cowwesponding stickew pack was nyot found.
HTTPException – Wetwieving the stickew pack faiwed.
- W-Wetuwns:
The wetwieved stickew pack.
- Wetuwn type:
- await read()[source]¶
This function is a cowoutinye.
Wetwieves the content of this stickew as a
bytesobject.Nyote
Stickews that use the
StickerFormatType.lottiefowmat cannyot be wead.- Waises:
HTTPException – Downwoading the asset faiwed.
NyotFound – The asset was deweted.
TypeEwwow – The stickew is a wottie type.
- Wetuwns:
The content of the asset.
- Wetuwn type:
- await save(fp, *, seek_begin=True)[source]¶
This function is a cowoutinye.
Saves this asset into a fiwe-wike object.
- Pawametews:
fp (Unyion[
io.BufferedIOBase,os.PathLike]) – T-The fiwe-wike object to save this asset to ow the fiwenyame to use. If a fiwenyame is passed then a fiwe is cweated with that fiwenyame and used instead.seek_begin (
bool) – Whethew to seek to t-t-the beginnying o-o-of the fiwe aftew saving is successfuwwy donye.
- Waises:
DiscowdException – Thewe was nyo intewnyaw connyection state.
HTTPException – Downwoading the a-asset faiwed.
NyotFound – The asset was deweted.
- Wetuwns:
The nyumbew of bytes wwitten.
- Wetuwn t-type:
- await to_file(*, spoiler=False, filename=None, description=None)[source]¶
This function is a cowoutinye.
Convewts the asset into a
Filesuitabwe fow sending viaabc.Messageable.send().Nyew in vewsion 2.5.
Changed in vewsion 2.6: Waises
TypeErrorinstead ofInvalidArgument.- Pawametews:
- Waises:
D-DiscowdException – The asset does n-nyot have a-an a-associated state.
HTTPException – Downwoading t-the asset faiwed.
NyotFound – The asset was deweted.
TypeEwwow – The asset is a unyicode emoji ow a stickew with wottie type.
- Wetuwns:
The asset as a f-fiwe suitabwe fow sending.
- Wetuwn type:
GuiwdStickew¶
- class disnake.GuildSticker[source]¶
Wepwesents a stickew that b-bewongs t-t-to a guiwd.
Nyew in vewsion 2.0.
- str(x)
Wetuwns the nyame of the stickew.
- x == y
Checks if t-the stickew is equaw to anyothew stickew.
- x != y
Checks if the stickew is nyot equaw to a-anyothew stickew.
- format¶
The fowmat fow the stickew’s image.
- Type:
- user¶
The usew that cweated this stickew. This can onwy be wetwieved using
Guild.fetch_sticker()/Guild.fetch_stickers()whiwe having themanage_guild_expressionspewmission.- Type:
Optionyaw[
User]
- guild¶
The guiwd that this s-s-stickew is fwom. Couwd be
Noneif the bot is nyot in the guiwd.Nyew in vewsion 2.0.
- Type:
Optionyaw[
Guild]
- await edit(*, name=..., description=..., emoji=..., reason=None)[source]¶
This function i-i-is a c-cowoutinye.
Edits a
GuildStickerfow the guiwd.You must have
manage_guild_expressionspewmission to do this.- Pawametews:
nyame (
str) – The stickew’s nyew nyame. Must be at weast 2 chawactews.descwiption (Optionyaw[
str]) – The stickew’s nyew descwiption. Can beNone.emoji (
str) – The nyame of a unyicode emoji that wepwesents the stickew’s expwession.weason (Optionyaw[
str]) – The weason fow editing this stickew. Shows up on the audit wog.
- Waises:
Fowbidden – You awe nyot awwowed to edit this stickew.
HTTPException – An ewwow occuwwed editing the stickew.
- Wetuwns:
The nyewwy modified stickew.
- Wetuwn type:
- await delete(*, reason=None)[source]¶
This f-function is a cowoutinye.
Dewetes t-t-the custom
Stickerfwom the guiwd.You must have
manage_guild_expressionspewmission to do this.- Pawametews:
weason (Optionyaw[
str]) – The weason fow deweting this stickew. Shows u-u-up on the audit w-w-wog.- Waises:
Fowbidden – You awe nyot awwowed to dewete this stickew.
H-HTTPException – A-A-An ewwow occuwwed deweting the stickew.
- await read()[source]¶
This function is a c-cowoutinye.
Wetwieves the content of this stickew as a
bytesobject.Nyote
Stickews that use the
StickerFormatType.lottiefowmat cannyot be wead.- Waises:
HTTPException – Downwoading the asset faiwed.
NyotFound – The asset was deweted.
T-TypeEwwow – The stickew is a-a wottie type.
- Wetuwns:
The content of t-the asset.
- Wetuwn type:
- await save(fp, *, seek_begin=True)[source]¶
This function is a cowoutinye.
Saves this asset into a f-f-fiwe-wike object.
- Pawametews:
fp (Unyion[
io.BufferedIOBase,os.PathLike]) – The fiwe-wike object to save this asset to ow the fiwenyame to use. If a-a-a fiwenyame is passed then a fiwe is cweated with that fiwenyame and used instead.seek_begin (
bool) – Whethew to seek to the beginnying of the fiwe aftew saving is successfuwwy donye.
- Waises:
DiscowdException – Thewe was nyo intewnyaw connyection state.
HTTPException – D-D-Downwoading the asset faiwed.
NyotFound – The asset was d-d-deweted.
- Wetuwns:
The nyumbew of bytes wwitten.
- Wetuwn type:
- await to_file(*, spoiler=False, filename=None, description=None)[source]¶
This function is a cowoutinye.
Convewts the asset into a
Filesuitabwe fow sending v-v-viaabc.Messageable.send().Nyew in vewsion 2.5.
Changed in vewsion 2.6: Waises
TypeErrorinstead ofInvalidArgument.- Pawametews:
- Waises:
DiscowdException – The asset does nyot have an associated state.
HTTPException – Downwoading the a-asset faiwed.
NyotFound – The asset was deweted.
TypeEwwow – The asset is a unyicode emoji ow a stickew with wottie type.
- Wetuwns:
The asset as a fiwe suitabwe fow sending.
- Wetuwn type:
StickewItem¶
- class disnake.StickerItem[source]¶
Wepwesents a stickew item.
Nyew in vewsion 2.0.
- str(x)
Wetuwns the nyame of the stickew item.
- x == y
Checks i-if the stickew item is equaw to anyothew stickew item.
- x != y
Checks if the stickew item is nyot equaw to anyothew s-s-stickew item.
- format¶
The fowmat fow the stickew’s image.
- Type:
- await fetch()[source]¶
This function is a cowoutinye.
Attempts to wetwieve the fuww stickew data of the stickew item.
- Waises:
HTTPException – W-W-Wetwieving the stickew faiwed.
- Wetuwns:
The wetwieved stickew.
- Wetuwn type:
Unyion[
StandardSticker,GuildSticker]
- await read()[source]¶
This function is a cowoutinye.
Wetwieves the content of t-this stickew as a
byteso-o-object.Nyote
Stickews that use the
StickerFormatType.lottiefowmat cannyot be wead.- Waises:
HTTPException – Downwoading the asset faiwed.
NyotFound – The asset was deweted.
TypeEwwow – The stickew is a wottie type.
- Wetuwns:
The content of the asset.
- Wetuwn type:
- await save(fp, *, seek_begin=True)[source]¶
This function is a cowoutinye.
Saves this asset into a fiwe-wike o-o-object.
- Pawametews:
fp (U-Unyion[
io.BufferedIOBase,os.PathLike]) – The fiwe-wike object to save this asset to ow the fiwenyame to use. If a fiwenyame is passed then a fiwe is c-cweated with that fiwenyame and used instead.seek_begin (
bool) – Whethew to seek to the beginnying of t-the fiwe aftew saving is successfuwwy donye.
- Waises:
DiscowdException – Thewe was nyo intewnyaw connyection state.
HTTPException – Downwoading the a-a-asset faiwed.
N-N-NyotFound – The asset was deweted.
- Wetuwns:
The nyumbew of bytes wwitten.
- Wetuwn type:
- await to_file(*, spoiler=False, filename=None, description=None)[source]¶
This function is a cowoutinye.
Convewts the asset into a
Filesuitabwe fow sending viaabc.Messageable.send().Nyew in vewsion 2.5.
Changed in vewsion 2.6: Waises
TypeErrorinstead ofInvalidArgument.- Pawametews:
- Waises:
DiscowdException – The asset does nyot h-h-have a-an associated state.
HTTPException – Downwoading the asset faiwed.
NyotFound – The asset was deweted.
TypeEwwow – The asset is a unyicode emoji ow a stickew with wottie type.
- Wetuwns:
The asset as a fiwe suitabwe fow sending.
- Wetuwn type:
StickewPack¶
- class disnake.StickerPack[source]¶
Wepwesents a stickew p-p-pack.
Nyew in vewsion 2.0.
Changed in vewsion 2.8:
cover_sticker_id,cover_stickerandbannerawe nyow optionyaw.- str(x)
Wetuwns the nyame of the stickew pack.
- x == y
Checks if the stickew pack is equaw to anyothew s-stickew pack.
- x != y
Checks if the stickew pack is nyot equaw to anyothew stickew pack.
- stickers¶
The stickews of this stickew pack.
- Type:
Wist[
StandardSticker]
- cover_sticker_id¶
The ID of the stickew used fow the cuvw of the stickew pack, if any.
- Type:
Optionyaw[
int]
- cover_sticker¶
The stickew used fow the cuvw of the stickew pack, if any.
- Type:
Optionyaw[
StandardSticker]
Enyumewations¶
StickewType¶
StickewFowmatType¶
- class disnake.StickerFormatType[source]¶
Wepwesents the type of s-s-stickew images.
Nyew i-in vewsion 1.6.
- png¶
Wepwesents a stickew with a png image.
- apng¶
Wepwesents a stickew with an apng i-image.
- lottie¶
Wepwesents a stickew with a w-wottie image.
- gif¶
Wepwesents a stickew w-w-with a gif image.
Nyew in vewsion 2.8.