ContactSelf
机器人自己的信息将会封装一个ContactSelf 类. 这个类继承自 Contact
ContactSelf
contactSelf.avatar() ⇒ Promise
// 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>contactSelf.qrcode() ⇒ Promise<string>
Promise<string>contactSelf.name() ⇒ string
stringcontactSelf.name(name) ⇒ Promise<string>
Promise<string>contactSelf.signature(signature): Promise<void>
Promise<void>Last updated
Was this helpful?