What do I need to know for a Discord bot because I’ve been developing on V11 for quite some time and I want to upgrade to V14 of JavaScript for the Discord bot.
So I got the bot to come online with this set of code.
const Discord = require(‘discord.js’);
const { Client, Intents } = require(‘discord.js’);
const client = new Discord.Client({intents: 3276799});
client.on(‘ready’, () => {
console.log(Logged in as ${client.user.tag}!
);
});
client.on(‘interactionCreate’, async interaction => {
if (!interaction.isChatInputCommand()) return;
if (interaction.commandName === ‘ping’) {
await interaction.reply('Pong!');
}
});
But I’m trying to make it work so it can listen to/ commands and respond to normal messages in chat without a prefix. I want to update my code to work on this newer version but I haven’t experienced how any of this logging and stuff works. I’m so used to how Discord js11 works. That’s what all my bots are currently running at this time!
To simplify it, I need help understanding and getting a base version of it so I can learn and experiment with how to make the bot work. I tried AI and it has failed miserably so who else to ask then the coding community?
Explained in the last one. Just trying to learn. I’m open-minded and happy for you to critique my code and I don’t get frustrated easil
Slyfox Studio is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.