Garry's Mod Wiki

Revision Difference

util.FilterText#546955

<function name="FilterText" parent="util" type="libraryfunc"> <description> Filters given text using Steam's filtering system. The function will obey local client's Steam settings for chat filtering: ⤶ <bug issue="5161">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.</bug>⤶ ⤶ <note>In some cases, especially in a chatbox, messages from some players may return an empty string if the context argument used for filtering is `TEXT_FILTER_CHAT` and [if the local player has blocked the sender of the message on Steam](https://github.com/Facepunch/garrysmod-issues/issues/5161#issuecomment-1035153941).</note>⤶ <upload src="70c/8d9e680b626348b.png" size="50426" name="image.png" /> </description> <added>2022.02.02</added> <realm>Client</realm> <args> <arg name="str" type="string">String to filter.</arg> <arg name="context" type="number" default="TEXT_FILTER_UNKNOWN">Filtering context. See <page>Enums/TEXT_FILTER</page>.</arg> <arg name="player" type="Player" default="nil">Used to determine if the text should be filtered according to local user's Steam chat filtering settings.</arg> </args> <rets> <ret name="" type="string">The filtered text based on given settings.</ret> </rets> </function>