aboutsummaryrefslogtreecommitdiff
path: root/src/core/model.rs
blob: b2cefacda597ee1be2560ad7e73679172a6f3d1d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
use crate::core::api;
use crate::core::timers::TimerClient;
use crate::db::Database;
use serenity::client::bridge::gateway::ShardManager;
// use serenity::client::bridge::{
//     gateway::ShardManager,
//     voice::ClientVoiceManager
// };
// use serenity::model::id::{UserId, GuildId};
// use serenity::prelude::{Mutex, RwLock};
use serenity::model::id::UserId;
use serenity::prelude::Mutex;
// use serenity::voice;
use std::sync::Arc;
// use std::collections::HashSet;
use typemap::Key;
// use lavalink_rs::LavalinkClient;

pub struct Owner;
impl Key for Owner {
    type Value = UserId;
}

pub struct SerenityShardManager;
impl Key for SerenityShardManager {
    type Value = Arc<Mutex<ShardManager>>;
}

pub struct ApiClient;
impl Key for ApiClient {
    type Value = Arc<api::ApiClient>;
}

pub struct DB;
impl Key for DB {
    type Value = Arc<Database>;
}

pub struct TC;
impl Key for TC {
    type Value = Arc<Mutex<TimerClient>>;
}

// pub struct VoiceManager;
// impl Key for VoiceManager {
//     type Value = Arc<Mutex<ClientVoiceManager>>;
// }

// pub struct Lavalink;
// impl Key for Lavalink {
//     type Value = Arc<Mutex<LavalinkClient>>;
// }

// pub struct VoiceGuildUpdate;
// impl Key for VoiceGuildUpdate {
//     type Value = Arc<RwLock<HashSet<GuildId>>>;
// }