Advertisement
xxxKookie

Aviso/Cancela

Mar 6th, 2019
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require('discord.js');
  2.  
  3. exports.run = async (bot, message, args) => {
  4.  
  5. if(!message.member.hasPermission("MENTION_EVERYONE", "ADMINISTRATOR")) return message.reply("VocΓͺ nΓ£o tem o direito de usar esse comando!");
  6.  
  7. message.delete().catch(O_o=>{});
  8. var args = message.content.split(" ").slice(1).join(" ");
  9. if (!args) return message.reply("Insira o seu aviso");
  10. const embed = new Discord.RichEmbed()
  11.     .setTitle('πŸ›Ž AVISO πŸ›Ž')
  12.     .setColor("36393e")
  13.     .setDescription(args)
  14.     .setTimestamp()
  15.     .setFooter(`Aviso enviado por: ${message.author.tag}`, `${message.author.avatarURL}`)
  16.  
  17.     message.channel.send(embed).then(msg => {
  18.         msg.react("πŸ›Ž")
  19.         .then(() => msg.react("❌"))
  20.        
  21.        
  22.  
  23.  
  24.  
  25.  
  26.     let filtro = (reaction, user) => reaction.emoji.name === "πŸ›Ž" && user.id === message.author.id;  
  27.    
  28.     const coletor = msg.createReactionCollector(filtro, {max: 1, time: 60000});
  29.  
  30.     coletor.on("collect", () => {
  31.         message.channel.send('@everyone');
  32.    
  33.     });
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.     const qEmbed = new Discord.RichEmbed()
  41.     .setTitle('❌ AVISO CANCELADO ❌')
  42.     .setColor("36393e")
  43.     .setTimestamp()
  44.     .setFooter(`Aviso cancelado por: ${message.author.tag}`, `${message.author.avatarURL}`)
  45.  
  46.  
  47.     let filtro2 = (reaction, user) => reaction.emoji.name === "❌" && user.id === message.author.id;  
  48.    
  49.     const coletor2 = msg.createReactionCollector(filtro2, {max: 1, time: 60000});
  50.  
  51.     coletor2.on("collect", () => {
  52.         msg.edit(qEmbed)
  53.        
  54.     });
  55.  
  56.  
  57.  
  58.  
  59.     let filtro1 = (reaction, user) => reaction.emoji.name === "❌" && user.id === message.author.id;  
  60.    
  61.     const coletor1 = msg.createReactionCollector(filtro1, {max: 1, time: 60000});
  62.  
  63.     coletor1.on("collect", () => {
  64.         msg.channel.bulkDelete(1)
  65.        
  66.     });
  67.  
  68.  });        
  69. }
  70.  
  71. exports.help = {
  72.     name: "aviso"
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement