This is a Node.js application that hosts a Telegram bot which communicates with the ChatGPT API. This bot allows users to interact with ChatGPT's AI language model to generate text.
Before running the application, make sure you have the following installed:
- Node.js v14 or higher
- npm package manager
- A Telegram bot token from BotFather
- An API key from ChatGPT
- Clone the repository or download the source code
- Install dependencies by running npm install
- Create a
.env
file in the root directory and add the following environment variables:
# It's not language of ChatGPT answers. It's language for errors and some chat commands
LANGUAGE="en"
#It's your PRIVATE tokens. Do not distribute them, keep them safe
OPENAI_TOKEN=""
TELEGRAM_BOT_TOKEN=""
- Start the application by running
npm start
Once the application is running, you can interact with the bot by sending messages to it in Telegram. The bot will respond with generated text based on the user's input. To start a conversation with the bot, search for it by name in Telegram and write /start
.
Contributions are welcome! To contribute, please follow these steps:
- Fork the repository
- Create a new branch for your feature or bug fix
- Make changes and commit them
- Push your changes to your fork
- Submit a pull request to the main repository
This project is licensed under the MIT License - see the LICENSE file for details.