mirror of
https://github.com/Vendicated/Vencord.git
synced 2025-02-24 15:35:11 +00:00
fix things as needed
This commit is contained in:
parent
e04032eb09
commit
eeb8750f94
1 changed files with 2 additions and 10 deletions
|
@ -36,14 +36,7 @@ interface Sticker {
|
||||||
type: number;
|
type: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface Emoji {
|
type Data = Sticker;
|
||||||
t: "Emoji";
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
isAnimated: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
type Data = Emoji | Sticker;
|
|
||||||
|
|
||||||
const StickerExt = [, "png", "png", "json", "gif"] as const;
|
const StickerExt = [, "png", "png", "json", "gif"] as const;
|
||||||
|
|
||||||
|
@ -51,7 +44,7 @@ function getUrl(data: Data) {
|
||||||
if (data.t === "Sticker")
|
if (data.t === "Sticker")
|
||||||
return `https:${window.GLOBAL_ENV.MEDIA_PROXY_ENDPOINT}/stickers/${data.id}.${StickerExt[data.format_type]}?size=2048&lossless=true`;
|
return `https:${window.GLOBAL_ENV.MEDIA_PROXY_ENDPOINT}/stickers/${data.id}.${StickerExt[data.format_type]}?size=2048&lossless=true`;
|
||||||
|
|
||||||
return "oops Couldnt get it sorry boss";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchSticker(id: string) {
|
async function fetchSticker(id: string) {
|
||||||
|
@ -83,7 +76,6 @@ function buildMenuItem(type: "Sticker", fetchData: () => Promisable<Omit<Sticker
|
||||||
const res = await fetchData();
|
const res = await fetchData();
|
||||||
const data = { t: type, ...res } as Sticker;
|
const data = { t: type, ...res } as Sticker;
|
||||||
const url = getUrl(data);
|
const url = getUrl(data);
|
||||||
console.log("URL: " + url + "\n" + "Data: " + data);
|
|
||||||
Toasts.show({
|
Toasts.show({
|
||||||
message: "Link to sticker copied!",
|
message: "Link to sticker copied!",
|
||||||
type: Toasts.Type.SUCCESS,
|
type: Toasts.Type.SUCCESS,
|
||||||
|
|
Loading…
Add table
Reference in a new issue