refactor: use config for max bot count

This commit is contained in:
Paul Makles
2023-10-16 09:21:48 +01:00
parent 0798e81862
commit 866ace3381

View File

@@ -1,3 +1,4 @@
use revolt_config::config;
use revolt_result::Result; use revolt_result::Result;
use ulid::Ulid; use ulid::Ulid;
@@ -79,9 +80,8 @@ impl Bot {
return Err(create_error!(IsBot)); return Err(create_error!(IsBot));
} }
// TODO: config let config = config().await;
let max_bot_count = 5; if db.get_number_of_bots_by_user(&owner.id).await? >= config.features.limits.default.bots {
if db.get_number_of_bots_by_user(&owner.id).await? >= max_bot_count {
return Err(create_error!(ReachedMaximumBots)); return Err(create_error!(ReachedMaximumBots));
} }