Skip to content

Commit 99d8ca4

Browse files
quinchsCookiezzz
andcommitted
Update bulk-overwrite-of-global-slash-commands.md
Co-Authored-By: Cookiezzz <[email protected]>
1 parent 4b7cda0 commit 99d8ca4

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/guides/int_basics/application-commands/slash-commands/bulk-overwrite-of-global-slash-commands.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ title: Slash Command Bulk Overwrites
66
If you have too many global commands then you might want to consider using the bulk overwrite function.
77

88
```cs
9-
public async Task Client_Ready()
9+
public async Task Client_Ready()
1010
{
1111
List<ApplicationCommandProperties> applicationCommandProperties = new();
12-
try
12+
try
1313
{
1414
// Simple help slash command.
1515
SlashCommandBuilder globalCommandHelp = new SlashCommandBuilder();
@@ -27,11 +27,12 @@ public async Task Client_Ready()
2727
SlashCommandBuilder globalCommandAddFamily = new SlashCommandBuilder();
2828
globalCommandAddFamily.WithName("add-family");
2929
globalCommandAddFamily.WithDescription("Add a family");
30+
globalCommandAddFamily.AddOptions(slashCommandOptionBuilder);
3031
applicationCommandProperties.Add(globalCommandAddFamily.Build());
3132

3233
await _client.BulkOverwriteGlobalApplicationCommandsAsync(applicationCommandProperties.ToArray());
33-
}
34-
catch (ApplicationCommandException exception)
34+
}
35+
catch (ApplicationCommandException exception)
3536
{
3637
var json = JsonConvert.SerializeObject(exception.Error, Formatting.Indented);
3738
Console.WriteLine(json);

0 commit comments

Comments
 (0)