feat: ensure bot invites work correctly

This commit is contained in:
Paul Makles
2023-08-27 12:21:48 +01:00
parent c2412190a8
commit 73f7b8f007
13 changed files with 168 additions and 44 deletions

View File

@@ -88,6 +88,7 @@ pub enum ErrorType {
TooManyRoles {
max: usize,
},
AlreadyInServer,
// ? Bot related errors
ReachedMaximumBots,

View File

@@ -43,6 +43,7 @@ impl<'r> Responder<'r, 'static> for Error {
ErrorType::UnknownServer => Status::NotFound,
ErrorType::InvalidRole => Status::NotFound,
ErrorType::Banned => Status::Forbidden,
ErrorType::AlreadyInServer => Status::Conflict,
ErrorType::TooManyServers { .. } => Status::BadRequest,
ErrorType::TooManyEmoji { .. } => Status::BadRequest,