upgrade to discord.js v14

This commit is contained in:
SowinskiBraeden committed 2022-08-24 23:23:44 -07:00
1 parent f32c04b5bc
commit 0cdd107b92
24 files changed
+1598 -1560

No files matched your search

+46 -45
View File
@@ -1,4 +1,4 @@
const { MessageEmbed } = require('discord.js');
const { EmbedBuilder } = require('discord.js');
module.exports = {
name: "wallet",
@@ -9,40 +9,41 @@ module.exports = {
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
member: [],
},
options: [
{
name: "view",
description: "view your wallet",
value: "view",
type: 1,
},
{
name: "id-set",
description: "set values on your id",
value: "id-set",
type: 1,
options: [
{
name: "alter",
description: "value to alter",
value: "alter",
type: 3,
required: true,
choices: [
{ name: "firstname", value: "firstname" }, { name: "lastname", value: "lastname" },
{ name: "dob", value: "dob" }, { name: "address", value: "address" },
]
},
{
name: "value",
description: "New value of what you'd like to change",
value: "value",
type: 3,
required: true,
},
]
}
],
SlashCommand: {
options: [
{
name: "view",
description: "view your wallet",
value: "view",
type: 1,
},
{
name: "id-set",
description: "set values on your id",
value: "id-set",
type: 1,
options: [
{
name: "value",
description: "value to set on id",
value: "value",
type: 3,
choices: [
{ name: "firstname", value: "firstname" }, { name: "lastname", value: "lastname" },
{ name: "dob", value: "dob" }, { name: "address", value: "address" },
]
},
{
name: "value",
description: "New value of what you'd like to change",
value: "value",
type: 3,
required: true,
},
]
}
],
/**
*
* @param {require("../structures/QuarksBot")} client
@@ -84,9 +85,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] });
}
@@ -97,9 +98,9 @@ module.exports = {
const success = addInventory(inventory.guilds, GuildDB.serverID, interaction.member.user.id, client);
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] });
}
@@ -111,9 +112,9 @@ module.exports = {
let item = inventory.guilds[GuildDB.serverID].items[0];
let ID = `${client.exists(item.ID.firstname) ? item.ID.firstname : '...'} ${client.exists(item.ID.lastname) ? item.ID.lastname : '...'} | ${client.exists(item.ID.dob) ? item.ID.dob : 'N/A'} | ${client.exists(item.ID.addr) ? item.ID.addr : 'N/A'}`
let walletEmbed = new MessageEmbed()
let walletEmbed = new EmbedBuilder()
.setTitle(`Your Wallet`)
.setColor(client.config.EmbedColor)
.setColor(client.config.Colors.Default)
.addFields(
{ name: '**Cash**', value: `$${item.cash.toFixed(2)}`, inline: true },
{ name: '**ID**', value: ID, inline: true });
@@ -138,9 +139,9 @@ module.exports = {
}
if (!isDate(args[0].options[1].value)) {
let embed = new MessageEmbed()
let embed = new EmbedBuilder()
.setTitle("Invalid Date of Birth")
.setColor("RED");
.setColor(client.config.Colors.Red);
return interaction.send({ embeds: [embed] });
}
@@ -155,15 +156,15 @@ module.exports = {
client.dbo.collection("inventories").updateOne(query, update, 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] });
}
});
let successEmbed = new MessageEmbed()
let successEmbed = new EmbedBuilder()
.setTitle('Success')
.setDescription(`Successfully set ${updateAction}\nUse \`/inventory wallet\` to view your updated ID`)
.setColor('GREEN');