# VoiceGroupInfo

An immutable snapshot of one voice group, as handed to addons and pushed to clients.

Source: https://socketsvc.vercel.app/zh-TW/api/shared/VoiceGroupInfo
<Callout title="Generated from source">
  Record `com.socketsvc.api.VoiceGroupInfo` — generated from [VoiceGroupInfo.java](https://github.com/HippoDev03/SocketSVC/blob/main/common/core/src/main/java/com/socketsvc/api/VoiceGroupInfo.java). Edit the Javadoc in the Java source, then run `pnpm gen:api`.
</Callout>

```java
package com.socketsvc.api;

public record VoiceGroupInfo(UUID id, String name, VoiceGroupType type, boolean passwordProtected, boolean persistent, UUID owner, Set<UUID> members) { ... }
```

An immutable snapshot of one voice group, as handed to addons and pushed to clients.

A snapshot, not a handle: the members are those at the moment it was taken, and nothing on
it changes afterwards. Mutating operations live on the server API (`SocketSvcApi` /
`SocketSvcModApi`) and are keyed by `#id()`, so an addon holding an old snapshot
cannot accidentally act on a membership that has moved on.

`#passwordProtected()` is a flag rather than the password itself. The password never
leaves the server, which is also why it is the one thing about a group that no client and no
addon can read back.

## Components

| Component | Description |
| --- | --- |
| `UUID id` | stable identity, generated when the group is created |
| `String name` | display name, 1-24 characters, unique among live groups (case-insensitive) |
| `VoiceGroupType type` | how the group relates to proximity chat, see [`VoiceGroupType`](/api/shared/VoiceGroupType) |
| `boolean passwordProtected` | whether joining requires a password |
| `boolean persistent` | whether the group survives its last member leaving |
| `UUID owner` | the player who created it, or `null` for a group an addon or the console created |
| `Set<UUID> members` | the players in it right now |

## Methods

### memberCount

```java
public int memberCount()
```

### contains

```java
public boolean contains(UUID player)
```