Commit Graph
16 Commits
Author SHA1 Message Date
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