README
ainasepics
- Random anime gifs
Installation
npm i ainasepics
Information
- Want to help us get more gifs, images or more methods (type)?
- If yes, then go to this submit form and fill it! It might get added within 1 or 2 days if accepted.
Get started
Properties
Every function with needed parameters or options Returns .get('name-here') Promise<{ url: String }> .getMultiple({ name: 'name-here', limit: 5 }) Promise<{ results: Array<{ url: String }> }> Available names
These names are used for the .get method. Example: await ainasepics.get('name-here');
Names for gifs (Anime) Names for pictures (No anime) happy cat hi dog hug wolf kiss fox nervous pat punch run slap cry
Usage example:
const ainasepics = require("ainasepics")
ainasepics.get('pat')
.then(imageData => console.log(imageData.url)) // Logs an URL like https://i.ibb.co/V2xFxBn/pat-zt5v6.gif
.catch(err => console.error(err));
// imageData is this object:
/* {
url: String
}
*/
ainasepics.getMultiple({ name: 'cat', limit: 5 }) // Max limit is 12
.then(search => console.log(search.results))
.catch(err => console.error(err));
/* search.results is something like this:
[
{ url: 'https://i.ibb.co/42n36gJ/cat-Sm1-FS-min.jpg' },
{ url: 'https://i.ibb.co/Fw8BMfL/cat-aa-LCc-min.jpg' },
{ url: 'https://i.ibb.co/xs64xXF/cat-l-Y4r5-min.jpg' },
{ url: 'https://i.ibb.co/ZcLbpJ1/cat-b-ERIp-min.jpg' },
{ url: 'https://i.ibb.co/xs64xXF/cat-l-Y4r5-min.jpg' }
]
*/
Full usage example on discord.js
const Discord = require("discord.js");
const ainasepics = require("ainasepics");
const client = new Discord.Client({ intents: [
Discord.Intents.FLAGS.GUILDS
Discord.Intents.FLAGS.GUILD_MESSAGES
] });
client.on("messageCreate", async (message) => {
if (message.content.toLowerCase().startsWith(".pat")) {
let patGif = await ainasepics.get('pat');
const embed = new Discord.MessageEmbed()
.setTitle("Pat")
.setImage(patGif.url);
message.channel.send({ embeds: [embed] })
}
});
client.login("Your bot's token")
Disclaimer
- The package name is not because of a person, animal or any character; It is a name I invented based on my username.