private void RemoveIntent() { string targetToken = $"{lbKnownIntents.SelectedItem}"; TwitchBot.Commands.CustomMap.Remove(targetToken); lbKnownIntents.DataSource = Wit.ListIntents().Select(i => TwitchBot.Commands.Map.Keys.Contains(i) ? $"*{i}" : i).ToList <string>(); TwitchBot.Commands.SaveCustomCommands(); Wit.DeleteIntent(targetToken); }
private string[] RemoveCommand(TwitchMessage message) { if (message.HasModPrivileges && !string.IsNullOrEmpty(message.ArgsString)) { string targetToken = message.ArgsString; if (TwitchBot.Commands.CustomMap.Keys.Contains(targetToken)) { TwitchBot.Commands.CustomMap.Remove(targetToken); TwitchBot.Commands.SaveCustomCommands(); Wit.DeleteIntent(targetToken); return(new string[] { $"Removed command: {targetToken}" }); } } return(null); }