ContactSelf
机器人自己的信息将会封装一个ContactSelf 类. 这个类继承自 Contact
ContactSelf
Kind: global class
Kind: instance method of ContactSelf
contactSelf.avatar() ⇒ Promise
获取机器人的头像
Example ( GET the avatar for bot, return {Promise<FileBox>})
// Save avatar to local file like `1-name.jpg`
bot.on('login', (user: ContactSelf) => {
console.log(`user ${user} login`)
const file = await user.avatar()
const name = file.name
await file.toFile(name, true)
console.log(`Save bot avatar: ${contact.name()} with avatar file: ${name}`)
})contactSelf.avatar(file) ⇒ Promise<void>
Promise<void>设置 机器人的头像
Param
Type
file
FileBox
Example (SET the avatar for a bot)
contactSelf.qrcode() ⇒ Promise<string>
Promise<string>获取机器人的二维码。
Kind: instance method of ContactSelf Example
contactSelf.name() ⇒ string
string获取 机器人昵称。
Kind: instance method of ContactSelf
Example
contactSelf.name(name) ⇒ Promise<string>
Promise<string>修改机器人昵称。
Kind: instance method of ContactSelf
Param
Description
name
机器人要修改的昵称内容
Example
contactSelf.signature(signature): Promise<void>
Promise<void>修改机器人签名。
Kind: instance method of ContactSelf
Param
Description
signature
机器人要修改的签名内容
Example
Last updated
Was this helpful?