diff --git a/Writerside/topics/core/Commands.topic b/Writerside/topics/core/Commands.topic index a763e4b8..eb81175e 100644 --- a/Writerside/topics/core/Commands.topic +++ b/Writerside/topics/core/Commands.topic @@ -3,15 +3,10 @@ SYSTEM "https://resources.jetbrains.com/writerside/1.0/xhtml-entities.dtd"> + title="Commands ✏️" id="Commands">

Kord Extensions provides a rich, type-safe commands framework which is only as complex as you need it to be. - As commands are the backbone of most non-trivial bots, it's important to have a thorough understanding of the - framework. -

- -

At the moment, three basic types of commands are supported:

diff --git a/Writerside/topics/core/commands/Chat-Commands.topic b/Writerside/topics/core/commands/Chat-Commands.topic index 8e397b80..d2b3b3af 100644 --- a/Writerside/topics/core/commands/Chat-Commands.topic +++ b/Writerside/topics/core/commands/Chat-Commands.topic @@ -5,5 +5,189 @@ xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/topic.v2.xsd" title="Chat Commands ✏️" id="Chat-Commands"> -

Start typing here...

+ +

+ Privileged Intents and You +

+ +

+ Chat commands require the use of the "message content" privileged intent. + While chat commands were traditionally how users interacted with bots on Discord, + this is no longer what Discord recommends or encourages for your bots. +

+ +

+ If your bot is on 75 or more guilds (or you plan to grow it to that point), you should consider using + and instead of chat commands as much + as possible. +

+ +

+ Your bot will need to go through a verification process (which starts at 75 guilds) before it can join + over 100 guilds. + Discord will not verify bots that are using the "message content" privileged + intent without a good reason for it. +

+ +

+ The only situations that we advise you to use chat commands for are + + those where the other types of commands provide an objectively worse user experience. + + This largely only applies to commands that need to take a large amount of text as input (where modals do + not suffice), or where your bot needs + to make use of file attachments uploaded to Discord without downloading them. +

+ +

+ Additionally, it's worth noting that + + the Discord client encourages users to make use of + when they attempt to use a chat command. + This means that users will expect your bots to support and + as a default mode of interaction. +

+
+ + +

+ Maintenance status +

+ +

+ Due to the situation explained in the above warning, + chat commands are not regularly used or tested by Kord Extensions' users or developers. + + As a result, there may be small bugs or formatting problems that we haven't noticed or had time to fix. +

+ +

+ If you run into any problems with the chat commands framework or its help extension, please let us know + or submit a Pull Request to address the issue. +

+
+ +

+ Please don't skip over the above admonitions — they're important! +

+ + +

+ Chat commands are a fairly simple concept. + When a user sends a message starting with a command prefix (or bot mention), the command name and arguments, + Kord Extensions can process it accordingly. +

+ +

+ To get started with chat commands, first create an extension. + Command arguments are provided as described on +

+ +

+ All builder functions should be called within your bot's `setup` function when you're registering commands + before the bot starts up. + However, it is also possible to register commands later on in the bot's lifecycle by calling the same + functions. +

+ +

+ Chat commands support command arguments, which are specified as explained on + the commands overview page. + However, unlike the other command types, they do not support . +

+ + + +

+ Standalone commands are the simplest type of chat command, and they're defined using the `chatCommand` + builder function. + This builder is a receiver function against the ChatCommand type, which provides a number of + APIs that can be used to configure your command and its metadata. +

+ +

+ At minimum, a command must have a name, description and action + defined. +

+ +

+ The following APIs are available for use when writing a chat command, in addition to those provided by + the base Command type.. +

+ + + + + + + + + + + + + + + + + + + + + + +
NameReceiverDescription
actionChatCommandContext<Arguments> + Required: Register the command's action, which will be run when + the command is invoked. + Provide the constructor for an Arguments subtype as the first argument to this + function if your command takes any arguments. +
checkCheckWithCache<MessageCreateEvent> + Register a check that must pass for the command's action + to be run. + For more information on checks, see the dedicated documentation. +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
descriptionString + The command's description. + This should be a string that explains what the command does. + If the string spans multiple lines, the first line should be a short summary of what the + command does, with a blank line underneath. +
nameString + The command's name, which is used to identify the command internally and for invoking the + command on Discord. +
+
+
\ No newline at end of file