This commit is contained in:
2026-02-28 12:43:07 +09:00
parent a875e39192
commit 9686e26cd6
4 changed files with 526 additions and 1 deletions

View File

@@ -194,6 +194,13 @@ enum Commands {
#[command(subcommand)]
command: PdsCommands,
},
/// Bot commands
#[command(alias = "b")]
Bot {
#[command(subcommand)]
command: BotCommands,
},
}
#[derive(Subcommand)]
@@ -220,6 +227,19 @@ enum NotifyCommands {
},
}
#[derive(Subcommand)]
enum BotCommands {
/// Start the bot (poll notifications and reply)
Start {
/// Poll interval in seconds
#[arg(short, long, default_value = "30")]
interval: u64,
/// Path to config.json
#[arg(short, long, default_value = "public/config.json")]
config: String,
},
}
#[derive(Subcommand)]
enum PdsCommands {
/// Check PDS versions
@@ -310,6 +330,13 @@ async fn main() -> Result<()> {
}
}
}
Commands::Bot { command } => {
match command {
BotCommands::Start { interval, config } => {
commands::bot::start(interval, &config).await?;
}
}
}
Commands::Pds { command } => {
match command {
PdsCommands::Version { networks } => {