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/gateway.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) (limited to 'discord/gateway.py') 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 = { -- cgit v1.2.3