mast / telegram-bot-api

First Telegram Bot API node.js library
http://mast.github.io/telegram-bot-api/
MIT License
245 stars 65 forks source link

throw new TypeError('first argument must be a string or Buffer'); #28

Closed bytelovers closed 4 years ago

bytelovers commented 8 years ago

Hi folk,

When I use the method "sendContact" throws this error:

http_outgoing.js:447 throw new TypeError('first argument must be a string or Buffer'); ^

TypeError: first argument must be a string or Buffer at ClientRequest.OutgoingMessage.write (_http_outgoing.js:447:11) at Request.write (/home/ubuntu/workspace/node_modules/request/request.js:1407:27) at FormData.ondata (stream.js:31:26) at emitOne (events.js:77:13) at FormData.emit (events.js:169:7) at FormData.CombinedStream.write (/home/ubuntu/workspace/node_modules/combined-stream/lib/combined_stream.js:118:8) at FormData.CombinedStream._pipeNext (/home/ubuntu/workspace/node_modules/combined-stream/lib/combined_stream.js:106:8) at FormData.CombinedStream._getNext (/home/ubuntu/workspace/node_modules/combined-stream/lib/combined_stream.js:79:10) at FormData.CombinedStream._pipeNext (/home/ubuntu/workspace/node_modules/combined-stream/lib/combined_stream.js:107:8) at FormData.CombinedStream._getNext (/home/ubuntu/workspace/node_modules/combined-stream/lib/combined_stream.js:79:10) at FormData.CombinedStream._pipeNext (/home/ubuntu/workspace/node_modules/combined-stream/lib/combined_stream.js:107:8) at FormData.<anonymous> (/home/ubuntu/workspace/node_modules/combined-stream/lib/combined_stream.js:91:10) at FormData.<anonymous> (/home/ubuntu/workspace/node_modules/form-data/lib/form_data.js:246:5) stream/lib/combined_stream.js:84:3) at FormData.CombinedStream._pipeNext (/home/ubuntu/workspace/node_modules/combined-stream/lib/combined_stream.js:107:8) at FormData.CombinedStream._getNext (/home/ubuntu/workspace/node_modules/combined-stream/lib/combined_stream.js:79:10)

Do yo know what happend?

bytelovers commented 8 years ago

In response to my comment above, I change the formData property to body property and it works.

mast commented 4 years ago

It is fixed in 2.0