• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Attempt to Rebuild MMM-Slack with media handling, includes dont seem to load

Scheduled Pinned Locked Moved Development
7 Posts 4 Posters 2.3k Views 4 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    strawberry 3.141 Project Sponsor Module Developer @mediathreat
    last edited by Apr 8, 2018, 9:37 PM

    @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);
    });
    

    Please create a github issue if you need help, so I can keep track

    M 1 Reply Last reply Apr 9, 2018, 12:09 AM Reply Quote 0
    • M Offline
      mediathreat @strawberry 3.141
      last edited by Apr 9, 2018, 12:09 AM

      @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;

      S 1 Reply Last reply Apr 9, 2018, 9:47 PM Reply Quote 0
      • S Offline
        strawberry 3.141 Project Sponsor Module Developer @mediathreat
        last edited by Apr 9, 2018, 9:47 PM

        @mediathreat dou you have it in your local node_modules folder?

        Please create a github issue if you need help, so I can keep track

        1 Reply Last reply Reply Quote 0
        • M Offline
          mediathreat
          last edited by Apr 10, 2018, 7:10 PM

          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?

          G 1 Reply Last reply Apr 12, 2018, 6:08 PM Reply Quote 0
          • G Offline
            gekberlin @mediathreat
            last edited by Apr 12, 2018, 6:08 PM

            @mediathreat That sound’s great and i’m looking forward for your module :)

            1 Reply Last reply Reply Quote 0
            • M Offline
              maxbachmann
              last edited by May 16, 2018, 6:04 PM

              a slack module sounds great

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • First post
                Last post
              Enjoying MagicMirror? Please consider a donation!
              MagicMirror created by Michael Teeuw.
              Forum managed by Sam, technical setup by Karsten.
              This forum is using NodeBB as its core | Contributors
              Contact | Privacy Policy