Skip to content

$replaceText

$replaceText will replace specific segments of text.

Usage

$replaceText[text;replacer;replaceTo;times?]

Parameters

FieldTypeDescriptionRequired
textstringText you want to modify.true
replacerstringThe text that will be replaced.true
replaceTostringThe text that will replace replacer.true
times?numberHow many times replaceTo replaces replacer. / Use -1 for the last one.false

Example(s)

This will replace M with D and the output will be Donkey:

1
client.command({
2
name: "replaceText",
3
code: `
4
$replaceText[Monkey;M;D]
5
`
6
});

Advanced Example

This will replace the word coffee two times using the last field of $replaceText:

1
client.command({
2
name: "replaceText",
3
code: `
4
$replaceText[I love drinking Coffee, Coffee gives me power! Coffee is bad for my health.;Coffee;orange juice;2]
5
`
6
});

This will replace Ferel and are using multiple $replaceText:

1
client.command({
2
name: "replaceText",
3
code: `
4
$replaceText[$replaceText[Leref and Ferel are the same person.;Ferel;Ayaka];are;are not]
5
`
6
});