story-kit: merge 310_story_bot_delete_command_removes_a_story_from_the_pipeline
This commit is contained in:
@@ -108,6 +108,11 @@ pub fn commands() -> &'static [BotCommand] {
|
||||
description: "Display the full text of a work item: `show <number>`",
|
||||
handler: handle_show,
|
||||
},
|
||||
BotCommand {
|
||||
name: "delete",
|
||||
description: "Remove a work item from the pipeline: `delete <number>`",
|
||||
handler: handle_delete_fallback,
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
@@ -624,6 +629,16 @@ fn handle_show(ctx: &CommandContext) -> Option<String> {
|
||||
))
|
||||
}
|
||||
|
||||
/// Fallback handler for the `delete` command when it is not intercepted by
|
||||
/// the async handler in `on_room_message`. In practice this is never called —
|
||||
/// delete is detected and handled before `try_handle_command` is invoked.
|
||||
/// The entry exists in the registry only so `help` lists it.
|
||||
///
|
||||
/// Returns `None` to prevent the LLM from receiving "delete" as a prompt.
|
||||
fn handle_delete_fallback(_ctx: &CommandContext) -> Option<String> {
|
||||
None
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Tests
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user