Files
discord-music-bot/src/state.rs
2025-04-20 00:49:17 +08:00

17 lines
647 B
Rust

// 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>>,
}