Created
July 4, 2015 19:38
-
-
Save SkyzohKey/6e9d4f5b860fc5f8edc8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn init_tox() -> Tox | |
{ | |
// load Tox Profile | |
let mut xp: Vec<u8> = Vec::new(); | |
let mut tox = match Tox::new(ToxOptions::new(), match File::open(Path::new(HFB_PROFILE)) | |
{ | |
Ok(mut data) => | |
{ | |
data.read_to_end(&mut xp).ok().expect("[ERROR] Impossible de lire le profil."); | |
Some(&xp) | |
}, | |
Err(_) => None | |
}) | |
{ | |
Ok(t) => t, | |
Err(err) => panic!("[ERROR] Tox InitError: {:?}", err) | |
}; | |
let bootstrap_key = match BOOTSTRAP_KEY.parse() | |
{ | |
Ok(b) => b, | |
Err(_) => panic!("[ERROR] Erreur lors de la creation de la clef de bootstrap"), | |
}; | |
// config + bootstrap | |
tox.set_name("Hack-Free Bot").unwrap(); | |
tox.set_status_message("Développé par Skyzohkey et Ogromny").unwrap(); | |
tox.bootstrap(BOOTSTRAP_IP, BOOTSTRAP_PORT, bootstrap_key).unwrap(); | |
tox | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment