From 98f50b98e895721b06a211c2a1bb1f467da8164f Mon Sep 17 00:00:00 2001 From: WhatCats Date: Tue, 17 Dec 2024 23:55:41 +0100 Subject: [PATCH] fix vouch comment update --- src/modules/council/vouches/vouch-commands.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/council/vouches/vouch-commands.ts b/src/modules/council/vouches/vouch-commands.ts index e822cfa..39b72d3 100644 --- a/src/modules/council/vouches/vouch-commands.ts +++ b/src/modules/council/vouches/vouch-commands.ts @@ -239,7 +239,7 @@ async function addVouch(interaction: ChatInputCommandInteraction, worth: number) const vouch = await Vouch.findOneAndUpdate( { givenAt: { $lte: DateTime.now().plus({ days: 7 }).toJSDate() }, ...filter }, - { ...filter, worth, comment, givenAt: new Date() }, + { ...filter, worth, givenAt: new Date(), ...(comment ? { comment } : { $unset: { comment: "" } }) }, { upsert: true, new: true }, )