This Django project is a Telegram service that allows users to interact with a Telegram bot through a Django-based web application. The project integrates with the Telegram Bot API to send and receive messages, enabling seamless communication between users and the bot.
- Telegram Bot Integration: Connects to the Telegram Bot API to send and receive messages.
- Web Interface: Provides a Django-based web interface for users to interact with the Telegram bot.
- User Authentication: Supports user authentication to ensure secure access to the service.
- Message Logging: Logs messages exchanged between users and the bot for analytics and debugging purposes.
- Python 3.x
- Django
- Django REST Framework
-
Clone the repository:
git clone https://github.com/tyrohansen/django_telegram_bot
-
Navigate to the project directory:
cd django_telegram_bot
-
Install dependencies:
pip install -r requirements.txt
-
Configure your Telegram bot:
- Create a new bot using the BotFather on Telegram.
- Obtain the bot token.
- Update the
TELEGRAM_TOKEN
variable in.env
with your bot token.
-
Apply migrations:
python manage.py migrate
-
Run the development server:
python manage.py runserver
-
Access the web interface at
http://127.0.0.1:8000/
.
- Register/Login to the web interface using your credentials.
- Start a conversation with your Telegram bot by searching for its username on Telegram.
- Interact with the bot through the web interface.
- Messages exchanged between users and the bot will be logged for analysis.
TELEGRAM_TOKEN
: Token provided by the BotFather for accessing the Telegram Bot API.DEBUG
: Set toTrue
for development,False
for production.- Additional Django settings can be configured in
.env
as per project requirements.
Contributions are welcome! Please fork the repository, make your changes, and submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.