diff options
| author | Jokler <jokler.contact@gmail.com> | 2017-10-09 17:25:59 +0200 |
|---|---|---|
| committer | Jokler <jokler.contact@gmail.com> | 2017-10-11 15:41:32 +0200 |
| commit | ea3cd019142d2276ba9a6a9a3945143b18789873 (patch) | |
| tree | f359e24e50bef334ab5db715c6d21e240ac113ea /src/plugin.rs | |
| parent | b56541e40f3138d85a8f4f17453be30075f1dead (diff) | |
| download | frippy-ea3cd019142d2276ba9a6a9a3945143b18789873.tar.gz frippy-ea3cd019142d2276ba9a6a9a3945143b18789873.zip | |
Only expose the run function
Diffstat (limited to 'src/plugin.rs')
| -rw-r--r-- | src/plugin.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/plugin.rs b/src/plugin.rs index 62f4fbb..3791bf1 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -1,7 +1,6 @@ use std::fmt; use irc::client::prelude::*; use irc::error::Error as IrcError; -use PluginCommand; pub trait Plugin: Send + Sync + fmt::Display + fmt::Debug { fn is_allowed(&self, server: &IrcServer, message: &Message) -> bool; @@ -9,7 +8,13 @@ pub trait Plugin: Send + Sync + fmt::Display + fmt::Debug { fn command(&mut self, server: &IrcServer, command: PluginCommand) -> Result<(), IrcError>; } -#[macro_export] +#[derive(Clone, Debug)] +pub struct PluginCommand { + pub source: String, + pub target: String, + pub tokens: Vec<String>, +} + macro_rules! register_plugin { ($t:ident) => { use std::fmt; |
