ChatGPT, EdgeGPT, DALL-E and Bard implementation as a telegram bot with admin control, automatic proxy searcher and data logging
Support the project by buying and listening to my music 🎵
- 🟦 Bandcamp
- 🟧 SoundCloud
- ChatGPT (ChatGPT by OpenAI): https://chat.openai.com/chat
- EdgeGPT (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
- acheong08/Bard (API): https://github.com/acheong08/Bard
- python-telegram-bot (Telegram bot API): https://github.com/python-telegram-bot/python-telegram-bot
- Install Python and pip
- Download source code
- Install requirements
pip install -r requirements.txt --upgrade
- Access the modules you want to use (Generate an API key to ChatGPT / DALL-E, save cookies for EdgeGPT / Bard)
- 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
You can edit telegram bot messages by editing file messages.json
. You can add new lines by adding \\n
Note: make sure you don't delete argumensts {0}
, {1}
, ... in message and please restart script to apply changes
- Install Python and pip
- Clone repo
- 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=always WorkingDirectory=YOUR DIRECTORY HERE/GPT-Telegramus ExecStart=YOUR DIRECTORY HERE/GPT-Telegramus/run.sh RestartSec=5 [Install] WantedBy=multi-user.target
- Reload systemctl daemon
sudo systemctl daemon-reload
- Enable service
sudo systemctl enable gpt-telegramus.service
- Start service
sudo systemctl start gpt-telegramus.service
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
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
- 📄
/start
- Welcome message and bot version - 📙
/help
- Show this message - 🤖
/chatgpt <request>
- ChatGPT request - 🔵
/edgegpt <request>
- EdgeGPT request - 🖥
/bard <request>
- Bard request - 🖼
/dalle <request>
- Draw a picture with DALL-E - 🧹
/clear <module>
- Clear chat history (chatgpt / edgegpt / bard) - 🆔
/chatid
- Show your chat_id
💬 Or just send a text message to make a request
- 💬
/queue
- Show requests queue - 🔃
/restart
- Restart modules 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 only ChatGPT chat history locally ("conversations_dir": "conversations"
). Other modules either have a built-in ability to save chat history or do not have the ability to split conversations
GPT-Telegramus has a built-in data collecting function (request and response)
- For ChatGPT, EdgeGPT and Bard response is saved as plain text
- For DALL-E 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
- Anyone can contribute! Just create a pull request