This commit is contained in:
MedzikUserBot 2022-02-27 10:39:28 +00:00
parent 461b53d681
commit 7598ba5293
2 changed files with 29 additions and 9 deletions

View File

@ -1,7 +1,7 @@
use colored::Colorize;
use chrono::{prelude::DateTime, Utc};
use std::time::{Duration, UNIX_EPOCH};
use colored::Colorize;
use imgurs::api::{rate_limit::rate_limit, ImgurClient};
use std::time::{Duration, UNIX_EPOCH};
pub async fn credits(client: ImgurClient) {
let i = rate_limit(client).await.expect("send api request");
@ -10,10 +10,30 @@ pub async fn credits(client: ImgurClient) {
let datetime = DateTime::<Utc>::from(date);
let timestamp_str = datetime.format("%Y-%m-%d %H:%M:%S").to_string();
println!("{} {}", "user limit".green(), i.data.user_limit.to_string().magenta());
println!("{} {}", "user remaining".green(), i.data.user_remaining.to_string().magenta());
println!("{} {} {}", "user reset".green(), timestamp_str.magenta(), "(UTC)".blue());
println!("{} {}", "client limit".green(), i.data.client_limit.to_string().magenta());
println!("{} {}", "client remaining ".green(), i.data.client_remaining.to_string().magenta());
println!(
"{} {}",
"user limit".green(),
i.data.user_limit.to_string().magenta()
);
println!(
"{} {}",
"user remaining".green(),
i.data.user_remaining.to_string().magenta()
);
println!(
"{} {} {}",
"user reset".green(),
timestamp_str.magenta(),
"(UTC)".blue()
);
println!(
"{} {}",
"client limit".green(),
i.data.client_limit.to_string().magenta()
);
println!(
"{} {}",
"client remaining ".green(),
i.data.client_remaining.to_string().magenta()
);
}

View File

@ -5,9 +5,9 @@ pub mod info_image;
pub mod parse;
pub mod upload_image;
use imgurs::api::ImageInfo;
use chrono::{prelude::DateTime, Utc};
use colored::Colorize;
use imgurs::api::ImageInfo;
use std::time::{Duration, UNIX_EPOCH};
pub fn print_image_info(i: ImageInfo) {