Add handler for 50001 Missing Access

This commit is contained in:
jude 2023-07-30 14:13:20 +01:00
parent e65429aa9c
commit 90df265114

View File

@ -592,27 +592,39 @@ WHERE
if let Err(e) = result { if let Err(e) = result {
if let Error::Http(error) = e { if let Error::Http(error) = e {
if let HttpError::UnsuccessfulRequest(http_error) = *error { if let HttpError::UnsuccessfulRequest(http_error) = *error {
if http_error.error.code == 50007 { match http_error.error.code {
error!( 10003 => {
"Reminder {} could not be sent as user has DMs disabled", error!(
self.id "Reminder {} could not be sent as channel does not exist",
); self.id
self.force_delete(pool).await; );
} else if http_error.error.code == 10003 { self.force_delete(pool).await;
error!( }
"Reminder {} could not be sent as channel does not exist", 10004 => {
self.id error!(
); "Reminder {} could not be sent as guild does not exist",
self.force_delete(pool).await; self.id
} else if http_error.error.code == 10004 { );
error!( self.force_delete(pool).await;
"Reminder {} could not be sent as guild does not exist", }
self.id 50001 => {
); error!(
self.force_delete(pool).await; "Reminder {} could not be sent as permissions are invalid",
} else { self.id
error!("HTTP Error sending reminder {}: {:?}", self.id, http_error); );
self.refresh(pool).await; self.force_delete(pool).await;
}
50007 => {
error!(
"Reminder {} could not be sent as user has DMs disabled",
self.id
);
self.force_delete(pool).await;
}
_ => {
error!("HTTP Error sending reminder {}: {:?}", self.id, http_error);
self.refresh(pool).await;
}
} }
} else { } else {
error!( error!(