Browse Source

[DOCS] Add a note about `DontAutoRegisterAttribute` (#2430)

* add a note about `DontAutoRegisterAttribute`

* Remove "to to" and add punctuation

Co-authored-by: MrCakeSlayer <13650699+MrCakeSlayer@users.noreply.github.com>
tags/3.8.0
Misha133 GitHub 2 years ago
parent
commit
917118d094
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions
  1. +6
    -2
      docs/guides/int_framework/intro.md

+ 6
- 2
docs/guides/int_framework/intro.md View File

@@ -294,7 +294,7 @@ By nesting commands inside a module that is tagged with [GroupAttribute] you can
> [!NOTE] > [!NOTE]
> To not use the command group's name as a prefix for component or modal interaction's custom id set `ignoreGroupNames` parameter to `true` in classes with [GroupAttribute] > To not use the command group's name as a prefix for component or modal interaction's custom id set `ignoreGroupNames` parameter to `true` in classes with [GroupAttribute]
> >
> However, you have to be careful to prevent overlapping ids of buttons and modals
> However, you have to be careful to prevent overlapping ids of buttons and modals.


[!code-csharp[Command Group Example](samples/intro/groupmodule.cs)] [!code-csharp[Command Group Example](samples/intro/groupmodule.cs)]


@@ -346,10 +346,13 @@ Command registration methods can only be used after the gateway client is ready
Methods like `AddModulesToGuildAsync()`, `AddCommandsToGuildAsync()`, `AddModulesGloballyAsync()` and `AddCommandsGloballyAsync()` Methods like `AddModulesToGuildAsync()`, `AddCommandsToGuildAsync()`, `AddModulesGloballyAsync()` and `AddCommandsGloballyAsync()`
can be used to register cherry picked modules or commands to global/guild scopes. can be used to register cherry picked modules or commands to global/guild scopes.


> [!NOTE]
> [DontAutoRegisterAttribute] can be used on module classes to prevent `RegisterCommandsGloballyAsync()` and `RegisterCommandsToGuildAsync()` from registering them to the Discord.

> [!NOTE] > [!NOTE]
> In debug environment, since Global commands can take up to 1 hour to register/update, > In debug environment, since Global commands can take up to 1 hour to register/update,
> it is adviced to register your commands to a test guild for your changes to take effect immediately. > it is adviced to register your commands to a test guild for your changes to take effect immediately.
> You can use preprocessor directives to create a simple logic for registering commands as seen above
> You can use preprocessor directives to create a simple logic for registering commands as seen above.


## Interaction Utility ## Interaction Utility


@@ -377,6 +380,7 @@ delegate can be used to create HTTP responses from a deserialized json object st
[DependencyInjection]: xref:Guides.DI.Intro [DependencyInjection]: xref:Guides.DI.Intro


[GroupAttribute]: xref:Discord.Interactions.GroupAttribute [GroupAttribute]: xref:Discord.Interactions.GroupAttribute
[DontAutoRegisterAttribute]: xref:Discord.Interactions.DontAutoRegisterAttribute
[InteractionService]: xref:Discord.Interactions.InteractionService [InteractionService]: xref:Discord.Interactions.InteractionService
[InteractionServiceConfig]: xref:Discord.Interactions.InteractionServiceConfig [InteractionServiceConfig]: xref:Discord.Interactions.InteractionServiceConfig
[InteractionModuleBase]: xref:Discord.Interactions.InteractionModuleBase [InteractionModuleBase]: xref:Discord.Interactions.InteractionModuleBase


Loading…
Cancel
Save