Merged
Conversation
…add configuration and client handling - Removed `LoginCommandHandler` and migrated logic to `LoginCallbackHandler` with support for callback-based login flow. - Introduced `TelegramConfiguration` to centralize bot client configuration with injectable `TelegramClient`. - Updated `TelegramCommandHandler` interface to use generic `BotApiMethod<?>` for flexible bot responses. - Adjusted `ZaldoTelegramBot` to handle `AnswerCallbackQuery` and improve callback execution. - Extended session expiration in `UserSessionManager` from 20 to 30 minutes for enhanced user experience. Signed-off-by: Willian Silva <williansilva@alu.ufc.br>
- Added methods to remove and clear active keyboards for better UI interactions. - Enhanced `FlowContext` with `lastMessageId` to track message states. - Updated `ZaldoTelegramBot` to manage keyboard state transitions and validate callback actions. - Improved resilience in session management by refining `executeClient` and error handling in Telegram API calls. Signed-off-by: Willian Silva <williansilva@alu.ufc.br>
- Created `ConfirmDeleteUserCallbackHandler` and `DeleteUserCallbackHandler` for user deletion flow with confirmation prompts. - Improved error handling and session management in `DeleteUserCallbackHandler` with clear feedback messages. - Updated `ZaldoTelegramBot` to validate user existence during interactions and prompt account creation if necessary. - Fixed newline escape issue in `ListTransactionCallbackHandler` for better UI consistency. Signed-off-by: Willian Silva <williansilva@alu.ufc.br>
There was a problem hiding this comment.
Pull request overview
This PR enhances the Telegram bot functionality with improved keyboard management, user deletion features, and better UX through message editing and expiration handling. The changes refactor how the bot tracks active keyboards to prevent users from interacting with stale buttons, consolidate login flow handling, and add user account deletion capabilities.
Changes:
- Implemented keyboard expiration tracking using
lastMessageIdin FlowContext to prevent interactions with old keyboards - Added user deletion functionality with confirmation flow (ConfirmDeleteUserCallbackHandler and DeleteUserCallbackHandler)
- Refactored TelegramClient to use Spring dependency injection via TelegramConfiguration bean
- Migrated login flow from command handler to callback handler for better UX with in-place message editing
- Extended session expiration from 20 to 30 minutes and improved CI test reporting
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| TelegramConfiguration.java | New Spring configuration that creates TelegramClient bean for dependency injection |
| UserSessionManager.java | Increased session expiration from 20 to 30 minutes |
| FlowContext.java | Added lastMessageId field to track the most recent message with active keyboard |
| TelegramCommandHandler.java | Changed return type from SendMessage to BotApiMethod<?> for more flexibility |
| StartCommandHandler.java | Updated to return BotApiMethod<?> instead of SendMessage |
| LoginCommandHandler.java | Removed - functionality moved to LoginCallbackHandler |
| HelpCommandHandler.java | Updated to return BotApiMethod<?> instead of SendMessage |
| LoginCallbackHandler.java | Refactored to directly implement login flow logic using EditMessageText, removing dependency on LoginCommandHandler |
| DeleteUserCallbackHandler.java | New handler to execute user deletion and clear session |
| ConfirmDeleteUserCallbackHandler.java | New handler to show user deletion confirmation dialog |
| ListTransactionCallbackHandler.java | Fixed escaped newline sequences (\n\n to \n\n) in empty transaction message |
| ZaldoTelegramBot.java | Major refactor: injected TelegramClient, added keyboard tracking/expiration logic, improved callback handling with AnswerCallbackQuery, and better unauthenticated user handling |
| maven.yml | Added working-directory and improved test summary extraction to show only final test results |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.