Crate Command + Inline Commands
Crate Command
Command: ?crate crate_name
Purpose: Search https://crates.io for a crate and supply the link
Questions:
- Support for multiple crates?
Inline Commands
Purpose: Allow simple commands to be run inline, such as you might want to look at (?crate foo)
Questions:
- How many inline commands to allow?
- Format of the inline commands
- How should we output the commands? (all in one message for some commands, or all separate messages?)
Re Crate Command: You can already search through crates.io using the Mallard bot with @ddg !crates crate_name, but that links to the crates.io search page instead of linking to the actual crate. Thus this command should directly link to https://crates.io/crates/{crate_name}.
Another Suggestion:
Docsrs Command
Command: ?docs crate_name [query] or ?docsrs crate_name query
Similar to above @ddg !docsrs crate_name links to the search page of docs.rs instead of the actual crate's docs. The ?docsrs crate_name command should thus link directly to https://docs.rs/{crate_name}.
As further suggestion it would be cool if ?docsrs crate_name query would directly search the crate's docs.rs page for query and return the only match (if there is only one) or link to the search page otherwise.
Questions:
- Should the command error if there isn't a single match?
- Should the command always just return the first result?
Doc Command
Command: `?doc [version] query
Similar to the suggestion in the docsrs command, this should search the std's docs page (http://doc.rust-lang.org/std) for the query and return the only result or a link to the search page in case of multiple results.
Additionally one should be able to specify the version of std to use, e.g. ?doc nightly query which should link to http://doc.rust-lang.org/nightly/std.
Questions:
- Should the command error if there isn't a single match?
- Should the command always just return the first result?
Inline Commands
I have never seen this kind of feature in any discord bot, and while it's neat, the unfamiliarity and limited usefulness makes me think this feature is not worth it.
This example you might want to look at (?crate foo) could be easily done in two lines
you might want to look at
?crate foo
Which is more intuitive, quicker, unambiguous, and requires no further implementation work.