ogrodnek/code-pipeline-slack

Channel error

asyba opened this issue · 1 comments

asyba commented

The SLACK_CHANNEL I put is a private channel in slack.

'channels': KeyError
Traceback (most recent call last):
  File "/var/task/notifier.py", line 98, in run
    m = process(event)
  File "/var/task/notifier.py", line 91, in process
    processCodePipeline(event)
  File "/var/task/notifier.py", line 56, in processCodePipeline
    existing_msg = find_message_for_build(buildInfo)
  File "/var/task/slack_helper.py", line 40, in find_message_for_build
    for m in find_my_messages("builds"):
  File "/var/task/slack_helper.py", line 28, in find_my_messages
    ch_id = find_channel(ch_name)
  File "/var/task/slack_helper.py", line 17, in find_channel
    for ch in r['channels']:
KeyError: 'channels'

image

image

I had success changing
"/var/task/slack_helper.py", line 40
find_my_messages("builds")
to
find_my_messages(SLACK_CHANNEL)

And setted my Slack App Scopes to:

channels:history
channels:read
chat:write