summaryrefslogtreecommitdiff
path: root/src/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/api')
-rw-r--r--src/api/mod.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/api/mod.rs b/src/api/mod.rs
index 2ce664e..d9eaef2 100644
--- a/src/api/mod.rs
+++ b/src/api/mod.rs
@@ -3,13 +3,15 @@ use once_cell::sync::Lazy;
pub mod guzzle;
pub mod shiggy;
-pub const USER_AGENT: &str = "teawieBot/";
-
-pub static REQWEST_CLIENT: Lazy<reqwest::Client> = Lazy::new(|| {
+pub static USER_AGENT: Lazy<String> = Lazy::new(|| {
let version = option_env!("CARGO_PKG_VERSION").unwrap_or("development");
+ format!("teawieBot/{version}")
+});
+
+pub static REQWEST_CLIENT: Lazy<reqwest::Client> = Lazy::new(|| {
reqwest::Client::builder()
- .user_agent(format!("{USER_AGENT}/{version}"))
+ .user_agent(format!("{:#?}", USER_AGENT))
.build()
.unwrap_or_default()
});