2024-10-03 20:53:30 +00:00
|
|
|
// pub struct Data {}
|
|
|
|
|
2025-01-09 17:57:42 +00:00
|
|
|
use std::{ffi::OsString, path::PathBuf};
|
|
|
|
|
|
|
|
use serenity::prelude::TypeMapKey;
|
|
|
|
|
|
|
|
use reqwest::Client as HttpClient;
|
|
|
|
|
|
|
|
// TODO: this should be probably expanded also to be used by multiple servers and commands
|
|
|
|
// radio and spotify commands always create new HttpClient
|
|
|
|
pub struct HttpKey;
|
|
|
|
|
|
|
|
impl TypeMapKey for HttpKey {
|
|
|
|
type Value = HttpClient;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Data {
|
|
|
|
pub http_client: HttpClient,
|
|
|
|
}
|
|
|
|
|
2024-10-03 20:53:30 +00:00
|
|
|
pub type Error = Box<dyn std::error::Error + Send + Sync>;
|
|
|
|
// replace () with Data if you ever need to store some additional data
|
2025-01-09 17:57:42 +00:00
|
|
|
pub type Context<'a> = poise::Context<'a, Data, Error>;
|
|
|
|
|
|
|
|
pub struct Track {
|
|
|
|
pub path: PathBuf,
|
|
|
|
pub name: OsString,
|
|
|
|
}
|