Skip to content

Instantly share code, notes, and snippets.

View conblem's full-sized avatar
🌌

conblem conblem

🌌
View GitHub Profile
@conblem
conblem / index.js
Created August 8, 2019 06:18
Adding Twitchemotes to Mattermost; Replace CREATOR_ID, mattermost url and X-CSRF-Token
function send(emote) {
return fetch(`https://static-cdn.jtvnw.net/emoticons/v1/${emote.id}/2.0`)
.then(res => res.blob())
.then(res => {
const formdata = new FormData();
formdata.append("image", res, `${emote.code}.png`);
formdata.append("emoji", JSON.stringify({creator_id:"CREATOR_ID",name: emote.code}));
return fetch("https://mattermost.com/api/v4/emoji", {
method: "post",