5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 10:30:26 +00:00
matterbridge/contrib/outmessage-discordemoji.tengo
2020-01-30 00:00:57 +01:00

11 lines
428 B
Plaintext

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")
}