Simple echo line bot on Google Cloud Functions
- Replace
<CHANNEL ACCESS TOKEN>inindex.jswith your token from the Line Channel settings page - Create GCP account and install
gcloudcli - Enable
Cloud Functions APIin GCP Console - Repace
<YOUR-GCP-PROJECT>indeploy.shwith your GCP Project ID - Replace
<YOUR-GCS-BUCKET>indeploy.shwith your GCS Bucket
You can deploy by running deploy.sh or using the command below
gcloud beta functions deploy line-bot --project <YOUR-GCP-PROJECT> --stage-bucket <YOUR-GCS-BUCKET> --entry-point hook --trigger-http
Your bot will or may be available for Line Messaging API to access via
https://us-central1-<YOUR-GCP-PROJECT>.cloudfunctions.net/line-bot
You can enter the above URL to Webhook URL in the Line Channel settings page
Google Cloud Functions is still in beta during this publish. Please use with caution.