13.0.0 invoice features + configuration

This commit is contained in:
SowinskiBraeden committed 2022-10-16 19:38:09 -07:00
1 parent 43d6a7742a
commit 6f2f24da50
7 files changed
+418 -13

No files matched your search

+25
View File
@@ -352,6 +352,19 @@ module.exports = {
min_value: 1,
}]
},
{
name: "can_ignore_invoices",
description: "Allow users to ignore and delete invoices",
value: "can_ignore_invoices",
type: 1,
options: [{
name: "true_or_false",
description: "Set the value for this configurations",
value: true,
type: 5,
required: true,
}]
},
{
name: "reset",
description: "Restore all settings to default configurations",
@@ -855,6 +868,17 @@ module.exports = {
return interaction.send({ embeds: [prompt], components: [opt], flags: (1 << 6) });
} else if (args[0].name == 'can_ignore_invoices') {
client.dbo.collection("guilds").updateOne({"server.serverID":GuildDB.serverID}, {$set: {"server.canIgnoreInvoices": args[0].options[0].value}}, function(err, res) {
if (err) return client.sendInternalError(interaction, err);
});
const successEmbed = new EmbedBuilder()
.setColor(client.config.Colors.Green)
.setDescription(`**Success:** can ${args[0].options[0].value == true ? 'now' : 'no longer'} ignore and delete invoices.`);
return interaction.send({ embeds: [successEmbed] });
} else if (args[0].name == 'view') {
const tweetChannel = GuildDB.tweetChannel ? `\n╚➤ <#${GuildDB.tweetChannel}>` : '';
const tweetColor = GuildDB.tweetChannel ? '+ ' : '- ';
@@ -896,6 +920,7 @@ module.exports = {
{ name: 'Has Disptach Role?', value: `\`\`\`diff\n${dispatchRoleColor}${client.exists(GuildDB.dispatcherRole)}\`\`\`${dispatchRole}`, inline: true },
{ name: 'Has Dispatch Channel?', value: `\`\`\`diff\n${dispatchChannelColor}${client.exists(GuildDB.dispatchChannel)}\`\`\`${dispatchChannel}`, inline: true },
{ name: 'Has bot admin role?', value: `\`\`\`diff\n${botAdminRoleColor}${client.exists(GuildDB.botAdmin)}\`\`\`${botAdminRole}`, inline: true },
{ name: 'Can Ignore Invoices?', value: `\`\`\`diff\n${GuildDB.canIgnoreInvoices ? '+ ' : '- '}${GuildDB.canIgnoreInvoices}\`\`\``, inline: true },
);
return interaction.send({ embeds: [settingsEmbed] });