Hebrew-package is a package about, trivia, jokes, and more function that wrote in Hebrew language.
npm install hebrew-packageThanks to @MyCool#4453 for helping me.
const hebrew = require("hebrew-package")
let trivia = hebrew.trivia({difficulty: , amount_of_options: ""}) `
Or
`let joke = hebrew.joke()`
The functions
The function for now:
`
trivia,
jokes
`
Code for example:
`
const Discord = require('discord.js');
const { Client, Intents } = require('discord.js')
const client = new Client({ intents: [Intents.FLAGS.DIRECT_MESSAGES, Intents.FLAGS.GUILDS] })
const prefix = "!";
const hebrew = require('hebrew-package');
client.on('ready', async () => {
console.log('ready');
})
client.on('message', async message => {
let args = message.content.slice(prefix.length).trim().split(/ +/);
let command = args.shift().toLocaleLowerCase();
//----------Trivia:
if(command === 'trivia'){
let trivia = hebrew.trivia({difficulty: "Easy", amount_of_options: "3"});
message.channel.send(The question:\n${trivia.question}\n\nThe options:\n${trivia.options.join('\n')});
}
//----------Jokes:
if(command === 'jokes'){
let jokes = hebrew.jokes();
message.channel.send(The joke:\n${jokes.joke}\n\n${jokes.punchline});
}
})
client.login("token");
``