Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

611
Views
Error - TypeError: client.on no es una función (Discord.js)

me sale este error:

 Client.on("guildCreate", (guild) => { TypeError: Client.on is not a function

mi código es:

 const client = require("../index"); const { MessageEmbed } = require("discord.js"); client.on("guildCreate", (guild) => { let channelToSend; guild.channels.cache.forEach((channel) => { if ( channel.type === "text" && !channelToSend && channel.permissionsFor(guild.me).has("SEND_MESSAGES") ) channelToSend = channel; }); if(!channelToSend) return; channelToSend.send( new MessageEmbed() .setAuthor(guild.name, guild.iconURL({ dynamic: true })) .setDescription("Thanks for inviting me my prefix is '?'") .setColor("RANDOM") .setTimestamp() ) });
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No estás creando el client correctamente.

La documentación oficial dice que haga eso para crear el client :

 const { Client } = require('discord.js'); const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!