diff --git a/commands/admin.js b/commands/admin.js index cb481d7..1635dfa 100644 --- a/commands/admin.js +++ b/commands/admin.js @@ -168,7 +168,7 @@ module.exports = { $set: { "server.playerstats": [] } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); } @@ -232,7 +232,7 @@ module.exports = { $set: { "server.playerstats": [] } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); } @@ -333,7 +333,7 @@ module.exports = { $set: { 'server.playerstats': GuildDB.playerstats, } - }, function(err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -396,7 +396,7 @@ module.exports = { ? banking.guilds[GuildDB.serverID].balance + args[0].options[0].value : banking.guilds[GuildDB.serverID].balance - args[0].options[0].value; - client.dbo.collection("users").updateOne({"user.userID":targetUserID},{$set:{[`user.guilds.${GuildDB.serverID}.balance`]:newBalance}}, function(err, res) { + client.dbo.collection("users").updateOne({"user.userID":targetUserID},{$set:{[`user.guilds.${GuildDB.serverID}.balance`]:newBalance}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); diff --git a/commands/alarm.js b/commands/alarm.js index adece0c..86953a2 100644 --- a/commands/alarm.js +++ b/commands/alarm.js @@ -220,7 +220,7 @@ module.exports = { $push: { 'server.alarms': alarm, } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -406,7 +406,7 @@ module.exports = { $pull: { 'server.alarms': alarm, } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -452,7 +452,7 @@ module.exports = { $set: { 'server.alarms': GuildDB.alarms, } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -484,7 +484,7 @@ module.exports = { $set: { 'server.alarms': GuildDB.alarms, } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -536,7 +536,7 @@ module.exports = { $set: { 'server.alarms': GuildDB.alarms, } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -566,7 +566,7 @@ module.exports = { $set: { 'server.alarms': GuildDB.alarms, } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -597,7 +597,7 @@ module.exports = { $set: { 'server.alarms': GuildDB.alarms, } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -628,7 +628,7 @@ module.exports = { $set: { 'server.alarms': GuildDB.alarms, } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); diff --git a/commands/bank.js b/commands/bank.js index f1e9768..81a109a 100644 --- a/commands/bank.js +++ b/commands/bank.js @@ -155,7 +155,7 @@ module.exports = { const newBalance = banking.guilds[GuildDB.serverID].balance - args[0].options[1].value; - client.dbo.collection("users").updateOne({"user.userID":interaction.member.user.id},{$set:{[`user.guilds.${GuildDB.serverID}.balance`]:newBalance}}, function(err, res) { + client.dbo.collection("users").updateOne({"user.userID":interaction.member.user.id},{$set:{[`user.guilds.${GuildDB.serverID}.balance`]:newBalance}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -181,7 +181,7 @@ module.exports = { const newTargetBalance = targetUserBanking.guilds[GuildDB.serverID].balance + args[0].options[1].value; - client.dbo.collection("users").updateOne({"user.userID":targetUserID},{$set:{[`user.guilds.${GuildDB.serverID}.balance`]:newTargetBalance}}, function(err, res) { + client.dbo.collection("users").updateOne({"user.userID":targetUserID},{$set:{[`user.guilds.${GuildDB.serverID}.balance`]:newTargetBalance}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); diff --git a/commands/bounty.js b/commands/bounty.js index aeef3a9..5ecef08 100644 --- a/commands/bounty.js +++ b/commands/bounty.js @@ -104,7 +104,7 @@ module.exports = { $set: { [`user.guilds.${GuildDB.serverID}.balance`]: newBalance, } - }, function(err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -121,7 +121,7 @@ module.exports = { $set: { 'server.playerstats': GuildDB.playerstats, } - }, function(err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -162,7 +162,7 @@ module.exports = { const newBalance = banking.guilds[GuildDB.serverID].balance - (totalBounty * 2); - client.dbo.collection("users").updateOne({"user.userID":interaction.member.user.id},{$set:{[`user.guilds.${GuildDB.serverID}.balance`]:newBalance}}, function(err, res) { + client.dbo.collection("users").updateOne({"user.userID":interaction.member.user.id},{$set:{[`user.guilds.${GuildDB.serverID}.balance`]:newBalance}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -173,7 +173,7 @@ module.exports = { $set: { 'server.playerstats': GuildDB.playerstats, } - }, function(err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); diff --git a/commands/claim.js b/commands/claim.js index af74b4b..5344b68 100644 --- a/commands/claim.js +++ b/commands/claim.js @@ -129,12 +129,12 @@ module.exports = { for (const [fid, data] of Object.entries(GuildDB.factionArmbands)) { if (fid == factionID) removeQuery = data.armband; } - client.dbo.collection("guilds").updateOne({'server.serverID': GuildDB.serverID}, {$pull: {'server.usedArmbands': removeQuery}}, function (err, res) { + client.dbo.collection("guilds").updateOne({'server.serverID': GuildDB.serverID}, {$pull: {'server.usedArmbands': removeQuery}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }) } - client.dbo.collection("guilds").updateOne({'server.serverID': GuildDB.serverID}, query, function (err, res) { + client.dbo.collection("guilds").updateOne({'server.serverID': GuildDB.serverID}, query, (err, res) => { if (err) return client.sendInternalError(interaction, err); }) diff --git a/commands/collect-income.js b/commands/collect-income.js index 41389af..f214f62 100644 --- a/commands/collect-income.js +++ b/commands/collect-income.js @@ -89,7 +89,7 @@ module.exports = { newData.balance += totalIncome; newData.lastIncome = now; - client.dbo.collection("users").updateOne({"user.userID":interaction.member.user.id},{$set:{[`user.guilds.${GuildDB.serverID}`]: newData}}, function(err, res) { + client.dbo.collection("users").updateOne({"user.userID":interaction.member.user.id},{$set:{[`user.guilds.${GuildDB.serverID}`]: newData}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); diff --git a/commands/config.js b/commands/config.js index 127e8a1..b9cc932 100644 --- a/commands/config.js +++ b/commands/config.js @@ -349,7 +349,7 @@ module.exports = { if (channelAdd.type=="voice") {error=true;newChannelErrorEmbed.setDescription(`**Error Notice:** Cannot add voice channel to allowed channels.`);} if (error) return interaction.send({ embeds: [newChannelErrorEmbed] }); - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$push:{"server.allowedChannels": channelid}}, function (err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$push:{"server.allowedChannels": channelid}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -390,7 +390,7 @@ module.exports = { if (args[0].options[0].value == 'add') { const botAdminRoleId = args[0].options[1].value; - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$push: {"server.botAdminRoles": botAdminRoleId}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$push: {"server.botAdminRoles": botAdminRoleId}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -430,7 +430,7 @@ module.exports = { } case 'admin_role': - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.adminRole": args[0].options[0].value}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.adminRole": args[0].options[0].value}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -442,7 +442,7 @@ module.exports = { case 'exclude': if (args[0].options[0].value == 'add') { - client.dbo.collection('guilds').updateOne({'server.serverID': GuildDB.serverID}, {$push: {'server.excludedRoles': args[0].options[1].value}}, function(err, res) { + client.dbo.collection('guilds').updateOne({'server.serverID': GuildDB.serverID}, {$push: {'server.excludedRoles': args[0].options[1].value}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }) @@ -453,7 +453,7 @@ module.exports = { return interaction.send({ embeds: [successExcludeEmbed] }); } else if (args[0].options[0].value == 'remove') { - client.dbo.collection('guilds').updateOne({'server.serverID': GuildDB.serverID}, {$pull: {'server.excludedRoles': args[0].options[1].value}}, function(err, res) { + client.dbo.collection('guilds').updateOne({'server.serverID': GuildDB.serverID}, {$pull: {'server.excludedRoles': args[0].options[1].value}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }) @@ -510,7 +510,7 @@ module.exports = { case 'killfeed_channel': const killfeedChannel = args[0].options[0].value; - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.killfeedChannel": killfeedChannel}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.killfeedChannel": killfeedChannel}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -523,7 +523,7 @@ module.exports = { case 'show_killfeed_coords': const showKillfeedCoordsConfiguration = args[0].options[0].value; - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.showKillfeedCoords": showKillfeedCoordsConfiguration}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.showKillfeedCoords": showKillfeedCoordsConfiguration}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -536,7 +536,7 @@ module.exports = { case 'admin_logs_channel': const adminLogsChannel = args[0].options[0].value; - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.connectionLogsChannel": adminLogsChannel}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.connectionLogsChannel": adminLogsChannel}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -549,7 +549,7 @@ module.exports = { case 'welcome_channel': const welcomeChannel = args[0].options[0].value; - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.welcomeChannel": welcomeChannel}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.welcomeChannel": welcomeChannel}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -562,7 +562,7 @@ module.exports = { case 'active_players_channel': const acticePlayersChannel = args[0].options[0].value; - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.activePlayersChannel": acticePlayersChannel}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.activePlayersChannel": acticePlayersChannel}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -575,7 +575,7 @@ module.exports = { case 'linked_gt_role': const linked_gt_role = args[0].options[0].value; - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.linkedGamertagRole": linked_gt_role}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.linkedGamertagRole": linked_gt_role}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -588,7 +588,7 @@ module.exports = { case 'member_role': const member_role = args[0].options[0].value; - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.memberRole": member_role}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID},{$set: {"server.memberRole": member_role}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -599,7 +599,7 @@ module.exports = { return interaction.send({ embeds: [successMemberRoleEmbed] }); case 'starting_balance': - client.dbo.collection("guilds").updateOne({"server.serverID": GuildDB.serverID}, {$set: {"server.startingBalance":args[0].options[0].value}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID": GuildDB.serverID}, {$set: {"server.startingBalance":args[0].options[0].value}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -628,7 +628,7 @@ module.exports = { income: args[0].options[0].options[1].value, } - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$push: {"server.incomeRoles":newIncome}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$push: {"server.incomeRoles":newIncome}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); } else { @@ -640,7 +640,7 @@ module.exports = { $set: { "server.incomeRoles.$.income": args[0].options[0].options[1].value } - }, function(err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); } @@ -682,7 +682,7 @@ module.exports = { } case 'income_limiter': - client.dbo.collection("guilds").updateOne({"server.serverID": GuildDB.serverID}, {$set: {"server.incomeLimiter":args[0].options[0].value}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID": GuildDB.serverID}, {$set: {"server.incomeLimiter":args[0].options[0].value}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -693,7 +693,7 @@ module.exports = { return interaction.send({ embeds: [successIncomeLimiterEmbed] }); case 'uav-price': - client.dbo.collection("guilds").updateOne({"server.serverID": GuildDB.serverID}, {$set: {"server.uavPrice":args[0].options[0].value}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID": GuildDB.serverID}, {$set: {"server.uavPrice":args[0].options[0].value}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -704,7 +704,7 @@ module.exports = { return interaction.send({ embeds: [successUAVPriceEmbed] }); case 'emp-price': - client.dbo.collection("guilds").updateOne({"server.serverID": GuildDB.serverID}, {$set: {"server.empPrice":args[0].options[0].value}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID": GuildDB.serverID}, {$set: {"server.empPrice":args[0].options[0].value}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -733,7 +733,7 @@ module.exports = { let action = '' if (interaction.customId.split('-')[1]=='yes') { action = 'removed'; - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$pull:{"server.allowedChannels": channelid}}, function (err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$pull:{"server.allowedChannels": channelid}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); } else if (interaction.customId.split('-')[1]=='no') action = 'kept'; @@ -758,7 +758,7 @@ module.exports = { let roleId = interaction.customId.split('-')[2]; if (interaction.customId.split('-')[1]=='yes') { action = 'removed'; - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$pull: {"server.botAdminRoles": roleId}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$pull: {"server.botAdminRoles": roleId}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); } else if (interaction.customId.split('-')[1]=='no') action = 'kept'; @@ -784,7 +784,7 @@ module.exports = { if (interaction.customId.split('-')[1]=='yes') { action = 'removed'; let income = GuildDB.incemeRoles.find((i) => i.role == roleId); - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$pull: {"server.incomeRoles": income}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$pull: {"server.incomeRoles": income}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); } else if (interaction.customId.split('-')[1]=='no') action = 'kept'; @@ -809,7 +809,7 @@ module.exports = { if (interaction.customId.split('-')[1]=='yes') { action = 'reset'; const defaultGuildConfig = client.getDefaultSettings(GuildDB.serverID); - client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server": defaultGuildConfig}}, function(err, res) { + client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server": defaultGuildConfig}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); } else if (interaction.customId.split('-')[1]=='no') action = 'kept'; diff --git a/commands/event.js b/commands/event.js index eecaf9f..690c415 100644 --- a/commands/event.js +++ b/commands/event.js @@ -93,7 +93,7 @@ module.exports = { $set: { "server.events": events } - }, function(err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -138,7 +138,7 @@ module.exports = { $pull: { 'server.events': event, } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); diff --git a/commands/gamertag-link.js b/commands/gamertag-link.js index 09ef079..45fb86d 100644 --- a/commands/gamertag-link.js +++ b/commands/gamertag-link.js @@ -33,7 +33,7 @@ module.exports = { $set: { "server.playerstats": [] } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); } diff --git a/commands/gamertag-unlink.js b/commands/gamertag-unlink.js index 28d9c63..2780d17 100644 --- a/commands/gamertag-unlink.js +++ b/commands/gamertag-unlink.js @@ -26,7 +26,7 @@ module.exports = { $set: { "server.playerstats": [] } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); } diff --git a/commands/location.js b/commands/location.js index 10cc204..bc93642 100644 --- a/commands/location.js +++ b/commands/location.js @@ -27,7 +27,7 @@ module.exports = { $set: { "server.playerstats": [] } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); } diff --git a/commands/lookup.js b/commands/lookup.js index 34df0e3..4d3a319 100644 --- a/commands/lookup.js +++ b/commands/lookup.js @@ -51,7 +51,7 @@ module.exports = { $set: { "server.playerstats": [] } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); } diff --git a/commands/purchase-emp.js b/commands/purchase-emp.js index 45b2b6f..f363096 100644 --- a/commands/purchase-emp.js +++ b/commands/purchase-emp.js @@ -63,7 +63,7 @@ module.exports = { if (GuildDB.alarms.length == 0) return interaction.send({ embeds: [new EmbedBuilder().setColor(client.config.Colors.Default).setDescription('**Notice:** No Existing Alarms to EMP.')], flags: (1 << 6) }); - client.dbo.collection("users").updateOne({"user.userID":interaction.member.user.id},{$set:{[`user.guilds.${GuildDB.serverID}.balance`]:newBalance}}, function(err, res) { + client.dbo.collection("users").updateOne({"user.userID":interaction.member.user.id},{$set:{[`user.guilds.${GuildDB.serverID}.balance`]:newBalance}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -102,7 +102,7 @@ module.exports = { $set: { 'server.alarms': alarms, } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); diff --git a/commands/purchase-uav.js b/commands/purchase-uav.js index 3e3d843..6f26523 100644 --- a/commands/purchase-uav.js +++ b/commands/purchase-uav.js @@ -78,7 +78,7 @@ module.exports = { const newBalance = banking.guilds[GuildDB.serverID].balance - GuildDB.uavPrice; - client.dbo.collection("users").updateOne({"user.userID":interaction.member.user.id},{$set:{[`user.guilds.${GuildDB.serverID}.balance`]:newBalance}}, function(err, res) { + client.dbo.collection("users").updateOne({"user.userID":interaction.member.user.id},{$set:{[`user.guilds.${GuildDB.serverID}.balance`]:newBalance}}, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); @@ -93,7 +93,7 @@ module.exports = { $push: { 'server.uavs': uav, } - }, function (err, res) { + }, (err, res) => { if (err) return client.sendInternalError(interaction, err); }); diff --git a/package.json b/package.json index 807c61e..21e5e90 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dayzr-bot", - "version": "9.6.0", + "version": "9.6.1", "description": "A General Purpose Discord Bot for DayZ Nitrado Servers.", "main": "index.js", "nodemonConfig": { diff --git a/structures/DayzRBot.js b/structures/DayzRBot.js index fe3b40e..5b67e95 100644 --- a/structures/DayzRBot.js +++ b/structures/DayzRBot.js @@ -56,7 +56,7 @@ class DayzRBot extends Client { $pull: { 'server.usedArmbands': data.armband }, $unset: { [`server.factionArmbands.${factionID}`]: "" }, }; - await this.dbo.collection("guilds").updateOne({'server.serverID': GuildDB.serverID}, query, function (err, res) { + await this.dbo.collection("guilds").updateOne({'server.serverID': GuildDB.serverID}, query, (err, res) => { if (err) return this.sendInternalError(interaction, err); }); } @@ -185,7 +185,7 @@ class DayzRBot extends Client { $set: { "server.playerstats": s } - }, function (err, res) { + }, (err, res) => { if (err) this.sendError(this.GetChannel(guild.adminLogsChannel), err); }); @@ -409,7 +409,7 @@ class DayzRBot extends Client { guild = {} guild.server = this.getDefaultSettings(GuildId); if (this.databaseConnected) { - this.dbo.collection("guilds").insertOne(guild, function(err, res) { + this.dbo.collection("guilds").insertOne(guild, (err, res) => { if (err) throw err; }); } diff --git a/structures/user.js b/structures/user.js index b55cd50..0e51b54 100644 --- a/structures/user.js +++ b/structures/user.js @@ -29,7 +29,7 @@ function addUser(guilds, guildID, userID, client, startingBalance) { lastIncome: new Date('2000-01-01T00:00:00') } - client.dbo.collection("users").updateOne({"user.userID":userID}, {$set: {"user.guilds": updatedGuilds}}, function(err, res) { + client.dbo.collection("users").updateOne({"user.userID":userID}, {$set: {"user.guilds": updatedGuilds}}, (err, res) => { if (err) return false }) return true diff --git a/util/AlarmsHandler.js b/util/AlarmsHandler.js index 9671f62..71fde19 100644 --- a/util/AlarmsHandler.js +++ b/util/AlarmsHandler.js @@ -12,7 +12,7 @@ const ExpireEvent = async(client, guild, e) => { $pull: { "server.events": e } - }, function(err, res) { + }, (err, res) => { if (err) return client.sendError(client.GetChannel(guild.adminLogsChannel), err); }); } @@ -128,7 +128,7 @@ module.exports = { } if (update) { - client.dbo.collection("guilds").updateOne({ "server.serverID": guildId }, {$set: { "server.uavs": uavs }}, function (err, res) { + client.dbo.collection("guilds").updateOne({ "server.serverID": guildId }, {$set: { "server.uavs": uavs }}, (err, res) => { if (err) return client.sendError(client.GetChannel(guild.adminLogsChannel), err); }); } diff --git a/util/KillfeedHandler.js b/util/KillfeedHandler.js index fa5f84f..8c5daed 100644 --- a/util/KillfeedHandler.js +++ b/util/KillfeedHandler.js @@ -152,7 +152,7 @@ module.exports = { $set: { [`user.guilds.${guildId}.balance`]: newBalance, } - }, function(err, res) { + }, (err, res) => { if (err) return client.sendError(client.GetChannel(guild.killfeedChannel), `Killfeed Error: Updating killer bank balance\n${err}`); });