Skip to content

arc53/tg-bot-docsgpt-extenstion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Telegram DocsGPT extension

This repository contains the source code for a Telegram bot that leverages DocsGPT to provide intelligent responses to user queries. This bot is an extension for DocsGPT.

Features

  • Responds to user queries with intelligent answers using DocsGPT.
  • Maintains conversation history for context-aware responses.
  • Easily deployable using Docker.

Prerequisites

Before you begin, ensure you have met the following requirements:

  • You have registered a bot with BotFather on Telegram and obtained a TOKEN.
  • You have created an API key on DocsGPT to access your AI's data and prompt.

Installation

Using Python

  1. Clone the repository:

    git clone https://github.com/arc53/tg-bot-docsgpt-extenstion.git
    cd tg-bot-docsgpt-extenstion
  2. Set up a virtual environment:

    python3 -m venv venv
    • On macOS and Linux:
      source venv/bin/activate
    • On Windows:
      .\venv\Scripts\activate
  3. Install dependencies:

    pip install -r requirements.txt
  4. Create a .env file in the project directory and add your environment variables:

    TELEGRAM_BOT_TOKEN=<your-telegram-bot-token>
    API_KEY=<your-api-key>
    
  5. Run the bot:

    python bot.py

Using Docker

  1. Clone the repository:

    git clone https://github.com/arc53/tg-bot-docsgpt-extenstion.git
    cd tg-bot-docsgpt-extenstion
  2. Build the Docker image:

    docker build -t telegram-gpt-bot .
  3. Create a .env file in the project directory and add your environment variables:

    TELEGRAM_BOT_TOKEN=<your-telegram-bot-token>
    API_KEY=<your-api-key>
    
  4. Run the Docker container:

    docker run --env-file .env telegram-gpt-bot

Usage

Telegram Commands

  • /start - Initiates the conversation with the bot.
  • /help - Provides help information.

General Conversation

Simply type any message, and the bot will respond with an intelligent answer based on the context of the conversation maintained in context.chat_data.

File Description

  • bot.py: The main script for running the bot.
  • requirements.txt: Python dependencies required by the bot.
  • Dockerfile: Instructions to build the Docker image.
  • .env: File containing environment variables (not included, must be created).

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments

Releases

No releases published

Packages

No packages published

Languages