mirror of
				https://github.com/Rapptz/discord.py.git
				synced 2025-10-25 02:23:04 +00:00 
			
		
		
		
	[lint] Remove unused variables
Left over from various refactoring and rewrites.
This commit is contained in:
		| @@ -955,7 +955,7 @@ class Connectable(metaclass=abc.ABCMeta): | |||||||
|         :class:`VoiceClient` |         :class:`VoiceClient` | ||||||
|             A voice client that is fully connected to the voice server. |             A voice client that is fully connected to the voice server. | ||||||
|         """ |         """ | ||||||
|         key_id, key_name = self._get_voice_client_key() |         key_id, _ = self._get_voice_client_key() | ||||||
|         state = self._state |         state = self._state | ||||||
|  |  | ||||||
|         if state._get_voice_client(key_id): |         if state._get_voice_client(key_id): | ||||||
|   | |||||||
| @@ -367,7 +367,7 @@ class Client: | |||||||
|         while True: |         while True: | ||||||
|             try: |             try: | ||||||
|                 await self.ws.poll_event() |                 await self.ws.poll_event() | ||||||
|             except ResumeWebSocket as e: |             except ResumeWebSocket: | ||||||
|                 log.info('Got a request to RESUME the websocket.') |                 log.info('Got a request to RESUME the websocket.') | ||||||
|                 coro = DiscordWebSocket.from_client(self, shard_id=self.shard_id, |                 coro = DiscordWebSocket.from_client(self, shard_id=self.shard_id, | ||||||
|                                                           session=self.ws.session_id, |                                                           session=self.ws.session_id, | ||||||
|   | |||||||
| @@ -321,7 +321,7 @@ class Command: | |||||||
|         try: |         try: | ||||||
|             # first/second parameter is context |             # first/second parameter is context | ||||||
|             result.popitem(last=False) |             result.popitem(last=False) | ||||||
|         except Exception as e: |         except Exception: | ||||||
|             raise ValueError('Missing context parameter') from None |             raise ValueError('Missing context parameter') from None | ||||||
|  |  | ||||||
|         return result |         return result | ||||||
|   | |||||||
| @@ -74,7 +74,7 @@ class Shard: | |||||||
|     async def poll(self): |     async def poll(self): | ||||||
|         try: |         try: | ||||||
|             await self.ws.poll_event() |             await self.ws.poll_event() | ||||||
|         except ResumeWebSocket as e: |         except ResumeWebSocket: | ||||||
|             log.info('Got a request to RESUME the websocket at Shard ID %s.', self.id) |             log.info('Got a request to RESUME the websocket at Shard ID %s.', self.id) | ||||||
|             coro = DiscordWebSocket.from_client(self._client, resume=True, |             coro = DiscordWebSocket.from_client(self._client, resume=True, | ||||||
|                                                               shard_id=self.id, |                                                               shard_id=self.id, | ||||||
| @@ -212,7 +212,7 @@ class AutoShardedClient(Client): | |||||||
|         try: |         try: | ||||||
|             coro = websockets.connect(gateway, loop=self.loop, klass=DiscordWebSocket, compression=None) |             coro = websockets.connect(gateway, loop=self.loop, klass=DiscordWebSocket, compression=None) | ||||||
|             ws = await asyncio.wait_for(coro, loop=self.loop, timeout=180.0) |             ws = await asyncio.wait_for(coro, loop=self.loop, timeout=180.0) | ||||||
|         except Exception as e: |         except Exception: | ||||||
|             log.info('Failed to connect for shard_id: %s. Retrying...', shard_id) |             log.info('Failed to connect for shard_id: %s. Retrying...', shard_id) | ||||||
|             await asyncio.sleep(5.0, loop=self.loop) |             await asyncio.sleep(5.0, loop=self.loop) | ||||||
|             return (await self.launch_shard(gateway, shard_id)) |             return (await self.launch_shard(gateway, shard_id)) | ||||||
| @@ -265,7 +265,7 @@ class AutoShardedClient(Client): | |||||||
|  |  | ||||||
|         while True: |         while True: | ||||||
|             pollers = [shard.get_future() for shard in self.shards.values()] |             pollers = [shard.get_future() for shard in self.shards.values()] | ||||||
|             done, pending = await asyncio.wait(pollers, loop=self.loop, return_when=asyncio.FIRST_COMPLETED) |             done, _ = await asyncio.wait(pollers, loop=self.loop, return_when=asyncio.FIRST_COMPLETED) | ||||||
|             for f in done: |             for f in done: | ||||||
|                 # we wanna re-raise to the main Client.connect handler if applicable |                 # we wanna re-raise to the main Client.connect handler if applicable | ||||||
|                 f.result() |                 f.result() | ||||||
|   | |||||||
| @@ -240,7 +240,7 @@ class ConnectionState: | |||||||
|         return guild |         return guild | ||||||
|  |  | ||||||
|     def chunks_needed(self, guild): |     def chunks_needed(self, guild): | ||||||
|         for chunk in range(math.ceil(guild._member_count / 1000)): |         for _ in range(math.ceil(guild._member_count / 1000)): | ||||||
|             yield self.receive_chunk(guild.id) |             yield self.receive_chunk(guild.id) | ||||||
|  |  | ||||||
|     def _get_guild_channel(self, data): |     def _get_guild_channel(self, data): | ||||||
| @@ -423,7 +423,7 @@ class ConnectionState: | |||||||
|             emoji = self._upgrade_partial_emoji(emoji) |             emoji = self._upgrade_partial_emoji(emoji) | ||||||
|             try: |             try: | ||||||
|                 reaction = message._remove_reaction(data, emoji, raw.user_id) |                 reaction = message._remove_reaction(data, emoji, raw.user_id) | ||||||
|             except (AttributeError, ValueError) as e: # eventual consistency lol |             except (AttributeError, ValueError): # eventual consistency lol | ||||||
|                 pass |                 pass | ||||||
|             else: |             else: | ||||||
|                 user = self._get_reaction_user(message.channel, raw.user_id) |                 user = self._get_reaction_user(message.channel, raw.user_id) | ||||||
|   | |||||||
| @@ -281,7 +281,7 @@ async def async_all(gen, *, check=_isawaitable): | |||||||
|     return True |     return True | ||||||
|  |  | ||||||
| async def sane_wait_for(futures, *, timeout, loop): | async def sane_wait_for(futures, *, timeout, loop): | ||||||
|     done, pending = await asyncio.wait(futures, timeout=timeout, loop=loop) |     _, pending = await asyncio.wait(futures, timeout=timeout, loop=loop) | ||||||
|  |  | ||||||
|     if len(pending) != 0: |     if len(pending) != 0: | ||||||
|         raise asyncio.TimeoutError() |         raise asyncio.TimeoutError() | ||||||
|   | |||||||
| @@ -132,7 +132,6 @@ class VoiceClient: | |||||||
|     async def start_handshake(self): |     async def start_handshake(self): | ||||||
|         log.info('Starting voice handshake...') |         log.info('Starting voice handshake...') | ||||||
|  |  | ||||||
|         key_id, key_name = self.channel._get_voice_client_key() |  | ||||||
|         guild_id, channel_id = self.channel._get_voice_state_pair() |         guild_id, channel_id = self.channel._get_voice_state_pair() | ||||||
|         state = self._state |         state = self._state | ||||||
|         self.main_ws = ws = state._get_websocket(guild_id) |         self.main_ws = ws = state._get_websocket(guild_id) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user