Support the project by buying and listening to my music ๐ต
- ๐ฆ Bandcamp
- ๐ง SoundCloud
Or message me if you would like to donate ๐ฐ
- 1๏ธโฃ Sprav04ka - Tofii'skovyi' language, Testing, Super beautiful DIY jack o'lantern (for poster), Project Logo, Motivation
- 2๏ธโฃ Sergey Krashevich - Docker, GitHub Actions
- 3๏ธโฃ Wahit Fitriyanto - Indonesian language
- 4๏ธโฃ Alexander Fadeyev - EdgeGPT Fix
- Python 3.10
- GO lang (for ChatGPTProxy)
- Unblocked access to the telegram bot official API
- Other requirements specified in the
requirements.txt
file
- ChatGPT (ChatGPT by OpenAI): https://chat.openai.com/chat
- Bing chat (EdgeGPT by Microsoft): https://bing.com/chat
- DALL-E (DALLE by OpenAI): https://openai.com/dall-e-2/
- Bard (Bard by Google): https://bard.google.com/
- acheong08/ChatGPT (API): https://github.com/acheong08/ChatGPT
- acheong08/EdgeGPT (API): https://github.com/acheong08/EdgeGPT
- jacobgelling/EdgeGPT (API): https://github.com/jacobgelling/EdgeGPT
- dsdanielpark/Bard-API (API): https://github.com/dsdanielpark/Bard-API
- acheong08/BingImageCreator (API): https://github.com/acheong08/BingImageCreator
- python-telegram-bot (Telegram bot API): https://github.com/python-telegram-bot/python-telegram-bot
- Install Python 3.10,
venv
andpip
- Download source code
- Create venv
python -m venv venv
/python3 -m venv venv
/python3.10 -m venv venv
- Activate venv
source venv/bin/activate
/venv\Scripts\activate.bat
- Check python version using
python --version
command. It should be 3.10.X - Install requirements
pip install -r requirements.txt --upgrade
- Access the modules you want to use (Generate an API key / access token for ChatGPT / DALL-E, save cookies for EdgeGPT / Bard)
- Start ChatGPTProxy for ChatGPT (see ๐ Chat-GPT Base URL (proxy) section)
- 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 - Create bot at https://t.me/BotFather
- Type Bot's token into
api_key
intelegram
inconfig.json
file - 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.
- 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 (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.
- Supports conversation style
- Bing ImageGen
- Bing Image Generator. Used as a separate module due to issues with the EdgeGPT module
- Free and unlimited
- Bard
- Google's Bard AI
- Chat history support
- Web-browsing support (probably)
- Now supports requests with images (you can send an image with text to it) NEW
- You can edit telegram bot messages by editing file
messages.json
. You can add new lines by adding\\n
- You can add a new language simply by copying one of existing language (with
{}
) to the end of file (before the last]
) and translating all values
Note: make sure you don't delete argumensts {0}
, {1}
, ... in message and please restart python script to apply changes
- ๐บ๐ธ English
- ๐ท๐บ ะ ัััะบะธะน
- โโ ๏ธ ะขะพัะธะนัะบะพะฒัะน
- ๐ฎ๐ฉ Bahasa Indonesia
If you want to add a language, create a pull request ๐
- Install Python 3.10,
venv
andpip
- Download source code
- Create venv
python -m venv venv
/python3 -m venv venv
/python3.10 -m venv venv
- Clone repo
git clone https://github.com/F33RNI/GPT-Telegramus/
cd GPT-Telegramus
- Edit
config.json
- Install systemd
sudo apt-get install -y systemd
- Create new service file
sudo nano /etc/systemd/system/gpt-telegramus.service
[Unit] Description=GPT-Telegramus service After=multi-user.target [Service] Type=simple Restart=on-failure RestartSec=5 WorkingDirectory=YOUR DIRECTORY HERE/GPT-Telegramus ExecStart=YOUR DIRECTORY HERE/GPT-Telegramus/run.sh [Install] WantedBy=multi-user.target
- Reload systemctl daemon
sudo systemctl daemon-reload
- Enable and start service
sudo systemctl enable gpt-telegramus
sudo systemctl start gpt-telegramus
- Note: Please use
sudo systemctl kill gpt-telegramus
and thensudo systemctl stop gpt-telegramus
if onlysudo systemctl stop gpt-telegramus
not working
- Install Python 3.10 if not installed
-
sudo apt-get update sudo apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev wget https://www.python.org/ftp/python/3.10.13/Python-3.10.13.tgz sudo tar zxf Python-3.10.13.tgz cd Python-3.10.13 sudo ./configure --enable-optimizations sudo make -j 4 sudo make altinstall
- Check version by typing
python3.10 -V
. After this, you should usepython3.10
command instead ofpython
or you can add it to thebashrc
by typingecho "alias python=/usr/local/bin/python3.10" >> ~/.bashrc
-
- For ChatGPTProxy, install GO and tls-client
-
sudo apt-get install golang-go git clone https://github.com/bogdanfinn/tls-client.git cd tls-client/cffi_dist sudo GOOS=linux CGO_ENABLED=1 GOARCH=arm64 CC="gcc" /usr/local/go/bin/go build -buildmode=c-shared -o tls-client-arm64.so mv ./dist/tls-client-arm64.so /home/pi/.local/lib/python3.10/site-packages/tls_client/dependencies/ mv ./dist/tls-client-arm64.h /home/pi/.local/lib/python3.10/site-packages/tls_client/dependencies/
-
- Build ChatGPTProxy
-
git clone https://github.com/acheong08/ChatGPTProxy /usr/local/go/bin/go build
- Create and start service as mention in the ๐ Chat-GPT Base URL (proxy) section
-
- Follow the ๐ง Running as service on linux guide
WARNING: not tested
- Install Docker
- Clone repo
- Build container
docker buildx build -t telegramus --load -f Dockerfile .
- Run the container
docker run -d --name gpt-telegramus --restart on-failure telegramus
Note: You can specify settings and messages files and chats folder location. (default location is in project folder):
docker run -d -e TELEGRAMUS_SETTINGS_FILE="PATH_TO_config.json" --name gpt-telegramus --restart on-failure telegramus
Default base URL by acheong08/ChatGPT stopped working. Below is an instruction on how to launch your own ChatGPT proxy server (on Linux)
- Install GO
sudo apt-get update
sudo apt-get install golang-go
- Clone acheong08/ChatGPTProxy repo
git clone https://github.com/acheong08/ChatGPTProxy
cd ChatGPTProxy
- Build it
go build
- Install systemd
sudo apt-get install systemd
- Create service
sudo nano /etc/systemd/system/chatgpt-proxy.service
[Unit] Description=ChatGPTProxy service After=multi-user.target [Service] Type=simple Restart=on-failure RestartSec=5 # Proxy (if needed, or remove this and next line) Environment="http_proxy=http://USERNAME:PASSWORD@IP:PORT" # ChatGPT login Environment="OPENAI_EMAIL=YOUR_EMAIL" Environment="OPENAI_PASSWORD=YOUR_PASSWORD" WorkingDirectory=PATH_TO_ChatGPTProxy_DIRECTORY ExecStart=PATH_TO_ChatGPTProxy_DIRECTORY/ChatGPTProxy [Install] WantedBy=multi-user.target
- Reload systemctl daemon
sudo systemctl daemon-reload
- Enable and start service
sudo systemctl enable chatgpt-proxy
sudo systemctl start chatgpt-proxy
- See logs to make sure it's running and see current port
systemctl status chatgpt-proxy
- Add it's IP to
config.json
- ex.
"base_url": "http://127.0.0.0:9090/api/",
- ex.
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
- Set
enabled
inproxy_automation
inconfig.json
totrue
- Set
auto
inproxy
for modules you want to connect automatic proxy search - Restart app and hope for the best.
GPT-Telegramus will download the proxy list itself and start trying various proxies (see console for logs).
Sometimes, searching for a proxy can take a long time. If you think that the found proxy is not suitable, you can restart the bot using the /restart
command
- To use manual proxy, specify tham in
http://IP:Port
orhttp://user:password@IP:Port
format (even if they are HTTPS proxies) inproxy
for modules you need
- ๐
/start
- Welcome message and bot version - โ
/help
- Show this message โ๏ธ /module
- Change module to chat with- ๐งน
/clear
- Clear chat history - ๐
/lang
- Change the language - ๐
/chatid
- Show your chat_id /style
- Bing AI conversation style/chatgpt <Text request>
- Request to the ChatGPT module/dalle <Text request>
- Request to the DALL-E module/bing <Text request>
- Request to the Bing AI module/bingigen <Text request>
- Request to the Bing Image Generator/bard <Text request>
- Request to the Bard module
- ๐ฌ
/queue
- Show requests queue - ๐
/restart
- Restart proxies and telegram bot - ๐ค
/users
- Show list of all users - ๐จ
/ban <id> [reason]
- Ban a user by their id with reason (optional) - ๐
/unban <id>
- Unban a user by their id - ๐ข
/broadcast <message>
- Send text message to everyone except banned users
GPT-Telegramus saves chat history for some modules locally ("conversations_dir": "conversations"
) to keep conversation with users
GPT-Telegramus has a built-in data collecting function (request and response)
- For ChatGPT, EdgeGPT (aka Bing AI) and Bard response is saved as plain text and Base64-encoded images
- For DALL-E and Bing Image generator response is saved as Base64-encoded image (in the same text file)
You can enable and configure data collection in config in data_collecting
block
NOTE: Please make sure you notify your bot users that you are collecting data
- Add some free GPT-4 model
- Add image input and generation for EdgeGPT (and ChatGPT?)
- Add Bard's text-to-speech
- Add list of commands
- Add an API, so you can use GPT-Telegramus from outside the bot
- Anyone can contribute! Just create a pull request
- If you find a bug in GPT-Telegramus, please create an Issue