This project serves as an example of using Apache Camel together with the Spring Boot framework to develop Telegram bots. Apache Camel is a powerful tool for integrating various systems, and Spring Boot simplifies the creation and configuration of Java applications.
-
Setting up the Telegram bot: To get started, you must have a Telegram account and your bot's token. Create it through @BotFather and save the token.
-
Cloning the project: Use the
git clone
command to clone this repository to your computer. -
Project configuration:
- Open the project in your favorite development environment.
- In the
application.yaml
file, fill inbot.api-token: ${API_TOKEN}
with your bot's token.
-
Running: Launch the application and you can start testing your Telegram bot using the specified endpoints and handlers configured with Apache Camel.
This project is licensed under the MIT License.
- Configure
logback.xml
- Separate sample bot uri's into different classes (for ex.
direct:messageHandler
>MessageHandlerProcessor
,direct:unsupportedOperationHandler
>UnsupportedOperationHandlerProcessor
) - More unit tests
- Camel route integration tests (
MockEndpoint
) - Tests with test containers
- Configure dependencyManagement in pom
BaseCommandHandler
shouldn't know anything aboutUnknownCommandHandler
. Better extract into field and add to constructor params- More
CommandHandler
's examples, with different functionality (for ex. something that class any remote api) - Configure maven profiles
- Add command priority in
setNext()
method - Refactor tests