depoio / node-telegram-bot

Client wrapper for Telegram Bot API (Under heavy development)
MIT License
136 stars 30 forks source link

Send gif #55

Closed gielcobben closed 8 years ago

gielcobben commented 8 years ago

Hello I want to send a gif file like this:

bot.sendDocument({
    chat_id: id,
    document: request(original_url).pipe(fs.createReadStream("image.gif"))
});

But I keep getting this message:

.../node_modules/node-telegram-bot/lib/Bot.js:700
    if (options.files.stream) {
                     ^

TypeError: Cannot read property 'stream' of undefined
shernshiou commented 8 years ago

@gielcobben if you would like to send as stream

bot.sendDocument({
  chat_id: id,
  files: {
    stream: fs.createReadStream("image.gif")
  }
});
gielcobben commented 8 years ago

Great, thank you.