Initial code upload

This commit is contained in:
2025-04-20 00:49:17 +08:00
parent fe4f0aec41
commit 44170c8ae7
11 changed files with 827 additions and 0 deletions

17
src/state.rs Normal file
View File

@@ -0,0 +1,17 @@
// src/state.rs
use lavalink_rs::LavalinkClient;
use serenity::{http::Http, model::id::{GuildId, ChannelId}};
use tokio::sync::Mutex;
use std::{sync::Arc, collections::HashMap};
// BotState holds shared data accessible by different parts of the bot,
// like the Lavalink client and the Serenity HTTP client.
pub struct BotState {
pub lavalink: LavalinkClient,
// Need Http client to send messages from areas that don't have Context,
// like the Lavalink event handler.
pub http: Arc<Http>,
// Optional: Store announcement channels per guild for track announcements.
// pub announcement_channels: Mutex<HashMap<GuildId, ChannelId>>,
}