diff options
| author | Rapptz <[email protected]> | 2017-05-07 03:08:06 -0400 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-05-07 03:08:06 -0400 |
| commit | dff6bcc7457febf7bb1d797bd777e728f623e938 (patch) | |
| tree | 2d2aa0ff68f5954b8733babf7aee6df6eaab151b /discord/emoji.py | |
| parent | Fix NameError when making things Object in audit logs. (diff) | |
| download | discord.py-dff6bcc7457febf7bb1d797bd777e728f623e938.tar.xz discord.py-dff6bcc7457febf7bb1d797bd777e728f623e938.zip | |
Add support for audit log reasons.
Most routes now have a 'reason' keyword argument.
Diffstat (limited to 'discord/emoji.py')
| -rw-r--r-- | discord/emoji.py | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/discord/emoji.py b/discord/emoji.py index ff839c4d..fdb13430 100644 --- a/discord/emoji.py +++ b/discord/emoji.py @@ -118,7 +118,7 @@ class Emoji(Hashable): @asyncio.coroutine - def delete(self): + def delete(self, *, reason=None): """|coro| Deletes the custom emoji. @@ -128,6 +128,11 @@ class Emoji(Hashable): Guild local emotes can only be deleted by user bots. + Parameters + ----------- + reason: Optional[str] + The reason for deleting this emoji. Shows up on the audit log. + Raises ------- Forbidden @@ -136,10 +141,10 @@ class Emoji(Hashable): An error occurred deleting the emoji. """ - yield from self._state.http.delete_custom_emoji(self.guild.id, self.id) + yield from self._state.http.delete_custom_emoji(self.guild.id, self.id, reason=reason) @asyncio.coroutine - def edit(self, *, name): + def edit(self, *, name, reason=None): """|coro| Edits the custom emoji. @@ -153,6 +158,8 @@ class Emoji(Hashable): ----------- name: str The new emoji name. + reason: Optional[str] + The reason for editing this emoji. Shows up on the audit log. Raises ------- @@ -162,4 +169,4 @@ class Emoji(Hashable): An error occurred editing the emoji. """ - yield from self._state.http.edit_custom_emoji(self.guild.id, self.id, name=name) + yield from self._state.http.edit_custom_emoji(self.guild.id, self.id, name=name, reason=reason) |