discord.js发送并等待,然后编辑消息 [英] discord.js send and wait before editing a message

查看:97
本文介绍了discord.js发送并等待,然后编辑消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的机器人发送我的表情,等待1秒钟,然后将消息编辑为我的其他表情

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

这是我的代码:

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

他向我发送此错误:无法读取未定义的属性 edit

谢谢您的帮助。

推荐答案

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

ok so finaly the code that works is :

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

这篇关于discord.js发送并等待,然后编辑消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆