LPgenerator / mattermost_bot

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

KeyError token #16

Closed Romerus closed 8 years ago

Romerus commented 8 years ago

Hi! Install worked fine (Version 1.0.16)

settings.py

DEBUG = False

PLUGINS = [
    'mattermost_bot.plugins',
]
PLUGINS_ONLY_DOC_STRING = False

BOT_URL = 'http://servername.domain.tld/api/v1'
BOT_LOGIN = 'name@domain.tld'
BOT_PASSWORD = 'password'
BOT_TEAM = 'teamname'

IGNORE_NOTIFIES = ['@channel', '@all']
WORKERS_NUM = 10

Error

[root@ mattermost_bot-1.0.16]# matterbot /opt/appl/source_files/mattermos                                                        t_bot-1.0.16/mattermost_bot/settings.py
[06/01/2016 10:16:30] Starting new HTTP connection (1): siik.oebb.at
Traceback (most recent call last):
  File "/bin/matterbot", line 9, in <module>
    load_entry_point('mattermost-bot==1.0.16', 'console_scripts', 'matterbot')()
  File "/opt/appl/source_files/mattermost_bot-1.0.16/mattermost_bot/cli.py", lin                                                        e 17, in main
    b = bot.Bot()
  File "/opt/appl/source_files/mattermost_bot-1.0.16/mattermost_bot/bot.py", lin                                                        e 26, in __init__
    settings.BOT_LOGIN, settings.BOT_PASSWORD,
  File "/opt/appl/source_files/mattermost_bot-1.0.16/mattermost_bot/mattermost.p                                                        y", line 118, in __init__
    self.login(team, email, password)
  File "/opt/appl/source_files/mattermost_bot-1.0.16/mattermost_bot/mattermost.p                                                        y", line 122, in login
    self.user = self.api.login(team, email, password)
  File "/opt/appl/source_files/mattermost_bot-1.0.16/mattermost_bot/mattermost.p                                                        y", line 36, in login
    self.token = p.headers["Token"]
  File "/opt/appl/source_files/mattermost_bot-1.0.16/requests/structures.py", li                                                        ne 56, in __getitem__
    return self._store[key.lower()][1]
KeyError: 'token'

I tested the url -> works I tested the user login with email and passwort -> works

gotlium commented 8 years ago

Hi, you can try to change api version on url

BOT_URL = 'http://servername.domain.tld/api/v3'