ChatFilter

Summary

ChatFilter global table.

Functions

MethodReturns
Clear()void
ClearBlockedPhrases()void
ClearBlockedRegex()void
Enable()void
Disable()void
IsEnabled()boolean
AddBlockedPhrase(phrase: string)boolean
AddBlockedRegex(phrase: string)boolean
SetFilterCharacter(char: string)void
GetFilterCharacter()string

Functions

Clear

ChatFilter.Clear(): void

Clears all blocked phrases & regex.

ClearBlockedPhrases

ChatFilter.ClearBlockedPhrases(): void

Clears all blocked phrases.

ClearBlockedRegex

ChatFilter.ClearBlockedRegex(): void

Clears all blocked regex.

Enable

ChatFilter.Enable(): void

Enable chat filter filtering messages. Note: Even when disabled, you can still access these table functions.

Disable

ChatFilter.Disable(): void

Disable chat filter filtering messages. Note: Even when disabled, you can still access these table functions.

IsEnabled

ChatFilter.IsEnabled(): boolean

Returns if the chat filter is enabled.

Returns

TypeDescription
boolean

AddBlockedPhrase

ChatFilter.AddBlockedPhrase(phrase: string): boolean

Add blocked phrase to chat filter. Filtering of this type is case insensitive. Returns whether the phrase was added to the list or already existed (false)

Parameters

NameTypeDescription
phrasestringThe phrase you want to add

Returns

TypeDescription
boolean

AddBlockedRegex

ChatFilter.AddBlockedRegex(phrase: string): boolean

Add blocked regex to chat filter. Returns whether the regex was added to the list or already existed (false)

Parameters

NameTypeDescription
phrasestringThe phrase you want to add

Returns

TypeDescription
boolean

SetFilterCharacter

ChatFilter.SetFilterCharacter(char: string): void

Sets the chat filter's replacement character. For example, if set to '#', "blah badword" -> "blah #######"

Parameters

NameTypeDescription
charstringThe character you want to set

GetFilterCharacter

ChatFilter.GetFilterCharacter(): string

Gets the chat filter's replacement character.

Returns

TypeDescription
stringcharacter