项目作者: amistaa

项目描述 :
:jp: Generate random anime images.
高级语言: JavaScript
项目地址: git://github.com/amistaa/random-anime.git
创建时间: 2020-03-20T19:52:17Z
项目社区:https://github.com/amistaa/random-anime

开源协议:MIT License

下载




Random Anime


NPM version

NPM downloads


Generate random anime images with a huge database.

Installation

  1. $ npm install random-anime

Usage

  1. const randomanime = require('random-anime')
  2. const anime = randomanime.anime()
  3. const nsfw = randomanime.nsfw()
  4. console.log(anime) /* https://anime.jpg */
  5. console.log(nsfw) /* https://nsfw.jpg */

Discord Bot

  1. const randomanime = require("random-anime");
  2. const Discord = require("discord.js");
  3. const client = new Discord.Client();
  4. client.on("message", async message => {
  5. /* Plain Text */
  6. if (message.content === "plain") {
  7. const anime = randomanime.anime();
  8. message.channel.send(anime);
  9. }
  10. /* Embed Image (D.JS Version 12) */
  11. if (message.content === "embed") {
  12. const anime = randomanime.anime();
  13. const embed = new Discord.MessageEmbed().setImage(anime);
  14. message.channel.send(embed);
  15. }
  16. });
  17. client.login("BOT_TOKEN");

Options

Options Description Usage
anime Random anime images. randomanime.anime()
nsfw Random NSFW anime images. randomanime.nsfw()

License

MIT © Amista