diff --git a/src/data.rs b/src/data.rs index 78ddb6d..78d415a 100644 --- a/src/data.rs +++ b/src/data.rs @@ -23,7 +23,7 @@ impl<'a> Message<'a> { } } -#[deriving(Decodable)] +#[deriving(Clone, Decodable)] pub struct Config { pub owners: Vec, pub nickname: String, diff --git a/src/lib.rs b/src/lib.rs index 34202a4..b268f32 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -23,6 +23,7 @@ pub trait Bot<'a> { fn send_privmsg(&self, chan: &str, msg: &str) -> IoResult<()>; fn identify(&self) -> IoResult<()>; fn output(&mut self) -> IoResult<()>; + fn config(&self) -> Config; } pub struct IrcBot<'a, T, U> where T: IrcWriter, U: IrcReader { @@ -161,6 +162,10 @@ impl<'a, T, U> Bot<'a> for IrcBot<'a, T, U> where T: IrcWriter, U: IrcReader { } Ok(()) } + + fn config(&self) -> Config { + self.config.clone() + } } fn process(msg: &str) -> IoResult<(&str, &str, Vec<&str>)> {