errbotio / err-backend-mattermost

GNU General Public License v3.0
41 stars 22 forks source link

Access to channel 'notifications'? Ex.: "xyz joined the team" #42

Closed thufir-hawat closed 5 years ago

thufir-hawat commented 5 years ago

Like this: image I'd like to have the bot react to the mentions and send the users a message. Is there a way to do that with your plugin?

Vaelor commented 5 years ago

I don't think so, though I am not 100% sure.

I can't test it at the moment, but, your message above should trigger this event: https://github.com/Vaelor/errbot-mattermost-backend/blob/master/mattermost.py#L93 which, in turn calls the callback_room_joined, but as far as I still understand that line, only if the bot is the user joining the room. https://github.com/Vaelor/errbot-mattermost-backend/blob/master/mattermost.py#L109 If it is another user, it shouldn't trigger. So, this probably would need some kind of code change...

Vaelor commented 5 years ago

Not sure if it is an alternative: You could use https://github.com/Vaelor/python-mattermost-driver and access the websocket events directly (not sure if you are dead set on using errbot for that) foo.init_websocket(event_handler) Where your event_handler could do anything you like. https://api.mattermost.com/#tag/WebSocket - The list of available events is quite big.