The link to the avatar.Where is the error?

Hi.
Trying to make a command for the bot to output the avatar of the goal.
Got this code that is not working.
Help,please.
spoiler
const { Command } = require('shell.js-commando');

module.exports = class avatarCommand extends Command {
 constructor(client) {
 super(client, {
 name: 'avatar',
 memberName: 'avatar',
 group: 'other',
 description: ""
});
}
 async run(message, args) {
 var avatar = author.avatarURL;
 message.reply("avatar:" + avatar);
}
}

This is the whole code.
Thanks in advance
April 3rd 20 at 18:55
1 answer
April 3rd 20 at 18:57
Solution
And what's it supposed to work?
Where variable author come from?
As a token bot sadesa? Where the bulk of the work with the bot?

Do not use commando in General. Than you normal discrod.js not satisfied?
Here is an example appropriate for your request is: https://discord.js.org/#/docs/main/stable/examples...
@norma, Sorry to say about this:
spoiler
const { Command } = require('shell.js-commando');

module.exports = class avatarCommand extends Command {
 constructor(client) {
 super(client, {
 name: 'avatar',
 memberName: 'avatar',
 group: 'other',
 description: ",
 args: [
{
 key: 'text',
 prompt: 'which user?',
 type: 'string'
}
]
});
}
 run(msg, { user }) {

 let embed = new RichEmbed()
.setTitle(`${user.tag}!`)
.setURL(user.displayAvatarURL)
.setImage(user.displayAvatarURL)
.setColor("RANDOM")
msg.embed(embed)
}
}
- marcellus_Raynor41 commented on April 3rd 20 at 19:00
@marcellus_Raynor41, clear the error text you never sent.
I sent you the code, which 100% solves your problem. No need to use commando if you can't deal with the underlying discord.js. - norma commented on April 3rd 20 at 19:03
@norma, got it,thanks - marcellus_Raynor41 commented on April 3rd 20 at 19:06
@norma, the Error in the second code RichEmbed is not defined
As I understand it you need to declare RichEmbed - marcellus_Raynor41 commented on April 3rd 20 at 19:09
@marcellus_Raynor41, Yes, of course. If you knew how to work with the base discord.js you would know that RichEmbed you want to import: https://discord.js.org/#/docs/main/stable/examples...
As I did, you don't have to create a class, but you can pass an object to the send () method: https://discordjs.guide/popular-topics/embeds.html... - norma commented on April 3rd 20 at 19:12
@norma, Thanks for the info - marcellus_Raynor41 commented on April 3rd 20 at 19:15
@norma, Maybe I'm stupid,but adding
spoiler
const { Client RichEmbed } = require('discord.js');
const client = new Client();

The error has changed to TypeError: RichEmbed is not a constructor - marcellus_Raynor41 commented on April 3rd 20 at 19:18
@norma, Thanks for Your help.I figured it out! - marcellus_Raynor41 commented on April 3rd 20 at 19:21

Find more questions by tags JavaScriptNode.jsBotsDiscord