aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugin.rs
diff options
context:
space:
mode:
authorJokler <jokler.contact@gmail.com>2018-02-10 14:13:07 +0100
committerJokler <jokler.contact@gmail.com>2018-02-10 14:13:07 +0100
commit2ba26a37d27a637b7c0e02970419342a6f83462b (patch)
treec7d2323ddf7a0aa58d1b680200dc0acb9dad8558 /src/plugin.rs
parent1f69bfef7f2fd5fdc8787485d81461d68aa2d3ba (diff)
downloadfrippy-2ba26a37d27a637b7c0e02970419342a6f83462b.tar.gz
frippy-2ba26a37d27a637b7c0e02970419342a6f83462b.zip
Add evaluate function to plugins
This allows plugins to be used in combination with each other.
Diffstat (limited to 'src/plugin.rs')
-rw-r--r--src/plugin.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugin.rs b/src/plugin.rs
index d14c129..63d3530 100644
--- a/src/plugin.rs
+++ b/src/plugin.rs
@@ -13,6 +13,8 @@ pub trait Plugin: PluginName + Send + Sync + fmt::Debug {
fn execute(&self, server: &IrcServer, message: &Message) -> Result<(), IrcError>;
/// Handles any command directed at this plugin.
fn command(&self, server: &IrcServer, command: PluginCommand) -> Result<(), IrcError>;
+ /// Should work like command but return a String instead of sending messages to IRC.
+ fn evaluate(&self, server: &IrcServer, command: PluginCommand) -> Result<String, String>;
}
/// `PluginName` is required by `Plugin`.