diff options
author | c0ncord2 <59669788+c0ncord2@users.noreply.github.com> | 2020-01-29 23:00:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-30 00:00:57 +0100 |
commit | 0dd19af6e8b3c122ddc8c96e5ab259d89023d561 (patch) | |
tree | 04073768e9afb925f44ea3e55181ca3ab9343b15 /contrib | |
parent | 4c44515f9df8eb0eb67116f05cb50820d800f961 (diff) | |
download | matterbridge-msglm-0dd19af6e8b3c122ddc8c96e5ab259d89023d561.tar.gz matterbridge-msglm-0dd19af6e8b3c122ddc8c96e5ab259d89023d561.tar.bz2 matterbridge-msglm-0dd19af6e8b3c122ddc8c96e5ab259d89023d561.zip |
Create outmessage-discordemoji.tengo (#979)
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/outmessage-discordemoji.tengo | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/outmessage-discordemoji.tengo b/contrib/outmessage-discordemoji.tengo new file mode 100644 index 00000000..3dd61ad9 --- /dev/null +++ b/contrib/outmessage-discordemoji.tengo @@ -0,0 +1,10 @@ +text := import("text") + +// if we're not sending to a discord bridge, +// then convert custom emoji tags into url's +if (inProtocol == "discord" && outProtocol != "discord") { + rePNG := text.re_compile(`<:.*?:([0-9]+)>`) + msgText=rePNG.replace(msgText,"https://cdn.discordapp.com/emojis/$1.png") + reGIF := text.re_compile(`<a:.*?:([0-9]+)>`) + msgText=reGIF.replace(msgText,"https://cdn.discordapp.com/emojis/$1.gif") +} |