Example #1
0
 private async Task SendMessageToTargetFeedbackChannel(IUserMessage message)
 {
     var mentionedUserId = message.MentionedUserIds.First();
     var channels        = FeedbackCommon.GetExistingChannelsAndTopics(FeedbackCommon.GetFeedbackCategory(this.Guild));
     var targetChannel   = FeedbackCommon.GetFeedbackChannelForUser(mentionedUserId, channels);
     await targetChannel?.SendMessageAsync($"{targetChannel.GetUserMentionForChannel()} you have received new feedback!" +
                                           $"\n{GetFeedbackString(message)}");
 }
        public async Task SelfFeedbackReminderMissing()
        {
            var channels = FeedbackCommon.GetExistingChannelsAndTopics(this.Context.Guild.GetFeedbackCategory()).Select(x => x.Value);

            foreach (var channel in channels)
            {
                await RemindRaiderIfNoFeedbackSubmitted(channel);
            }
        }
        public async Task Initialize(DiscordSocketClient client)
        {
            this.Client = client;

            this.Client.GuildMemberUpdated += UserUpdated;

            this.Guild = this.Client.Guilds.First(x => x.Id == OmgSpidersBotDriver.OmgSpidersGuildId);
            await this.Guild.DownloadUsersAsync();

            this.Raiders = this.Guild.Users.Where(x => x.Roles.Any(x => x.Id == FeedbackCommon.TrialRoleId || x.Id == FeedbackCommon.MainRaiderRoleId));

            this.FeedbackCategory = this.Guild.GetFeedbackCategory();
            this.ArchiveCategory  = this.Guild.GetFeedbackArchiveCategory();
            this.RaiderChannels   = FeedbackCommon.GetExistingChannelsAndTopics(FeedbackCategory);
            this.ArchiveChannels  = FeedbackCommon.GetExistingChannelsAndTopics(ArchiveCategory);

            await SetupPerRaiderChannels();
            await ArchiveChannelsForNonRaiders();

            await SortChannelsByName();
        }