Attachment content type support

Hello. Not sure if this is correct place to ask this question. I need a list of what content types are supported for attachments. Does anyone got a list or a link to it, I'd appreciate it. Thank you!
7 Replies
d.js toolkit
d.js toolkit17mo ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
chickenwing
chickenwingOP17mo ago
nevermind, I found what I was looking for. 👍
PAdventures
PAdventures16mo ago
sorry where did you find that. i am looking for the same thing. specifically what is given with attachement.contentType 😕 I know what file types are. I'm looking at what discord supports and what is given when I use attachement.contentType. so for example .png or png or image
chewie
chewie16mo ago
anything, really you can upload any file type you want
PAdventures
PAdventures16mo ago
when u said "Look into MIME" i thought you were saying the profession. but i get it now so if i want to specifically look at images, image/jpeg and image/png is whats given with contentType? or other image file types ok thx so theoretically this code would work to only allow image files being used
const attachements = message.attachments.filter(a => a.contentType.startsWith('image/'))
const attachements = message.attachments.filter(a => a.contentType.startsWith('image/'))
chewie
chewie16mo ago
yes
PAdventures
PAdventures16mo ago
ok
Want results from more Discord servers?
Add your server