feat: send category
All checks were successful
Build / Build (push) Successful in 2m0s
Build / docker (push) Successful in 1m23s

This commit is contained in:
파링 2026-01-06 11:58:55 +09:00
parent 18eba1d443
commit e739c443ac
Signed by: paring
SSH key fingerprint: SHA256:8uCHhCpn/gVOLEaTolmbub9kfM6XBxWkIWmHxUZoWWk
7 changed files with 53 additions and 13 deletions

View file

@ -1,5 +1,6 @@
use std::{str::FromStr, sync::Arc};
use crate::{config::Config, handler::Handler};
use anyhow::Context;
use dashmap::DashMap;
use figment::{
@ -12,8 +13,7 @@ use serenity::{
all::{GatewayIntents, Token},
};
use sqlx::{migrate, postgres::PgPoolOptions};
use crate::{config::Config, handler::Handler};
use tracing::Level;
mod commands;
mod config;
@ -26,7 +26,7 @@ extern crate tracing;
#[tokio::main]
async fn main() -> anyhow::Result<()> {
tracing_subscriber::fmt::init();
let mut fmt = tracing_subscriber::fmt();
let figment = Figment::new()
.merge(Toml::file("config.toml"))
@ -34,6 +34,12 @@ async fn main() -> anyhow::Result<()> {
let config: Config = figment.extract()?;
if config.debug.unwrap_or(false) {
fmt = fmt.with_max_level(Level::DEBUG);
}
fmt.init();
info!("config: {config:?}");
let db = PgPoolOptions::new()
@ -49,7 +55,9 @@ async fn main() -> anyhow::Result<()> {
let mut client = Client::builder(
Token::from_str(config.bot.token.expose_secret()).unwrap(),
GatewayIntents::GUILD_MESSAGES | GatewayIntents::GUILD_MESSAGE_REACTIONS,
GatewayIntents::GUILD_MESSAGES
| GatewayIntents::GUILD_MESSAGE_REACTIONS
| GatewayIntents::GUILDS,
)
.event_handler(Arc::new(Handler {
db,