# SB_CHAT_LISTEN

Starts/stops listening to the group chat. Messages will come to you with [SB_CHAT_MESSAGE](/doc/6df578a9-ca28-4297-84a2-1e4d9e8832b0) event.


:::info
Requires group chat monitoring to be enabled on your group

:::

## Command usage

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

```snippet adminbot-api-parameters-RxnGv0pgFW command="SB_CHAT_LISTEN"
str | yes | 1to start listening<br>0 to stop
id  | yes | \--
```

## Comments

This command instructs AdminBot to start listening on the group chat.  
The group chat messages will be passed to your script using the [SB_CHAT_MESSAGE](/doc/6df578a9-ca28-4297-84a2-1e4d9e8832b0) event.

### Successful connection

After connecting to the group chat, the script will receive the [SB_CHAT_SUCCESS](/doc/f5f90886-cb4e-4049-990f-7c3b664b3986) event.

### Possible Errors

There are several conditions which may prevent AdminBot from connecting to the group chat.

In case of an error, your script will receive [SB_COMMAND_FAILED](/doc/4506acf4-03df-47cd-a6b6-8900905ceee9) with the following data:

```
event SB_COMMAND_FAILED, status code = SERVICE_UNAVAILABLE

Reason: Your SmartBots subscription does not include Group Chat Control

Solution: Enable the Group Chat Control service for the group.
```

```
event SB_COMMAND_FAILED, status code = CHAT_LISTEN_FAILED

Reason: SL can't provide the HTTP listener for the script

Solution: This can happen for extremely crowded and overloaded sims. The only solution is to move to another sim.
```

## Example

See [this example](/doc/ad461b10-ed35-4095-8cb1-fd414a74521a) for a simple chat relay.