daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Jun 19th, 2017 72 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2.  
  3. const TOKEN = "MzI1OTc4NzU5MDU4NTU0ODgy.DChMxg.I4_EhiYfRcVBvruvctqoMyBuYqw";
  4. const PREFIX = "//";
  5.  
  6. function generateHex() {
  7.     return '#' + Math.floor(Math.random() * 16777215).toString(16)
  8. }
  9.  
  10. var fortunes = [
  11.     "https://prntscr.com/fl6tx4",
  12.     "https://prntscr.com/fl6tzt",
  13. ];
  14.  
  15.  
  16.  
  17. var bot = new Discord.Client();
  18.  
  19. bot.on("ready", function() {
  20.      console.log("Ready");
  21. });
  22.  
  23. bot.on("guildMemberAdd", function(member) {
  24.     member.guild.channels.find("name", "general").sendMessage(member.toString() + "welsome bitchi ie boty");
  25.    
  26.     member.addRole(member.guild.roles.find("name", "guest"));
  27.  
  28.      member.guild.createRole({
  29.          name: member.user.username,
  30.          color: generateHex(),
  31.          permissions: []
  32.        }).then(function(role) {
  33.           member.addRole(role);      
  34.        });
  35. });
  36. bot.on("message", function(message) {
  37.      if (message.author.equals(bot.user)) return;
  38.  
  39.      if (!message.content.startsWith(PREFIX)) return;
  40.  
  41.      var args = message.content.substring(PREFIX.length).split(" ");
  42.            
  43.  
  44.      switch (args[0].toLowerCase()) {
  45.          case "ping":
  46.              message.channel.sendMessage("Pong!");
  47.              break;
  48.          case "info":
  49.              message.channel.sendMessage("I'm a super dope bot created by Me");
  50.              break;
  51.          case "8ball":
  52.              if (args[1])  message.channel.sendMessage(fortunes[Math.floor(Math.random() * fortunes.length)]);
  53.              else message.channel.sendMessage("cant read that");                            
  54.                break;
  55.            case "embed":
  56.                 var embed = new Discord.RichEmbed()
  57.                     .addField("test", "mir doch egal", true)
  58.                     .addField("test", "mir doch egal", true)
  59.                     .ddField("test", "mir doch egal")
  60.                     .addField("test", "mir doch egal")
  61.                     .addField("test", "mir doch egal")
  62.                     .setcolor(0x00FFFF)
  63.                     .setFooter("das ist eine nachricht")
  64.                     .setThumbnail(message.author.avatarurl)
  65.                 message.channel.sendEmbed(embed);
  66.                 break;
  67.                case "noticeme":
  68.                message.channel.sendMessage(message.author.toString() +" idk");
  69.                        break;
  70.          
  71.     }
  72. });
  73.  
  74. bot.login(TOKEN);
RAW Paste Data
Top