作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我得到了这个:
( Node :5496)UnhandledPromiseRejectionWarning:未处理的 promise 拒绝(拒绝ID:2):TypeError:无法读取属性rty 'map' of null
( Node :5496)[DEP0018] DeprecationWarning:未处理的 promise 拒绝已被弃用。 future , promise 拒绝未处理的将会以非零退出代码终止 Node.js 进程。
每次我运行“userinfo”命令时
const prefix = require('../../settings.json').prefix;
const Discord = require('discord.js');
const commando = require('discord.js-commando');
class UserInfo extends commando.Command {
constructor(client) {
super(client, {
name: 'userinfo',
group: 'showinfo',
memberName: 'userinfo',
description: 'Muestra la información de un usuario.'
});
}
async run (message, args) {
if(message.author.bot) return;
if(message.channel.type === "dm") return;
var embed = new Discord.RichEmbed()
.setAuthor(message.author.username)
.setDescription("Usuario rikolino.")
.setColor("#3535353")
.addField("Usuario", '${message.author.username}#${message.author.discriminator}')
.addField("ID", message.author.id)
.addField("Creación", message.author.createdAt);
message.channel.sendEmbed(embed);
return;
}
}
module.exports = UserInfo;
最佳答案
自 5 月 1 日起,.sendEmbed()
现已弃用。它现在是 .send()
方法的一部分,要发送嵌入,您现在必须输入:
message.channel.send({embed});
- https://github.com/hydrabolt/discord.js/releases/tag/11.1.0
所以就你而言,
var embed = new Discord.RichEmbed()
.setAuthor(message.author.username)
.setDescription("Usuario rikolino.")
.setColor("#3535353")
.addField("Usuario", '${message.author.username}#${message.author.discriminator}')
.addField("ID", message.author.id)
.addField("Creación", message.author.createdAt);
message.channel.send({embed});
return;
javascript discord.js discord embed richembed node.js depreciationwarning
关于javascript - .sendEmbed 不适用于 RichEmbeds,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46009103/
我是一名优秀的程序员,十分优秀!