Friendship

发送,接受好友请求的Class

Friendship

发送,接受好友请求的Class,有以下三种:

  1. 发送好友请求

  2. 在 Friend event 中收到好友请求

  3. 在 Friend event 中确认好友请求

Examples/Friend-Bot

Kind: global class

friendship.accept() ⇒ Promise <void>

通过好友请求

Kind: instance method of Friendship Example

friendship.hello() ⇒ string

获取对方发送好友请求的验证信息。

Kind: instance method of Friendship Example (If request content is `ding`, then accept the friendship)

friendship.contact() ⇒ Contact

获取发送好友请求的联系人。

Kind: instance method of Friendship Example

friendship.type() ⇒ FriendshipType

返回好友请求的类型。

FriendshipType 在这里是enum:

  • FriendshipType.Unknown

  • FriendshipType.Confirm

  • FriendshipType.Receive

  • FriendshipType.Verify

Kind: instance method of Friendship Example (如果用户发送好友请求的内容是 `ding`, 机器人会自动通过好友请求)

Friendship.send()

Deprecated

请使用 Friendship#add 替换

Kind: static method of Friendship

Friendship.add(contact, hello) ⇒ Promise <void>

发送好友请求给contact 发送的内容是 hello.

Kind: static method of Friendship

Param

Type

Description

contact

Contact

需要发送好友请求的联系人

hello

string

发送好友请求的内容

Example

Last updated

Was this helpful?