daily pastebin goal
29%
SHARE
TWEET

SelfBot

a guest Jul 22nd, 2018 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Made by _programmeKid
  2.  
  3. //Variables
  4. var discord = require("discord.js");
  5. var client = new discord.Client();
  6. var prefix = "!";
  7.  
  8. //Functions
  9. function spam(channel,msg,rate,time){
  10.     let interval = setInterval(function(){
  11.         channel.send(msg);
  12.     },rate);
  13.     setTimeout(clearInterval,time*1000,interval);
  14. }
  15.  
  16. //Events
  17. client.on("ready",() => {
  18.     console.log("Ready for action!");
  19. });
  20.  
  21. client.on("message",msg => {
  22.  
  23.     let msgarray = msg.content.split(" ");
  24.     let cmd = msgarray[0];
  25.     let args = msgarray.slice(1);
  26.  
  27.     if(cmd == prefix + "spam"){
  28.         let rate = parseInt(args[0]);
  29.         let time = parseInt(args[1]);
  30.         let message = args.slice(2);
  31.  
  32.         spam(msg.channel,message,rate,time);
  33.     } else if(cmd == prefix + "activity"){
  34.         let doing = args[0];
  35.         let activity = args.slice(1);
  36.  
  37.         client.user.setActivity(activity,{type: doing});
  38.     }
  39. });
  40.  
  41. //Login
  42. client.login("token");
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