Welcome to the DaysInYearPassedBot project! This is a Telegram bot that provides information on how many days have passed in the current year, presented as a percentage.
- Introduction
- Features
- Prerequisites
- Getting Started
- Running with Docker Compose
- Configuration
- Usage
- Contributing
The DaysInYearPassedBot is a Telegram bot built using the Spring Boot. It fetches and sends updates to users, providing information about the percentage of days that have already passed in the current year. Users can interact with the bot by sending specific commands.
- Send daily updates to users with the percentage of days passed.
- Users can start and stop receiving updates by sending the
/startand/stopcommands. - Configurable bot settings through the
application.propertiesfile.
Before you begin, ensure you have met the following requirements:
- Java Development Kit (JDK) 17 or higher
- Maven for building the project
- PostgreSQL database (You can use a Docker container for development)
- A Telegram bot token (create one on Telegram's BotFather)
- Clone this repository:
git clone https://github.com/anesmy/DaysInYearPassedBot.git - Navigate to the project directory:
cd DaysInYearPassedBot - Create a PostgreSQL database and configure the database connection in
src/main/resources/application.properties. - Build the project using Maven:
mvn clean install - Run the application:
java -jar target/DaysInYearPassedBot-1.0.jar - Start chatting with your Telegram bot!
This project includes a Docker Compose configuration to simplify running the application and its required services.
- Open a terminal window.
- Navigate to the project directory containing the
docker-compose.ymlfile. - Run the following command to start the application and associated services:
docker-compose up
This will create and run containers for your application.
You need to configure the application through the application.properties file. Provide your bot's token and database connection details:
Bot Configuration
bot.name=YourBotName
bot.token=YourBotToken
Database Configuration
spring.datasource.url=jdbc:postgresql://your-database-url/your-database-name
spring.datasource.username=your-database-username
spring.datasource.password=your-database-password
To interact with the bot, open your Telegram app and search for your bot by its name. Send the following commands:
- /start: Start receiving daily updates.
- /stop: Stop receiving updates.
Contributions are welcome! Please feel free to open issues or submit pull requests to improve this project.