multiple creation

Hello, I am creating a sports race manager and I am currently encountering a problem. When I create the first race everything goes well but when I create more races they are created several times (example: the 4th race created is created 4 times, the 5th 5 times, etc.) here are the diferents that are related to this problem. Thanks in advance. discord.js version : 14.12.1 | node version : v20.5.1 course.js :
const {
SlashCommandBuilder,
ButtonBuilder,
ActionRowBuilder,
} = require('discord.js');

const Infocourse = require('../fonctions/Infocourse.js');

module.exports = {

data: new SlashCommandBuilder().setName('créer-course').setDescription('Crée une course'),

async execute(interaction) {
const buttoncourse = new ButtonBuilder()
.setCustomId('buttoncourse')
.setLabel('🛶créer une course🛶')
.setStyle('Primary');

const buttonRow = new ActionRowBuilder().addComponents(buttoncourse);

await interaction.reply({
content: `⬇️ Clicker pour commencer à créer une course ⬇️`,
components: [buttonRow],
});
await Infocourse.execute(interaction);
}
};
const {
SlashCommandBuilder,
ButtonBuilder,
ActionRowBuilder,
} = require('discord.js');

const Infocourse = require('../fonctions/Infocourse.js');

module.exports = {

data: new SlashCommandBuilder().setName('créer-course').setDescription('Crée une course'),

async execute(interaction) {
const buttoncourse = new ButtonBuilder()
.setCustomId('buttoncourse')
.setLabel('🛶créer une course🛶')
.setStyle('Primary');

const buttonRow = new ActionRowBuilder().addComponents(buttoncourse);

await interaction.reply({
content: `⬇️ Clicker pour commencer à créer une course ⬇️`,
components: [buttonRow],
});
await Infocourse.execute(interaction);
}
};
Infocourse.js : 1st attached piece createCourse.js : 2de attached piece
3 Replies
d.js toolkit
d.js toolkit10mo 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!
d.js docs
d.js docs10mo ago
If you are waiting for button or select menu input from a specific message, don't create the collector on the channel. - Channel collectors return component interactions for any component within that channel.
- <Channel>.createMessageComponentCollector(…)
+ <Message>.createMessageComponentCollector(…)
- <Channel>.createMessageComponentCollector(…)
+ <Message>.createMessageComponentCollector(…)
Tifaz
Tifaz10mo ago
I can't find which collector you want to talk about I close them well all alone thank you very much for your time it's very nice to help people like that