Crates.io | mojos_api_madhouse |
lib.rs | mojos_api_madhouse |
version | 0.1.1 |
source | src |
created_at | 2022-08-17 10:08:11.845421 |
updated_at | 2022-08-17 10:38:25.584841 |
description | A collaction of simple functions to easily use a large ammount of random APIs! |
homepage | |
repository | https://github.com/BuyMyMojo/mojos_api_madhouse |
max_upload_size | |
id | 647346 |
size | 17,057 |
This is a library I made so I can intergreate more APIs in my discord bot's easily.
it is asynchronous and powered by Reqwest.
My main goal is to make an easy to use library for many things and have features for each type of api so you can have faster compile times/less dead code then what is necessary.
use mojos_api_madhouse::structs::{AnimechanRout, AnimechanResponse};
use mojos_api_madhouse::anime::animechan;
let output = animechan(AnimechanRout::Random, None, None).await?;
let quote: AnimechanResponse = output.except("No response from AnimeChan API").first().expect("There should always be an output!").to_owned();
println!("Your random quote: {}", quote.quote.unwrap_or(error.error.unwrap()));