Browse Source

Allow CustomActivity emoji to be constructed as documented.

Fix #4049
pull/6436/head
Rapptz 4 years ago
parent
commit
88c23125ff
  1. 8
      discord/activity.py

8
discord/activity.py

@ -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):

Loading…
Cancel
Save