2024-06-16 22:26:52 +00:00
|
|
|
mod commands;
|
|
|
|
|
2024-04-21 19:37:52 -04:00
|
|
|
use clap::Subcommand;
|
2024-06-16 22:26:52 +00:00
|
|
|
use conduit::Result;
|
2024-04-21 19:37:52 -04:00
|
|
|
use ruma::events::room::message::RoomMessageEventContent;
|
|
|
|
|
2024-06-16 22:26:52 +00:00
|
|
|
use self::commands::*;
|
2024-04-21 19:37:52 -04:00
|
|
|
|
|
|
|
#[cfg_attr(test, derive(Debug))]
|
|
|
|
#[derive(Subcommand)]
|
2024-06-23 09:55:51 +00:00
|
|
|
pub(super) enum CheckCommand {
|
|
|
|
AllUsers,
|
2024-04-21 19:37:52 -04:00
|
|
|
}
|
|
|
|
|
2024-06-23 09:55:51 +00:00
|
|
|
pub(super) async fn process(command: CheckCommand, body: Vec<&str>) -> Result<RoomMessageEventContent> {
|
2024-04-21 19:37:52 -04:00
|
|
|
Ok(match command {
|
2024-06-23 09:55:51 +00:00
|
|
|
CheckCommand::AllUsers => check_all_users(body).await?,
|
2024-04-21 19:37:52 -04:00
|
|
|
})
|
|
|
|
}
|