|
|
|
@ -67,7 +67,12 @@ export const callback = async (interaction: CommandInteraction): Promise<void> =
|
|
|
|
};
|
|
|
|
};
|
|
|
|
do {
|
|
|
|
do {
|
|
|
|
const buttons = new ActionRowBuilder<ButtonBuilder>().addComponents(
|
|
|
|
const buttons = new ActionRowBuilder<ButtonBuilder>().addComponents(
|
|
|
|
new ButtonBuilder().setCustomId("edit").setLabel("Edit Embed").setStyle(ButtonStyle.Secondary),
|
|
|
|
new ButtonBuilder()
|
|
|
|
|
|
|
|
.setCustomId("edit")
|
|
|
|
|
|
|
|
.setLabel("Edit Embed")
|
|
|
|
|
|
|
|
.setStyle(ButtonStyle.Secondary)
|
|
|
|
|
|
|
|
.setEmoji(getEmojiByName("ICONS.EDIT") as APIMessageComponentEmoji)
|
|
|
|
|
|
|
|
,
|
|
|
|
new ButtonBuilder()
|
|
|
|
new ButtonBuilder()
|
|
|
|
.setCustomId("send")
|
|
|
|
.setCustomId("send")
|
|
|
|
.setLabel("Send")
|
|
|
|
.setLabel("Send")
|
|
|
|
@ -143,7 +148,7 @@ export const callback = async (interaction: CommandInteraction): Promise<void> =
|
|
|
|
let i: Discord.ButtonInteraction | Discord.ChannelSelectMenuInteraction | Discord.StringSelectMenuInteraction;
|
|
|
|
let i: Discord.ButtonInteraction | Discord.ChannelSelectMenuInteraction | Discord.StringSelectMenuInteraction;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
i = (await interaction.channel!.awaitMessageComponent({
|
|
|
|
i = (await interaction.channel!.awaitMessageComponent({
|
|
|
|
filter: (i: Discord.Interaction) => i.user.id === interaction.user.id,
|
|
|
|
filter: (i: Discord.Interaction) => i.user.id === interaction.user.id && i.isMessageComponent() && i.message.id === m.id,
|
|
|
|
time: 300000
|
|
|
|
time: 300000
|
|
|
|
})) as
|
|
|
|
})) as
|
|
|
|
| Discord.ButtonInteraction
|
|
|
|
| Discord.ButtonInteraction
|
|
|
|
@ -223,17 +228,16 @@ export const callback = async (interaction: CommandInteraction): Promise<void> =
|
|
|
|
case "send": {
|
|
|
|
case "send": {
|
|
|
|
await i.deferUpdate();
|
|
|
|
await i.deferUpdate();
|
|
|
|
const channel = interaction.guild!.channels.cache.get(data.channel!) as Discord.TextChannel;
|
|
|
|
const channel = interaction.guild!.channels.cache.get(data.channel!) as Discord.TextChannel;
|
|
|
|
const components = new ActionRowBuilder<ButtonBuilder>();
|
|
|
|
const messageData: MessageCreateOptions = { };
|
|
|
|
for (const button of data.buttons) {
|
|
|
|
for (const button of data.buttons) {
|
|
|
|
components.addComponents(
|
|
|
|
messageData.components = [new ActionRowBuilder<ButtonBuilder>().addComponents(
|
|
|
|
new ButtonBuilder()
|
|
|
|
new ButtonBuilder()
|
|
|
|
.setCustomId(button)
|
|
|
|
.setCustomId(button)
|
|
|
|
.setLabel(buttonNames[button]!)
|
|
|
|
.setLabel(buttonNames[button]!)
|
|
|
|
.setStyle(ButtonStyle.Primary)
|
|
|
|
.setStyle(ButtonStyle.Primary)
|
|
|
|
);
|
|
|
|
)];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const messageData: MessageCreateOptions = { components: [components] };
|
|
|
|
if (data.title || data.description || data.color) {
|
|
|
|
if (data.title || data.description) {
|
|
|
|
|
|
|
|
const e = new EmojiEmbed();
|
|
|
|
const e = new EmojiEmbed();
|
|
|
|
if (data.title) e.setTitle(data.title);
|
|
|
|
if (data.title) e.setTitle(data.title);
|
|
|
|
if (data.description) e.setDescription(data.description);
|
|
|
|
if (data.description) e.setDescription(data.description);
|
|
|
|
|