Skip to content

Commit

Permalink
feat: 🎸 scan type
Browse files Browse the repository at this point in the history
  • Loading branch information
hcfw007 committed Jan 3, 2024
1 parent 5f16d07 commit 9fec60f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
"@chatie/eslint-config": "^1.0.4",
"@chatie/semver": "^0.4.7",
"@chatie/tsconfig": "^4.6.3",
"@juzi/wechaty-puppet": "^1.0.75",
"@juzi/wechaty-puppet": "^1.0.76",
"@juzi/wechaty-puppet-mock": "^1.0.1",
"@swc/core": "1.3.44",
"@swc/helpers": "^0.3.6",
Expand Down
2 changes: 1 addition & 1 deletion src/schemas/wechaty-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type WechatyEventListenerRoomLeave = (room: RoomInterface, leaverList:
type WechatyEventListenerRoomTopic = (room: RoomInterface, newTopic: string, oldTopic: string, changer: ContactInterface, date?: Date) => void | Promise<void>
type WechatyEventListenerRoomAnnounce = (room: RoomInterface, newAnnounce: string, changer: ContactInterface, oldAnnounce?: string, date?: Date) => void | Promise<void>
type WechatyEventListenerRoomOwner = (room: RoomInterface, newOwner: ContactInterface, oldOwner: ContactInterface) => void | Promise<void>
type WechatyEventListenerScan = (qrcode: string, status: PUPPET.types.ScanStatus, data?: string) => void | Promise<void>
type WechatyEventListenerScan = (qrcode: string, status: PUPPET.types.ScanStatus, data: string, type: PUPPET.types.ScanType) => void | Promise<void>
type WechatyEventListenerStartStop = () => void | Promise<void>
type WechatyEventListenerContactTagAdd = (contact: ContactInterface, tagList: TagInterface[]) => void | Promise<void>
type WechatyEventListenerContactTagRemove = (contact: ContactInterface, tagList: TagInterface[]) => void | Promise<void>
Expand Down
3 changes: 2 additions & 1 deletion src/wechaty-mixins/puppet-mixin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import type {
import type { GErrorMixin } from './gerror-mixin.js'
import type { IoMixin } from './io-mixin.js'
import { checkUntilChanged } from '../pure-functions/retry-policy.js'
import { ScanType } from '@juzi/wechaty-puppet/types'

const PUPPET_MEMORY_NAME = 'puppet'

Expand Down Expand Up @@ -541,7 +542,7 @@ const puppetMixin = <MixinBase extends WechatifyUserModuleMixin & GErrorMixin &
case 'scan':
puppet.on('scan', async payload => {
this.__readyState.inactive(true)
this.emit('scan', payload.qrcode || '', payload.status, payload.data)
this.emit('scan', payload.qrcode || '', payload.status, payload.data || '', payload.type || ScanType.Unknown)
})
break

Expand Down

0 comments on commit 9fec60f

Please sign in to comment.