botcat-capoo 1.0.3

A NapCat based QQ bot implemented in Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub mod poke;

use crate::{
    context::AppContext,
    error::Error,
    handler::poke::handle_poke,
    model::event::{BotEvent, NoticeEvent, NotifyEvent, PostEvent},
};

pub async fn handle_bot_event(ctx: &AppContext, event: BotEvent) -> Result<(), Error> {
    match event.to_owned().post_type {
        // notice.notify.poke
        PostEvent::Notice(NoticeEvent::Notify(NotifyEvent::Poke(e))) => {
            handle_poke(ctx, &event, &e).await
        }
        _ => Err(Error::from(crate::error::Unimplemented::new())),
    }
}