F33RNI / GPT-Telegramus

💜 The best free Telegram bot for ChatGPT, Microsoft Copilot (aka Bing AI / Sidney / EdgeGPT), Microsoft Copilot Designer (aka BingImageCreator), Gemini and Groq with stream writing, requests with images, multiple languages, admin control, data logging and more!
GNU Affero General Public License v3.0
335 stars 104 forks source link
ai bing bing-image-creator bot chatgpt dalle edge-ai edgegpt gemini google gpt groq linux microsoft microsoft-copilot-ai openai proxy python telegram

🤖 GPT-Telegramus v5

GPT-Telegramus logo

The best free Telegram bot for ChatGPT, Microsoft Copilot (aka Bing AI / Sidney / EdgeGPT), Microsoft Copilot Designer (aka BingImageCreator), Gemini and Groq with stream writing, requests with images, multiple languages, admin control, data logging and more!

YouTube Bandcamp Spotify SoundCloud

Project banner


🚧 GPT-Telegramus is under development

😔 Currently, GPT-Telegramus doesn't have paid ChatGPT and DALL-E support

📈 GPT-Telegramus v5 is an updated and highly refactored version of the old GPT-Telegramus

📄 Documentation is also under development! Consider reading docstring for now

🐛 If you find a bug in GPT-Telegramus, please create an Issue

p.s. Due to my studies, I don't have much time to work on the project 😔


😋 Support project

💜 Please support the project so that I can continue to develop it

Star History Chart


🤗 Contributors


📨 Project channel and demo

⚠️ Please do not overload the bot and use it only as a demo version


🏗️ Requirements


📙 Project based on


❓ Get started

See 🐧 Running as service on linux, 🍓 Running on Raspberry Pi (ARM), 🐋 Running in Docker sections for more info

  1. Install Python 3.10 / 3.11 (not tested on other versions), venv and pip
  2. Download source code (clone repo)
  3. Create venv python -m venv venv / python3 -m venv venv / python3.10 -m venv venv / python3.11 -m venv venv
  4. Activate venv source venv/bin/activate / venv\Scripts\activate.bat
  5. Check python version using python --version command
  6. Install requirements pip install -r requirements.txt --upgrade
  7. Carefully change all the settings in config.json file and in each *.json file inside module_configs directory. If you have questions regarding any setting, open an issue, I'll try to add a more detailed description
  8. Run main script python main.py

🐧 Running as service on linux

  1. Install Python 3.10 / 3.11 (not tested on other versions), venv and pip

  2. Clone repo

    1. git clone https://github.com/F33RNI/GPT-Telegramus.git
    2. cd GPT-Telegramus
  3. Create venv python -m venv venv / python3 -m venv venv / python3.10 -m venv venv / python3.11 -m venv venv

  4. Carefully change all the settings in config.json file and in each *.json file inside module_configs directory

  5. Install systemd

    1. sudo apt-get install -y systemd
  6. Create new service file

    1. 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
      
  7. Reload systemctl daemon

    1. sudo systemctl daemon-reload
  8. Enable and start service

    1. sudo systemctl enable gpt-telegramus
    2. sudo systemctl start gpt-telegramus
  9. Note: Please use sudo systemctl kill gpt-telegramus and then sudo systemctl stop gpt-telegramus if only sudo systemctl stop gpt-telegramus not working


🍓 Running on Raspberry Pi (ARM)

  1. Install Python 3.11 or later (not tested) if not installed

    1. 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.11.8/Python-3.11.8.tgz
      sudo tar zxf Python-3.11.8.tgz
      cd Python-3.11.8
      sudo ./configure --enable-optimizations
      sudo make -j 4
      sudo make altinstall
    2. Check version by typing python3.11 -V. After this, you should use python3.11 command instead of python or you can add it to the bashrc by typing echo "alias python=/usr/local/bin/python3.11" >> ~/.bashrc

  2. Follow the 🐧 Running as service on linux guide


🐋 Running in Docker

From GitHub Package

  1. Clone repo or download config.json and module_configs and langs
  2. Edit the config.json, set options in the files section to the path in the container (/app/config/<FILE_NAME>)
  3. Run the container

    docker run -d -e TELEGRAMUS_CONFIG_FILE="/app/config/config.json" -v <YOUR_CONFIG_FOLDER>:/app/config --name gpt-telegramus --restart on-failure ghcr.io/f33rni/gpt-telegramus:latest

    If you want to try the preview version

    docker run -d -e TELEGRAMUS_CONFIG_FILE="/app/config/config.json" -v <YOUR_CONFIG_FOLDER>:/app/config --name gpt-telegramus --restart on-failure ghcr.io/f33rni/gpt-telegramus:edge

Build Manually

  1. Install Docker

  2. Clone repo

  3. Build container

    docker buildx build -t telegramus --load -f Dockerfile .
  4. Run the container

    docker run -d --name gpt-telegramus --restart on-failure telegramus

    or if you want to use a custom config

    docker run -d -e TELEGRAMUS_CONFIG_FILE="/app/config/config.json" -v <YOUR_CONFIG_FOLDER>:/app/config --name gpt-telegramus --restart on-failure telegramus

🌐 Bot messages

Currently available languages

You can add a new language. For that:

  1. Copy any existing language file (inside langs directory)
  2. Rename it according to Set2/T (3-letters code) ISO 639 https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes
  3. Translate each entry
  4. Create a pull request 💜

You can add new lines by adding \n

⚠️ Please make sure you haven't messed up the string formatting structure {this_type}


🤖 Telegram bot commands

Admin commands


📜 Data collecting

GPT-Telegramus has a built-in data collecting function (saves requests and responses in a files)

You can enable and configure data collection in config.json in data_collecting section

⚠️ Please make sure you notify your bot users that you're collecting data


📝 TODO


✨ Contribution