Tifaz
Tifaz
DIAdiscord.js - Imagine an app
Created by Tifaz on 8/16/2023 in #djs-questions
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
5 replies
DIAdiscord.js - Imagine an app
Created by Tifaz on 8/16/2023 in #djs-questions
Multiple création
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
2 replies