moover_rust/src/types.rs

29 lines
679 B
Rust
Raw Normal View History

// pub struct Data {}
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,
}
pub type Error = Box<dyn std::error::Error + Send + Sync>;
// replace () with Data if you ever need to store some additional data
pub type Context<'a> = poise::Context<'a, Data, Error>;
pub struct Track {
pub path: PathBuf,
pub name: OsString,
}