how to make a discord js 8 ball command

Solutions on MaxInterview for how to make a discord js 8 ball command by the best coders in the world

showing results for - "how to make a discord js 8 ball command"
Simon
09 Jul 2017
1const Discord = require("discord.js");
2
3module.exports.run = async (bot, message, args) => {
4
5	//!8ball <question fjdksf>
6	if(!args[2]) return message.reply("Please ask a full question!");
7	let replies = ["Yes.", "No.", "I don't know.", "Ask again later"];
8	
9	let result = Math.floor((Math.random() * replies.length));
10	let question = args.slice(1).join(" ");
11	
12	let ballembed = new Discord.RichEmbed()
13	.setAuthor(message.author.tag)
14	.setColor("#FF9900")
15	.addField("Question", question)
16	.addField("Answer", replies[result]);
17	
18	message.channel.send(ballembed)	
19}
20