5
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2024-11-22 02:20:28 +00:00

Create outmessage-discordemoji.tengo (#979)

This commit is contained in:
c0ncord2 2020-01-29 23:00:57 +00:00 committed by GitHub
parent 4c44515f9d
commit 0dd19af6e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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