“Comando de pelota de JavaScript Discord Bot 8” Código de respuesta

Comando de pelota de JavaScript Discord Bot 8

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)	
}
Fellow osu! gamer (profile in desc)

Comando de pelota de JavaScript Discord Bot 8

//THIS METHOD USES THE BOTKIT-DISCORD CONNECTOR
//To get it, open the terminal, navigate to your bot's folder and do
//$ npm install --save botkit-discord

const discordBotkit = require('botkit-discord');

const configuration = {
    token: 'YOUR_DISCORD_TOKEN'
};

const discordBot = discordBotkit(configuration);

discordBot.hears('.*', 'mention', (bot, message) => {
	const responses = [
		"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",
		"Signs point to yes"
	];
	const randomIndex = Math.floor(Math.random() * responses.length);
	bot.reply(message, responses[randomIndex]);
});
Fellow osu! gamer (profile in desc)

Respuestas similares a “Comando de pelota de JavaScript Discord Bot 8”

Preguntas similares a “Comando de pelota de JavaScript Discord Bot 8”

Más respuestas relacionadas con “Comando de pelota de JavaScript Discord Bot 8” en JavaScript

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código