aboutsummaryrefslogtreecommitdiff
path: root/discord
diff options
context:
space:
mode:
Diffstat (limited to 'discord')
-rw-r--r--discord/guild.py25
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|