# TextFilterResult

Roblox Engine API class from Roblox Studio 0.744.0.7441077 (version-7aaa6838d36c4448).

- Inherits from, nearest first: [Instance](https://rapi.sleaze.dev/classes/Instance.md), [Object](https://rapi.sleaze.dev/classes/Object.md)
- Tags: Not creatable, Not replicated
- Memory category: Instances
- HTML page: https://rapi.sleaze.dev/classes/TextFilterResult/
- Roblox documentation: https://create.roblox.com/docs/reference/engine/classes/TextFilterResult

Represents the result of a call to [`TextService:FilterStringAsync()`](https://rapi.sleaze.dev/classes/TextService.md), used to distribute a filtered string accordingly.

## Methods

### GetNonChatStringForBroadcastAsync

```luau
TextFilterResult:GetNonChatStringForBroadcastAsync(): string
```

- Tags: Yields, Capabilities: UI

Returns the text in a properly filtered manner for all users.

Returns: Filtered text string.

### GetNonChatStringForUserAsync

```luau
TextFilterResult:GetNonChatStringForUserAsync(toUserId: number): string
```

- Tags: Yields, Capabilities: UI

Returns the text in a properly filtered manner for the specified [`Player.UserId`](https://rapi.sleaze.dev/classes/Player.md) based on age and other details.

Parameters:

- `toUserId`: [`Player.UserId`](https://rapi.sleaze.dev/classes/Player.md) of the user intended to see/receive the text.

Returns: Filtered text string.

### GetChatForUserAsync

```luau
TextFilterResult:GetChatForUserAsync(toUserId: number): string
```

- Tags: Deprecated, Yields, Capabilities: UI

**Deprecated:** This method is deprecated and returns an empty string. Text filtering pertaining to chat should be done through [`TextChatService`](https://rapi.sleaze.dev/classes/TextChatService.md), and experiences that do not properly filter player-generated chat text may be subject to moderation.

Returns the text in a properly filtered manner for the specified [`Player.UserId`](https://rapi.sleaze.dev/classes/Player.md).

Parameters:

- `toUserId`: [`Player.UserId`](https://rapi.sleaze.dev/classes/Player.md) of the user being chatted.

Returns: Filtered text string.

## Inherited members

- From [Instance](https://rapi.sleaze.dev/classes/Instance.md): `Archivable`, `archivable`, `Attributes`, `AttributesReplicate`, `AttributesSerialize`, `HistoryId`, `Name`, `Parent`, `PredictionMode`, `PropertyStatusStudio`, `RobloxLocked`, `SerializedOverrides`, `SourceAssetId`, `Tags`, `UniqueId`, `numExpectedDirectChildren`, `DataCost`, `Capabilities`, `DefinesCapabilities`, `IsInSandbox`, `Sandboxed`, `AddTag`, `ClearAllChildren`, `Clone`, `Destroy`, `FindFirstAncestor`, `FindFirstAncestorOfClass`, `FindFirstAncestorWhichIsA`, `FindFirstChild`, `FindFirstChildOfClass`, `FindFirstChildWhichIsA`, `FindFirstDescendant`, `GetActor`, `GetAttribute`, `GetAttributeChangedSignal`, `GetAttributes`, `GetChildren`, `GetDebugId`, `GetDescendants`, `GetFullName`, `GetStyled`, `GetStyledPropertyChangedSignal`, `GetTags`, `HasTag`, `IsAncestorOf`, `IsDescendantOf`, `IsPropertyModified`, `QueryDescendants`, `RemoveTag`, `ResetPropertyToDefault`, `SetAttribute`, `WaitForChild`, `Remove`, `children`, `clone`, `destroy`, `findFirstChild`, `getChildren`, `isDescendantOf`, `remove`, `AncestryChanged`, `AttributeChanged`, `ChildAdded`, `ChildRemoved`, `DescendantAdded`, `DescendantRemoving`, `Destroying`, `StyledPropertiesChanged`, `childAdded`
- From [Object](https://rapi.sleaze.dev/classes/Object.md): `ClassName`, `className`, `GetPropertyChangedSignal`, `IsA`, `isA`, `Changed`
