1use std::fmt::Debug;
2
3use async_trait::async_trait;
4
5use crate::{Error, commands::Context};
6
7#[async_trait]
8#[allow(unused)]
9pub trait CommandEventHandler {
10 type State: Debug + Clone + Send + Sync + 'static;
11 type Error: From<Error> + Clone + Debug + Send + Sync + 'static;
12
13 async fn get_prefix(
14 &self,
15 context: Context<Self::Error, Self::State>,
16 ) -> Result<Vec<String>, Self::Error>;
17
18 async fn command(&self, context: Context<Self::Error, Self::State>) -> Result<(), Self::Error> {
19 Ok(())
20 }
21
22 async fn no_command(
23 &self,
24 context: Context<Self::Error, Self::State>,
25 ) -> Result<(), Self::Error> {
26 Ok(())
27 }
28
29 async fn after_command(
30 &self,
31 context: Context<Self::Error, Self::State>,
32 ) -> Result<(), Self::Error> {
33 Ok(())
34 }
35
36 async fn error(
37 &self,
38 context: Context<Self::Error, Self::State>,
39 error: Self::Error,
40 ) -> Result<(), Self::Error> {
41 log::error!("{error:?}");
42
43 Ok(())
44 }
45}