From 4a50c30c56a8bee61107aea572c3a4276c0e66cf Mon Sep 17 00:00:00 2001 From: Kwoth Date: Fri, 17 Sep 2021 17:19:11 +0200 Subject: [PATCH] Fixed .logserver - should no longer throw an exception if you had no logsettings previously --- CHANGELOG.md | 7 ++++++- src/NadekoBot/Db/Extensions/GuildConfigExtensions.cs | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2fd5cd6b7..c56b587b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog.com/en/1.0.0/) except date format. a-c-f-r-o +## Unreleased + +### Fixed +- Fixed images not automatically reloading on startup if the keys don't exist +- Fixed `.logserver` - it should no longer throw an exception if you had no logsettings previously + ## [3.0.4] - 16.09.2021 ### Added @@ -17,7 +23,6 @@ Experimental changelog. Mostly based on [keepachangelog](https://keepachangelog. - Timer should no longer increase on some repeaters - Repeaters should no longer have periods when they're missing from the list - Fixed several commands which used error color for success confirmation messages -- Fixed images not automatically reloading on startup if the keys don't exist ## [3.0.3] - 15.09.2021 diff --git a/src/NadekoBot/Db/Extensions/GuildConfigExtensions.cs b/src/NadekoBot/Db/Extensions/GuildConfigExtensions.cs index 3ad081ca0..a92b82709 100644 --- a/src/NadekoBot/Db/Extensions/GuildConfigExtensions.cs +++ b/src/NadekoBot/Db/Extensions/GuildConfigExtensions.cs @@ -120,6 +120,15 @@ namespace NadekoBot.Db .Include(x => x.IgnoredChannels) .Where(x => x.GuildId == guildId) .FirstOrDefault(); + + if (logSetting is null) + { + ctx.LogSettings.Add(logSetting = new () + { + GuildId = guildId + }); + ctx.SaveChanges(); + } return logSetting; }