All checks were successful
tests / fmt (push) Successful in 2m5s
tests / clippy (push) Successful in 2m29s
tests / pre-commit (push) Successful in 2m33s
tests / test (push) Successful in 2m44s
tests / build (push) Successful in 2m54s
deploy / release-image (push) Successful in 9m8s
38 lines
866 B
Rust
38 lines
866 B
Rust
use dashmap::DashMap;
|
|
use songbird::Songbird;
|
|
use std::sync::Arc;
|
|
use twilight_cache_inmemory::InMemoryCache;
|
|
use twilight_http::Client as HttpClient;
|
|
use twilight_model::id::{marker::GuildMarker, Id};
|
|
use twilight_standby::Standby;
|
|
|
|
pub(crate) type State = Arc<StateRef>;
|
|
|
|
#[derive(Debug)]
|
|
pub(crate) struct Settings {
|
|
pub(crate) loop_queue: bool,
|
|
}
|
|
|
|
impl Settings {
|
|
pub(crate) fn new() -> Self {
|
|
Self { loop_queue: false }
|
|
}
|
|
}
|
|
|
|
impl Default for Settings {
|
|
fn default() -> Self {
|
|
Self::new()
|
|
}
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub(crate) struct StateRef {
|
|
pub(crate) http: HttpClient,
|
|
pub(crate) cache: InMemoryCache,
|
|
pub(crate) songbird: Songbird,
|
|
pub(crate) standby: Standby,
|
|
pub(crate) guild_settings: DashMap<Id<GuildMarker>, Settings>,
|
|
pub(crate) pool: sqlx::SqlitePool,
|
|
pub(crate) client: reqwest::Client,
|
|
}
|