rockymadden / slack-cli

:neckbeard: Powerful Slack CLI via pure bash. Rich messaging, uploads, posts, piping, oh my!
1.06k stars 93 forks source link

Sending private message #84

Open lamvann opened 6 years ago

lamvann commented 6 years ago

Hi, I tried sending a private message but I keep getting a 'channel_not_found' error using the following command:

slack chat send 'Hello world!' @adel

Note: I can successfully send messages to channel, however i need to send private messages now

Complete error message: jq: error (at <stdin>:0): Cannot iterate over null (null) jq: error (at <stdin>:0): Cannot iterate over null (null) { "ok": false, "error": "channel_not_found" }

rockymadden commented 6 years ago

@lamvann, thank you. I can also confirm the behavior. Queued up.

rockymadden commented 6 years ago

@lamvann, upon further research I cannot reproduce. My message above was user error, as I put the channel first instead of second. Can you try this curl command:

$ curl -s -X POST https://slack.com/api/users.list --data-urlencode "token=${SLACK_CLI_TOKEN}"

I am curious if you can find the user at hand in the list by another username than they now have, there are permission issues, etc.

rockymadden commented 6 years ago

I added the ability to look up by display name as well: https://github.com/rockymadden/slack-cli/pull/92

bmc08gt commented 5 years ago

100 fully resolves this issue