中文 | English
A linebot with assistance of ChatGPT.
The functions of LineGPT are defined by several commands. You can use help to list available commands.
@LineGPT help
Let ChatGPT help you.
@LineGPT gpt help
Check the weather in your place.
@LineGPT weather help
Need to know how much you should pay? Let LineGPT settle a groups' expense!
@LineGPT settle help
Settings are listed in a .env file. Here offering a template '.env.template' for user to setup your personal setting for this bot.
Item | Necessity | Default value | Note |
---|---|---|---|
LANGUAGE | NO | zh_TW | Default is Traditional Chinese. |
LINE_CHANNEL_SECRET | YES | "" | Channel secret of LINE. You can check this link for more information |
LINE_CHANNEL_ACCESS_TOKEN | YES | "" | Channel access token of LINE. You can check this link for more information |
SESSION_EXPIRE | NO | 600 | To save the memory, you can not talk to ChatGPT after <SESSION_EXPIRE> time since last update. |
WEATHER_TOKEN | NO | "" | You can set your own token or simply use mine. If you want to use your own token. Please refer the official website to see how to get a token. |
Note: After you fill in these variable, please rename the .env.template to .env.
- Start the server
uvicorn api.index:app --reload --loop asyncio
api page will be http://127.0.0.1:8000/docs
- Open ngrok
ngrok http 8000
-
Copy the https url to line bot webhook url. The result will be /webhook
-
Check verify button to see if the url works.
-
You can send message to your bot.
-
Vercel Fork this project to your github to use vercel. You can import the .env file in Settings > Environment Variables.
-
Container You can also deploy your bot by docker. Note that Linebot only take https url, so you may need to verify your domain first.
Bug reports, issues, and PRs are always welcome. If you face any questions, welcome to discuss page to discuss.