Skip to content

Commit 02642b5

Browse files
Use "UnconditionallyOverwriteCommands" when registering slash commands
Avoids ratelimits when registering
1 parent 17a3f3a commit 02642b5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Program.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,13 @@ internal static async Task Main()
121121
EnableCommandNotFoundException = false
122122
});
123123
extension.AddProcessor(textCommandProcessor);
124+
125+
// Use custom SlashCommandProcessor to use UnconditionallyOverwriteCommands
126+
SlashCommandProcessor slashCommandProcessor = new(new()
127+
{
128+
UnconditionallyOverwriteCommands = true,
129+
});
130+
extension.AddProcessor(slashCommandProcessor);
124131

125132
// Register context checks
126133
extension.AddCheck<RequireAuthCheck>();
@@ -137,7 +144,7 @@ internal static async Task Main()
137144

138145
}, new CommandsConfiguration
139146
{
140-
UseDefaultCommandErrorHandler = false
147+
UseDefaultCommandErrorHandler = false,
141148
});
142149

143150
// Build the client

0 commit comments

Comments
 (0)