aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNCPlayz <[email protected]>2019-10-11 22:31:51 +0100
committerRapptz <[email protected]>2019-10-20 05:19:03 -0400
commitf273199d57076c292ae15a7e4a4c909f835ec6bd (patch)
tree7dc8639c31f5bb3d3b71f836c26e6384020c0095
parentAdd changelog for v1.2.4 (diff)
downloaddiscord.py-f273199d57076c292ae15a7e4a4c909f835ec6bd.tar.xz
discord.py-f273199d57076c292ae15a7e4a4c909f835ec6bd.zip
Refactor `name` kwarg for `Emoji.edit()`
-rw-r--r--discord/emoji.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/discord/emoji.py b/discord/emoji.py
index f581d950..7d4ab658 100644
--- a/discord/emoji.py
+++ b/discord/emoji.py
@@ -281,7 +281,7 @@ class Emoji:
await self._state.http.delete_custom_emoji(self.guild.id, self.id, reason=reason)
- async def edit(self, *, name, roles=None, reason=None):
+ async def edit(self, *, name=None, roles=None, reason=None):
r"""|coro|
Edits the custom emoji.
@@ -306,6 +306,7 @@ class Emoji:
An error occurred editing the emoji.
"""
+ name = name or self.name
if roles:
roles = [role.id for role in roles]
await self._state.http.edit_custom_emoji(self.guild.id, self.id, name=name, roles=roles, reason=reason)