Merge branch 'master' into feat/embed_improvements

This commit is contained in:
Paul Makles
2021-09-14 20:54:21 +01:00
committed by GitHub
37 changed files with 1049 additions and 882 deletions

View File

@@ -43,6 +43,9 @@ pub enum Error {
UnknownServer,
InvalidRole,
Banned,
TooManyServers{
max: usize,
},
// ? Bot related errors.
ReachedMaximumBots,
@@ -111,6 +114,7 @@ impl<'r> Responder<'r, 'static> for Error {
Error::UnknownServer => Status::NotFound,
Error::InvalidRole => Status::NotFound,
Error::Banned => Status::Forbidden,
Error::TooManyServers { .. } => Status::Forbidden,
Error::ReachedMaximumBots => Status::BadRequest,
Error::IsBot => Status::BadRequest,

View File

@@ -66,6 +66,8 @@ lazy_static! {
env::var("REVOLT_MAX_BOT_COUNT").unwrap_or_else(|_| "5".to_string()).parse().unwrap();
pub static ref MAX_EMBED_COUNT: usize =
env::var("REVOLT_MAX_EMBED_COUNT").unwrap_or_else(|_| "5".to_string()).parse().unwrap();
pub static ref MAX_SERVER_COUNT: usize =
env::var("REVOLT_MAX_SERVER_COUNT").unwrap_or_else(|_| "100".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();
}