diff options
| author | Jokler <jokler.contact@gmail.com> | 2017-10-27 20:24:44 +0200 |
|---|---|---|
| committer | Jokler <jokler.contact@gmail.com> | 2017-10-27 20:24:44 +0200 |
| commit | 9d77de5e5d133b990983040b01cc0cb22b2f526b (patch) | |
| tree | c1fa9f77d42d679061038e8b7b5244bcd2d9a0df /src/plugins/help.rs | |
| parent | 2b943fa26f1d3c199cbc03e65c567e5c29887465 (diff) | |
| download | frippy-9d77de5e5d133b990983040b01cc0cb22b2f526b.tar.gz frippy-9d77de5e5d133b990983040b01cc0cb22b2f526b.zip | |
Add missing help plugin
Diffstat (limited to 'src/plugins/help.rs')
| -rw-r--r-- | src/plugins/help.rs | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/help.rs b/src/plugins/help.rs new file mode 100644 index 0000000..c4ddcd4 --- /dev/null +++ b/src/plugins/help.rs @@ -0,0 +1,34 @@ +use irc::client::prelude::*; +use irc::error::Error as IrcError; + +use plugin::*; + +#[derive(PluginName, Debug)] +pub struct Help; + +impl Help { + pub fn new() -> Help { + Help {} + } + + fn help(&self, server: &IrcServer, command: PluginCommand) -> Result<(), IrcError> { + server.send_notice(&command.source, "Help has not been added yet.") + } +} + +impl Plugin for Help { + fn is_allowed(&self, _: &IrcServer, _: &Message) -> bool { + false + } + + fn execute(&mut self, _: &IrcServer, _: &Message) -> Result<(), IrcError> { + panic!("Help does not implement the execute function!") + } + + fn command(&mut self, server: &IrcServer, command: PluginCommand) -> Result<(), IrcError> { + self.help(server, command) + } +} + +#[cfg(test)] +mod tests {} |
