commit ee1c6291199e21eb38a8599b4b512ec0995121e8
Author: c0ncord2 <59669788+c0ncord2@users.noreply.github.com>
Date: Wed Jan 29 23:00:57 2020 +0000
diff --git a/contrib/outmessage-discordemoji.tengo b/contrib/outmessage-discordemoji.tengo
new file mode 100644
index 0000000..3dd61ad
--- /dev/null
+++ b/contrib/outmessage-discordemoji.tengo
@@ -00 +110 @@
+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")
+}