Class
TextFilterResult
NotCreatableNotReplicated
Represents the result of a call to TextService:FilterStringAsync(),
used to distribute a filtered string accordingly.
Represents the result of a call to TextService:FilterStringAsync().
Used to distribute a filtered string accordingly.
Methods 3#
| GetChatForUserAsync | Returns the text in a properly filtered manner for the specified
Player.UserId.DeprecatedYields |
| GetNonChatStringForBroadcastAsync | Returns the text in a properly filtered manner for all users.Yields |
| GetNonChatStringForUserAsync | Returns the text in a properly filtered manner for the specified
Player.UserId based on age and other details.Yields |
GetChatForUserAsync(toUserId: int64): string#
YieldsDeprecatedDeprecated
Deprecated. This method is deprecated and returns an empty string. Text filtering
pertaining to chat should be done through TextChatService, and
experiences that do not properly filter player-generated chat text may be
subject to moderation.
This method returns the text in a properly filtered manner for the
specified Player.UserId using the least restrictive filtering
appropriate for that user, with Chat privacy settings of both
users enforced. This should be used in the context of chats between
players, although there are some other cases where text filtering is
required.
The returned string should only be shown to the target user, as it might not be appropriate for all users.
If this method throws an error, the string should not be displayed to the user. Cases for error include:
- The two users are not allowed to chat, for example if
Chat:CanUserChatAsync()would returnfalsefor the given sender and receiver. - The user with the ID
toUserIdis not online on the current server.
This function will return immediately in most cases, although it will yield if the target user has just joined the server and their filtering info is not yet loaded.
| Name | Type | Default | Description |
|---|---|---|---|
toUserId | int64 | Player.UserId of the user being chatted. |
Returns
string— Filtered text string.
GetNonChatStringForBroadcastAsync(): string#
Yields
Returns the text in a properly filtered manner for all users. This should be used in the context of non-chat text that every user can see, such as for a dialog that lets a user write a message on a sign, visible to all users on the server even after the author has left.
Returns
string— Filtered text string.
GetNonChatStringForUserAsync(toUserId: int64): string#
Yields
Returns the text in a properly filtered manner for the specified
Player.UserId based on age and other details. This should be used
in the context of non-chat text that one specific user can see, such as
the name of a pet.
| Name | Type | Default | Description |
|---|---|---|---|
toUserId | int64 | Player.UserId of the user intended to see/receive the text. |
Returns
string— Filtered text string.
Inherited members#
Inherited from Instance 58
Properties (10)
Archivable, archivable, Capabilities, IsInSandbox, Name, Parent, PredictionMode, RobloxLocked, Sandboxed, UniqueId
Methods (39)
AddTag, children, ClearAllChildren, Clone, clone, Destroy, destroy, FindFirstAncestor, FindFirstAncestorOfClass, FindFirstAncestorWhichIsA, FindFirstChild, findFirstChild, FindFirstChildOfClass, FindFirstChildWhichIsA, FindFirstDescendant, GetActor, GetAttribute, GetAttributeChangedSignal, GetAttributes, GetChildren, getChildren, GetDebugId, GetDescendants, GetFullName, GetStyled, GetStyledPropertyChangedSignal, GetTags, HasTag, IsAncestorOf, IsDescendantOf, isDescendantOf, IsPropertyModified, QueryDescendants, Remove, remove, RemoveTag, ResetPropertyToDefault, SetAttribute, WaitForChild