Telegram-GPT is a versatile chatbot integration for Telegram, utilizing OpenAI's GPT models. Developed with NestJS, it provides an intelligent chatbot experience on Telegram. The bot can operate in two modes: long polling and webhook, determined by the TELEGRAM_WEBHOOK_URL
environment variable.
- Dual Operating Modes: Runs as a long polling bot or a webhook bot based on configuration.
- GPT-Powered Conversations: Leverages OpenAI's GPT models for engaging interactions.
- NestJS Framework: Delivers a robust, scalable architecture.
- TypeORM for Data Management: Efficient user and interaction data handling.
- Modular Structure: Organized for maintainability and scalability.
- Unit Testing Framework: Ensures the reliability of the application.
Requires Node.js and npm.
git clone [Repository URL]
cd telegram-gpt
npm install
Set up the necessary environment variables:
TELEGRAM_BOT_TOKEN="your-telegram-bot-token"
# For webhook mode
PORT="http-server-port"
TELEGRAM_WEBHOOK_URL="your-webhook-url" # Optional
The application can run in two modes based on the TELEGRAM_WEBHOOK_URL:
- Long Polling Mode: Default mode if
TELEGRAM_WEBHOOK_URL
is not set. - Webhook Mode: Set
TELEGRAM_WEBHOOK_URL
to enable.
npm start
Interact with the ChatbBot on Telegram. The bot uses AI to provide relevant responses.
To contribute to the project:
- Fork the repository.
- Create a feature branch (
git checkout -b feat/YourFeature
). - Commit changes (
git commit -am 'Add YourFeature'
). - Push to the branch (
git push origin feat/YourFeature
). - Create a Pull Request.
Ensure functionality with:
npm test
This project is licensed under the MIT License - see the LICENSE file for details.