Caleb
edfacb36cf
[commands] Fix HybridCommandGroup._update_copy to update fallback
Fix #8461
3 years ago
Bryan Forbes
b12b4b18fd
Mark public callbacks as positional-only
3 years ago
Rapptz
bd19ad05e7
Fix app_command_completion triggering on certain errors
3 years ago
Rapptz
1a11c9eeee
[commands] Properly set module information for hybrid commands
3 years ago
Puncher
44abc469f1
[commands] Remove unused with_command HybridCommand parameter
3 years ago
Rapptz
2d586ae805
Add initial support for app command localisation
3 years ago
Bryan Forbes
d707019348
Bump Pyright to 1.1.265, fix type errors, and remove unnecessary ignores
3 years ago
Rapptz
5527de688a
Fix Python 3.10 __or__ not working with transformers
Fixes #8214
3 years ago
Rapptz
11618cd1ba
Refactor transformers to use instances instead of classmethods
This should allow them to be easier to use for users without requiring
a lot of metaprogramming hackery if you want to involve state.
3 years ago
Rapptz
c43d302a28
[commands] Only call hybrid after_invoke hooks if the command is called
Fix #8276
3 years ago
apple502j
b95db674c0
Fix some typos
3 years ago
Josh
c9f777c873
Fix type annotations to adhere to latest pyright release
3 years ago
Rapptz
06c43d6772
[commands] Add support for NSFW commands for hybrid commands
3 years ago
Rapptz
6e2fcd4762
[commands] Assign current parameter and argument in hybrid commands
3 years ago
Rapptz
6d55b96fa7
[commands] Fix unsupported discord converters in hybrid commands
These are things that are supported in regular commands but not in
application commands, such as discord.Colour, discord.Game, or
discord.Emoji.
3 years ago
Rapptz
06e8683d01
[commands] Fix flag_converter attribute not being properly copied
3 years ago
Rapptz
15ceca1e63
[commands] Add support for FlagConverter in hybrid commands
This works by unpacking and repacking the flag arguments in a flag.
If an unsupported type annotation is found then it will error at
definition time.
3 years ago
Rapptz
bd3ce597e1
[commands] Fix app command children not being copied in HybridGroup
This degenerate case is only triggered inside cogs when using the
app_command property to define commands, such as this:
class X(commands.Cog):
@commands.hybrid_group()
async def foo(self, ctx):
...
@foo.app_command.command()
async def bar(self, interaction):
...
3 years ago
Rapptz
9793fba338
[commands] Add support for discord.Attachment converters
3 years ago
Rapptz
ccc737eb07
[commands] Add support for with_app_command in hybrid commands
This allows the user to make a text-only command without it registering
as an application command
3 years ago
Rapptz
eee65ac39b
[commands] Pass permissions v2 information to HybridGroup
3 years ago
Rapptz
6ee56fe964
Fix remaining --verifytypes related errors
3 years ago
Rapptz
5536ef1eea
Update to pyright 1.1.242
3 years ago
Rapptz
832d2c0542
[commands] Fix certain annotations being allowed in hybrid commands
Union types were not properly constrained and callable types were
too eagerly being converted
3 years ago
Rapptz
1d97a35385
[commands] Fix hybrid commands not respecting default annotations
3 years ago
Rapptz
6113f856b6
[commands] Dispatch command events for hybrid commands
3 years ago
jack1142
f9ead92239
[commands] Change Parameters header to Attributes in HybridGroup
3 years ago
Rapptz
80aa45ed31
[commands] Skip ws before processing arguments in Greedy transformer
3 years ago
Rapptz
bc07a02f68
[commands] Fix type hints for hybrid command decorators
3 years ago
Rapptz
8a1800bd12
[commands] Add support for setting a fallback slash subcommand
This allows the group callback to be invoked as a slash subcommand
3 years ago
Rapptz
e9ff6b4be8
[commands] Fix broken documentation references
3 years ago
Rapptz
7a52aa3764
[commands] Force HybridGroup to always have invoke_without_command
3 years ago
Rapptz
242d3f7ab7
[commands] Add Bot.hybrid_group and Bot.hybrid_command decorators
3 years ago
Rapptz
1931b0eb75
[commands] Ensure hybrid app command receives copied wrapper command
3 years ago
Rapptz
393fdde037
[commands] Add support for Greedy for hybrid commands
3 years ago
Rapptz
1004cf2059
[commands] Unconditionally replace default if it's set
Handles degenerate `x: int = commands.param(default=10)` case
3 years ago
Rapptz
70d2522e7e
[commands] Unwrap CommandInvokeError if the cause is CommandError
3 years ago
Rapptz
65418414ea
[commands] Refactor parameter replacement to be less brittle
If a parameter works as-is as a transformer or a built-in then it
will always be taken rather. This way, the custom behaviour is done
as a fallback in case it doesn't work natively with app commands.
This also allows things that are hybrid transformers and converters
to work transparently.
3 years ago
Rapptz
896932faf1
[commands] Add Range converter
This allows hybrid commands to also have a range annotation
3 years ago
Rapptz
3c4b22b623
[commands] Fix transformers no longer working as annotation
3 years ago
Rapptz
9d05f55ddb
[commands] Fix Optional handling when the inner type is a converter
3 years ago
Rapptz
f072edfdfc
[commands] Properly support commands.param in hybrid commands
3 years ago
Rapptz
d61561f2e8
[commands] Add support for autocomplete for hybrid commands
3 years ago
Rapptz
52fcaed79b
[commands] Reassign app_command attribute on copy
Prior to this change it would re-create the HybridAppCommand on copy
which had the consequence of clearing parameter related changes.
3 years ago
Rapptz
1232a1d2fd
[commands] Properly call after_hooks in hybrid commands
3 years ago
Rapptz
840eb577d4
[commands] Add initial implementation of hybrid commands
Hybrid commands allow a regular command to also double as a slash
command, assuming it meets the subset required to function.
3 years ago