fix: don't exceed the max emoji limit by one

closes #295
This commit is contained in:
Amy
2023-12-06 21:19:10 -04:00
committed by Paul Makles
parent 25016efbc2
commit 09a848f5a6

View File

@@ -45,7 +45,7 @@ pub async fn create_emoji(
// Check that we haven't hit the emoji limit
let emojis = db.fetch_emoji_by_parent_id(&server.id).await?;
if emojis.len() > config.features.limits.default.server_emoji {
if emojis.len() >= config.features.limits.default.server_emoji {
return Err(create_error!(TooManyEmoji {
max: config.features.limits.default.server_emoji,
}));