mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 12:18:59 +00:00
Add the Guild.delete_custom_emoji method
This commit is contained in:
parent
fb0c6c56e1
commit
2ea2693bd7
@ -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|
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user