我试图在不和谐中打印 get embed 消息,但发生了这种情况:
类型错误:Discord.RichEmbed 不是构造函数
这是我的代码:
const Discord = require('discord.js');
const bot = new Discord.Client();
const token = 'mytokenhere';
const prefix = '!';
bot.on('ready', () => {
console.log('This bot is online!');
});
bot.on('message', message => {
let args = message.content.substring(prefix.length).split(" ");
switch(args[0]) {
case 'pomoc':
message.channel.send('.')
break;
case 'cc':
if(!args[1]) return message.reply('Podaj 2 argument! (liczbe wiadomosci do skasowania)')
message.channel.bulkDelete(args[1]);
break;
case 'embed':
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});
break; …Run Code Online (Sandbox Code Playgroud)