Add role hoisting / ranking.

Add bot creation for #8.
This commit is contained in:
Paul
2021-08-11 20:04:22 +01:00
parent e70f848f21
commit 084d71f050
18 changed files with 282 additions and 29 deletions

View File

@@ -44,6 +44,9 @@ pub enum Error {
InvalidRole,
Banned,
// ? Bot related errors.
ReachedMaximumBots,
// ? General errors.
TooManyIds,
FailedValidation {
@@ -98,6 +101,8 @@ impl<'r> Responder<'r, 'static> for Error {
Error::InvalidRole => Status::NotFound,
Error::Banned => Status::Forbidden,
Error::ReachedMaximumBots => Status::BadRequest,
Error::FailedValidation { .. } => Status::UnprocessableEntity,
Error::DatabaseError { .. } => Status::InternalServerError,
Error::InternalError => Status::InternalServerError,

View File

@@ -62,6 +62,8 @@ lazy_static! {
// Application Logic Settings
pub static ref MAX_GROUP_SIZE: usize =
env::var("REVOLT_MAX_GROUP_SIZE").unwrap_or_else(|_| "50".to_string()).parse().unwrap();
pub static ref MAX_BOT_COUNT: usize =
env::var("REVOLT_MAX_BOT_COUNT").unwrap_or_else(|_| "5".to_string()).parse().unwrap();
pub static ref EARLY_ADOPTER_BADGE: i64 =
env::var("REVOLT_EARLY_ADOPTER_BADGE").unwrap_or_else(|_| "0".to_string()).parse().unwrap();
}