Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

small: Add documentation link on unknown commands #1815

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/zulip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,13 +189,19 @@ fn handle_command<'a>(
.map_err(|e| format_err!("Failed to await at this time: {e:?}"))
}
Some("docs-update") => return trigger_docs_update(message_data),
_ => {}
_ => {
return Ok(Some(
String::from(
"Unknown command, check triagebot's documentation at https://forge.rust-lang.org/triagebot/index.html#common-command-summary"
)
))
}
Comment on lines +192 to +198
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suspect ignoring text here was intentional. Perhaps @Mark-Simulacrum could elaborate on why it was done this way? I could guess to allow saying something like You can send messages to @**triagebot** to execute certain commands., and not get an error message that the word "to" is unexpected.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds like a plausible theory; it also seems like this is just duplicate effort - we'd presumably fall through regardless to the trailing error if there wasn't another command found in the message.

}
}
next = words.next();
}

Ok(Some(String::from("Unknown command")))
Ok(Some(String::from("Unknown command, check triagebot's documentation at https://forge.rust-lang.org/triagebot/index.html")))
}
}
})
Expand Down
Loading