AWS-ruby-line-echo-bot
Follow this project,
I use my first language(ruby) to build this on serverless,
so you can use this project in others case.
Before you start
- LINE developer account
- LINE Messaging API
Get Started
- Install serverless via npm
$ npm install -g serverless
- Setup your AWS ceritficate
export AWS_ACCESS_KEY_ID=<your-key-here>
export AWS_SECRET_ACCESS_KEY=<your-secret-key-here>
- Set your LINE bot channel secret & access token as environment variables before deploying
export LINE_CHANNEL_SECRET=<your-channel-secret-here>
export LINE_CHANNEL_ACCESS_TOKEN=<your-channel-access-token-here>
- Deploy the webhook function
npm install
serverless deploy
- Register the deployed
webhookendpoint URL as your LINE bot's webhook URL in the LINE Developers console, then send it a message.
Now you can test your chatbot, have fun!
![]()
Implementation notes
The handler uses line-bot-api v2's Line::Bot::V2::WebhookParser to validate the X-Line-Signature
header on every incoming request before processing it, and replies through
Line::Bot::V2::MessagingApi::ApiClient. See the gem's README
for the full Messaging API surface.