使用消息收集器收集嵌入

时间:2020-02-14 06:06:24

标签: javascript typescript visual-studio-code collectors

我正在尝试更改嵌入命令。我想要的是,当有人在其中键入命令让bot询问您要嵌入的内容时,然后当用户响应两者时,将其发布为嵌入内容。这是我所拥有的,但是使用打字稿的VSC表示缺少内容。逗号在哪里或我使用了错误的功能?

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

        }
    }

0 个答案:

没有答案