From dec178a883769e221c8da3c125f83c6512b733e3 Mon Sep 17 00:00:00 2001 From: uku Date: Fri, 13 Oct 2023 18:31:21 +0200 Subject: move client & logic into api module --- src/api/guzzle.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'src/api/guzzle.rs') diff --git a/src/api/guzzle.rs b/src/api/guzzle.rs index b58f323..a13243d 100644 --- a/src/api/guzzle.rs +++ b/src/api/guzzle.rs @@ -1,4 +1,4 @@ -use once_cell::sync::Lazy; +use crate::api::REQWEST_CLIENT; use reqwest::StatusCode; use serde::{Deserialize, Serialize}; @@ -9,13 +9,6 @@ struct GuzzleResponse { const GUZZLE: &str = "https://api.mydadleft.me"; -pub static REQWEST_CLIENT: Lazy = Lazy::new(|| { - reqwest::Client::builder() - .user_agent("teawieBot/0.1.0") - .build() - .unwrap_or_default() -}); - pub async fn get_random_teawie() -> String { let endpoint = "get_random_teawie"; let req = REQWEST_CLIENT -- cgit v1.2.3