# anime-character-random

> Fetches Random Anime Characters For You

Latest version **1.0.14** (published 2022-08-17) · ISC license · 0 weekly downloads

## Install

```sh
npm install anime-character-random
pnpm add anime-character-random
yarn add anime-character-random
bun add anime-character-random
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.14 |
| Published | 2022-08-17 |
| First published | 2021-03-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 7.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Reuben Chagas fernandes |
| Maintainers | gco360full |
| Keywords | Anime-character, Anime-character-random, Random-anime-character |

## Links

- npm: https://www.npmjs.com/package/anime-character-random
- Repository: https://github.com/Reubencfernandes/anime-character-random
- Homepage: https://github.com/Reubencfernandes/anime-character-random#readme
- Issues: https://github.com/Reubencfernandes/anime-character-random/issues
- npm.io page: https://npm.io/package/anime-character-random

## Dependencies (2)

- [cheerio](https://npm.io/package/cheerio.md) ^1.0.0-rc.10
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.6.1

## Recent versions

- 1.0.14 (latest) — 2022-08-17
- 1.0.13 — 2022-08-14
- 1.0.12 — 2022-08-13
- 1.0.11 — 2021-12-25
- 1.0.10 — 2021-08-26
- 1.0.9 — 2021-08-25
- 1.0.8 — 2021-07-21
- 1.0.7 — 2021-07-05
- 1.0.6 — 2021-06-11
- 1.0.5 — 2021-04-22
- 1.0.4 — 2021-04-22
- 1.0.3 — 2021-03-21
- 1.0.2 — 2021-03-18
- 1.0.1 — 2021-03-18
- 1.0.0 — 2021-03-16

## README

# anime-character-random  1.0.13V
## This Package Fetches Random Anime Character For You

`npm install anime-character-random`

#### Here is An Example Code
```js
const randomChar = require('anime-character-random');
(async () => {
  console.log(await randomChar.GetChar())
})()
```
#### Will Display This 
```js
{
    AnimeName: 'Hikaru no Go',
    CharacterName: 'Fujisaki, Akari',
    CharacterImage: 'https://cdn.myanimelist.net/images/characters/15/28057.jpg',
    CharacterTag: [ 'Fujisaki', ' Akari' ],
    CharacterJapaneseName: '(藤崎 あかり)',
    OtherCharacterList: [
      'Fujiwara no, Sai',
      'Shindou, Hikaru',
      'Touya, Akira',
      'Waya, Yoshitaka',
      'Isumi, Shinichiro',
      'Ogata, Seiji',
      'Mitani, Yuki',
      'Kaga, Tetsuo',
      'Touya, Kouyou'
    ]
  }
```
### If you Are Using Discord.js Then Heres An Example Code For Version 14
```js
const { setTimeout } = require('node:timers/promises')
const randomChar = require('anime-character-random')
const { SlashCommandBuilder, EmbedBuilder, ActionRowBuilder, SelectMenuBuilder, ComponentType } = require('discord.js')
module.exports = {
  data: new SlashCommandBuilder().setName('animechar')
    .setDescription('Guess The Anime Character'),
  async execute (client, interaction) {
    const AnimeData = await randomChar.GetChar()
    const db = [AnimeData.OtherCharacterList[0], AnimeData.OtherCharacterList[1], AnimeData.OtherCharacterList[2], AnimeData.CharacterName]
    const list = db.sort(() => Math.random() - 0.5)
    await interaction.deferReply()
    const embed = new EmbedBuilder()
      .setTitle('Guess the anime character')
      .setAuthor({ name: interaction.user.username.toString(), iconURL: interaction.guild.iconURL() })
      .setDescription(`Anime Name : ${AnimeData.AnimeName}`)
      .setColor('#0763e3')
      .setFooter({ text: 'Reo || レオ Developed by Subarashi Studios', iconURL: client.user.avatarURL() })
      .setTimestamp()
      .setImage(AnimeData.CharacterImage)
      .setURL('https://reo-fernandes.herokuapp.com/')
    const row = new ActionRowBuilder()
      .addComponents(
        new SelectMenuBuilder()
          .setCustomId('select')
          .setPlaceholder('Select an Answer')
          .addOptions(
            {
              label: list[0],
              description: 'Choose The Correct Answer',
              value: list[0]
            },
            {
              label: list[1],
              description: 'Choose The Correct Answer',
              value: list[1]
            },
            {
              label: list[2],
              description: 'Choose The Correct Answer',
              value: list[2]
            },
            {
              label: list[3],
              description: 'Choose The Correct Answer',
              value: list[3]
            }
          )
      )
    await interaction.editReply({ content: 'You Have **30 Seconds** To answer', components: [row], embeds: [embed] })

    const filter = i => i.user.id === interaction.user.id

    const collector = interaction.channel.createMessageComponentCollector({ filter, componentType: ComponentType.SelectMenu, max: 1, time: 30000 })

    collector.on('collect', async i => {
      if (i.values[0] === AnimeData.CharacterName) {
        await interaction.editReply({ content: 'You have Answered **Correctly**', components: [] })
      } else {
        await interaction.editReply({ content: `You have Answered **Incorrectly**\n The correct answer is **${AnimeData.CharacterName}**`, components: [] })
      }
    })
    collector.on('end', async collected => {
      if (collected.size === 0) await interaction.editReply({ content: `Time's Up\n The correct answer is **${AnimeData.CharacterName}**`, components: [] })
    })
  }
}
```
## I Also Want To Thank 3ddelano For Helping Me Out
#### I created this package to use it for my personal projects You Are Free to Modify/Edit Its Source Code But You Cant Claim It To Be Yours

#### Support

[Discord](https://discord.gg/4ftQqQ6)
[github](https://github.com/gco360)

---
_Source: https://npm.io/package/anime-character-random · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
