Code Monkey home page Code Monkey logo

telegrambot's Introduction

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:

  • Supports OCR with Tesseract in addition to salesforce blip image captioning.
  • Easy to translate to your own language with multi-language support.
  • Internet access using duckduckgo_search.
  • Supports voice transcription with speech_recognition
  • Image generation using Stability Diffusion and DALL-E.
  • Plugin support for DuckDuckGo search and news (under testing).

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
wget https://github.com/tesseract-ocr/tessdata_fast/raw/main/script/Devanagari.traineddata -P /usr/share/tesseract-ocr/4.00/tessdata/script/
EXPORT TESSDATA_PREFIX=/usr/share/tesseract-ocr/4.00/tessdata

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
  1. Copy the example.env file to .env

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

  3. 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
  1. Install additional dependencies:
  • Install Tesseract OCR:

    • Download the Windows installer from the Tesseract OCR GitHub page.
    • Run the installer and make sure to check download Additional script data option in the installation options.
    • Add the Tesseract installation directory to the system's PATH environment variable.
  • Install FFmpeg:

    • Download the latest static build of FFmpeg for Windows from the official FFmpeg website.
    • Extract the downloaded ZIP file to a location of your choice.
    • Add the FFmpeg bin directory to the system's PATH environment variable.
  1. Run the bot:
python main.py

Docker

Build (change environment variables before build)

docker build -t telegrambot_gpt4free:latest "." 

Docker-compose

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

telegrambot's People

Contributors

noes14155 avatar mlnekit avatar wahitftry avatar vasmarfas avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.