mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-04-20 01:08:55 +00:00
Update lots of dependencies
This commit is contained in:
parent
59551f1f6a
commit
3a9a252a1d
8 changed files with 370 additions and 395 deletions
736
Cargo.lock
generated
736
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -216,8 +216,8 @@ fn print_info_message<'a>(
|
|||
contest
|
||||
.start_time_seconds
|
||||
.as_ref()
|
||||
.map(|v| {
|
||||
let ts = Utc.timestamp(*v as i64, 0);
|
||||
.and_then(|v| Utc.timestamp_opt(*v as i64, 0).earliest())
|
||||
.map(|ts| {
|
||||
format!(
|
||||
" | from {} ({})",
|
||||
ts.format("<t:%s:F>"),
|
||||
|
|
|
@ -94,8 +94,11 @@ pub async fn watch_contest(
|
|||
};
|
||||
|
||||
if contest.phase == ContestPhase::Before {
|
||||
let start_time = match contest.start_time_seconds {
|
||||
Some(s) => chrono::Utc.timestamp(s as i64, 0),
|
||||
let start_time = match contest
|
||||
.start_time_seconds
|
||||
.and_then(|x| chrono::Utc.timestamp_opt(x as i64, 0).earliest())
|
||||
{
|
||||
Some(s) => s,
|
||||
None => {
|
||||
channel
|
||||
.send_message(ctx, |f| {
|
||||
|
|
|
@ -7,7 +7,7 @@ edition = "2021"
|
|||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
sqlx = { version = "0.5.13", features = ["runtime-tokio-rustls", "sqlite", "chrono", "offline"] }
|
||||
sqlx = { version = "0.6", features = ["runtime-tokio-rustls", "sqlite", "chrono", "offline"] }
|
||||
thiserror = "1.0.31"
|
||||
chrono = "0.4.19"
|
||||
futures-util = "0.3.21"
|
||||
|
|
|
@ -7,10 +7,10 @@ pub struct OsuUser {
|
|||
pub user_id: i64,
|
||||
pub id: i64,
|
||||
pub last_update: DateTime,
|
||||
pub pp_std: Option<f32>,
|
||||
pub pp_taiko: Option<f32>,
|
||||
pub pp_mania: Option<f32>,
|
||||
pub pp_catch: Option<f32>,
|
||||
pub pp_std: Option<f64>,
|
||||
pub pp_taiko: Option<f64>,
|
||||
pub pp_mania: Option<f64>,
|
||||
pub pp_catch: Option<f64>,
|
||||
/// Number of consecutive update failures
|
||||
pub failures: u8,
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ impl Announcer {
|
|||
user_id: UserId,
|
||||
channels: Vec<ChannelId>,
|
||||
mode: Mode,
|
||||
) -> Result<Option<f32>, Error> {
|
||||
) -> Result<Option<f64>, Error> {
|
||||
let days_since_last_update = (now - osu_user.last_update).num_days() + 1;
|
||||
let last_update = osu_user.last_update;
|
||||
let (scores, user) = {
|
||||
|
@ -153,7 +153,7 @@ impl Announcer {
|
|||
.await
|
||||
.pls_ok();
|
||||
});
|
||||
Ok(pp.map(|v| v as f32))
|
||||
Ok(pp)
|
||||
}
|
||||
|
||||
async fn scan_user(&self, u: &OsuUser, mode: Mode) -> Result<Vec<(u8, Score)>, Error> {
|
||||
|
|
|
@ -153,7 +153,7 @@ pub struct OsuUser {
|
|||
pub user_id: UserId,
|
||||
pub id: u64,
|
||||
pub last_update: DateTime<Utc>,
|
||||
pub pp: [Option<f32>; 4],
|
||||
pub pp: [Option<f64>; 4],
|
||||
/// More than 5 failures => gone
|
||||
pub failures: u8,
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ impl ToQuery for (&'static str, String) {
|
|||
|
||||
impl ToQuery for (&'static str, DateTime<Utc>) {
|
||||
fn to_query(&self) -> Vec<(&'static str, String)> {
|
||||
vec![(self.0, format!("{}", self.1.date().format("%Y-%m-%d")))]
|
||||
vec![(self.0, format!("{}", self.1.format("%Y-%m-%d")))]
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue