discord.js send and wait before editing a message

随声附和 提交于 2019-12-11 14:53:11

问题


I want my bot, to send my emotes, wait 1 seconds and edit the message to my others emotes.

Here's my code :

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

And he send me this error : Cannot read property 'edit' of undefined

Thanks you for helping me.


回答1:


ok so finaly the code that works is :

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


来源:https://stackoverflow.com/questions/49840290/discord-js-send-and-wait-before-editing-a-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!