feat: add caching to everything, should make all member interacts faster
This commit is contained in:
parent
3abbb8d485
commit
e901f3ed74
6 changed files with 40 additions and 4 deletions
|
@ -7,7 +7,7 @@ use serenity::{
|
|||
};
|
||||
use skynet_discord_bot::common::database::{db_init, DataBase};
|
||||
|
||||
use skynet_discord_bot::common::set_roles::committee::{db_roles_get};
|
||||
use skynet_discord_bot::common::set_roles::committee::db_roles_get;
|
||||
use skynet_discord_bot::{get_config, Config};
|
||||
use sqlx::{Pool, Sqlite};
|
||||
use std::{process, sync::Arc};
|
||||
|
@ -51,7 +51,7 @@ struct Handler;
|
|||
impl EventHandler for Handler {
|
||||
async fn cache_ready(&self, ctx: Context, guilds: Vec<GuildId>) {
|
||||
for guild in guilds {
|
||||
ctx.shard.chunk_guild(guild, Some(500), false, ChunkGuildFilter::None, None);
|
||||
ctx.shard.chunk_guild(guild, Some(2000), false, ChunkGuildFilter::None, None);
|
||||
}
|
||||
println!("Cache built successfully!");
|
||||
}
|
||||
|
@ -126,4 +126,4 @@ async fn cleanup(db: &Pool<Sqlite>, ctx: &Context, config: &Config) {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue