aboutsummaryrefslogtreecommitdiff
path: root/src/feature/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/feature/mod.rs')
-rw-r--r--src/feature/mod.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/feature/mod.rs b/src/feature/mod.rs
new file mode 100644
index 0000000..5e00620
--- /dev/null
+++ b/src/feature/mod.rs
@@ -0,0 +1,23 @@
1use std::boxed::Box;
2use std::error::Error;
3
4extern crate telegram_bot;
5use telegram_bot::{Api, Message};
6
7pub mod jisoku;
8pub mod tasterank;
9
10pub enum FeatureResult {
11 Handled,
12 Skip,
13}
14
15pub trait Feature {
16 fn name(&self) -> &'static str;
17 fn init(&mut self);
18 fn handle(&mut self, Api, Message) -> Result<FeatureResult, String>;
19}
20
21pub fn init() -> Vec<Box<Feature>> {
22 vec![Box::new(tasterank::Tasterank::new()), Box::new(jisoku::Jisoku::new())]
23}