• Documentation
  • Pricing
© 2026 Serverless, Inc. All rights reserved.

Framework

  • Overview
  • Documentation
  • Plugins360
  • Pricing

Learn

  • Blog
  • GuidesUpdated
  • Examples240
  • Courses

Resources

  • Support
  • Security
  • Trust Center
  • Status

Community

  • Slack
  • GitHub47k
  • Forum
  • Meetups

Company

  • About
  • Careers
  • Contact
  • Partners

Legal

  • Terms of Service
  • Privacy Policy
  • Trademark
  • DMCA
Wolfgang Teuber

Ruby LINE bot

by

This example shows you how to create a LINE bot using Ruby.

  1. Ruby LINE bot

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

  • Plugin hook

Contents

  • AWS-ruby-line-echo-bot
  • Before you start
  • Get Started
  • Implementation notes
  • References

Related

GuidesPluginsExamplesSlack CommunitySupport