Rewrite setup

This commit is contained in:
Natsu Kagami 2020-09-03 17:56:02 -04:00
parent a8958a20f2
commit ff2626b656
Signed by: nki
GPG key ID: 73376E117CD20735

View file

@ -4,14 +4,11 @@ use std::path::Path;
/// Set up the prelude libraries.
///
/// Panics on failure: Youmubot should *NOT* attempt to continue when this function fails.
pub fn setup_prelude(db_path: &Path, data: &mut ShareMap, _: &mut StandardFramework) {
pub fn setup_prelude(db_path: &Path, data: &mut TypeMap, _: &mut StandardFramework) {
// Setup the announcer DB.
crate::announcer::AnnouncerChannels::insert_into(data, db_path.join("announcers.yaml"))
.expect("Announcers DB set up");
// Set up the HTTP client.
data.insert::<crate::HTTPClient>(reqwest::blocking::Client::new());
// Set up the reaction watcher.
data.insert::<crate::ReactionWatcher>(crate::ReactionWatcher::new());
data.insert::<crate::HTTPClient>(reqwest::Client::new());
}