The LINE server which handles users' messages from LINE client based on Python flask
-
Install Env
pip3 install -r requirements.txt
-
Run it in the developing mode
python3 run.py
-
Run it in the production mode
gunicorn app:app -c ./gunicorn.conf.py
-
Kubenetes Env
- name: LINE_OFFICIAL_TOKEN
valueFrom:
secretKeyRef:
name: line-official-token # kubernetes secret
key: password
- name: LINE_WEBHOOK_STRING
valueFrom:
secretKeyRef:
name: line-webhook-string # kubernetes secret
key: password
- name: GINIP
valueFrom:
configMapKeyRef:
name: gin-config
key: ginip
All linebot's event handler is implemented in app/linebot
. There are four programs to handle the different events.
callback.py
:Handle all post requests come from/callback
.followEvent.py
:Handle the event that new user add NTHU LINE Chatbot.messageEvent.py
:The chatbot core program. Process the message sends by user and will reply proper message to the user.postbackEvent.py
:Handle the postback event.
Flag status | Description |
---|---|
init | 無互動狀態 |
andx_insert | 處理新增笑話 |
affair | 處理校務詢問 |
feedback | 處理問題回饋 |
epidemic_feedback | 處理疫情意見回饋 |
mapping | 處理地圖查詢 |
Please refer to Dockerfile and gke folder
Developed by Jenson Su & Jonathan Wu