mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-23 23:15:10 +00:00
chore: use Partial<Sticker> instead of any
This commit is contained in:
parent
4788a678a3
commit
368b8f337c
1 changed files with 3 additions and 3 deletions
|
@ -318,7 +318,7 @@ function isGifUrl(url: string) {
|
||||||
return u.pathname.endsWith(".gif") || u.searchParams.get("animated") === "true";
|
return u.pathname.endsWith(".gif") || u.searchParams.get("animated") === "true";
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildFakeSticker(sticker: any) {
|
function buildFakeSticker(sticker: Partial<Sticker>) {
|
||||||
return {
|
return {
|
||||||
id: sticker?.id,
|
id: sticker?.id,
|
||||||
name: sticker?.name,
|
name: sticker?.name,
|
||||||
|
@ -326,7 +326,7 @@ function buildFakeSticker(sticker: any) {
|
||||||
// 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
|
||||||
};
|
};
|
||||||
|
@ -351,7 +351,7 @@ const messageContextMenuPatch: NavContextMenuPatchCallback = (children, props) =
|
||||||
isAnimated: isGifUrl(itemHref ?? itemSrc)
|
isAnimated: isGifUrl(itemHref ?? itemSrc)
|
||||||
}));
|
}));
|
||||||
case "sticker":
|
case "sticker":
|
||||||
const sticker = props.message.stickerItems.find(s => s.id === favoriteableId);
|
const sticker: Partial<Sticker> | undefined = props.message.stickerItems.find(s => s.id === favoriteableId);
|
||||||
if (sticker?.format_type === 3 /* LOTTIE */) return;
|
if (sticker?.format_type === 3 /* LOTTIE */) return;
|
||||||
|
|
||||||
// Workaround for cases when it's not available
|
// Workaround for cases when it's not available
|
||||||
|
|
Loading…
Add table
Reference in a new issue