discordjs-facts

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

discordjs-facts

Facts in discord

unpublished
latest
Version
1.0.1
Version published
Maintainers
1
Created

discordjs-facts

Send easy an fact in discord

Installation

npm install discordjs-facts

Examples

const Discord = require('discord.js'); // Require discord.js
const RandomFact = require('discordjs-facts'); // Require RandomFact
const bot = new Discord.Client(); // Create client

const fact = new RandomFact({
    title: 'facts', // Title of the embed while displaying the game. Default: facts
    color: 'RANDOM', // Color of the embed. Default: RANDOM
    lang: 'en', // Custom the language for the embeds. Default: en
    footer: 'This is my custom footer', // Custom text for the embed title of the game over embed. Default: 'Game Over'
    subject: "dogs", // chose a category for the facts. Default: random
    thumbnail: 'https://www.gettyimages.be/gi-resources/images/500px/983794168.jpg', // A thumbnail at the embed. Remove this to remove the embed 
    embed: true, // remove rhis for your facts in text version without embed
  });

// Config

bot.config = {
    token: "TOKEN"
}

// Ready Event

bot.on('ready', () => {
    console.log(`Logged in as ${bot.user.tag}!`);
});

// Message Event

bot.on('message', message => {
    if (message.content.toLowerCase() === '!test') {
        message.reply("Test command work!")
    }

    else if (message.content.toLowerCase() === '!fact') {
        fact.newFact(message);
    }
})
 
// Login the bot
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

FAQs

Package last updated on 22 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts