Contact
All wechat contacts(friend) will be encapsulated as a Contact.
Last updated
Was this helpful?
All wechat contacts(friend) will be encapsulated as a Contact.
Last updated
Was this helpful?
All wechat contacts(friend) will be encapsulated as a Contact.
The way to search Contact
All wechat contacts(friend) will be encapsulated as a Contact.
Kind: global class Properties
Name
Type
Description
id
string
instance
⇒ Promise <void>
⇒ string
⇒ Promise <null | string | void>
⇒ boolean
| null
⇒ ContactType.Unknown
| ContactType.Personal
| ContactType.Official
⇒ ContactGender.Unknown
| ContactGender.Male
| ContactGender.Female
⇒ string
| null
⇒ string
| null
⇒ Promise <FileBox>
⇒ Promise <void>
⇒ boolean
static
⇒ Promise <Contact | null>
⇒ Promise <Contact []>
Promise <void>
Param
Type
Description
textOrContactOrFileOrUrlLinkOrMiniProgram
Example
string
Get the name from a contact
Promise <null | string | void>
GET / SET / DELETE the alias for a contact
Tests show it will failed if set alias too frequently(60 times in one minute).
Param
Type
newAlias
none
| string
| null
Example ( GET the alias for a contact, return {(Promise<string | null>)})
Example (SET the alias for a contact)
Example (DELETE the alias for a contact)
boolean
| null
Check if contact is friend
ContactType.Unknown
| ContactType.Personal
| ContactType.Official
Return the type of the Contact
Tips: ContactType is enum here.
ContactGender.Unknown
| ContactGender.Male
| ContactGender.Female
Contact gender
Tips: ContactGender is enum here.
string
| null
Get the region 'province' from a contact
string
| null
Get the region 'city' from a contact
Promise <FileBox>
Get avatar picture file stream
Promise <void>
Force reload data for Contact, Sync data from lowlevel API again.
boolean
Check if contact is self
Promise <Contact | null>
Try to find a contact by filter: {name: string | RegExp} / {alias: string | RegExp}
Find contact by name or alias, if the result more than one, return the first one.
Param
Type
query
Example
Promise <Contact []>
Find contact by name
or alias
If use Contact.findAll() get the contact list of the bot.
name
the name-string set by user-self, should be called name
alias
the name-string set by bot for others, should be called alias
Param
Type
queryArg
Example
The way to search Contact
Kind: global typedef Properties
Name
Type
Description
name
string
The name-string set by user-self, should be called name
alias
string
Get Contact id. This function is depending on the Puppet Implementation, see
Tips: This function is depending on the Puppet Implementation, see
Kind: instance method of
string
| | FileBox
| UrlLink
| MiniProgram
send text, Contact, file or UrlLink to contact. You can use to send file
Kind: instance method of Example
Kind: instance method of
Tips: This function is depending on the Puppet Implementation, see
Kind: instance method of Returns: boolean
| null
- True for friend of the bot False for not friend of the bot, null for unknown. Example
Kind: instance method of Example
Kind: instance method of Example
Kind: instance method of Example
Kind: instance method of Example
Kind: instance method of Example
Kind: instance method of Example
Kind: instance method of Returns: boolean
- True for contact is self, False for contact is others Example
Kind: static method of Returns: Promise.
- If can find the contact, return Contact, or return null
Kind: static method of
The name-string set by bot for others, should be called alias