My idea is to autocomplete commands and subcommands with help strings from hubot scripts.
I think it would be great to have this feature.
I'm looking for working on this, but I don't know where to start as I've never worked with meteor before.
Maybe someone can guide me a little bit ?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
I've found client/views/app/messagePopupConfig.coffee and client/views/app/messagePopupConfig.html where I copied popupSlashCommands parts, and added client/views/app/messagePopupHubotCommand.html
I think I begin to understand how popup complete works.
But now I want to silently send "help" message to every user connected, and store the response to build the hubot command collection.
Any idea on how to do this ?
@kernicpanel I've been thinking about this very idea. I don't think sending a message would be most efficient way of doing this. I think we need a method on the server hubot can call directly to register its methods.
So this would require an addition here in a package likely. Then in the adapter after connection gather commands and call the method to register the commands
I'd gladly collaborate on this with you. I'd love to have this functionality in
@geekgonecrazy Of course using help seems ugly, I've thinked about the same implementation as you.
But using help will allow autocompletion of any bot, as help is (almost?) always implemented in them.
I think it would be more flexible approach, and a far more interesting feature for Rocket.Chat.
@kernicPanel I would agree.. But any bot made for Rocket.Chat is going to have to have an adapter wrote for it. Its just one more call to write in the adapter.
This will also allow the bot reloading with more commands to tell Rocket.Chat it has more commands with out pinging it at some interval.
OK, I get your point.
Can you provide me some tech guidance to get this done ?
@kernicPanel alright i've started a bit on this.
https://github.com/RocketChat/Rocket.Chat/compare/bot-autocomplete
https://github.com/RocketChat/hubot-rocketchat/compare/send-autocomplete
I've got a bit left to do. Use the bots name as part of the autocomplete, as well as getting updated commands from the server when the bot informs it.
Thank you @geekgonecrazy I see how it works now.
@kernicPanel Feel free to contribute. :) let me know if you start working on it. I'll probably be working on it tomorrow again :)
@geekgonecrazy
Yes, I started, but I'm having trouble with basic things I guess.
But I'll continue to work on it, and learn from my mistakes.
I'm mot sure I'll be able to PR something for now.
Can I direct message you on demo.rocket.chat if I have precise questions ?
@kernicPanel @geekgonecrazy Are there any updates or alternative implementations of this?
@timgrossmann Afraid I haven't made any progress.
My idea was that we'd have a method the bot could call to register all of its methods. It should be fairly straight forward. Not exactly easy, but pretty straight forward.
We already have our hubot adapter able to call any method it has permission to. So this work would really be here on the server side to write the method.
I would assume these would have to expire at some point also incase the bot went offline; we wouldn't want the entries for it to remain forever.
@graywolf336 for integrations this could also be a really great thing to have. So they could register commands via their integration. This might already be possible now that the RocketChat object is available to the integrations? (Might be a matter of streamlining it?)
That's already on the to do list :+1: will be added in the next month or so
@graywolf336 Do you have added the feature yet ?
@geekgonecrazy Hi, I was just interested if the autocomplete function was implemented as feature or you are still working on it. I can definitely see the usefulness of the concept.
Rocket.Chat Apps will likely help make this a more realistic possibility. As it will allow runtime registration of slash commands
This can be progressed with new updates to the new js.SDK that will be used in the next version of the Hubot adapter.
I would propose adding a method in the adapter/SDK like registerCommand that would run on startup against all the commands within a Hubot instance (drawn from each scripts inline header docs - existing functionality in Hubot), that would call a counterpart server method to populate the auto completion handler. This would require an issue on the SDK too, but we can keep this one to track the platform support side.
https://github.com/RocketChat/hubot-rocketchat/pull/71/files I started to do that here. Doing exactly as you said. :)
Rocket.Chat apps are now able to do this so the commands should actually all be ready here in the rest and real time api. Its all up to the bot side now :)
I don't use Rocket.Chat anymore, but I'm really happy to see this coming.
Thanks @geekgonecrazy for your work :)
Related: #7445
Most helpful comment
This can be progressed with new updates to the new js.SDK that will be used in the next version of the Hubot adapter.
I would propose adding a method in the adapter/SDK like
registerCommandthat would run on startup against all the commands within a Hubot instance (drawn from each scripts inline header docs - existing functionality in Hubot), that would call a counterpart server method to populate the auto completion handler. This would require an issue on the SDK too, but we can keep this one to track the platform support side.