LPgenerator / mattermost_bot

MatterBot - A chat bot for MatterMost (http://www.mattermost.org).
MIT License
211 stars 60 forks source link

Demo bot crashes when trying to send a message - channel_type = channel['channel']['type'] - KeyError: 'channel' #49

Open mechastorm opened 6 years ago

mechastorm commented 6 years ago

Where should I debug this issue I am having? I had spun up the bot from the demo installation instructions.

The minute I try to send a message in the public channel

The crash log

[dd/mm/2017 23:16:18] Starting new HTTP connection (1): my-mattermost-server
[dd/mm/2017 23:16:18] http://my-mattermost-server:80 "GET /api/v3/teams/xxx/channels/yyy/ HTTP/1.1" 500 256
Traceback (most recent call last):
  File "/home/vagrant/my-bot/venv/bin/matterbot", line 11, in <module>
    sys.exit(main())
  File "/home/vagrant/my-bot/venv/local/lib/python2.7/site-packages/mattermost_bot/cli.py", line 18, in main
    b.run()
  File "/home/vagrant/my-bot/venv/local/lib/python2.7/site-packages/mattermost_bot/bot.py", line 37, in run
    self._dispatcher.loop()
  File "/home/vagrant/my-bot/venv/local/lib/python2.7/site-packages/mattermost_bot/dispatcher.py", line 116, in loop
    self._on_new_message(self.event)
  File "/home/vagrant/my-bot/venv/local/lib/python2.7/site-packages/mattermost_bot/dispatcher.py", line 92, in _on_new_message
    if self.is_mentioned(msg) or self.is_personal(msg):
  File "/home/vagrant/my-bot/venv/local/lib/python2.7/site-packages/mattermost_bot/dispatcher.py", line 54, in is_personal
    channel_type = channel['channel']['type']
KeyError: 'channel'

Is this a permission issue? My bot account can talk in the public channel with no issues when I manually log it into the system. But through the mattermost bot, it crashes.

My sample config

DEBUG = True
SSL_VERIFY = False
BOT_URL = 'http://my-mattermost-server/api/v3'
BOT_LOGIN = 'my_bot_username'
BOT_PASSWORD = 'my_bot_pass'
BOT_TEAM = 'my-channel'