thatitalianguy
thatitalianguy
DIAdiscord.js - Imagine an app
Created by thatitalianguy on 2/12/2024 in #djs-questions
Embed is only sending once every time the slash command is ran every active session
By every active session I mean every time the bot is online. I have a slash command that is like an 8ball command. It isnt finished since this is inly the testing version but It only sends the embed once then if I run it a 2nd time it says "Application didn't respond" with no errors in the console. Here is my code:
client.once('interactionCreate', async (cmd) => {
if (cmd.commandName === '8ball') {
var finishedCheck = false;
const randomInteger = randInt(0, 2)
const embedBall = new EmbedBuilder()
embedBall.setTitle('🎱 8ball')
embedBall.setDescription('The 8ball has been rolled!')

if(randomInteger == 0) {
embedBall.addFields(
{name: "8Ball's response", value: 'yes!'},


)
}
if(randomInteger == 1) {
embedBall.addFields(
{name: "8Ball's response", value: 'no!'},


)

}
if(randomInteger == 2) {
embedBall.addFields(
{name: "8Ball's response", value: 'maybe...'},


)

}

await cmd.reply("The 8ball has spoken...")
await cmd.channel.send({embeds: [embedBall]})



}
})
client.once('interactionCreate', async (cmd) => {
if (cmd.commandName === '8ball') {
var finishedCheck = false;
const randomInteger = randInt(0, 2)
const embedBall = new EmbedBuilder()
embedBall.setTitle('🎱 8ball')
embedBall.setDescription('The 8ball has been rolled!')

if(randomInteger == 0) {
embedBall.addFields(
{name: "8Ball's response", value: 'yes!'},


)
}
if(randomInteger == 1) {
embedBall.addFields(
{name: "8Ball's response", value: 'no!'},


)

}
if(randomInteger == 2) {
embedBall.addFields(
{name: "8Ball's response", value: 'maybe...'},


)

}

await cmd.reply("The 8ball has spoken...")
await cmd.channel.send({embeds: [embedBall]})



}
})
I've tried: Resetting my bot's token, only using interaction.reply Maybe it is because the command has an option that is being un used?
14 replies