UNPKG

nidhishpackage

Version:

This is a fun package for [Discord](https://discord.com) The library is [Discord.js](https://discord.js.org)

21 lines (17 loc) 584 B
async function getfact(options = {}) { const Fetch = require(`node-fetch`) const res = await Fetch("https://nekos.life/api/v2/fact"), json = await res.json(); if (!json.fact) throw new Error(`Something Went Wrong, Try Again Later!`); const Data = { embed: { color: options.Color || "RANDOM", description: json.fact, timestamp: new Date() } }; if (options.ResultOnly && options.ResultOnly === true) return { Result: json.fact }; return Data; }; module.exports = getfact