7.1.0 configure emp price
This commit is contained in:
2 files changed
+27
-1
No files matched your search
@@ -233,6 +233,20 @@ module.exports = {
|
||||
required: true,
|
||||
}]
|
||||
},
|
||||
{
|
||||
name: "emp-price",
|
||||
description: "Configure the price of an EMP",
|
||||
value: "emp-price",
|
||||
type: 1,
|
||||
options: [{
|
||||
name: "amount",
|
||||
description: "The amount to set the EMP price",
|
||||
value: "amount",
|
||||
type: 10,
|
||||
min_value: 0.01,
|
||||
required: true,
|
||||
}]
|
||||
},
|
||||
{
|
||||
name: "income_role",
|
||||
description: "Add/update a role to earn income on /collect-income command",
|
||||
@@ -308,6 +322,7 @@ module.exports = {
|
||||
if (!canUseCommand) return interaction.send({ content: 'You don\'t have the permissions to use this command.' });
|
||||
|
||||
switch(args[0].name) {
|
||||
|
||||
case 'allowed_channels':
|
||||
const channelid = args[0].options[0].options[0].value;
|
||||
|
||||
@@ -662,6 +677,17 @@ module.exports = {
|
||||
|
||||
return interaction.send({ embeds: [successEmbed] });
|
||||
|
||||
case 'emp-price':
|
||||
client.dbo.collection("guilds").updateOne({"server.serverID": GuildDB.serverID}, {$set: {"server.empPrice":args[0].options[0].value}}, function(err, res) {
|
||||
if (err) return client.sendInternalError(interaction, err);
|
||||
});
|
||||
|
||||
let successEmbed = new EmbedBuilder()
|
||||
.setColor(client.config.Colors.Green)
|
||||
.setDescription(`Successfully set $${args[0].options[0].value.toFixed(2)} as EMP price`);
|
||||
|
||||
return interaction.send({ embeds: [successEmbed] });
|
||||
|
||||
default:
|
||||
return client.sendInternalError(interaction, 'There was an error parsing the config command');
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user