#help

1 messages · Page 1 of 1 (latest)

autumn robin
#

Here, post all of the index code and I'll try to replicate it

humble ether
#

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

autumn robin
#

okay gimme a second

humble ether
#

are you Spanish by the way, i saw you tutorial in Spanish also

autumn robin
#

I'm not! This isn't my tutorial haha

humble ether
#

oke

autumn robin
#

Does it give any error when you hit "run"?

humble ether
#

no

#

just this

autumn robin
#

Try adding console.log('hi') on the last line and let me know if it prints

humble ether
#

that's keep not running

#

@autumn robin what's now?

autumn robin
#

When you make a Discord client, you need to put intents

humble ether
#

what are intents

autumn robin
#

Intents are what you need from Discord

#

For example,

new Discord.client(
  intents: [
    GUILDS,
    GUILD_MESSAGES
  ]
)
humble ether
#

where do i put it?

autumn robin
#

When you define your Discord client, you should put the intents in the ()

humble ether
#

but where i put it exactly?

autumn robin
#

Inside Discord.client(-here-)

humble ether
#

yea but the code

autumn robin
#

In there, you put {intents: ['intent1', 'intent2']}

autumn robin
#

Line 2

humble ether
#

...

#

okay

#

okat let me quitting you, i gonna learn more about this, thanks for the help anyways

#

you're a legend