animal-images-api
v0.0.2
Published
Es una api que te da imagenes del animal que elijas random.
Downloads
2
Maintainers
Readme
animal-images-api
Te envia una imagen de un animal especeficado random.
Instalación
npm instal --save animal-images-api
MODO DE USO:
//Tienes que poner el método async
const animal = require('animal-images-api')//definimos y requerimos el modulo
let img = await animal.el_animal_que_este_disponible()
console.log(img)
EJEMPLOS:
Zorro:
//Tienes que poner el método async
const animal = require('animal-images-api')
let img = await animal.zorro()
console.log(img)
Perro:
//Tienes que poner el método async
const animal = require('animal-images-api')
let img = await animal.perro()
console.log(img)
Pato:
//Tienes que poner el método async
const animal = require('animal-images-api')
let img = await animal.pato()
console.log(img)
Si lo quieres para Discord este es un ejemplo:
//Necesitas obviamente el package de discord.js
const animal = require('animal-images-api')
//En donde empiezas el evento message necesitas poner async: client.on('message', async message => {
// ^^^^^
const img = await guau.el_animal_que_quieres()
//Mediante un mensaje normal:
message.channel.send(img)
//Mediante un embed:
const embed = new Discord.MessageEmbed()
.setImage(img)
messge.channel.send(embed)