Initial code upload
This commit is contained in:
17
src/state.rs
Normal file
17
src/state.rs
Normal 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>>,
|
||||
}
|
||||
Reference in New Issue
Block a user