Need support? Click here
$ npm install anime-facts
const random = require("anime-facts");
const fact = random.getFacts(); // Returns id, fact, tags
console.log(fact);
const random = require("anime-facts");
const Discord = require("discord.js");
const client = new Discord.Client();
client.login("BOT_TOKEN");
client.on("message", async (message) => {
//Plain Text
if (message.content === "plain") {
const fact = random.getfact();
message.channel.send(fact);
}
//Embed Image (D.JS Version 11)
if (message.content === "embed") {
const fact = random.getfact();
const embed = new Discord.RichEmbed().setDescription(fact);
message.channel.send(embed);
}
//Embed Image (D.JS Version 12)
if (message.content === "embed") {
const fact = random.getfact();
const embed = new Discord.MessageEmbed().setDescription(fact);
message.channel.send(embed);
}
});
Functions | Description | Usage |
---|---|---|
getFact | Generate random anime facts. | random.getFact() |
@LamkasDev for adding facts to prior database.
@xMercyTheDeveloper for adding a fact to prior database.