#19 fix guild specific configs
- Fixed the guild key - forced guild ID to be a number
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user