Squashed Bugs
diff --git a/src/utils/database.ts b/src/utils/database.ts
index b42b8b2..dd768a3 100644
--- a/src/utils/database.ts
+++ b/src/utils/database.ts
@@ -698,7 +698,10 @@
async create(guild: string, user: string, note: string | null) {
// console.log("ModNotes create");
- await this.modNotes.updateOne({ guild: guild, user: user }, { $set: { note: note } }, { upsert: true });
+ const modNote = await this.modNotes.findOne({ guild: guild, user: user });
+ modNote
+ ? await this.modNotes.updateOne({ guild: guild, user: user }, { $set: { note: note } }, collectionOptions)
+ : await this.modNotes.insertOne({ guild: guild, user: user, note: note }, collectionOptions);
}
async read(guild: string, user: string) {