SHARE
TWEET

Untitled

a guest Jan 19th, 2020 79 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require("discord.js");
  2. const client = new Discord.Client();
  3. const prefix = "PREFIX HERE"
  4.  
  5. const activities_list = [
  6.   "t",
  7.   "te",
  8.   "tes",
  9.   "test"
  10.   ];
  11.  
  12. client.on("ready", () =>{
  13.  
  14.     })
  15.  
  16. client.on("message", message =>{
  17.   if (message.author.id !== 'ID HERE') return;
  18.   const args = message.content.slice(prefix.length).trim().split(/ +/g);
  19.   const command = args.shift().toLowerCase();
  20.   var seperator = " ";
  21.   var params = message.content.split(seperator).slice(1);
  22.  
  23.   if (command === `cmd`) {
  24.     message.delete()
  25.     message.channel.send("", { embed: new Discord.RichEmbed().setTitle("**Void**").setColor("#000000").setDescription("\n \n \n**USER COMMANDS**\n \nUser -- Cycles username\nNick -- Changes nickname\nAvatar -- Grabs avatar of user\n \n**STATUS COMMANDS**\n \nStream -- Streams status\nListening -- Listening status\nWatching -- Watching status\nPlaying -- Playing status\n \n**TEXT COMMANDS**\n \nEmbed -- Embeds message\nInvite -- Discord invite\nPurge -- Purges messages\n").setTimestamp() })
  26.   }
  27.  
  28.  
  29.   if (command === `stream`) {
  30.     const sayMessage = args.join(" ");
  31.     if (!sayMessage) return;
  32.  client.user.setPresence({
  33.         game: {
  34.             name: `${sayMessage}`,
  35.             type: `Streaming`,
  36.             url: "https://www.twitch.tv/999"
  37.         }
  38.     });
  39.     message.delete().catch(dash => { });
  40.   }
  41.  
  42.   if (command == 'listening') {
  43.     message.delete().catch(dash => { });
  44.     const sayMessage = args.join(" ");
  45.     if (!sayMessage) return;
  46.     client.user.setActivity(`${sayMessage}`, { type: 'LISTENING' })
  47.   }
  48.  
  49.   if (command == 'nick') {
  50.     message.delete().catch(dash => { });
  51.     const sayMessage = args.join(" ");
  52.     if (!sayMessage) return;
  53.     message.guild.members.get(client.user.id).setNickname(`${sayMessage}`);
  54.  
  55.  
  56.   }
  57.  
  58.  
  59.   if (command == 'watching') {
  60.     message.delete().catch(dash => { });
  61.     const sayMessage = args.join(" ");
  62.     if (!sayMessage) return;
  63.     client.user.setActivity(`${sayMessage}`, { type: 'WATCHING'})
  64.   }
  65.  
  66.   if (command == 'playing') {
  67.     message.delete().catch(dash => { });
  68.     const sayMessage = args.join(" ");
  69.     if (!sayMessage) return;
  70.     client.user.setActivity(`${sayMessage}`, { type: 'PLAYING'})
  71.   }
  72.  
  73.   if (command === `user`) {
  74.     message.delete().catch(dash => { });
  75.     var interval = setInterval(function () {
  76.       message.member.setNickname(`m`);
  77.       message.member.setNickname(`ma`);
  78.       message.member.setNickname(`mat`);
  79.       message.member.setNickname(`matt`);
  80.     }, 10);
  81.   }
  82.  
  83.   if (command === `avatar`) {
  84.     var member = message.mentions.users.first();
  85.     if (!member) return;
  86.     message.delete()
  87.     message.send("", { embed: new Discord.RichEmbed().setColor("#000000").setDescription("URL : " + member.avatarURL).setImage(member.avatarURL) })
  88.   }
  89.  
  90.  
  91.   if (command == 'invite') {
  92.     message.delete().catch(dash => { });
  93.     message.channel.send({embed: {
  94.       color: 0000000
  95.       ,
  96.       title: "join my discord!",
  97.       url: "https://discord.gg/Aw9mc4",  
  98.     }});
  99.   }
  100.  
  101.  
  102.   if (command == 'embed') {
  103.     message.delete().catch(dash => { });
  104.     const sayMessage = args.join(" ");
  105.     if (!sayMessage) return;
  106.     message.channel.send({embed: {
  107.       color: 16761035,
  108.       description: `${sayMessage}`
  109.     }});
  110.   }
  111.  
  112.   if (command === `purge`) {
  113.     var messagecount = 100;
  114.     if (params.length > 0) {
  115.       messagecount = parseInt(params[0]);
  116.     }
  117.     message.channel.fetchMessages({ limit: 100 }).then(function (messages) {
  118.       var messageArray = messages.array();
  119.       messageArray = messageArray.filter(function (m) { return m.author.id === client.user.id; });
  120.       messageArray.length = messagecount + 1;
  121.       messageArray.map(function (m) { m.delete().catch(console.error); });
  122.     });
  123.   }
  124.  
  125. })
  126.  
  127. client.login("TOKEN HERE")
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