12.5.3 Command not working

Heres my code, any idea why its not working? const Discord = require('discord.js'); const client = new Discord.Client(); const prefix = '!'; client.once('ready', () => { console.log('VividMC Bot is online!'); }); client.on('message', message =>{ if (!message.content.startsWith(prefix) || message.author.bot) return;
const args = message.content.slice(prefix.length).split(/ +/); const command = args.shift().toLowerCase();
if(command === 'ping'){ message.channel.send('pong!'); } }); client.login('Token goes here');
2 Replies
d.js toolkit
d.js toolkit9mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
GamingWithJohn
GamingWithJohnOP9mo ago
discord.js = 12.5.3 node = 16.14.2 im not updating as the newer version are much more confusing & complex. Could you just tell me what seems to be the problem?
Want results from more Discord servers?
Add your server