コード例 #1
0
            public async Task RegisterAsync(CommandContext context, string username, [EmailAddress] string email, string password)
            {
                await context.Message.DeleteAsync();

                RegisterModel credentials = new() { Username = username, Email = email, Password = password };
                Response      result      = await _apiAuth.RegisterNewUserAsync(credentials, CancellationToken.None);

                await context.Channel.SendMessageAsync($"{context.User.Mention} {result.Status} : {result.Message}\n");
            }
        }
コード例 #2
0
            public async Task SetLoginAsync(InteractionContext ctx,
                                            [Option("username", "Account Username")] string username,
                                            [Option("email", "Account Email"), EmailAddress] string email,
                                            [Option("password", "Account Password")] string password)
            {
                await ctx.CreateResponseAsync(InteractionResponseType.DeferredChannelMessageWithSource, new() { IsEphemeral = true });

                RegisterModel credentials = new() { Username = username, Email = email, Password = password };
                Response      result      = await _apiAuth.RegisterNewUserAsync(credentials, CancellationToken.None);

                await ctx.FollowUpAsync($"{ctx.User.Mention} {result.Status} : {result.Message}\n");
            }