Allow CustomActivity emoji to be constructed as documented.

Fix #4049
This commit is contained in:
Rapptz 2021-02-18 00:43:19 -05:00
parent 0cd1a88316
commit 88c23125ff

View File

@ -693,8 +693,14 @@ class CustomActivity(BaseActivity):
if emoji is None:
self.emoji = emoji
else:
elif isinstance(emoji, dict):
self.emoji = PartialEmoji.from_dict(emoji)
elif isinstance(emoji, str):
self.emoji = PartialEmoji(name=emoji)
elif isinstance(emoji, PartialEmoji):
self.emoji = emoji
else:
raise TypeError('Expected str, PartialEmoji, or None, received {0!r} instead.'.format(type(emoji)))
@property
def type(self):