-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from flynnoct/dev
v1.2.0
- Loading branch information
Showing
19 changed files
with
735 additions
and
450 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/docs | ||
config.json.template | ||
LICENSE.md | ||
README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FROM python:3.9-alpine | ||
|
||
# Install dependencies | ||
WORKDIR /app | ||
|
||
COPY requirements.txt requirements.txt | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
# Copy the rest of the code | ||
COPY . . | ||
|
||
CMD ["sh", "bin/start_bot.sh"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
#!/bin/bash | ||
# This script start a Python program named telegram_message_parser.py and run it in the background | ||
|
||
nohup python3 telegram_message_parser.py >/dev/null 2>&1 & | ||
nohup python3 src/telegram_message_parser.py >/dev/null 2>&1 & | ||
echo "Bot has been started successfully" |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,19 @@ | ||
{ | ||
"openai_api_key": "<YOUR_OPENAI_API_KEY_HERE>", | ||
"telegram_bot_token": "<YOUR_TELEGRAM_BOT_TOKEN_HERE>", | ||
"enable_voice": true, // When enabled, Bot will accept audio messages with Whisper and reply. | ||
"allow_all_users": false, | ||
"allowed_users": [ | ||
"<USER_ID_1>", | ||
"<USER_ID_2>", | ||
"<USER_ID_2>" | ||
], | ||
"wait_time": 600, // The time limit in seconds that the Bot will clear the conversation context. | ||
"enable_dalle": true, // When enabled, Bot will involve DALL·E to handle requests for painting. | ||
"enable_voice": true, | ||
"wait_time": 600, | ||
"enable_dalle": true, | ||
"super_users": [ | ||
"<SUPER_USER_ID_1>", // Super users are granted unlimited usage on DALL·E per day. | ||
"<SUPER_USER_ID_1>", | ||
"<SUPER_USER_ID_2>" | ||
], | ||
"image_generation_limit_per_day": 5 // The upper limit that a normal user is allowed to invoke DALL·E per day. | ||
"image_generation_limit_per_day": 5, | ||
// Beta! When enabled, Bot will be able to work in inline mode, contact @BotFather to enable inline mode for your Bot | ||
"enable_inline": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: "3" | ||
|
||
services: | ||
chatgpt-bot: | ||
image: chatgpt/bot | ||
container_name: chatgpt-bot | ||
restart: always | ||
build: | ||
context: . | ||
dockerfile: Dockerfile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Documentation for config.json | ||
|
||
This documentation is for users who are unfamilar with JSON file and have trouble in using the `config.json` file. | ||
|
||
## Usage | ||
|
||
Follow below procedures to modify your `config.json`: | ||
|
||
1. Replace the `telegram_token` and `openai_api_key` with your own. | ||
2. Add allowed users to the `allowed_users` list. You can get your user id by sending `/start` to [@userinfobot](https://t.me/userinfobot) or send `/getid` to the Bot (after you start it). | ||
|
||
> Note: the user ID is a series of numbers, you should add it to the `allowed_users` list as a string (add quotation marks around it). | ||
``` | ||
{ | ||
"openai_api_key": "<YOUR_OPENAI_API_KEY_HERE>", | ||
"telegram_bot_token": "<YOUR_TELEGRAM_BOT_TOKEN_HERE>", | ||
// Allow all users to use the bot, if enabled, "allowed_users" list won't have any effect. | ||
"allow_all_users": false, | ||
"allowed_users": [ | ||
"<USER_ID_1>", | ||
"<USER_ID_2>" | ||
], | ||
// When enabled, Bot will accept audio messages with Whisper and reply. | ||
"enable_voice": true, | ||
// The time limit in seconds that the Bot will clear the conversation context. | ||
"wait_time": 600, | ||
// When enabled, Bot will involve DALL·E to handle requests for painting. | ||
"enable_dalle": true, | ||
// Super users are granted unlimited usage on DALL·E per day. | ||
"super_users": [ | ||
"<SUPER_USER_ID_1>", | ||
"<SUPER_USER_ID_2>" | ||
], | ||
// The upper limit that a normal user is allowed to invoke DALL·E per day. | ||
"image_generation_limit_per_day": 5, | ||
// Beta! When enabled, Bot will be able to work in inline mode, contact @BotFather to enable inline mode for your Bot | ||
"enable_inline": False | ||
} | ||
``` | ||
|
||
## Troubleshooting | ||
|
||
- Comments are not allowed in JSON specification. Make sure there are no commented code and words left in the file. | ||
- There should be **no comma** after the last element in `allowed_users` and `super_users` lists. |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Version history | ||
|
||
## v1.2.0 | ||
|
||
- Privacy protection improvement. The Bot now is unable to acquire messages in the group chat except user prompts. | ||
- Beta version for Telegram inline mode. The Bot now can be invoked in a chat with a contact. | ||
- Code hierarchy adjustment and bugs fixed. | ||
- Documentation for config.json file is published. | ||
|
||
## v1.1.0 | ||
|
||
- DALL·E API integration. The Bot now supports image generation based on user prompts. | ||
- Whisper API integration. The Bot now supports interaction with voice messages. | ||
- Usage limitation. Now support set daily limitation of requirements to DALL·E. | ||
- Super user. Now support granting unlimited resources to Super Users. | ||
|
||
## v1.0.0 | ||
|
||
- ChatGPT API integration. | ||
- Telegram API integration. | ||
- Private and group chat function. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.