WarwickTabletop / tablebot

An extendable Discord bot framework written on top of `discord-haskell`
MIT License
4 stars 10 forks source link

Enhancing the cat command #26

Open L0neGamer opened 2 years ago

L0neGamer commented 2 years ago

The cat api allows for searching cats by breed, file type, category, amongst some other options. These can be seen on the left side of this site: https://docs.thecatapi.com/

A useful extension/change to the cat command (found in src/Tablebot/Plugins/Cats.hs) would allow a user to optionally filter for cats.

Example usages may be $cat breed bengal, $cat type gif, or $cat breed Abyssinian type gif. Exact syntax is up to you.

The three types of image are known ahead of time, so as long as the user correctly selects one of the three the command should work. The type is then added to the search query.
To search for pictures of a particular breed of cat, the program first needs to request the breeds and the ids associated with each, and then locate the id of the breed requested, which can then be added to the search query.

Multiple search options can be combined in the API, but it may be worth implementing basic forms that only work with one type of search query.

Additional options for syntax:

finnbar commented 2 years ago

You may want to look at how .netrunner search works, as you'll be able to use the parsing from that!