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

218
Views
¿Cómo puedo unirme a un bot y enviar información del gremio en mi servidor de soporte?

¿Cómo puedo agregar cuando alguien agrega mi bot a su servidor? El bot enviará un mensaje a mi servidor de soporte con la información de ese servidor. Como una inserción: título: Bot se unió a una nueva descripción del servidor: nombre del gremio, ID del gremio, enlace de invitación del gremio o enlace de invitación del servidor

about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Debe usar el evento guildCreate de la clase Client para esto. ( https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=e-guildCreate )

El evento guildCreate devuelve el parámetro de guild en la devolución de llamada, que es el gremio donde se agregó el bot. Aquí hay un pequeño ejemplo de cómo podría usar este evento:

 const client = new Client({intents: ['Your Intents Here']}); client.on('guildCreate', guild => { const mainguild = client.guilds.cache.get('Your Guild ID Here'); const channel = mainguild.channels.cache.get('Your Channel ID Here'); const embed = new MessageEmbed() .setColor(`GREEN`) .setTitle(`Bot has been added`) .setAuthor(guild.name, guild.iconURL({dynamic: true})) .setDescription(`I've been added to the server '${guild.name}'. Here you have some more info...`) .setTimestamp(); channel.send({ embeds: [embed] }); });

Puede ver aquí qué propiedades y funciones puede usar para su inserción

about 4 years ago · Santiago Gelvez 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!