scrapinghub / slackbot

A chat bot for Slack (https://slack.com).
MIT License
1.26k stars 396 forks source link

Unable to post back messages to a channel #232

Open jeffbilder opened 1 year ago

jeffbilder commented 1 year ago

When attempting to send return data back to a slack channel, the following error is issued:

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/slackbot/dispatcher.py", line 55, in _dispatch_msg_handler
    func(Message(self._client, msg), *args)
  File "/home/slackbot/cranebot/cranebot/khasbaht/plugins/saltorch.py", line 23, in salt
    cmd_runner(cmd, message, user)
  File "/home/slackbot/cranebot/cranebot/khasbaht/helpers.py", line 696, in cmd_runner
    stdout=results.stdout, stderr=results.stderr)
  File "/home/slackbot/cranebot/cranebot/khasbaht/helpers.py", line 738, in format_response
    return check_response(message, response), default_username
  File "/home/slackbot/cranebot/cranebot/khasbaht/helpers.py", line 710, in check_response
    message.channel.upload_file(fname, tmpf)
  File "/usr/local/lib/python3.6/site-packages/slackbot/dispatcher.py", line 299, in channel
    return self._client.get_channel(self._body['channel'])
  File "/usr/local/lib/python3.6/site-packages/slackbot/slackclient.py", line 174, in get_channel
    return Channel(self, self.channels[channel_id])
  KeyError: 'xxxxxxx'