Skip to content

Commit

Permalink
Feat: Animated FFZ emote support (#1051)
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisScr3ams committed Jun 21, 2024
1 parent b80054b commit 229d8cb
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG-nightly.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### 3.1.1 3000

- Added support for animated FFZ emotes

### 3.1.1.2100

- Fixed an issue where certain hooks would not work properly
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Improve your viewing experience on Twitch & YouTube with new features, emotes, vanity and performance.",
"private": true,
"version": "3.1.1",
"dev_version": "2.0",
"dev_version": "3.0",
"scripts": {
"start": "NODE_ENV=dev yarn build:dev && NODE_ENV=dev vite --mode dev",
"build:section:app": "vite build --config vite.config.mts",
Expand Down
23 changes: 16 additions & 7 deletions src/common/Transform.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,13 +232,22 @@ export function convertFFZEmote(data: FFZ.Emote): SevenTV.Emote {
listed: true,
owner: null,
host: {
url: "//cdn.frankerfacez.com/emote/" + data.id,
files: Object.keys(data.urls).map((key) => {
return {
name: key,
format: "PNG",
};
}),
url: data.animated
? "//cdn.frankerfacez.com/emote/" + data.id + "/animated"
: "//cdn.frankerfacez.com/emote/" + data.id,
files: data.animated
? Object.keys(data.animated).map((key) => {
return {
name: key,
format: "WEBP",
};
})
: Object.keys(data.urls).map((key) => {
return {
name: key,
format: "PNG",
};
}),
},
};
}
Expand Down
1 change: 1 addition & 0 deletions src/types/app.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ declare namespace FFZ {
display_name: string;
} | null;
urls: LinkMap;
animated?: LinkMap;
}

interface BadgesResponse {
Expand Down

0 comments on commit 229d8cb

Please sign in to comment.