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

Using slack ruby client commands #61

Closed
maxbrodi opened this issue Mar 25, 2016 · 3 comments
Closed

Using slack ruby client commands #61

maxbrodi opened this issue Mar 25, 2016 · 3 comments

Comments

@maxbrodi
Copy link

Hi,

Thanks a lot for the amazing gem.
Unfortunately I can't use slack ruby client commands with it such as:

  • client.channels_list.channels
    or
  • client.channels_info(channel: '#general')

I get a "undefined method `channels_info' for #SlackRubyBot::Client:0x007fb2e1624030" error each time. Am I doing something wrong here?

Thank you

@maxbrodi
Copy link
Author

What I'm trying to do is to send private messages to users instead of posting in a channel, I guess that using these kind of functions to get the users' ID is the best way.

@dblock
Copy link
Collaborator

dblock commented Mar 25, 2016

You want the Web client that was used to obtain the RealTime connection in the first place, try this:

client.web_client.channels_list

Maybe the doc could use some updating, please feel free to PR.

@dblock dblock closed this as completed Mar 25, 2016
@dblock
Copy link
Collaborator

dblock commented Mar 25, 2016

Btw, this is documented in the RealTime client itself, but that's not part of this gem - https://github.com/dblock/slack-ruby-client#combining-realtime-and-web-clients.

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

No branches or pull requests

2 participants