Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

178
Vistas
SyntaxError: Unexpected end of input client.login(token);

Today i was trying to make a bot that sends welcome messages for my friend's server when i got this error and i dont know how to solve it, i tried multiple things in my code to fix it but it still does not work, i would appreciate if someone knows how to help me with this.

Error log:

C:\Users\LUCAS\Desktop\sachabot\index.js:34
client.login(token);


SyntaxError: Unexpected end of input
←[90m    at Object.compileFunction (node:vm:352:18)←[39m
←[90m    at wrapSafe (node:internal/modules/cjs/loader:1031:15)←[39m
←[90m    at Module._compile (node:internal/modules/cjs/loader:1065:27)←[39m
←[90m    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)←[39m
←[90m    at Module.load (node:internal/modules/cjs/loader:981:32)←[39m
←[90m    at Function.Module._load (node:internal/modules/cjs/loader:822:12)←[39m
←[90m    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12)←[39m
←[90m    at node:internal/main/run_main_module:17:47←[39m

Code that im using:

const Discord = require('discord.js');
const client = new Discord.Client();

const config = require("./config.json");

client.on("ready", () => {
  console.log("im on!");

client.on("guildMemberAdd", async (member) => { 

  let guild = await client.guilds.cache.get("server id here");
  let channel = await client.channels.cache.get("welcome channel id here");
  let emoji = await member.guild.emojis.cache.find(emoji => emoji.name === "emogi");

  if (guild != member.guild) {
    return console.log("i dont recognize this server...");
   } else {

      let embed = await new Discord.MessageEmbed()
      .setColor("#7c2ae8")
      .setAuthor(member.user.tag, member.user.displayAvatarURL())
      .setTitle(`${emoji} welcome ${emoji}`)
      .setImage("https://tenor.com/view/dancing-baby-pacifier-shades-gif-5960764")
      .setDescription(`**${member.user}**, Welcome to the server **${guild.name}**! in this exact moment we have **${member.guild.memberCount} members**, be cool!`)
      .setThumbnail(member.user.displayAvatarURL({ dynamic: true, format: "png", size: 1024 }))
      .setFooter('User ID: ' + member.user.id)
      .setTimestamp();

    await channel.send(embed);
  }

});

client.login(token);
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Syntax error on line 7. Be more careful when posting question like this.

client.on("ready", () => {
  console.log("im on!");
}) // this line is missing "})"
about 4 years ago · Juan Pablo Isaza Denunciar

0

You forgot to close your first callback. Adding another }); after the first });should fix it

about 4 years 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 vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda