discord.js 发送并等待编辑消息

discord.js send and wait before editing a message

我想让我的机器人发送 my emotes,等待 1 秒,然后将消息编辑到 my others emotes

这是我的代码:

message.channel.send('my emotes')
  .then((msg) => {
    setTimeout(function() {
    msg.edit('my other emotes');
  }, 1000)});  

然后他向我发送了这个错误:Cannot read property 'edit' of undefined

谢谢你帮助我。

好的,最后有效的代码是:

message.channel.send('my emote')
.then((msg)=> {
  setTimeout(function(){
    msg.edit('my others emotes');
  }, 1000)
});