public void Groups(ISender sender, ArgumentList args) { var add = args.TryPop("add"); //xgroup add groupname var save = args.TryPop("-save"); if (add) { var groupName = args.GetString(0); if (XmlParser.HasGroup(groupName)) { throw new CommandError(Languages.DefinitionsExist + Languages.Group); } XmlParser.AddGroup(groupName); if (save) { XmlParser.Save(); } sender.sendMessage( String.Format("`{0}` {1}", groupName, Languages.HasBeenCreated) ); } else { throw new CommandError(Languages.ArgumentsExpected); } }