diff options
| author | Rapptz <[email protected]> | 2020-01-15 09:26:47 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2020-01-15 09:27:32 -0500 |
| commit | 23f16618fdf5fcbeeefed7acb56b579e74bc88d8 (patch) | |
| tree | fe07bda51ee95e3187f12902cd9341758615d2b7 | |
| parent | [docs] Fix sphinx warning about heading (diff) | |
| download | discord.py-23f16618fdf5fcbeeefed7acb56b579e74bc88d8.tar.xz discord.py-23f16618fdf5fcbeeefed7acb56b579e74bc88d8.zip | |
Make CustomActivity.__str__ not raise errors and match the client
| -rw-r--r-- | discord/activity.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/discord/activity.py b/discord/activity.py index 6f724199..5b2861bb 100644 --- a/discord/activity.py +++ b/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) |