From 0be5b059da59fa495615c3d4fe5f654b0dc76e5c Mon Sep 17 00:00:00 2001 From: Logan Cusano Date: Sat, 17 Aug 2024 17:35:20 -0400 Subject: [PATCH] #19 fix guild specific configs - Fixed the guild key - forced guild ID to be a number --- modules/mongo-wrappers/mongoConfigWrappers.mjs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/mongo-wrappers/mongoConfigWrappers.mjs b/modules/mongo-wrappers/mongoConfigWrappers.mjs index 16e348e..cea0bb4 100644 --- a/modules/mongo-wrappers/mongoConfigWrappers.mjs +++ b/modules/mongo-wrappers/mongoConfigWrappers.mjs @@ -60,7 +60,7 @@ export const getGuildConfig = async (guildId, key) => { try { const config = await getDocumentByFields( collectionName, - ["guildId", guildId], + ["guild", Number(guildId)], ["key", key], ); log.DEBUG( @@ -82,7 +82,7 @@ export const setGuildConfig = async (guildId, key, value) => { const result = await upsertDocumentByFields( collectionName, value, - ["guildId", guildId], + ["guild", Number(guildId)], ["key", key], ); log.DEBUG(`Guild ${guildId} configuration for key "${key}" set:`, value); @@ -98,7 +98,7 @@ export const deleteGuildConfig = async (guildId, key) => { try { const result = await deleteDocumentByFields( collectionName, - ["guildId", guildId], + ["guild", Number(guildId)], ["key", key], ); log.DEBUG(