From 5729be27ee6efb330ad4fa0d8beaacb8f5b14080 Mon Sep 17 00:00:00 2001 From: Amber Ehrlich Date: Wed, 11 Oct 2023 10:53:27 -0400 Subject: [PATCH 1/5] docs: reorganize interactions and components, add subcategories and move some things to other places --- .../interactions_and_components.md | 20 +++++-------------- .../components-menu.md | 7 +++++++ .../{ => components}/components.md | 0 .../{ => components}/components2.md | 0 .../{ => components}/components3.md | 0 .../slashcommands-menu.md | 12 +++++++++++ .../{ => slashcommands}/autocomplete.md | 0 .../clearing_slashcommands.md | 0 .../{ => slashcommands}/commandhandler.md | 0 .../{ => slashcommands}/slashcommands.md | 2 +- .../{ => slashcommands}/subcommands.md | 0 .../{ => slashcommands}/upload_parameter.md | 0 docpages/example_programs/misc.md | 2 ++ .../making_threads.md | 0 docpages/example_programs/the_basics.md | 5 +++-- .../detecting-messages.md | 0 .../private-messaging.md | 0 17 files changed, 30 insertions(+), 18 deletions(-) create mode 100644 docpages/example_programs/interactions_and_components/components-menu.md rename docpages/example_programs/interactions_and_components/{ => components}/components.md (100%) rename docpages/example_programs/interactions_and_components/{ => components}/components2.md (100%) rename docpages/example_programs/interactions_and_components/{ => components}/components3.md (100%) create mode 100644 docpages/example_programs/interactions_and_components/slashcommands-menu.md rename docpages/example_programs/interactions_and_components/{ => slashcommands}/autocomplete.md (100%) rename docpages/example_programs/interactions_and_components/{ => slashcommands}/clearing_slashcommands.md (100%) rename docpages/example_programs/interactions_and_components/{ => slashcommands}/commandhandler.md (100%) rename docpages/example_programs/interactions_and_components/{ => slashcommands}/slashcommands.md (94%) rename docpages/example_programs/interactions_and_components/{ => slashcommands}/subcommands.md (100%) rename docpages/example_programs/interactions_and_components/{ => slashcommands}/upload_parameter.md (100%) rename docpages/example_programs/{interactions_and_components => misc}/making_threads.md (100%) rename docpages/example_programs/{interactions_and_components => the_basics}/detecting-messages.md (100%) rename docpages/example_programs/{interactions_and_components => the_basics}/private-messaging.md (100%) diff --git a/docpages/example_programs/interactions_and_components.md b/docpages/example_programs/interactions_and_components.md index 761ac77d71..8316dffef8 100644 --- a/docpages/example_programs/interactions_and_components.md +++ b/docpages/example_programs/interactions_and_components.md @@ -1,20 +1,10 @@ \page interactions-and-components Interactions And Components -The example programs listed here demonstrate lots of things to do with interactions, application commands (slash commands) and message components. If you're looking to make your bot **modern and user friendly** these examples are what you need. +Interactions are a unified way provided by Discord to handle \ref slashcommands "slash commands" and \ref components-menu "component interactions", such as \ref components "clicking a button". Slash commands are much better than message commands as they are not rate limited as much, meaning your bot can handle a lot more at once. They also contain a lot of data about a command, for example by making a command take a user as a parameter, \ref resolved-objects "the entire user object will be contained in the interaction" so you do not have to fetch it yourself, avoiding even more rate limits! -* \subpage slashcommands "Using Slash Commands and Interactions" -* \subpage clearing_slashcommands -* \subpage subcommands "Slash command sub-commands" +* \subpage slashcommands-menu "Slash Commands" * \subpage user-only-messages "Ephemeral replies ('Only you can see this' replies)" -* \subpage components "Using button components" -* \subpage components2 "Advanced button components" -* \subpage components3 "Using select menu components" -* \subpage detecting-messages "Listening to messages" -* \subpage context-menu "Context Menus" -* \subpage modal-dialog-interactions "Modal Dialogs" -* \subpage commandhandler "Unified message/slash command handler" -* \subpage application-command-autocomplete "Slash command auto completion" -* \subpage discord-application-command-file-upload "Using file parameters in slash commands" -* \subpage private-messaging -* \subpage making_threads * \subpage resolved-objects +* \subpage components-menu +* \subpage modal-dialog-interactions "Modals" +* \subpage context-menu "Context Menus" diff --git a/docpages/example_programs/interactions_and_components/components-menu.md b/docpages/example_programs/interactions_and_components/components-menu.md new file mode 100644 index 0000000000..35b9502772 --- /dev/null +++ b/docpages/example_programs/interactions_and_components/components-menu.md @@ -0,0 +1,7 @@ +\page components-menu Message components + +Components are anything that can be attached to a message or a \ref modal-dialog-interactions modal and interacted with, for example buttons and select menus. Due to being \ref interactions-and-components "interactions", they benefit from a low rate limit and are much more efficient than the old ways of using reactions for this purpose. + +* \subpage components "Button components" +* \subpage components2 "Advanced button components" +* \subpage components3 "Select menu components" diff --git a/docpages/example_programs/interactions_and_components/components.md b/docpages/example_programs/interactions_and_components/components/components.md similarity index 100% rename from docpages/example_programs/interactions_and_components/components.md rename to docpages/example_programs/interactions_and_components/components/components.md diff --git a/docpages/example_programs/interactions_and_components/components2.md b/docpages/example_programs/interactions_and_components/components/components2.md similarity index 100% rename from docpages/example_programs/interactions_and_components/components2.md rename to docpages/example_programs/interactions_and_components/components/components2.md diff --git a/docpages/example_programs/interactions_and_components/components3.md b/docpages/example_programs/interactions_and_components/components/components3.md similarity index 100% rename from docpages/example_programs/interactions_and_components/components3.md rename to docpages/example_programs/interactions_and_components/components/components3.md diff --git a/docpages/example_programs/interactions_and_components/slashcommands-menu.md b/docpages/example_programs/interactions_and_components/slashcommands-menu.md new file mode 100644 index 0000000000..575295a06d --- /dev/null +++ b/docpages/example_programs/interactions_and_components/slashcommands-menu.md @@ -0,0 +1,12 @@ +\page slashcommands-menu Slash commands + +Here you will find examples on how to use slash commands, subcommands, and different types or parameters. + +* \subpage slashcommands "Using Slash Commands" +* \subpage clearing_slashcommands +* \subpage subcommands "Slash command sub-commands" +* \subpage application-command-autocomplete "Slash command auto completion" +* \subpage discord-application-command-file-upload "Using file parameters in slash commands" +* \subpage commandhandler "Unified message/slash command handler" + +\note Keep in mind, someone using a slash command is NOT A MESSAGE!! It is not a string but an interaction structure with its own data, and command parameters are objects. diff --git a/docpages/example_programs/interactions_and_components/autocomplete.md b/docpages/example_programs/interactions_and_components/slashcommands/autocomplete.md similarity index 100% rename from docpages/example_programs/interactions_and_components/autocomplete.md rename to docpages/example_programs/interactions_and_components/slashcommands/autocomplete.md diff --git a/docpages/example_programs/interactions_and_components/clearing_slashcommands.md b/docpages/example_programs/interactions_and_components/slashcommands/clearing_slashcommands.md similarity index 100% rename from docpages/example_programs/interactions_and_components/clearing_slashcommands.md rename to docpages/example_programs/interactions_and_components/slashcommands/clearing_slashcommands.md diff --git a/docpages/example_programs/interactions_and_components/commandhandler.md b/docpages/example_programs/interactions_and_components/slashcommands/commandhandler.md similarity index 100% rename from docpages/example_programs/interactions_and_components/commandhandler.md rename to docpages/example_programs/interactions_and_components/slashcommands/commandhandler.md diff --git a/docpages/example_programs/interactions_and_components/slashcommands.md b/docpages/example_programs/interactions_and_components/slashcommands/slashcommands.md similarity index 94% rename from docpages/example_programs/interactions_and_components/slashcommands.md rename to docpages/example_programs/interactions_and_components/slashcommands/slashcommands.md index a6d7ea0bdc..1f549b7d6c 100644 --- a/docpages/example_programs/interactions_and_components/slashcommands.md +++ b/docpages/example_programs/interactions_and_components/slashcommands/slashcommands.md @@ -1,6 +1,6 @@ \page slashcommands Using Slash Commands and Interactions -Slash commands and interactions are a newer feature of Discord which allow bot's commands to be registered centrally within the system and for users to easily explore and get help with available commands through the client itself. +Slash commands and interactions are a newer feature of Discord which allow a bot's commands to be registered centrally within the system and for users to easily explore and get help with available commands through the client itself. To add a slash command you should use the dpp::cluster::global_command_create method for global commands (available to all guilds) or dpp::cluster::guild_command_create to create a local command (available only to one guild). If you want to add many commands, it is advised to use the dpp::cluster::global_bulk_command_create method for global commands or the dpp::cluster::guild_bulk_command_create method for local commands. diff --git a/docpages/example_programs/interactions_and_components/subcommands.md b/docpages/example_programs/interactions_and_components/slashcommands/subcommands.md similarity index 100% rename from docpages/example_programs/interactions_and_components/subcommands.md rename to docpages/example_programs/interactions_and_components/slashcommands/subcommands.md diff --git a/docpages/example_programs/interactions_and_components/upload_parameter.md b/docpages/example_programs/interactions_and_components/slashcommands/upload_parameter.md similarity index 100% rename from docpages/example_programs/interactions_and_components/upload_parameter.md rename to docpages/example_programs/interactions_and_components/slashcommands/upload_parameter.md diff --git a/docpages/example_programs/misc.md b/docpages/example_programs/misc.md index 131f6dcb91..3ff56d64a7 100644 --- a/docpages/example_programs/misc.md +++ b/docpages/example_programs/misc.md @@ -4,6 +4,8 @@ This section lists examples that do not fit neatly into any of the categories ab * \subpage making_a_http_request "Making arbitrary HTTP requests using D++" * \subpage spdlog "Integrating with spdlog" +* \subpage editing-channels-and-messages +* \subpage making_threads * \subpage caching-messages "Caching messages" * \subpage collecting-reactions "Collecting Reactions" * \subpage cpp-eval-command-discord "Making an eval command in C++" diff --git a/docpages/example_programs/interactions_and_components/making_threads.md b/docpages/example_programs/misc/making_threads.md similarity index 100% rename from docpages/example_programs/interactions_and_components/making_threads.md rename to docpages/example_programs/misc/making_threads.md diff --git a/docpages/example_programs/the_basics.md b/docpages/example_programs/the_basics.md index 0522b99d7e..be54d97478 100644 --- a/docpages/example_programs/the_basics.md +++ b/docpages/example_programs/the_basics.md @@ -4,8 +4,9 @@ These example programs are great to get started with simple things in the D++ li * \subpage firstbot "Creating Your First Bot" * \subpage embed-message "Sending Embeds" +* \subpage private-messaging * \subpage attach-file "Attaching a file" * \subpage webhooks "Webhooks" * \subpage callback-functions "Using Callback Functions" -* \subpage editing-channels-and-messages -* \subpage using-cache \ No newline at end of file +* \subpage using-cache +* \subpage detecting-messages "Listening to messages" diff --git a/docpages/example_programs/interactions_and_components/detecting-messages.md b/docpages/example_programs/the_basics/detecting-messages.md similarity index 100% rename from docpages/example_programs/interactions_and_components/detecting-messages.md rename to docpages/example_programs/the_basics/detecting-messages.md diff --git a/docpages/example_programs/interactions_and_components/private-messaging.md b/docpages/example_programs/the_basics/private-messaging.md similarity index 100% rename from docpages/example_programs/interactions_and_components/private-messaging.md rename to docpages/example_programs/the_basics/private-messaging.md From 8b941d7f64b462bdfd3a872a0bc5488ce5203f44 Mon Sep 17 00:00:00 2001 From: Amber Ehrlich Date: Wed, 11 Oct 2023 10:56:53 -0400 Subject: [PATCH 2/5] windows moment --- .../components-menu.md | 14 +++++------ .../slashcommands-menu.md | 24 +++++++++---------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/docpages/example_programs/interactions_and_components/components-menu.md b/docpages/example_programs/interactions_and_components/components-menu.md index 35b9502772..fbce55f6d1 100644 --- a/docpages/example_programs/interactions_and_components/components-menu.md +++ b/docpages/example_programs/interactions_and_components/components-menu.md @@ -1,7 +1,7 @@ -\page components-menu Message components - -Components are anything that can be attached to a message or a \ref modal-dialog-interactions modal and interacted with, for example buttons and select menus. Due to being \ref interactions-and-components "interactions", they benefit from a low rate limit and are much more efficient than the old ways of using reactions for this purpose. - -* \subpage components "Button components" -* \subpage components2 "Advanced button components" -* \subpage components3 "Select menu components" +\page components-menu Message components + +Components are anything that can be attached to a message or a \ref modal-dialog-interactions modal and interacted with, for example buttons and select menus. Due to being \ref interactions-and-components "interactions", they benefit from a low rate limit and are much more efficient than the old ways of using reactions for this purpose. + +* \subpage components "Button components" +* \subpage components2 "Advanced button components" +* \subpage components3 "Select menu components" diff --git a/docpages/example_programs/interactions_and_components/slashcommands-menu.md b/docpages/example_programs/interactions_and_components/slashcommands-menu.md index 575295a06d..87d2a92af6 100644 --- a/docpages/example_programs/interactions_and_components/slashcommands-menu.md +++ b/docpages/example_programs/interactions_and_components/slashcommands-menu.md @@ -1,12 +1,12 @@ -\page slashcommands-menu Slash commands - -Here you will find examples on how to use slash commands, subcommands, and different types or parameters. - -* \subpage slashcommands "Using Slash Commands" -* \subpage clearing_slashcommands -* \subpage subcommands "Slash command sub-commands" -* \subpage application-command-autocomplete "Slash command auto completion" -* \subpage discord-application-command-file-upload "Using file parameters in slash commands" -* \subpage commandhandler "Unified message/slash command handler" - -\note Keep in mind, someone using a slash command is NOT A MESSAGE!! It is not a string but an interaction structure with its own data, and command parameters are objects. +\page slashcommands-menu Slash commands + +Here you will find examples on how to use slash commands, subcommands, and different types or parameters. + +* \subpage slashcommands "Using Slash Commands" +* \subpage clearing_slashcommands +* \subpage subcommands "Slash command sub-commands" +* \subpage application-command-autocomplete "Slash command auto completion" +* \subpage discord-application-command-file-upload "Using file parameters in slash commands" +* \subpage commandhandler "Unified message/slash command handler" + +\note Keep in mind, someone using a slash command is NOT A MESSAGE!! It is not a string but an interaction structure with its own data, and command parameters are objects. From b43ba7145c029da7388d9e618b36230b378da24f Mon Sep 17 00:00:00 2001 From: Amber Ehrlich Date: Wed, 11 Oct 2023 10:59:06 -0400 Subject: [PATCH 3/5] add link to resolved objects in note --- .../interactions_and_components/slashcommands-menu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docpages/example_programs/interactions_and_components/slashcommands-menu.md b/docpages/example_programs/interactions_and_components/slashcommands-menu.md index 87d2a92af6..03846de482 100644 --- a/docpages/example_programs/interactions_and_components/slashcommands-menu.md +++ b/docpages/example_programs/interactions_and_components/slashcommands-menu.md @@ -9,4 +9,4 @@ Here you will find examples on how to use slash commands, subcommands, and diffe * \subpage discord-application-command-file-upload "Using file parameters in slash commands" * \subpage commandhandler "Unified message/slash command handler" -\note Keep in mind, someone using a slash command is NOT A MESSAGE!! It is not a string but an interaction structure with its own data, and command parameters are objects. +\note Keep in mind, someone using a slash command is NOT A MESSAGE!! It is not a string but an interaction structure with its own data, and \ref resolved-objects "command parameters are objects". From fde28fe55267de258576e4434a33dfd9df7e852e Mon Sep 17 00:00:00 2001 From: Amber Ehrlich Date: Wed, 11 Oct 2023 11:00:48 -0400 Subject: [PATCH 4/5] fix link in components --- .../interactions_and_components/components-menu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docpages/example_programs/interactions_and_components/components-menu.md b/docpages/example_programs/interactions_and_components/components-menu.md index fbce55f6d1..f7fed09ecc 100644 --- a/docpages/example_programs/interactions_and_components/components-menu.md +++ b/docpages/example_programs/interactions_and_components/components-menu.md @@ -1,6 +1,6 @@ \page components-menu Message components -Components are anything that can be attached to a message or a \ref modal-dialog-interactions modal and interacted with, for example buttons and select menus. Due to being \ref interactions-and-components "interactions", they benefit from a low rate limit and are much more efficient than the old ways of using reactions for this purpose. +Components are anything that can be attached to a message or a \ref modal-dialog-interactions "modal" and interacted with, for example buttons and select menus. Due to being \ref interactions-and-components "interactions", they benefit from a low rate limit and are much more efficient than the old ways of using reactions for this purpose. * \subpage components "Button components" * \subpage components2 "Advanced button components" From 357274aae9203390f794b050f7a356f6c7cbee8a Mon Sep 17 00:00:00 2001 From: Amber Ehrlich Date: Wed, 11 Oct 2023 11:32:58 -0400 Subject: [PATCH 5/5] fix wording --- .../interactions_and_components/slashcommands-menu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docpages/example_programs/interactions_and_components/slashcommands-menu.md b/docpages/example_programs/interactions_and_components/slashcommands-menu.md index 03846de482..16a7baf4f6 100644 --- a/docpages/example_programs/interactions_and_components/slashcommands-menu.md +++ b/docpages/example_programs/interactions_and_components/slashcommands-menu.md @@ -9,4 +9,4 @@ Here you will find examples on how to use slash commands, subcommands, and diffe * \subpage discord-application-command-file-upload "Using file parameters in slash commands" * \subpage commandhandler "Unified message/slash command handler" -\note Keep in mind, someone using a slash command is NOT A MESSAGE!! It is not a string but an interaction structure with its own data, and \ref resolved-objects "command parameters are objects". +\note Keep in mind, a slash command when sent to your bot is NOT SENT AS A MESSAGE! It is not a string but an interaction structure with its own data, and \ref resolved-objects "command parameters are objects".