-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix various inconsistencies within the documentation #5067
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…orted operations containers
diceroll123
added a commit
to diceroll123/discord.py
that referenced
this pull request
Dec 5, 2020
* Fix incorrect class reference in documentation * Fix minor markdown typo in migrating.rst * Support discord.com/invite URL in resolve_invite * Fix TypeError on missing shard_id kwarg * Escape masked URLs; Support quotes for as_needed * Fix reconnecting loop due to failed handshake on region change * Change PartialInviteGuild.icon_url_as to mimic Guild.icon_url_as * Fix error raised when using the roles parameter. * Add versionadded to VoiceClient latency and average_latency * Update Message.system_content join strings to be up to date. Fixes Rapptz#4211 * Fix Guild.by_category not showing empty categories. * Fix a KeyError for channels with no category in Guild.by_category * Fix various inconsistencies within the documentation (Rapptz#5067) * [commands] Add a new exception class for command registration errors * [tasks] Fix issue with default error handler in class context * [commands] Raise TypeError when Optional is used with Greedy converter * Add support for Discord templates * Add support for integrations * Add support for bulk editing role positions * [bugs] stop resolving Object for template/invite; remove dupe methods * Fix typo with voice_client documentation * Documentation formatting * Allow Webhook to be hashable and comparable * Allow more methods to set an audit log reason * Add a licence and encoding declaration to missing files * Document raises for Converter.convert * [docs] fix reference to `Guild` and document `utils.resolve_template` * Fix TypeError when not specifying roles. * Don't use a namedtuple for _Overwrites Fix Rapptz#5109 * Fix detection of some JPEG images without JFIF or Exif info Closes Rapptz#5143 * Add Guild.change_voice_state to control our voice state. * Add double backticks for some parameter mentions in the documentation. * Added exception documentation for Guild.create_voice_channel * [commands] GroupView.get_command shouldn't raise errors for empty names * Add gray alias for discord.Colour * [commands] Add documentation for exceptions in Context.(re)invoke * Fix typo in on_socket_raw_send documentation * Add a changelog entry for v1.3.4 * Add documentation on bot_check_once * Add revisions to check_once docs * Rewrite of AutoShardedClient to prevent overlapping identify This is experimental and I'm unsure if it actually works * Add shard ID to keep alive logger messages * Can't use %d in here * Fix AttributeError on reconnection * Rewrite gateway to use aiohttp instead of websockets * Use a proper type for the event queue * Fix voice websocket connections * Fix READY not firing for multi-processed AutoShardedClient clusters * Add before_identify_hook to have finer control over IDENTIFY syncing * 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. * Handle connection errors during reidentify flow. * Add shard related connection and resume events. These include: * on_shard_resumed * on_shard_connect * on_shard_disconnect * 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. * If we're out of retries just raise the OSError * Add a timeout for receiving websocket messages. * 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 Rapptz#4112 * Update message references in AutoShardedConnectionState Fixes Rapptz#5133 * Use a subclass rather than monkey-patching for the websocket * Propagate exceptions when an unhandled error happens * Add an exposed way to extract shard-specific information. Closes Rapptz#2654 * Fix AttributeError from internal queue being double underscore. * Fix NameError with resolving codes with Template * Specify where to get max_members in documentation * Fix typo when creating a guild via template * Terminate shard processing queue when a clean close is encountered. Fix Rapptz#5180 * 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 * Fix AttributeError when fetching reactions without cache * Fix gramatical error in Client guild_subscriptions docs * [tasks] Remove HTTPException as an exception to silently continue for * Fix endpoint strings with :443 instead of :80 Fix Rapptz#5191 Close Rapptz#5188 * Propagate manual close codes to socket subclass aiohttp seems to not set it during its state machine flow * Require people to use templates when making an issue * Fix NameError and AttributeError in Template and Integrations * Be defensive in case Discord breaks something with WS URLs again * [commands] Restart subcommand_passed chain on invoke Fix Rapptz#5198 * [commands] Provide a way to retrieve time left for a cooldown * [commands] implement HelpCommand.add/remove_check * Add missing comma in template.py * Fix a typo with webhook documentation * Fixed a typo in message unpinning docs * Add remaining user flags * Add changelog for 1.4 * Version bump to 1.4 * Terminate connection if a close code couldn't be handled * Fix error when trying to clear empty image/thumbnail in embeds * Extend __path__ with pkgutil to allow editable extensions * Add changelog for 1.4.1 * Version bump to 1.4.1 * Document on_error "special" behavior * Add South Korea VoiceRegion * update the docs on RawReactionActionEvent.member * Fix letter to be consistent with the rest of the docs * Fix hyperlink reference to PartialInviteChannel in Client * Document merging behaviour of AllowedMentions in Messageable.send * 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. * Version bump for development purposes * Fix issue with empty overwrites Fixes Rapptz#5756. * [commands] Use edited timestamp if provided for cooldown timing * [tasks] Don't update _next_iteration on retry * [commands] Added ColorConverter alias * Don't call close() if we've already been closed in Client.run * Added __eq__ to Message * Add COMMUNITY to Guild.features * Classmethods all and none for AllowedMentions * [commands] Add subclasses of BadArgument for converters * [commands] BadBooleanArgument -> BadBoolArgument * [commands] add require_var_positional * [docs] remove unresolved doc refs, fix attribute ref * [commands] Update Bot.command() decorator docs * Add fetch_message_fast using history endpoint * Add discord.Colour classmethod dark_theme * Fix Member.joined_at documentation * [commands] Fix exception raised in Command invoke hooks. * [commands] Correct command removing during cog injecting * Fix comparison for overwrites when checking if a channel is synced * Add logging to webhooks Fixes Rapptz#5798 * Handle cloudflare bans on webhook requests Fixes Rapptz#5221 * Guard uses of the keep alive thread in case they're None Fixes Rapptz#5800 * Add a more concrete exception for 500 status codes. Fixes Rapptz#5797 * [tasks] Lazily fetch event loop if one isn't provided Fixes Rapptz#5808 * Remove caching from AutoShardedClient.shards * Add missing permission in clone documentation * Revert "Add fetch_message_fast using history endpoint" This reverts commit a309088. A rate limited was added to this method after 5 years defeating the purpose of it. * Completely update member references from message inner members. Fixes Rapptz#5819 * Add labels to the issue templates * Update issue template to redirect to discussions * issue/PR templates: use h2 instead of h3 `h2` is the semantically correct heading here, as `h1` is for document titles and `h2` is for the top level headings within a document. `h3` should be used for subheadings of `h2` headings. * Add competing activity type * Fix allowed_mentions when sending files * Add bot.listen() suggestion to on_message faq * Remove namedtuples to better future guard the library * Use quotes when installing in the README Other shells have a hard time with square brackets. Closes Rapptz#5821 * Add support for message_reference on Message object * Fix and add documentation * Implement VoiceProtocol lower level hooks. This allows changing the connect flow and taking control of it without relying on internal events or tricks. * Correct some protocol errors in v4 of voice gateway * Fix issues with VoiceProtocol docstrsings. * Properly handle disconnects in voice when force disconnected * Add support for guild intents * Handle gateway rate limits by using a rate limiter. With the new chunking changes this will become necessary and we don't want to disconnect from having too many outwards requests. * Change unknown cache log warnings from WARNING -> DEBUG * Add more close codes that can't be handled for reconnecting. * Rewrite chunking to work with intents. 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. * Handle user updates within GUILD_MEMBER_UPDATE * All guilds require chunking if opting into it * Heartbeats bypass the rate limits for gateway * Use a lock for the gateway rate limiter. This will allow for higher concurrency in AutoSharded situations where I can mostly "fire and forget" the chunk requests. * Maximize concurrency when chunking on AutoSharded clients * Speed up chunking for guilds with presence intent enabled * Check for zombie connections through last received payload 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. * Maximize the amount of concurrency while chunking. In order to reduce our amount of backpressure we need to limit the amount of concurrent chunk requests we can have so the gateway buffer has some time to breathe. * Fix timeouts due to hitting the gateway rate limit * Explicitly disable the members presence by default * Add versionadded for intents enum * Fix Client.request_offline_members no longer working * Add Guild.chunk and deprecated Client.request_offline_members * Don't cache members during guild start up if cache is disabled. This is mainly a half-implemented commit. There are a few more places where cache consistency is necessary. In the future there will probably be a member cache policy enum that will be used and cache consistency will be tackled in part of that larger refactoring. * Raise if member intent is not enabled * Allow finer grained control over the member cache. * Intern status and overwrite strings * Pass default intents if not explicitly given * Add a special exception for required privileged intents * Default MemberCacheFlags based on intents * Some documentation fixes for MemberCacheFlags and Intents * Fix up wording in MemberCacheFlags exception * Disable voice cache in weird intent configurations. * Fix presence intent docstring * Mention potential Guild.member_count accuracy issues * Add documentation for gateway intents * Use /invites/ instead of /invite/ * Use delete_message_days instead of delete-message-days * Add support for flag alias * Fix typos in Intents documentation * Add chunk_guilds_at_startup and deprecate fetch_offline_members * More intent related documentation * More intent documentation. Mention that you can downgrade the library to revert. Also mention that intents need to be updated in the code as well as the developer portal. * Fix typo in ValueError message * Make Intent class creation more intuitive * Fixed incorrectly named 'Intent' class in doc. `Intent.members` -> `Intents.members`. * Add Client.intents to query the current intents Closes Rapptz#5854 * Update intents with small typo fixes * Guard GUILD_MEMBER_ADD/GUILD_MEMBER_REMOVE from errors If the guilds intent is disabled all guilds are unavailable. This means we don't receive a member_count attribute and cannot update it. * Add warning if guilds intent is disabled. * Add changelog for v1.5.0 * Add changelog for v1.4.2 * Version bump to v1.5.0 * Some minor documentation fixes. Make examples all mention where to put it for the unaware. * Add intents to examples * Add intents to event reference * Update intent documentation to use defaults * Add intents to the issue template * Add note pointing to discord.AllowedMentions * Fix typo in event reference * Use Hashable mixin for Message * logging.rst: Fix some typos and grammar errors * Fix Colour.dark_theme docstring. * Escape multi-line quotes properly Fix Rapptz#5897 * Properly insert at the end if position is not found when moving. Fixes Rapptz#5923 * Evict keys when they're set to None in PermissionOverwrite Fixes Rapptz#5929 * Mark intent alias flags as actual aliases to skip them in __iter__ Fix Rapptz#5945 * Fix disconnect when trying to move to another voice channel. 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 Rapptz#5904 * Fix attribute errors when timing out during chunking start-up * Add internal method to check if the websocket is currently ratelimited * Ensure our own member is never evicted from the cache in any policy. * [commands] Lazily fetch members in discord.Member converters This makes commands taking members mostly work transparently without much effort from the user. * Load member from guild_member_update dispatch * Allow concurrent calls to guild.chunk() This allows people who write guild.chunk() calls in highly concurrent places such as on_message or checks to not spam the gateway with an actual request and instead waits for the pre-existing request to finish * Fix error when querying members from the gateway. I accidentally made this return True instead of the actual member list * Add changelog for v1.5.1 * Version bump to v1.5.1 * Translation sync with crowdin * Implement icon_rl_as and cover_image_url_as for AppInfo * Raise ClientException when members intent is not enabled on guild.fetch_members * [commands] Update MessageConverter link regex Remove redundant parts of the MessageConverter regexes and support www * Emphasize intents in the constructors of the examples * Raise DiscordServerError for 503 Service Unavailable errors * Properly document that categories throw 404's on create_invite. * Add Colour.random factory method * Clarify Colour.random RNG * Bump version for development purposes * Fix error with templates not having access to member cache flags. This also changes the attribute from having an underscore Fix Rapptz#5986 * Fix attribute error during rapid disconnects in VoiceClient. Fix Rapptz#6039 * Clear the connected flag when potentially reconnecting the player Fix Rapptz#5953 * Bump dependencies for 3.9 to work without build tools Fix Rapptz#5984, Rapptz#5970 * Suppress the creation of a command window from ffmpeg on Windows Fix Rapptz#6038 * Add sticker support * Don't store a user cache if there's no member intent or cache is off Without a cache or member intent the user cache can get out of date with no events to update the underlying user in the member object. Ref: Rapptz#6034 * Ensure member key is not overwritten by author key in MESSAGE_UPDATE This also coerces the older message to take the member data from the newer message so the types are not incompatible. Fix Rapptz#5999 * Sticker implementation cleanup * [commands] Fetch user if an ID is passed and cache lookup fails. * Fix preview_asset key name in Sticker * [commands] Allow setting description of cogs * Implement role tags. This comes with: * The RoleTags class * Role.is_premium_subscriber() * Role.is_bot_managed() * Role.is_integration() * Guild.self_role * Guild.premium_subscriber_role * Add a way to check if the websocket is rate limited. This is mainly for low level decision making for utilities that need to know whether to fetch a member by HTTP or to query through the websocket. The library already does this trick in some places so it's only fair that end users possess the same ability as well. * Fix `discord.RoleTags` resolution * Implement discord.Message.reply * Code cleanup involving enums and message replies * Allow MessageReference to be constructible by users * Added MessageReference.resolved attribute to get replied to message * Correct docstring missing ] * Fix Message.to_reference from the MessageReference changes * Change reply example to use replies * Fix `UnboundLocalError` for editing `public_updates_channel` * [chore] Remove redundant imports This also removes the historical patch for NullHandler implemented in bbf1c54, as it has been available since Python 3.1. * [bug] call super constructor for `CustomActivity` to fix `created_at` * Fix Team.icon_url_as format argument default value * Add reaction roles example * Update documentation for rules/updates channels * Add support for chunking AsyncIterator objects * [commands] Cog unload failures are swallowed. Fix Rapptz#6113 Co-authored-by: JohnyTheCarrot <[email protected]> Co-authored-by: Tarek <[email protected]> Co-authored-by: apple502j <[email protected]> Co-authored-by: Anurag <[email protected]> Co-authored-by: NCPlayz <[email protected]> Co-authored-by: Jeffrey <[email protected]> Co-authored-by: Tsumiki <[email protected]> Co-authored-by: Rapptz <[email protected]> Co-authored-by: Sebastian Law <[email protected]> Co-authored-by: jack1142 <[email protected]> Co-authored-by: Josh <[email protected]> Co-authored-by: Skezza <[email protected]> Co-authored-by: Znunu <[email protected]> Co-authored-by: James <[email protected]> Co-authored-by: James <[email protected]> Co-authored-by: AXVin <[email protected]> Co-authored-by: Jaime Garcia Jr <[email protected]> Co-authored-by: Jaime Garcia Jr <[email protected]> Co-authored-by: Riley S <[email protected]> Co-authored-by: Tyler North <[email protected]> Co-authored-by: Dan Hess <[email protected]> Co-authored-by: Xua <[email protected]> Co-authored-by: ELginas <[email protected]> Co-authored-by: Bryan Forbes <[email protected]> Co-authored-by: Vexs <[email protected]> Co-authored-by: Patrick <[email protected]> Co-authored-by: Zomatree <[email protected]> Co-authored-by: sinus-x <[email protected]> Co-authored-by: Nanofaux <[email protected]> Co-authored-by: parafoxia <[email protected]> Co-authored-by: alkatar21 <[email protected]> Co-authored-by: Andres Torres <[email protected]> Co-authored-by: Alex Nørgaard <[email protected]> Co-authored-by: Saphielle Akiyama <[email protected]> Co-authored-by: Simon Beal <[email protected]> Co-authored-by: khazhyk <[email protected]> Co-authored-by: Skye Im <[email protected]> Co-authored-by: BluePhoenixGame <[email protected]> Co-authored-by: rodovia <[email protected]> Co-authored-by: Duck <[email protected]> Co-authored-by: iomintz <[email protected]> Co-authored-by: iDutchy <[email protected]> Co-authored-by: PikalaxALT <[email protected]> Co-authored-by: Michael <[email protected]> Co-authored-by: Muhammad Hamza <[email protected]> Co-authored-by: Nekokatt <[email protected]> Co-authored-by: ChristopherJHart <[email protected]> Co-authored-by: Eric Chan <[email protected]> Co-authored-by: PythonCoderAS <[email protected]> Co-authored-by: numbermaniac <[email protected]> Co-authored-by: Florian Spieß <[email protected]> Co-authored-by: Lukas <[email protected]> Co-authored-by: Jonathan Feenstra <[email protected]> Co-authored-by: Harmon <[email protected]> Co-authored-by: webtax-gh <[email protected]> Co-authored-by: Caio Alexandre <[email protected]> Co-authored-by: SNVMK <[email protected]> Co-authored-by: Kippiii <[email protected]> Co-authored-by: RocketRace <[email protected]>
diceroll123
added a commit
to diceroll123/discord.py
that referenced
this pull request
Dec 7, 2020
* Fix minor markdown typo in migrating.rst * Support discord.com/invite URL in resolve_invite * Fix TypeError on missing shard_id kwarg * Escape masked URLs; Support quotes for as_needed * Fix reconnecting loop due to failed handshake on region change * Change PartialInviteGuild.icon_url_as to mimic Guild.icon_url_as * Fix error raised when using the roles parameter. * Add versionadded to VoiceClient latency and average_latency * Update Message.system_content join strings to be up to date. Fixes Rapptz#4211 * Fix Guild.by_category not showing empty categories. * Fix a KeyError for channels with no category in Guild.by_category * Fix various inconsistencies within the documentation (Rapptz#5067) * [commands] Add a new exception class for command registration errors * [tasks] Fix issue with default error handler in class context * [commands] Raise TypeError when Optional is used with Greedy converter * Add support for Discord templates * Add support for integrations * Add support for bulk editing role positions * [bugs] stop resolving Object for template/invite; remove dupe methods * Fix typo with voice_client documentation * Documentation formatting * Allow Webhook to be hashable and comparable * Allow more methods to set an audit log reason * Add a licence and encoding declaration to missing files * Document raises for Converter.convert * [docs] fix reference to `Guild` and document `utils.resolve_template` * Fix TypeError when not specifying roles. * Don't use a namedtuple for _Overwrites Fix Rapptz#5109 * Fix detection of some JPEG images without JFIF or Exif info Closes Rapptz#5143 * Add Guild.change_voice_state to control our voice state. * Add double backticks for some parameter mentions in the documentation. * Added exception documentation for Guild.create_voice_channel * [commands] GroupView.get_command shouldn't raise errors for empty names * Add gray alias for discord.Colour * [commands] Add documentation for exceptions in Context.(re)invoke * Fix typo in on_socket_raw_send documentation * Add a changelog entry for v1.3.4 * Add documentation on bot_check_once * Add revisions to check_once docs * Rewrite of AutoShardedClient to prevent overlapping identify This is experimental and I'm unsure if it actually works * Add shard ID to keep alive logger messages * Can't use %d in here * Fix AttributeError on reconnection * Rewrite gateway to use aiohttp instead of websockets * Use a proper type for the event queue * Fix voice websocket connections * Fix READY not firing for multi-processed AutoShardedClient clusters * Add before_identify_hook to have finer control over IDENTIFY syncing * 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. * Handle connection errors during reidentify flow. * Add shard related connection and resume events. These include: * on_shard_resumed * on_shard_connect * on_shard_disconnect * 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. * If we're out of retries just raise the OSError * Add a timeout for receiving websocket messages. * 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 Rapptz#4112 * Update message references in AutoShardedConnectionState Fixes Rapptz#5133 * Use a subclass rather than monkey-patching for the websocket * Propagate exceptions when an unhandled error happens * Add an exposed way to extract shard-specific information. Closes Rapptz#2654 * Fix AttributeError from internal queue being double underscore. * Fix NameError with resolving codes with Template * Specify where to get max_members in documentation * Fix typo when creating a guild via template * Terminate shard processing queue when a clean close is encountered. Fix Rapptz#5180 * 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 * Fix AttributeError when fetching reactions without cache * Fix gramatical error in Client guild_subscriptions docs * [tasks] Remove HTTPException as an exception to silently continue for * Fix endpoint strings with :443 instead of :80 Fix Rapptz#5191 Close Rapptz#5188 * Propagate manual close codes to socket subclass aiohttp seems to not set it during its state machine flow * Require people to use templates when making an issue * Fix NameError and AttributeError in Template and Integrations * Be defensive in case Discord breaks something with WS URLs again * [commands] Restart subcommand_passed chain on invoke Fix Rapptz#5198 * [commands] Provide a way to retrieve time left for a cooldown * [commands] implement HelpCommand.add/remove_check * Add missing comma in template.py * Fix a typo with webhook documentation * Fixed a typo in message unpinning docs * Add remaining user flags * Add changelog for 1.4 * Version bump to 1.4 * Terminate connection if a close code couldn't be handled * Fix error when trying to clear empty image/thumbnail in embeds * Extend __path__ with pkgutil to allow editable extensions * Add changelog for 1.4.1 * Version bump to 1.4.1 * Document on_error "special" behavior * Add South Korea VoiceRegion * update the docs on RawReactionActionEvent.member * Fix letter to be consistent with the rest of the docs * Fix hyperlink reference to PartialInviteChannel in Client * Document merging behaviour of AllowedMentions in Messageable.send * 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. * Version bump for development purposes * Fix issue with empty overwrites Fixes Rapptz#5756. * [commands] Use edited timestamp if provided for cooldown timing * [tasks] Don't update _next_iteration on retry * [commands] Added ColorConverter alias * Don't call close() if we've already been closed in Client.run * Added __eq__ to Message * Add COMMUNITY to Guild.features * Classmethods all and none for AllowedMentions * [commands] Add subclasses of BadArgument for converters * [commands] BadBooleanArgument -> BadBoolArgument * [commands] add require_var_positional * [docs] remove unresolved doc refs, fix attribute ref * [commands] Update Bot.command() decorator docs * Add fetch_message_fast using history endpoint * Add discord.Colour classmethod dark_theme * Fix Member.joined_at documentation * [commands] Fix exception raised in Command invoke hooks. * [commands] Correct command removing during cog injecting * Fix comparison for overwrites when checking if a channel is synced * Add logging to webhooks Fixes Rapptz#5798 * Handle cloudflare bans on webhook requests Fixes Rapptz#5221 * Guard uses of the keep alive thread in case they're None Fixes Rapptz#5800 * Add a more concrete exception for 500 status codes. Fixes Rapptz#5797 * [tasks] Lazily fetch event loop if one isn't provided Fixes Rapptz#5808 * Remove caching from AutoShardedClient.shards * Add missing permission in clone documentation * Revert "Add fetch_message_fast using history endpoint" This reverts commit a309088. A rate limited was added to this method after 5 years defeating the purpose of it. * Completely update member references from message inner members. Fixes Rapptz#5819 * Add labels to the issue templates * Update issue template to redirect to discussions * issue/PR templates: use h2 instead of h3 `h2` is the semantically correct heading here, as `h1` is for document titles and `h2` is for the top level headings within a document. `h3` should be used for subheadings of `h2` headings. * Add competing activity type * Fix allowed_mentions when sending files * Add bot.listen() suggestion to on_message faq * Remove namedtuples to better future guard the library * Use quotes when installing in the README Other shells have a hard time with square brackets. Closes Rapptz#5821 * Add support for message_reference on Message object * Fix and add documentation * Implement VoiceProtocol lower level hooks. This allows changing the connect flow and taking control of it without relying on internal events or tricks. * Correct some protocol errors in v4 of voice gateway * Fix issues with VoiceProtocol docstrsings. * Properly handle disconnects in voice when force disconnected * Add support for guild intents * Handle gateway rate limits by using a rate limiter. With the new chunking changes this will become necessary and we don't want to disconnect from having too many outwards requests. * Change unknown cache log warnings from WARNING -> DEBUG * Add more close codes that can't be handled for reconnecting. * Rewrite chunking to work with intents. 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. * Handle user updates within GUILD_MEMBER_UPDATE * All guilds require chunking if opting into it * Heartbeats bypass the rate limits for gateway * Use a lock for the gateway rate limiter. This will allow for higher concurrency in AutoSharded situations where I can mostly "fire and forget" the chunk requests. * Maximize concurrency when chunking on AutoSharded clients * Speed up chunking for guilds with presence intent enabled * Check for zombie connections through last received payload 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. * Maximize the amount of concurrency while chunking. In order to reduce our amount of backpressure we need to limit the amount of concurrent chunk requests we can have so the gateway buffer has some time to breathe. * Fix timeouts due to hitting the gateway rate limit * Explicitly disable the members presence by default * Add versionadded for intents enum * Fix Client.request_offline_members no longer working * Add Guild.chunk and deprecated Client.request_offline_members * Don't cache members during guild start up if cache is disabled. This is mainly a half-implemented commit. There are a few more places where cache consistency is necessary. In the future there will probably be a member cache policy enum that will be used and cache consistency will be tackled in part of that larger refactoring. * Raise if member intent is not enabled * Allow finer grained control over the member cache. * Intern status and overwrite strings * Pass default intents if not explicitly given * Add a special exception for required privileged intents * Default MemberCacheFlags based on intents * Some documentation fixes for MemberCacheFlags and Intents * Fix up wording in MemberCacheFlags exception * Disable voice cache in weird intent configurations. * Fix presence intent docstring * Mention potential Guild.member_count accuracy issues * Add documentation for gateway intents * Use /invites/ instead of /invite/ * Use delete_message_days instead of delete-message-days * Add support for flag alias * Fix typos in Intents documentation * Add chunk_guilds_at_startup and deprecate fetch_offline_members * More intent related documentation * More intent documentation. Mention that you can downgrade the library to revert. Also mention that intents need to be updated in the code as well as the developer portal. * Fix typo in ValueError message * Make Intent class creation more intuitive * Fixed incorrectly named 'Intent' class in doc. `Intent.members` -> `Intents.members`. * Add Client.intents to query the current intents Closes Rapptz#5854 * Update intents with small typo fixes * Guard GUILD_MEMBER_ADD/GUILD_MEMBER_REMOVE from errors If the guilds intent is disabled all guilds are unavailable. This means we don't receive a member_count attribute and cannot update it. * Add warning if guilds intent is disabled. * Add changelog for v1.5.0 * Add changelog for v1.4.2 * Version bump to v1.5.0 * Some minor documentation fixes. Make examples all mention where to put it for the unaware. * Add intents to examples * Add intents to event reference * Update intent documentation to use defaults * Add intents to the issue template * Add note pointing to discord.AllowedMentions * Fix typo in event reference * Use Hashable mixin for Message * logging.rst: Fix some typos and grammar errors * Fix Colour.dark_theme docstring. * Escape multi-line quotes properly Fix Rapptz#5897 * Properly insert at the end if position is not found when moving. Fixes Rapptz#5923 * Evict keys when they're set to None in PermissionOverwrite Fixes Rapptz#5929 * Mark intent alias flags as actual aliases to skip them in __iter__ Fix Rapptz#5945 * Fix disconnect when trying to move to another voice channel. 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 Rapptz#5904 * Fix attribute errors when timing out during chunking start-up * Add internal method to check if the websocket is currently ratelimited * Ensure our own member is never evicted from the cache in any policy. * [commands] Lazily fetch members in discord.Member converters This makes commands taking members mostly work transparently without much effort from the user. * Load member from guild_member_update dispatch * Allow concurrent calls to guild.chunk() This allows people who write guild.chunk() calls in highly concurrent places such as on_message or checks to not spam the gateway with an actual request and instead waits for the pre-existing request to finish * Fix error when querying members from the gateway. I accidentally made this return True instead of the actual member list * Add changelog for v1.5.1 * Version bump to v1.5.1 * Translation sync with crowdin * Implement icon_rl_as and cover_image_url_as for AppInfo * Raise ClientException when members intent is not enabled on guild.fetch_members * [commands] Update MessageConverter link regex Remove redundant parts of the MessageConverter regexes and support www * Emphasize intents in the constructors of the examples * Raise DiscordServerError for 503 Service Unavailable errors * Properly document that categories throw 404's on create_invite. * Add Colour.random factory method * Clarify Colour.random RNG * Bump version for development purposes * Fix error with templates not having access to member cache flags. This also changes the attribute from having an underscore Fix Rapptz#5986 * Fix attribute error during rapid disconnects in VoiceClient. Fix Rapptz#6039 * Clear the connected flag when potentially reconnecting the player Fix Rapptz#5953 * Bump dependencies for 3.9 to work without build tools Fix Rapptz#5984, Rapptz#5970 * Suppress the creation of a command window from ffmpeg on Windows Fix Rapptz#6038 * Add sticker support * Don't store a user cache if there's no member intent or cache is off Without a cache or member intent the user cache can get out of date with no events to update the underlying user in the member object. Ref: Rapptz#6034 * Ensure member key is not overwritten by author key in MESSAGE_UPDATE This also coerces the older message to take the member data from the newer message so the types are not incompatible. Fix Rapptz#5999 * Sticker implementation cleanup * [commands] Fetch user if an ID is passed and cache lookup fails. * Fix preview_asset key name in Sticker * [commands] Allow setting description of cogs * Implement role tags. This comes with: * The RoleTags class * Role.is_premium_subscriber() * Role.is_bot_managed() * Role.is_integration() * Guild.self_role * Guild.premium_subscriber_role * Add a way to check if the websocket is rate limited. This is mainly for low level decision making for utilities that need to know whether to fetch a member by HTTP or to query through the websocket. The library already does this trick in some places so it's only fair that end users possess the same ability as well. * Fix `discord.RoleTags` resolution * Implement discord.Message.reply * Code cleanup involving enums and message replies * Allow MessageReference to be constructible by users * Added MessageReference.resolved attribute to get replied to message * Correct docstring missing ] * Fix Message.to_reference from the MessageReference changes * Change reply example to use replies * Fix `UnboundLocalError` for editing `public_updates_channel` * [chore] Remove redundant imports This also removes the historical patch for NullHandler implemented in bbf1c54, as it has been available since Python 3.1. * [bug] call super constructor for `CustomActivity` to fix `created_at` * Fix Team.icon_url_as format argument default value * Add reaction roles example * Update documentation for rules/updates channels * Add support for chunking AsyncIterator objects * [commands] Cog unload failures are swallowed. Fix Rapptz#6113 * Add created_at property to PartialEmoji Also fixed docstring for PartialEmoji.url Co-authored-by: Tarek <[email protected]> Co-authored-by: apple502j <[email protected]> Co-authored-by: Anurag <[email protected]> Co-authored-by: NCPlayz <[email protected]> Co-authored-by: Jeffrey <[email protected]> Co-authored-by: Tsumiki <[email protected]> Co-authored-by: Rapptz <[email protected]> Co-authored-by: Sebastian Law <[email protected]> Co-authored-by: jack1142 <[email protected]> Co-authored-by: Josh <[email protected]> Co-authored-by: Skezza <[email protected]> Co-authored-by: Znunu <[email protected]> Co-authored-by: James <[email protected]> Co-authored-by: James <[email protected]> Co-authored-by: AXVin <[email protected]> Co-authored-by: Jaime Garcia Jr <[email protected]> Co-authored-by: Jaime Garcia Jr <[email protected]> Co-authored-by: Riley S <[email protected]> Co-authored-by: Tyler North <[email protected]> Co-authored-by: Dan Hess <[email protected]> Co-authored-by: Xua <[email protected]> Co-authored-by: ELginas <[email protected]> Co-authored-by: Bryan Forbes <[email protected]> Co-authored-by: Vexs <[email protected]> Co-authored-by: Patrick <[email protected]> Co-authored-by: Zomatree <[email protected]> Co-authored-by: sinus-x <[email protected]> Co-authored-by: Nanofaux <[email protected]> Co-authored-by: parafoxia <[email protected]> Co-authored-by: alkatar21 <[email protected]> Co-authored-by: Andres Torres <[email protected]> Co-authored-by: Alex Nørgaard <[email protected]> Co-authored-by: Saphielle Akiyama <[email protected]> Co-authored-by: Simon Beal <[email protected]> Co-authored-by: khazhyk <[email protected]> Co-authored-by: Skye Im <[email protected]> Co-authored-by: BluePhoenixGame <[email protected]> Co-authored-by: rodovia <[email protected]> Co-authored-by: Duck <[email protected]> Co-authored-by: iomintz <[email protected]> Co-authored-by: iDutchy <[email protected]> Co-authored-by: PikalaxALT <[email protected]> Co-authored-by: Michael <[email protected]> Co-authored-by: Muhammad Hamza <[email protected]> Co-authored-by: Nekokatt <[email protected]> Co-authored-by: ChristopherJHart <[email protected]> Co-authored-by: Eric Chan <[email protected]> Co-authored-by: PythonCoderAS <[email protected]> Co-authored-by: numbermaniac <[email protected]> Co-authored-by: Florian Spieß <[email protected]> Co-authored-by: Lukas <[email protected]> Co-authored-by: Jonathan Feenstra <[email protected]> Co-authored-by: Harmon <[email protected]> Co-authored-by: webtax-gh <[email protected]> Co-authored-by: Caio Alexandre <[email protected]> Co-authored-by: SNVMK <[email protected]> Co-authored-by: Kippiii <[email protected]> Co-authored-by: RocketRace <[email protected]>
6 tasks
yagomichalak
pushed a commit
to yagomichalak/discord.py
that referenced
this pull request
May 28, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Various inconsistencies exist within the documentation:
None
, booleans, and numbersThis pull request aims to fix these.
Additional changes:
discord.File
cannot be sent multiple times #4022Checklist