---
title: ZEPETO.Module.Social
slug: world-sdk-guide-ch/zepetomodulesocial
docTags: 
createdAt: 2026-09-04T05:12:34.241Z
---

| 类型                                                          | 说明                                                                                    |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| [SocialService](./#socialservice)                           | `SocialService` 用于实现 ZEPETO World 内的社交功能。 该服务使玩家能够访问社交数据，例如用户的关注关系。 同时提供向其他玩家发送私信的功能。 |
| [RoomMemberStatus](./#roommemberstatus)                     | 表示与本地玩家关系的枚举。                                                                         |
| [MyFollowerListResponse](./#myfollowerlistresponse)         | `MyFollowerListResponse` 类提供本地玩家的粉丝列表信息。                                              |
| [MyFollowingListResponse](./#myfollowinglistresponse)       | `MyFollowingListResponse` 类提供 API 调用结果以及本地玩家的关注列表信息。                                  |
| [UserFollowInfoListResponse](./#userfollowinfolistresponse) | `UserFollowInfoListResponse` 类提供 API 调用结果以及多个用户的关注信息列表。                               |
| [UserFollowInfoResponse](./#userfollowinforesponse)         | `UserFollowInfoResponse` 类提供 API 调用结果以及该用户的关注信息列表。                                    |
| [UserFollowStatusResponse](./#userfollowstatusresponse)     | `UserFollowStatusResponse` 类提供 API 调用结果，以及表示指定用户是否与本地玩家存在关注关系的信息。                     |
| [DirectMessagePopupState](./#directmessagepopupstate)       | 枚举私信弹窗的状态。                                                                            |
| [UserInfo](./#userinfo)                                     | 用户信息。                                                                                 |
| [UserFollowInfo](./#userfollowinfo)                         | 用户的关注信息。                                                                              |
| [UserAccountType](./#useraccounttype)                       | 表示用户账号类型的枚举。                                                                          |
| [FollowStatus](./#followstatus)                             | 表示与本地玩家的关注关系。                                                                         |
| [FollowCellView](./#followcellview)                         | 用于官方好友列表弹窗的类。                                                                         |
| [UserInfoCellView](./#userinfocellview)                     | 用于在官方好友列表弹窗中显示好友信息的 UI 元素类。                                                           |
| [TotalCountCellView](./#totalcountcellview)                 | 用于在官方好友列表弹窗中显示好友总数的类。                                                                 |

## SocialService

`class`

`SocialService` 用于实现 ZEPETO World 内的社交功能。
该服务使玩家能够访问社交数据，例如用户的关注关系。
同时提供向其他玩家发送私信的功能。

### 方法

### add\_onRoomMemberStatusChanged

`static add_onRoomMemberStatusChanged(value: Action<string, RoomMemberStatus>) → void`

该异步方法用于获取本地玩家的粉丝列表。

| 参数    | 类型                                 |
| ----- | ---------------------------------- |
| value | `Action<string, RoomMemberStatus>` |

### GetMyFollowingListAsync

`static GetMyFollowingListAsync(nextPageToken?: string) → BaseRequest<MyFollowingListResponse>`

该异步方法用于获取本地玩家的关注列表。

| 参数                 | 类型       | 说明                             |
| ------------------ | -------- | ------------------------------ |
| nextPageToken （可选） | `string` | 分页令牌。首次调用该方法时，请将该参数设置为 `null`。 |

**返回值：** `BaseRequest<MyFollowingListResponse>` — 一个 `BaseRequest` 对象。异步处理完成后，可通过 `responseData` 属性访问 `MyFollowingListResponse` 对象。

### GetUserFollowInfoAsync

`static GetUserFollowInfoAsync(userIds: string[]) → BaseRequest<UserFollowInfoListResponse>`

该异步方法用于获取多个用户的关注信息。

| 参数      | 类型         | 说明                |
| ------- | ---------- | ----------------- |
| userIds | `string[]` | 需要查询关注列表的多个用户 ID。 |

**返回值：** `BaseRequest<UserFollowInfoListResponse>` — 一个 `BaseRequest` 对象。异步处理完成后，可通过 `responseData` 属性访问 `UserFollowInfoListResponse` 对象。

### GetUserFollowInfoAsync

`static GetUserFollowInfoAsync(userId: string) → BaseRequest<UserFollowInfoResponse>`

该异步方法用于获取单个用户的关注信息。

| 参数     | 类型       | 说明              |
| ------ | -------- | --------------- |
| userId | `string` | 需要查询关注列表的用户 ID。 |

**返回值：** `BaseRequest<UserFollowInfoResponse>` — 一个 `BaseRequest` 对象。异步处理完成后，可通过 `responseData` 属性访问 `UserFollowInfoResponse` 对象。

### GetUserFollowStatusAsync

`static GetUserFollowStatusAsync(userId: string) → BaseRequest<UserFollowStatusResponse>`

该异步方法用于获取本地玩家与某个用户之间的关注关系信息。

| 参数     | 类型       | 说明              |
| ------ | -------- | --------------- |
| userId | `string` | 需要查询关注状态的用户 ID。 |

**返回值：** `BaseRequest<UserFollowStatusResponse>` — 一个 `BaseRequest` 对象。异步处理完成后，可通过 `responseData` 属性访问 `UserFollowStatusResponse` 对象。

### OpenPopupDirectMessage

`static OpenPopupDirectMessage(sendMessage: string, userIds?: string[], onComplete?: Action<DirectMessagePopupState>) → void`

弹出用于向用户发送私信的弹窗。

| 参数              | 类型                                | 说明                                                         |
| --------------- | --------------------------------- | ---------------------------------------------------------- |
| sendMessage     | `string`                          | 要发送的消息正文。若为空白或为空，则发送将失败。                                   |
| userIds （可选）    | `string[]`                        | 潜在收件人的用户 ID 列表。若省略 `users` 参数，收件人选择界面将自动填入发送者的粉丝/关注列表中的用户。 |
| onComplete （可选） | `Action<DirectMessagePopupState>` | 消息发送完成或取消时调用的回调函数。                                         |

## RoomMemberStatus

`enum`

表示与本地玩家关系的枚举。

| 名称        | 值 | 说明              |
| --------- | - | --------------- |
| None      | 0 | 表示本地玩家是否未关注该用户。 |
| Following | 1 | 表示本地玩家是否已关注该用户。 |
| Blocked   | 3 | 表示本地玩家是否已屏蔽该用户。 |

## MyFollowerListResponse

`class` · extends `PlayBaasResponse`

`MyFollowerListResponse` 类提供本地玩家的粉丝列表信息。

### 属性

| 名称            | 类型                          | 说明                                                                            |
| ------------- | --------------------------- | ----------------------------------------------------------------------------- |
| userCount     | `number`                    | 关注本地玩家的用户数量。                                                                  |
| users         | [UserInfo\[\]](./#userinfo) | 关注本地玩家的用户信息。                                                                  |
| nextPageToken | `string`                    | 当可用条目较多时，响应中会包含 `nextPageToken`，可用于获取后续的粉丝列表。当没有剩余条目时，`nextPageToken` 为 null。 |

## MyFollowingListResponse

`class` · extends `PlayBaasResponse`

`MyFollowingListResponse` 类提供 API 调用结果以及本地玩家的关注列表信息。

### 属性

| 名称            | 类型                          | 说明                                                                            |
| ------------- | --------------------------- | ----------------------------------------------------------------------------- |
| userCount     | `number`                    | 本地玩家关注的用户数量。                                                                  |
| users         | [UserInfo\[\]](./#userinfo) | 本地玩家关注的用户信息。                                                                  |
| bookMarkUsers | [UserInfo\[\]](./#userinfo) | 本地玩家收藏的用户信息。                                                                  |
| nextPageToken | `string`                    | 当可用条目较多时，响应中会包含 `nextPageToken`，可用于获取后续的关注列表。当没有剩余条目时，`nextPageToken` 为 null。 |

## UserFollowInfoListResponse

`class` · extends `BaseResponse`

`UserFollowInfoListResponse` 类提供 API 调用结果以及多个用户的关注信息列表。

### 属性

| 名称    | 类型                                      | 说明             |
| ----- | --------------------------------------- | -------------- |
| users | [UserFollowInfo\[\]](./#userfollowinfo) | 多个用户的关注信息列表数组。 |

## UserFollowInfoResponse

`class` · extends `BaseResponse`

`UserFollowInfoResponse` 类提供 API 调用结果以及该用户的关注信息列表。

### 属性

| 名称   | 类型                                  | 说明            |
| ---- | ----------------------------------- | ------------- |
| user | [UserFollowInfo](./#userfollowinfo) | 该用户的关注信息列表数组。 |

## UserFollowStatusResponse

`class` · extends `PlayBaasResponse`

`UserFollowStatusResponse` 类提供 API 调用结果，以及表示指定用户是否与本地玩家存在关注关系的信息。

### 属性

| 名称     | 类型                              | 说明              |
| ------ | ------------------------------- | --------------- |
| status | [FollowStatus](./#followstatus) | 指定用户与本地玩家的关注关系。 |

## DirectMessagePopupState

`enum`

枚举私信弹窗的状态。

| 名称           | 值 | 说明            |
| ------------ | - | ------------- |
| Cancel       | 0 | 手动关闭弹窗或发送失败时。 |
| SendComplete | 1 | 发送请求完成并关闭弹窗时。 |

## UserInfo

`class`

用户信息。

### 属性

| 名称                | 类型                                    | 说明                    |
| ----------------- | ------------------------------------- | --------------------- |
| zepetoId          | `string`                              | 用户的唯一句柄，通常以 `@` 符号呈现。 |
| userId            | `string`                              | 内部用户标识符。              |
| name              | `string`                              | 用户的显示名称。              |
| isOfficialAccount | `boolean`                             | 表示该账号是否为官方账号。         |
| accountType       | [UserAccountType](./#useraccounttype) | 用户账号类型。               |
| followStatus      | [FollowStatus](./#followstatus)       | 与本地玩家的关注关系。           |

### 方法

### GetProfileThumbnailAsync

`GetProfileThumbnailAsync() → BaseRequest<TextureResponse>`

该异步方法用于获取用户资料的缩略图。

**返回值：** `BaseRequest<TextureResponse>` — 一个 `BaseRequest` 对象。异步处理完成后，可通过 `responseData` 属性访问 `TextureResponse` 对象。

### GetBadgeImageAsync

`GetBadgeImageAsync() → BaseRequest<TextureResponse>`

若该用户为 Greeter 或 Creator 账号，该异步方法用于从其个人资料中获取徽章图片。

**返回值：** `BaseRequest<TextureResponse>` — 一个 `BaseRequest` 对象。异步处理完成后，可通过 `responseData` 属性访问 `TextureResponse` 对象。

## UserFollowInfo

`class` · extends [UserInfo](./#userinfo)

用户的关注信息。

### 属性

| 名称             | 类型       | 说明          |
| -------------- | -------- | ----------- |
| followingCount | `number` | 该账号关注的用户数量。 |
| followerCount  | `number` | 该账号的粉丝数量。   |

## UserAccountType

`enum`

表示用户账号类型的枚举。

| 名称      | 值 | 说明                         |
| ------- | - | -------------------------- |
| Default | 0 | 普通用户。                      |
| Greeter | 1 | 为 Greeter 计划指定的账号，用于协助新用户。 |

## FollowStatus

`class`

表示与本地玩家的关注关系。

### 属性

| 名称          | 类型        | 说明               |
| ----------- | --------- | ---------------- |
| isFollower  | `boolean` | 表示该用户是否为本地玩家的粉丝。 |
| isFollowing | `boolean` | 表示本地玩家是否已关注该用户。  |

## FollowCellView

`class` · extends `EnhancedScrollerCellView`

用于官方好友列表弹窗的类。

### 属性

| 名称                  | 类型       | 说明                                                |
| ------------------- | -------- | ------------------------------------------------- |
| textFollowButton    | `string` | 返回官方好友列表弹窗中关注按钮上显示的本地化文本标签。该文本会自动翻译为与设备设置相匹配的语言。  |
| textFollowingButton | `string` | 返回官方好友列表弹窗中已关注按钮上显示的本地化文本标签。该文本会自动翻译为与设备设置相匹配的语言。 |
| cellHeight          | `number` | 返回用户信息单元格视图的高度。                                   |

### 事件

| 名称            | 类型           | 说明                  |
| ------------- | ------------ | ------------------- |
| onCreated     | `UnityEvent` | 返回官方好友列表弹窗创建时调用的事件。 |
| onDeactivated | `UnityEvent` | 返回官方好友列表弹窗停用时调用的事件。 |
| onActivated   | `UnityEvent` | 返回官方好友列表弹窗激活时调用的事件。 |

## UserInfoCellView

`class` · extends [FollowCellView](./#followcellview)

用于在官方好友列表弹窗中显示好友信息的 UI 元素类。

### 属性

| 名称       | 类型                      | 说明                |
| -------- | ----------------------- | ----------------- |
| userInfo | [UserInfo](./#userinfo) | 返回在 UI 上显示的用户信息。  |
| textName | `string`                | 返回在 UI 上显示的账号用户名。 |

## TotalCountCellView

`class` · extends [FollowCellView](./#followcellview)

用于在官方好友列表弹窗中显示好友总数的类。

### 属性

| 名称        | 类型       | 说明                                 |
| --------- | -------- | ---------------------------------- |
| textCount | `string` | 返回好友总数的本地化文本。该文本会自动翻译为与设备设置相匹配的语言。 |
