{"id":13683418,"url":"https://github.com/line/line-bot-sdk-ruby","last_synced_at":"2025-04-30T13:30:44.661Z","repository":{"id":7413509,"uuid":"56061447","full_name":"line/line-bot-sdk-ruby","owner":"line","description":"LINE Messaging API SDK for Ruby","archived":false,"fork":false,"pushed_at":"2025-04-26T11:31:24.000Z","size":3889,"stargazers_count":485,"open_issues_count":7,"forks_count":130,"subscribers_count":39,"default_branch":"master","last_synced_at":"2025-04-26T12:33:11.694Z","etag":null,"topics":["bot","line","ruby","sdk"],"latest_commit_sha":null,"homepage":"https://developers.line.biz/en/docs/messaging-api/overview/","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/line.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-04-12T12:32:57.000Z","updated_at":"2025-04-26T11:31:26.000Z","dependencies_parsed_at":"2024-04-08T12:26:51.665Z","dependency_job_id":"a17b9f28-1295-4b25-9907-1c85c09204e1","html_url":"https://github.com/line/line-bot-sdk-ruby","commit_stats":{"total_commits":364,"total_committers":43,"mean_commits":8.465116279069768,"dds":0.7252747252747253,"last_synced_commit":"dce55204095cc5d70cf64526ddeae2e2e7854d09"},"previous_names":[],"tags_count":50,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fline-bot-sdk-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fline-bot-sdk-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fline-bot-sdk-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/line%2Fline-bot-sdk-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/line","download_url":"https://codeload.github.com/line/line-bot-sdk-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251712832,"owners_count":21631447,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","line","ruby","sdk"],"created_at":"2024-08-02T13:02:10.556Z","updated_at":"2025-04-30T13:30:39.652Z","avatar_url":"https://github.com/line.png","language":"Ruby","readme":"# LINE Messaging API SDK for Ruby\n\n[![Gem-version](https://img.shields.io/gem/v/line-bot-api.svg)](https://rubygems.org/gems/line-bot-api)\n\n\n## Introduction\nThe LINE Messaging API SDK for Ruby makes it easy to develop bots using LINE Messaging API, and you can create a sample bot within minutes.\n\n## Documentation\n\nSee the official API documentation for more information\n\n- English: https://developers.line.biz/en/docs/messaging-api/overview/\n- Japanese: https://developers.line.biz/ja/docs/messaging-api/overview/\n\nAlso, generated documentation by YARD is available.\n\n- https://rubydoc.info/gems/line-bot-api\n\n## Requirements\nThis library requires Ruby 3.1 or later.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'line-bot-api'\n```\n\nAnd then execute:\n\n```sh\nbundle\n```\n\nOr install it yourself as:\n\n```sh\ngem install line-bot-api\n```\n\n## Synopsis\n\nUsage:\n\n```ruby\n# app.rb\nrequire 'sinatra'\nrequire 'line/bot'\n\ndef client\n  @client ||= Line::Bot::Client.new { |config|\n    config.channel_id = ENV[\"LINE_CHANNEL_ID\"]\n    config.channel_secret = ENV[\"LINE_CHANNEL_SECRET\"]\n    config.channel_token = ENV[\"LINE_CHANNEL_TOKEN\"]\n  }\nend\n\npost '/callback' do\n  body = request.body.read\n\n  signature = request.env['HTTP_X_LINE_SIGNATURE']\n  unless client.validate_signature(body, signature)\n    error 400 do 'Bad Request' end\n  end\n\n  events = client.parse_events_from(body)\n  events.each do |event|\n    case event\n    when Line::Bot::Event::Message\n      case event.type\n      when Line::Bot::Event::MessageType::Text\n        message = {\n          type: 'text',\n          text: event.message['text']\n        }\n        client.reply_message(event['replyToken'], message)\n      when Line::Bot::Event::MessageType::Image, Line::Bot::Event::MessageType::Video\n        response = client.get_message_content(event.message['id'])\n        tf = Tempfile.open(\"content\")\n        tf.write(response.body)\n      end\n    end\n  end\n\n  # Don't forget to return a successful response\n  \"OK\"\nend\n```\n\n## Help and media\nFAQ: https://developers.line.biz/en/faq/\n\nNews: https://developers.line.biz/en/news/\n\n## Versioning\nThis project respects semantic versioning.\n\nSee https://semver.org/\n\n## Contributing\nPlease check [CONTRIBUTING](CONTRIBUTING.md) before making a contribution.\n\n## License\n```\nCopyright (C) 2016 LINE Corp.\n \nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n \n   http://www.apache.org/licenses/LICENSE-2.0\n \nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fline%2Fline-bot-sdk-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fline%2Fline-bot-sdk-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fline%2Fline-bot-sdk-ruby/lists"}