NaoTomori

by ZhongXiLu

GitHub Readme.md

Nao Tomori

Build Status

Basic Discord bot that pings you when a new anime episode or manga chapter is released, based on your MyAnimeList account. I couldn't find any bot that does this, so I wrote one my own.

This is just a personal bot, meaning it only servers one user at a time, so feel free to use it for yourself.

Currently it supports following sources:

Usage

Just set your MyAnimeList profile with the !setProfile command and you're good to go. For more information on the other commands, you can use !help or check the table below.

Name Description setProfile Set your MAL profile removeProfile Remove your MAL profile (you wont get pings then) getProfile Get a brief overview of your MAL profile setChannel Set the bot channel (where it will ping you) setPrefix Set the prefix of the bot ping Ping the bot help Get a list of all the commands with their description setAnimeSource Set the anime source for retrieving new anime setMangaSource Set the manga source for retrieving new manga

Setup

Local Setup

  1. Set up Discord application:

  2. Set up Postgresql database

    sudo -i -u postgres
    $ createuser <USER> -P --interactive
    $ createdb naotomori

    Also export the configuration as:

    export DATABASE_URL="dbname='naotomori' user=<DB_USER> host='localhost' password=<DB_PASSWORD>"
  3. Set up bot (make sure you are using python3.7 or greater):

    pip install -r requirements.txt
    export DISCORD_CLIENT_TOKEN=<TOKEN>
    python main.py

Heroku Setup

Alternatively, you can use Heroku to host the discord bot for free, there are already config files present, so the deployment should be easy:

Deploy

  1. Repeat step 1 from the Local Setup.
  2. Click the button above to create the app from a template
  3. Start your worker in the 'Resources' tab
  4. That's it! Your discord bot should be running 24/7 (it actually only runs 550 hours a month if you have the 'free' version, but you can increase this to 1000 hours if you link your credit card, making it run the entire month)

Tests

Run all unit tests:

python -m unittest -v