我正在尝试开发一些代码来在机器人上线时显示它,并让嵌入消息的颜色每 2 秒更改一次。(2000 毫秒)但我不知道怎么做,我得到一个错误,上面写着channel.send.edit is not a function
或类似的东西。
我所做的是......创建一个超时。编辑消息,但它会为正常运行时间部分显示不同的消息/输出。删除并发送消息。
var myInfo = new discord.RichEmbed()
.setAuthor(`${bot.user.username} is now ONLINE`,`${bot.user.avatarURL}`)
.setDescription(`The bot is now up, please check the following below to see when the bot was online.`)
.addField(`Ready At`,`${bot.readyAt}`,true)
.addField(`Timestamp`,`${bot.readyTimestamp}`,true)
.addField(`Uptime`,`${bot.uptime}`,true)
.setColor(0x008704)
.setFooter('Bot is now online.')
.setThumbnail(`${bot.user.avatarURL}`)
var myInfo2 = new discord.RichEmbed()
.setAuthor(`${bot.user.username} is now ONLINE`,`${bot.user.avatarURL}`)
.setDescription(`The bot is now up, please check the following below to see when the bot was online.`)
.addField(`Ready At`,`${bot.readyAt}`,true)
.addField(`Timestamp`,`${bot.readyTimestamp}`,true)
.addField(`Uptime`,`${bot.uptime}`,true)
.setColor(0x00c13a)
.setFooter('Bot is now online.')
.setThumbnail(`${bot.user.avatarURL}`)
bot.channels.get("523649838693482507").send(myInfo).edit(myInfo2);
我希望机器人在上线时会发送嵌入消息,然后 2 秒后机器人会编辑颜色,依此类推。
输出是一个给出错误的机器人,或者根本不工作。