Ledger Nano X - The secure hardware wallet
SHARE
TWEET

discord bot tut 8 v12

jensie1996 May 22nd, 2020 1,268 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const discord = require("discord.js");
  2.  
  3. module.exports.run = async (client, message, args) => {
  4.  
  5.     // !announcement titel | bericht | kleur | kanaal.
  6.  
  7.     if (!message.member.hasPermission("KICK_MEMBERS")) return message.reply("sorry jij kan dit niet");
  8.  
  9.     var seperator = "|";
  10.  
  11.     if (args[0] == null) {
  12.         var embed = new discord.MessageEmbed()
  13.             .setTitle("Gebruik")
  14.             .setColor("#00ee00")
  15.             .setDescription(`Maak een announcement door gebruik te maken van: \n !announcement titel ${seperator} bericht ${seperator} kleur ${seperator} kanaal`);
  16.  
  17.         return message.reply(embed);
  18.     }
  19.  
  20.     var argsList = args.join(" ").split(seperator);
  21.  
  22.     console.log(argsList);
  23.  
  24.     if (argsList[2] == undefined) argsList[2] = "#eeeeee";
  25.     if (argsList[3] == undefined) argsList[3] = "general";
  26.  
  27.     var options = {
  28.  
  29.         titel: argsList[0],
  30.         bericht: argsList[1] || "Geen inhoud opgegeven",
  31.         kleur: argsList[2].trim(),
  32.         kanaal: argsList[3].trim()
  33.  
  34.     }
  35.  
  36.     console.log(options);
  37.  
  38.     var announceEmbed = new discord.MessageEmbed()
  39.         .setTitle("Announcement")
  40.         .setColor(options.kleur)
  41.         .setDescription(`Bericht van ${message.author} \n\n ${options.titel} \n\n ${options.bericht}`)
  42.         .setTimestamp();
  43.  
  44.     var channel = message.member.guild.channels.cache.find(channel => channel.name === options.kanaal);
  45.     if (!channel) return message.reply("Kanaal bestaat niet");
  46.  
  47.     channel.send(announceEmbed);
  48.  
  49. }
  50.  
  51. module.exports.help = {
  52.     name: "announcement"
  53. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top