public override bool HandleCommand(ulong userId, string[] words) { int index = 0; SettingsBlockEnforcementItem blockItem = new SettingsBlockEnforcementItem(); if (words.Length > 1) { Communication.SendPrivateInformation(userId, "Too many arguments detected. Doing nothing to be safe."); return(true); } else if (words.Length == 0) { HandleSettingsGetBlockEnforcement getEnf = new HandleSettingsGetBlockEnforcement(); getEnf.HandleCommand(userId, null); } if (!int.TryParse(words[0], out index)) { Communication.SendPrivateInformation(userId, "Couldn't parse index; make sure it's a number."); return(true); } else { MTObservableCollection <SettingsBlockEnforcementItem> _BlockEnforcementItems = PluginSettings.Instance.BlockEnforcementItems; _BlockEnforcementItems.RemoveAt(index); PluginSettings.Instance.BlockEnforcementItems = _BlockEnforcementItems; Communication.SendPrivateInformation(userId, "Removed enforcement item " + index.ToString() + "."); return(true); } }
public override bool HandleCommand(ulong userId, string[] words) { int index = 0; SettingsBlockEnforcementItem blockItem = new SettingsBlockEnforcementItem(); if (words.Length > 1) { Communication.SendPrivateInformation(userId, "Too many arguments detected. Doing nothing to be safe."); return true; } else if (words.Length == 0) { HandleSettingsGetBlockEnforcement getEnf = new HandleSettingsGetBlockEnforcement(); getEnf.HandleCommand(userId, null); } if (!int.TryParse(words[0], out index)) { Communication.SendPrivateInformation(userId, "Couldn't parse index; make sure it's a number."); return true; } else { MTObservableCollection<SettingsBlockEnforcementItem> _BlockEnforcementItems = PluginSettings.Instance.BlockEnforcementItems; _BlockEnforcementItems.RemoveAt(index); PluginSettings.Instance.BlockEnforcementItems = _BlockEnforcementItems; Communication.SendPrivateInformation(userId, "Removed enforcement item " + index.ToString() + "."); return true; } }