-
Notifications
You must be signed in to change notification settings - Fork 68
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
[Feature] Long help messages must be delivered over DM #1
Comments
I actually have a private version that does exactly this that I have been using with my personal Hubots. I will update the code a little bit to make this configurable and submit a PR when I get a chance. |
This makes sense to me, especially for adapters like IRC. Another idea I have thought about is to, for some adapters, using a pastebin service to upload the text of the help, and paste back to the user. Or, just use the http link like you mentioned. |
In my hubot, any help command w/o a query returns the web URL, but searches with a term will display the filter inline. There's no checking for number of lines in either case. You could do something like: "View the help documentation here.... Or send me a private message" I like the URL solution because when setup, it's usually faster than a PM. However, currently the URL doesn't support search terms which would also be a handy thing. |
I've implemented two of the mentioned solutions before. In case anyone is interested in a solution... (1) The link method may be achieved like so: module.exports = (robot) ->
robot.respond /help/i, (msg) ->
msg.message.done = true
msg.reply "Full list of commands available at URL HERE" The The regular expression used targets You may obtain the number of commands from Additionally, you can speed up the time it takes to populate the commands web page by caching the results. (2) I wrote two separate modules and made changes to a fork of Hubot that would allow long responses to be uploaded onto a paste service such as Pastebin. a. A general paste module (library and commands). It currently supports Pastebin and Dpaste, e.g. b. A long text filter module that checks if the response is longer than X and if so, it will use the paste module to upload the content and return the paste URL c. (b) relies on changes to be made on Hubot. I've not made any PR since I'm not sure if it's an efficient implementation or appropriate for Hubot's philosophy (design). Instead, I forked it. When Best of luck. |
You can use |
This all sounds pretty great, and is in line of what I had been thinking of. Can you file a PR with your filter changes to hubot? I took a quick look, and it reminds me of some of the work being done to add middleware to a few places in hubot over in hubotio/hubot#803 |
+1 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Is there any update on this? |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Problem: Your Hubot has many packages. When a user types
hubot help
, a flood wall of text fills up the channel, raising the ire of his/her coworkers.My simplest idea is that if the help text is more than a reasonable number (say, 20 lines), Hubot responds with "Sorry, I can't display that here. Try sending me a direct message of
help
and I'll get that for you."For cases where the bot is already exposed on a port (if using this script, it comes standard), the bot could alternatively respond with "See our help docs at http://some-hubot.herokuapp.com/hubot/help". This is less ideal, if only because not every set up has this working properly.
The better option would be to send the user a DM immediately upon asking for help (with a "No problem! Check your direct messages." message in the room). The trouble there would be working with how each adapter implemented sending private messages -- I don't think they all support
robot.send { user: some_user_object }, "MY MESSAGE"
. My initial thoughts went something like this, but I realized halfway through writing it that it is likely impractical to make this script aware of each adapter's DM methodology.I'm not certain how much of this should be configurable (Default to always sending a private message, or only if the help text is greater than
x
lines.)The text was updated successfully, but these errors were encountered: