Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/becoditive/random-jokes-api
This is an Npm Package that has many meme API calls from which you can make a meme bot.
https://github.com/becoditive/random-jokes-api
becoditive node-js node-module nodejs npm npm-module npm-package
Last synced: about 1 month ago
JSON representation
This is an Npm Package that has many meme API calls from which you can make a meme bot.
- Host: GitHub
- URL: https://github.com/becoditive/random-jokes-api
- Owner: beCoditive
- License: mit
- Created: 2021-02-24T12:05:37.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-24T04:47:49.000Z (over 3 years ago)
- Last Synced: 2024-11-08T16:50:05.315Z (about 1 month ago)
- Topics: becoditive, node-js, node-module, nodejs, npm, npm-module, npm-package
- Language: JavaScript
- Homepage:
- Size: 57.6 KB
- Stars: 5
- Watchers: 3
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Random Jokes Api
![npm bundle size](https://img.shields.io/bundlephobia/min/random-jokes-api)
![npm](https://img.shields.io/npm/v/random-jokes-api)## Bugs and glitches
Feel free to report all bugs and glitches by creating an issue in the [issue section](https://github.com/beCoditive/random-jokes-api/issues/new).A correct and understandable issue contains :
- Steps to reproduce
- Code that summonned the error
- The complete errorYou can also join me on my [discord server](https://discord/5JtJFEcZeP).
ou can download it from npmjs.
```cli
npm i random-jokes-api
```## Configuration
The first step is to import the module in your code.
```js
const Memer = require("random-jokes-api");
```Then you have to request a API call according to your choice.
```js
// Import the discord.js library.
const Discord = require("discord.js")
// Create a new discord.js client.
const bot = new Discord.Client()const Memer = require("random-jokes-api");
> You can also destructure to avoid repeating Memer.// Listen to the ready event
bot.on("ready", () => {
console.log("Ready!");
})// Listen to the message event
bot.on("message", async (message) => {
if (message.content === "joke") {
// Get the avatarUrl of the userlet jokes = Memer.joke()
message.channel.send(jokes)
}
})// Log in to the bot
bot.login("super_secret_token")
````# Available API Calls
- ``let jokes = Memer.joke()``
- ``let puns = Memer.pun()``
- ``let roast = Memer.roast()``
- ``let antijoke = Memer.antijoke()``
- ``let quotes = Memer.quotes()``
- ``let web = Memer.uselessweb()``
- ``let shower = Memer.showerThought()``
- ``let chuck = Memer.chuckNorris()``
- ``let trivia = Memer.trivia()``
- ``let compliment = Memer.compliement()``
- ``let truth = Memer.truth()``
- ``let dare = Memer.dare()``
# Image Generation
### Memes
```js
const Memer = require("random-jokes-api")const Discord = require("discord.js")
const bot = new Discord.Client()
// Listen to the ready event
bot.on("ready", () => {
console.log("Ready!");
})// Listen to the message event
bot.on("message", async (message) => {
if (message.content === "meme") {let meme = Memer.meme()
let embed = new Discord.MessageEmbed()
.setTitle(meme.title)
.setImage(meme.url)
.setFooter(`Categroy: ${meme.category}`)message.channel.send(embed)
}
})````