How to check if message contains images/other files

My bot crashes everytime it tries to copy a message from me and I attach a file to my message.
client.on('messageCreate', (message) => {
if(message.author.bot) return;
if(typeof message.content !== 'string'){
client.on('messageCreate', (message) => {
if(message.author.bot) return;
if(typeof message.content !== 'string'){
I'm very new to this sorry
2 Replies
d.js toolkit
d.js toolkit9mo 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! - Marked as resolved by OP
d.js docs
d.js docs9mo ago
Documentation suggestion for @Pagani: :property: Message#attachments A collection of attachments in the message - e.g. Pictures - mapped by their ids. (more...)
Want results from more Discord servers?
Add your server