Browse Source

Make CustomActivity.__str__ not raise errors and match the client

pull/2510/head
Rapptz 5 years ago
parent
commit
23f16618fd
  1. 7
      discord/activity.py

7
discord/activity.py

@ -724,7 +724,12 @@ class CustomActivity(BaseActivity):
return hash((self.name, str(self.emoji)))
def __str__(self):
return self.name
if self.emoji:
if self.name:
return '%s %s' % (self.emoji, self.name)
return str(self.emoji)
else:
return str(self.name)
def __repr__(self):
return '<CustomActivity name={0.name!r} emoji={0.emoji!r}>'.format(self)

Loading…
Cancel
Save