cache
All checks were successful
Build / Build (push) Successful in 1m49s
Build / docker (push) Successful in 19s

This commit is contained in:
파링 2026-01-07 20:29:29 +09:00
parent e934da887f
commit 11f6f1edbf
Signed by: paring
SSH key fingerprint: SHA256:8uCHhCpn/gVOLEaTolmbub9kfM6XBxWkIWmHxUZoWWk
4 changed files with 26 additions and 3 deletions

View file

@ -11,6 +11,7 @@ use secrecy::ExposeSecret;
use serenity::{
Client,
all::{GatewayIntents, Token},
cache,
};
use sqlx::{migrate, postgres::PgPoolOptions};
use tracing::Level;
@ -53,18 +54,21 @@ async fn main() -> anyhow::Result<()> {
info!("migrated database");
let mut cache_settings = cache::Settings::default();
cache_settings.max_messages = 100;
let mut client = Client::builder(
Token::from_str(config.bot.token.expose_secret()).unwrap(),
GatewayIntents::GUILD_MESSAGES
| GatewayIntents::GUILD_MESSAGE_REACTIONS
| GatewayIntents::GUILDS
| GatewayIntents::GUILD_MESSAGES
| GatewayIntents::MESSAGE_CONTENT,
)
.event_handler(Arc::new(Handler {
db,
message_lock: Arc::new(DashMap::new()),
}))
.cache_settings(cache_settings)
.await
.expect("Err creating client");