MMRIZE / MMM-TelegramBot

TelegramBot module for remote-controlling MagicMirror
MIT License
26 stars 8 forks source link

Where to add custom commands? #19

Closed mungle closed 5 years ago

mungle commented 5 years ago

Hello! I red the wiki but I'm unable to understand where I can add a simple notification. I want to use telegram to select next pages with this module: https://github.com/edward-shen/MMM-pages

Thank you

eouia commented 5 years ago

Can you modify the code by yourself? Or you should request the module creator to support this. If you want to modify it by yourself, I can help you.

eouia commented 5 years ago

Can you modify the code by yourself? Or you should request the module creator to support this. If you want to modify it by yourself, I can help you.

mungle commented 5 years ago

Yes, I can

eouia commented 5 years ago

Insert belows in MMM-pages.js. I think line 18 is good place to insert.

getCommands: function(commander) {
  return [
    {command: 'PAGE_CHANGED'},
    {command: 'PAGE_INCREMENT'},
    {command: 'PAGE_DECREMENT'},
  ]
},

Now you can get commands

eouia commented 5 years ago

More detailed information is here; https://github.com/eouia/MMM-TelegramBot/wiki/How-to-add-commands

eouia commented 5 years ago

Have you solved your problem? I'll close this.