fix/bounties length
This commit is contained in:
3 files changed
+4
-4
No files matched your search
+2
-3
@@ -104,7 +104,7 @@ module.exports = {
|
|||||||
setBy: (anonymous && !anonymous.value) ? interaction.member.user.id : null,
|
setBy: (anonymous && !anonymous.value) ? interaction.member.user.id : null,
|
||||||
value: args[0].options[1].value,
|
value: args[0].options[1].value,
|
||||||
});
|
});
|
||||||
playerStat.bountiesLength++;
|
playerStat.bountiesLength = playerStat.bounties.length; // Will ensure bounties length = # of bounties, even if bountiesLength does not exists in player stat.
|
||||||
|
|
||||||
await UpdatePlayer(client, playerStat, interaction);
|
await UpdatePlayer(client, playerStat, interaction);
|
||||||
|
|
||||||
@@ -160,10 +160,9 @@ module.exports = {
|
|||||||
|
|
||||||
} else if (args[0].name == 'view') {
|
} else if (args[0].name == 'view') {
|
||||||
|
|
||||||
// TODO: only get players with boutnies.length greater than 0
|
|
||||||
const activeBounties = await client.dbo.collection("players").find({
|
const activeBounties = await client.dbo.collection("players").find({
|
||||||
"bountiesLength": { $gt: 0 }
|
"bountiesLength": { $gt: 0 }
|
||||||
});
|
}).toArray();
|
||||||
|
|
||||||
let bountiesEmbed = new EmbedBuilder()
|
let bountiesEmbed = new EmbedBuilder()
|
||||||
.setColor(client.config.Colors.Default)
|
.setColor(client.config.Colors.Default)
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ module.exports = {
|
|||||||
|
|
||||||
// Other
|
// Other
|
||||||
bounties: [],
|
bounties: [],
|
||||||
|
bountiesLength: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dayzr-bot",
|
"name": "dayzr-bot",
|
||||||
"version": "12.3.7",
|
"version": "12.3.8",
|
||||||
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
|
"description": "A General Purpose Discord Bot for DayZ Nitrado Servers.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
|
|||||||
Reference in new issue
Block a user