use tenorv2::{tenor, tenor_types::{MediaFilter, TenorError}, JsonValue}; pub async fn get_random_tenor_gif(tenor_response: JsonValue, limit: u8) -> Result { let index = rand::random::() % limit as usize; match tenor::get_gif_url(MediaFilter::gif, tenor_response) { Ok(urls) => Ok(urls[index].clone()), Err(e) => Err(e) } }