LPgenerator / mattermost_bot

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

Not working on Mattermost v3.3 #20

Closed tomedelliott closed 8 years ago

tomedelliott commented 8 years ago

I've just upgraded to Mattermost 3.3, and my bot stopped working.

I think mattermost have made some changes to the API. "action" has changed to "event", so this this line needs changing accordingly. Also json.loads is not fully loading all field correctly, on python 2.7.6. msg['data']['post'] is being returned as a string. Changing MessageDispatcher.get_message to this worked

def get_message(msg):
    return json.loads(
        msg.get('data', {}).get('post', {})
    ).get('message', '').strip()

but is a bit hacky.

tomedelliott commented 8 years ago

Also looks like msg['props']['mentions'] is now msg['data']['mentions']

gotlium commented 8 years ago

thanks for your report. pls check new 1.0.18 for compatibility with v3.3

tomedelliott commented 8 years ago

Thanks for the update.

mattermost_bot 1.0.18 is working great now on mattermost v3.3

gotlium commented 8 years ago

good news)