avatar.js Cannot send an empty message

i recently update my node version, my discord.js version and my npm version. While doing ?avatar @pingOne @pingTwo, i get the error :
throw new DiscordAPIError.DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^

DiscordAPIError[50006]: Cannot send an empty message
throw new DiscordAPIError.DiscordAPIError(data, "code" in data ? data.code : data.error, status, method, url, requestData);
^

DiscordAPIError[50006]: Cannot send an empty message
My code is :
const avatarList = message.mentions.users.map(user => {
return `L'avatar de ${user.username} est : ${user.displayAvatarURL({ format: 'png' })}`;
});
message.channel.send(avatarList);
const avatarList = message.mentions.users.map(user => {
return `L'avatar de ${user.username} est : ${user.displayAvatarURL({ format: 'png' })}`;
});
message.channel.send(avatarList);
7 Replies
d.js docs
d.js docs3y 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.
Hugo4774
Hugo4774OP3y ago
14.3.0 v16.17.0
MrMythical
MrMythical3y ago
You are passing an array, join it then send
Hugo4774
Hugo4774OP3y ago
Can someone pass me a short code to send mentionned user's avatar from a message ?
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs3y ago
Documentation suggestion for @hugo4774:method GuildMember#avatarURL() A link to the member's guild avatar.
Hugo4774
Hugo4774OP3y ago
I got it ty
Want results from more Discord servers?
Add your server