noes14155 / Telegrambot-with-GPT

telegram bot with gpt
GNU General Public License v2.0
79 stars 30 forks source link
aiogram-bot chatbot chatgpt-python free-gpt python telegram

Deploy on Railway

Telegrambot-with-GPT4free

🤖 A Telegram bot powered by ChatGPT using the Aiogram API.

ℹ️ Note: The Hugging Face token is only required for image captioning.

✨ Features:

Installation Steps

Linux

Download or clone this repository
Go to the directory

git clone https://github.com/noes14155/Telegrambot-with-GPT4free
cd Telegrambot-with-GPT4free

Copy example.env file to .env

cp example.env .env

Change environment variables in .env file Environment Variables

nano .env

Create virtual environment for this project/directory

python3 -m venv venv
source venv/bin/activate

Install the requirements

apt install -y flac ffmpeg tesseract-ocr

pip install -r requirements.txt

Run the bot

python main.py

Windows

  1. Download or clone this repository:

    git clone https://github.com/noes14155/Telegrambot-with-GPT4free
    cd Telegrambot-with-GPT4free
  2. Copy the example.env file to .env

  3. Change the environment variables in the .env file using a text editor of your choice.

  4. Create a virtual environment for this project/directory:

python -m venv venv
venv\Scripts\activate
  1. Install the required dependencies:
    pip install -r requirements.txt
  2. Install additional dependencies:
  1. Run the bot:
    python main.py

Docker

Build (change environment variables before build)

Uncomment this section (If yu want to use gpt4free)

  g4f_server:
    container_name: g4f_server
    ports:
      - '1337:1337'
    environment:
      - PYTHONUNBUFFERED=1
    build:
      context: ./interference
      dockerfile: Dockerfile
    restart: always

Build containers

docker-compose up --build -d

Environment Variables

To run this project, you will need to create a .env file or rename the existing example.env to .env and add the following environment variables

🎉 You're all set! Enjoy using the Telegram bot with ChatGPT!

Contributors