N
N
Nikita NeVajno2019-12-27 17:59:13
JavaScript
Nikita NeVajno, 2019-12-27 17:59:13

Rich Embed is not a constructor?

Hello.
I am making a command for the bot, namely UserInfo.
The essence of the command shows when the user joined the server, his status, role on the server. In general, information.
Encountered an error, please help. Thanks in advance!
With coming!

spoiler
const { Command } = require("discord.js-commando");
const { RichEmbed } = require("discord.js");

module.exports = class UInfoCommand extends Command {
  constructor(client) {
    super (client, {
      name: "uinf",
      group: "other",
      memberName: "uinf",
      description: "Покажет информацию о пользователе.",
      args: [{
        key: "member",
        label: "user",
        type: "member",
        prompt: "Упомините пользователя."
      }]
    });
  }
  async run(msg, { member }) {
    var user = member.user;
    var userStats = user.presence.status.split("");
    userStats[0] = userStats[0].toUpperCase();
    userStats = userStats.join("");
    var embed = new RichEmbed()
      .setTitle(user.tag +"'s info")
      .setThumbnail(user.avatarURL)
      .setColor(0xFF0090)
      .addField("ID пользователя", user.id)
      .addField("Присоединился", member.joinedAt)
      .addField("Создан", member.user.createdAt)
      .addField("Играет в", user.presence.game ? user.presence.game.name : "None")
      .addField("Роли на сервере", "```"+ member.roles.map(roles => roles.name).join(", ") +"```")
      .addField("Статус", userStats);
    return msg.channel.send(embed);
  }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stalker_RED, 2019-12-27
@Pangsit

const discord = require("discord.js");
...
var embed = new discord.RichEmbed()  // не?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question