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/batch room add remove wechaty #2526

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: 🎸 batch room remove
  • Loading branch information
hcfw007 committed Apr 26, 2023
commit 2d5fa5aa97a11e8e52d25e6cc03407a1f46eb4d5
13 changes: 10 additions & 3 deletions src/user-modules/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -706,9 +706,16 @@ class RoomMixin extends MixinBase implements SayableSayer {
* }
* }
*/
async remove (contact: ContactInterface): Promise<void> {
log.verbose('Room', 'del(%s)', contact)
await this.wechaty.puppet.roomDel(this.id, contact.id)
async remove (contacts: ContactInterface | ContactInterface[]): Promise<void> {
log.verbose('Room', 'del(%s)', contacts)

let contactIds: string[]
if (Array.isArray(contacts)) {
contactIds = contacts.map(c => c.id)
} else {
contactIds = [contacts.id]
}
await this.wechaty.puppet.roomDel(this.id, contactIds)
// this.delLocal(contact)
}

Expand Down