aboutsummaryrefslogtreecommitdiff
path: root/discord/client.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-01-08 01:51:10 -0500
committerRapptz <[email protected]>2017-01-08 01:51:10 -0500
commit4bc6625739ba5166d26e927489f2c8317c8e9016 (patch)
tree403063a7c4226e7a1f60eec456e24fe73e891c49 /discord/client.py
parentChange the way shards are launched in AutoShardedClient. (diff)
downloaddiscord.py-4bc6625739ba5166d26e927489f2c8317c8e9016.tar.xz
discord.py-4bc6625739ba5166d26e927489f2c8317c8e9016.zip
Add AutoShardedClient.change_presence.
Diffstat (limited to 'discord/client.py')
-rw-r--r--discord/client.py11
1 files changed, 11 insertions, 0 deletions
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):