SHARE
TWEET

juiced bot

a guest Jun 18th, 2019 84 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const Discord = require('discord.js');
  2.  
  3. const client = new Discord.Client();
  4.  
  5. const config = require('./auth.json');
  6.  
  7. var amountfees = ['nothing', '0'];
  8.  
  9. var strMatchList = ['yeezy 350', 'cactus plant', 'sacai', 'off white'];
  10.  
  11. function getMatch(str, list) {
  12.   var len = list.length;
  13.   for (n = 0; n < len; n++) {
  14.     s = list[n].toLowerCase();
  15.     if (str.toLowerCase().includes(s)){
  16.       return list[n];
  17.     }
  18.   }
  19.   return null;
  20. }
  21.  
  22. const request = require('request');
  23. const log = require('./logger');
  24.  
  25. const config = {
  26.   "webhook":"WEBHOOK", // Your webhook here
  27.   "requestURL":"LINK", // Your product link here
  28.   "refreshRate":1000
  29. }
  30. log("Starting...");
  31. function send() {
  32.   let requestLoop = setInterval(function(){
  33.   request({
  34.       url: config.requestURL,
  35.       method: "GET",
  36.       timeout: 1000,
  37.       followRedirect: true,
  38.       maxRedirects: 10
  39.   },function(error, response, body){
  40.     if(error){
  41.       console.log("You're banned, try using a VPN!")
  42.     }
  43.  
  44.     request(opts);
  45.     log("+1 View")
  46.   });
  47. }, config.refreshRate);
  48. }
  49. send();
  50.  
  51. const helpEmbed = new Discord.RichEmbed()
  52.     .setColor('#fa709a')
  53.     .setTitle('___**List of commands**___')
  54.   /*  .addField('!purge, amount', 'Deletes a certain amount of messages')
  55.     .addField('!ban, user', 'Bans a specified member') */
  56.     .addField('!ping', 'Returns the ping in milliseconds')
  57.     .addField('!view (link)', 'Views an ebay link 200 times')
  58.     .addField('!fees (number)', 'Calculates the selling fees of GOAT/Stockx/Ebay/Grailed')
  59.     .addField('!shopifydelays (tasks) (proxies)', 'Calculates the recommended delays for Shopify websites')
  60.     .setTimestamp()
  61.     .setFooter('Juiced tools by matthew#1232', 'https://cdn.discordapp.com/attachments/582998102944907274/584911748650237962/twitter_icon.png');
  62.  
  63. client.on("ready", () => {
  64.     console.log(`Bot has started, with ${client.users.size} users, in ${client.channels.size} channels of ${client.guilds.size} servers.`);
  65.     client.user.setActivity(`!help`);
  66.   });
  67.  
  68.   client.on("guildCreate", guild => {
  69.  
  70.     console.log(`New guild joined: ${guild.name} (id: ${guild.id}). This guild has ${guild.memberCount} members!`);
  71.     client.user.setActivity(`with ${client.guilds.size} servers`);
  72.   });
  73.  
  74.   client.on("guildDelete", guild => {
  75.     console.log(`I have been removed from: ${guild.name} (id: ${guild.id})`);
  76.     client.user.setActivity(`with ${client.guilds.size} servers`);
  77.   });
  78.  
  79.  
  80.   client.on("message", async message => {
  81.  
  82.     var keywordmsg = message.content;
  83.  
  84.     var match = getMatch( message.content, strMatchList );
  85.     if (match != null  && message.channel.id == "589923197609181205"){
  86.       message.channel.send('**Keyword matched!** @everyone');
  87.     }
  88.  
  89.     // This event will run on every single message received, from any channel or DM.
  90.    
  91.     // Ignores bots
  92.     if(message.author.bot) return;
  93.    
  94.     if(message.content.indexOf(config.prefix) !== 0) return;
  95.    
  96.     // Here we separate our "command" name, and our "arguments" for the command.
  97.     // e.g. if we have the message "+say Is this the real life?" , we'll get the following:
  98.     // command = say
  99.     // args = ["Is", "this", "the", "real", "life?"]
  100.     const args = message.content.slice(config.prefix.length).trim().split(/ +/g);
  101.     const command = args.shift().toLowerCase();
  102.  
  103.     // Let's go with a few common example commands! Feel free to delete or change those.
  104.    
  105.     if(command === "ping") {
  106.       // Calculates ping between sending a message and editing it, giving a nice round-trip latency.
  107.       // The second ping is an average latency between the bot and the websocket server (one-way, not round-trip)
  108.       const m = await message.channel.send("Ping?");
  109.       m.edit(`Pong! Latency is ${m.createdTimestamp - message.createdTimestamp}ms. API Latency is ${Math.round(client.ping)}ms`);
  110.     }
  111.    
  112.     /*
  113.     if(command === "say") {
  114.       // makes the bot say something and delete the message. As an example, it's open to anyone to use.
  115.       // To get the "message" itself we join the `args` back into a string with spaces:
  116.       const sayMessage = args.join(" ");
  117.       // Then we delete the command message (sneaky, right?). The catch just ignores the error with a cute smiley thing.
  118.       message.delete().catch(O_o=>{});
  119.       // And we get the bot to say the thing:
  120.       message.channel.send(sayMessage);
  121.     }
  122.     */
  123. /*
  124.     if(command === "kick") {
  125.       // This command must be limited to mods and admins. In this example we just hardcode the role names.
  126.       // Please read on Array.some() to understand this bit:
  127.       // https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/some?
  128.       if(!message.member.roles.some(r=>["ADMIN", "OWNER"].includes(r.name)) )
  129.         return message.reply("**Sorry, you don't have permissions to use this!**");
  130.      
  131.       // Let's first check if we have a member and if we can kick them!
  132.       // message.mentions.members is a collection of people that have been mentioned, as GuildMembers.
  133.       // We can also support getting the member by ID, which would be args[0]
  134.       let member = message.mentions.members.first() || message.guild.members.get(args[0]);
  135.       if(!member)
  136.         return message.reply("**Please mention a valid member of this server**");
  137.       if(!member.kickable)
  138.         return message.reply("**I cannot kick this user!**");
  139.      
  140.       // slice(1) removes the first part, which here should be the user mention or ID
  141.       // join(' ') takes all the various parts to make it a single string.
  142.       let reason = args.slice(1).join(' ');
  143.       if(!reason) reason = "**No reason provided**";
  144.      
  145.       // Now, time for a swift kick in the nuts!
  146.       await member.kick(reason)
  147.         .catch(error => message.reply(`**Sorry ${message.author} I couldn't kick because of : ${error}**`));
  148.       message.reply(`**${member.user.tag} has been kicked by ${message.author.tag} because: ${reason}**`);
  149.  
  150.     }
  151.     */
  152.  /*   if(command === "ban") {
  153.       if(!message.member.roles.some(r=>["Administrator"].includes(r.name)) )
  154.         return message.reply("**Sorry, you don't have permissions to use this!**");
  155.      
  156.       let member = message.mentions.members.first();
  157.       if(!member)
  158.         return message.reply("**Please mention a valid member of this server**");
  159.       if(!member.bannable)
  160.         return message.reply("**I cannot ban this user!**");
  161.  
  162.       let reason = args.slice(1).join(' ');
  163.       if(!reason) reason = "No reason provided";
  164.      
  165.       await member.ban(reason)
  166.         .catch(error => message.reply(`Sorry ${message.author} I couldn't ban because of : ${error}`));
  167.       message.reply(`**${member.user.tag} has been banned by ${message.author.tag} because: ${reason}**`);
  168.     }
  169.    
  170.     if(command === "purge") {
  171.       const deleteCount = parseInt(args[0], 10) + 1;
  172.      
  173.       if(!deleteCount || deleteCount < 1 || deleteCount > 100)
  174.         return message.reply("**Please provide a number between 2 and 100 for the number of messages to delete**");
  175.      
  176.       const fetched = await message.channel.fetchMessages({limit: deleteCount});
  177.       message.channel.bulkDelete(fetched)
  178.         .catch(error => message.reply(`**Couldn't delete messages because of: ${error}**`));
  179.     }
  180. */
  181.     if (command === "shopifydelays") {
  182.         amountdelays = message.content.split(" ");
  183.  
  184.         const delaysembed = new Discord.RichEmbed()
  185.         .setColor('#fa709a')
  186.         .setTitle('___**Recommended Shopify Delays for you**___')
  187.         .addField('Restocks: ', amountdelays[1] * 10000 / amountdelays[2])
  188.         .addField('Initial: ', amountdelays[1] * 3500 / amountdelays[2])
  189.          
  190.         .setTimestamp()
  191.         .setFooter('Juiced tools by matthew#1232', 'https://cdn.discordapp.com/attachments/582998102944907274/584911748650237962/twitter_icon.png');
  192.         console.log('Calculating delays of ' + amountdelays[1]);
  193.  
  194.         message.reply(delaysembed);
  195.  
  196.     }
  197.  
  198.     if (command === "help") {
  199.         //List of commands
  200.         return message.reply(helpEmbed);
  201.     }
  202.  
  203.     // Calculates fees of certain websites
  204.     if (command === "fees") {
  205.         amountfees = message.content.split(" ");
  206.  
  207.         // making the embed
  208.         const feesEmbed = new Discord.RichEmbed()
  209.         .setColor('#fa709a')
  210.         .setTitle('___**Fees of**___')
  211.         .addField('Stockx ', '$' + Math.ceil(amountfees[1] * 88.75) / 100)
  212.         .addField('Ebay ', '$' + Math.ceil(amountfees[1] * 90) / 100)
  213.         .addField('Grailed ', '$' + Math.ceil(amountfees[1] * 91) / 100)
  214.         .addField('Goat ', '$' + Math.ceil(amountfees[1] * 87.6) / 100)
  215.          
  216.         .setTimestamp()
  217.         .setFooter('Juiced tools by matthew#1232', 'https://cdn.discordapp.com/attachments/582998102944907274/584911748650237962/twitter_icon.png');
  218.         console.log('Calculating fees of ' + Math.ceil(amountfees[1]));
  219.  
  220.         message.reply(feesEmbed);
  221.  
  222.     }
  223.   /* if (command === "mute") {
  224.         let tomute = message.mentions.members.first() || message.guild.members.get(args[0]);
  225.         if (!tomute){
  226.             return message.reply("Couldn't find user");
  227.         }
  228.  
  229.         if (tomute.hasPermission("MANAGE_MESSAGES")){
  230.             return message.reply("**You do not have permissions to use this!**");
  231.         }
  232.  
  233.         let muterole = message.guild.roles.find('name', "muted");
  234.         if (!muterole){
  235.             try{
  236.                 muterole = await message.guild.createRole({
  237.                     name: "muted",
  238.                     color: "#000000"
  239.                 }
  240.                 message.guild.channels.forEach(async (channel, id) => {
  241.                         await channel.overwritePermissions(muterole, {
  242.                             SEND_MESSAGES: false,
  243.                             ADD_REACTIONS: false
  244.                         }
  245.  
  246.  
  247.                 })
  248.            
  249.             } catch(e){
  250.                 console.log(e.stack);
  251.             }
  252.  
  253.         }
  254.         let mutetime = args[1];
  255.         if(!mutetime){
  256.          return message.reply("You didn't specifiy a time!");
  257.         }
  258.  
  259.         await(tomute.addRole(muterole.id);
  260.         message.reply(`<@${tomute.id}> has been muted for ${ms(mutetime)}`);
  261.  
  262.         setTimeout(function(){
  263.             tomute.removeRole(muterole.id);
  264.             message.channel.send('**<@${tomute.id}> has been unmuted**');
  265.  
  266.         }, ms(mutetime));
  267.    }*/
  268.    
  269.   });
  270.  
  271.   client.login(config.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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top