Categorygithub.com/BensonLiao/my-line-simple-bot
modulepackage
0.0.0-20190821072620-4ec0983e2ca2
Repository: https://github.com/bensonliao/my-line-simple-bot.git
Documentation: pkg.go.dev

# README

my-line-simple-bot

A LINE bot server utilized with liff-react-boilerplate and imgur-api-go-v3, User can chat with bot, upload image to imgur or search subreddit/account on imgur.com.

Also a barebones Go app, which can easily be deployed to Heroku.

This application supports the Getting Started with Go on Heroku article - check it out.

Running Locally

Make sure you have Go version 1.12 or newer and the Heroku Toolbelt installed.

$ git clone https://github.com/heroku/my-line-simple-bot.git
$ cd my-line-simple-bot
$ go build -o bin/my-line-simple-bot -v .
github.com/mattn/go-colorable
gopkg.in/bluesuncorp/validator.v5
golang.org/x/net/context
github.com/heroku/x/hmetrics
github.com/gin-gonic/gin/render
github.com/manucorporat/sse
github.com/heroku/x/hmetrics/onload
github.com/gin-gonic/gin/binding
github.com/gin-gonic/gin
github.com/heroku/my-line-simple-bot
$ heroku local

Your app should now be running on localhost:8888.

Note. server read and access variable like PORT from .env, usually put that in the project root.

For example:

LINEBOT_CHANNEL_SECRET=1234
LINEBOT_CHANNEL_TOKEN=5678
IMGUR_CLIENT_ID=1234
IMGUR_CLIENT_SECRET=5678
PORT=8888

Deploying to Heroku

$ heroku create
$ git push heroku master
$ heroku open

or

Deploy

Demo

Add the LINE bot as a friend:

Press the button 加入好友 or scan the QRcode:

reactToPost

Documentation

For more information about using Go on Heroku, see these Dev Center articles:

# Functions

ActionsOnImageMessage func, to do specific action depend on message received and the last bot sent image message.
ActionsOnTextMessage func, to do specific action depend on message received and the last bot sent text message.
AddLIFFApp func.
Callback func, http handler for /callback.
DeleteLIFFApp func.
GetDefaulLIFFBotMessage func.
GetDefaultBotMessage func.
GetDefaultLIFFWithNoteBotMessage func.
GetFormatTime func.
GetImageUploadBotMessage func.
GetLIFFAppID func.
GetRandomSticker func.
HandleFile func.
HandleImage func.
HandleLocation func.
HandleSticker func.
HandleText func.
ReplyStickerMessage func.
ReplyTextMessage func.
SplitHTTPReqParams func, split http request params and return a key-value map.
UpdateLIFFApp func.

# Structs

Sticker struct.