Render external animated emoji

This commit is contained in:
Jeremy Zhang 2018-03-01 08:15:42 +00:00
parent 63979835ab
commit 5a2e51b135

View File

@ -1006,6 +1006,8 @@
}
var rendered = Mustache.render(template, {"id": "$2", "name": "$1"}).trim();
message.content = message.content.replace(/<:(.*?):(.*?)>/g, rendered);
rendered = Mustache.render(template, {"id": "$2", "name": "$1", "animated": true}).trim();
message.content = message.content.replace(/<a:(.*?):(.*?)>/g, rendered);
message.content = twemoji.parse(message.content, {
className: "message_emoji",
callback: function(icon, options, variant) { // exclude special characters