58 Commits

Author SHA1 Message Date
Rapptz
8953938a53 Update Pyright to v1.1.394 2025-02-18 03:29:09 -05:00
DA344
7c8503fefb
Fix callable FlagConverter defaults on hybrid commands
fix: Callable FlagConverter defaults being returned as-is on interaction based calls.
2025-01-15 18:27:03 -05:00
Soheab
c7305b022c
[commands] Respect enabled kwarg for hybrid app commands 2024-11-07 03:07:20 -05:00
Danny
2e2f51fd5c
First pass at supporting user apps
Co-authored-by: red <red@kalab.sk>
Co-authored-by: Vioshim <63890837+Vioshim@users.noreply.github.com>
2024-05-04 23:25:01 -04:00
Josh
4e03b170ef
Update pyright version 2024-02-20 13:36:02 -05:00
Rapptz
5c5ccc4e82 [commands] Fix hybrid command wrapped instances being out of sync 2023-09-30 14:28:18 -04:00
thegamecracks
c7f6e95f1c
[commands] Fix localization support for hybrid group fallback 2023-08-24 14:33:29 -04:00
Josh
630b2a1e55
Update pyright version 2023-07-01 18:26:27 -04:00
Bryan Forbes
0ea098567c
[commands] Use ... for Command and Group typing 2023-03-01 22:47:17 -05:00
Bryan Forbes
4d51f68864
[commands] Fix some more partially uknown typing errors 2023-03-01 19:37:38 -05:00
Puncher
1e9d04bbca
Add missing and fix wrong docstrings 2023-02-28 02:18:59 -05:00
Rapptz
faee0b4968 [commands] Explicit set traceback for hybrid invoke
Fix #9205
2023-01-25 03:05:24 -05:00
Caleb
edfacb36cf
[commands] Fix HybridCommandGroup._update_copy to update fallback
Fix #8461
2022-09-12 15:31:08 -04:00
Bryan Forbes
b12b4b18fd
Mark public callbacks as positional-only 2022-08-22 15:21:19 -04:00
Rapptz
bd19ad05e7 Fix app_command_completion triggering on certain errors 2022-08-16 20:03:02 -04:00
Rapptz
1a11c9eeee [commands] Properly set module information for hybrid commands 2022-08-16 01:28:27 -04:00
Puncher
44abc469f1
[commands] Remove unused with_command HybridCommand parameter 2022-08-07 17:20:02 -04:00
Rapptz
2d586ae805 Add initial support for app command localisation 2022-08-05 22:35:30 -04:00
Bryan Forbes
d707019348
Bump Pyright to 1.1.265, fix type errors, and remove unnecessary ignores 2022-08-04 22:46:02 -04:00
Rapptz
5527de688a Fix Python 3.10 __or__ not working with transformers
Fixes #8214
2022-07-30 04:48:26 -04:00
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.
2022-07-30 04:40:28 -04:00
Rapptz
c43d302a28 [commands] Only call hybrid after_invoke hooks if the command is called
Fix #8276
2022-07-29 21:39:23 -04:00
apple502j
b95db674c0
Fix some typos 2022-06-27 22:34:45 -04:00
Josh
c9f777c873
Fix type annotations to adhere to latest pyright release 2022-06-12 15:30:45 -04:00
Rapptz
06c43d6772 [commands] Add support for NSFW commands for hybrid commands 2022-05-22 19:31:28 -04:00
Rapptz
6e2fcd4762 [commands] Assign current parameter and argument in hybrid commands 2022-05-12 06:36:19 -04:00
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.
2022-05-11 20:14:39 -04:00
Rapptz
06e8683d01 [commands] Fix flag_converter attribute not being properly copied 2022-05-11 03:30:20 -04:00
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.
2022-05-11 03:15:57 -04:00
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):
            ...
2022-05-06 09:02:49 -04:00
Rapptz
9793fba338 [commands] Add support for discord.Attachment converters 2022-05-05 01:54:59 -04:00
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
2022-05-05 01:46:19 -04:00
Rapptz
eee65ac39b [commands] Pass permissions v2 information to HybridGroup 2022-05-02 19:08:25 -04:00
Rapptz
6ee56fe964 Fix remaining --verifytypes related errors 2022-04-30 19:43:53 -04:00
Rapptz
5536ef1eea Update to pyright 1.1.242 2022-04-30 19:37:01 -04:00
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
2022-04-21 04:13:32 -04:00
Rapptz
1d97a35385 [commands] Fix hybrid commands not respecting default annotations 2022-04-19 12:08:22 -04:00
Rapptz
6113f856b6 [commands] Dispatch command events for hybrid commands 2022-04-19 01:40:16 -04:00
jack1142
f9ead92239
[commands] Change Parameters header to Attributes in HybridGroup 2022-04-15 03:23:56 -04:00
Rapptz
80aa45ed31 [commands] Skip ws before processing arguments in Greedy transformer 2022-04-15 03:21:36 -04:00
Rapptz
bc07a02f68 [commands] Fix type hints for hybrid command decorators 2022-04-14 05:14:48 -04:00
Rapptz
8a1800bd12 [commands] Add support for setting a fallback slash subcommand
This allows the group callback to be invoked as a slash subcommand
2022-04-13 20:30:11 -04:00
Rapptz
e9ff6b4be8 [commands] Fix broken documentation references 2022-04-13 18:49:39 -04:00
Rapptz
7a52aa3764 [commands] Force HybridGroup to always have invoke_without_command 2022-04-13 17:14:21 -04:00
Rapptz
242d3f7ab7 [commands] Add Bot.hybrid_group and Bot.hybrid_command decorators 2022-04-12 21:17:00 -04:00
Rapptz
1931b0eb75 [commands] Ensure hybrid app command receives copied wrapper command 2022-04-12 20:15:11 -04:00
Rapptz
393fdde037 [commands] Add support for Greedy for hybrid commands 2022-04-12 20:15:11 -04:00
Rapptz
1004cf2059 [commands] Unconditionally replace default if it's set
Handles degenerate `x: int = commands.param(default=10)` case
2022-04-12 20:15:11 -04:00
Rapptz
70d2522e7e [commands] Unwrap CommandInvokeError if the cause is CommandError 2022-04-12 20:15:11 -04:00
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.
2022-04-12 20:15:11 -04:00