mirror of
https://github.com/Rapptz/discord.py.git
synced 2026-11-20 13:29:03 +00:00
Allow setting a presence upon logging in.
This commit is contained in:
1 parent
9e24d43c63
commit
3436792614
3 files changed
+29
-1
No files matched your search
@@ -275,6 +275,15 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol):
|
||||
if self.shard_id is not None and self.shard_count is not None:
|
||||
payload['d']['shard'] = [self.shard_id, self.shard_count]
|
||||
|
||||
state = self._connection
|
||||
if state._game is not None or state._status is not None:
|
||||
payload['d']['presence'] = {
|
||||
'status': state._status,
|
||||
'game': state._game,
|
||||
'since': 0,
|
||||
'afk': False
|
||||
}
|
||||
|
||||
yield from self.send_as_json(payload)
|
||||
log.info('Shard ID %s has sent the IDENTIFY payload.', self.shard_id)
|
||||
|
||||
|
||||
Reference in new issue
Block a user