2.0.2 • Published 3 years ago

get-dadjoke v2.0.2

Weekly downloads
13
License
ISC
Repository
github
Last release
3 years ago

About

Get dad joke is a simple package that returns dad jokes from icanha's dad joke api

Instalation

npm install get-dadjoke

Example

const { Client } = require('discord.js');
const client = new Client();

const { getdadjoke } = require('get-dadjoke');


client.on('ready', () => {
    console.log(`${client.user.tag} has logged in!`)
})

client.on('message', async (msg) => {
    if(msg.content === 'joke') {
    
       const joke = await getdadjoke()
       
        msg.channel.send(joke);
    }
})

client.login('toek goes here');

The function is asynchronous because we need to wait for the api to return a joke, so not using async/await will end up in an empty message!

Found a bug

Create a new issue!

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago