-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 🎸 implement room announce #2527
base: main
Are you sure you want to change the base?
Conversation
type WechatyEventListenerRoomTopic = (room: RoomInterface, newTopic: string, oldTopic: string, changer: ContactInterface, date?: Date) => void | Promise<void> | ||
type WechatyEventListenerScan = (qrcode: string, status: PUPPET.types.ScanStatus, data?: string) => void | Promise<void> | ||
type WechatyEventListenerStartStop = () => void | Promise<void> | ||
type WechatyEventListenerRoomAnnounce = (room: RoomInterface, newAnnounce: string, changer: ContactInterface, oldAnnounce?: string, date?: Date) => void | Promise<void> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep the parameters order the same as the WechatyEventListenerRoomTopic
Hey @ellipsis, give me a code review |
OK! Reviewing this PR... Responding to this comment by @huan. For more information about Ellipsis, check the documentation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Looks good to me!
- Reviewed the entire pull request up to 5d2ce40
- Looked at
124
lines of code in3
files - Took 1 minute and 9 seconds to review
More info
- Skipped
0
files when reviewing. - Skipped posting
3
additional comments because they didn't meet confidence threshold of50%
.
1. src/schemas/room-events.ts:113
:
- Assessed confidence :
0%
- Comment:
The implementation of theRoomEventListenerAnnounce
and its addition to theRoomEventListeners
interface is correctly done, matching the existing patterns for event listeners in the system. - Reasoning:
The PR introduces a new event typeroom-announce
in theRoomEventListeners
interface and the corresponding event listener typeRoomEventListenerAnnounce
. The event listener type is defined correctly with appropriate parameters including the room, the new announcement, the changer, the old announcement, and the date. This aligns with the typical structure of event listeners in the system, which usually include the main object (room), the primary change (newAnnounce), the initiator of the change (changer), and optionally the previous state (oldAnnounce) and the timestamp (date).
2. src/schemas/wechaty-events.ts:210
:
- Assessed confidence :
0%
- Comment:
The implementation of theWechatyEventListenerRoomAnnounce
and its addition to theWechatyEventListeners
interface is correctly done, matching the existing patterns for event listeners in the system. - Reasoning:
The PR introduces a new event typeroom-announce
in theWechatyEventListeners
interface and the corresponding event listener typeWechatyEventListenerRoomAnnounce
. The event listener type is defined correctly with appropriate parameters including the room, the new announcement, the changer, the old announcement, and the date. This aligns with the typical structure of event listeners in the system, which usually include the main object (room), the primary change (newAnnounce), the initiator of the change (changer), and optionally the previous state (oldAnnounce) and the timestamp (date).
3. src/wechaty-mixins/puppet-mixin.ts:421
:
- Assessed confidence :
0%
- Comment:
The implementation of theroom-announce
event handling in thepuppetMixin
class is correctly done, following the established patterns for similar event handlers in the system. - Reasoning:
The PR introduces handling for theroom-announce
event in thepuppetMixin
class. The handling logic includes finding the room and the changer based on their IDs, syncing the room, and emitting both a Wechaty and a room-specific event with the new announcement, the changer, the old announcement, and the date. This follows the typical pattern for event handling in the system, which involves resource lookup, state synchronization, and event emission with relevant data.
Workflow ID: wflow_UOORNsxRCg07wnkl
You can customize Ellipsis with review rules, user-specific overrides, quiet
mode, and more. See docs.
⌛ 6 days left in your free trial, upgrade for $20/seat/month or contact us.
issue: #2524
由于相关 PR 尚未 merge , CI 无法通过。
Summary:
Implements the
room-announce
event handling in Wechaty, updating event schemas and the puppet mixin to support room announcement notifications.Key points:
RoomEventListenerAnnounce
in/src/schemas/room-events.ts
.WechatyEventListenerRoomAnnounce
in/src/schemas/wechaty-events.ts
.room-announce
in/src/wechaty-mixins/puppet-mixin.ts
.Generated with ❤️ by ellipsis.dev