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
+8-6
Original file line number
Diff line number
Diff line change
@@ -319,6 +319,8 @@ Adding Context Menus.
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
322
+
Please note that the current limit for context menus with the Discord API is **5.**
323
+
322
324
A menu command (context menu) is an easy way for bot developers to program optionless and choiceless commands into their bot
323
325
which can be easily accessible by right clicking on a user and/or message present. Below is a table of the supported keys and
324
326
values:
@@ -340,7 +342,7 @@ The following table below represents how it would be shown as a JSON object:
340
342
"type": 3
341
343
}
342
344
343
-
The following table explains more about the `type` parameter being passed, which there are three of: `CHAT_INPUT`, `USER` and `MESSAGE`. By default, the type will
345
+
The following table explains more about the ``type`` parameter being passed, which there are three of: ``CHAT_INPUT``, ``USER`` and ``MESSAGE``. By default, the type will
344
346
always be the first. This is because it is a registered type that is used to process slash commands, and should not be used for when you are declaring context menu
345
347
commands in your bot's code at all:
346
348
@@ -354,7 +356,7 @@ commands in your bot's code at all:
354
356
| MESSAGE | 3 |
355
357
+------------+-----------+
356
358
357
-
Unlike `manage_commands` and `manage_components`, you will have to use a decorator for now to register them:
359
+
Unlike ``manage_commands`` and ``manage_components``, you will have to use a decorator for now to register them:
358
360
359
361
.. code-block :: python
360
362
@@ -370,12 +372,12 @@ Unlike `manage_commands` and `manage_components`, you will have to use a decorat
370
372
hidden=True
371
373
)
372
374
373
-
The `@slash.context_menu` decorator takes in the context type as given (to either appear when you right-click on a user or when you right-click on a message) as well
375
+
The ``@slash.context_menu`` decorator takes in the context type as given (to either appear when you right-click on a user or when you right-click on a message) as well
374
376
as the name of the command, and any guild IDs if given if you would like to make it applicable to only a guild. **We only accept connected names** for the time being,
375
377
although context menus will have the ability to have spaces in their name in the future when development further progresses.
376
378
377
-
You are able to also use the `@cog_ext.cog_context_menu` path which will require an import from `cog_ext.py` respectively, however, it is worth nothing that
378
-
the `target` kwarg for the decorator **must** be brought to the very end.
379
+
You are able to also use the ``@cog_ext.cog_context_menu`` path which will require an import from ``cog_ext.py`` respectively, however, it is worth nothing that
380
+
the ``target`` kwarg for the decorator **must** be brought to the very end.
379
381
380
382
Can I use components with context menus?
381
383
----------------------------------------
@@ -405,4 +407,4 @@ for explicitly context menus, as they're more universal.
0 commit comments