aboutsummaryrefslogtreecommitdiff
path: root/discord/shard.py
Commit message (Collapse)AuthorAgeFilesLines
* Disable compression for websockets.Rapptz2018-06-101-1/+1
| | | | Increase of RAM and CPU doesn't give me much benefit I feel.
* Remove dead package references.Rapptz2018-06-101-1/+1
|
* Drop support for Python 3.4 and make minimum version 3.5.2.Rapptz2018-06-101-54/+37
|
* Split Game object to separate Activity subtypes for Rich Presences.Rapptz2018-03-051-9/+15
| | | | | | | | | | | This is a massive breaking change. * All references to "game" have been renamed to "activity" * Activity objects contain a majority of the rich presence information * Game and Streaming are subtypes for memory optimisation purposes for the more common cases. * Introduce a more specialised read-only type, Spotify, for the official Spotify integration to make it easier to use.
* Add intersphinxTobotimus2018-01-061-3/+3
|
* Fixed a zero division error when accessing latenciesverixx2017-11-121-1/+3
| | | | | | | | | | | | | | | | | | When accessing the latencies property on an AutoShardedClient when none of shards are ready, we get a ZeroDivisionError. An example of this can be seen here. ```py class StatsBot(commands.AutoShardedBot): def __init__(self): super().__init__(command_prefix=None) self._add_commands() def _add_commands(self): '''Adds commands automatically''' for name, attr in inspect.getmembers(self): if isinstance(attr, commands.Command): self.add_command(attr) ``` When iterating through this custom client's it accesses the latencies property when no shards are ready, therefore it raises the error. A quick fix for this would be to return None if no shards are ready.
* Reimplement zlib streaming.Rapptz2017-10-141-12/+30
| | | | | | | | | | | | | | This time with less bugs. It turned out that the crash was due to a synchronisation issue between the pending reads and the actual shard polling mechanism. Essentially the pending reads would be cancelled via a simple bool but there would still be a pass left and thus we would have a single pending read left before or after running the polling mechanism and this would cause a race condition. Now the pending read mechanism is properly waited for before returning control back to the caller.
* Add Client.latency, AutoShardedClient.latency and latencies.Rapptz2017-08-151-0/+18
| | | | | | This should allow an easier way to query the Discord protocol gateway latency, defined by the difference HEARTBEAT_ACK between and the last sent HEARTBEAT.
* Add heartbeat_timeout to the Client options.Rapptz2017-08-081-0/+1
| | | | | | | This setting configures how long before a timeout event is emitted internally and disconnects the websocket. Since some users were experiencing issues with the gateway not responding, this should help mitigate the issue for those with poor PCs.
* Rename internal ConnectionState attribute to have an underscore.Rapptz2017-05-161-8/+8
| | | | | | Some people like to use that variable name apparently. See #568 and #569.
* Make sure that websockets.connect is a coroutine.Rapptz2017-05-091-2/+11
| | | | | | | | | | In 3.5.0 and 3.5.1 asyncio.ensure_future requires a Future or a coroutine otherwise a TypeError is raised. The issue is that the websockets.connect call is an awaitable rather than a coroutine. asyncio.ensure_future did not gain support for awaitables until 3.5.2. This patch allows 3.5.0 and 3.5.1 to connect regardless of their python version.
* Timeout when doing initial connection.Rapptz2017-04-221-9/+17
|
* Remove unused imports.Rapptz2017-04-181-1/+1
|
* Properly cleanup of VoiceClients in cache.Rapptz2017-04-181-0/+6
|
* Re-implement voice sending.Rapptz2017-04-181-0/+5
| | | | | | | | | | | | | | | | | | | | This is a complete redesign of the old voice code. A list of major changes is as follows: * The voice websocket will now automatically reconnect with exponential back-off just like the regular Client does. * Removal of the stream player concept. * Audio now gracefully pauses and resumes when a disconnect is found. * Introduce a discord.AudioSource concept to abstract streams * Flatten previous stream player functionality with the VoiceClient, e.g. player.stop() is now voice_client.stop() * With the above re-coupling this means you no longer have to store players anywhere. * The after function now requires a single parameter, the error, if any existed. This will typically be None. A lot of this design is experimental.
* Use create_future wrapper for initially created Future.Rapptz2017-04-121-1/+1
|
* Improve logging in more places.Rapptz2017-04-121-2/+1
| | | | | | This shows the Shard ID in more places, along with a gateway trace and session ID. Also helps show the RESUME/IDENTIFY/RESUMED/READY flow a bit more instead of it looking like the connection has zombied out.
* Proper recursion when launching shards.Rapptz2017-04-071-1/+1
|
* Aggregate shard closing futures instead of doing them sequentially.Rapptz2017-03-211-3/+2
|
* Check if we're closed before attempting to do a reconnect.Rapptz2017-03-211-1/+2
|
* Add experimental reconnection logic.Rapptz2017-02-151-21/+6
|
* Rewrite RESUME logic to be more in line with what is requested.Rapptz2017-02-081-4/+3
| | | | | | Apparently we should always try to RESUME first and if we get INVALIDATE_SESSION then we should IDENTIFY instead. This is the preferred way to do RESUMEs.
* Make all public is_ functions into methods instead of properties.Rapptz2017-01-291-3/+2
|
* Add option to disable auto member chunking.Rapptz2017-01-231-22/+36
|
* Update copyright year to 2017.Rapptz2017-01-201-1/+1
|
* Fix AutoShardedClient docstring.Rapptz2017-01-161-1/+1
|
* Remove extraneous prints.Rapptz2017-01-081-2/+0
|
* Allow overriding the shard_ids used for initial shard launch.Rapptz2017-01-081-2/+21
|
* Add AutoShardedClient.change_presence.Rapptz2017-01-081-0/+60
|
* Change the way shards are launched in AutoShardedClient.Rapptz2017-01-081-6/+58
|
* Implement AutoShardedClient for transparent sharding.Rapptz2017-01-071-0/+174
This allows people to run their >2,500 guild bot in a single process without the headaches of IPC/RPC or much difficulty.