Blague.xyz
Blague.xyz is a package to get jokes and FML easily from the Blague.xyz API.
🇬🇧 Jokes/FML in english are supported
🇫🇷 Blagues/Vie de merde en français sont supportées
Installation
$ npm install --save blague.xyz
API Token
You need an API Key to send request to the Blague.xyz API. Click here to get one.
Usage example
Jokes/Blague
const { Client } = require("blague.xyz");
const joker = new Client("API token", {
defaultLang: "fr"
});
joker.randomJoke().then((joke) => {
console.log(joke.question);
console.log(joke.answer);
console.log(joke.toString());
console.log(joke.toDiscordSpoils());
console.log(joke.id);
});
joker.dailyJoke("en").then((joke) => {
console.log(joke.question);
console.log(joke.answer);
});
joker.getJoke(10, "fr").then((joke) => {
console.log(joke.question);
console.log(joke.answer);
});
joker.listJoke().then((list) => {
console.log(list);
});
FML/VDM
const Client = require("blague.xyz");
const joker = new Client("API token", {
defaultLang: "fr"
});
joker.randomVDM().then((vdm) => {
console.log(vdm.content);
});
joker.randomVDM("hot").then((vdm) => {
console.log(vdm.content);
});
joker.getVDM("normal", "en").then((fml) => {
console.log(fml.content);
});
joker.listVDM().then((list) => {
console.log(list);
});
Links