diff --git a/.vscode/launch.json b/.vscode/launch.json index 23c8edb..42ff7f8 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,8 +10,8 @@ "request": "launch", "preLaunchTask": "build", // If you have changed target frameworks, make sure to update the program path. - "program": "${workspaceFolder}/bin/Debug/net6.0/BirthdayBot.dll", - "args": [ "-c", "${workspaceFolder}/bin/Debug/net6.0/settings.json" ], + "program": "${workspaceFolder}/bin/Debug/net8.0/BirthdayBot.dll", + "args": [ "-c", "${workspaceFolder}/bin/Debug/settings.json" ], "cwd": "${workspaceFolder}", // For more information about the 'console' field, see https://aka.ms/VSCode-CS-LaunchJson-Console "console": "internalConsole", diff --git a/ApplicationCommands/ConfigModule.cs b/ApplicationCommands/ConfigModule.cs index 91928d1..81c55a1 100644 --- a/ApplicationCommands/ConfigModule.cs +++ b/ApplicationCommands/ConfigModule.cs @@ -141,7 +141,7 @@ public class ConfigModule : BotModuleBase { var result = new StringBuilder(); result.AppendLine($"Server ID: `{guild.Id}` | Bot shard ID: `{Shard.ShardId:00}`"); - result.AppendLine($"Number of registered birthdays: `{guildconf.UserEntries.Count}`"); + result.AppendLine($"Number of registered birthdays: `{guildconf.UserEntries?.Count ?? 0}`"); result.AppendLine($"Server time zone: `{guildconf.GuildTimeZone ?? "Not set - using UTC"}`"); result.AppendLine(); @@ -152,7 +152,8 @@ public class ConfigModule : BotModuleBase { result.Append(DoTestFor("Birthday processing", delegate { if (!hasMembers) return false; if (guildconf.IsNew) return false; - bdayCount = BackgroundServices.BirthdayRoleUpdate.GetGuildCurrentBirthdays(guildconf.UserEntries, guildconf.GuildTimeZone).Count; + bdayCount = BackgroundServices.BirthdayRoleUpdate + .GetGuildCurrentBirthdays(guildconf.UserEntries!, guildconf.GuildTimeZone).Count; return true; })); if (!hasMembers) result.AppendLine(" - Previous step failed.");