aboutsummaryrefslogtreecommitdiff
path: root/discord/gateway.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Rewrite HTTP handling significantly.Rapptz2016-06-121-34/+4
| | | | | | | | | This should have a more uniform approach to rate limit handling. Instead of queueing every request, wait until we receive a 429 and then block the requesting bucket until we're done being rate limited. This should reduce the number of 429s done by the API significantly (about 66% avg). This also consistently checks for 502 retries across all requests.
* Actually read from the voice websocket & fix heartbeat.Jake2016-06-051-1/+1
| | | | | | This change makes it so that the buffer doesn't fill and the voice server drops the socket. Also, use correct interval for voice websocket heartbeat.
* Actually use v4 gateway and fixes thanks to Jake.Rapptz2016-06-021-5/+5
|
* Update voice client main ws references when reconnecting.Rapptz2016-06-011-0/+2
|
* Add RESUME support.Rapptz2016-06-011-9/+43
|
* Rename threading internal variable conflict.Rapptz2016-05-131-3/+3
|
* Force encoding of text retrieval functions to use utf-8.Rapptz2016-05-101-1/+1
| | | | Closes #207
* Add Game.type and Game.url attributes to change streaming status.Rapptz2016-05-061-1/+1
|
* Add a TimeoutError if VoiceClient.connect fails.Rapptz2016-05-061-1/+1
|
* Suppress ConnectionClosed on sending in the main websocket.Rapptz2016-05-061-2/+9
|
* Working multi-server voice support.Rapptz2016-05-011-40/+21
|
* Refactor voice websocket into gateway.pyRapptz2016-04-271-6/+184
|