Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- const client = new Discord.Client();
- var utils = require('./utils.js');
- var cmdList = require('./cmdList.json');
- var env = require('node-env-file');
- env(__dirname + '/.env');
- // used to make a simple request to bot hosted on glitch
- const http = require('http');
- const express = require('express');
- const app = express();
- // simple get request is sent every 4 mins as glitch
- // put apps to sleep for being inactive for 5 mins
- app.listen(8080);
- setInterval(() => {
- http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
- }, 290000);
- // simple console log
- client.on('ready', () => {
- console.log(`Logged in as ${client.user.tag}!`);
- });
- // when a message is sent bot will match it with some predefined messages
- // if message is detected then it'll respond
- client.on('message', msg => {
- // 0.5 second sleep as an instant responsefelt somewhat jarring
- utils.sleepFor(500)
- // switch cases of messages
- let msgContent = msg.content.toLowerCase()
- switch(msgContent){
- // lists commands
- case 'memebot help':
- var ttlList = cmdList.ttlList;
- var msglist = ""
- for(let i = 0 ; i < ttlList.length ; i ++){
- msglist += ttlList[i] + "\n"
- }
- msg.channel.send(msglist);
- break;
- case 'hello memebot':
- let user = msg.author.username + msg.author.discriminator;
- if (user === process.env.OWNER){
- msg.channel.send("Hello :)");
- } else if (user === process.env.ADMIN){
- msg.channel.send("https://giphy.com/gifs/animated-hello-waving-bcKmIWkUMCjVm");
- } else {
- msg.channel.send("You're not my owner :(");
- msg.channel.send("https://giphy.com/gifs/cute-baby-sand-mm4JjpQtOVLxe");
- }
- break;
- case 'memebot: on':
- msg.channel.send('https://i.imgur.com/mHJBtiY.png');
- msg.channel.send('What is my purpose?');
- break;
- case 'you post memes':
- msg.channel.send('https://imgur.com/VTIsPNF');
- break;
- case 'memebot freakout':
- msg.channel.send('https://media.giphy.com/media/DpB9NBjny7jF1pd0yt2/giphy.gif');
- break;
- case 'memebot nervous':
- msg.channel.send('https://giphy.com/gifs/bEVKYB487Lqxy');
- break;
- case "i'm a lady":
- msg.channel.send('https://giphy.com/gifs/going-out-im-a-lady-strutgif-2WEkVuHs2y8Du');
- break;
- case 'finger guns':
- msg.channel.send('https://giphy.com/gifs/stephen-colbert-finger-guns-television-2CcKiHPDsJqVi');
- break;
- case 'dupey':
- msg.channel.send('https://giphy.com/gifs/dat-ass-YxhOkgsnXdzxe');
- break;
- case 'zadnik':
- msg.channel.send('https://giphy.com/gifs/NwENlDgkgvaMM');
- break;
- case 'sweats':
- msg.channel.send('https://giphy.com/gifs/reactiongifs-LRVnPYqM8DLag');
- break;
- case 'burn':
- msg.channel.send('https://giphy.com/gifs/loop-xXvIkTu08XQLC');
- break;
- case 'do it':
- msg.channel.send('https://giphy.com/gifs/anakin-rjLINlGpJYvvO');
- break;
- case 'mlem':
- msg.channel.send('https://giphy.com/gifs/party-gecko-mlem-YhoruVAvQ5N6g');
- break;
- case 'blep':
- msg.channel.send('https://giphy.com/gifs/oRmdI7jb34gV2');
- break;
- case 'yas queen':
- msg.channel.send('https://media1.tenor.com/images/20a6f59e6593d7f6fc6ed4332ba27e9b/tenor.gif?itemid=10053937');
- break;
- case 'lenny face':
- msg.channel.send('( ͡° ͜ʖ ͡°)');
- break;
- case ':3c':
- msg.channel.send('https://i.pinimg.com/originals/bd/a0/b4/bda0b4db14b6bbf261f2bd94fd56b0ae.gif');
- break;
- case ':3':
- msg.channel.send('http://truegif.com/pictures/gif/8126.gif');
- break;
- case '>:3':
- msg.channel.send('https://78.media.tumblr.com/3abcdbf5dedcc88116d19d7e35f0c2f3/tumblr_p19njs04eK1tkjy51o1_500.gif');
- break;
- //---------------------------------------------------------------------------------------//
- // found
- case 'k':
- msg.channel.send('https://giphy.com/gifs/k-kermit-10sXTCdlsdKn8k');
- break;
- // found
- case 'hehehe':
- msg.channel.send('https://giphy.com/gifs/hehehe-hehehehe-9MFsKQ8A6HCN2');
- break;
- case 't h i c c':
- msg.channel.send('https://giphy.com/gifs/boi-thicc-bq95VzInIUDw4');
- break;
- case 'waifu':
- msg.channel.send('https://giphy.com/gifs/not-funny-NjyRlliJPoiNa');
- break;
- case 'kawaii desu':
- msg.channel.send('https://giphy.com/gifs/hyperrpg-game-animation-1gR4amyiLmg9yLjP03');
- break;
- case 'mic drop':
- msg.channel.send('https://giphy.com/gifs/mic-drop-peace-out-obama-3o7qDEq2bMbcbPRQ2c');
- break;
- // oops
- case 'boom':
- msg.channel.send('http://i.imgur.com/x0JOxZC.gifv');
- break;
- // found
- case 'smh':
- msg.channel.send('https://giphy.com/gifs/smh-13ATyLQB0rLVzG');
- break;
- // found
- case 'yaaas':
- msg.channel.send('https://giphy.com/gifs/kimpetras-kim-petras-l0HUokJsNfyZZzoTS');
- break;
- // found
- case 'wat':
- let meowuser = msg.author.username + msg.author.discriminator;
- if (meowuser !== "Meow2707"){
- msg.channel.send('https://giphy.com/gifs/truthorange-cat-surprised-what-angry-glare-xThuW4BaAA2f7nRvoc');
- }
- break;
- case 'bruh':
- msg.channel.send('https://giphy.com/gifs/NrqabhEpXWsGA');
- break;
- case 'whaaat':
- msg.channel.send('https://giphy.com/gifs/whaaaaaaat-IUp9WRHyCwUEg');
- break;
- case 'gasp':
- msg.channel.send('https://giphy.com/gifs/lenny-kravitz-penis-opinions-7GDNFQmWlwQvu');
- break;
- case 'are you fucking kidding me?':
- msg.channel.send('https://giphy.com/gifs/david-bowie-are-you-kidding-me-not-impressed-l2RaPhzQeY4ODghNK');
- break;
- // found
- case 'u wot m8':
- msg.channel.send('https://giphy.com/gifs/giggle-animaltext-avin-KC262P8sXA0qA');
- break;
- // found
- case 'owo':
- msg.channel.send('https://orig00.deviantart.net/3baf/f/2017/064/3/9/owo_intensifies_by_rikadoh-db197ad.gif');
- break;
- case 'triggered':
- msg.channel.send('https://giphy.com/gifs/vk7VesvyZEwuI');
- break;
- // found
- // case 'rip':
- // msg.channel.send('https://giphy.com/gifs/postmalone-music-video-post-malone-too-young-xTk9ZQKTCc1QLr29ri');
- // break;
- case 'salty':
- msg.channel.send('https://giphy.com/gifs/comments-trying-salty-kgFvhJziznlKg');
- break;
- // found
- case 'wut':
- msg.channel.send('https://giphy.com/gifs/pedro-no-ahora-porfavor-nios-en-crecimiento-tu54GM19sqJOw');
- break;
- case 'cool story bro':
- msg.channel.send('https://giphy.com/gifs/theroom-the-room-tommy-wiseau-l0HU2QpFqukBfMLD2');
- break;
- case "you're welcome":
- msg.channel.send('https://giphy.com/gifs/oscars-academy-awards-oscars-2017-l44Q5hp1dwIoZcGsw');
- break;
- case "nani?!":
- msg.channel.send('https://i.redd.it/xjo357eyc8m01.gif');
- break;
- case 'hello fellow kids':
- msg.channel.send('https://giphy.com/gifs/Os3obWs4ch54Y');
- break;
- // found
- // case '?':
- // msg.channel.send('https://giphy.com/gifs/life-germany-YVPwi7L2izTJS');
- // break;
- //---------------------------------------------------------------------------------------//
- case 'unlimited power':
- msg.channel.send('https://imgur.com/r/HighQualityGifs/cJlBUVL');
- break;
- case 'kazoo':
- msg.channel.send('https://giphy.com/gifs/fun-XOXdQszYm4I3m');
- break;
- case 'internalized oppression':
- msg.channel.send('https://media.giphy.com/media/WoXq3IHLd9BsY/giphy.gif');
- break;
- case 'internally oppressed':
- msg.channel.send('https://imgur.com/JiO3KvM');
- break;
- case 'make coffee':
- msg.channel.send("Error 418: I'm a teapot.");
- break;
- case 'skirr skirr':
- msg.channel.send("skeet skeet");
- break;
- // case 'skeet skeet':
- // msg.channel.send("skirr skirr");
- // break;
- //listens for "maff num+num"
- //\d+ = 1 or more digits in a continuous row
- //\s* = optional whitespace
- case (msgContent.match(/^(maff \d+\s*)[+*\/-](\s*\d+)$/) || {}).input:
- let numbers = msgContent.match(/(\d+\s*)[+*\/-](\s*\d+)/g);
- let sum = eval(numbers[0]).toString()
- msg.channel.send("The maff goes...");
- utils.sleepFor(1000)
- msg.channel.send("skrrrrrahh, pap, pap, KA KA KA");
- msg.channel.send("skidiki-pap-pap and a pu-pu-pudrrrrr BOOM");
- msg.channel.send("skkya du-du-ku DOON DOON");
- msg.channel.send("POOM POOM you don' know");
- msg.channel.send(numbers + " = " + sum);
- msg.channel.send("minus one thats " + (parseInt(sum) - 1));
- msg.channel.send("quick maffs");
- break;
- }
- });
- // login function
- client.login(process.env.TOKEN);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement