Advertisement
MrSolg

Bottle Bot

Apr 19th, 2019
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.16 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const { Client, Attachment } = require('discord.js');
  3. const { Client2, RichEmbed } = require('discord.js');
  4. const fetch = require('node-fetch');
  5. const client = new Discord.Client();
  6. client.on('ready', () => {
  7. console.log(`Logged in as ${client.user.tag}!`);
  8. });
  9.  
  10. const EventEmitter = require('events');
  11. class MyEmitter extends EventEmitter {}
  12. const myEmitter = new MyEmitter();
  13. // increase the limit
  14. myEmitter.setMaxListeners(15);
  15. for(let i = 0; i < 15; i++) {
  16. myEmitter.on('event', _ => console.log(i));
  17. }
  18. myEmitter.emit('event');
  19.  
  20. // No, currently our bot does *not* work with DMs, Karen.
  21. client.on('message', msg => {
  22. if (msg.channel.type == "dm") {
  23. msg.author.send("Bottle Bot currently **does not** support DMs. Please message me in a server!");
  24. }
  25. });
  26.  
  27. // heartbeat
  28. client.on('message', message => {
  29. if (message.content === '!!test') {
  30. message.channel.send('response')
  31. message.author.send('dm response');
  32. }
  33. });
  34.  
  35. // !help
  36. client.on('message', message => {
  37. if (message.content === '!!help') {
  38. message.channel.send("Check your DM's, " + message.author + "!")
  39. message.author.send('``` \n Bottle Bot Commands \n !!avatar - sends avatar link \n !!birds - sends an image from birdemic \n !!credits - shameless self promotion \n !!compliment - in case you need a pick me up \n --!!compliment.list - list of all possible reponses \n !!askbb - ask my opinion on things! \n --!!askbb.list - list of all possible reponses \n ```');
  40. }
  41. });
  42.  
  43. // !update
  44. client.on('message', message => {
  45. if (message.content === '!!update') {
  46. message.channel.send('```\n**Welcome to Bottle Bot 0.0.2!**\n\n--Changed prefix to "!!"\ntodo\n```')
  47. }
  48. });
  49. // Avatar Link
  50. client.on('message', message => {
  51. if (message.content === '!!avatar') {
  52. message.reply(message.author.avatarURL);
  53. }
  54. });
  55.  
  56. // "Birds"
  57. client.on('message', message => {
  58. if (message.content === '!!birds') {
  59. const attachment = new Attachment('https://cdn.discordapp.com/attachments/482382552208769046/566393869575651358/253242.png');
  60. message.channel.send('birds bro',attachment);
  61. }
  62. });
  63.  
  64. // Compliment
  65. client.on('message', message => {
  66. if (message.content === '!!compliment') {
  67. const helloResponses = ["Cutie", "Absolute Beaut", "Gobsmacking"];
  68. var response = helloResponses [Math.floor(Math.random()*helloResponses .length)];
  69. message.channel.send(response);
  70. }
  71. });
  72.  
  73. // askbb
  74. client.on('message', message => {
  75. if (message.content === '!!askbb') {
  76. const askbbResponses = ["Absolutely", "Very Possible", "Considerable", "On an Off Chance", "As much as you have in common with Jim Carrey", "No."];
  77. var response = askbbResponses [Math.floor(Math.random()*askbbResponses .length)];
  78. message.channel.send(response);
  79. }
  80. });
  81.  
  82. // Compliment.list
  83. client.on('message', message => {
  84. // If the message is "how to embed"
  85. if (message.content === '!!compliment.list') {
  86. const embed = new RichEmbed()
  87. .setTitle('List for `!!compliment`')
  88. // Set the color of the embed
  89. .setColor(0xadd9f4)
  90. // Set the main content of the embed
  91. .setDescription('Cutie\nAbsolute Beaut\nGobsmacking')
  92. // Set footer of the embed
  93. .setFooter ('Bottle Bot!');
  94. // Send the embed to the same channel as the message
  95. message.channel.send(embed);
  96. }
  97. });
  98.  
  99. // askbb.list
  100. client.on('message', message => {
  101. // If the message is "how to embed"
  102. if (message.content === '!!askbb.list') {
  103. const embed = new RichEmbed()
  104. .setTitle('List for `!!askbb`')
  105. // Set the color of the embed
  106. .setColor(0xadd9f4)
  107. // Set the main content of the embed
  108. .setDescription('Absolutely\nVery Possible\nConsiderable\nOn an Off Chance\nAs much as you have in common with Jim Carrey\nNo.')
  109. // Set footer of the embed
  110. .setFooter ('Bottle Bot!');
  111. // Send the embed to the same channel as the message
  112. message.channel.send(embed);
  113. }
  114. });
  115.  
  116. // Credits
  117. client.on('message', msg => {
  118. if (msg.content === '!!credits') {
  119. msg.channel.send('Solg#3436 for creating me, and Google Fonts for the Lobster Font in my logo!');
  120. }
  121. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement