AB would provide Flex Message template and LINE bot feature.
- Type any text to trigger bot for send Announcer template.
- About GA feature, please follow this article.
- Express / nodejs v12.18
- TypeScript
You can test this project on Heroku.
Use following up commands to check machine:
heroku run bash -a YOUR_HEROKU_NAME
heroku logs --tail -a YOUR_HEROKU_NAME
- Login
LINE Developer Console
. - Create a
LINE Login
channel. - Input channel information.
- Click
LIFF
tab and add LIFF application. - Copy
LIFF ID
to environmentCONCAT_ID
variable.
- Login
LINE Developer Console
. - Create a
Messaging API
channel. - Input channel information.
- Copy
Channel secret
andChannel access token
to environmentCHANNEL_ACCESS_TOKEN
andCHANNEL_SECRET
variables.
cp .env.sample .env
npm install
npm run dev
npx ngrok http 5000
You can go to LINE Developer Console to change LINE Bot webhook url.
If you used channel_access_toen
and channel_secret
in .env
file.
You can use change_bot_url.sh
to change temp webhook url.
sh change_bot_url.sh 57G...YOUR_ACCESS_TOKEN...vw= https://{YOUR_DOMAIN}/webhooks/line
will see following log:
--------------------------
{}
--------------------------
{"endpoint":"https://{YOUR_DOMAIN}/webhooks/line","active":true}
-------------------------
{}
: if empty, means success.
npm run dev
This command will compile TypeScript to JavaScript file in
dist/
.
If you use .env
to develop this project(contain LINE Bot token), can use following command:
npm run test
- If you installed act locally, run
act
to check GitHub Actions status.
type announcement = {
template: '1',
title: 'Title',
place: 'location',
time: '12/26 15:00',
url: 'HTTP string',
imageUrl: 'HTTP string',
description: 'aaa\nbbb\nccc',
activity: 'some tag',
};
type staffList = {
template: '2',
title: 'title',
place: 'here',
url: 'HTTP link',
activity: 'tag',
map: 'Google Map link',
people: [{name: 'NiJia', time: '10:00~12:00'}],
};
type Card = {
template: '2',
title: 'title',
description: 'aaa\nbbb',
avatar: 'HTTP link',
back: 'HTTP image background link',
followUrl: 'HTTP link',
};
type News = {
image: string;
date: string;
description: string;
link: string;
tag: string;
targetPicker?: string;
}
Above template would response following type:
type FlexResponse = {
flex: string;
};
MIT License