N
N
Nikita NeVajno2019-12-21 16:14:50
JavaScript
Nikita NeVajno, 2019-12-21 16:14:50

Displaying a link to the avatar. Where is the error?

Hello.
I'm trying to make a command for the bot to display the target's avatar.
I got a code that doesn't work.
Help me please.

spoiler
const { Command } = require('discord.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);
  }
}

This is all code.
thanks in advance

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Anton Neverov, 2019-12-21
@Pangsit

And what exactly should work here?
Where does the author variable come from?
How will the bot get the token? Where is the main part of the work with the bot?
Don't use commando at all. What do you dislike about regular discrod.js?
Here is an example suitable for your request: https://discord.js.org/#/docs/main/stable/examples...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question