Skip to content

Commit

Permalink
Create outmessage-discordemoji.tengo (#979)
Browse files Browse the repository at this point in the history
  • Loading branch information
c0ncord2 committed Jan 29, 2020
1 parent 4c44515 commit 0dd19af
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions contrib/outmessage-discordemoji.tengo
Original file line number Diff line number Diff line change
@@ -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")
}

0 comments on commit 0dd19af

Please sign in to comment.