aboutsummaryrefslogtreecommitdiff
path: root/discord/gateway.py
Commit message (Collapse)AuthorAgeFilesLines
* Disable compression for websockets.Rapptz2018-06-101-2/+2
| | | | 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-87/+65
|
* Fix invalid close errors on websockets 4.xRapptz2018-03-061-1/+1
| | | | Fixes #1110
* Split Game object to separate Activity subtypes for Rich Presences.Rapptz2018-03-051-9/+9
| | | | | | | | | | | 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.
* Fix websockets 4.0 supportBeatButton2018-02-121-4/+4
|
* Add intersphinxTobotimus2018-01-061-1/+1
|
* Reimplement zlib streaming.Rapptz2017-10-141-2/+13
| | | | | | | | | | | | | | 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.
* Revert "Implement zlib streaming for the gateway."Rapptz2017-10-141-14/+2
| | | | This reverts commit 462191a08b5b2efb83f5bc32935dc546d35a744b.
* Implement zlib streaming for the gateway.Rapptz2017-10-121-2/+14
|
* Use time.monotonic instead of time.time for heartbeat code.Rapptz2017-08-191-5/+5
|
* Add Client.latency, AutoShardedClient.latency and latencies.Rapptz2017-08-151-0/+2
| | | | | | 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-1/+4
| | | | | | | 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.
* Add DiscordWebSocket.latency to measure discord heartbeat latency.Rapptz2017-08-081-0/+9
|
* Fix missing lazy logging format calls.Rapptz2017-06-241-5/+5
| | | | Not sure how I missed these.
* Defer logging formatting until the logger is actually called.Rapptz2017-06-091-5/+5
| | | | | This would cause unnecessary format calls even if you didn't have logging enabled.
* Allow setting a presence upon logging in.Rapptz2017-05-201-0/+9
|
* Rename internal ConnectionState attribute to have an underscore.Rapptz2017-05-161-3/+3
| | | | | | Some people like to use that variable name apparently. See #568 and #569.
* Wait 5 seconds before attempting to RESUME during INVALIDATE_SESSION.Rapptz2017-04-221-0/+1
|
* Timeout when doing initial connection.Rapptz2017-04-221-1/+1
|
* Remove unused imports.Rapptz2017-04-181-4/+2
|
* Re-implement voice sending.Rapptz2017-04-181-22/+56
| | | | | | | | | | | | | | | | | | | | 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.
* Improve logging in more places.Rapptz2017-04-121-10/+17
| | | | | | 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.
* Add info logging for close codes we cannot handle.Rapptz2017-02-241-0/+1
|
* Don't RESUME when given sharding related close codes.Rapptz2017-02-151-1/+1
|
* Add missing continue statement in gateway futures.Rapptz2017-02-081-0/+1
|
* Handle HEARTBEAT_ACKRapptz2017-02-081-2/+24
|
* Rewrite RESUME logic to be more in line with what is requested.Rapptz2017-02-081-12/+7
| | | | | | 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.
* Add compatibility shim for asyncio.Future creation.Rapptz2017-01-251-1/+1
| | | | Should provide better support for uvloop.
* Update copyright year to 2017.Rapptz2017-01-201-1/+1
|
* Add AutoShardedClient.change_presence.Rapptz2017-01-081-16/+1
|
* Change the way shards are launched in AutoShardedClient.Rapptz2017-01-081-29/+0
|
* Implement AutoShardedClient for transparent sharding.Rapptz2017-01-071-23/+57
| | | | | This allows people to run their >2,500 guild bot in a single process without the headaches of IPC/RPC or much difficulty.
* Move message creation to a factory method inside ConnectionState.Rapptz2017-01-031-7/+5
|
* Absolute import some circular dependencies to appease Python 3.4.Rapptz2017-01-031-5/+8
|
* Rename Server to Guild everywhere.Rapptz2017-01-031-6/+6
|
* Discard null sequences in the gateway.Rapptz2016-12-161-4/+4
| | | | | This was forbidding the Discord gateway from allowing us to RESUME properly, causing an over-abundance of READY being called.
* Fix typo in change_presence validation messagekhazhyk2016-10-151-1/+1
|
* Add support for "Do Not Disturb" and "Invisible" statuses.Rapptz2016-09-261-6/+16
| | | | | This deprecates Client.change_status in favour of the newer and more correct Client.change_presence.
* Remove unused endpoints.py file.Rapptz2016-09-251-1/+1
|
* Fix gateway code to work with websockets 3.2.Rapptz2016-08-251-1/+2
|
* Ensure that keep alive threads are closed when a websocket closes.Rapptz2016-08-211-4/+5
| | | | | | | | | | The library worked with the assumption that whenever the recv call for the websocket would lead to a closure, the close method would be called to signal closure and as a result our close method would be called. This assumption turned out to be false as the websockets library would instead call an internal function named close_connection instead. So to solve our problem we need to override this function instead of close.
* Handle receiving HEARTBEAT opcode.Rapptz2016-07-301-0/+5
|
* Begin working on gateway v6 changes.Rapptz2016-07-131-1/+1
| | | | | The first batch of changes are related to channel types and group direct messages. Support these first so READY begins parsing.
* Ignore HEARTBEAT_ACK for now to disable the noisy logging.Rapptz2016-06-271-0/+3
|
* Guild Sharding supportcookie2016-06-261-0/+5
|
* Support for v5 Gateway.Rapptz2016-06-221-5/+32
|
* Attempt resume when we receive a 1001.Rapptz2016-06-161-1/+1
|
* Fix sed error involved in creation of voice websocket.Rapptz2016-06-121-1/+1
|
* Support more close codes for RESUME.Rapptz2016-06-121-1/+1
|