Get random anime images / pfp .
News
Anyanime API was hosted on heroku till now but now its getting paid so i will be moving it to vercel
Recent Changes
- AnyAnime now supports Gif's
- AnyAnime is now hosted on vercel
- The downtime will be completely dependend on vercel
However The npm package will be as it is so if you want better performance use the npm package instead of the api
Update
Anyanime anime() function is now updated
What will change ?
- The anime() function will now have async await
const anyanime = require("anyanime");
// Anime function
async function main() {
console.log(await anyanime.getAnime({}));
}
// Anime Gif function
async function main() {
console.log(await anyanime.getAnime({ type: "png", number: 10 }));
}
// Check for update
anyanime.checkUpdate(true);
Installation
npm install anyanime
Functions
const anyanime = require("anyanime");
// Get png anime image
anyanime.getAnime({ type: "png", number: 1 })
// Get anime Gif
anyanime.getAnime({ type: "gif", number: 10 })
// Check for update
anyanime.checkUpdate(true);
Using checkUpdate(true) - Search for new npm package updates on bot
startup!
Latest version will be displayed in console.
Database
Png images : 768
Gif images : 183
Usage
const anyanime = require("anyanime");
// Anime function
async function main() {
console.log(await anyanime.getAnime({ type: "png", number: 1 }));
}
// Anime Gif function
async function main() {
console.log(await anyanime.getAnime({ type: "gif", number: 1 }));
}
Discord Bot
const Discord = require("discord.js");
const client = new Discord.Client();
const anyanime = require("anyanime");
anyanime.checkUpdate(true);
client.log("messageCreate", async ( ) => {
/* Plain Image */
if ( .content === "plain") {
const anime = await anyanime.getAnime({ type: "png", number: 1 })
.channel.send({ embeds: [anime[0]] });
}
if ( .content === "plain") {
const animeGif = await anyanime.getAnime({ type: "gif", number: 1 })
.channel.send({ embeds: [animeGif[0]] });
}
/* Embed Image (D.JS Version 13) */
if ( .content === "embed") {
const anime = await anyanime.getAnime({ type: "png", number: 1 })
const = new Discord.MessageEmbed().setImage(anime[0]);
.channel.send({ embeds: [ ] });
}
});
if ( .content === "embed") {
const animeGif = await anyanime.getAnime({ type: "gif", number: 1 })
const = new Discord.MessageEmbed().setImage(animeGif[0]);
.channel.send({ embeds: [ ] });
}
});
client.login(" ");
AnyAnime Api
If you dont want to use the npm package you can use the api instead.
The installation is given in the readMe file !