Any Anime

NPM version

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 (message) => {

 /* Plain Image */
  if (message.content === "plain") {
     const anime = await anyanime.getAnime({ type: "png", number: 1 })
     message.channel.send({ embeds: [anime[0]] });
  }

  if (message.content === "plain") {
     const animeGif = await anyanime.getAnime({ type: "gif", number: 1 })
     message.channel.send({ embeds: [animeGif[0]] });
  }

 /* Embed Image (D.JS Version 13) */
  if (message.content === "embed") {
     const anime = await anyanime.getAnime({ type: "png", number: 1 })
     const embed = new Discord.MessageEmbed().setImage(anime[0]);
     message.channel.send({ embeds: [embed] });
  }
});

  if (message.content === "embed") {
     const animeGif = await anyanime.getAnime({ type: "gif", number: 1 })
     const embed = new Discord.MessageEmbed().setImage(animeGif[0]);
     message.channel.send({ embeds: [embed] });
  }
});

client.("TOKEN");

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 !

Huge Thanks To Pinterest for the images !