diff options
| author | 2020-01-16 14:07:42 -0800 | |
|---|---|---|
| committer | 2020-01-16 14:07:42 -0800 | |
| commit | 33dd712d3fe046c196ac0d31e0bfaf121f469ed5 (patch) | |
| tree | 93cfef7e9dc2c908ec780549e50bfb896ab9d1dd | |
| parent | Merge pull request #701 from manusaurio/fetched-user (diff) | |
| parent | Merge branch 'master' into user-info-fix (diff) | |
Merge pull request #730 from python-discord/user-info-fix
Fix user command error for empty custom status
| -rw-r--r-- | bot/cogs/information.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/bot/cogs/information.py b/bot/cogs/information.py index 1ede95ff4..125d7ce24 100644 --- a/bot/cogs/information.py +++ b/bot/cogs/information.py @@ -189,7 +189,11 @@ class Information(Cog): # Custom status custom_status = '' for activity in user.activities: - if activity.name == 'Custom Status': + # Check activity.state for None value if user has a custom status set + # This guards against a custom status with an emoji but no text, which will cause + # escape_markdown to raise an exception + # This can be reworked after a move to d.py 1.3.0+, which adds a CustomActivity class + if activity.name == 'Custom Status' and activity.state: state = escape_markdown(activity.state) custom_status = f'Status: {state}\n' |