RealMrCactus
RealMrCactus
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
@Jö🌈🦄
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
const { Events } = require('discord.js');

module.exports = {
name: Events.InteractionCreate,
async execute(interaction) {
if (!interaction.isChatInputCommand()) return;

const command = interaction.client.commands.get(interaction.commandName);

if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);
return;
}

try {
await command.execute(interaction);
} catch (error) {
console.error(error);
if (interaction.replied || interaction.deferred) {
await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true });
} else {
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
}
},
};
const { Events } = require('discord.js');

module.exports = {
name: Events.InteractionCreate,
async execute(interaction) {
if (!interaction.isChatInputCommand()) return;

const command = interaction.client.commands.get(interaction.commandName);

if (!command) {
console.error(`No command matching ${interaction.commandName} was found.`);
return;
}

try {
await command.execute(interaction);
} catch (error) {
console.error(error);
if (interaction.replied || interaction.deferred) {
await interaction.followUp({ content: 'There was an error while executing this command!', ephemeral: true });
} else {
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
}
},
};
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
after
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
await interaction.reply({ content: 'Application created!', ephemeral: true });
await interaction.reply({ content: 'Application created!', ephemeral: true });
it causes the error
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
if i do uhh
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
the first one
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
but it still sends twice
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
well i figured out the error
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
and sends twice
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
ping does unknown interaction
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
nvm it does
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
and now ping doesnt register
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
I did delete registered commands
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
but i dont see how a command makes all commands send twice
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
the only thing i did was try making a command
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
not that i can think of
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
nope
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
Powershell doesnt fix the issue
39 replies
DIAdiscord.js - Imagine an app
Created by RealMrCactus on 8/9/2024 in #djs-questions
Commands send twice
i can try using powershell instead of nushell
39 replies