From ae01e88e1340027a848cbcf2d230f3395e94011c Mon Sep 17 00:00:00 2001 From: byron <47872200+byeoon@users.noreply.github.com> Date: Mon, 8 Apr 2024 20:33:18 -0400 Subject: [PATCH] EmoteCloner: fix low quality; don't count managed emojis (#2321) Co-authored-by: Nam Anh Co-authored-by: ryan-0324 <77452312+ryan-0324@users.noreply.github.com> Co-authored-by: V --- src/plugins/emoteCloner/index.tsx | 7 ++++--- src/utils/constants.ts | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/plugins/emoteCloner/index.tsx b/src/plugins/emoteCloner/index.tsx index 4c0fe94ad..cd9890a80 100644 --- a/src/plugins/emoteCloner/index.tsx +++ b/src/plugins/emoteCloner/index.tsx @@ -54,9 +54,9 @@ const StickerExt = [, "png", "png", "json", "gif"] as const; function getUrl(data: Data) { if (data.t === "Emoji") - return `${location.protocol}//${window.GLOBAL_ENV.CDN_HOST}/emojis/${data.id}.${data.isAnimated ? "gif" : "png"}`; + return `${location.protocol}//${window.GLOBAL_ENV.CDN_HOST}/emojis/${data.id}.${data.isAnimated ? "gif" : "png"}?size=4096&lossless=true`; - return `${window.GLOBAL_ENV.MEDIA_PROXY_ENDPOINT}/stickers/${data.id}.${StickerExt[data.format_type]}`; + return `${window.GLOBAL_ENV.MEDIA_PROXY_ENDPOINT}/stickers/${data.id}.${StickerExt[data.format_type]}?size=4096&lossless=true`; } async function fetchSticker(id: string) { @@ -130,7 +130,8 @@ function getGuildCandidates(data: Data) { let count = 0; for (const emoji of emojis) - if (emoji.animated === isAnimated) count++; + if (emoji.animated === isAnimated && !emoji.managed) + count++; return count < emojiSlots; }).sort((a, b) => a.name.localeCompare(b.name)); } diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 53f9934b1..3bad423d5 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -425,6 +425,10 @@ export const Devs = /* #__PURE__*/ Object.freeze({ newwares: { name: "newwares", id: 421405303951851520n + }, + Byron: { + name: "byeoon", + id: 1167275288036655133n } } satisfies Record);