Garry's Mod Wiki

util.FilterText

  string util.FilterText( string str, number context = TEXT_FILTER_UNKNOWN, Player player = nil )

Just Added

This was just added in the latest version (2022.02.02). It might only be available on the Dev Branch right now.

Description

Filters given text using Steam's filtering system. The function will obey local client's Steam settings for chat filtering:

This function may return an empty string if the context argument is TEXT_FILTER_CHAT and the passed player is currently blacklisted by the local player on Steam. This may currently be considered a bug with Steam while investigations are ongoing.

Issue Tracker: 5161
image.png

Arguments

1 string str
String to filter.
2 number context = TEXT_FILTER_UNKNOWN
Filtering context. See Enums/TEXT_FILTER.
3 Player player = nil
Used to determine if the text should be filtered according to local user's Steam chat filtering settings.

Returns

1 string
The filtered text based on given settings.