public async Task AddFeatureAsync( [Summary("The name of the command.")] string command, [Summary("The name of the feature.")] string feature, [Summary("The arguments to pass to the feature."), Remainder] string arguments) { if (!CustomCommands.TryGetCommand(command, out CustomCommand customCommand)) { throw new InvalidOperationException($"A command with the name `{command}` does not exist."); } var commandFeature = CustomCommands.CreateFeature(feature, arguments); // Ensure no duplicate features exist int previousFeatures = customCommand.Features.RemoveAll(f => f.GetType().Equals(commandFeature.GetType())); // Add the new feature customCommand.Features.Add(commandFeature); CustomCommands.SaveCustomCommands(); await GetDefaultBuilder() .WithColor(Color.Green) .WithDescription(previousFeatures == 0 ? $"The feature `{feature}` was added to `{command}`!" : $"The feature `{feature}` was updated in `{command}`!") .Build() .SendToChannel(Context.Channel); }