一個基本的LINE Bot專案,基於FastAPI框架,並將所有意圖獨立於 Python 檔案
pip install -r requirement.txt
LINE_CHANNEL_ACCESS_TOKEN=<your accecc token>
LINE_CHANNEL_SECRET=<your secret>
uvicorn main:app --reload
from linebot.models import TextSendMessage
from models.message_request import MessageRequest
from skills import add_skill
@add_skill('/hello')
def get(message_request: MessageRequest):
return [
TextSendMessage(text='Hello World!')
]