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
use crate::embed;
use crate::databases;
use serenity::model::id::GuildId;
#[path = "./events.rs"] pub mod events;
pub struct Environment<'a> {
pub embed: Option<embed::Embed>,
pub database_manager: Box<dyn databases::DatabaseManager>,
pub guild_id: GuildId,
pub target: String,
pub attachments: Vec<String>,
pub event_info: events::EventType,
pub discord_context: &'a mut serenity::client::Context,
pub delete_option: Option<std::time::Duration>,
pub reactions_to_add: Vec<String>,
}
impl<'a> Environment<'a> {
pub fn new(event_info: events::EventType, guild_id: GuildId, context: &'a mut serenity::client::Context, db_manager: Box<dyn databases::DatabaseManager>) -> Self {
return Self {
embed: None,
target: String::new(),
database_manager: db_manager,
guild_id: guild_id,
attachments: Vec::new(),
event_info: event_info,
discord_context: context,
delete_option: None,
reactions_to_add: vec![],
};
}
}