From f0a53a1cd44f3468bf26bbbae0fc3cd1eba94ddc Mon Sep 17 00:00:00 2001 From: "Zhuohuan LI (CARPE DIEM)" Date: Sun, 23 Oct 2016 02:04:10 +0800 Subject: [PATCH] fix doc with FriendRequest --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4b3a3469..f261ea75 100644 --- a/README.md +++ b/README.md @@ -406,8 +406,11 @@ The `message` here is a [Message](#class-message). 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 -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 request.accept() console.log('auto accepted for ' + contact + ' with message: ' + request.hello) -- GitLab