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

170
Views
discord.js editar el tiempo de espera de incrustación

Hice un comando divertido y no obtuve errores hasta ahora.

Aquí está el código:

 const { MessageEmbed } = require('discord.js') module.exports = { name: "spin", description: "spin", permissions: ["SEND_MESSAGES"], run: async (client, message, args) => { if(message.author.bot) return; let number = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36"]; let secondEmbed = new MessageEmbed() .setTitle("The wheel is spinning...") .setColor('#fc8eac') .setTimestamp() .addField("Spinner", `<@!${message.author.id}>`, true) .addField("Result", ` <a:dotload:928216650614968321>`, true) .setThumbnail('https://cdn.discordapp.com/emojis/928270805492699177.webp?size=160&quality=lossless') .setFooter(`${message.author.tag}`, message.author.displayAvatarURL()); const m = await message.channel.send({embeds: [secondEmbed] }) let firstEmbed = new MessageEmbed() .setTitle("The wheel has stopped spinning!") .setColor('#fc8eac') .setTimestamp() .addField("Spinner", `<@!${message.author.id}>`, true) .addField("Result", `${number[Math.floor(Math.random() * number.length)]}`, true) .setThumbnail('https://cdn.discordapp.com/emojis/928270805492699177.webp?size=160&quality=lossless') .setFooter(`${message.author.tag}`, message.author.displayAvatarURL()); await m.edit(({embeds: [firstEmbed] }), {timeout: 5000}) } }

Tengo problemas en esta línea porque la inserción se edita en menos del tiempo dado {timeout: 5000}

 await m.edit(({embeds: [firstEmbed] }), {timeout: 5000})

Necesito ayuda sobre cómo solucionar esto.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

No estoy seguro de si hay una opción de timeout de espera para el método de Message#edit . Al menos no puedo encontrarlo en la documentación .

Sin embargo, podrías usar el viejo método setTimeout para lograr lo mismo:

 setTimeout(() => { m.edit({ embeds: [firstEmbed] }) }, 5000)
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!