Line Bot - 日常瑣事linebot (Implement FSM)
example code, Hlunlun
前言
- 外出看天氣可以直接查詢
- 也可以是todo list,隨時查看還有哪些事沒完成
環境:
python 3.9.13
技術
- pymogo : 連接資料庫
- api : 搜尋氣象資料
- mongodb : 存todolist
How to start
pip3 install pipenv
- 創一個
.env
檔包含
- LINE_CHANNEL_SECRET
- LINE_CHANNEL_ACCESS_TOKEN
- WEATHER_API : 到這裡申請api
- CONNECTION_STRING : 到這裡創建mongodb帳號
- pygraphviz : for windows
- open ngrok.exe : 記得先安裝
- type
ngrok http 5000
- run app.py :
python app.py
操作說明
- 基本操作
restart
: reset 回到初始狀態
fsm
: 顯示狀態圖
- 架構
weather
: 查詢天氣
todo
: 可以對todolist做CRUD的編輯
- 使用示範
- hello
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- 天氣
- 問地區
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- 可以繼續問,若是不想問了,就打
restart
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- todolist
- 問CRUD的哪個,一個項目進行完可以打todo就可以繼續下一個項目
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Create
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Read
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Update
- 輸入要更新的項目的編號
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- 選擇要更新狀態
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- 最後顯示目前todolist
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Delete
- 輸入要刪除的項目的編號
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- 最後顯示目前todolist
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- 輸入
fsm
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
參考資料
.gitignore
line develop
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Warning
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →