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 = Lazy::new(|| { +pub static USER_AGENT: Lazy = Lazy::new(|| { let version = option_env!("CARGO_PKG_VERSION").unwrap_or("development"); + format!("teawieBot/{version}") +}); + +pub static REQWEST_CLIENT: Lazy = Lazy::new(|| { reqwest::Client::builder() - .user_agent(format!("{USER_AGENT}/{version}")) + .user_agent(format!("{:#?}", USER_AGENT)) .build() .unwrap_or_default() }); diff --git a/src/commands/version.rs b/src/commands/version.rs index c5e97f9..8d9a1f3 100644 --- a/src/commands/version.rs +++ b/src/commands/version.rs @@ -22,7 +22,7 @@ pub async fn version(ctx: Context<'_>) -> Result<()> { false, ), ("Revision:", &revision_url, false), - ("User Agent:", crate::api::USER_AGENT, false), + ("User Agent:", &crate::api::USER_AGENT, false), ]; ctx.send(|c| {