diff options
| author | TheLeadingLlama <[email protected]> | 2021-05-29 15:53:07 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2021-06-07 03:25:09 -0400 |
| commit | 2ea2693bd77a2b36ceb7cc9fe33540d9a92a564f (patch) | |
| tree | 69a9749676d3ccd8b6d38856195118446c22a3d8 /discord/guild.py | |
| parent | Return message content for replies in Message.system_content (diff) | |
| download | discord.py-2ea2693bd77a2b36ceb7cc9fe33540d9a92a564f.tar.xz discord.py-2ea2693bd77a2b36ceb7cc9fe33540d9a92a564f.zip | |
Add the Guild.delete_custom_emoji method
Diffstat (limited to 'discord/guild.py')
| -rw-r--r-- | discord/guild.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/discord/guild.py b/discord/guild.py index 452edff2..36317e47 100644 --- a/discord/guild.py +++ b/discord/guild.py @@ -1943,6 +1943,31 @@ class Guild(Hashable): data = await self._state.http.create_custom_emoji(self.id, name, img, roles=roles, reason=reason) return self._state.store_emoji(self, data) + async def delete_emoji(self, emoji: abc.Snowflake, *, reason: Optional[str] = None) -> None: + """|coro| + + Deletes the custom :class:`Emoji` from the guild. + + You must have :attr:`~Permissions.manage_emojis` permission to + do this. + + Parameters + ----------- + emoji: :class:`abc.Snowflake` + The emoji you are deleting. + reason: Optional[:class:`str`] + The reason for deleting this emoji. Shows up on the audit log. + + Raises + ------- + Forbidden + You are not allowed to delete emojis. + HTTPException + An error occurred deleting the emoji. + """ + + await self._state.http.delete_custom_emoji(self.id, emoji.id, reason=reason) + async def fetch_roles(self): """|coro| |