Answer the question
In order to leave comments, you need to log in
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!
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
const discord = require("discord.js");
...
var embed = new discord.RichEmbed() // не?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question