1.0.5 • Published 5 years ago

catsndogs v1.0.5

Weekly downloads
5
License
MIT
Repository
github
Last release
5 years ago

catsndogs

Fetches a random image of a Dog or a Cat.
This is 'random-animal' but fixed.
My Discord: **MrScopes#5546**

Basic Usage

const random = require('catsndogs');

// Get a random image of a Cat via random.cat
random.cat().then(url => console.log(url)).catch(err => console.log(err.message));

// Get a random image of a Dog via random.dog 
random.dog().then(url => console.log(url)).catch(err => console.log(err.message));

Examples

  • discord.js | cat command (with handler)
const Discord = require('discord.js');

module.exports.run = async (client, message, args) => {
	const random = require('catsndogs');
	return await random.cat().then(url => message.channel.send(new Discord.Attachment(url, 'cat.jpg'))).catch();
}
  • discord.js | cat command (without handler)
const Discord = require('discord.js');

client.on('message', msg => {
	if (msg.content === 'cat') {
		return await random.cat().then(url => message.channel.send(new Discord.Attachment(url, 'cat.jpg'))).catch();
	}
});
1.0.5

5 years ago

1.0.6

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago