public async Task AddCustomCommand(string name, [Remainder] string message) { string parsedCommand = ParseCommandInputToJSONString(message); if (_customCommands.Has(name)) { _customCommands.Set(name, parsedCommand); await ReplyAsync("Custom command updated!"); } else { _customCommands.Add(name, parsedCommand); await ReplyAsync("Custom command added!"); } }
public async Task AddCustomCommand(string name, [Remainder] string message) { // Converts \\ to \ (because single \ can't be passed by discord) name = name.Replace(@"\\", @"\"); string parsedCommand = ParseCommandInputToJSONString(message); if (_customCommands.Has(name)) { _customCommands.Set(name, parsedCommand); await ReplyAsync("Custom command updated!"); } else { _customCommands.Add(name, parsedCommand); await ReplyAsync("Custom command added!"); } }