the bot does not respond to commands #821
-
I write a command in the guild or personally to the bot and it just doesn't work const { REST } = require('@discordjs/rest');
const { Routes } = require('discord-api-types/v9');
const { Client, Intents } = require('discord.js');
const { token, prefix } = require('./config.json');
const fs = require('fs');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
const clientId = 'some-clientId';
const guildId = 'some-guildId';
const comdFIle = fs.readFileSync('./commands/ping.js')
client.once('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
client.user.setActivity(`in Dev`);
});
client.on('interactionCreate', async interaction => {
if (!interaction.isCommand()) return;
const { commandName } = interaction;
if (!client.commands.has(commandName)) return;
try {
await client.commands.get(commandName).execute(interaction);
} catch (error) {
console.error(error);
await interaction.reply({ content: 'There was an error while executing this command!', ephemeral: true });
}
});
client.login(token); |
Beta Was this translation helpful? Give feedback.
Answered by
WiseDevHelper
Aug 15, 2021
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
almostSouji
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
node -v
)