Commit Graph
100 Commits
Author SHA1 Message Date
Rapptz 9036b9651b Properly handle disconnects in voice when force disconnected 2020-09-23 03:20:35 -04:00
Rapptz e3922e24d9 Correct some protocol errors in v4 of voice gateway 2020-09-23 03:20:35 -04:00
Rapptz 0b93fa3a82 Implement VoiceProtocol lower level hooks.
This allows changing the connect flow and taking control of it without
relying on internal events or tricks.
2020-09-23 03:20:35 -04:00
Rapptz ab5e175b25 Use quotes when installing in the README
Other shells have a hard time with square brackets.

Closes #5821
2020-09-21 03:39:19 -04:00
Rapptz 9978288346 Update issue template to redirect to discussions 2020-09-18 04:21:32 -04:00
Rapptz aa258073dc Add labels to the issue templates 2020-09-17 22:16:20 -04:00
Rapptz a183c4f752 Completely update member references from message inner members.
Fixes #5819
2020-09-17 02:45:53 -04:00
Rapptz 986adae108 Revert "Add fetch_message_fast using history endpoint"
This reverts commit a309088ae4.

A rate limited was added to this method after 5 years defeating the
purpose of it.
2020-09-14 01:18:09 -04:00
Rapptz 4ccd9c1591 Remove caching from AutoShardedClient.shards 2020-09-10 05:17:25 -04:00
Rapptz ccdf4c4ad6 [tasks] Lazily fetch event loop if one isn't provided
Fixes #5808
2020-09-10 00:00:58 -04:00
Rapptz 450e71f086 Add a more concrete exception for 500 status codes.
Fixes #5797
2020-09-09 21:24:14 -04:00
Rapptz f8808dba9b Guard uses of the keep alive thread in case they're None
Fixes #5800
2020-09-09 21:18:41 -04:00
Rapptz e6017a2170 Handle cloudflare bans on webhook requests
Fixes #5221
2020-09-09 21:17:28 -04:00
Rapptz 425bb809ed Add logging to webhooks
Fixes #5798
2020-09-09 20:46:16 -04:00
Rapptz 0a7e2f7c2f [commands] BadBooleanArgument -> BadBoolArgument 2020-09-04 08:47:07 -04:00
Rapptz 4203e7a5a8 [commands] Use edited timestamp if provided for cooldown timing 2020-08-25 23:15:26 -04:00
Rapptz 38ebef8c16 Version bump for development purposes 2020-08-22 17:19:47 -04:00
Rapptz 11f29890dc Fix bug with Guild.by_category not showing some channels
If categories come after a child channel in the dictionary mapping for
whatever reason, then the previous code would remove it from the
mapping and set it to []. This commit aims to fix this.
2020-08-22 17:18:48 -04:00
Rapptz 45752ab354 Document merging behaviour of AllowedMentions in Messageable.send 2020-08-22 17:14:02 -04:00
Rapptz 00d39704da Version bump to 1.4.1 2020-08-09 01:12:45 -04:00
Rapptz 6388bc7b29 Add changelog for 1.4.1 2020-08-09 01:12:32 -04:00
Rapptz 5dd8e372e4 Terminate connection if a close code couldn't be handled 2020-08-06 09:25:01 -04:00
Rapptz 9048914756 Version bump to 1.4 2020-08-05 22:05:21 -04:00
Rapptz 8d16a61e02 Add changelog for 1.4 2020-08-05 22:04:20 -04:00
Rapptz 09f432016c [commands] Restart subcommand_passed chain on invoke
Fix #5198
2020-08-05 08:36:45 -04:00
Rapptz 250f29989b Be defensive in case Discord breaks something with WS URLs again 2020-08-05 08:35:43 -04:00
Rapptz 78851bf1d8 Require people to use templates when making an issue 2020-08-05 04:40:31 -04:00
Rapptz 3a1a215f8b Propagate manual close codes to socket subclass
aiohttp seems to not set it during its state machine flow
2020-08-05 04:27:11 -04:00
Rapptz a9824ffabf Fix endpoint strings with :443 instead of :80
Fix #5191
Close #5188
2020-08-05 04:21:27 -04:00
Rapptz 14fd3dbaa7 Optimize Channel.permissions_for by not creating temporary objects
This seemed to have shaved a few microseconds:
10.8 µs ± 79.6 ns per loop → 8.53 µs ± 48.1 ns per loop
12 µs ± 613 ns per loop → 8.72 µs ± 30.2 ns per loop

With 100K loops each
2020-08-01 19:48:15 -04:00
Rapptz 50f4c31d31 Terminate shard processing queue when a clean close is encountered.
Fix #5180
2020-08-01 19:26:49 -04:00
Rapptz b77af19939 Fix AttributeError from internal queue being double underscore. 2020-07-25 10:32:32 -04:00
Rapptz 7ed26db3b3 Add an exposed way to extract shard-specific information.
Closes #2654
2020-07-25 09:59:41 -04:00
Rapptz a42bebe581 Propagate exceptions when an unhandled error happens 2020-07-25 09:59:40 -04:00
Rapptz ec3c3eb4c6 Update message references in AutoShardedConnectionState
Fixes #5133
2020-07-25 09:59:40 -04:00
Rapptz d37b91dfc6 Add guild_ready_timeout to control the timeout of GUILD_CREATE stream
This also fixes a timing issue where READY would take far too long to
load for big bot authors.

Closes #4112
2020-07-25 09:59:40 -04:00
Rapptz e0660ef8a6 Add a timeout for receiving websocket messages. 2020-07-25 09:59:40 -04:00
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
Rapptz 2628949cda Add a changelog entry for v1.3.4 2020-07-22 23:37:33 -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
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
Rapptz cbdf660ddc Document that sleep_until considers naive datetimes as UTC. 2020-05-29 02:59:31 -04:00
Rapptz 1ee1b7feea Consistent usage of RST inline code within Guild.features references 2020-05-23 22:05:59 -04:00
Rapptz 66c6be50d8 Prepare for the discord.com domain rename 2020-05-23 21:44:30 -04:00
Rapptz 13a3f760e6 Fix timeout issues with fetching members via query_members
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.
2020-05-10 19:35:45 -04:00
Rapptz 1f73e18bc6 Make use_cached keyword only 2020-05-03 01:58:52 -04:00
Rapptz e473f3c775 Convert id parameter of Object into int or raise TypeError on failure
This prevents breakage for users who pass in a str as an ID whereas
it previously worked.

Fix #4002
2020-04-19 18:33:03 -04:00
Rapptz 0d5e6e213c Decrement Guild.member_count even if member is not cached
Fix #4021
2020-04-19 18:22:41 -04:00
Rapptz 9f47d7f71c Fix cases where member_count is equal to 0
Fixes #4008, #4005
2020-04-16 23:30:59 -04:00
Rapptz 540a88b762 [tasks] Replace stack-based implementation with a cleaner one. 2020-04-14 04:56:52 -04:00
Rapptz d5211fb327 [tasks] Create different Loop objects for different instances
Fixes #2294
2020-04-14 04:35:49 -04:00
Rapptz 11211d48eb Bump blocking threshold from 5 seconds to 10 seconds 2020-04-14 04:22:05 -04:00
Rapptz d6be6adf8b Add traceback to debug blocking issues 2020-04-14 04:21:20 -04:00
Rapptz 874c2cd3c9 [commands] Raise CheckFailure if all bot "check once" fail
Fix #2643
2020-04-06 21:45:16 -04:00
Rapptz 8874aa3dd2 Move log levels around to make INFO a little less noisy 2020-04-06 05:22:57 -04:00
Rapptz 9a52786aa9 Bump version for development 2020-04-06 05:00:33 -04:00
Rapptz 7433cf3b16 Fix VoiceClient.average_latency erroring when heartbeat is None 2020-04-06 04:58:27 -04:00
Rapptz 8ff285fcbc Documentation fixups for allowed mentions 2020-04-04 13:32:47 -04:00
Rapptz d853a57e86 Rename allowed mention parameters to allowed_mentions 2020-04-04 13:22:51 -04:00
Rapptz 730d79d60a Allow introspection and setting of global allowed mention configuration 2020-04-04 12:49:39 -04:00
Rapptz 481b335f2d Fix various implementation bugs with allowed mentions 2020-04-04 12:45:17 -04:00
Rapptz 041785937e Add support for configuring allowed mentions per message or bot wide. 2020-04-04 07:40:51 -04:00
Rapptz 6c764465c0 Fix regression with Member.activities not clearing 2020-04-04 03:17:31 -04:00
Rapptz baffe564e5 Version bump to v1.3.3 2020-04-04 01:50:13 -04:00
Rapptz 465438fb3c Add changelog for v1.3.3 2020-04-04 01:47:01 -04:00
Rapptz 403651a144 Change default close code to 4000 instead of 1000.
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
2020-04-04 01:42:08 -04:00
Rapptz 5e63357508 Bump version to v1.3.2 2020-02-22 19:35:42 -05:00
Rapptz 07720fabd4 Add changelog for v1.3.2 2020-02-22 19:33:27 -05:00
Rapptz 00f6562728 Suppress missing Content-Type headers when fetching content
Fixes #2572
2020-02-22 19:07:17 -05:00
Rapptz 4cf5f792d4 Fix Webhook.send returning an empty string when wait=False 2020-02-16 21:52:20 -05:00
Rapptz af6a5efa53 Fix crashes when Message.guild is Object 2020-02-16 21:52:20 -05:00
Rapptz bb1c1e9fa3 [commands] Raise when passing invalid permission keys in their checks 2020-02-02 19:11:50 -05:00
Rapptz cbca33e44f Guard against the member data not being available in VOICE_STATE_UPDATE 2020-02-01 23:48:09 -05:00
Rapptz 25a04ed135 Better detection for Cloudflare related 429s.
At some point Cloudflare started returning some JSON. I don't know how
this JSON looks like.

See #2544
2020-02-01 23:46:28 -05:00
Rapptz 3b8678da81 Use member data from VOICE_STATE_UPDATE if not found in cache 2020-02-01 23:40:25 -05:00
Rapptz 5c7df3d943 Bump waiting time of GUILD_CREATE stream by number of shards waited.
2 seconds might be too short and cause it to finish waiting while other
shards are still IDENTIFYing.
2020-01-28 23:56:46 -05:00
Rapptz 8767c478ed Version bump to v1.3.1 2020-01-26 17:40:34 -05:00
Rapptz 090110eaf6 Add changelog for v1.3.1 2020-01-26 17:40:08 -05:00
Rapptz b9e6ed28a4 Downgrade unknown event logging to DEBUG rather than WARNING
It's too noisy
2020-01-26 09:22:42 -05:00
Rapptz d5589dcc27 Document the new opus loading behaviour 2020-01-25 22:21:14 -05:00
Rapptz 0033cc83ef Fix fetching invites on guilds the user is not in 2020-01-25 03:29:14 -05:00
Rapptz a2a02ea945 Version bump to v1.3 2020-01-24 19:32:25 -05:00
Rapptz 215fed831c Mention that you can create Permissions via kwargs now 2020-01-23 00:04:45 -05:00
Rapptz 2ba28bbfe2 One last superfluous .0 in versionadded 2020-01-22 21:12:02 -05:00