Code Monkey home page Code Monkey logo

chatgptbot's Introduction

ChatGPT Telegram Bot

License Issues Pull Requests

This is a Telegram bot that uses the OpenAI's GPT-3 model to answer questions and generate responses. The bot is written in Python and uses the Telethon library to interact with the Telegram API, and the OpenAI API to communicate with the GPT-3 model. It also uses the Telegraph API to create a Telegraph article of the response and sends the link to the user as a reply.

How to use

To use the bot, send your questions along with the /ask command. For example, if you want to ask "What is the weather today?", you should send the message "/ask What is the weather today?"

How to run

To run the bot, you need to have the following things:

  • A Telegram account and a bot token
  • An OpenAI API key (if you have more than one key the bot will select next key in case of usage exceed error)
  • A Telegraph API token
  • Python 3.8 or higher

Once you have these things, you can clone the repository and install the dependencies by running the following command:

  
  git clone https://github.com/hybridvamp/chatgptbot.git
  cd chatgptbot
  pip3 install -r requirements.txt
  

Then, you need to set the following environment variables:

  • API_ID
  • API_HASH
  • BOT_TOKEN
  • API_KEY1
  • API_KEY2 (optional)
  • API_KEY3 (optional)
  • API_KEY4 (optional)
  • API_KEY5 (optional)
  • TELEGRAPH_TOKEN

Finally, you can run the bot by running the following command:

  python3 main.py

Contribution and Pull Requests

Contributions and Pull Requests are most welcome. If you have any suggestions or improvements, please feel free to open an issue or submit a pull request.

Contact

For any queries and support, you can contact me on Telegram at @hybrid_chat

chatgptbot's People

Contributors

hybridvamp 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.