discord.js 在编辑消息之前发送并等待 [英] discord.js send and wait before editing a message

查看:20
本文介绍了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)});  

他发给我这个错误:Cannot read property 'edit' of undefined

谢谢你帮助我.

推荐答案

好的,最后的代码是:

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

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

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