summary refs log tree commit diff
path: root/src/system/types.rs
blob: bd1e40f31173c282e56fe760273c7ae2eb987825 (plain)
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
use regex::Regex;
use twilight_http::Client;
use twilight_gateway::Shard;
use twilight_model::id::{marker::UserMarker, Id};
use std::sync::Arc;
use tokio::sync::Mutex;

#[derive(Clone)]
pub struct Member {
    pub discord_token: String,
    pub message_pattern: Regex,
    pub shard: Arc<Mutex<Shard>>,
    pub client: Arc<Mutex<Client>>,
}

#[derive(Clone)]
pub struct System {
    pub followed_user: Id<UserMarker>,
    pub command_prefix: String,
    pub members: Vec<Member>
}

#[derive(Clone)]
pub enum Response {
    Proxy {member: Member, content: String},
    Noop {delete_source: bool},
}

pub enum SystemThreadCommand {
    Restart,
    ReloadConfig,
    ShutdownSystem,
    ShutdownAll,
}