feature/anonymous-bounty-option
This commit is contained in:
2 files changed
+13
-4
No files matched your search
+12
-3
@@ -28,6 +28,12 @@ module.exports = {
|
|||||||
type: 10,
|
type: 10,
|
||||||
min_value: 0.01,
|
min_value: 0.01,
|
||||||
required: true
|
required: true
|
||||||
|
}, {
|
||||||
|
name: "anonymous",
|
||||||
|
description: "Make this bounty anonymous",
|
||||||
|
value: false,
|
||||||
|
type: 5,
|
||||||
|
required: false
|
||||||
}]
|
}]
|
||||||
}, {
|
}, {
|
||||||
name: "view",
|
name: "view",
|
||||||
@@ -93,10 +99,12 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
}, function(err, res) {
|
}, function(err, res) {
|
||||||
if (err) return client.sendInternalError(interaction, err);
|
if (err) return client.sendInternalError(interaction, err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
let anonymous = args[0].options[2];
|
||||||
|
|
||||||
playerStat.bounties.push({
|
playerStat.bounties.push({
|
||||||
setBy: interaction.member.user.id,
|
setBy: (anonymous && !anonymous.value) ? interaction.member.user.id : null,
|
||||||
value: args[0].options[1].value,
|
value: args[0].options[1].value,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -115,6 +123,7 @@ module.exports = {
|
|||||||
.setDescription(`Successfully set a **$${args[0].options[1].value.toFixed(2)}** bounty on \` ${playerStat.gamertag} \`\nThis can be viewed using </bounty view:1086786904671924267>`)
|
.setDescription(`Successfully set a **$${args[0].options[1].value.toFixed(2)}** bounty on \` ${playerStat.gamertag} \`\nThis can be viewed using </bounty view:1086786904671924267>`)
|
||||||
.setColor(client.config.Colors.Green);
|
.setColor(client.config.Colors.Green);
|
||||||
|
|
||||||
|
if (anonymous && anonymous.value) return interaction.send({ embeds: [successEmbed], flags: (1 << 6) });
|
||||||
return interaction.send({ embeds: [successEmbed] });
|
return interaction.send({ embeds: [successEmbed] });
|
||||||
|
|
||||||
} else if (args[0].name == 'view') {
|
} else if (args[0].name == 'view') {
|
||||||
@@ -127,7 +136,7 @@ module.exports = {
|
|||||||
|
|
||||||
for (let i = 0; i < activeBounties.length; i++) {
|
for (let i = 0; i < activeBounties.length; i++) {
|
||||||
for (let j = 0; j < activeBounties[i].bounties.length; j++) {
|
for (let j = 0; j < activeBounties[i].bounties.length; j++) {
|
||||||
bountiesEmbed.addFields({ name: `${activeBounties[i].gamertag} has a:`, value: `**$${activeBounties[i].bounties[j].value.toFixed(2)}** bounty set by <@${activeBounties[i].bounties[j].setBy}>`, inline: false });
|
bountiesEmbed.addFields({ name: `${activeBounties[i].gamertag} has a:`, value: `**$${activeBounties[i].bounties[j].value.toFixed(2)}** bounty set by ${activeBounties[i].bounties[j].setBy == null ? 'Anonymous' : `<@${activeBounties[i].bounties[j].setBy}>`}`, inline: false });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "dayz-armbands",
|
"name": "dayz-armbands",
|
||||||
"version": "8.2.11",
|
"version": "8.3.0",
|
||||||
"description": "A General Purpose Discord Bot for DayZ Servers.",
|
"description": "A General Purpose Discord Bot for DayZ Servers.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"nodemonConfig": {
|
"nodemonConfig": {
|
||||||
|
|||||||
Reference in new issue
Block a user