"This Interaction Failed" Error

The code functions as followed: Once I do /blacklist-server add, the owner of the blacklisted server will receive an DM where then click a button and apply to be unblacklisted. The issues lies when the owner tries to click the button, it sends an "This interaction failed" error. Here is my code:
const { Listener } = require('@sapphire/framework');
const {
Events,
ModalBuilder,
TextInputBuilder,
TextInputStyle,
ButtonBuilder,
ButtonStyle,
ActionRowBuilder
} = require("discord.js");
const { color, emojis } = require('../../config');
const Guild = require('../../schemas/blacklistSchema');

class UserEvent extends Listener {

constructor(context, options = {}) {
super(context, {
...options
});
}

async run(interaction, client) {
if (interaction.customId !== "ban_appeal_modal") {
if (interaction.customId === "ban_appeal") {
const modal = new ModalBuilder()
.setCustomId('ban_appeal_modal')
.setTitle('Blacklist Appeal');
const Q1 = new TextInputBuilder()
.setCustomId('question_1')
.setLabel("Your ID")
.setStyle(TextInputStyle.Short);
const Q2 = new TextInputBuilder()
.setCustomId('question_2')
.setLabel("What was the reason for your blacklist?")
.setStyle(TextInputStyle.Short);
const Q3 = new TextInputBuilder()
.setCustomId('question_3')
.setLabel("Why do you think you should be unblacklisted?")
.setStyle(TextInputStyle.Paragraph);

const firstActionRow = new ActionRowBuilder().addComponents(Q1);
const secondActionRow = new ActionRowBuilder().addComponents(Q2);
const thirdActionRow = new ActionRowBuilder().addComponents(Q3);

modal.addComponents(firstActionRow, secondActionRow, thirdActionRow);

await interaction.showModal(modal);
}
if (interaction.customId === "blacklist_appeal_accept") {
const ownerId = interaction.guild.ownerId;
const owner = await client.users.fetch(ownerId);
const currentDate = new Date().toLocaleDateString();
await owner.send(`${emojis.custom.tada} Your blacklist appeal has been **accepted** on **${currentDate}**!`);
await interaction.reply({
content: `${emojis.custom.success} You have successfully **accepted** ${owner}'s blacklist appeal on **${currentDate}**!`,
ephemeral: true
});
}
if (interaction.customId === "blacklist_appeal_deny") {
const ownerId = interaction.guild.ownerId;
const owner = await client.users.fetch(ownerId);
const currentDate = new Date().toLocaleDateString();
await owner.send(`${emojis.custom.fail} Your blacklist appeal has been **denied** on **${currentDate}**!`);
await interaction.reply({
content: `${emojis.custom.success} You have successfully **denied** ${owner}'s blacklist appeal on **${currentDate}**!`,
ephemeral: true
});
}
}
}
};

module.exports = {
UserEvent
};
const { Listener } = require('@sapphire/framework');
const {
Events,
ModalBuilder,
TextInputBuilder,
TextInputStyle,
ButtonBuilder,
ButtonStyle,
ActionRowBuilder
} = require("discord.js");
const { color, emojis } = require('../../config');
const Guild = require('../../schemas/blacklistSchema');

class UserEvent extends Listener {

constructor(context, options = {}) {
super(context, {
...options
});
}

async run(interaction, client) {
if (interaction.customId !== "ban_appeal_modal") {
if (interaction.customId === "ban_appeal") {
const modal = new ModalBuilder()
.setCustomId('ban_appeal_modal')
.setTitle('Blacklist Appeal');
const Q1 = new TextInputBuilder()
.setCustomId('question_1')
.setLabel("Your ID")
.setStyle(TextInputStyle.Short);
const Q2 = new TextInputBuilder()
.setCustomId('question_2')
.setLabel("What was the reason for your blacklist?")
.setStyle(TextInputStyle.Short);
const Q3 = new TextInputBuilder()
.setCustomId('question_3')
.setLabel("Why do you think you should be unblacklisted?")
.setStyle(TextInputStyle.Paragraph);

const firstActionRow = new ActionRowBuilder().addComponents(Q1);
const secondActionRow = new ActionRowBuilder().addComponents(Q2);
const thirdActionRow = new ActionRowBuilder().addComponents(Q3);

modal.addComponents(firstActionRow, secondActionRow, thirdActionRow);

await interaction.showModal(modal);
}
if (interaction.customId === "blacklist_appeal_accept") {
const ownerId = interaction.guild.ownerId;
const owner = await client.users.fetch(ownerId);
const currentDate = new Date().toLocaleDateString();
await owner.send(`${emojis.custom.tada} Your blacklist appeal has been **accepted** on **${currentDate}**!`);
await interaction.reply({
content: `${emojis.custom.success} You have successfully **accepted** ${owner}'s blacklist appeal on **${currentDate}**!`,
ephemeral: true
});
}
if (interaction.customId === "blacklist_appeal_deny") {
const ownerId = interaction.guild.ownerId;
const owner = await client.users.fetch(ownerId);
const currentDate = new Date().toLocaleDateString();
await owner.send(`${emojis.custom.fail} Your blacklist appeal has been **denied** on **${currentDate}**!`);
await interaction.reply({
content: `${emojis.custom.success} You have successfully **denied** ${owner}'s blacklist appeal on **${currentDate}**!`,
ephemeral: true
});
}
}
}
};

module.exports = {
UserEvent
};
3 Replies
d.js toolkit
d.js toolkit4mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
mallusrgreat
mallusrgreat4mo ago
what is the error you're getting in terminal
Malik
Malik4mo ago
I am getting none. yes Well, it used to work. I'm not sure why it doesn't anymore. Is there anyway I can troubleshoot this? Any ideas? That if they dont share a common server with the bot, it won't work That'd be a good solution. Thank you!