public override Task <int> RunAsync(string[] args) { if (!AccessKey.IsSet && !Authorization.IsSet) { throw new ArgumentNullException("You must provide at least one of the key parameters for a bot. Use 'k' or 'a' parameters"); } if (!Node.IsSet) { throw new ArgumentNullException("You must provide the node or a bot identifier using 'n' parameter. For example: 'saveNode -n papagaio -k YOUR KEY' or 'saveNode -n [email protected] -k YOUR KEY'"); } var stringNode = Node.Value.ToLowerInvariant().Trim(); if (!stringNode.Contains("@")) { stringNode += "@msging.net"; } var node = Lime.Protocol.Node.Parse(stringNode); var authorization = Authorization.Value; var accessKey = AccessKey.Value; if (!Authorization.IsSet) { authorization = BlipKeysFormater.GetAuthorizationKey(node.Name, accessKey); } _settingsFile.AddNodeCredentials(new NodeCredential { Node = node, Authorization = authorization }); return(Task.FromResult(0)); }