boybundit / linebot

🤖 SDK for the LINE Messaging API for Node.js
https://www.npmjs.com/package/linebot
MIT License
216 stars 93 forks source link

fix: add empty check for options #55

Open BirkhoffLee opened 3 years ago

BirkhoffLee commented 3 years ago

channelId, channelSecret and channelAccessToken should be present for the bot in order to function properly.

Past behaviour: when a channelSecret is not given, webhook requests are simply returned 400 Bad Request by the verify function.

After this commit, the constructor will throw an error when any of the above options are not given.

Haven't written the tests yet.

Signed-off-by: Birkhoff Lee git@birkhoff.me

WayneChang65 commented 3 years ago

I've created a fork repo(WayneChang65/linebot2) and added API functions. Maybe you could consider sending PR to it and give a support. Thanks.