diff --git a/Commands/InterviewTemplateCommands.cs b/Commands/InterviewTemplateCommands.cs index 9a21210..e628dfd 100644 --- a/Commands/InterviewTemplateCommands.cs +++ b/Commands/InterviewTemplateCommands.cs @@ -38,7 +38,7 @@ public class InterviewTemplateCommands return; } - if (!Database.TryGetCategory(category.Id, out Database.Category categoryData)) + if (!Database.TryGetCategory(category.Id, out Database.Category _)) { await command.RespondAsync(new DiscordEmbedBuilder { @@ -99,17 +99,15 @@ public class InterviewTemplateCommands return; } + Stream stream = await new HttpClient().GetStreamAsync(file.Url); try { - List errors = []; - - Stream stream = await new HttpClient().GetStreamAsync(file.Url); JSchemaValidatingReader validatingReader = new(new JsonTextReader(new StreamReader(stream))); validatingReader.Schema = JSchema.Parse(jsonSchema); // The schema seems to throw an additional error with incorrect information if an invalid parameter is included // in the template. Throw here in order to only show the first correct error to the user, also skips unnecessary validation further down. - validatingReader.ValidationEventHandler += (o, a) => throw new JsonException(a.Message); + validatingReader.ValidationEventHandler += (_, a) => throw new JsonException(a.Message); JsonSerializer serializer = new(); Template template = serializer.Deserialize