# Chat.SubscriptionHandler

Kind: Delegate · Namespace: Sansar.Simulation · Assembly: Sansar.Simulation.dll · Script API 47.10.0

<div class="api-meta">
<span class="api-kind api-kind-delegate" data-pagefind-filter="kind:Delegate">Delegate</span>
<span data-pagefind-filter="namespace:Sansar.Simulation">Namespace <a href="/scripting/api/sansar.simulation"><code>Sansar.Simulation</code></a></span>
</div>

<span id="T:Sansar.Simulation.Chat.SubscriptionHandler"></span>

Subscribe to receive events on chat messages from the system, users or scripts.

```csharp
[System.Obsolete("Use subscription callbacks of type Action<Sansar.Simulation.ChatData>", false)]
public delegate void Chat.SubscriptionHandler(
    int Channel,
    string Source,
    Sansar.Script.SessionId SourceId,
    Sansar.Script.ScriptId SourceScriptId,
    string Message
)
```

| Parameter | Type | Description |
|---|---|---|
| `Channel` | [int](https://learn.microsoft.com/dotnet/api/system.int32) | int channel which the chat occurs on. |
| `Source` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string source of the chat: system, user or script. |
| `SourceId` | [Sansar.Script.SessionId](/scripting/api/sansar.script/sessionid) | Sansar.Script.SessionId id of the chat source. May be [`SessionId.Invalid`](/scripting/api/sansar.script/sessionid#invalid) if the source is not an agent. |
| `SourceScriptId` | [Sansar.Script.ScriptId](/scripting/api/sansar.script/scriptid) | Sansar.Script.ScriptId id of the chat source. May be [`ScriptId.Invalid`](/scripting/api/sansar.script/scriptid#invalid) if the source is not a script. |
| `Message` | [string](https://learn.microsoft.com/dotnet/api/system.string) | string message of the chat event. |



<p class="api-generated" data-pagefind-ignore>Generated from the Sansar 47.10.0 client ScriptApi snapshot.</p>