Exemplo n.º 1
0
        public async Task ExecuteAllActiveWebhooksAsync(DPSReportJSON reportJSON)
        {
            string   bossName      = reportJSON.Encounter.Boss + (reportJSON.ChallengeMode ? " CM" : "");
            string   successString = (reportJSON.Encounter.Success ?? false) ? ":white_check_mark:" : "❌";
            string   extraJSON     = (reportJSON.ExtraJSON == null) ? "" : $"Recorded by: {reportJSON.ExtraJSON.RecordedBy}\nDuration: {reportJSON.ExtraJSON.Duration}\nElite Insights version: {reportJSON.ExtraJSON.EliteInsightsVersion}\n";
            string   icon          = "";
            BossData bossData      = Bosses.GetBossDataFromId(reportJSON.Encounter.BossId);

            if (bossData != null)
            {
                bossName = bossData.Name + (reportJSON.ChallengeMode ? " CM" : "");
                icon     = bossData.Icon;
            }
            int color = (reportJSON.Encounter.Success ?? false) ? 32768 : 16711680;
            DiscordAPIJSONContentEmbedThumbnail discordContentEmbedThumbnail = new DiscordAPIJSONContentEmbedThumbnail()
            {
                Url = icon
            };
            DateTime timestampDateTime = DateTime.UtcNow;

            if (DateTime.TryParse(reportJSON.ExtraJSON.TimeStart, out DateTime timeStart))
            {
                timestampDateTime = timeStart;
            }
            string timestamp = timestampDateTime.ToString("yyyy'-'MM'-'ddTHH':'mm':'ssZ");
            DiscordAPIJSONContentEmbed discordContentEmbed = new DiscordAPIJSONContentEmbed()
            {
                Title       = bossName,
                Url         = reportJSON.Permalink,
                Description = $"{extraJSON}Result: {successString}\narcdps version: {reportJSON.EVTC.Type}{reportJSON.EVTC.Version}",
                Color       = color,
                TimeStamp   = timestamp,
                Thumbnail   = discordContentEmbedThumbnail
            };
            DiscordAPIJSONContent discordContentWithoutPlayers = new DiscordAPIJSONContent()
            {
                Embeds = new List <DiscordAPIJSONContentEmbed>()
                {
                    discordContentEmbed
                }
            };
            DiscordAPIJSONContentEmbed discordContentEmbedForPlayers = new DiscordAPIJSONContentEmbed()
            {
                Title       = bossName,
                Url         = reportJSON.Permalink,
                Description = $"{extraJSON}Result: {successString}\narcdps version: {reportJSON.EVTC.Type}{reportJSON.EVTC.Version}",
                Color       = color,
                TimeStamp   = timestamp,
                Thumbnail   = discordContentEmbedThumbnail
            };

            if (reportJSON.Players.Values.Count <= 10)
            {
                List <DiscordAPIJSONContentEmbedField> fields = new List <DiscordAPIJSONContentEmbedField>();
                foreach (DPSReportJSONPlayers player in reportJSON.Players.Values)
                {
                    fields.Add(new DiscordAPIJSONContentEmbedField()
                    {
                        Name = player.CharacterName, Value = $"```\n{player.DisplayName}\n\n{Players.ResolveSpecName(player.Profession, player.EliteSpec)}\n```", Inline = true
                    });
                }
                discordContentEmbedForPlayers.Fields = fields;
            }
            DiscordAPIJSONContent discordContentWithPlayers = new DiscordAPIJSONContent()
            {
                Embeds = new List <DiscordAPIJSONContentEmbed>()
                {
                    discordContentEmbedForPlayers
                }
            };

            try
            {
                string jsonContentWithoutPlayers = JsonConvert.SerializeObject(discordContentWithoutPlayers);
                string jsonContentWithPlayers    = JsonConvert.SerializeObject(discordContentWithPlayers);
                foreach (int key in allWebhooks.Keys)
                {
                    DiscordWebhookData webhook = allWebhooks[key];
                    if (!webhook.Active ||
                        (webhook.SuccessFailToggle.Equals(DiscordWebhookDataSuccessToggle.OnSuccessOnly) && !(reportJSON.Encounter.Success ?? false)) ||
                        (webhook.SuccessFailToggle.Equals(DiscordWebhookDataSuccessToggle.OnFailOnly) && (reportJSON.Encounter.Success ?? false)) ||
                        webhook.BossesDisable.Contains(reportJSON.Encounter.BossId))
                    {
                        continue;
                    }
                    Uri uri = new Uri(webhook.URL);
                    if (webhook.ShowPlayers)
                    {
                        using (StringContent content = new StringContent(jsonContentWithPlayers, Encoding.UTF8, "application/json"))
                        {
                            using (await mainLink.HttpClientController.PostAsync(uri, content)) { }
                        }
                    }
                    else
                    {
                        using (StringContent content = new StringContent(jsonContentWithoutPlayers, Encoding.UTF8, "application/json"))
                        {
                            using (await mainLink.HttpClientController.PostAsync(uri, content)) { }
                        }
                    }
                }
                if (allWebhooks.Count > 0)
                {
                    mainLink.AddToText(">:> All active webhooks successfully executed.");
                }
            }
            catch
            {
                mainLink.AddToText(">:> Unable to execute active webhooks.");
            }
        }
Exemplo n.º 2
0
 public async Task ExecuteAllActiveWebhooksAsync(DPSReportJSON reportJSON)
 {
     if (reportJSON.Encounter.BossId.Equals(1)) // WvW
     {
         var extraJSONFightName = (reportJSON.ExtraJSON is null) ? reportJSON.Encounter.Boss : reportJSON.ExtraJSON.FightName;
         var extraJSON          = (reportJSON.ExtraJSON is null) ? string.Empty : $"Recorded by: {reportJSON.ExtraJSON.RecordedBy}\nDuration: {reportJSON.ExtraJSON.Duration}\nElite Insights version: {reportJSON.ExtraJSON.EliteInsightsVersion}";
         var icon     = string.Empty;
         var bossData = Bosses.GetBossDataFromId(1);
         if (!(bossData is null))
         {
             icon = bossData.Icon;
         }
         var colour = 16752238;
         var discordContentEmbedThumbnail = new DiscordAPIJSONContentEmbedThumbnail()
         {
             Url = icon
         };
         var timestampDateTime = DateTime.UtcNow;
         if (!(reportJSON.ExtraJSON is null))
         {
             timestampDateTime = reportJSON.ExtraJSON.TimeStart;
         }
         var timestamp           = timestampDateTime.ToString("o");
         var discordContentEmbed = new DiscordAPIJSONContentEmbed()
         {
             Title       = extraJSONFightName,
             Url         = reportJSON.Permalink,
             Description = $"{extraJSON}\narcdps version: {reportJSON.EVTC.Type}{reportJSON.EVTC.Version}",
             Colour      = colour,
             TimeStamp   = timestamp,
             Thumbnail   = discordContentEmbedThumbnail
         };
         // fields
         if (!(reportJSON.ExtraJSON is null))
         {
             // squad summary
             var squadPlayers = reportJSON.ExtraJSON.Players
                                .Where(x => !x.FriendNPC && !x.NotInSquad)
                                .Count();
             var squadDamage = reportJSON.ExtraJSON.Players
                               .Where(x => !x.FriendNPC && !x.NotInSquad)
                               .Select(x => x.DpsTargets.Sum(y => y.Sum(z => z.Damage)))
                               .Sum();
             var squadDps = reportJSON.ExtraJSON.Players
                            .Where(x => !x.FriendNPC && !x.NotInSquad)
                            .Select(x => x.DpsTargets.Sum(y => y.Sum(z => z.DPS)))
                            .Sum();
             var squadDowns = reportJSON.ExtraJSON.Players
                              .Where(x => !x.FriendNPC && !x.NotInSquad)
                              .Select(x => x.Defenses.First().DownCount)
                              .Sum();
             var squadDeaths = reportJSON.ExtraJSON.Players
                               .Where(x => !x.FriendNPC && !x.NotInSquad)
                               .Select(x => x.Defenses.First().DeadCount)
                               .Sum();
             var squadSummary = new TextTable(5, tableStyle, tableBorders);
             squadSummary.SetColumnWidthRange(0, 3, 3);
             squadSummary.SetColumnWidthRange(1, 10, 10);
             squadSummary.SetColumnWidthRange(2, 10, 10);
             squadSummary.SetColumnWidthRange(3, 8, 8);
             squadSummary.SetColumnWidthRange(4, 8, 8);
             squadSummary.AddCell("#", tableCellCenterAlign);
             squadSummary.AddCell("DMG", tableCellCenterAlign);
             squadSummary.AddCell("DPS", tableCellCenterAlign);
             squadSummary.AddCell("Downs", tableCellCenterAlign);
             squadSummary.AddCell("Deaths", tableCellCenterAlign);
             squadSummary.AddCell($"{squadPlayers}", tableCellCenterAlign);
             squadSummary.AddCell($"{squadDamage.ParseAsK()}", tableCellCenterAlign);
             squadSummary.AddCell($"{squadDps.ParseAsK()}", tableCellCenterAlign);
             squadSummary.AddCell($"{squadDowns}", tableCellCenterAlign);
             squadSummary.AddCell($"{squadDeaths}", tableCellCenterAlign);
             var squadField = new DiscordAPIJSONContentEmbedField()
             {
                 Name  = "Squad summary:",
                 Value = $"```{squadSummary.Render()}```"
             };
             // enemy summary field
             var enemyField = new DiscordAPIJSONContentEmbedField()
             {
                 Name  = "Enemy summary:",
                 Value = $"```Summary could not have been generated.\nToggle detailed WvW to enable this feature.```"
             };
             if (reportJSON.ExtraJSON.Targets.Count > 1)
             {
                 var enemyPlayers = reportJSON.ExtraJSON.Targets
                                    .Count() - 1;
                 var enemyDamage = reportJSON.ExtraJSON.Targets
                                   .Where(x => !x.IsFake)
                                   .Select(x => x.DpsAll.First().Damage)
                                   .Sum();
                 var enemyDps = reportJSON.ExtraJSON.Targets
                                .Where(x => !x.IsFake)
                                .Select(x => x.DpsAll.First().DPS)
                                .Sum();
                 var enemyDowns = reportJSON.ExtraJSON.Players
                                  .Where(x => !x.FriendNPC && !x.NotInSquad)
                                  .Select(x => x.StatsTargets.Select(y => y.First().Downed).Sum())
                                  .Sum();
                 var enemyDeaths = reportJSON.ExtraJSON.Players
                                   .Where(x => !x.FriendNPC && !x.NotInSquad)
                                   .Select(x => x.StatsTargets.Select(y => y.First().Killed).Sum())
                                   .Sum();
                 var enemySummary = new TextTable(5, tableStyle, tableBorders);
                 enemySummary.SetColumnWidthRange(0, 3, 3);
                 enemySummary.SetColumnWidthRange(1, 10, 10);
                 enemySummary.SetColumnWidthRange(2, 10, 10);
                 enemySummary.SetColumnWidthRange(3, 8, 8);
                 enemySummary.SetColumnWidthRange(4, 8, 8);
                 enemySummary.AddCell("#", tableCellCenterAlign);
                 enemySummary.AddCell("DMG", tableCellCenterAlign);
                 enemySummary.AddCell("DPS", tableCellCenterAlign);
                 enemySummary.AddCell("Downs", tableCellCenterAlign);
                 enemySummary.AddCell("Deaths", tableCellCenterAlign);
                 enemySummary.AddCell($"{enemyPlayers}", tableCellCenterAlign);
                 enemySummary.AddCell($"{enemyDamage.ParseAsK()}", tableCellCenterAlign);
                 enemySummary.AddCell($"{enemyDps.ParseAsK()}", tableCellCenterAlign);
                 enemySummary.AddCell($"{enemyDowns}", tableCellCenterAlign);
                 enemySummary.AddCell($"{enemyDeaths}", tableCellCenterAlign);
                 enemyField = new DiscordAPIJSONContentEmbedField()
                 {
                     Name  = "Enemy summary:",
                     Value = $"```{enemySummary.Render()}```"
                 };
             }
             // damage summary
             var damageStats = reportJSON.ExtraJSON.Players
                               .Where(x => !x.FriendNPC && !x.NotInSquad)
                               .Where(x => x.DpsTargets.Sum(y => y.First().Damage) > 0)
                               .OrderByDescending(x => x.DpsTargets.Sum(y => y.First().Damage))
                               .Take(10)
                               .ToList();
             var damageSummary = new TextTable(4, tableStyle, tableBorders);
             damageSummary.SetColumnWidthRange(0, 3, 3);
             damageSummary.SetColumnWidthRange(1, 25, 25);
             damageSummary.SetColumnWidthRange(2, 7, 7);
             damageSummary.SetColumnWidthRange(3, 6, 6);
             damageSummary.AddCell("#", tableCellCenterAlign);
             damageSummary.AddCell("Name");
             damageSummary.AddCell("DMG", tableCellRightAlign);
             damageSummary.AddCell("DPS", tableCellRightAlign);
             var rank = 0;
             foreach (var player in damageStats)
             {
                 rank++;
                 damageSummary.AddCell($"{rank}", tableCellCenterAlign);
                 damageSummary.AddCell($"{player.Name} ({player.ProfessionShort})");
                 damageSummary.AddCell($"{player.DpsTargets.Sum(y => y.First().Damage).ParseAsK()}", tableCellRightAlign);
                 damageSummary.AddCell($"{player.DpsTargets.Sum(y => y.First().DPS).ParseAsK()}", tableCellRightAlign);
             }
             var damageField = new DiscordAPIJSONContentEmbedField()
             {
                 Name  = "Damage summary:",
                 Value = $"```{damageSummary.Render()}```"
             };
             // cleanses summary
             var cleansesStats = reportJSON.ExtraJSON.Players
                                 .Where(x => !x.FriendNPC && !x.NotInSquad)
                                 .Where(x => x.Support.First().CondiCleanseTotal > 0)
                                 .OrderByDescending(x => x.Support.First().CondiCleanseTotal)
                                 .Take(10)
                                 .ToList();
             var cleansesSummary = new TextTable(3, tableStyle, tableBorders);
             cleansesSummary.SetColumnWidthRange(0, 3, 3);
             cleansesSummary.SetColumnWidthRange(1, 27, 27);
             cleansesSummary.SetColumnWidthRange(2, 12, 12);
             cleansesSummary.AddCell("#", tableCellCenterAlign);
             cleansesSummary.AddCell("Name");
             cleansesSummary.AddCell("Cleanses", tableCellRightAlign);
             rank = 0;
             foreach (var player in cleansesStats)
             {
                 rank++;
                 cleansesSummary.AddCell($"{rank}", tableCellCenterAlign);
                 cleansesSummary.AddCell($"{player.Name} ({player.ProfessionShort})");
                 cleansesSummary.AddCell($"{player.Support.First().CondiCleanseTotal}", tableCellRightAlign);
             }
             var cleansesField = new DiscordAPIJSONContentEmbedField()
             {
                 Name  = "Cleanses summary:",
                 Value = $"```{cleansesSummary.Render()}```"
             };
             // boon strips summary
             var boonStripsStats = reportJSON.ExtraJSON.Players
                                   .Where(x => !x.FriendNPC && !x.NotInSquad)
                                   .Where(x => x.Support.First().BoonStrips > 0)
                                   .OrderByDescending(x => x.Support.First().BoonStrips)
                                   .Take(10)
                                   .ToList();
             var boonStripsSummary = new TextTable(3, tableStyle, tableBorders);
             boonStripsSummary.SetColumnWidthRange(0, 3, 3);
             boonStripsSummary.SetColumnWidthRange(1, 27, 27);
             boonStripsSummary.SetColumnWidthRange(2, 12, 12);
             boonStripsSummary.AddCell("#", tableCellCenterAlign);
             boonStripsSummary.AddCell("Name");
             boonStripsSummary.AddCell("Strips", tableCellRightAlign);
             rank = 0;
             foreach (var player in boonStripsStats)
             {
                 rank++;
                 boonStripsSummary.AddCell($"{rank}", tableCellCenterAlign);
                 boonStripsSummary.AddCell($"{player.Name} ({player.ProfessionShort})");
                 boonStripsSummary.AddCell($"{player.Support.First().BoonStrips}", tableCellRightAlign);
             }
             var boonStripsField = new DiscordAPIJSONContentEmbedField()
             {
                 Name  = "Boon strips summary:",
                 Value = $"```{boonStripsSummary.Render()}```"
             };
             // add the fields
             discordContentEmbed.Fields = new List <DiscordAPIJSONContentEmbedField>()
             {
                 squadField,
                 enemyField,
                 damageField,
                 cleansesField,
                 boonStripsField
             };
         }
         // post to discord
         var discordContentWvW = new DiscordAPIJSONContent()
         {
             Embeds = new List <DiscordAPIJSONContentEmbed>()
             {
                 discordContentEmbed
             }
         };
         try
         {
             var jsonContentWvW = JsonConvert.SerializeObject(discordContentWvW);
             foreach (var key in allWebhooks.Keys)
             {
                 var webhook = allWebhooks[key];
                 if (!webhook.Active ||
                     (webhook.SuccessFailToggle.Equals(DiscordWebhookDataSuccessToggle.OnSuccessOnly) && !(reportJSON.Encounter.Success ?? false)) ||
                     (webhook.SuccessFailToggle.Equals(DiscordWebhookDataSuccessToggle.OnFailOnly) && (reportJSON.Encounter.Success ?? false)) ||
                     (webhook.BossesDisable.Contains(reportJSON.Encounter.BossId)) ||
                     (!webhook.Team.IsSatisfied(reportJSON.ExtraJSON)))
                 {
                     continue;
                 }
                 var uri = new Uri(webhook.URL);
                 using var content  = new StringContent(jsonContentWvW, Encoding.UTF8, "application/json");
                 using var response = await mainLink.HttpClientController.PostAsync(uri, content);
             }
             if (allWebhooks.Count > 0)
             {
                 mainLink.AddToText(">:> All active webhooks successfully executed.");
             }
         }
         catch
         {
             mainLink.AddToText(">:> Unable to execute active webhooks.");
         }
     }
     else // not WvW
     {
         var bossName      = $"{reportJSON.Encounter.Boss}{(reportJSON.ChallengeMode ? " CM" : string.Empty)}";
         var successString = (reportJSON.Encounter.Success ?? false) ? ":white_check_mark:" : "❌";
         var extraJSON     = (reportJSON.ExtraJSON is null) ? string.Empty : $"Recorded by: {reportJSON.ExtraJSON.RecordedBy}\nDuration: {reportJSON.ExtraJSON.Duration}\nElite Insights version: {reportJSON.ExtraJSON.EliteInsightsVersion}\n";
         var icon          = string.Empty;
         var bossData      = Bosses.GetBossDataFromId(reportJSON.Encounter.BossId);
         if (!(bossData is null))
         {
             bossName = $"{bossData.Name}{(reportJSON.ChallengeMode ? " CM" : string.Empty)}";
             icon     = bossData.Icon;
         }
         var colour = (reportJSON.Encounter.Success ?? false) ? 32768 : 16711680;
         var discordContentEmbedThumbnail = new DiscordAPIJSONContentEmbedThumbnail()
         {
             Url = icon
         };
         var timestampDateTime = DateTime.UtcNow;
         if (!(reportJSON.ExtraJSON is null))
         {
             timestampDateTime = reportJSON.ExtraJSON.TimeStart;
         }
         var timestamp           = timestampDateTime.ToString("o");
         var discordContentEmbed = new DiscordAPIJSONContentEmbed()
         {
             Title       = bossName,
             Url         = reportJSON.Permalink,
             Description = $"{extraJSON}Result: {successString}\narcdps version: {reportJSON.EVTC.Type}{reportJSON.EVTC.Version}",
             Colour      = colour,
             TimeStamp   = timestamp,
             Thumbnail   = discordContentEmbedThumbnail
         };
         var discordContentWithoutPlayers = new DiscordAPIJSONContent()
         {
             Embeds = new List <DiscordAPIJSONContentEmbed>()
             {
                 discordContentEmbed
             }
         };
         var discordContentEmbedForPlayers = new DiscordAPIJSONContentEmbed()
         {
             Title       = bossName,
             Url         = reportJSON.Permalink,
             Description = $"{extraJSON}Result: {successString}\narcdps version: {reportJSON.EVTC.Type}{reportJSON.EVTC.Version}",
             Colour      = colour,
             TimeStamp   = timestamp,
             Thumbnail   = discordContentEmbedThumbnail
         };
         if (reportJSON.Players.Values.Count <= 10)
         {
             var fields = new List <DiscordAPIJSONContentEmbedField>();
             if (reportJSON.ExtraJSON is null)
             {
                 foreach (var player in reportJSON.Players.Values)
                 {
                     fields.Add(new DiscordAPIJSONContentEmbedField()
                     {
                         Name = player.CharacterName, Value = $"```\n{player.DisplayName}\n\n{Players.ResolveSpecName(player.Profession, player.EliteSpec)}\n```", Inline = true
                     });
                 }
             }
             else
             {
                 // player list
                 var playerNames = new TextTable(2, tableStyle, tableBorders);
                 playerNames.SetColumnWidthRange(0, 21, 21);
                 playerNames.SetColumnWidthRange(1, 20, 20);
                 playerNames.AddCell("Character");
                 playerNames.AddCell("Account name");
                 foreach (var player in reportJSON.ExtraJSON.Players.Where(x => !x.FriendNPC).OrderBy(x => x.Name))
                 {
                     playerNames.AddCell($"{player.Name}");
                     playerNames.AddCell($"{player.Account}");
                 }
                 fields.Add(new DiscordAPIJSONContentEmbedField()
                 {
                     Name  = "Players in squad/group:",
                     Value = $"```{playerNames.Render()}```"
                 });
                 var numberOfRealTargers = reportJSON.ExtraJSON.Targets
                                           .Where(x => !x.IsFake)
                                           .Count();
                 // damage summary
                 var damageStats = reportJSON.ExtraJSON.Players
                                   .Where(x => !x.FriendNPC)
                                   .Select(x => new
                 {
                     Player = x,
                     DPS    = numberOfRealTargers > 0 ? reportJSON.ExtraJSON.PlayerTargetDPS[x] : x.DpsAll.First().DPS
                 })
                                   .OrderByDescending(x => x.DPS)
                                   .Take(10)
                                   .ToList();
                 var dpsTargetSummary = new TextTable(3, tableStyle, TableVisibleBorders.HEADER_AND_FOOTER);
                 dpsTargetSummary.SetColumnWidthRange(0, 5, 5);
                 dpsTargetSummary.SetColumnWidthRange(1, 27, 27);
                 dpsTargetSummary.SetColumnWidthRange(2, 8, 8);
                 dpsTargetSummary.AddCell("#", tableCellCenterAlign);
                 dpsTargetSummary.AddCell("Name");
                 dpsTargetSummary.AddCell("DPS", tableCellRightAlign);
                 var rank = 0;
                 foreach (var player in damageStats)
                 {
                     rank++;
                     dpsTargetSummary.AddCell($"{rank}", tableCellCenterAlign);
                     dpsTargetSummary.AddCell($"{player.Player.Name} ({player.Player.ProfessionShort})");
                     dpsTargetSummary.AddCell($"{player.DPS.ParseAsK()}", tableCellRightAlign);
                 }
                 dpsTargetSummary.AddCell(string.Empty);
                 dpsTargetSummary.AddCell("Total");
                 var totalDPS = damageStats
                                .Select(x => x.DPS)
                                .Sum();
                 dpsTargetSummary.AddCell($"{totalDPS.ParseAsK()}", tableCellRightAlign);
                 fields.Add(new DiscordAPIJSONContentEmbedField()
                 {
                     Name  = "DPS target summary:",
                     Value = $"```{dpsTargetSummary.Render()}```"
                 });
             }
             discordContentEmbedForPlayers.Fields = fields;
         }
         var discordContentWithPlayers = new DiscordAPIJSONContent()
         {
             Embeds = new List <DiscordAPIJSONContentEmbed>()
             {
                 discordContentEmbedForPlayers
             }
         };
         try
         {
             var jsonContentWithoutPlayers = JsonConvert.SerializeObject(discordContentWithoutPlayers);
             var jsonContentWithPlayers    = JsonConvert.SerializeObject(discordContentWithPlayers);
             foreach (var key in allWebhooks.Keys)
             {
                 var webhook = allWebhooks[key];
                 if (!webhook.Active ||
                     (webhook.SuccessFailToggle.Equals(DiscordWebhookDataSuccessToggle.OnSuccessOnly) && !(reportJSON.Encounter.Success ?? false)) ||
                     (webhook.SuccessFailToggle.Equals(DiscordWebhookDataSuccessToggle.OnFailOnly) && (reportJSON.Encounter.Success ?? false)) ||
                     (webhook.BossesDisable.Contains(reportJSON.Encounter.BossId)) ||
                     (!webhook.Team.IsSatisfied(reportJSON.ExtraJSON)))
                 {
                     continue;
                 }
                 var uri = new Uri(webhook.URL);
                 if (webhook.ShowPlayers)
                 {
                     using var content = new StringContent(jsonContentWithPlayers, Encoding.UTF8, "application/json");
                     using (await mainLink.HttpClientController.PostAsync(uri, content)) { }
                 }
                 else
                 {
                     using var content = new StringContent(jsonContentWithoutPlayers, Encoding.UTF8, "application/json");
                     using (await mainLink.HttpClientController.PostAsync(uri, content)) { }
                 }
             }
             if (allWebhooks.Count > 0)
             {
                 mainLink.AddToText(">:> All active webhooks successfully executed.");
             }
         }
         catch
         {
             mainLink.AddToText(">:> Unable to execute active webhooks.");
         }
     }
 }