I've been trying to get my discord bot to work, but it will only become online on discord and say that it's online in the console. What am I doing wrong
here's the code from my index.js
const Discord = require('discord.js')
const client = new Discord.Client({ partials: ["MESSAGE", "CHANNEL", "REACTION" ], intents: ["GUILDS", /* Other intents... */]});
const token = '(token here)';
client.login(token);
client.on('ready', () => {
console.log('I ARRIVE FROM THE ASHES OF THE EARTH');
});
client.on('message', message => {
if (message.content === 'Hello') {
message.send('I HAVE A GUN');
}
});
client.on('disconnect', () => {
console.log('ZE POPCORN IS DEAD');
});
const prefix = '-';
client.on('message', message => {
if (message.content === prefix + 'ping') {
message.send('Gun').then(message => message.edit('Pong'));
}
});
client.on('message', message => {
if (message.content === prefix + 'shutdown') {
if (message.author.id === '262707958646901248') {
message.send('Shutting down...').then(message => client.destroy());
}
}
});
client.on('message', message => {
if (message.content.startsWith(prefix)) {
const args = message.content.slice(prefix.length).split(/ +/);
const command = args.shift().toLowerCase();
if (command === 'ping') {
message.send('Gun');
}
}
});
client.on('message', message => {
if (message.content === prefix + 'help') {
message.send('figure it out I guess?');
}
});
client.on('message', message => {
if (message.content === prefix + 'info') {
message.send('I made this bot when popcorn "died". I hope you enjoy it.');
}
});
client.on('message', message => {
if (message.content === 'ping') {
message.send('
https://tenor.com/view/heavy-tf2-the-rock-rock-the-rock-the-dwayne-johnson-gif-22149531');
}
});
I tried all the commands that I put in and such, but it didn't do anything.
JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)