49 Commits

Author SHA1 Message Date
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
Rapptz
25b4bc277b Add app_commands.guilds to set the guilds of a command in another way
This is mostly preparation for interopability with commands.Cog as this
would allow authors to specify the guilds for their cog defined
commands.
2022-03-08 00:48:24 -05:00
Rapptz
e6a87e0782 Add support for adding app commands locally to many guilds
This affects the context_menu and command decorators as well. Removing
and syncing do not support multiple guild IDs.
2022-03-07 21:52:58 -05:00
Rapptz
13e102b6b9 Add default parameter to CommandTree.sync
I'm not sure how I feel about this, since explicitly passing
guild=None seems better.
2022-03-05 22:02:33 -05:00
Rapptz
aa74238053 Reorganise documentation for interactions 2022-03-04 21:17:27 -05:00
Rapptz
f435d160dd Add Interaction.client property 2022-03-01 08:11:22 -05:00
Rapptz
6110fe5b1c Add fallback overloads for CommandTree 2022-03-01 07:54:14 -05:00
Rapptz
ae1aaac5a7 Add support for autocomplete 2022-03-01 05:42:44 -05:00
Rapptz
c10ed93cef Add support for error handlers 2022-03-01 05:42:44 -05:00
Rapptz
cdb7b3728e Fix potential conflicts in snowflake keys
This can happen on really old channels with the same ID as the guild ID
and having a command with both a role and a channel.
2022-03-01 05:42:44 -05:00
Rapptz
dffd72da58 Add support for context menu commands 2022-03-01 05:42:44 -05:00
Rapptz
0d2db90028 Implement slash commands 2022-03-01 05:35:29 -05:00