anime-crossing / man-chan

A collaborative effort between friends. Multipurpose Discord Bot written in Python.
MIT License
2 stars 1 forks source link

AniList Integration #6

Closed furlongi closed 7 months ago

furlongi commented 2 years ago

https://anilist.gitbook.io/anilist-apiv2-docs/

We want to retrieve info on our favorite anime. Most of us use AniList, which luckily has an API (and with very good documentation). Anilist uses graphql so take a peek in it. Anilist also has a playground to test your post requests.

Commands:

You will need to create tables that can fit all this information and learn how to make http requests for the api. We will be using sqlalchemy and alembic to interact with the database. I will look for a library for the http requests but if you find one then let me know.

ssumachai commented 1 year ago

I do a start after crimmas

ssumachai commented 1 year ago

Created initial embed, might have to make it a class method for the selection.

Still need to add aliases to commands, will do eventually

ssumachai commented 1 year ago

Got API requests to work, anime integrated with alias ani. Still need to do manga. Once anime and manga both work, using either function will invoke a selection menu, similar to how Karuta does lookup

ssumachai commented 1 year ago

implemented manga (alias man) and novel (alias nov). Had to subsequently deprecate original man greeting command. User Information next, utilizing SQLAlchemy and Alembic to keep userID and Anilist Profile

ssumachai commented 1 year ago
image
ssumachai commented 1 year ago

Actually scratch that, search embed is next, similar to how karuta does klu

image
ssumachai commented 1 year ago

@furlongi how would you like the search parameters to be presented?

Anime name (in bold) * Studio, is my suggestion

ssumachai commented 1 year ago
image image
ssumachai commented 1 year ago

DB Works!! I do however, need to clean up code immensely, as well as adding edge cases for the database, example if you already have an account linked

ssumachai commented 1 year ago

Just need to fix description with regex