示例#1
0
        public async Task AddCredential(ICommand command, CancellationToken ct)
        {
            var credentials = new Credentials
            {
                Login    = command["Login"],
                Password = command["Password"].AsString.ToSecureString(),
                Name     = command["Description"]
            };

            await _credentialsService.AddAsync(command.Author.Id, credentials, ct);

            await command.ReplySuccess($"A credential with ID `{credentials.Id}` has been added! Use `credential list` to view all your saved credentials.");
        }