AniSearch

AniSearch is an easy-to-use Discord bot written in Python that allows you to search for anime, manga, characters, staff, studios and much more directly in Discord and displays the results as paginated embeds!

You can also:

  • Search for a random anime or manga of a specific genre.
  • View the opening and ending themes of an anime.
  • View another user's profile with anime and manga stats from AniList, MyAnimeList or Kitsu.
  • Search for the anime or the source of an image.
  • View the next airing, and the most recently aired anime episodes.
  • View the latest anime related news from Anime News Network and Crunchyroll.

2e737667

✨ Commands

AniSearch's Command Prefix: as! | @AniSearch | Customizable

Parameters: <> - required, [] - optional, | - either/or

Do not include <>, [] or | when executing the command.

  • anime <title>: Searches for an anime with the given title and displays information about the search results such as type, status, episodes, description, and more!

    Anime Example
  • manga <title>: Searches for a manga with the given title and displays information about the search results such as type, status, chapters, description, and more!

    Manga Example
  • character <name>: Searches for a character with the given name and displays information about the search results such as description, synonyms, and appearances!

    Character Example
  • staff <name>: Searches for a staff with the given name and displays information about the search results such as description, staff roles, and character roles!

    Staff Example
  • studio <name>: Searches for a studio with the given name and displays information about the search results such as the studio productions!

    Studio Example
  • random <anime|manga> <genre>: Displays a random anime or manga of the specified genre.

  • themes <anime>: Searches for the openings and endings of the given anime and displays them.

  • theme <OP|ED> <anime>: Displays a specific opening or ending of the given anime.

Profile

  • anilist [username|@member]: Displays information about the given AniList profile such as anime stats, manga stats and favorites.

  • myanimelist [username|@member]: Displays information about the given MyAnimeList profile such as anime stats, manga stats and favorites.

  • kitsu [username|@member]: Displays information about the given Kitsu profile such as anime stats, manga stats and favorites!

  • setprofile <al|mal|kitsu> <username>: Sets an AniList, MyAnimeList or Kitsu profile.

  • profiles [@member]: Displays the set profiles of you, or the specified user.

  • removeprofiles: Removes the set AniList, MyAnimeList and Kitsu profile.

Image

  • trace <image-url|with image as attachment>: Tries to find the anime the image is from through the image url or the image as attachment.

  • source <image-url|with image as attachment>: Tries to find the source of an image through the image url or the image as attachment.

Schedule

  • next: Displays the next airing anime episodes.

  • last: Displays the most recently aired anime episodes.

News

  • aninews: Displays the latest anime news from Anime News Network.

  • crunchynews: Displays the latest anime news from Crunchyroll.

Help

  • help [command]: Shows help or displays information about a command.

  • commands: Displays all commands.

  • about: Displays information about the bot.

  • stats: Displays statistics about the bot.

  • github: Displays information about the GitHub repository.

Settings

Can only be used by a server administrator.

  • setprefix <prefix>: Changes the current server prefix. Max 5 characters.

Admin

Can only be used by the bot owner.

  • status: Displays the current status of the bot.

  • load <cog>: Loads a cog.

  • unload <cog>: Unloads a cog.

  • reload <cog>: Reloads a cog.

  • reloadall: Reloads all cogs.

  • sysinfo: Displays basic information about the system on which the bot is currently running.

? Contribute

You have an idea or found a bug? Open a new issue with detailed explanation.

You want to write code and add new things or fix a bug?
First, please open a new issue so we can discuss the changes you want to make.
After that, it's just fork, clone to your computer, and when you're done, open a pull request!
Most of the code should be commented, and once you're in, you should understand how everything works.
For info, the bot still contains a lot of code from a very early version that can be rewritten.

? Running AniSearch

Self-hosting isn't fully supported and I don't recommend you to self-host the bot unless you want to contribute to the code.

That's why I would prefer if you don't run an instance of my bot and recommend everyone to use the official instance instead, which you can add it to your Discord server here!

Nevertheless, the installation steps are as follows:

Introduction

The bot and the associated admin panel can be run either as a Docker containers or manually. The admin panel can be accessed via port 5000 by default.

Requirements:

1. ⚙️ Set up the Bot

  1. Clone the repository.

    $ git clone https://github.com/IchBinLeoon/anisearch-discord-bot
    
  2. Change the working directory.

    $ cd anisearch-discord-bot
    
  3. Create a Discord Application.

  4. Rename .env.example to .env.

  5. Edit .env and fill in BOT_TOKEN, BOT_OWNER_ID and BOT_SAUCENAO_API_KEY.

    # The token the bot will use for auth with Discord.
    BOT_TOKEN=
    
    # The Discord ID of the user hosting the bot.
    BOT_OWNER_ID=
    
    # The SauceNAO API key. Is required for the `source` command.
    BOT_SAUCENAO_API_KEY=
    

2. Run

? Docker

  1. Make sure Docker and Docker-Compose are installed.

  2. Build the images and run the bot, admin panel and database.

    $ docker-compose up --build
    

? Manually

  1. To be able to use the bot you need to set up a PostgreSQL Database. Make sure the tables are set up correctly as shown below to successfully connect to your database. Type the following in your PSQL Tool:

    CREATE TABLE IF NOT EXISTS guilds (id bigint, prefix VARCHAR (5));
    CREATE TABLE IF NOT EXISTS users (id bigint, anilist VARCHAR (255), myanimelist VARCHAR (255), kitsu VARCHAR (255));
    
  2. Edit .env and change BOT_API_HOST and WEB_HOST to localhost or to the IP address of the device the bot and admin panel are running on. Also change the credentials for the Postgres database to match yours.

  3. Bot

    • Make sure you have Python 3.8 or higher.

    • Change the working directory.

      $ cd bot
      
    • Set up and activate a venv.

      $ python3 -m venv venv
      $ source venv/bin/activate # On macOS and Linux
      $ .\venv\Scripts\activate # On Windows
      
    • Install the requirements.

      $ python -m pip install -r requirements.txt
      
    • Run the bot.

      $ python -m anisearch
      
  4. Admin Panel

    • Make sure you have Go 1.16 or higher.

    • Change the working directory.

      $ cd web
      
    • Build the executable.

      $ go build .
      
    • Run the admin panel.

      $ ./web # On macOS and Linux
      $ web.exe # On Windows
      

GitHub

https://github.com/IchBinLeoon/anisearch-discord-bot