1.0.1 • Published 4 years ago

cat-img v1.0.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
4 years ago

cat-img

Npm: npmjs.com/cat-img

cat-img is a easy way to get a picture of a cat

How hard to use?

It is very easy download the package npm install cat-img and require it in your code and use the simple function!

How to install

npm install cat-img

Example

This is how you use this package!

//requiring the npm package
const cat = require('cat-img');

//console logging the function

//picture
console.log(cat.getImg())

Discord bot example

//please read!
//you need discord.js v12 npm for this code example

//requiring the npm packages
const Discord = require('discord.js')
const client = new Discord.Client();
const cat = require('cat-img');

client.on('message', async message => {
  if (message.content.toLowerCase() === '!img') {
    const img = new Discord.MessageEmbed()
    .setTitle(`Cat IMG`)
    .setImage(cat.getImg())
    message.channel.send(img)
  }
})

client.login("TOKEN")

Functions

getImg() - Gets a random image of a cat

1.0.1

4 years ago

1.0.0

4 years ago