lukefx / hubot-telegram

Hubot adapter for Telegram
MIT License
160 stars 42 forks source link

New reworked version of the adapter #72

Closed lukefx closed 4 years ago

lukefx commented 4 years ago

Switched to a more complete library: https://github.com/yagop/node-telegram-bot-api

An example of the new functionality is in example.js

Using a trick with a middleware we're able to expose Telegram's methods directly on the Response object:

  robot.respond(/totoro/, res => {
    const image = 'https://bit.ly/2VlEgCs'
    res.sendPhoto(res.envelope.room, image, {
      caption: 'Totoro!'
    })
  })