Contact
所有的联系人(好友)都会被封装成Contact 类实例
Last updated
Was this helpful?
所有的联系人(好友)都会被封装成Contact 类实例
Last updated
Was this helpful?
Kind: global class Properties
Name
Type
Description
id
string
instance
⇒ Promise
⇒ string
⇒ Promise
⇒ boolean
| null
⇒ ContactType.Unknown
| ContactType.Personal
| ContactType.Official
⇒ ContactGender.Unknown
| ContactGender.Male
| ContactGender.Female
⇒ string
| null
⇒ string
| null
⇒ Promise
⇒ Promise
⇒ boolean
static
⇒ Promise
⇒ Promise
Promise
Param
Type
Description
textOrContactOrFileOrUrl
Example
string
获取联系人的昵称
Promise
获取/设置/删除 好友的备注。
如果设置备注过于频繁,设置将会失效(比如1分钟设置60次)
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
判断这个联系人是否为机器人的好友
ContactType.Unknown
| ContactType.Personal
| ContactType.Official
获取好友的类型,是公众号还是普通还有。
ContactGender.Unknown
| ContactGender.Male
| ContactGender.Female
获取联系人的性别
string
| null
获取联系人设置的省份信息
string
| null
获取联系人设置的城市信息
Promise
获取联系人的头像
Promise
强制重新加载好友数据,会从低级别的 API 中重新同步一遍。
boolean
检测好友是否是机器人自己。
Promise
通过类似这样的命令查找联系人: {name: string | RegExp} / {alias: string | RegExp}
支持通过昵称或者备注查找。如果查到不止一个联系人,返回找到的第一个。
Param
Type
query
Example
Promise
通过name (昵称)或者alias(备注)查找联系人。
用 Contact.findAll() 获取机器人的所有联系人列表。
name
用户自己设置的昵称叫做name
alias
机器人给这个用户设置的昵称叫做alias
Param
Type
[queryArg]
Example
搜索联系人的方式
Kind: global typedef Properties
Name
Type
Description
name
string
用户自己设置的昵称叫做name
alias
string
获取联系人id,这个id 是否为永久唯一id 取决于你使用什么puppet,详见 。
这个功能是否能实现取决于你使用的是哪一个Puppet, 详情参考:
Kind: instance method of
string
| | FileBox
| UrlLink
给微信好友发送文本,联系人名片,文件或者链接。你可以使用 来发送文件。
Kind: instance method of Example
Kind: instance method of
这个功能是否能实现取决于你使用的是哪一个Puppet, 详情参考:
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
机器人或者其他人给这个用户设置的昵称叫做alias: