edisonchee / slimbot

Telegram Bot API for Node.js
MIT License
223 stars 37 forks source link

More examples to the Sending Files Please #28

Closed suntong closed 5 years ago

suntong commented 5 years ago

Hey @edisonchee,

Please add more examples to the Sending Files demo.

So far it only sends Photos. When I tried to copy and use sendVideo() I got the error of:

error_code":400,"description":"Bad Request: there is no video in the request"}
    at Request.then.resp (/.../node_modules/slimbot/src/telegram.js:61:15)

Are the video/document parameter supposed to be binary strings (obtained from fs.createReadStream)?

Thx

edisonchee commented 5 years ago

Hi @suntong, thanks for raising this issue. After looking at the source, I realised there are quite a number of bugs that need to be fixed:

My bad. I'll update you here once I fix the bugs and publish a new release in a bit.

edisonchee commented 5 years ago

Send methods now make requests with formData if the file you're using is a readable stream.

sendFile no longer broken; let me know if you have any issues using it.

suntong commented 5 years ago

Fantastic! I'll give it a try. THX a lot!