Skip to content

Commit

Permalink
feat: 🎸 search with type
Browse files Browse the repository at this point in the history
  • Loading branch information
hcfw007 committed Feb 28, 2024
1 parent 8eea773 commit be3458d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
},
"homepage": "https://github.com/wechaty/",
"dependencies": {
"@juzi/wechaty-puppet-service": "^1.0.92",
"@juzi/wechaty-puppet-service": "^1.0.93",
"clone-class": "^1.1.1",
"cmd-ts": "^0.10.0",
"cockatiel": "^2.0.2",
Expand All @@ -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.84",
"@juzi/wechaty-puppet": "^1.0.86",
"@juzi/wechaty-puppet-mock": "^1.0.1",
"@swc/core": "1.3.44",
"@swc/helpers": "^0.3.6",
Expand Down
6 changes: 5 additions & 1 deletion src/user-modules/friendship.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,15 @@ class FriendshipMixin extends MixinBase implements Accepter {
*/
static async search (
queryFilter : PUPPET.filters.Friendship,
type?: PUPPET.types.Contact,
): Promise<undefined | ContactInterface> {
log.verbose('Friendship', 'static search("%s")',
JSON.stringify(queryFilter),
)
const contactId = await this.wechaty.puppet.friendshipSearch(queryFilter)
if (typeof (type) === 'undefined') {
type = PUPPET.types.Contact.Individual
}
const contactId = await this.wechaty.puppet.friendshipSearch(queryFilter, type)

if (!contactId) {
return undefined
Expand Down

0 comments on commit be3458d

Please sign in to comment.