Thumbnail

rani/matterbridge.git

Clone URL: https://git.buni.party/rani/matterbridge.git

Viewing file on branch master

1/*
2variables available
3read-only:
4inAccount, inProtocol, inChannel, inGateway
5outAccount, outProtocol, outChannel, outGateway
6
7read-write:
8msgText, msgUsername
9*/
10
11text := import("text")
12
13// start - strip irc colors
14// if we're not sending to an irc bridge we strip the IRC colors
15if inProtocol == "irc" && outProtocol != "irc" {
16 re := text.re_compile(`\x03(?:\d{1,2}(?:,\d{1,2})?)?|[[:cntrl:]]`)
17 msgText=re.replace(msgText,"")
18}
19// end - strip irc colors
20
21// strip custom emoji
22if inProtocol == "discord" {
23 re := text.re_compile(`<a?(:.*?:)[0-9]+>`)
24 msgText=re.replace(msgText,"$1")
25}
26