Read the statement by Michael Teeuw here.
Attempt to Rebuild MMM-Slack with media handling, includes dont seem to load
-
@mediathreat just from looking at the code there is something missing (this should result in an error)
rtm.on('message', function(message) { this.sendSocketNotifcation('SLACK_DATA' , message); }); this.sendSocketNotifcation('SLACK_DATA' , event); });
it should be, look at slack event and use arrow functions to keep your scope to be able to call the notification method
rtm.on('message', (message) => { this.sendSocketNotifcation('SLACK_DATA' , message); }); rtm.on('slack_event', (event) => { this.sendSocketNotifcation('SLACK_DATA' , event); });
-
@strawberry-3.141 oops thanks for that, yeah- i cut and paste in two sections and forgot that part.
Is there a way I can check to debug why it wont load the
var RtmClient = require(‘@slack/client’).RTMClient;
-
@mediathreat dou you have it in your local node_modules folder?
-
Actually the fix above got the whole thing working and I was able to strip the code down quite a bit with the new simpler function calls. Thank you! I hope to have a updated module posted to the forum soon from github
@strawberry-3.141 said in Attempt to Rebuild MMM-Slack with media handling, includes dont seem to load:
@mediathreat dou you have it in your local node_modules folder?
-
@mediathreat That sound’s great and i’m looking forward for your module :)
-
a slack module sounds great