this interaction failed

async function lockChannel(interaction, channel, guild) {
try {
await interaction.deferReply({ ephemeral: true });

if (guild && guild.roles.everyone) {
await channel.permissionOverwrites.edit(guild.roles.everyone, {
[PermissionsBitField.Flags.Connect]: false
});
await interaction.editReply({ content: 'Канал закрыт для подключения.' });
} else {
console.error('Не удалось изменить права доступа.');
await interaction.editReply({
content: 'Не удалось изменить права доступа.'
});
}
} catch (error) {
console.error('Ошибка при закрытии канала:', error);
if (!interaction.replied && !interaction.deferred) {
await interaction.reply({
content: 'Не удалось закрыть канал.',
ephemeral: true
});
} else {
await interaction.editReply({
content: 'Не удалось закрыть канал.'
});
}
}
}
async function lockChannel(interaction, channel, guild) {
try {
await interaction.deferReply({ ephemeral: true });

if (guild && guild.roles.everyone) {
await channel.permissionOverwrites.edit(guild.roles.everyone, {
[PermissionsBitField.Flags.Connect]: false
});
await interaction.editReply({ content: 'Канал закрыт для подключения.' });
} else {
console.error('Не удалось изменить права доступа.');
await interaction.editReply({
content: 'Не удалось изменить права доступа.'
});
}
} catch (error) {
console.error('Ошибка при закрытии канала:', error);
if (!interaction.replied && !interaction.deferred) {
await interaction.reply({
content: 'Не удалось закрыть канал.',
ephemeral: true
});
} else {
await interaction.editReply({
content: 'Не удалось закрыть канал.'
});
}
}
}
18 Replies
d.js toolkit
d.js toolkit2w 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!
Martoz
MartozOP2w ago
my problem is that after closing the channel, this interaction failed appears on all select menus.
treble/luna
treble/luna2w ago
does that code run at all if so, have you checked to see where execution stops
Martoz
MartozOP2w ago
the code is executed, that is, it closes it, but after it, all functions like unlock ban unban limit name cease to be executed.
treble/luna
treble/luna2w ago
sounds like an issue with your interactionCreate then
Martoz
MartozOP2w ago
one second you can open the file that I will upload, my interactioncreate is large and uploads as a file.
d.js docs
d.js docs2w ago
To share long code snippets, use a service like gist, sourcebin, pastebin, or similar instead of posting them as large code blocks or files.
Martoz
MartozOP2w ago
oh okey
treble/luna
treble/luna2w ago
but as far as i can see you dont handle commands there
Martoz
MartozOP2w ago
Pastebin
const { handleVoiceSelectMenu, handleVoiceModalsSubmit, handleVoice...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
treble/luna
treble/luna2w ago
which you should, you should only have 1 listener and filter based on component type
Martoz
MartozOP2w ago
is this a suspicion or the obvious reason for this interaction failed?
treble/luna
treble/luna2w ago
well you dont handle any commands in the code you showed
Martoz
MartozOP2w ago
Okay, I'll try, is there any documentation?
treble/luna
treble/luna2w ago
well you have some handling somewhere considering your commands works once
Martoz
MartozOP2w ago
the commands work fine and everything works until the moment I use lock, it kind of performs its function, but after that everything breaks and all commands stop executing, I can throw off the source code, maybe you'll find something there
d.js docs
d.js docs2w ago
If you aren't getting any errors, try to place console.log checkpoints throughout your code to find out where execution stops. - Once you do, log relevant values and if-conditions - More sophisticated debugging methods are breakpoints and runtime inspections: learn more

Did you find this page helpful?