discordjs-facts
Send easy an fact in discord
Installation
npm install discordjs-facts
Examples
const Discord = require('discord.js');
const RandomFact = require('discordjs-facts');
const bot = new Discord.Client();
const fact = new RandomFact({
title: 'facts',
color: 'RANDOM',
lang: 'en',
footer: 'This is my custom footer',
subject: "dogs",
thumbnail: 'https://www.gettyimages.be/gi-resources/images/500px/983794168.jpg',
embed: true,
});
bot.config = {
token: "TOKEN"
}
bot.on('ready', () => {
console.log(`Logged in as ${bot.user.tag}!`);
});
bot.on('message', message => {
if (message.content.toLowerCase() === '!test') {
message.reply("Test command work!")
}
else if (message.content.toLowerCase() === '!fact') {
fact.newFact(message);
}
})
bot.login(bot.config.token)
Available languages
- English -> en
- Nederlands -> nl (Dutch)
Available categories (Do not use caps)
- Cats
- Chickens
- Computer
- Covid
- Dogs
- Emoji
- Space