#Sticker zip downloads via zip
1 messages ยท Page 1 of 1 (latest)
๐ #๐ฅ-vencord-support-๐ฅ
(Auto-response invoked by @sinful orchid)
but what the fuck are you doing making a thread in js snippets
@opaque island yo sorry for ping but can u del this thread for obvi reasons
hold on though, I am asking how to code such javascript
right
which is something someone said was okay a while ago
lmao
i think hes the first person to make a thread in js snippets for the issue of not knowing how to right code
I was told to use a js snippets at another time which was fine then
well they told you wrong
and you probably weren't even told that
I was told to use a js snippets channel in programming at the time
you were only told about js snippets in the text "go read #๐-js-snippets"
which if i recall correctly does not say "go make a thread and ask for programming support in #๐-js-snippets" (but correct me if im wrong)
I understand why you are frustated but at least you know why I tried to make a thread now, right?
there's no reason to be further harsh on me
im not frustrated
and not being harsh
im just telling you what you should have done instead
it's how you worded the tone
??
If you look at the actual converstation, no one bothered to help out and I have even been told by a few contributors to use js snippets last time
so if you look at it, you can see why I thought what you consider wrong
if you want people to use the correct channel maybe it's best to follow up in the right channel
In short, I understand what channel I can use in the future, I just hope you understand why I put a message in here instead
This is a valid thread, stop making a fool out of yourself
?
You just seem aggravated for no reason
im not
sure :)
though the only issue I have with this thread is that it has no real relationship with another existing js snippet
the issue i have with it is that its not related to js snippets
tone exists btw
?
Seems like it is
to me it seemed like it should go in #๐งฉ-plugin-development or (due to the fact they didnt have access to it) #๐ช -progaming
You understand a certain tone in messages can convey something, you seemed harsh but you said you werent but its the complete opposite for your previous messages
plugin development is not for js snippets
yeah but i dont think this is a js snippet as theyre im p sure theyre trynna make a plugin
its fine to make a thread here just associate it with the existing js snippet
wtf is that cursed code ๐
await fetch("https://unpkg.com/fflate@0.8.0").then(r => r.text()).then(eval);
๐ญ
there had to be a better way to do that right
I am trying to run a javascript snippet
I barely know javascript
I am only able to do so much because of python and general java knowledge
I would have zero knowledge on how to code a plugin
Sorry i have no real contribution other than JDJG and nyan handled this v well, hope yawl have a nice day
thanks, discord summaries
My biggest problem would be figuring out where the sticker store is
cause i have no idea what vencord utils exist
(and I can barely read javascript so)
The server shuts down today some time today so
what?
I was wondering if someone could tell me what util I use to get the stickers
is there a util or do I need to grab it from a list of imports?
This is a javascript snippet not plugin
and i have zero knowledge on plugin development
and i Don't have a plugin development role
This guy is doing the same thing by telling me the wrong channel
there is quite literally no way you can misconstrue my messages to be harsh in the slightest
I am asking for a java snippet to download the stickers of a server into a zip file
you know the emoji download script?
the sticker format isn't the same in terms of utils or file format
this is why I need a new version
this is not at all related to plugins
okay, thanks for telling me, that answers #1279268271706869780 message
again, theres nothing about what i said thats harsh at all, i was simply asking you a question.
I have said this several times
this thread, albeit short, is very hard to follow.
I want my version of emoji download but with stickers instead
async function zipServerEmojis(id) {
await fetch("https://unpkg.com/fflate@0.8.0").then(r => r.text()).then(eval);
const emojis = Vencord.Webpack.Common.EmojiStore.getGuilds()[id]?.emojis;
if (!emojis) {
return console.log("Server not found!");
}
const fetchEmojis = async e => {
let filename = e.id + (e.animated ? ".gif" : ".png");
const emoji = await fetch("https://cdn.discordapp.com/emojis/" + filename + "?size=512&quality=lossless" ).then(res => res.blob());
filename = e.id + "_" + e.name + (e.animated ? ".gif" : ".png");
return { file: new Uint8Array(await emoji.arrayBuffer()), filename };
};
const emojiPromises = emojis.map(e => fetchEmojis(e));
Promise.all(emojiPromises)
.then(results => {
const emojis = fflate.zipSync(Object.fromEntries(results.map(({ file, filename }) => [filename, file])));
const blob = new Blob([emojis], { type: "application/zip" });
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = `emojis-${id}.zip`;
link.click();
link.remove();
})
.catch(error => {
console.error(error);
});
}
zipServerEmojis("SERVER ID HERE");
like the id and sticker name
if no sticker id then it would be saved with just sticker name
Essentially I want a script that does something similar to this (modifited version of emoji downloader but with stickers of a server instead)
the other thing I would love to get is a json file with the unicode emoji either name to emoji
or something similar
but first thing is a sticker download java snippet
how do I import sticker's list and such?
the problem is that there isn't a helpful util like EmojiStore to get what i Need
and and importing within javascript doesn't work
the evergrowing list continues to grow
what do you mean?
async function ZipStickerEmojis(server_id)
{
import {findStoreLazy} from "@webpack";
const StickerStore = findStoreLazy("StickersStore")
}
no luck
Uncaught SyntaxError: Cannot use import statement outside a module
as you can see
Based on what i can see there isn't something i can do to run it as a javascript snippet
it might require a utility on vencord's end
cause the import doesn't work in javascript snippets
I think it's a problem that there doesn't seem to be a util to do this
at least I Cannot find a util if there is one
May need to make a pull request to add a util to grab stickerstore
So I can make thid
- this
this is entertaining
Entertaining how?
you're just randomly pinging people about whatever this is (apparently something about java), including me, and trying to report to moderators that I'm being rude or whatever.
also, isn't there a stickerstore
ah stickersstore
Ah:
Vencord.Webpack.findStoreLazy("StickersStore")
i have no idea how to use that though
async function ZipStickerEmojis(server_id)
{
await fetch("https://unpkg.com/fflate@0.8.0").then(r => r.text()).then(eval);
const stickers = Vencord.Webpack.findStore("StickersStore").
getStickersByGuildId(server_id)
if (!stickers){
return console.log("Server not found!");
}
}
I have this so far but there's no asset I could find
Like asset is empty
\https://cdn.discordapp.com/stickers/1039992459209490513.png
I only need that then
I need to somehow represent:
pngยถ
Represents a sticker with a png image.apng
Represents a sticker with an apng image.lottie
Represents a sticker with a lottie image.gif
Represents a sticker with a gif image.
what is in format_type
png = 1
apng = 2
lottie = 3
gif = 4
This will help
name and id also exist
async function ZipStickerEmojis(server_id)
{
await fetch("https://unpkg.com/fflate@0.8.0").then(r => r.text()).then(eval);
const stickers = Vencord.Webpack.findStore("StickersStore").
getStickersByGuildId(server_id)
if (!stickers){
return console.log("Server not found!");
}
const fetchStickers = async s => {
let filename = s.id + (s.content_type ? ".gif" : ".png");
const sticker = await fetch("https://cdn.discordapp.com/stickers/" + filename + "?size=512&quality=lossless").then(res => res.blob());
filename = s.id + "_" + s.name + (s.content_type ? ".gif" : ".png");
return {file: new Uint8Array(await sticker.arrayBuffer()), filename};
};
const StickersPromises = stickers.map(s => fetchStickers(s));
Promise.all(StickersPromises)
.then(results => {
const stickers = fflate.zipSync(Object.fromEntries(results.map(({ file, filename }) => [filename, file])));
const blob = new Blob([stickers], { type: "application/zip" });
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = `stickers-${id}.zip`;
link.click();
link.remove();
})
.catch(error => {
console.error(error);
});
}
await ZipStickerEmojis("1015060230222131221")
I have this now but grabbing the sticker urls don't quite work right
so for content_type png and apng it should be png
for gif it should be gif
not sure about lottie tho
ah lottie is json
png -> png
apng -> png
lottie -> json
gif -> gif
no real luck with:
async function ZipStickerEmojis(serverId) {
// Fetch fflate library (consider using a bundler for production)
await fetch("https://unpkg.com/fflate@0.8.0").then(r => r.text()).then(eval);
const stickers = Vencord.Webpack.findStore("StickersStore").getStickersByGuildId(serverId);
if (!stickers) {
console.log("Server not found!");
return; // Early exit if server not found
}
const fetchSticker = async (sticker) => {
let filenameSuffix;
switch (sticker.format_type) {
case 1: // png
filenameSuffix = ".png";
break;
case 2: // apng (treated as png)
filenameSuffix = ".png";
break;
case 3: // lottie
filenameSuffix = ".json";
break;
default:
console.warn(`Unknown format type: ${sticker.format_type}, using .png ${sticker.id}`);
filenameSuffix = ".png";
}
const filename = sticker.id + filenameSuffix;
const stickerBlob = await fetch("https://cdn.discordapp.com/stickers/" + filename + "?size=512&quality=lossless").then(res => res.blob());
return { file: new Uint8Array(await stickerBlob.arrayBuffer()), filename };
};
const stickerPromises = stickers.map(fetchSticker);
try {
const results = await Promise.all(stickerPromises);
const stickersZip = fflate.zipSync(Object.fromEntries(results.map(({ file, filename }) => [filename, file])));
const blob = new Blob([stickersZip], { type: "application/zip" });
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = `stickers-${serverId}.zip`;
link.click();
link.remove();
} catch (error) {
console.error(error);
}
}
await ZipStickerEmojis("1015060230222131221");
ooh:
Vencord.Webpack.Common.Constants.Endpoints.STICKER()
I have an issue with the cross site scriptting error so it makes things more difficult
could please someone let me know what I util I should be downloading from to not get an error?
ahhh always you
what
not youu
I know, I just find the necroposting a little odd
hi
?
lmao
idk why no one else has done it yet ๐คทโโ๏ธ but i made it work
async function ZipStickerEmojis(serverId) {
// Fetch fflate library (consider using a bundler for production)
await fetch("https://unpkg.com/fflate@0.8.0").then(r => r.text()).then(eval);
const stickers = Vencord.Webpack.findStore("StickersStore").getStickersByGuildId(serverId);
if (!stickers) {
console.log("Server not found!");
return; // Early exit if server not found
}
const fetchSticker = async (sticker) => {
const filename = sticker.id + "."+[, "png", "png", "json", "gif"][sticker.format_type]; // type 2 is APNG
const stickerBlob = await fetch(window.GLOBAL_ENV.MEDIA_PROXY_ENDPOINT+ "/stickers/" + filename + "?quality=lossless").then(res => res.blob());
return { file: new Uint8Array(await stickerBlob.arrayBuffer()), filename };
};
const stickerPromises = stickers.map(fetchSticker);
try {
const results = await Promise.all(stickerPromises);
const stickersZip = fflate.zipSync(Object.fromEntries(results.map(({ file, filename }) => [filename, file])));
const blob = new Blob([stickersZip], { type: "application/zip" });
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = `stickers-${serverId}.zip`;
link.click();
link.remove();
} catch (error) {
console.error(error);
}
}
await ZipStickerEmojis("SERVER ID HERE");```
@potent gate incase you still need it
Thank you ill try it in a bit
Will try soon
Hi there! Thank you for making this! 
Just some feedback:
It works, except for the naming of the stickers per their name in the server; filenames are just strings of numbers.
No idea why @potent gate needs to weeks to do a few-minute test 
oh yeah. i was just trying keep it similar to the emoji download thing. here's a version that downloads with their names
async function ZipStickerEmojis(serverId) {
// Fetch fflate library (consider using a bundler for production)
await fetch("https://unpkg.com/fflate@0.8.0").then(r => r.text()).then(eval);
const stickers = Vencord.Webpack.findStore("StickersStore").getStickersByGuildId(serverId);
if (!stickers) {
console.log("Server not found!");
return; // Early exit if server not found
}
const fetchSticker = async (sticker) => {
const suffix = "."+[, "png", "png", "json", "gif"][sticker.format_type]; // type 2 is APNG
const stickerBlob = await fetch(window.GLOBAL_ENV.MEDIA_PROXY_ENDPOINT+ "/stickers/" + sticker.id+suffix + "?quality=lossless").then(res => res.blob());
return { file: new Uint8Array(await stickerBlob.arrayBuffer()), filename: sticker.name+suffix };
};
const stickerPromises = stickers.map(fetchSticker);
try {
const results = await Promise.all(stickerPromises);
const stickersZip = fflate.zipSync(Object.fromEntries(results.map(({ file, filename }) => [filename, file])));
const blob = new Blob([stickersZip], { type: "application/zip" });
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = `stickers-${serverId}.zip`;
link.click();
link.remove();
} catch (error) {
console.error(error);
}
}
await ZipStickerEmojis("SERVER ID HERE");```
the emoji download css snippet keeps the server emoji names 
oh
unless im using a version different to what you know
i guess i forgot
This is for Emojis
await fetch("https://unpkg.com/fflate@0.8.0").then(r => r.text()).then(eval);
const emojis = Vencord.Webpack.Common.EmojiStore.getGuilds()[id]?.emojis;
if (!emojis) {
return console.log("Server not found!");
}
const fetchEmojis = async e => {
const filename = e.name + (e.animated ? ".gif" : ".png");
const emoji = await fetch("https://cdn.discordapp.com/emojis/" + e.id + "?size=512&quality=lossless" ).then(res => res.blob());
return { file: new Uint8Array(await emoji.arrayBuffer()), filename };
};
const emojiPromises = emojis.map(e => fetchEmojis(e));
Promise.all(emojiPromises)
.then(results => {
const emojis = fflate.zipSync(Object.fromEntries(results.map(({ file, filename }) => [filename, file])));
const blob = new Blob([emojis], { type: "application/zip" });
const link = document.createElement("a");
link.href = URL.createObjectURL(blob);
link.download = `emojis-${id}.zip`;
link.click();
link.remove();
})
.catch(error => {
console.error(error);
});
}
zipServerEmojis("SERVER ID HERE");```
im probably thinking of that one userplugin that also did the same
is it possible to consolidate the two?
like download them into folders of the final zip file?
that wasn't what i meant, but that would be nice
I mean combine the two snippets for Emojis & Stickers respectively into a single copy+paste
having the .zip export have separate subdirectories for emojis & stickers would be the final edit I could think of adding
you could just put both functions into your console and then call them both
but il try this out
and maybe i can possibly try soundboard items too (?)
i could, but i figured i'd ask

yeah i found the soundboardstore stuff so this should be happening
one quirk is that will require fetching the stickers beforehand (entering any vc and opening your soundboard button)
unless i figure out how to fetch
yeah i see why no one has done this already now
- too many call stacks when making subdirectories with this fflate module for some reason (more likely me doing something wrong but i cant figure it out)
- final code is too big for me to send
probably better off making a plugin for it and keep each expression type as an individual snippet
This works.
hey, this used to work great. really appreciated it. unfortunately, I am getting lots of Refused to connect because it violates the document's Content Security Policy.
i'll look into it later
the script still works for me so im not sure
are you using discord desktop, web or vesktop
all three
what platform did it work for you ?
well, vencord, vesktop & web
i use a fork of vesktop
but in theory, it should be the same result
unless they changed something on vesktop
