shxd
shxd
DIAdiscord.js - Imagine an app
Created by shxd on 3/7/2024 in #djs-questions
Bot stopped working
i js didnt notice
11 replies
DIAdiscord.js - Imagine an app
Created by shxd on 3/7/2024 in #djs-questions
Bot stopped working
but yea it works now
11 replies
DIAdiscord.js - Imagine an app
Created by shxd on 3/7/2024 in #djs-questions
Bot stopped working
but i didnt change stuff, like it happened all of a sudden
11 replies
DIAdiscord.js - Imagine an app
Created by shxd on 3/7/2024 in #djs-questions
Bot stopped working
oops, didnt notice that
11 replies
DIAdiscord.js - Imagine an app
Created by shxd on 3/7/2024 in #djs-questions
Bot stopped working
const { Events } = require('discord.js');

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

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 });
}
}

} else if (interaction.isAutocomplete()) {

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

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

try {
await command.autocomplete(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()) {

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 });
}
}

} else if (interaction.isAutocomplete()) {

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

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

try {
await command.autocomplete(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 });
}
}

}
},
};
11 replies
DIAdiscord.js - Imagine an app
Created by shxd on 3/7/2024 in #djs-questions
Bot stopped working
well yea
11 replies
DIAdiscord.js - Imagine an app
Created by shxd on 3/7/2024 in #djs-questions
Bot stopped working
token, guild, client are right
11 replies
DIAdiscord.js - Imagine an app
Created by shxd on 3/7/2024 in #djs-questions
Bot stopped working
i dont even think its a code problem since i havent done anything and it stopped all of a sudden
11 replies
DIAdiscord.js - Imagine an app
Created by shxd on 3/7/2024 in #djs-questions
Bot stopped working
d.js v14.14.1 and node v20.11.1
11 replies