Support and flag undocumented features, eg. channels.invite takes users
See https://github.com/slack-ruby/slack-ruby-client/issues/118, apparently channels.invite can take up to 30 users.
I reached out to Slack about this cause on their error messaging there is one that says too_many_users. I got this reply:
Hi Abel, thanks so much for writing, I'm very sorry for the confusion here.
If you change the name of the parameter from user to users (plural instead of singular) and then pass a comma-separated list of valid user IDs, the method should work as expected. e.g.
users=U123456789,U987654321 If you are inviting multiple members, you may receive a slightly different error response in the JSON payload Slack returns. For example, if one or more of the people you invite are already members of the channel, you will receive an error array with the user ID of team members already in channel. Other members will be added to the channel. So you may need to run a few tests to make sure your error handling code is working as expected.
We obviously didn't do a great job of documenting this, I'll work on getting that fixed asap.
Thanks again, please let me know if I can help with anything else!
Sounds like this will get documented and will appear in the API.
In the meantime you can monkey-patch/rewrite https://github.com/slack-ruby/slack-ruby-client/blob/master/lib/slack/web/api/endpoints/channels.rb#L76 or just call the underlying post API.
Some of this was built in #21, but I don't think it covers this scenario, @manuelmeurer?
No, the channels.invite methods were not touched when I added the undocumented methods.
Probably the "easiest" way to add support for the users param would be to push the Slack team again to add it to the API docs. 😄
Maybe we can just introduce patches? A JSON file that gets merged?
We have patches in slack-ruby-client, right? Can we add it there?
We could, but these are very much undocumented parameters of the API, I think they belong here.