diff options
| author | Rapptz <[email protected]> | 2017-01-08 01:51:10 -0500 |
|---|---|---|
| committer | Rapptz <[email protected]> | 2017-01-08 01:51:10 -0500 |
| commit | 4bc6625739ba5166d26e927489f2c8317c8e9016 (patch) | |
| tree | 403063a7c4226e7a1f60eec456e24fe73e891c49 /discord/gateway.py | |
| parent | Change the way shards are launched in AutoShardedClient. (diff) | |
| download | discord.py-4bc6625739ba5166d26e927489f2c8317c8e9016.tar.xz discord.py-4bc6625739ba5166d26e927489f2c8317c8e9016.zip | |
Add AutoShardedClient.change_presence.
Diffstat (limited to 'discord/gateway.py')
| -rw-r--r-- | discord/gateway.py | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/discord/gateway.py b/discord/gateway.py index 8180f4ec..3d922660 100644 --- a/discord/gateway.py +++ b/discord/gateway.py @@ -412,13 +412,10 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol): raise ConnectionClosed(e, shard_id=self.shard_id) from e @asyncio.coroutine - def change_presence(self, *, game=None, status=None, afk=False, since=0.0, idle=None): + def change_presence(self, *, game=None, status=None, afk=False, since=0.0): if game is not None and not isinstance(game, Game): raise InvalidArgument('game must be of type Game or None') - if idle: - status = 'idle' - if status == 'idle': since = int(time.time() * 1000) @@ -438,18 +435,6 @@ class DiscordWebSocket(websockets.client.WebSocketClientProtocol): log.debug('Sending "{}" to change status'.format(sent)) yield from self.send(sent) - status_enum = try_enum(Status, status) - if status_enum is Status.invisible: - status_enum = Status.offline - - for guild in self._connection.guilds: - me = guild.me - if me is None: - continue - - me.game = game - me.status = status_enum - @asyncio.coroutine def request_sync(self, guild_ids): payload = { |