提交 f0a53a1c 编写于 作者: Huan (李卓桓)'s avatar Huan (李卓桓)

fix doc with FriendRequest

上级 cffadbe6
...@@ -406,8 +406,11 @@ The `message` here is a [Message](#class-message). ...@@ -406,8 +406,11 @@ The `message` here is a [Message](#class-message).
Fired when we got new friend request, or confirm a friend ship. Fired when we got new friend request, or confirm a friend ship.
1. if `request?: FriendRequest` is set, then it's a friend request
1. if `request?: FriendRequest` is not set, then it's a friend confirmation
```ts ```ts
wechaty.on('friend', (this: Sayable, contact: Contact, request: FriendRequest) => { wechaty.on('friend', (this: Sayable, contact: Contact, request?: FriendRequest) => {
if (request) { // 1. request to be friend from new contact if (request) { // 1. request to be friend from new contact
request.accept() request.accept()
console.log('auto accepted for ' + contact + ' with message: ' + request.hello) console.log('auto accepted for ' + contact + ' with message: ' + request.hello)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册