Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- const { Client, Attachment } = require('discord.js');
- const { Client2, RichEmbed } = require('discord.js');
- const fetch = require('node-fetch');
- const client = new Discord.Client();
- client.on('ready', () => {
- console.log(`Logged in as ${client.user.tag}!`);
- });
- const EventEmitter = require('events');
- class MyEmitter extends EventEmitter {}
- const myEmitter = new MyEmitter();
- // increase the limit
- myEmitter.setMaxListeners(15);
- for(let i = 0; i < 15; i++) {
- myEmitter.on('event', _ => console.log(i));
- }
- myEmitter.emit('event');
- // No, currently our bot does *not* work with DMs, Karen.
- client.on('message', msg => {
- if (msg.channel.type == "dm") {
- msg.author.send("Bottle Bot currently **does not** support DMs. Please message me in a server!");
- }
- });
- // heartbeat
- client.on('message', message => {
- if (message.content === '!!test') {
- message.channel.send('response')
- message.author.send('dm response');
- }
- });
- // !help
- client.on('message', message => {
- if (message.content === '!!help') {
- message.channel.send("Check your DM's, " + message.author + "!")
- 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 ```');
- }
- });
- // !update
- client.on('message', message => {
- if (message.content === '!!update') {
- message.channel.send('```\n**Welcome to Bottle Bot 0.0.2!**\n\n--Changed prefix to "!!"\ntodo\n```')
- }
- });
- // Avatar Link
- client.on('message', message => {
- if (message.content === '!!avatar') {
- message.reply(message.author.avatarURL);
- }
- });
- // "Birds"
- client.on('message', message => {
- if (message.content === '!!birds') {
- const attachment = new Attachment('https://cdn.discordapp.com/attachments/482382552208769046/566393869575651358/253242.png');
- message.channel.send('birds bro',attachment);
- }
- });
- // Compliment
- client.on('message', message => {
- if (message.content === '!!compliment') {
- const helloResponses = ["Cutie", "Absolute Beaut", "Gobsmacking"];
- var response = helloResponses [Math.floor(Math.random()*helloResponses .length)];
- message.channel.send(response);
- }
- });
- // askbb
- client.on('message', message => {
- if (message.content === '!!askbb') {
- const askbbResponses = ["Absolutely", "Very Possible", "Considerable", "On an Off Chance", "As much as you have in common with Jim Carrey", "No."];
- var response = askbbResponses [Math.floor(Math.random()*askbbResponses .length)];
- message.channel.send(response);
- }
- });
- // Compliment.list
- client.on('message', message => {
- // If the message is "how to embed"
- if (message.content === '!!compliment.list') {
- const embed = new RichEmbed()
- .setTitle('List for `!!compliment`')
- // Set the color of the embed
- .setColor(0xadd9f4)
- // Set the main content of the embed
- .setDescription('Cutie\nAbsolute Beaut\nGobsmacking')
- // Set footer of the embed
- .setFooter ('Bottle Bot!');
- // Send the embed to the same channel as the message
- message.channel.send(embed);
- }
- });
- // askbb.list
- client.on('message', message => {
- // If the message is "how to embed"
- if (message.content === '!!askbb.list') {
- const embed = new RichEmbed()
- .setTitle('List for `!!askbb`')
- // Set the color of the embed
- .setColor(0xadd9f4)
- // Set the main content of the embed
- .setDescription('Absolutely\nVery Possible\nConsiderable\nOn an Off Chance\nAs much as you have in common with Jim Carrey\nNo.')
- // Set footer of the embed
- .setFooter ('Bottle Bot!');
- // Send the embed to the same channel as the message
- message.channel.send(embed);
- }
- });
- // Credits
- client.on('message', msg => {
- if (msg.content === '!!credits') {
- msg.channel.send('Solg#3436 for creating me, and Google Fonts for the Lobster Font in my logo!');
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement