{"size": 619, "ext": "js", "max_stars_repo_path": "commands/fun/8ball.js", "max_stars_repo_name": "pixelvoxelboxel/uwu-bot-public", "max_stars_repo_stars_event_min_datetime": "2021-02-27T22:47:55.000Z", "max_stars_repo_stars_event_max_datetime": "2021-10-08T01:09:31.000Z", "max_issues_repo_path": "commands/fun/8ball.js", "max_issues_repo_name": "pixelvoxelboxel/uwu-bot-public", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "commands/fun/8ball.js", "max_forks_repo_name": "pixelvoxelboxel/uwu-bot-public", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 3, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.5789473684, "max_line_length": 94, "alphanum_fraction": 0.6639741519}
const Discord = require("discord.js");
const useful_functions = require('../useful_functions.js')


module.exports = {
  name: "8ball",
  description: "What should you do? The magic 8ball shall help you!",
  async execute(message, args) {
    var url = `https://8ball.delegator.com/magic/JSON/${args.toString().replace(/,/g, ' ')}`;
    const qoutes_json = await useful_functions.getData(url);
    const magic = qoutes_json.magic
    const embed = new Discord.MessageEmbed()
    .setColor('#0099ff')
    .setTitle(magic.type)
    .setDescription(magic.answer);

    message.channel.send(embed);
  } 
}