Creating a attachment with a link

Hello! Currently i have a link that is cdn.discordapp.com in a webp format, how can i use attachment builder to upload it as a file? link =
let img = randomMember?.avatarURL({ size: 1024, extension: "webp" })
let img = randomMember?.avatarURL({ size: 1024, extension: "webp" })
4 Replies
d.js toolkit
d.js toolkit•16mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
adam
adamOP•16mo ago
Latest discord.js version any help..? okay gimmie a second ill try this out, thanks
adam
adamOP•16mo ago
uploads it like this
adam
adamOP•16mo ago
channel.send({
files: [
{
attachment: randomMember.displayAvatarURL({
size: 1024,
extension: "webp",
}),
name: `marleanPfp-${makeid(15)}`,
},
],
});
channel.send({
files: [
{
attachment: randomMember.displayAvatarURL({
size: 1024,
extension: "webp",
}),
name: `marleanPfp-${makeid(15)}`,
},
],
});
need the upload to be an image oh... no Sob lemme try this out hmm got a bit of a dumb question, how can i make it gif, if its a gif? or like, work as a gif but i keep the ,webp in the name, right? Ehh, so there is no way to use the name in this case? Sorry but uh how can I do that I mean a custom name like the one i had there Ah so store, get the extension from link, and put it in the end of the name found the solution, thanks a lot 🙂
Want results from more Discord servers?
Add your server