61 Commits

Author SHA1 Message Date
Rapptz
bd19ad05e7 Fix app_command_completion triggering on certain errors 2022-08-16 20:03:02 -04:00
Rapptz
0ec06f0ac5 Add on_app_command_completion event
Fix #8126
2022-08-15 09:19:01 -04:00
Rapptz
1fa7d7e402 Raise special CommandSyncFailure during sync for better errors
This is parsed from the error to allow for users to better debug
what exactly is causing the issue in sync.
2022-08-12 22:36:13 -04:00
Rapptz
a9025ca3d1 Remove public CommandTree.call method and make it private 2022-08-12 10:57:54 -04:00
Rapptz
cc0c261925 Change auto_locale_strings default to True 2022-08-08 20:17:47 -04:00
Rapptz
1c9792e0ed Add auto_locale_strings parameter to application commands 2022-08-05 22:36:40 -04:00
Rapptz
2d586ae805 Add initial support for app command localisation 2022-08-05 22:35:30 -04:00
Rapptz
6c42065210 Fix various a -> an typos across the library
Closes #8301, #8287
2022-08-04 08:17:07 -04:00
Stocker
0546343bcb
[commands] Add cog-level app command error special method 2022-07-17 23:45:19 -04:00
Bryan Forbes
0eb3d26343
Add generic arguments for extras typing 2022-06-27 22:35:22 -04:00
I. Ahmad
9fc4769b18
Add extras attribute to app commands command types 2022-06-21 20:38:56 -04:00
Rapptz
b8ddb17b14 Fix fallback_to_global not working with context menus
Fix #8167
2022-06-20 06:20:46 -04:00
Rapptz
53685b9b86 Change stderr prints to use the logging module instead 2022-06-13 01:06:15 -04:00
will
f6a74f74a7
Fix typo in CommandTree.fetch_command's NotFound doc 2022-06-04 03:25:06 -04:00
Soheab
af265dba06
Add CommandTree.fetch_command 2022-06-03 04:46:20 -04:00
Nickyux
823d650e97
Update comments in CommandTree to reflect commands v2 2022-06-01 02:38:20 -04:00
Rapptz
081f483a0d Fix tree not properly accounting for override when checking limits 2022-05-25 23:40:20 -04:00
Rapptz
573b2121b7 Add support for NSFW application commands
Of course, this somehow doesn't work with subcommands
2022-05-22 19:20:37 -04:00
Rapptz
f780b0a283 Add setting to fallback to global command if guild command isn't found 2022-05-12 06:36:19 -04:00
z03h
bd727d2b0c
Add edit and delete methods to AppCommand 2022-05-05 06:20:55 -04:00
Rapptz
5536ef1eea Update to pyright 1.1.242 2022-04-30 19:37:01 -04:00
Rapptz
ab64a2eae9 Fix typing of guilds kwargs to take Sequence instead of List 2022-04-28 10:48:57 -04:00
Rapptz
cdf442bc32 Fix signature detection in CommandTree.error decorator 2022-04-13 22:30:39 -04:00
Rapptz
3f4fb91328 Change CommandTree.on_error to only take two parameters
The command that failed can be retrieved using Interaction.command
so having it as a parameter doesn't make much sense.
2022-04-13 22:29:27 -04:00
Rapptz
83fae4f0fa Add CommandTree.clear_commands 2022-04-13 22:20:05 -04:00
NextChai
5892bbd8b4
Allow getting all commands from CommandTree.get_commands
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-04-10 23:00:18 -04:00
Rapptz
907d5e0ee7 Document Forbidden exception in CommandTree.sync 2022-04-03 22:57:54 -04:00
Rapptz
24f8f8d4a7 Rename MaxCommandsReached to CommandLimitReached 2022-03-31 23:10:13 -04:00
Rapptz
a0618ef791 Clarify documentation certain tree methods 2022-03-31 10:31:48 -04:00
Rapptz
34b2ff40b6 Change ValueError on max commands reached to a more specific exception 2022-03-31 09:34:48 -04:00
Rapptz
985f5732c0 Refactor ContextMenu constructor to allow app command type inferring 2022-03-25 09:11:11 -04:00
James Gayfer
f26d3a7155
Add interaction check to command tree
In some cases, it's desirable for our command tree to only process a
subset of incoming interactions, such as in a multi process deployment.
2022-03-24 22:32:56 -04:00
Rapptz
84c38f1f22 Ignore errors if it's already handled in app commands 2022-03-21 04:07:05 -04:00
Rapptz
f7c664e3e2 Add error handler support for context menus 2022-03-21 03:56:28 -04:00
Rapptz
202b993da3 Add Interaction.command and Interaction.namespace attributes 2022-03-17 09:45:21 -04:00
Rapptz
3c6daff473 Change default ellipsis descriptions to use U+2026 2022-03-17 07:37:33 -04:00
Rapptz
8ced1143e3 Change missing application ID error to be more descriptive 2022-03-15 07:22:44 -04:00
Rapptz
698d1e12a1 Add CommandTree.error decorator to set on_error dynamically 2022-03-15 06:57:25 -04:00
Rapptz
20aa6f866d Fix CommandTree removal and getter overloads 2022-03-15 03:34:04 -04:00
Rapptz
f015b59e43 Add CommandTree.walk_commands and Group.walk_commands 2022-03-15 03:24:20 -04:00
Stocker
5aa696ccfa
Fix typing issues and improve typing completeness across the library
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
Co-authored-by: Josh <josh.ja.butt@gmail.com>
2022-03-13 23:52:10 -04:00
Rapptz
5e9097179b Add CommandTree.copy_global_to method for quick development 2022-03-12 21:32:35 -05:00
Rapptz
0ef369c0fa [commands] Automatically unload top level app commands in extensions 2022-03-12 09:24:26 -05:00
Rapptz
a672455ca9 Fix some context menu commands not being registered in guild contexts
This happened when there weren't any application commands due to a typo
stemming from a copy paste error.

Fixes #7650
2022-03-12 08:39:57 -05:00
Rapptz
140a827190 Fix default guilds for commands not being respected
Pesky little typo

Fix #7641
2022-03-11 08:33:37 -05:00
Rapptz
26c6b4d449 Use new differentiator for guild and global commands
Fixes #7602
2022-03-10 20:10:49 -05:00
Arthur
8502978649
Check the global scope when dispatching context menus 2022-03-10 18:51:14 -05:00
Rapptz
a6ae7ec196 Raise error if two trees are registered to the same connection state 2022-03-09 20:35:07 -05:00
Rapptz
5741ad9368 Change default guild IDs attribute to persist on copy 2022-03-09 20:26:54 -05:00
Rapptz
303d33bb08 Support Group with app_commands.guilds decorator 2022-03-09 20:26:54 -05:00