From 4bc6625739ba5166d26e927489f2c8317c8e9016 Mon Sep 17 00:00:00 2001 From: Rapptz Date: Sun, 8 Jan 2017 01:51:10 -0500 Subject: Add AutoShardedClient.change_presence. --- discord/client.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'discord/client.py') diff --git a/discord/client.py b/discord/client.py index f8f45870..7f18effd 100644 --- a/discord/client.py +++ b/discord/client.py @@ -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): -- cgit v1.2.3