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
Steve C
ef9bb79e91
[tasks] Move the Loop's sleep to be before exit conditions
This change makes it more so that `Loop.stop()` gracefully makes the
current iteration the final one, by waiting AND THEN returning.
The current implementation is closer to `cancel`, while also not.
I encountered this because I was trying to run a
`@tasks.loop(count=1)`, and inside it I print some text and change the
interval, and in an `after_loop`, I restart the loop.
Without this change, it immediately floods my console, due to
not waiting before executing `after_loop`.
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
Dan Hess
f2d5ab6f80
[commands] Provide a dynamic cooldown system
4 years ago
Sigmath Bits
68aef92b37
[commands]Add typing.Literal converter
4 years ago
Sebastian Law
4134a17a29
[commands] Raise error when a cog name is already registered
4 years ago
Rapptz
99fc950510
Use f-strings in more places that were missed.
4 years ago
pikaninja
1c553f51fb
[commands] Use has_error_handler instead in command_error
4 years ago
Rapptz
f80b8d3f5d
[commands] Only replace annotation if one was given
4 years ago
Nadir Chowdhury
89456022cf
Add `__all__` to remaining modules
4 years ago
Nadir Chowdhury
7a34de1570
[commands] Use typing.get_type_hints to resolve ForwardRefs
4 years ago
Rapptz
9ab58d302d
[commands] Fix classmethod converters not working.
Protocols sure are annoying.
4 years ago