提交 8ebd1e9d 编写于 作者: G Gcaufy 提交者: Huan (李卓桓)

docs: Fixed FriendshipType enum typo (#1620)

* docs: Fixed FriendshipType typo

* 0.23.17
上级 a04c4ee3
...@@ -205,7 +205,7 @@ wechaty.on('message', (message) => { ...@@ -205,7 +205,7 @@ wechaty.on('message', (message) => {
// Friendship Event will emit when got a new friend request, or friendship is confirmed. // Friendship Event will emit when got a new friend request, or friendship is confirmed.
bot.on('friendship', (friendship) => { bot.on('friendship', (friendship) => {
if(friendship.type() === Friendship.Type.RECEIVE){ // 1. receive new friendship request from new contact if(friendship.type() === Friendship.Type.Receive){ // 1. receive new friendship request from new contact
const contact = friendship.contact() const contact = friendship.contact()
let result = await friendship.accept() let result = await friendship.accept()
if(result){ if(result){
...@@ -213,7 +213,7 @@ bot.on('friendship', (friendship) => { ...@@ -213,7 +213,7 @@ bot.on('friendship', (friendship) => {
} else{ } else{
console.log(`Request from ${contact.name()} failed to accept!`) console.log(`Request from ${contact.name()} failed to accept!`)
} }
} else if (friendship.type() === Friendship.Type.CONFIRM) { // 2. confirm friendship } else if (friendship.type() === Friendship.Type.Confirm) { // 2. confirm friendship
console.log(`new friendship confirmed with ${contact.name()}`) console.log(`new friendship confirmed with ${contact.name()}`)
} }
}) })
......
{ {
"name": "wechaty", "name": "wechaty",
"version": "0.23.16", "version": "0.23.17",
"description": "Wechaty is a Bot SDK for Wechat Personal Account", "description": "Wechaty is a Bot SDK for Wechat Personal Account",
"main": "dist/src/index.js", "main": "dist/src/index.js",
"typings": "dist/src/index.d.ts", "typings": "dist/src/index.d.ts",
......
...@@ -421,7 +421,7 @@ export class Wechaty extends Accessory implements Sayable { ...@@ -421,7 +421,7 @@ export class Wechaty extends Accessory implements Sayable {
* // Friendship Event will emit when got a new friend request, or friendship is confirmed. * // Friendship Event will emit when got a new friend request, or friendship is confirmed.
* *
* bot.on('friendship', (friendship) => { * bot.on('friendship', (friendship) => {
* if(friendship.type() === Friendship.Type.RECEIVE){ // 1. receive new friendship request from new contact * if(friendship.type() === Friendship.Type.Receive){ // 1. receive new friendship request from new contact
* const contact = friendship.contact() * const contact = friendship.contact()
* let result = await friendship.accept() * let result = await friendship.accept()
* if(result){ * if(result){
...@@ -429,7 +429,7 @@ export class Wechaty extends Accessory implements Sayable { ...@@ -429,7 +429,7 @@ export class Wechaty extends Accessory implements Sayable {
* } else{ * } else{
* console.log(`Request from ${contact.name()} failed to accept!`) * console.log(`Request from ${contact.name()} failed to accept!`)
* } * }
* } else if (friendship.type() === Friendship.Type.CONFIRM) { // 2. confirm friendship * } else if (friendship.type() === Friendship.Type.Confirm) { // 2. confirm friendship
* console.log(`new friendship confirmed with ${contact.name()}`) * console.log(`new friendship confirmed with ${contact.name()}`)
* } * }
* }) * })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册