You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/gettingstarted.rst
+43-1Lines changed: 43 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -315,7 +315,7 @@ But what about buttons?
315
315
-----------------------
316
316
This library supports components (buttons, actionrows, selects, etc.). Take a look here: `components`_.
317
317
318
-
Adding Context Menus.
318
+
Making a message/menu command.
319
319
*********************
320
320
Lucky for you, this library has recently added support for context menus! Let's take a look into how they're designed.
321
321
@@ -401,8 +401,50 @@ The decision has been made that this will not be implemented because of two reas
401
401
for any responses would be currently pointless. Additionally, component listening is already a built-in feature that does not require further customized and new decorators
402
402
for explicitly context menus, as they're more universal.
403
403
404
+
Nested commands as subcommands.
405
+
*******************************
406
+
Before you get into learning how to create a subcommand, please be sure to read up on the documentation above given for how slash commands are made.
407
+
408
+
Subcommands are way to "nest" your slash commands under one (or more) given names, as either a "base" name or a "grouping" of an existing base. When this is said, it will initially appear very confusing. Let's use the table shown below as a way to introduce the new fields/properties that can be applied for a slash command to become a subcommand:
This table is importantly distinguishing the **library's** naming conventions and not the way that th eDiscord API handles it. The API does subcommand grouping and bases through the options of a slash command, so we decided to create a decorator instead to make this easy for bot developers alike to use. We will not be giving a JSON example of this because of this reason.
423
+
424
+
.. code-block :: python
425
+
426
+
# This will appear as "/bot latency" as latency is not an option,
If you would like to add a group instead, you may simply base the ``subcommand_group``` kwarg into the decorator. Please note that the slash command limit is 25 commands per subcommand group per subcommand base. (Laymen's term for 25 subcommands in a group, and 25 groups in a base. This is not a global exception and may also apply as a limitation for guild commands.)
435
+
436
+
Handling my errors.
437
+
*******************
438
+
439
+
Thankfully, we try to make a majority of our error handling very simple. If you would like to learn more about how to handle your errors, please refer to our `errors`_ page.
440
+
If you are looking for listener events, then check our `listeners`_ page instead.
441
+
442
+
As a side-note, as of version 3.0, message/menu commands (context menus) are handled under the ``on_slash_command_error`` event.
0 commit comments