upgrade to discord.js v14
This commit is contained in:
24 files changed
+1598
-1560
No files matched your search
+30
-29
@@ -1,4 +1,5 @@
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const { EmbedBuilder } = require('discord.js');
|
||||
const { Bank, addBank } = require('../structures/bank');
|
||||
|
||||
module.exports = {
|
||||
name: "fine",
|
||||
@@ -9,24 +10,24 @@ module.exports = {
|
||||
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
||||
member: [],
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: "user",
|
||||
description: "The user to fine",
|
||||
value: "user",
|
||||
type: 6,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "amount",
|
||||
description: "Amount the fine totals to",
|
||||
value: "amount",
|
||||
type: 5,
|
||||
min_value: 0.01,
|
||||
required: true,
|
||||
}
|
||||
],
|
||||
SlashCommand: {
|
||||
options: [
|
||||
{
|
||||
name: "user",
|
||||
description: "The user to fine",
|
||||
value: "user",
|
||||
type: 6,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "amount",
|
||||
description: "Amount the fine totals to",
|
||||
value: "amount",
|
||||
type: 10,
|
||||
min_value: 0.01,
|
||||
required: true,
|
||||
}
|
||||
],
|
||||
/**
|
||||
*
|
||||
* @param {require("../structures/QuarksBot")} client
|
||||
@@ -40,16 +41,16 @@ module.exports = {
|
||||
}
|
||||
|
||||
if (!GuildDB.officerRole) {
|
||||
const embed = MessageEmbed()
|
||||
.setColor("RED")
|
||||
const embed = EmbedBuilder()
|
||||
.setColor(client.config.Colors.Red)
|
||||
.setDescription("**Notice:** The admins have not set an officer role.")
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
}
|
||||
|
||||
if (!interaction.member.roles.includes(GuildDB.officerRole)) {
|
||||
const embed = MessageEmbed()
|
||||
.setColor("RED")
|
||||
const embed = EmbedBuilder()
|
||||
.setColor(client.config.Colors.Red)
|
||||
.setDescription(`**Notice: You require the <@&${GuildDB.officerRole}>**`)
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
@@ -78,9 +79,9 @@ module.exports = {
|
||||
.catch(err => {
|
||||
if (err) {
|
||||
client.log(err);
|
||||
const embed = new MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setColor("RED")
|
||||
.setColor(client.config.Colors.Red)
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
}
|
||||
@@ -92,9 +93,9 @@ module.exports = {
|
||||
const success = addBank(banking.guilds, GuildDB.serverID, targetUserID, client, GuildDB.startingBalance);
|
||||
if (!success) {
|
||||
client.log(err);
|
||||
const embed = new MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setColor("RED")
|
||||
.setColor(client.config.Colors.Red)
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
}
|
||||
@@ -105,15 +106,15 @@ module.exports = {
|
||||
client.dbo.collection("banks").updateOne({"account.userID":targetUserID},{$set:{[`banking.guilds.${GuildDB.serverID}.account.balance`]:newTargetBalance}}, function(err, res) {
|
||||
if (err) {
|
||||
client.log(err);
|
||||
const embed = new MessageEmbed()
|
||||
const embed = new EmbedBuilder()
|
||||
.setDescriptions(`**Internal Error:** ${err}\nContact the Developers\nhttps://discord.gg/YCXhvy9uZw`)
|
||||
.setColor("RED")
|
||||
.setColor(client.config.Colors.Red)
|
||||
|
||||
return interaction.send({ embeds: [embed] });
|
||||
}
|
||||
});
|
||||
|
||||
const successEmbed = new MessageEmbed()
|
||||
const successEmbed = new EmbedBuilder()
|
||||
.setTitle('Bank Notice:')
|
||||
.setDescription(`Successfully fined <@${targetUserID}> $${args[0].options[1].value.toFixed(2)}`)
|
||||
.setColor('GREEN');
|
||||
|
||||
Reference in new issue
Block a user