diff --git a/Common/Bot/BotParser.cs b/Common/Bot/BotParser.cs index dae8fd1..4669f73 100644 --- a/Common/Bot/BotParser.cs +++ b/Common/Bot/BotParser.cs @@ -13,7 +13,7 @@ public static class BotParser { static JsonSerializerOptions serialiserOptions = new JsonSerializerOptions { }; - public static async Task> ParseAsync(string dumpPath) + public static async Task> ParseAsync(string dumpPath, string[] botTypes) { var stopwatch = Stopwatch.StartNew(); @@ -63,12 +63,18 @@ public static class BotParser Console.WriteLine($"parsing: {bots.Count} bots in file {splitFilePath.Last()}"); foreach (var bot in bots) { + if (!botTypes.Contains(bot.Info.Settings.Role.ToLower())) + { + continue; + } + if (!parsedBotsDict.ContainsKey(bot._id)) { parsedBotsDict.Add(bot._id, bot); } else { + var existingBot = parsedBotsDict[bot._id]; dupeCount++; } } diff --git a/Generator/Program.cs b/Generator/Program.cs index 861ff2b..e07bc01 100644 --- a/Generator/Program.cs +++ b/Generator/Program.cs @@ -40,7 +40,7 @@ internal static class Program // Read raw bot dumps and turn into c# objects var workingPath = Directory.GetCurrentDirectory(); var dumpPath = $"{workingPath}//dumps"; - var parsedBots = await BotParser.ParseAsync(dumpPath); + var parsedBots = await BotParser.ParseAsync(dumpPath, botTypes); if (parsedBots.Count == 0) {