Add AutoShardedClient.change_presence.

This commit is contained in:
Rapptz
2017-01-08 01:51:10 -05:00
parent b5bed9ef33
commit 4bc6625739
3 changed files with 72 additions and 16 deletions

View File

@@ -1006,13 +1006,24 @@ class Client:
if status is None:
status = 'online'
status_enum = Status.online
elif status is Status.offline:
status = 'invisible'
status_enum = Status.offline
else:
status_enum = status
status = str(status)
yield from self.ws.change_presence(game=game, status=status, afk=afk)
for guild in self.connection.guilds:
me = guild.me
if me is None:
continue
me.game = game
me.status = status_enum
# Invite management
def _fill_invite_data(self, data):