Last active
January 11, 2023 03:51
-
-
Save Enigo/11a1b5a8465e1c08f92de0b30949ff37 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async fn process_order(result: TheResult) { | |
let timestamp = DateTime::parse_from_rfc3339(&result.timestamp).unwrap(); | |
let for_last_minutes = 1; | |
let last_minute = Utc::now() - Duration::minutes(for_last_minutes); | |
let is_after = timestamp > last_minute; | |
if is_after { | |
info!("Newly listed land detected"); | |
let response = reqwest::get(ASSET_URL.to_owned() + &result.sell.data.id) | |
.await.unwrap().json::<Asset>() | |
.await; | |
match response { | |
Ok(asset) => { | |
// telegram_bot_sender will be called here | |
info!("{:?}", asset); | |
} | |
Err(e) => { | |
error!("Asset API response cannot be parsed! {}", e) | |
} | |
}; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment