aboutsummaryrefslogtreecommitdiff
path: root/src/feature/mod.rs
blob: a52bb2c95bb5e77061907759f946e79a0718dbfe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use std::boxed::Box;

extern crate telegram_bot;
use telegram_bot::{Api, Message};

pub mod jisoku;
pub mod tasterank;

pub enum FeatureResult {
    Handled,
    Skip,
}

pub trait Feature {
    fn name(&self) -> &'static str;
    fn init(&mut self);
    fn handle(&mut self, Api, Message) -> Result<FeatureResult, String>;
}

pub fn init() -> Vec<Box<Feature>> {
    vec![Box::new(tasterank::Tasterank::new()), Box::new(jisoku::Jisoku::new())]
}