Naltox / telegram-node-bot

Node module for creating Telegram bots.
MIT License
723 stars 143 forks source link

Unable to call callback from runMenu #125

Closed aguiraf closed 8 years ago

aguiraf commented 8 years ago

Running a menu like this:

startHandler($){
  $.runMenu({
      message: 'message text',
      'A': 'AHandler',
      'B' : 'BHandler'
    })
}
AHandler($){...}

When tapping on A button, It seems the callback is never called.

Naltox commented 8 years ago

@aguiraf Look at docs please.

You must do it like this:

startHandler($){
  $.runMenu({
      message: 'message text',
      'A': () => {
       //code for 'A' here
      },
      'B' : () => {
       //code for 'B' here
      }
    })
}
aguiraf commented 8 years ago

ok, sorry, now it's clear. THX