1.0.1 • Published 4 years ago
cat-img v1.0.1
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