From 2ea2693bd77a2b36ceb7cc9fe33540d9a92a564f Mon Sep 17 00:00:00 2001 From: TheLeadingLlama <44980366+StockerMC@users.noreply.github.com> Date: Sat, 29 May 2021 15:53:07 -0400 Subject: [PATCH] Add the Guild.delete_custom_emoji method --- discord/guild.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/discord/guild.py b/discord/guild.py index 452edff2f..36317e470 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|