wordbox.js

0.1.2 • Public • Published

About

Word box can help you with generating quotes, jokes, puns, and more for your application. Word box has its own generating system which updates weekly and adds new quotes, puns, jokes and more!

Upcoming

  • Generating a unique code.
  • Word definitions.

Current features

.generateQuote() - Generates a quote.
  • .text - The quote.
  • .author - The author of the quote.

.generatePun() - Generates a pun.

  • .text - The pun.

.generateJoke() - Generates a joke.

  • .type - The type of the joke.
  • .prompt - The setup question.
  • .punchline - The punchline of the joke.

.generateRoast() - Generates a roast.

  • .text - The roast.

Here is an example code

This is an example where word box is being used in a discord bot. ```js const { Client, MessageEmbed } = require('discord.js'); const client = new Client(); const wordbox = require('wordbox.js');

client.once('ready', () => { console.log("Testing Bot Is Ready To Be Tested"); });

client.on('message', async message => { if(message.content.startsWith("!quote")){

let args = message.content.split(" ");
if(args){
  let quote = wordbox.generateQuote(args.join(" ").slice(6), message);
  let embed = new MessageEmbed()
  .setDescription(`Quote: ${quote.text}\n\nAuthor: ${quote.author}`)
  .setColor("BLUE");
  message.channel.send(embed);
}else{
  let quote = await wordbox.generateQuote();
  let embed = new MessageEmbed()
  .setDescription(`Quote: ${quote.text}\n\nAuthor: ${quote.author}`)
  .setColor("BLUE");
  message.channel.send(embed);
}

}else if(message.content === "!pun"){

let pun = await wordbox.generatePun();
let embed = new MessageEmbed()
.setDescription(pun.text)
.setColor("BLUE");
message.channel.send(embed);

}else if(message.content === "!joke"){

let joke = await wordbox.generateJoke();
let embed = new MessageEmbed()
.setDescription(`Joke type: ${joke.type}\nPromt Message: ${joke.prompt}\nPunchline: ${joke.punchline}`)
.setColor("BLUE");
message.channel.send(embed);

}else if(message.content === "!roast"){

let roast = await wordbox.generateRoast();
let embed = new MessageEmbed()
.setDescription(`${roast.text}`);
.setColor("BLUE");
message.channel.send(embed);

} });

client.login('TOKEN');

#### More features coming soon!

Readme

Keywords

none

Package Sidebar

Install

npm i wordbox.js

Weekly Downloads

2

Version

0.1.2

License

ISC

Unpacked Size

266 kB

Total Files

7

Last publish

Collaborators

  • arcle