A Rust wrapper around the OpenTriviaQA database
This is a wrapper around the OpenTriviaQA database. This library has the questions built into the binary (they are ~8mb), so it's useful where other trivia libraries cannot function (e.g. WASM).
Code Example
let mut ctx = otqa::TriviaContext::new(false);
let question = ctx.get_question(otqa::Category::Animals, otqa::Seeding::Random);
println!("{}", question.question);
println!("Category: {:?}", question.category);
for answer in question.answers {
println!("{}", answer);
}
println!("Correct answer: {}", question.correct_answer);