Facebook
From Tonaco, 3 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 171
  1. const Discord = require("discord.js");
  2.  
  3. exports.run = (client, message, args) => {
  4.   if (!message.member.hasPermission("ADMINISTRATOR"))
  5.     return message.channel.send(`> ${message.author} \n > ⚠️  **Você não tem permissão para utilizar esse comand0o!**`);
  6.  
  7.   message.channel
  8.     .send(`> **Em qual canal você deseja anunciar?**`)
  9.     .then(msg => { let cp = message.channel.createMessageCollector(x => x.author.id == message.author.id, {max: 1})
  10.       .on("collect", c => {let canal = c.mentions.channels.first();
  11.           if (!canal) {
  12.             message.reply("mencione um canal!");
  13.           } else {
  14.             message.channel
  15.               .send(`> **Qual a mensagem desse anúncio?**`)
  16.               .then(msg2 => {
  17.                 let c1 = message.channel
  18.                   .createMessageCollector(
  19.                     x => x.author.id == message.author.id,
  20.                     { max: 1 }
  21.                   )
  22.                   .on("collect", c => {
  23.                     let desc = c.content;
  24.  
  25.                     message.channel
  26.                       .send(`> **Qual é o título?**`)
  27.                       .then(msg3 => {
  28.                         let ck = message.channel
  29.                           .createMessageCollector(
  30.                             x => x.author.id == message.author.id,
  31.                             { max: 1 }
  32.                           )
  33.                           .on("collect", c => {
  34.                             let title = c.content;
  35.  
  36.                             message.channel.send(
  37.                               `> ${message.author} \n > **Seu anúncio foi enviado ao canal ${canal} com sucesso!**`
  38.                             );
  39.  
  40.                             let anuncioembed = new Discord.RichEmbed()
  41.  
  42.                               .setColor("#7331db")
  43.                               .setFooter(
  44.                                 `Anúncio realizado por: ${message.author.username}`,
  45.                                 message.author.avatarURL
  46.                               )
  47.                               .setTitle(title)
  48.                               .setDescription(desc);
  49.  
  50.                             canal.send(`||@here||`, anuncioembed);
  51.                           });
  52.                       });
  53.                   });
  54.               });
  55.           }
  56.         });
  57.     });
  58. };
  59.  
  60. exports.help = {
  61.   name: "anunciar-here",
  62.   aliases: ["anuncio-here", "alerta-here", "alert-here"]
  63. };
  64.