Horje
how to make a discord.js 8 ball command Code Example
how to make a discord.js 8 ball command
const Discord = require("discord.js");

module.exports.run = async (bot, message, args) => {

	//!8ball <question fjdksf>
	if(!args[2]) return message.reply("Please ask a full question!");
	let replies = ["Yes.", "No.", "I don't know.", "Ask again later"];
	
	let result = Math.floor((Math.random() * replies.length));
	let question = args.slice(1).join(" ");
	
	let ballembed = new Discord.RichEmbed()
	.setAuthor(message.author.tag)
	.setColor("#FF9900")
	.addField("Question", question)
	.addField("Answer", replies[result]);
	
	message.channel.send(ballembed)	
}




Javascript

Related
date options js Code Example date options js Code Example
countTo add commas to number jquery Code Example countTo add commas to number jquery Code Example
js arrays check if there is intersection Code Example js arrays check if there is intersection Code Example
localstorage drop item Code Example localstorage drop item Code Example
first remove active class from classlist and append to current element using javascript Code Example first remove active class from classlist and append to current element using javascript Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11