import { Command } from 'discord-akairo'; import { Message } from 'discord.js'; import * as EightBallResponses from '../../json/8ball.json' import { colour } from '../../Config'; export default class EightBallMinigames extends Command { public constructor() { super('8ball', { aliases: ['8ball', '8b', '8-ball', '8-b'], category: 'minigames', description: { content: 'Shake the magic 8 Ball for a fortune!', usage: '[question]', examples: [ 'will I ever get married?' ] }, ratelimit: 3 }); } public exec(msg: Message): Promise { let randomResponse = EightBallResponses.standard[Math.floor(Math.random() * EightBallResponses.standard.length)]; const embed = this.client.util.embed() .setColor(colour) .setAuthor('The 8-ball says', 'https://upload.wikimedia.org/wikipedia/commons/thumb/f/fd/8-Ball_Pool.svg/500px-8-Ball_Pool.svg.png') .setDescription(`\`${randomResponse}\``); return msg.channel.send(embed); } }