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

146
Views
Obligue al bot a esperar y envíe todo esto incrustado en el mismo mensaje

mensajeEliminar.js

 const Discord = require('discord.js') module.exports = { name: 'messageDelete', async execute(client, message, messageDelete) { if (message.channel.type === 'DM') return; if (message.author == client) return; if (!message.author) return; if(message.embeds[0]) return; if(message.attachments.size) return; let Channel = client.channels.cache.get("CHANNEL-ID") if (!Channel){ return; } else if (Channel.type !== 'GUILD_TEXT') { return; } else if (!data.Mod.Logs.isEnabled){ return; } else if(!Channel.guild.me.permissions.has("EMBED_LINKS", "VIEW_CHANNEL", "READ_MESSAGE_HISTORY", "VIEW_AUDIT_LOG", "SEND_MESSAGES")) { return; } else { // Do nothing.. }; const timestamp = Math.floor(Date.now() / 1000) const Msg = message.toString().substr(0, 500); const DeletedLog = new Discord.MessageEmbed() .setAuthor({ name: message.author.username, iconURL: message.author.displayAvatarURL({dynamic: true, size: 2048}) }) .setTitle(`<a:Down:853495989796470815> Deleted Message`) .setDescription(`<a:iNFO:853495450111967253> **Member**: \`${message.author.tag}\` (${message.author.id})\n<:pp198:853494893439352842> **In**: ${message.channel}\n• **At**: <t:${timestamp}>\n\n<a:Right:877975111846731847> **Content**: \`\`\`\n${Msg || '❌ | Unkown message!'}\n\`\`\``) .setColor('RED') .setFooter({ text: message.guild.name, iconURL: message.guild.iconURL({dynamic: true}) }) .setTimestamp() .setThumbnail(message.author.displayAvatarURL({dynamic: true})) const botname = client.user.username; const webhooks = await Channel.fetchWebhooks() setTimeout(async function(){ let webhook = webhooks.filter((w)=>w.type === "Incoming" && w.token).first(); if(!webhook){ webhook = await Channel.createWebhook(botname, {avatar: client.user.displayAvatarURL({ format: 'png', dynamic: true, size: 128 })}) } else if(webhooks.size <= 10) { } webhook.send({embeds: [DeletedLog]}) .catch(() => {}); }, 5000); // add more functions on ready event callback function... return; } }

Así es como mi evento messageDelete envía la inserción. ¿Cómo puedo obligar al bot a esperar un cierto tiempo y si el evento messageDelete se ejecutó como 5 veces en este momento, el bot envía las 5 incrustaciones en el mismo mensaje?

about 4 years ago · Juan Pablo Isaza
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!