handle Game.name being None

re #221, Game.name can still be None, which will cause TypeError on
str(game).

Currently discord does not treat these weird statuses uniformly, with it
showing as playing a game on mobile, but not playing a game on desktop. It
may be useful to know users are in this weird state.
This commit is contained in:
khazhyk 2017-07-03 23:10:33 -07:00
parent 6c01250c39
commit 94eb938d29

View File

@ -63,7 +63,7 @@ class Game:
self.type = kwargs.get('type')
def __str__(self):
return self.name
return str(self.name)
def __repr__(self):
return '<Game name={0.name!r} type={0.type!r} url={0.url!r}>'.format(self)