Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hcfw007
Copy link
Member

@hcfw007 hcfw007 commented Apr 26, 2023

issue: #2524

由于相关 PR 尚未 merge , CI 无法通过。


🚀 This description was created by Ellipsis for commit 5d2ce40

Summary:

Implements the room-announce event handling in Wechaty, updating event schemas and the puppet mixin to support room announcement notifications.

Key points:

  • Added RoomEventListenerAnnounce in /src/schemas/room-events.ts.
  • Introduced WechatyEventListenerRoomAnnounce in /src/schemas/wechaty-events.ts.
  • Implemented event handling for room-announce in /src/wechaty-mixins/puppet-mixin.ts.
  • Ensured proper event propagation and error handling for the new event type.

Generated with ❤️ by ellipsis.dev

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>
Copy link
Member

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

@huan
Copy link
Member

huan commented May 3, 2024

Hey @ellipsis, give me a code review

Copy link

ellipsis-dev bot commented May 3, 2024

OK! Reviewing this PR...


Responding to this comment by @huan. For more information about Ellipsis, check the documentation.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label May 3, 2024
Copy link

@ellipsis-dev ellipsis-dev bot left a 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 in 3 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 of 50%.
1. src/schemas/room-events.ts:113:
  • Assessed confidence : 0%
  • Comment:
    The implementation of the RoomEventListenerAnnounce and its addition to the RoomEventListeners interface is correctly done, matching the existing patterns for event listeners in the system.
  • Reasoning:
    The PR introduces a new event type room-announce in the RoomEventListeners interface and the corresponding event listener type RoomEventListenerAnnounce. 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 the WechatyEventListenerRoomAnnounce and its addition to the WechatyEventListeners interface is correctly done, matching the existing patterns for event listeners in the system.
  • Reasoning:
    The PR introduces a new event type room-announce in the WechatyEventListeners interface and the corresponding event listener type WechatyEventListenerRoomAnnounce. 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 the room-announce event handling in the puppetMixin class is correctly done, following the established patterns for similar event handlers in the system.
  • Reasoning:
    The PR introduces handling for the room-announce event in the puppetMixin 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants