From e19d6d882cad91f653605f51fcafdc546ffe3092 Mon Sep 17 00:00:00 2001 From: Stanley Dimant Date: Tue, 2 Aug 2022 22:01:15 +0200 Subject: [PATCH] add forced as subcommand --- .../MareSynchronosServer/Discord/DiscordBot.cs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/MareSynchronosServer/MareSynchronosServer/Discord/DiscordBot.cs b/MareSynchronosServer/MareSynchronosServer/Discord/DiscordBot.cs index 73c115d..631725a 100644 --- a/MareSynchronosServer/MareSynchronosServer/Discord/DiscordBot.cs +++ b/MareSynchronosServer/MareSynchronosServer/Discord/DiscordBot.cs @@ -291,14 +291,13 @@ namespace MareSynchronosServer.Discord private async Task DiscordClient_Ready() { - var register = new SlashCommandBuilder(); - register.WithName("register"); - register.WithDescription("Starts the registration process for the Mare Synchronos server of this Discord"); - - var registerForced = new SlashCommandBuilder(); - registerForced.WithName("register"); - registerForced.WithDescription("Starts the registration process for the Mare Synchronos server of this Discord"); - registerForced.AddOption("forced", ApplicationCommandOptionType.SubCommand, "Will forcefully overwrite your current character on the service, if present", false, false); + var register = new SlashCommandBuilder() + .WithName("register") + .WithDescription("Starts the registration process for the Mare Synchronos server of this Discord") + .AddOption(new SlashCommandOptionBuilder() + .WithName("forced") + .WithDescription("Will forcefully overwrite your current character on the service, if present") + .WithType(ApplicationCommandOptionType.SubCommand)); var verify = new SlashCommandBuilder(); verify.WithName("verify"); @@ -307,7 +306,6 @@ namespace MareSynchronosServer.Discord try { await discordClient.CreateGlobalApplicationCommandAsync(register.Build()); - await discordClient.CreateGlobalApplicationCommandAsync(registerForced.Build()); await discordClient.CreateGlobalApplicationCommandAsync(verify.Build()); } catch (Exception ex)