slack-go / slack

Slack API in Go, originally by @nlopes; Maintainers needed, contact @parsley42
https://pkg.go.dev/github.com/slack-go/slack
BSD 2-Clause "Simplified" License
4.69k stars 1.14k forks source link

Calling conversations.unarchive returns not_in_channel error #1066

Closed llamahunter closed 2 years ago

llamahunter commented 2 years ago

What happened

Called client.UnarchiveConversationContext() on an archived channel, but got a 'not_in_channel' error, which isn't even listed as a valid error on https://api.slack.com/methods/conversations.unarchive

Expected behavior

Channel is unarchived and caller is added to channel

Steps to reproduce

  1. archive a channel
  2. call client.UnarchiveConversationContext on the channel

reproducible code

see https://github.com/pablovarela/terraform-provider-slack/blob/master/slack/resource_conversation.go#L247

manifest.yaml

Versions

kanata2 commented 2 years ago

Please could you try to use User Token instead of Bot Token? Actually it seems that this is Slack's undocumented specification.

See also: https://stackoverflow.com/questions/63361079/slack-webapi-conversations-unarchive-fails-with-not-in-channel

llamahunter commented 2 years ago

https://stackoverflow.com/questions/63361079/slack-webapi-conversations-unarchive-fails-with-not-in-channel

Err... that seems like a somewhat egregious bug in the slack api? Why can't bots unarchive channels?