Skip to content
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

Support and flag undocumented features, eg. channels.invite takes users #6

Open
dblock opened this issue Oct 25, 2016 · 7 comments
Open

Comments

@dblock
Copy link
Collaborator

dblock commented Oct 25, 2016

See slack-ruby/slack-ruby-client#118, apparently channels.invite can take up to 30 users.

@abmartinr
Copy link

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!

@dblock
Copy link
Collaborator Author

dblock commented Oct 25, 2016

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.

@dblock
Copy link
Collaborator Author

dblock commented Nov 25, 2017

Some of this was built in #21, but I don't think it covers this scenario, @manuelmeurer?

@manuelmeurer
Copy link
Collaborator

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. 😄

@dblock
Copy link
Collaborator Author

dblock commented Nov 26, 2017

Maybe we can just introduce patches? A JSON file that gets merged?

@manuelmeurer
Copy link
Collaborator

We have patches in slack-ruby-client, right? Can we add it there?

@dblock
Copy link
Collaborator Author

dblock commented Nov 27, 2017

We could, but these are very much undocumented parameters of the API, I think they belong here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants