From 909cb9ab9c5a96512cbc963004705dae5327731e Mon Sep 17 00:00:00 2001 From: Wan <495709+wa0x6e@users.noreply.github.com> Date: Tue, 30 Apr 2024 14:11:24 +0400 Subject: [PATCH] fix: fix invalid sql query params on duplicate update (#193) --- src/providers/discord.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/providers/discord.ts b/src/providers/discord.ts index 722f341..6f0bad3 100644 --- a/src/providers/discord.ts +++ b/src/providers/discord.ts @@ -402,12 +402,12 @@ async function snapshotCommandHandler(interaction, commandType) { channelId, spaceId, mention || '', - events ? JSON.stringify(events) : '["proposal/start"]', ts, + events ? JSON.stringify(events) : '["proposal/start"]', ts ]; await db.queryAsync( - `INSERT INTO subscriptions (guild, channel, space, mention, events, created, updated) VALUES (?, ?, ?, ?, ?, ?, ?) + `INSERT INTO subscriptions (guild, channel, space, mention, updated, events, created) VALUES (?, ?, ?, ?, ?, ?, ?) ON DUPLICATE KEY UPDATE guild = ?, channel = ?, space = ?, mention = ?, updated = ?`, [...subscription, ...subscription] );