From 0dd19af6e8b3c122ddc8c96e5ab259d89023d561 Mon Sep 17 00:00:00 2001 From: c0ncord2 <59669788+c0ncord2@users.noreply.github.com> Date: Wed, 29 Jan 2020 23:00:57 +0000 Subject: Create outmessage-discordemoji.tengo (#979) --- contrib/outmessage-discordemoji.tengo | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 contrib/outmessage-discordemoji.tengo 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(``) + msgText=reGIF.replace(msgText,"https://cdn.discordapp.com/emojis/$1.gif") +} -- cgit v1.2.3