fix: change usd type to integer

According to the webhook spec, it should be an integer, not a float.
This commit is contained in:
Sculas 2023-01-25 23:50:05 +01:00
parent d460078801
commit 3b5d20dc23
No known key found for this signature in database
GPG Key ID: 1530BFF96D1EEB89
2 changed files with 2 additions and 2 deletions

View File

@ -20,5 +20,5 @@ pub struct Sponsor {
#[derive(Debug, Deserialize)] #[derive(Debug, Deserialize)]
pub struct Tier { pub struct Tier {
pub monthly_price_in_dollars: f64, pub monthly_price_in_dollars: i64,
} }

View File

@ -2,7 +2,7 @@ pub struct Error(pub &'static str);
pub type Result<T> = std::result::Result<T, Error>; pub type Result<T> = std::result::Result<T, Error>;
pub async fn notify_discord(username: &str, profile_url: &str, usd_donated: f64) -> Result<()> { pub async fn notify_discord(username: &str, profile_url: &str, usd_donated: i64) -> Result<()> {
let webhook_url = std::env::var("DISCORD_WEBHOOK_URL").map_err(|_| Error("no-webhook-url"))?; let webhook_url = std::env::var("DISCORD_WEBHOOK_URL").map_err(|_| Error("no-webhook-url"))?;
let thread_id = std::env::var("DISCORD_WEBHOOK_TID").ok(); let thread_id = std::env::var("DISCORD_WEBHOOK_TID").ok();
let client = reqwest::Client::builder() let client = reqwest::Client::builder()