From: Erik Mackdanz Date: Mon, 23 Feb 2026 04:23:25 +0000 (-0600) Subject: Command starts with ! not / X-Git-Url: https://git.humopery.space/?a=commitdiff_plain;h=b884996ecbf44723aa9c9d439c46bbfe2b9ff83f;p=private%2Fmemberbot.git Command starts with ! not / --- diff --git a/README.md b/README.md index 0c42b43..328f0fd 100644 --- a/README.md +++ b/README.md @@ -66,16 +66,16 @@ DATABASE_URL=sqlite:memberbot.db 3. Available commands (admin only): - - `/help` - Show help message - - `/upsert ` - Upsert members from TSV data - - `/list` - List all members - - `/setadmin ` - Set a member as admin - - `/removeadmin ` - Remove admin status from a member - - `/verify ` - Verify a device for E2E encryption + - `!help` - Show help message + - `!upsert ` - Upsert members from TSV data + - `!list` - List all members + - `!setadmin ` - Set a member as admin + - `!removeadmin ` - Remove admin status from a member + - `!verify ` - Verify a device for E2E encryption -### TSV Format for `/upsert` +### TSV Format for `!upsert` -The `/upsert` command accepts tab-separated values (TSV) in the format: +The `!upsert` command accepts tab-separated values (TSV) in the format: ``` member_id email matrix_user (optional) diff --git a/src/bot.rs b/src/bot.rs index 8e4cc15..dc478a0 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -308,7 +308,7 @@ async fn handle_message( let message = text_content.body.trim(); // Check if message is a command - if !message.starts_with('/') { + if !message.starts_with('!') { return Ok(()); } @@ -325,36 +325,36 @@ async fn handle_message( // Handle commands match command { - "/help" => { + "!help" => { let help_text = r#"Available commands: -/help - Show this help message -/upsert - Upsert members from TSV data -/list - List all members -/setadmin - Set a member as admin -/removeadmin - Remove admin status from a member -/verify - Verify a device for E2E encryption +!help - Show this help message +!upsert - Upsert members from TSV data +!list - List all members +!setadmin - Set a member as admin +!removeadmin - Remove admin status from a member +!verify - Verify a device for E2E encryption "#; if let Err(e) = send_reply(&room, help_text).await { error!("Failed to send help reply: {}", e); } } - "/upsert" => { + "!upsert" => { handle_upsert_command(&room, args, &sender, db).await?; } - "/list" => { + "!list" => { handle_list_command(&room, &sender, db).await?; } - "/setadmin" => { + "!setadmin" => { handle_setadmin_command(&room, args, &sender, db, true).await?; } - "/removeadmin" => { + "!removeadmin" => { handle_setadmin_command(&room, args, &sender, db, false).await?; } - "/verify" => { + "!verify" => { handle_verify_command(&room, args, &sender, db).await?; } _ => { - let reply = format!("Unknown command: {}. Type /help for available commands.", command); + let reply = format!("Unknown command: {}. Type !help for available commands.", command); if let Err(e) = send_reply(&room, &reply).await { error!("Failed to send unknown command reply: {}", e); } @@ -714,4 +714,4 @@ async fn handle_sas_verification(_client: Client, sas: SasVerification) { } } } -} \ No newline at end of file +}