diff options
| author | Jokler <jokler.contact@gmail.com> | 2017-10-27 15:55:11 +0200 |
|---|---|---|
| committer | Jokler <jokler.contact@gmail.com> | 2017-10-27 15:55:11 +0200 |
| commit | 8b481420cd3c0dd02cb5671e753dc5ff4a40e7eb (patch) | |
| tree | 8d55f5bec15be9412a18083a42cee1cbdc48157f | |
| parent | afa5eb93e9e14b65e3c846e70e22c6134ca95f80 (diff) | |
| download | frippy-8b481420cd3c0dd02cb5671e753dc5ff4a40e7eb.tar.gz frippy-8b481420cd3c0dd02cb5671e753dc5ff4a40e7eb.zip | |
Move help into a Plugin
| -rw-r--r-- | src/lib.rs | 1 | ||||
| -rw-r--r-- | src/plugin.rs | 8 | ||||
| -rw-r--r-- | src/plugins/mod.rs | 1 |
3 files changed, 2 insertions, 8 deletions
@@ -65,6 +65,7 @@ pub fn run() { // The list of plugins in use let mut plugins = ThreadedPlugins::new(); + plugins.add(plugins::help::Help::new()); plugins.add(plugins::emoji::Emoji::new()); plugins.add(plugins::currency::Currency::new()); info!("Plugins loaded: {}", plugins); diff --git a/src/plugin.rs b/src/plugin.rs index d1a1f3d..e0a4ce2 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -121,10 +121,6 @@ impl ThreadedPlugins { return server.send_notice(&command.source, &help); } - if &command.tokens[0].to_lowercase() == "help" { - return self.send_help_message(server, &command); - } - // Check if the command is for this plugin if let Some(plugin) = self.plugins.get(&command.tokens[0].to_lowercase()) { @@ -151,10 +147,6 @@ impl ThreadedPlugins { server.send_notice(&command.source, &help) } } - - fn send_help_message(&self, server: &IrcServer, command: &PluginCommand) -> Result<(), IrcError> { - server.send_notice(&command.source, "Help has not been added yet.") - } } impl fmt::Display for ThreadedPlugins { diff --git a/src/plugins/mod.rs b/src/plugins/mod.rs index adf54b2..d07ead6 100644 --- a/src/plugins/mod.rs +++ b/src/plugins/mod.rs @@ -1,2 +1,3 @@ +pub mod help; pub mod emoji; pub mod currency; |
