• Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Precios
    • Pruebas
    • Nómina
    • Blog
    • Comercial
    • Calculadora de salario

0

72
Vistas
Trying to make a discord but I keep getting the error "required is not defined"

I'm really new at this and I'm trying to get the bot to come online but no matter what I do the error message comes up, I also downloaded requirejs but it doesn't seem to be working. basically, I have no idea what I'm doing and need help.

const {Clients, Intents} = require(discord.js);
const TOKEN = '************************************************'
const client = new Client({
    intents: [
        Inents.FLAGS.GUILDS,
        Intents.FLags.GUILD_MESSAGES,
    ]
});




client.once('ready', () => {
    console.log('Logged in as ${client.user.tag}')
});
client.login(TOKEN);
9 months ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

You need to put discord.js in quotes like this:

const {Clients, Intents} = require("discord.js");
9 months ago · Juan Pablo Isaza Denunciar

0

A couple things. Don't give out your token on public websites. Discord has probably dmed you saying you gave out your token here, but still. I'd recommend creating a .env file with the 'dotenv' package (if you know what that is.) just to keep your token private.

On your 5th line, Intents has a typo, it says Inents. So, make sure that's fixed, and same with the 6th line. It should be FLAGS not FLags

The reason "require" isn't defined is because you need to put discord.js in quotations like this.

const {Clients, Intents} = require('discord.js');

If you have any other errors, feel free to reply with it. Have a great day.

9 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Precios Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.