Slack bot cannot post message to private channel

ytdm picture ytdm · Apr 7, 2017 · Viewed 16.4k times · Source

I follow Slack bot post message documents

it works perfectly when post to public channel, but get error [error] => channel_not_found when post to private channel, I even change channel_name to channel ID (ex: G1HCG4BQ9)

I already authorized with both chat:write:user and chat:write:bot permissions

Answer

Sam Mullin picture Sam Mullin · Feb 7, 2018

Did you invite the bot to the channel? A bot can't post in a private channel if it's not a member - you need to invite it to the channel like you would a person.

@YourBotsName will do it!