wip bump versions

This commit is contained in:
jude
2023-12-22 19:11:39 +00:00
parent e7803b98e8
commit cce0de7c75
9 changed files with 850 additions and 535 deletions

View File

@ -405,7 +405,6 @@ WHERE
if fail_count >= 4 {
self.log_error(
pool,
"Failed to update 4 times and so is being deleted",
None::<&'static str>,
)
@ -428,12 +427,7 @@ WHERE
}
}
async fn log_error(
&self,
pool: impl Executor<'_, Database = Database> + Copy,
error: &'static str,
debug_info: Option<impl std::fmt::Debug>,
) {
async fn log_error(&self, error: &'static str, debug_info: Option<impl std::fmt::Debug>) {
let message = match debug_info {
Some(info) => format!(
"{}
@ -447,7 +441,7 @@ WHERE
error!("[Reminder {}] {}", self.id, message);
}
async fn log_success(&self, pool: impl Executor<'_, Database = Database> + Copy) {}
async fn log_success(&self) {}
async fn set_sent(&self, pool: impl Executor<'_, Database = Database> + Copy) {
sqlx::query!("UPDATE reminders SET `status` = 'sent' WHERE `id` = ?", self.id)
@ -640,7 +634,6 @@ WHERE
match http_error.error.code {
10003 => {
self.log_error(
pool,
"Could not be sent as channel does not exist",
None::<&'static str>,
)
@ -653,7 +646,6 @@ WHERE
}
10004 => {
self.log_error(
pool,
"Could not be sent as guild does not exist",
None::<&'static str>,
)
@ -663,7 +655,6 @@ WHERE
}
50001 => {
self.log_error(
pool,
"Could not be sent as missing access",
None::<&'static str>,
)
@ -672,7 +663,6 @@ WHERE
}
50007 => {
self.log_error(
pool,
"Could not be sent as user has DMs disabled",
None::<&'static str>,
)
@ -682,7 +672,6 @@ WHERE
}
50013 => {
self.log_error(
pool,
"Could not be sent as permissions are invalid",
None::<&'static str>,
)
@ -694,25 +683,21 @@ WHERE
.await;
}
_ => {
self.log_error(
pool,
"HTTP error sending reminder",
Some(http_error),
)
.await;
self.log_error("HTTP error sending reminder", Some(http_error))
.await;
self.refresh(pool).await;
}
}
} else {
self.log_error(pool, "(Likely) a parsing error", Some(error)).await;
self.log_error("(Likely) a parsing error", Some(error)).await;
self.refresh(pool).await;
}
} else {
self.log_error(pool, "Non-HTTP error", Some(e)).await;
self.log_error("Non-HTTP error", Some(e)).await;
self.refresh(pool).await;
}
} else {
self.log_success(pool).await;
self.log_success().await;
self.refresh(pool).await;
}
} else {