aboutsummaryrefslogtreecommitdiff
path: root/discord/gateway.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove afk parameter from change_presenceAaron Hennessey2021-07-211-4/+4
|
* Allow use of orjson instead of jsonRapptz2021-07-071-3/+2
| | | | | | | The difference in speed seems negligible at start up, which is when most time is taken for actually parsing JSON. I could potentially be missing something but profiling didn't point to any discernable difference.
* Fix default hook signature Imayhaveborkedit2021-05-251-1/+1
| | | | Since the hook function can be both bound and unbound the bound signature needs to accept an extra argument
* Add vws message hook Imayhaveborkedit2021-05-231-3/+10
|
* Fix sending arrays with nulls in them when changing presencesRapptz2021-05-161-2/+4
|
* Remove support for guild subscriptions apple502j2021-04-141-1/+0
|
* First pass at supporting v8 APIRapptz2021-04-111-1/+1
|
* Remove userbot functionalityRapptz2021-04-041-10/+0
| | | | | This has a lot of legacy and cruft so there may be some stuff I've missed but this first pass is enough to get a clear separation.
* Modernize code to use f-stringsRapptz2021-04-041-4/+2
| | | | | This also removes the encoding on the top, since Python 3 does it by default. It also changes some methods to use `yield from`.
* Code optimisations and refactoring via SourceryNadir Chowdhury2021-02-241-9/+4
|
* Fix ZeroDivisionError in DiscordVoiceWebSocket.average_latencyRiley Shaw2021-02-181-1/+1
|
* Change copyright year to presentNihaal Sangha2021-01-151-1/+1
|
* Fix SyntaxError from PR implementing presences in member queryingRapptz2021-01-011-1/+1
|
* Implement presences for `Guild.query_members`Nadir Chowdhury2020-12-311-1/+2
|
* Add internal method to check if the websocket is currently ratelimitedRapptz2020-10-171-0/+9
|
* Fix disconnect when trying to move to another voice channel.Rapptz2020-10-171-1/+2
| | | | | | | | | | Not overly proud of this implementation but this allows the library to differentiate between a 4014 that means "move to another channel" or "move nowhere". Sometimes the VOICE_STATE_UPDATE comes before the actual websocket disconnect so special care had to be taken in that case. Fix #5904
* Check for zombie connections through last received payloadRapptz2020-09-231-1/+9
| | | | | | | The previous code would check zombie connections depending on whether HEARTBEAT_ACK was received. Unfortunately when there's exceeding backpressure the connection can terminate since the HEARTBEAT_ACK is buffered very far away despite it being there, just not received yet.
* Use a lock for the gateway rate limiter.Rapptz2020-09-231-5/+12
| | | | | This will allow for higher concurrency in AutoSharded situations where I can mostly "fire and forget" the chunk requests.
* Heartbeats bypass the rate limits for gatewayRapptz2020-09-231-3/+14
|
* Rewrite chunking to work with intents.Rapptz2020-09-231-1/+1
| | | | | | | | This slows down chunking significantly for bots in a large number of guilds since it goes down from 75 guilds/request to 1 guild/request. However the logic was rewritten to fire the chunking request immediately after receiving the GUILD_CREATE rather than waiting for all the guilds in the ready stream before doing it.
* Add more close codes that can't be handled for reconnecting.Rapptz2020-09-231-1/+1
|
* Handle gateway rate limits by using a rate limiter.Rapptz2020-09-231-0/+31
| | | | | With the new chunking changes this will become necessary and we don't want to disconnect from having too many outwards requests.
* Add support for guild intentsRapptz2020-09-231-0/+3
|
* Correct some protocol errors in v4 of voice gatewayRapptz2020-09-231-9/+8
|
* Guard uses of the keep alive thread in case they're NoneRapptz2020-09-091-3/+5
| | | | Fixes #5800
* Terminate connection if a close code couldn't be handledRapptz2020-08-061-1/+1
|
* Propagate manual close codes to socket subclassRapptz2020-08-051-5/+11
| | | | aiohttp seems to not set it during its state machine flow
* Use a subclass rather than monkey-patching for the websocketjack11422020-07-251-8/+3
|
* Add a timeout for receiving websocket messages.Rapptz2020-07-251-4/+8
|
* Handle Connection Reset by Peer connection errors.Rapptz2020-07-251-4/+10
| | | | | | | | | | | | This should work both on Windows and on Linux. Apparently these types of blips are considered normal for Discord. So rather than letting the reconnect logic handler expect these to be catastrophic, it should handle it specially so it doesn't waste an IDENTIFY for what ultimately should just be a small networking blip. This also makes it less noisy for the end-user as these complaints happen from time to time.
* Add shard related connection and resume events.Rapptz2020-07-251-0/+4
| | | | | | | These include: * on_shard_resumed * on_shard_connect * on_shard_disconnect
* Add before_identify_hook to have finer control over IDENTIFY syncingRapptz2020-07-251-1/+4
|
* Fix voice websocket connectionsRapptz2020-07-251-4/+5
|
* Rewrite gateway to use aiohttp instead of websocketsRapptz2020-07-251-57/+75
|
* Can't use %d in hereRapptz2020-07-251-3/+3
|
* Add shard ID to keep alive logger messagesRapptz2020-07-251-9/+9
|
* Rewrite of AutoShardedClient to prevent overlapping identifyRapptz2020-07-251-11/+11
| | | | This is experimental and I'm unsure if it actually works
* Add user_ids fields for query_membersTarek2020-05-291-2/+8
|
* Fix timeout issues with fetching members via query_membersRapptz2020-05-101-2/+6
| | | | | | | | | | | | This uses the nonce field to properly disambiguate queries. There's also some redesigning going on behind the scenes and minor clean-up. Originally I planned on working on this more to account for the more widespread chunking changes planned for gateway v7 but I realized that this would indiscriminately slow down everyone else who isn't planning on working with intents for now. I will work on the larger chunking changes in the future, should time allow for it.
* Bump blocking threshold from 5 seconds to 10 secondsRapptz2020-04-141-3/+3
|
* Add traceback to debug blocking issuesRapptz2020-04-141-1/+12
|
* Move log levels around to make INFO a little less noisyRapptz2020-04-061-3/+3
|
* Fix VoiceClient.average_latency erroring when heartbeat is NoneRapptz2020-04-061-2/+4
|
* Added VoiceClient.latency and VoiceClient.average_latencyFwf2020-04-041-3/+23
| | | | | This also implements the heartbeating a bit more consistent to the official Discord client.
* Change default close code to 4000 instead of 1000.Rapptz2020-04-041-1/+1
| | | | | | | | | | This prevents our sessions from being invalidated by Discord which caused a lot of failures when resuming. This caused an unnecessary amount of IDENTIFYs to happen depending on the circumstances. Closes #2631 See also discord/discord-api-docs#1472
* Downgrade unknown event logging to DEBUG rather than WARNINGRapptz2020-01-261-1/+1
| | | | It's too noisy
* Bump copyright year to 2020Rapptz2020-01-191-1/+1
| | | | Closes #2510
* Expose _ActivityTag as BaseActivity to easily refer to.Rapptz2020-01-141-3/+3
|
* Wait 5 seconds before IDENTIFYing with an invalidated session.Rapptz2019-12-171-0/+1
|
* The port is a big endian unsigned short.Lorenzo2019-12-061-3/+1
| | | See https://github.com/discordapp/discord-api-docs/pull/1244