moved to d.js 14.3.0, started fixing errors
Co-authored-by: PineappleFan <pineapplefanyt@gmail.com>
diff --git a/src/commands/privacy.ts b/src/commands/privacy.ts
index 9f63602..8fce0b8 100644
--- a/src/commands/privacy.ts
+++ b/src/commands/privacy.ts
@@ -1,5 +1,5 @@
import { LoadingEmbed } from "./../utils/defaultEmbeds.js";
-import Discord, { CommandInteraction, MessageActionRow, MessageButton } from "discord.js";
+import Discord, { CommandInteraction, ActionRowBuilder, ButtonBuilder, ButtonStyle } from "discord.js";
import { SelectMenuOption, SlashCommandBuilder } from "@discordjs/builders";
import { WrappedCheck } from "jshaiku";
import EmojiEmbed from "../utils/generateEmojiEmbed.js";
@@ -13,12 +13,12 @@
.setDescription("Information and options for you and your server's settings");
class Embed {
- embed: Discord.MessageEmbed;
+ embed: Discord.EmbedBuilder;
title: string;
description = "";
pageId = 0;
- components?: MessageActionRow[] = [];
- setEmbed(embed: Discord.MessageEmbed) {
+ components?: ActionRowBuilder[] = [];
+ setEmbed(embed: Discord.EmbedBuilder) {
this.embed = embed;
return this;
}
@@ -34,7 +34,7 @@
this.pageId = pageId;
return this;
}
- setComponents(components: MessageActionRow[]) {
+ setComponents(components: ActionRowBuilder[]) {
this.components = components;
return this;
}
@@ -102,11 +102,11 @@
.setDescription("Options")
.setPageId(3)
.setComponents([
- new MessageActionRow().addComponents([
- new MessageButton()
+ new ActionRowBuilder().addComponents([
+ new ButtonBuilder()
.setLabel("Clear all data")
.setCustomId("clear-all-data")
- .setStyle("DANGER")
+ .setStyle(ButtonStyle.Danger)
])
])
]
@@ -138,8 +138,8 @@
);
});
selectPane = [
- new MessageActionRow().addComponents([
- new Discord.MessageSelectMenu()
+ new ActionRowBuilder().addComponents([
+ new Discord.SelectMenuBuilder()
.addOptions(options)
.setCustomId("page")
.setMaxValues(1)
@@ -148,25 +148,25 @@
];
}
const components = selectPane.concat([
- new MessageActionRow().addComponents([
- new MessageButton()
+ new ActionRowBuilder().addComponents([
+ new ButtonBuilder()
.setCustomId("left")
.setEmoji(getEmojiByName("CONTROL.LEFT", "id"))
- .setStyle("SECONDARY")
+ .setStyle(ButtonStyle.Secondary)
.setDisabled(page === 0),
- new MessageButton()
+ new ButtonBuilder()
.setCustomId("select")
.setEmoji(getEmojiByName("CONTROL.MENU", "id"))
- .setStyle(selectPaneOpen ? "PRIMARY" : "SECONDARY")
+ .setStyle(selectPaneOpen ? ButtonStyle.Primary : ButtonStyle.Secondary)
.setDisabled(false),
- new MessageButton()
+ new ButtonBuilder()
.setCustomId("right")
.setEmoji(getEmojiByName("CONTROL.RIGHT", "id"))
- .setStyle("SECONDARY")
+ .setStyle(ButtonStyle.Secondary)
.setDisabled(page === pages.length - 1)
])
]);
- const em = new Discord.MessageEmbed(pages[page].embed);
+ const em = new Discord.EmbedBuilder(pages[page].embed);
em.setDescription(em.description + "\n\n" + createPageIndicator(pages.length, page));
em.setFooter({ text: nextFooter ?? "" });
await interaction.editReply({
@@ -216,14 +216,14 @@
continue;
}
} else {
- const em = new Discord.MessageEmbed(pages[page].embed);
+ const em = new Discord.EmbedBuilder(pages[page].embed);
em.setDescription(em.description + "\n\n" + createPageIndicator(pages.length, page));
em.setFooter({ text: "Message closed" });
interaction.editReply({ embeds: [em], components: [] });
return;
}
}
- const em = new Discord.MessageEmbed(pages[page].embed);
+ const em = new Discord.EmbedBuilder(pages[page].embed);
em.setDescription(em.description + "\n\n" + createPageIndicator(pages.length, page));
em.setFooter({ text: "Message timed out" });
await interaction.editReply({