Coder Social home page Coder Social logo

zxchatgpt's Introduction

ZXChatGpt

Telegram bot to communicate with ChatGPT

link to the bot - @zxchatgptbot

Using bot

To start communicating with the bot, just write him any message. This message will send to the ChatGPT. The bot also has the following commands:

  • /q <message> to communicate with the bot in groups or supergroups (not private chats)
  • /context displays the communication history with the bot in the current chat
  • /deletecontext delete the dialog context with the bot in the current chat

Setup bot

Before launching the bot you need to create a file .env in which you should write the following:

  • BOT_TOKEN - the telegram bot token received in BotFather
  • OPENAI_API_KEY - openai api key received in OpenAI API

The structure of .env file:

BOT_TOKEN=your_token
OPENAI_API_KEY=your_api_key

Also, you should install the requirements using the command: pip install -r requirements.txt.

Now you can launch the bot using the command python main.py.

[P.S.] The dialog contexts of each chat are stored in the data/context.json file that will be created automatically.

Docker

  • Create a directory data if it is not created: mkdir data
  • Create a bot image: docker build -t zxchatgpt .
  • Create and run a container: docker run --name zxchatgpt -v zxchatgpt-data:/data -d zxchatgpt

zxchatgpt's People

Contributors

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