#help
1 messages · Page 1 of 1 (latest)
npconst Discord = require("discord.js");
const client = new Discord.Client();
const config = require("./config.json");
client.on("ready", () => {
console.log("Estoy listo!");
});
var prefix = config.prefix;
client.on('messageCreate', async message => {
if (message.content.startsWith(config.prefix)) {
let args = message.content.slice(config.prefix.length).split(' ');
let command = args.shift().toLowerCase();
switch (command) {
case "ping":
message.channel.send(\`pong 🏓!!\`);
break;
case "hola":
message.channel.send(\`Hola como estas?\`);
break;
}
}
});
client.login(config.token);
@autumn robin
okay gimme a second
are you Spanish by the way, i saw you tutorial in Spanish also
I'm not! This isn't my tutorial haha
oke
Does it give any error when you hit "run"?
Try adding console.log('hi') on the last line and let me know if it prints
When you make a Discord client, you need to put intents
what are intents
Intents are what you need from Discord
For example,
new Discord.client(
intents: [
GUILDS,
GUILD_MESSAGES
]
)
where do i put it?
When you define your Discord client, you should put the intents in the ()
but where i put it exactly?
Inside Discord.client(-here-)
yea but the code
In there, you put {intents: ['intent1', 'intent2']}
You already have the client part. You just need to put it in those parentheses
Line 2