Skip to content

This is an Npm Package that has many meme API calls from which you can make a meme bot.

License

Notifications You must be signed in to change notification settings

beCoditive/random-jokes-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 

Repository files navigation

Random Jokes Api

npm bundle size npm

Bugs and glitches

Feel free to report all bugs and glitches by creating an issue in the issue section.

A correct and understandable issue contains :

  • Steps to reproduce
  • Code that summonned the error
  • The complete error

You can also join me on my discord server.

Amandine support server

ou can download it from npmjs.

npm i random-jokes-api

Configuration

The first step is to import the module in your code.

const Memer = require("random-jokes-api");

Then you have to request a API call according to your choice.

// 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 user

        let 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

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)
    }
})

About

This is an Npm Package that has many meme API calls from which you can make a meme bot.

Topics

Resources

License

Stars

Watchers

Forks