https://github.com/deepxx86/linechatbot
This code will make your own line chat bot use chatgpt.
https://github.com/deepxx86/linechatbot
chatbot chatgpt easy javascript line linebot
Last synced: 2 months ago
JSON representation
This code will make your own line chat bot use chatgpt.
- Host: GitHub
- URL: https://github.com/deepxx86/linechatbot
- Owner: DeepXx86
- Created: 2024-04-19T16:40:21.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-08-17T08:23:27.000Z (10 months ago)
- Last Synced: 2024-08-17T09:25:04.292Z (10 months ago)
- Topics: chatbot, chatgpt, easy, javascript, line, linebot
- Language: JavaScript
- Homepage:
- Size: 14.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Create Your Own AI Chat Bot in Line😉
This code helps you make your own LINE bot with AI capabilities!
## Steps to Create a LINE Bot (Message API) 🗃️:
### 0. Prepare Your Environment
* Create a script in Google Apps Script. Link 🔗: https://script.google.com/home### 1. Copy the Code
Copy the provided code into your Google Apps Script project.### 2. Configure API Keys
In the script, replace the placeholders with your actual API keys:```javascript
const LINE_ACCESS_TOKEN = 'YOUR_LINE_CHANNEL_ACCESS_TOKEN';
const OPENAI_APIKEY = 'YOUR_OPENAI_API_KEY';
```
### 3. Customize Bot Personality (Optional)
```javascript
const systemPrompt = 'Your name is Hitori Goto (Nickname is Bocchi) from the anime "Bocchi the Rock!" You are a young girl, เธอเป็นผู้หญิง. You are cute but not good at talking. You will use emojis that convey the feeling of the context. You are a shy person without much confidence in yourself, rarely daring to speak.';
```
### 4. Deploy the Web App
Click on "Deploy" > "New deployment"
Choose "Web app" as the type
Set "Who has access" to "Anyone"
Click "Deploy" and copy the provided Web App URL
### 5. Set Up LINE Webhook
Go to your LINE bot settings in the LINE Developers Console
In the Messaging API settings, find the Webhook URL section
Click "Edit" and paste your Web App URL
Click "Update" or "Save"
Click "Verify" and wait for the success message### Done!