Skip to content

FilterTextOptions

silentwolf-dev edited this page Nov 10, 2022 · 2 revisions

text: string

The text that is being manipulated.

 const message = new TextFilter({text: "hello, world!"})

textoveride:boolean

Controls how The text is updated, textoverride is false by default

 const message = new TextFilter({textoveride: true})

censorWith: string,

change the blacklist censor symbol to whatever you like,

 const message = new TextFilter({censorWith: "%"})

customBlacklist: string[]

Allow you to set a custom blacklist

const message = new TextFilter({
    customBlacklist: ["foo", "boo"]
})

censor

message.censor("boo to you") // results "%%%% to you"

Clone this wiki locally