8-ball-bot/index.js

30 lines
2.3 KiB
JavaScript
Raw Permalink Normal View History

2020-03-23 19:15:04 -07:00
const Discord = require('discord.js');
var quotes = ['It is certain', 'It is decidedly so', 'Without a doubt', 'Yes definitely', 'You may rely on it', 'As I see it yes', 'Most likely', 'Outlook good', 'Yes', 'Reply hazy, try again', 'Ask again later', 'Better not tell you now', 'Cannot predict now', 'Concentrate and ask again', 'Dont count on it', 'My reply is no', 'My sources say no', 'Outlook not so good', 'Very doubtful']
const bot = new Discord.Client();
2022-04-04 07:25:51 -07:00
const token = 'token_here';
2020-03-23 19:15:04 -07:00
bot.login(token);
bot.on('ready', () =>{
console.log('This bot is on')
});
2020-10-13 02:28:23 -07:00
bot.on('message', msg=>{
function randomQuote() {
return quotes[Math.floor(Math.random() * quotes.length)];
};
const prefix = "?";
if (msg.content.endsWith(prefix))
{
msg.reply(randomQuote());
2022-04-04 07:25:51 -07:00
}
if (msg.author.bot == false){
if (msg.content.includes("kill"))
{
msg.reply("My sources say there should be no killing of yourself or others, please call the suicide hotline 800-273-8255 to get help. You are loved");
}
}
2020-03-23 19:15:04 -07:00
});