Skip to content

Commit

Permalink
Merge pull request #88 from F33RNI/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
F33RNI authored Nov 7, 2023
2 parents 0103892 + e46fb28 commit 6ec6dcd
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 29 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ jobs:
tags: |
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ env.SHORT_SHA }}
ghcr.io/${{ steps.lowercaseRepo.outputs.lowercase }}:${{ env.TAG }}
platforms: linux/amd64
platforms: linux/amd64, linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
1 change: 1 addition & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
matrix:
platform:
- amd64
- arm64

runs-on: ubuntu-latest

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ users.json
conversations/
EdgeGPT_cookies.json
Bard_cookies.json
ChatGPT_cookies.json
data/
Banner.psd
Banner.tif
UsersRecover.py
62 changes: 37 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# 🤖 GPT-Telegramus
### The best Telegram bot for ChatGPT, EdgeGPT (aka Bing AI), DALL-E, Bing Image generator and Bard with stream writing, requests with images (for Bard only), multiple languages, admin control, automatic proxy searcher, data logging and more!

| <img src="Logo.png" alt="GPT-Telegramus logo"/> | <h3>The best Telegram bot for ChatGPT, EdgeGPT (aka Bing AI), DALL-E, Bing Image generator and Bard with stream writing, requests with images (for Bard only), multiple languages, admin control, automatic proxy searcher, data logging and more!</h3> |
|-------------------------------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|

<div style="width:100%;text-align:center;">
<p align="center">
<img src="Logo.png" alt="GPT-Telegramus logo" width="100"/>
<img src="https://badges.frapsoft.com/os/v1/open-source.png?v=103" >
</p>
</div>
<div style="width:100%;text-align:center;">
<p align="center">
<img src="https://badges.frapsoft.com/os/v1/open-source.png?v=103" >
<a href="https://www.youtube.com/@F3RNI"><img alt="YouTube" src="https://img.shields.io/badge/-YouTube-red" ></a>
<a href="https://f3rni.bandcamp.com"><img alt="Bandcamp" src="https://img.shields.io/badge/-Bandcamp-cyan" ></a>
<a href="https://open.spotify.com/artist/22PQ62alehywlYiksbtzsm"><img alt="Spotify" src="https://img.shields.io/badge/-Spotify-green" ></a>
Expand Down Expand Up @@ -69,29 +71,33 @@ Or message me if you would like to donate 💰

## ❓ Get started

1. Install Python and pip
1. Install Python 3.10, `venv` and `pip`
2. Download source code
3. Install requirements `pip install -r requirements.txt --upgrade`
4. Access the modules you want to use (Generate an API key to ChatGPT / DALL-E, save cookies for EdgeGPT / Bard)
5. Carefully change all the settings (in the `config.json` file) to suit your needs. If you have questions regarding any setting, open an issue, I will add a more detailed description
6. Create bot at https://t.me/BotFather
7. Type Bot's token into `api_key` in `telegram` in `config.json` file
8. Run main script `python main.py`
3. Create venv `python -m venv venv` / `python3 -m venv venv` / `python3.10 -m venv venv`
4. Activate venv `source venv/bin/activate` / `venv\Scripts\activate.bat`
5. Check python version using `python --version` command. It should be 3.10.X
6. Install requirements `pip install -r requirements.txt --upgrade`
7. Access the modules you want to use (Generate an API key / access token for ChatGPT / DALL-E, save cookies for EdgeGPT / Bard)
8. Start ChatGPTProxy for ChatGPT (see **🔗 Chat-GPT Base URL (proxy)** section)
9. Carefully change all the settings (in the `config.json` file) to suit your needs. If you have questions regarding any setting, open an issue, I will add a more detailed description
10. Create bot at https://t.me/BotFather
11. Type Bot's token into `api_key` in `telegram` in `config.json` file
12. Run main script `python main.py`

- **ChatGPT**
- Browser-like Chat-GPT. Currently, without extensions and image requests (text only) (because I don't have a paid account to test it)
- Stream response support
- Chat history support
- Works better with API type 1 and an access_token for authentication
- Note: Please refer to the `🔗 Chat-GPT Base URL (proxy)` section for correct usage.
- **Note**: Please refer to the `🔗 Chat-GPT Base URL (proxy)` section for correct usage.
- **DALL·E**
- Image generation tool from OpenAI
- Requires an OpenAI account with unexpired credits
- **EdgeGPT (aka Bing AI) (aka Sydney)**
- Supports conversation style `/style`
- Stream response support
- Chat history support
- Web-browsing and sources support
- Web-browsing (probably) and sources support
- Unfortunately, it can't accept images as input yet, nor can it generate them. Please use Bing ImageGen to generate images.
- **Bing ImageGen**
- Bing Image Generator. Used as a separate module due to issues with the EdgeGPT module
Expand Down Expand Up @@ -124,14 +130,16 @@ If you want to add a language, create a pull request 💜

## 🐧 Running as service on linux

1. Install Python and pip
2. Clone repo
1. Install Python 3.10, `venv` and `pip`
2. Download source code
3. Create venv `python -m venv venv` / `python3 -m venv venv` / `python3.10 -m venv venv`
4. Clone repo
1. `git clone https://github.com/F33RNI/GPT-Telegramus/`
2. `cd GPT-Telegramus`
3. Edit `config.json`
4. Install systemd
5. Edit `config.json`
6. Install systemd
1. `sudo apt-get install -y systemd`
5. Create new service file
7. Create new service file
1. `sudo nano /etc/systemd/system/gpt-telegramus.service`
```
[Unit]
Expand All @@ -140,20 +148,22 @@ If you want to add a language, create a pull request 💜
[Service]
Type=simple
Restart=always
Restart=on-failure
RestartSec=5
WorkingDirectory=YOUR DIRECTORY HERE/GPT-Telegramus
ExecStart=YOUR DIRECTORY HERE/GPT-Telegramus/run.sh
RestartSec=5
[Install]
WantedBy=multi-user.target
```
6. Reload systemctl daemon
8. Reload systemctl daemon
1. `sudo systemctl daemon-reload`
7. Enable and start service
9. Enable and start service
1. `sudo systemctl enable gpt-telegramus`
2. `sudo systemctl start gpt-telegramus`
10. Note: Please use `sudo systemctl kill gpt-telegramus` and then `sudo systemctl stop gpt-telegramus` if only `sudo systemctl stop gpt-telegramus` not working
----------
Expand Down Expand Up @@ -236,7 +246,8 @@ Default base URL by acheong08/ChatGPT stopped working. Below is an instruction o
[Service]
Type=simple
Restart=always
Restart=on-failure
RestartSec=5
# Proxy (if needed, or remove this and next line)
Environment="http_proxy=http://USERNAME:PASSWORD@IP:PORT"
Expand All @@ -247,7 +258,6 @@ Default base URL by acheong08/ChatGPT stopped working. Below is an instruction o
WorkingDirectory=PATH_TO_ChatGPTProxy_DIRECTORY
ExecStart=PATH_TO_ChatGPTProxy_DIRECTORY/ChatGPTProxy
RestartSec=5
[Install]
WantedBy=multi-user.target
Expand All @@ -267,7 +277,9 @@ Default base URL by acheong08/ChatGPT stopped working. Below is an instruction o
## 🌎 Proxy to bypass geo-blocking
### NOT TESTED
### NOT TESTED AND MOST LIKELY WILL NOT WORK
**I won't respond to the issue if it's related to auto proxy**
It is possible to bypass geo-blocking of ChatGPT, EdgeGPT, DALL-E or Bard. GPT-Telegramus includes automatic proxy-list downloading with periodic checks
Expand Down Expand Up @@ -339,7 +351,7 @@ You can enable and configure data collection in config in `data_collecting` bloc
## ✨ Contribution
- Anyone can contribute! Just create a pull request
- Anyone can contribute! Just create a **pull request**
----------
Expand Down
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from JSONReaderWriter import load_json

# GPT-Telegramus version
__version__ = "3.6.0"
__version__ = "3.6.1"

# Logging level
LOGGING_LEVEL = logging.INFO
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ requests>=2.28.1
telegram>=0.0.1
psutil>=5.9.4
BingImageCreator>=0.5.0
langdetect>=1.0.9
4 changes: 2 additions & 2 deletions run.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
pip install -r requirements.txt --upgrade
python3 main.py
venv/bin/python -m pip install -r requirements.txt --upgrade
venv/bin/python main.py

0 comments on commit 6ec6dcd

Please sign in to comment.