slack-ruby / slack-ruby-client

A Ruby and command-line client for the Slack Web, Real Time Messaging and Event APIs.
MIT License
1.21k stars 214 forks source link

chat postMessage via CLI with non-existent channel produces unhelpful error message #451

Closed duffn closed 1 year ago

duffn commented 1 year ago

The error that the CLI produces if you send a message to a non-existent channel doesn't tell you that the channel doesn't exist.

CLI:

$ slack chat postMessage --text="hello from slack-ruby-client CLI" --channel="#doesnotexist"
error: wrong number of arguments (given 1, expected 0)

vs. the library:

client.chat_postMessage(channel: '#doesnotexist', text: 'Hello from slack-ruby-client')
channel_not_found (Slack::Web::Api::Errors::ChannelNotFound)

vs the CLI producing a meaningful error:

$ slack conversations info --channel=#doesnotexist
error: channel_not_found
duffn commented 1 year ago

This is invalid with v2.1.0.

dblock commented 1 year ago

Was fixed in https://github.com/slack-ruby/slack-ruby-client/issues/438.