mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-07 03:38:53 -05:00
[V3 General] Fix error in [p]userinfo when game is not set (#1325)
* Fix #1321 Modifies the game-checking lines so that they don't assume `user.game` is not a NoneType object. * Fix #1321 Modifies the game-checking lines so that they don't assume user.game is not a NoneType object. Also alerts the user to go bother @tekulvw if somehow the invariants of `user` having a `game` attribute and the `game` attribute either being `None` of having a `type` attribute in `[0, 1, 2, 3]` are broken. * Update general.py
This commit is contained in:
parent
1cca5ee5cb
commit
d20724d7b2
@ -215,11 +215,11 @@ class General:
|
||||
|
||||
created_on = _("{}\n({} days ago)").format(user_created, since_created)
|
||||
joined_on = _("{}\n({} days ago)").format(user_joined, since_joined)
|
||||
|
||||
|
||||
game = _("Chilling in {} status").format(user.status)
|
||||
|
||||
# Check if the user has a special status
|
||||
if user.game.type == 0: # "Playing" status
|
||||
if user.game is None: # Default status
|
||||
pass
|
||||
elif user.game.type == 0: # "Playing" status
|
||||
game = _("Playing {}").format(user.game.name)
|
||||
elif user.game.type == 1: # "Streaming" status
|
||||
game = _("Streaming [{}]({})").format(user.game.name, user.game.url)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user