From 025bb1e7888302e555e040d4848892de545a6e53 Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Mon, 4 Sep 2023 17:26:47 -0700 Subject: [PATCH] fix/bounty set undefined banking --- commands/bounty.js | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/bounty.js b/commands/bounty.js index 5ecef08..4c4e76f 100644 --- a/commands/bounty.js +++ b/commands/bounty.js @@ -56,8 +56,9 @@ module.exports = { */ run: async (client, interaction, args, { GuildDB }) => { + let banking; if (args[0].name == 'set' || args[0].name == 'pay') { - let banking = await client.dbo.collection("users").findOne({"user.userID": interaction.member.user.id}).then(banking => banking); + banking = await client.dbo.collection("users").findOne({"user.userID": interaction.member.user.id}).then(banking => banking); if (!banking) { banking = { @@ -82,7 +83,6 @@ module.exports = { const success = addUser(banking.guilds, GuildDB.serverID, interaction.member.user.id, client, GuildDB.startingBalance); if (!success) return client.sendInternalError(interaction, 'Failed to add bank'); } - } if (args[0].name == 'set') { diff --git a/package.json b/package.json index c7997a1..f01629d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dayzr-bot", - "version": "9.6.2", + "version": "9.6.3", "description": "A General Purpose Discord Bot for DayZ Nitrado Servers.", "main": "index.js", "nodemonConfig": {