Javascript 使用消息收集器收集嵌入的消息
我正在尝试更改嵌入命令。我想要的是,当有人输入命令让bot询问您想要嵌入什么,然后当用户响应时,两者都将其作为嵌入发布。这就是我所拥有的,但是VSC使用typescript表示缺少一个。逗号在哪里?还是我使用了错误的函数Javascript 使用消息收集器收集嵌入的消息,javascript,typescript,visual-studio-code,collectors,Javascript,Typescript,Visual Studio Code,Collectors,我正在尝试更改嵌入命令。我想要的是,当有人输入命令让bot询问您想要嵌入什么,然后当用户响应时,两者都将其作为嵌入发布。这就是我所拥有的,但是VSC使用typescript表示缺少一个。逗号在哪里?还是我使用了错误的函数 if(msgObject.content.startsWith(-embed)){ msgObject.channel.send('What would you like to embed?') const collector = new Di
if(msgObject.content.startsWith(-embed)){
msgObject.channel.send('What would you like to embed?')
const collector = new Discord.MessageCollector(msgObject.channel, m => m.author.id === msgObject.author.id, { time: 1000000 });
collector.on('collect', message => {
if(!message.content === null)
return;
let embed = new Discord.RichEmbed()
.setColor(Random)
.setDescription(message)
.setThumbnail(msgObject.author.avatarURL)
.setFooter(msgObject.author.username)
.setTimestamp();
msgObject.delete(70)// Waits 70 Milliseconds and deletes the message sent by the user.
msgObject.channel.send(embed) // Sends the new message
}
}