Rapptz
bac6c2fc7b
[commands] Unwrap functions to get their module and globalns
Fixes #7002
4 years ago
Michael H
52678b2eb5
[commands] Add Command.extras
4 years ago
Rapptz
f56543df15
[commands] Remove function call indirection when checking author
4 years ago
Tari
36cf3c94b4
[commands] Remove Bot.self_bot
4 years ago
Tari
42bab370a7
[commands] Add BadColorArgument to __all__
4 years ago
NextChai
ef6f5d947a
[commands] Update command.parent and command.parents docs
* Switch root_parent from command to group
4 years ago
Nadir Chowdhury
757cfad38f
Type up **kwargs of various methods
4 years ago
Jay3332
d5e14eb715
[commands] Fix a minor grammar error in MaxConcurrencyReached
4 years ago
sudosnok
2a6d79078e
[commands] Add GuildChannelConverter
4 years ago
Josh
3864fb37a0
Fix various reference issues in documentation
Co-Authored-By: Riley Shaw <[email protected] >
4 years ago
Rapptz
1a8d63d54f
[commands] Remove Flag related delimiter and prefix error
4 years ago
Rapptz
58274eafbc
[commands] Fix Generics causing other typing converters to fail
4 years ago
Rapptz
3b6a2b9e85
[commands] Fix Generic subcalsses used as a converter
4 years ago
Nadir Chowdhury
c786a85a9b
Add utils.MISSING
4 years ago
Rapptz
9f3551926a
Split annotation resolution to discord.utils
4 years ago
Rapptz
69da87f455
[commands] Disallow float/complex in Literal but allow None
Type checkers (both mypy and pydantic) apparently don't like it
4 years ago
Josh
4fbc78ba81
[commands] Add support for typing.Union to Flags
4 years ago
Rapptz
c250b9fc02
[commands] Fix regression with Union converters not working
This was due to the Literal restriction from earlier.
4 years ago
Rapptz
185b554a56
[commands] Disallow complicated Literal types
4 years ago
Rapptz
fb024546ff
[commands] Fix Literal converter not working within flags
4 years ago
Rapptz
1c312a158a
[commands] Add FlagConverter.__iter__
4 years ago
Stella
91c473db57
[commands] Fix _HelpCommandImpl.clean_params popitem
4 years ago
Rapptz
8e9860077d
[commands] Fix flag detection code in get_flags
4 years ago
jack1142
a55e817ffe
Fix documentation for RoleConverter
4 years ago
Josh
8457f70477
[commands] Set constructible FlagConverter flags to not be required
4 years ago
Josh
cfe93f19b1
[commands] Allow FlagCommand subclasses to inherit options
4 years ago
Josh
42463bae67
[commands] Add support for aliasing to FlagConverter
4 years ago
Kino
0c1c9284f6
Fix typo within `HelpCommand.verify_checks` documentation
4 years ago
Rapptz
6065329c0e
[commands] Avoid creating unnecessary flag mapping copies
4 years ago
Rapptz
15bfdf66b2
[commands] Default construct flags if they're not passed as parameters
This only applies if and only if the flag can be default constructible.
Ergo, all the flags are optional or not required.
4 years ago
Rapptz
18bf3d3a7d
[commands] Actually expose the FlagError base error
4 years ago
Rapptz
ddb71e2aed
[commands] Initial support for FlagConverter
The name is currently pending and there's no command.signature hook
for it yet since this requires bikeshedding.
4 years ago
Rapptz
c54e43360b
[commands] Add run_converters helper to call converters
4 years ago
Rapptz
09f3f2111c
[commands] Add Context.current_parameter
4 years ago
Rapptz
7fb746e6e5
[commands] Refactor evaluation functions to allow passing in localns
4 years ago
Nadir Chowdhury
5dec62f4c0
[commands] Add a converter for discord.Object
4 years ago
Nadir Chowdhury
d3ac191a67
Restrict snowflake regexes to 15-20 digits
4 years ago
pikaninja
ffea48f218
[commands] Remove HelpCommand.clean_prefix ( #6736 )
4 years ago
Nadir Chowdhury
5ea5f32479
[commands] Fix missing `re` import in Context
4 years ago
MrKomodoDragon
ed3c141f5e
[commands] Add `clean_prefix` attribute to commands.Context
4 years ago
Rapptz
74b07a3218
[commands] Fix Command.clean_params to return a regular dict
4 years ago
Kreusada
af5964358d
[commands] Strip text to remove spaces before ellipsis
4 years ago
Rapptz
74d8ad2013
[commands] Add support for Python 3.10 Union typing
4 years ago
Rapptz
1ecadf057e
[commands] Fix errors with cooldown mappings
4 years ago
Josh
7f91ae8b67
[commands] use __args__ and __origin__ where applicable
4 years ago
Josh
c54c4cb215
[commands] Fix repr for Greedy
4 years ago
Rapptz
3151672cfe
[commands] Refactor typing evaluation to not use get_type_hints
get_type_hints had a few issues:
1. It would convert = None default parameters to Optional
2. It would not allow values as type annotations
3. It would not implicitly convert some string literals as ForwardRef
In Python 3.9 `list['Foo']` does not convert into
`list[ForwardRef('Foo')]` even though `typing.List` does this
behaviour. In order to streamline it, evaluation had to be rewritten
manually to support our usecases.
This patch also flattens nested typing.Literal which was not done
until Python 3.9.2.
4 years ago
Rapptz
27886e5aa4
[commands] Remove legacy ExtensionNotFound.original attribute
4 years ago
Nadir Chowdhury
353737239a
[commands] Minimise code duplication in channel converters
4 years ago
James
bcd3a00eaf
[commands] Make `commands.Greedy` a `typing.Generic`
4 years ago