【发布时间】:2020-07-02 10:41:53
【问题描述】:
我正在为我的 discord 服务器编写一个机器人,我创建了一个命令,当被调用时,它可以工作。
确实,当用户键入“!embed theTextToEmbedHere”时,机器人会删除他的消息并发送一个嵌入,其中包含他的消息。 当我显示作者用户名和所有这些东西时,一切正常,但是当我尝试显示机器人或作者的头像时,什么都没有显示。 我到处搜索,给出的所有功能都不起作用。
这是我的简化代码(没有有效的东西):
module.exports = async(client, message) => {
//Already done all the test to check if the the command is called
const membre = message.member;
var avatar = membre.user.avatarURL; //Or displayAvatarURL
var embed = new Discord.MessageEmbed()
.setColor(0x00a5ff)
.setAuthor(`${membre.displayName}`, avatar);
message.channel.send(embed);
};
//Name the command after
当我尝试显示嵌入时,头像没有出现在嵌入上,这与我想要显示的用户名和所有其他信息相反。 提前致谢。
【问题讨论】:
标签: discord.js