fix banking db calls, add permission check for settings command

This commit is contained in:
SowinskiBraeden committed 2022-08-21 12:21:31 -07:00
1 parent 380dff6dea
commit a3e69dcca4
8 files changed
+79 -51

No files matched your search

+2 -2
View File
@@ -74,7 +74,7 @@ module.exports = {
}
}
let banking = await client.dbo.collection("banking").findOne({"account.userID": interaction.member.user.id}).then(banking => banking);
let banking = await client.dbo.collection("banks").findOne({"account.userID": interaction.member.user.id}).then(banking => banking);
if (!banking) {
banking = {
@@ -127,7 +127,7 @@ module.exports = {
earned = workPays[highestPayIndex]
newBalance = banking.guilds[guildDB.serverID].account.balance + earned
client.dbo.collection("banking").updateOne({"account.userID":interaction.member.user.id},{$set:{[`banking.guilds.${guildDB.serverID}.account.balance`]:newBalance}}, function(err, res) {
client.dbo.collection("banks").updateOne({"account.userID":interaction.member.user.id},{$set:{[`banking.guilds.${guildDB.serverID}.account.balance`]:newBalance}}, function(err, res) {
if (err) {
client.log(err);
const embed = new MessageEmbed()