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/src/Guides/03 Creating Commands.md
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -521,13 +521,16 @@ If your bot is complex enough, you might find yourself wanting to use custom mod
521
521
522
522
To do this, you'll want to use a string option, and define a converter. Information on how to use converters can be found [on the converter page](../08 Converters).
523
523
524
-
## Prefixed/Text Commands
524
+
## Hybrid Commands
525
525
526
-
To use prefixed commands, instead of typing `/my_command`, you will need to type instead `!my_command`, provided that the prefix you set is `!`.
526
+
!!! note
527
+
Prefixed commands, called by Discord as "text commands" and sometimes called "message commands" (not to be confused with Context Menu Message Commands), are commands that are triggered when a user sends a normal message with a designated "prefix" in front of them (ie `!my_command`).
528
+
529
+
interactions.py contains an extension for making these commands, which you can [read about here](/interactions.py/Guides/26 Prefixed Commands).
527
530
528
531
Hybrid commands are are slash commands that also get converted to an equivalent prefixed command under the hood. They are their own extension, and require [prefixed commands to be set up beforehand](/interactions.py/Guides/26 Prefixed Commands). After that, use the `setup` function in the `hybrid_commands` extension in your main bot file.
529
532
530
-
Your setup can (but doesn't necessarily have to) look like this:
Suggesting you are using the default mention settings for your bot, you should be able to run this command by `@BotPing my_command`.
555
+
Suggesting you are using the default mention settings for your bot, you should be able to run this command by typing out `@BotPing my_command` or using the slash command `/my_command`. Both will work largely equivalently.
553
556
554
557
As you can see, the only difference between hybrid commands and slash commands, from a developer perspective, is that they use `HybridContext`, which attempts
555
558
to seamlessly allow using the same context for slash and prefixed commands. You can always get the underlying context via `inner_context`, though.
0 commit comments