chore: apply splatter's patches

This commit is contained in:
Haruka 2025-01-25 02:42:59 +02:00
parent 58fd97ba58
commit 7d8c73f36c
No known key found for this signature in database
GPG key ID: C0F0780E671DB7D5

View file

@ -75,7 +75,6 @@ async function fetchSticker(id: string) {
return body as Sticker; return body as Sticker;
} catch (err) { } catch (err) {
return undefined;
} }
} }
@ -342,9 +341,7 @@ const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) =
// Workaround for cases when it's not available // Workaround for cases when it's not available
// (e.g when using MessageLinkEmkbeds) // (e.g when using MessageLinkEmkbeds)
if (sticker === undefined) { if (sticker === undefined) return;
return;
}
return buildMenuItem("Sticker", async () => { return buildMenuItem("Sticker", async () => {
const fetchedSticker = await fetchSticker(favoriteableId); const fetchedSticker = await fetchSticker(favoriteableId);
@ -353,19 +350,19 @@ const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) =
// Allows the sticker to still be cloned. // Allows the sticker to still be cloned.
if (fetchedSticker === undefined) { if (fetchedSticker === undefined) {
return { return {
"id": sticker?.id, id: sticker?.id,
"name": sticker?.name, name: sticker?.name,
"format_type": sticker?.format_type, format_type: sticker?.format_type,
// Discord has a character limit of at least 1 for tags (aka related emoji) // Discord has a character limit of at least 1 for tags (aka related emoji)
"tags": " ", tags: " ",
"description": "", description: "",
"type": "2", type: "2",
"available": true, available: true,
"guild_id": 0 guild_id: 0
}; };
} else {
return fetchedSticker;
} }
return fetchedSticker;
}); });
} }
})(); })();