Skip to content

Welcome#9

Merged
yenslife merged 6 commits into
mainfrom
welcome
May 22, 2025
Merged

Welcome#9
yenslife merged 6 commits into
mainfrom
welcome

Conversation

@yenslife
Copy link
Copy Markdown
Contributor

@yenslife yenslife commented May 9, 2025

新增使用者加好友後的歡迎訊息
詳細流程請參考 https://www.figma.com/board/7ixsgiFVKIkGOXfcZJnA3S/Linechatbot-flow?node-id=0-1&t=VjQhFytHaWBfHgFe-1

yenslife added 6 commits May 9, 2025 15:57
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.
@yenslife yenslife merged commit 217cf5d into main May 22, 2025
1 check passed
@yenslife yenslife deleted the welcome branch June 2, 2025 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant