Visitar URL original
examples/aws-ruby-line-bot at v4 · serverless/examples · GitHub
Skip to content

Latest commit

 

History

History

aws-ruby-line-bot

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

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

  1. LINE developer account
  2. LINE Messaging API

Get Started

  1. Install serverless via npm
$ npm install -g serverless
  1. Setup your AWS ceritficate
export AWS_ACCESS_KEY_ID=<your-key-here>
export AWS_SECRET_ACCESS_KEY=<your-secret-key-here>
  1. 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>
  1. Deploy the webhook function
npm install
serverless deploy
  1. Register the deployed webhook endpoint 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! Echo bot

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.

References