You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
2 years ago | |
|---|---|---|
| src | 2 years ago | |
| .gitignore | 2 years ago | |
| CHANGELOG.md | 2 years ago | |
| README.md | 2 years ago | |
| docker-compose.yml | 2 years ago | |
| ecosystem.config.js | 2 years ago | |
| icon.png | 2 years ago | |
| package.json | 2 years ago | |
| sample.env | 2 years ago | |
| tsconfig.json | 2 years ago | |
| yarn.lock | 2 years ago | |
README.md
ChatGPT Bot 🤖
(^ AI generated illustration from the ChatGPT Logo)
Simple ChatGPT Bot for a small team or personal use.
Quick Deploy, Easy Config, Simple Usage
📖 Features
- Support
Discord&Telegram - Selectable Chat Mode: Group Chat & Individual
- Easy to config
- Ready to run: 🐳
docker composeor ⚙️PM2 - Using Azure OpenAI
- Lightweight source code
- Flexible development design
💬 Chat Mode
| Mode | Name | Description |
|---|---|---|
| 1 | Default | Discord bot for group chat, Telegram bot for individual. Suitable for a small team/group of people. |
| 2 | Individual | Both Discord bot & Telegram bot will separate chat for each user. (1-to-1 chat) |
| 3 | Seamless | All chats of Discord bot and Telegram bot will count as the same conversation. Useful for personal. |
⚒️ Configuration
| Config Variable | Data Type | Description |
|---|---|---|
DISCORD_BOT_TOKEN |
string | The token of the Discord bot. If no token is provided, discord bot will be disabled. |
DISCORD_ALLOW_CHANNELS |
string | A comma-separated (,) whitelist of Discord channel IDs. The bot will only responsive in the channels from the list. |
TELEGRAM_BOT_TOKEN |
string | The token of the Telegram bot. If no token is provided, telegram bot will be disabled. |
TELEGRAM_ALLOW_USERS |
string | A comma-separated (,) whitelist of Telegram user IDs. The bot will only responsive to the users from the list. |
AZURE_ENDPOINT |
string | The endpoint URL of the Azure OpenAI service. |
AZURE_DEPLOYMENT_NAME |
string | The deployment name of the Azure OpenAI service. |
AZURE_KEY |
string | The key of the Azure OpenAI service. |
CHAT_MODE |
number | Choose the chat mode. Refer to the Chat Mode section. |
ALWAYS_SYSTEM_PROMPT |
boolean | Send system prompt to ChatGPT in each request? This can make ChatGPT keep remember the system prompt to provide better responsive in some cases, but more prompt tokens will be used. |
SYSTEM_PROMPT |
string | The system prompt for ChatGPT (optional) |
💡 How to use?
- You must have enabled the Azure OpenAI services
- You must created a Discord Application / Telegram Bot
- git clone to download the source code
- Copy the
sample.envfile and rename as.env - Edit the config in the
.envfile - If you want to use ⚙️ PM2, run
yarn run init:pm2 - If you want to use 🐳 docker compose, run
yarn run docker(⚠️ This project will not build a docker image, it use the node image to run the bot and manage with docker) - The bot will be run in the background