From 5891df846c9363d4619a585dfcf797612cdda899 Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Wed, 12 Oct 2022 19:21:20 -0700 Subject: [PATCH] 12.7.11 fix createBank --- config/config.js | 2 +- structures/bank.js | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/config/config.js b/config/config.js index 89dd382..3a4b5a1 100644 --- a/config/config.js +++ b/config/config.js @@ -2,7 +2,7 @@ require('dotenv').config(); module.exports = { Dev: "PROD.", - Version: "12.7.10", + Version: "12.7.11", Admins: ["362791661274660874", "329371697570381824"], // Admins of the bot DefaultPrefix: "?", ServerID: "955668596745461830", diff --git a/structures/bank.js b/structures/bank.js index 3c2e400..6b25061 100644 --- a/structures/bank.js +++ b/structures/bank.js @@ -8,14 +8,17 @@ let bankSchema = mongoose.Schema({ }); bankSchema.methods.createBank = function (userID, guildID, startingBalance) { - this.banking.userID = userID; - const newGuild = { - account: { - balance: startingBalance, - cash: 0.00, + this.banking = { + userID: userID, + guilds: { + [`${guildID}`]: { + account: { + balance: startingBalance, + cash: 0.00, + } + } } - }; - this.banking.guilds[guildID] = newGuild + } }; /*