Beispiel #1
0
        public async Task RejectAsync(int applicationId, [Remainder] string reason)
        {
            var cmd = new ChangeStatusSimple.Command
            {
                ApplicationId = applicationId, NewStatus = ApplicationStatus.Rejected
            };
            var cmdResult = await _mediator.Send(cmd);

            if (cmdResult.Succeeded)
            {
                var membersChannel        = Context.Guild.TextChannels.FindChannel(_config.ChannelNames.MemberApps);
                var userNotificationEmbed = new EmbedBuilder()
                                            .WithTitle("Application rejected")
                                            .WithDescription("Unfortunately, your application has been rejected.")
                                            .WithApplicationStatusColour(ApplicationStatus.Rejected)
                                            .WithMmccLogo()
                                            .AddField("Reason", reason)
                                            .AddField("Rejected by", Context.Message.Author)
                                            .Build();
                var staffNotificationEmbed = new EmbedBuilder()
                                             .WithTitle(":white_check_mark: Rejected the application successfully!")
                                             .WithDescription($"Application with ID `{applicationId}` has been *rejected*.")
                                             .WithMmccLogo()
                                             .WithColor(Color.Green)
                                             .Build();

                await membersChannel.SendMessageAsync($"<@{cmdResult.Payload!.AuthorDiscordId}>", false, userNotificationEmbed);

                await Context.Channel.SendEmbedAsync(staffNotificationEmbed);
            }
            else
            {
                await Context.Channel.SendEmbedAsync(cmdResult.ToErrorEmbed());
            }
        }
Beispiel #2
0
        public async Task ApproveAsync(int applicationId, string manual)
        {
            if (!manual.Equals("manual"))
            {
                await ApproveAsync();

                return;
            }

            var cmd = new ChangeStatusSimple.Command
            {
                ApplicationId = applicationId, NewStatus = ApplicationStatus.Approved
            };
            var cmdResult = await _mediator.Send(cmd);

            if (cmdResult.Succeeded)
            {
                var membersChannel = Context.Guild.TextChannels.FindChannel(_config.ChannelNames.MemberApps);
                await Context.Channel.SendMessageAsync($":white_check_mark: **Marked** application with ID `{applicationId}` as approved but the player still has to be promoted manually.\n\n" +
                                                       "**Remember to:**\n" +
                                                       ":one: Promote the player in-game via Polychat/MC\n" +
                                                       ":two: Give the player the appropriate Discord role\n" +
                                                       $":three: Let the player know in <#{membersChannel.Id}> that they've been promoted manually");
            }
            else
            {
                await Context.Channel.SendEmbedAsync(cmdResult.ToErrorEmbed());
            }
        }