Conversation
This commit introduces the ability to handle postback events, specifically for terms and conditions acceptance/rejection. - Added `PostbackService` to manage postback event logic. - Created `handle_postback_event` in `services/handlers/postback.py` to process different postback data values. - Registered `PostbackEvent` handler in `linebot.py` to route events to the `PostbackService`. - Added `show_loading_animation` before handling the postback event. - Added `send_message` to send the reply messages to the user. - Created a new file `linebot/flex_messages/welcome/terms.json` (empty file, to be populated later with the flex message for terms and conditions). This allows the bot to respond to user interactions with buttons related to accepting or rejecting terms and conditions.
This commit introduces a welcome flow for new users, including: - Terms of service agreement with accept/reject options. - Language selection (Traditional Chinese/English). - Role selection (Faculty/Student/Visitor). - Welcome messages tailored to the selected role. - Quick reply buttons for help and settings. The implementation involves: - Adding new flex messages for terms, language, and role selection. - Updating the postback handler to process the new postback data. - Adding a utility function to convert flex message JSON files to Python objects. - Adding a constant for default message after setting up. - Adding a quickreply function to create quickreply buttons. - Adding error handling for sending messages to LINE. - Adding logging for messages sent to LINE. These changes enhance the user experience by providing a guided onboarding process and personalized welcome messages.
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.
新增使用者加好友後的歡迎訊息
詳細流程請參考 https://www.figma.com/board/7ixsgiFVKIkGOXfcZJnA3S/Linechatbot-flow?node-id=0-1&t=VjQhFytHaWBfHgFe-1