Viewing file on branch master
| / | contrib | outmessage-discordemoji.tengo |
| 1 | text := import("text") |
| 2 | |
| 3 | // if we're not sending to a discord bridge, |
| 4 | // then convert custom emoji tags into url's |
| 5 | if (inProtocol == "discord" && outProtocol != "discord") { |
| 6 | rePNG := text.re_compile(`<:.*?:([0-9]+)>`) |
| 7 | msgText=rePNG.replace(msgText,"https://cdn.discordapp.com/emojis/$1.png") |
| 8 | reGIF := text.re_compile(`<a:.*?:([0-9]+)>`) |
| 9 | msgText=reGIF.replace(msgText,"https://cdn.discordapp.com/emojis/$1.gif") |
| 10 | } |
| 11 |