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

Conversation

blyxyas
Copy link
Member

@blyxyas blyxyas commented May 21, 2024

It was hard to find the Rust forge page dedicated to documenting triagebot's Zulip commands, and there was no help command.

With this PR, triagebot links to this page on unknown commands.

src/zulip.rs Outdated
Ok(Some(String::from("Unknown command")))
Ok(Some(String::from("Unknown command, check triagebot's documentation at <https://forge.rust-lang.org/triagebot/notifications.html>")))
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the brackets around the link needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's kinda the default formatting for links over the web, it's just a way to signify it. It isn't necessary for Zulip to parse it as a clickable link.

If it's too ugly I'll just modify it :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Why does this link to the notifications page? There are other features that accept Zulip commands, and I'm concerned it could be confusing for the user since it could imply that notifications are the only commands it accepts.

Copy link
Member Author

Choose a reason for hiding this comment

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

I was having problems finding the notifications page, so I didn't notice that that implementation is the one that also handles meetings. Should be fixed now (I added another message for manual triggers @ing triagebot)

Copy link
Contributor

@apiraino apiraino left a comment

Choose a reason for hiding this comment

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

apart from a small cosmetic nit, I think it 's reasonable as a stopgap solution. And, yes, better would be a help command (but that's a bit more work)

Comment on lines +192 to +198
_ => {
return Ok(Some(
String::from(
"Unknown command, check triagebot's documentation at https://forge.rust-lang.org/triagebot/index.html#common-command-summary"
)
))
}
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.

src/zulip.rs Outdated
}
}
next = words.next();
}

Ok(Some(String::from("Unknown command")))
Ok(Some(String::from("Unknown command, check triagebot's notifications documentation at https://forge.rust-lang.org/triagebot/notifications.html")))
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm still uncertain why this is linking to notifications, since there are other commands like "work" that are unrelated to those.

Also add link to unknown commands on manual trigger (atting triagebot on a group chat, instead of just on DMs)

Remove < & >

Change notifications links to index.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants