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-07-27 00:11:41 +00:00
|
|
|
use crate::Command;
|
2024-04-21 19:37:52 -04:00
|
|
|
|
2024-07-24 00:13:03 +00:00
|
|
|
#[derive(Debug, Subcommand)]
|
2024-06-23 09:55:51 +00:00
|
|
|
pub(super) enum CheckCommand {
|
|
|
|
AllUsers,
|
2024-04-21 19:37:52 -04:00
|
|
|
}
|
|
|
|
|
2024-07-27 00:11:41 +00:00
|
|
|
pub(super) async fn process(command: CheckCommand, context: &Command<'_>) -> Result<RoomMessageEventContent> {
|
2024-04-21 19:37:52 -04:00
|
|
|
Ok(match command {
|
2024-07-27 00:11:41 +00:00
|
|
|
CheckCommand::AllUsers => context.check_all_users().await?,
|
2024-04-21 19:37:52 -04:00
|
|
|
})
|
|
|
|
}
|