The Gobbler
The Gobbler
DIAdiscord.js - Imagine an app
Created by Gripz on 4/1/2024 in #djs-questions
How to get never timeout buttons
You shouldn't. That'll create a new event listener every time the command is ran. In general, you should only have 1 event listener per event. Instead, you can create a function to handle the button interaction, which could make it less cluttered.
// could be in a seperate file
async function handleButton(interaction) {
await interaction.reply('Button clicked!');
}

if (interaction.isButton()) {
handleButton(interaction);
}
// could be in a seperate file
async function handleButton(interaction) {
await interaction.reply('Button clicked!');
}

if (interaction.isButton()) {
handleButton(interaction);
}
15 replies
DIAdiscord.js - Imagine an app
Created by Solar on 2/22/2024 in #djs-questions
Uploading images don't work
Error is pretty self explanatory, you’re trying to edit or followUp an interaction reply that hasn’t been sent or deferred
23 replies