feature/anonymous-bounty-option

This commit is contained in:
SowinskiBraeden committed 2023-07-26 23:15:24 -07:00
1 parent d9f20296a4
commit c0ba41493d
2 files changed
+12 -3

No files matched your search

+11 -2
View File
@@ -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",
@@ -95,8 +101,10 @@ module.exports = {
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
View File
@@ -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": {