Node-telegram-bot-api: deep linking support

Created on 3 May 2017  路  3Comments  路  Source: yagop/node-telegram-bot-api

Is there any way to do deep linking with this library?
i.e. deep-linking

docs question

Most helpful comment

Yes, it is possible. As the docs (https://core.telegram.org/bots#deep-linking) say,

... your bot will receive a message from that user in this format:

/start PAYLOAD`

PAYLOAD stands for the value of the start or startgroup parameter that was passed in the link.

Therefore, all you've to do is capture the message with the format described above. For example,

bot.onText(/\/start (\w+)/, function(msg, match) {
    const payload = match[1];
    // ....
    // use payload
   // ...
  return bot.sendMessage(msg.chat.id, "bot at your service");
});

All 3 comments

Yes you can do it ...

I found nothing in the docs. could you explain how I can do this?

Yes, it is possible. As the docs (https://core.telegram.org/bots#deep-linking) say,

... your bot will receive a message from that user in this format:

/start PAYLOAD`

PAYLOAD stands for the value of the start or startgroup parameter that was passed in the link.

Therefore, all you've to do is capture the message with the format described above. For example,

bot.onText(/\/start (\w+)/, function(msg, match) {
    const payload = match[1];
    // ....
    // use payload
   // ...
  return bot.sendMessage(msg.chat.id, "bot at your service");
});
Was this page helpful?
0 / 5 - 0 ratings