# SB_AVATAR_GROUP

Checks if resident is a member of a specific group and returns result using [SB_GROUP_CHECKED](/doc/bf5e3188-d421-40f6-9a98-4075a65cffde) event.

You can check any group membership with this command, not only the one in-use by AdminBot.

## Command usage

```csharp
llMessageLinked(LINK_SET, SB_AVATAR_GROUP, string str, key id);
```

```snippet adminbot-api-parameters-RxnGv0pgFW command="SB_AVATAR_GROUP"
str | yes | Group name or UUID
id  | yes | Avatar UUID
```

## Comments

This command fetches the groups list of a selected avatar and searches for the group name/UUID you've provided. The check result is being sent to your script using SB_GROUP_CHECKED event.

* You can specify either group name or group UUID.
* You can check any group membership with this command, not only the one in-use by AdminBot.

### Visibility

Only "show in profile" resident's groups can be seen with this request. It is not possible to see the groups resident intentionally hides from profile.

### Delays

The command takes about 1–3 seconds to complete.

## Return value

The result of this command will be returned to your script using [SB_GROUP_CHECKED](/doc/bf5e3188-d421-40f6-9a98-4075a65cffde) event:

```csharp
link_message(integer sender, integer num, string str, key id) {
  ...
}
```

Where:

* sender – link number of a sender prim
* num – SB_GROUP_CHECKED
* str – `0` (avatar is not in this group) or `1` (avatar is in group)
* id – avatar UUID

## Examples

See [this example](/doc/2641f02c-90cd-459c-9f75-4d638fa56b2f) for LSL code.