ivandardi / RustbotPython

A Discord bot for the Community Rust Language server, written in Python.
MIT License
16 stars 9 forks source link

Crate Command + Inline Commands #4

Open repnop opened 5 years ago

repnop commented 5 years ago

Crate Command

Command: ?crate crate_name Purpose: Search https://crates.io for a crate and supply the link Questions:

Inline Commands

Purpose: Allow simple commands to be run inline, such as you might want to look at (?crate foo) Questions:

oberien commented 5 years ago

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:

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:

kangalio commented 3 years ago

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.