0

Hello I have a very serious problem, if someone uses commands in my bot his avatar shows up but people who do not have an avatar after using the command crash the bot because the bot can not send their avatar which causes errors, I hope this is enough code (it is a footer with embed)

${message.author.avatarURL({ size: 1024, dynamic: true })}

1 Answer 1

5

Simple fix. Use User#displayAvatarURL() instead, This will handle default avatars instead of throwing an error.

${message.author.displayAvatarURL({ size: 1024, dynamic: true })}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.