Remove in-place edits and return fresh instances instead

Fixes #4098
This commit is contained in:
Rapptz
2021-08-23 23:46:50 -04:00
parent 9d4fa0341e
commit 490bbffc93
15 changed files with 251 additions and 82 deletions

View File

@ -440,10 +440,10 @@ class GuildSticker(Sticker):
description: str = MISSING,
emoji: str = MISSING,
reason: Optional[str] = None,
) -> None:
) -> GuildSticker:
"""|coro|
Edits a :class:`Sticker` for the guild.
Edits a :class:`GuildSticker` for the guild.
Parameters
-----------
@ -462,6 +462,11 @@ class GuildSticker(Sticker):
You are not allowed to edit stickers.
HTTPException
An error occurred editing the sticker.
Returns
--------
:class:`GuildSticker`
The newly modified sticker.
"""
payload = {}
@ -482,8 +487,7 @@ class GuildSticker(Sticker):
payload['tags'] = emoji
data: GuildStickerPayload = await self._state.http.modify_guild_sticker(self.guild_id, self.id, payload, reason)
self._from_data(data)
return GuildSticker(state=self._state, data=data)
async def delete(self, *, reason: Optional[str] = None) -> None:
"""|coro|