From 50b5a8fbeedce4bf5e5e776e9d0a414c626619d1 Mon Sep 17 00:00:00 2001 From: Ske Date: Wed, 24 Jun 2020 17:50:12 +0200 Subject: [PATCH] Fix changing autoproxy settings with no system_guild row --- PluralKit.Bot/Commands/Autoproxy.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PluralKit.Bot/Commands/Autoproxy.cs b/PluralKit.Bot/Commands/Autoproxy.cs index e1c20471..10e6fae4 100644 --- a/PluralKit.Bot/Commands/Autoproxy.cs +++ b/PluralKit.Bot/Commands/Autoproxy.cs @@ -126,7 +126,7 @@ namespace PluralKit.Bot private Task UpdateAutoproxy(Context ctx, AutoproxyMode autoproxyMode, MemberId? autoproxyMember) => _db.Execute(c => c.ExecuteAsync( - "update system_guild set autoproxy_mode = @autoproxyMode, autoproxy_member = @autoproxyMember where guild = @guild and system = @system", + "insert into system_guild (system, guild, autoproxy_mode, autoproxy_member) values (@system, @guild, @autoproxyMode, @autoproxyMember) on conflict (system, guild) do update set autoproxy_mode = @autoproxyMode, autoproxy_member = @autoproxyMember", new {autoproxyMode, autoproxyMember, guild = ctx.Guild.Id, system = ctx.System.Id})); } } \ No newline at end of file