2402 Commits

Author SHA1 Message Date
Rapptz
137ff34f3a If we're out of retries just raise the OSError 2020-07-25 09:59:40 -04:00
Rapptz
e2f42597a5 Handle Connection Reset by Peer connection errors.
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.
2020-07-25 09:59:40 -04:00
Rapptz
8070d39a23 Add shard related connection and resume events.
These include:
* on_shard_resumed
* on_shard_connect
* on_shard_disconnect
2020-07-25 09:59:39 -04:00
Rapptz
80cc5b5edb Handle connection errors during reidentify flow. 2020-07-25 09:59:39 -04:00
Rapptz
f658fcf164 Make every shard maintain its own reconnect loop
Previously if a disconnect happened the client would get in a bad state
and certain shards would be double sending due to unhandled exceptions
raising back to Client.connect and causing all shards to be reconnected
again.

This new code overrides Client.connect to have more finer control and
allow each individual shard to maintain its own reconnect loop and then
serially request reconnection to ensure that IDENTIFYs are not
overlapping.
2020-07-25 09:59:39 -04:00
Rapptz
394b514cc9 Add before_identify_hook to have finer control over IDENTIFY syncing 2020-07-25 09:59:39 -04:00
Rapptz
9c7ae6b9dc Fix READY not firing for multi-processed AutoShardedClient clusters 2020-07-25 09:59:38 -04:00
Rapptz
058a1e608b Fix voice websocket connections 2020-07-25 09:59:38 -04:00
Rapptz
988505a97f Use a proper type for the event queue 2020-07-25 09:59:38 -04:00
Rapptz
b8154e365f Rewrite gateway to use aiohttp instead of websockets 2020-07-25 09:59:38 -04:00
Rapptz
45cb231161 Fix AttributeError on reconnection 2020-07-25 09:59:38 -04:00
Rapptz
3afbbf5e47 Can't use %d in here 2020-07-25 09:59:37 -04:00
Rapptz
ba35c2b9bf Add shard ID to keep alive logger messages 2020-07-25 09:59:37 -04:00
Rapptz
09ecb16680 Rewrite of AutoShardedClient to prevent overlapping identify
This is experimental and I'm unsure if it actually works
2020-07-25 09:59:37 -04:00
Jaime Garcia Jr
1c3b0c02f8 Add revisions to check_once docs 2020-07-24 09:18:42 -05:00
Jaime Garcia Jr
5813593d6e Add documentation on bot_check_once 2020-07-23 12:19:10 -05:00
Rapptz
2628949cda Add a changelog entry for v1.3.4 2020-07-22 23:37:33 -04:00
AXVin
f5289a30a7 Fix typo in on_socket_raw_send documentation 2020-07-22 23:19:37 -04:00
SebbyLaw
b43658f6ff [commands] Add documentation for exceptions in Context.(re)invoke 2020-07-22 23:18:30 -04:00
SebbyLaw
9b24ff4f77 Add gray alias for discord.Colour 2020-07-22 23:18:29 -04:00
jack1142
901290c8a2 [commands] GroupView.get_command shouldn't raise errors for empty names 2020-07-22 23:16:43 -04:00
Skezza
4a686e11ba Added exception documentation for Guild.create_voice_channel 2020-07-22 23:16:43 -04:00
Skezza
2552a268cb Add double backticks for some parameter mentions in the documentation. 2020-07-22 23:15:16 -04:00
jack1142
1ca257bb68 Add Guild.change_voice_state to control our voice state. 2020-07-22 23:13:29 -04:00
Rapptz
4de01212a4 Fix detection of some JPEG images without JFIF or Exif info
Closes #5143
2020-07-21 22:56:51 -04:00
Rapptz
0bc15fa130 Don't use a namedtuple for _Overwrites
Fix #5109
2020-07-08 23:18:13 -04:00
Tarek
a92e3e7b6b Fix TypeError when not specifying roles. 2020-07-08 23:12:10 -04:00
NCPlayz
3408695a37 [docs] fix reference to Guild and document utils.resolve_template 2020-07-08 23:01:00 -04:00
James
475762e8df Document raises for Converter.convert 2020-07-08 23:01:00 -04:00
James
61216112d0 Add a licence and encoding declaration to missing files 2020-07-08 23:01:00 -04:00
Nadir Chowdhury
e971e2f16c
Allow more methods to set an audit log reason 2020-06-30 23:35:42 -04:00
Znunu
de556b01d1
Allow Webhook to be hashable and comparable 2020-06-30 23:33:54 -04:00
Skezza
c3bca7ec73
Documentation formatting 2020-06-30 23:32:00 -04:00
Skezza
e7500f738c
Fix typo with voice_client documentation 2020-06-30 07:17:33 -04:00
NCPlayz
ce03c62c6b [bugs] stop resolving Object for template/invite; remove dupe methods 2020-06-29 16:58:19 +01:00
Nadir Chowdhury
b68cbb7a42
Add support for bulk editing role positions 2020-06-28 14:52:32 -04:00
Nadir Chowdhury
a64006ee9b
Add support for integrations 2020-06-28 14:50:43 -04:00
Nadir Chowdhury
2b3c6e0d47
Add support for Discord templates 2020-06-28 14:48:04 -04:00
Sebastian Law
7a07644de3
[commands] Raise TypeError when Optional is used with Greedy converter 2020-06-28 03:54:34 -04:00
Josh
6b5be39cd2
[tasks] Fix issue with default error handler in class context 2020-06-28 03:53:29 -04:00
jack1142
84098ed824
[commands] Add a new exception class for command registration errors 2020-06-28 03:48:07 -04:00
Sebastian Law
b4b953bfc6
Fix various inconsistencies within the documentation (#5067) 2020-06-28 03:45:58 -04:00
Rapptz
f94b00cb48 Fix a KeyError for channels with no category in Guild.by_category 2020-06-27 05:27:47 -04:00
Rapptz
c01bf7cd56 Fix Guild.by_category not showing empty categories. 2020-06-27 04:06:49 -04:00
Rapptz
de7c96333c Update Message.system_content join strings to be up to date.
Fixes #4211
2020-06-27 03:45:27 -04:00
Tsumiki
5cbbbca193
Add versionadded to VoiceClient latency and average_latency 2020-06-26 22:57:32 -04:00
Tarek
4bdebcd339
Fix error raised when using the roles parameter. 2020-06-26 22:54:02 -04:00
Anurag
08af907807
Change PartialInviteGuild.icon_url_as to mimic Guild.icon_url_as 2020-06-26 22:52:36 -04:00
Jeffrey
4078d64520 Fix reconnecting loop due to failed handshake on region change 2020-06-22 04:00:40 -04:00
NCPlayz
a2148d6d1a Escape masked URLs; Support quotes for as_needed 2020-06-17 16:31:48 +01:00