Commit Graph
34 Commits
Author SHA1 Message Date
Michael H 8b15475496 [Zstandard] Decompress even when discord doesn't encode size information 2025-11-07 18:57:01 -05:00
Michael H 439bd71c0d Upstream change in Python
The prior changes to use of return in finally (#9981) are now
insufficient. Without disclosing their intent when raising the issue,
this was used by them as part of justifying a SyntaxError for working
code outside of the normal process for adding errors, and with it
presenting to end users in a way that breaks downstream user's existing CI

While making the change, I've continued to not log errors like
CancellationError or TimeoutError to users here by default, as it is not an error
they need to be aware of during shutdown given the limited kinds of
BaseException that could raise in this context, see: #9984 for prior
analysis. I've added a debug log should anyone want access to this kind
of failure while debugging gateway close, but due to how asyncio
shutdown happens, this is unlikely to ever log anything useful even in a
library debugging context.
2025-08-13 20:47:41 -04:00
Michael H 6af9de0c39 Ensure COPYING notice is included 2025-06-20 15:06:52 -04:00
Michael H b28a4a115e Fix potentially stuck ratelimit buckets 2025-06-20 14:31:55 -04:00
Michael HandDanny db7b2d9058 Change default file size limit
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
2025-01-21 21:45:56 -05:00
Michael H 1537102402 Temporary dependency for docs extra on python 3.13+ 2025-01-15 18:50:59 -05:00
Michael H f2aa0b833c [tasks] Fix race condition with set_result 2025-01-15 18:18:02 -05:00
Michael H 9806aeb831 Add public method to get session start limits 2024-12-01 16:19:09 -05:00
Michael H d08fd59434 Avoid returning in finally
Specifically reraise KeyboardInterrupt, SystemExit
Swallow other BaseExceptions due to the way the standard library uses
them and the intent of this function
2024-10-30 08:08:45 -04:00
Michael H 3e168a93bf Improve typing of app command transformers
This allows subclasses of transformers to specify a specialization for
interaction without violating covariance of parameter types
2024-10-09 17:27:55 -04:00
Michael H 59f877fcf0 Fix and add test for missing discord.Permission bits 2024-09-02 10:53:31 -04:00
Michael H 6d8198126a Remove aiodns from being used on Windows 2024-08-29 03:05:35 -04:00
Michael H da89fbc8b5 Re-add client connector param
This provides paths for users to handle two entirely seperate issues

- Alternative fix for #9870
- Allows handling of windows sslcontext issues without a global
truststore.inject_into_ssl() use
2024-08-28 15:23:51 -04:00
Michael H 7d3eff9d9d Allow discord.Object use for permissions in channel creation 2024-07-10 07:55:16 -04:00
Michael H 9eac36501a Allow deletion race conditions to work with purge 2024-06-14 18:08:12 -04:00
Michael H a1206dfde8 Fix typing of various AppCommand decorators 2024-05-09 05:16:40 -04:00
Michael H 88f62d85d2 Ensure Client.close() has finished in __aexit__
This wraps the closing behavior in a task. Subsequent callers of
.close() now await that same close finishing rather than short
circuiting. This prevents a user-called close outside of __aexit__ from
not finishing before no longer having a running event loop.
2024-05-04 23:20:36 -04:00
Michael H e6d2d82803 Set socket family of connector to AF_INET
- discord doesn't support ipv6
- prevents issues with hosts with DNS64 enabled
- resolves #9442
2023-06-04 18:11:16 -04:00
Michael H 8991525215 Improve handling of ArrayFlags
Why discord did it this way instead of as an integer bitfield like everything
reasonable is unknowable, but this does less work to get to the same result.

Add comment detailing what many would find unreadbale
2023-04-18 04:03:40 -04:00
Michael H a8a6bf4f6c Add advanced startup example
shows setup_hook and async context manager use with examples
approximating real world use cases
2022-07-08 03:07:32 -04:00
Michael H d0667d08e3 [commands] Fix typing of check/check_any
This changes the type information of check decorators to return a
protocol representing that the decorator leaves the underlying object
unchanged while having a .predicate attribute.

resolves #7949
2022-05-02 18:54:49 -04:00
Michael H 52678b2eb5 [commands] Add Command.extras 2021-05-29 00:18:02 -04:00
Michael H 1bf782fcb5 Add Member.get_role
Adds an efficient way to check if a member has a role by ID.

 This is done in a way consistent with the existing user API of the
 library.

 The more debated Member.has_role_id/has_role is intentionally not
 included for review at this time given the heavy bikeshedding of it.
2021-05-27 22:31:49 -04:00
Michael H 682b73abb6 [commands] Address incorrect use of subclass (from type perspective)
This is a follow up from #6641
2021-04-05 21:39:17 -04:00
Michael H d0476e98df [commands] Add more type information to public API of converters 2021-04-05 21:31:28 -04:00
Michael H 83bd76504a Use covariant TypeVar for protocol 2021-04-05 20:29:15 -04:00
Michael H fbe6e2f520 [commands] Fix @classmethod converters 2021-04-05 20:25:23 -04:00
Michael H 08d45cc2ab Update docs to be clearer about discord limitations 2021-02-17 07:33:17 -05:00
Michael H 7bef78284f Removes the caching behavior of Member.roles
- fixes 4087
- This intentionally uses some internals in both Member.roles and
Member.top_role to retain as much performance as possible while
removing the cache
2020-06-04 23:38:11 -04:00
Michael H 6cdda4a320 Patch clean_prefix for new text editor
The new editor seems to force mentions to have ! even without a nick.
2020-01-14 19:39:34 -05:00
Michael H 6794bdaac5 Use discord.utils.escape_mentions as last step of
discord.Message.clean_content
2019-12-25 04:13:10 -05:00
Michael H 03616b91db Fix embed to_dict timestamp handling for python 3.5
resolves #1992
2019-03-17 09:17:14 -04:00
Michael H f45aef7c2e Handle implicit perms in discord.VoiceChannel.permissions_for
This adds some implicit permission handling for `discord.VoiceChannel.permissions_for`

This is not documented behavior in discord's developer documentation, but it can easily be verified as correct.
2018-12-14 18:59:46 -05:00
Michael H 39cb5f30b4 [commands] Handle nick mentions in HelpFormatter
Modifies the help formatter to handle nicknamed bot users for
mentions in clean_prefix
2018-08-22 21:06:09 -04:00