Advertisement
Dgame321

Untitled

Oct 9th, 2019
5,693
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.81 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const client = new Discord.Client();
  3. var utils = require('./utils.js');
  4. var cmdList = require('./cmdList.json');
  5. var env = require('node-env-file');
  6. env(__dirname + '/.env');
  7.  
  8. // used to make a simple request to bot hosted on glitch
  9. const http = require('http');
  10. const express = require('express');
  11. const app = express();
  12.  
  13. // simple get request is sent every 4 mins as glitch
  14. // put apps to sleep for being inactive for 5 mins
  15. app.listen(8080);
  16. setInterval(() => {
  17. http.get(`http://${process.env.PROJECT_DOMAIN}.glitch.me/`);
  18. }, 290000);
  19.  
  20. // simple console log
  21. client.on('ready', () => {
  22. console.log(`Logged in as ${client.user.tag}!`);
  23. });
  24.  
  25. // when a message is sent bot will match it with some predefined messages
  26. // if message is detected then it'll respond
  27. client.on('message', msg => {
  28. // 0.5 second sleep as an instant responsefelt somewhat jarring
  29. utils.sleepFor(500)
  30. // switch cases of messages
  31. let msgContent = msg.content.toLowerCase()
  32. switch(msgContent){
  33. // lists commands
  34. case 'memebot help':
  35. var ttlList = cmdList.ttlList;
  36. var msglist = ""
  37. for(let i = 0 ; i < ttlList.length ; i ++){
  38. msglist += ttlList[i] + "\n"
  39. }
  40. msg.channel.send(msglist);
  41. break;
  42. case 'hello memebot':
  43. let user = msg.author.username + msg.author.discriminator;
  44. if (user === process.env.OWNER){
  45. msg.channel.send("Hello :)");
  46. } else if (user === process.env.ADMIN){
  47. msg.channel.send("https://giphy.com/gifs/animated-hello-waving-bcKmIWkUMCjVm");
  48. } else {
  49. msg.channel.send("You're not my owner :(");
  50. msg.channel.send("https://giphy.com/gifs/cute-baby-sand-mm4JjpQtOVLxe");
  51. }
  52. break;
  53. case 'memebot: on':
  54. msg.channel.send('https://i.imgur.com/mHJBtiY.png');
  55. msg.channel.send('What is my purpose?');
  56. break;
  57. case 'you post memes':
  58. msg.channel.send('https://imgur.com/VTIsPNF');
  59. break;
  60. case 'memebot freakout':
  61. msg.channel.send('https://media.giphy.com/media/DpB9NBjny7jF1pd0yt2/giphy.gif');
  62. break;
  63. case 'memebot nervous':
  64. msg.channel.send('https://giphy.com/gifs/bEVKYB487Lqxy');
  65. break;
  66. case "i'm a lady":
  67. msg.channel.send('https://giphy.com/gifs/going-out-im-a-lady-strutgif-2WEkVuHs2y8Du');
  68. break;
  69. case 'finger guns':
  70. msg.channel.send('https://giphy.com/gifs/stephen-colbert-finger-guns-television-2CcKiHPDsJqVi');
  71. break;
  72. case 'dupey':
  73. msg.channel.send('https://giphy.com/gifs/dat-ass-YxhOkgsnXdzxe');
  74. break;
  75. case 'zadnik':
  76. msg.channel.send('https://giphy.com/gifs/NwENlDgkgvaMM');
  77. break;
  78. case 'sweats':
  79. msg.channel.send('https://giphy.com/gifs/reactiongifs-LRVnPYqM8DLag');
  80. break;
  81. case 'burn':
  82. msg.channel.send('https://giphy.com/gifs/loop-xXvIkTu08XQLC');
  83. break;
  84. case 'do it':
  85. msg.channel.send('https://giphy.com/gifs/anakin-rjLINlGpJYvvO');
  86. break;
  87. case 'mlem':
  88. msg.channel.send('https://giphy.com/gifs/party-gecko-mlem-YhoruVAvQ5N6g');
  89. break;
  90. case 'blep':
  91. msg.channel.send('https://giphy.com/gifs/oRmdI7jb34gV2');
  92. break;
  93. case 'yas queen':
  94. msg.channel.send('https://media1.tenor.com/images/20a6f59e6593d7f6fc6ed4332ba27e9b/tenor.gif?itemid=10053937');
  95. break;
  96. case 'lenny face':
  97. msg.channel.send('( ͡° ͜ʖ ͡°)');
  98. break;
  99. case ':3c':
  100. msg.channel.send('https://i.pinimg.com/originals/bd/a0/b4/bda0b4db14b6bbf261f2bd94fd56b0ae.gif');
  101. break;
  102. case ':3':
  103. msg.channel.send('http://truegif.com/pictures/gif/8126.gif');
  104. break;
  105. case '>:3':
  106. msg.channel.send('https://78.media.tumblr.com/3abcdbf5dedcc88116d19d7e35f0c2f3/tumblr_p19njs04eK1tkjy51o1_500.gif');
  107. break;
  108. //---------------------------------------------------------------------------------------//
  109. // found
  110. case 'k':
  111. msg.channel.send('https://giphy.com/gifs/k-kermit-10sXTCdlsdKn8k');
  112. break;
  113. // found
  114. case 'hehehe':
  115. msg.channel.send('https://giphy.com/gifs/hehehe-hehehehe-9MFsKQ8A6HCN2');
  116. break;
  117. case 't h i c c':
  118. msg.channel.send('https://giphy.com/gifs/boi-thicc-bq95VzInIUDw4');
  119. break;
  120. case 'waifu':
  121. msg.channel.send('https://giphy.com/gifs/not-funny-NjyRlliJPoiNa');
  122. break;
  123. case 'kawaii desu':
  124. msg.channel.send('https://giphy.com/gifs/hyperrpg-game-animation-1gR4amyiLmg9yLjP03');
  125. break;
  126. case 'mic drop':
  127. msg.channel.send('https://giphy.com/gifs/mic-drop-peace-out-obama-3o7qDEq2bMbcbPRQ2c');
  128. break;
  129. // oops
  130. case 'boom':
  131. msg.channel.send('http://i.imgur.com/x0JOxZC.gifv');
  132. break;
  133. // found
  134. case 'smh':
  135. msg.channel.send('https://giphy.com/gifs/smh-13ATyLQB0rLVzG');
  136. break;
  137. // found
  138. case 'yaaas':
  139. msg.channel.send('https://giphy.com/gifs/kimpetras-kim-petras-l0HUokJsNfyZZzoTS');
  140. break;
  141. // found
  142. case 'wat':
  143. let meowuser = msg.author.username + msg.author.discriminator;
  144. if (meowuser !== "Meow2707"){
  145. msg.channel.send('https://giphy.com/gifs/truthorange-cat-surprised-what-angry-glare-xThuW4BaAA2f7nRvoc');
  146. }
  147. break;
  148. case 'bruh':
  149. msg.channel.send('https://giphy.com/gifs/NrqabhEpXWsGA');
  150. break;
  151. case 'whaaat':
  152. msg.channel.send('https://giphy.com/gifs/whaaaaaaat-IUp9WRHyCwUEg');
  153. break;
  154. case 'gasp':
  155. msg.channel.send('https://giphy.com/gifs/lenny-kravitz-penis-opinions-7GDNFQmWlwQvu');
  156. break;
  157. case 'are you fucking kidding me?':
  158. msg.channel.send('https://giphy.com/gifs/david-bowie-are-you-kidding-me-not-impressed-l2RaPhzQeY4ODghNK');
  159. break;
  160. // found
  161. case 'u wot m8':
  162. msg.channel.send('https://giphy.com/gifs/giggle-animaltext-avin-KC262P8sXA0qA');
  163. break;
  164. // found
  165. case 'owo':
  166. msg.channel.send('https://orig00.deviantart.net/3baf/f/2017/064/3/9/owo_intensifies_by_rikadoh-db197ad.gif');
  167. break;
  168. case 'triggered':
  169. msg.channel.send('https://giphy.com/gifs/vk7VesvyZEwuI');
  170. break;
  171. // found
  172. // case 'rip':
  173. // msg.channel.send('https://giphy.com/gifs/postmalone-music-video-post-malone-too-young-xTk9ZQKTCc1QLr29ri');
  174. // break;
  175. case 'salty':
  176. msg.channel.send('https://giphy.com/gifs/comments-trying-salty-kgFvhJziznlKg');
  177. break;
  178. // found
  179. case 'wut':
  180. msg.channel.send('https://giphy.com/gifs/pedro-no-ahora-porfavor-nios-en-crecimiento-tu54GM19sqJOw');
  181. break;
  182. case 'cool story bro':
  183. msg.channel.send('https://giphy.com/gifs/theroom-the-room-tommy-wiseau-l0HU2QpFqukBfMLD2');
  184. break;
  185. case "you're welcome":
  186. msg.channel.send('https://giphy.com/gifs/oscars-academy-awards-oscars-2017-l44Q5hp1dwIoZcGsw');
  187. break;
  188. case "nani?!":
  189. msg.channel.send('https://i.redd.it/xjo357eyc8m01.gif');
  190. break;
  191. case 'hello fellow kids':
  192. msg.channel.send('https://giphy.com/gifs/Os3obWs4ch54Y');
  193. break;
  194. // found
  195. // case '?':
  196. // msg.channel.send('https://giphy.com/gifs/life-germany-YVPwi7L2izTJS');
  197. // break;
  198. //---------------------------------------------------------------------------------------//
  199. case 'unlimited power':
  200. msg.channel.send('https://imgur.com/r/HighQualityGifs/cJlBUVL');
  201. break;
  202. case 'kazoo':
  203. msg.channel.send('https://giphy.com/gifs/fun-XOXdQszYm4I3m');
  204. break;
  205. case 'internalized oppression':
  206. msg.channel.send('https://media.giphy.com/media/WoXq3IHLd9BsY/giphy.gif');
  207. break;
  208. case 'internally oppressed':
  209. msg.channel.send('https://imgur.com/JiO3KvM');
  210. break;
  211. case 'make coffee':
  212. msg.channel.send("Error 418: I'm a teapot.");
  213. break;
  214. case 'skirr skirr':
  215. msg.channel.send("skeet skeet");
  216. break;
  217. // case 'skeet skeet':
  218. // msg.channel.send("skirr skirr");
  219. // break;
  220. //listens for "maff num+num"
  221. //\d+ = 1 or more digits in a continuous row
  222. //\s* = optional whitespace
  223. case (msgContent.match(/^(maff \d+\s*)[+*\/-](\s*\d+)$/) || {}).input:
  224. let numbers = msgContent.match(/(\d+\s*)[+*\/-](\s*\d+)/g);
  225. let sum = eval(numbers[0]).toString()
  226. msg.channel.send("The maff goes...");
  227. utils.sleepFor(1000)
  228. msg.channel.send("skrrrrrahh, pap, pap, KA KA KA");
  229. msg.channel.send("skidiki-pap-pap and a pu-pu-pudrrrrr BOOM");
  230. msg.channel.send("skkya du-du-ku DOON DOON");
  231. msg.channel.send("POOM POOM you don' know");
  232. msg.channel.send(numbers + " = " + sum);
  233. msg.channel.send("minus one thats " + (parseInt(sum) - 1));
  234. msg.channel.send("quick maffs");
  235. break;
  236. }
  237. });
  238. // login function
  239. client.login(process.env.TOKEN);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement