用户登录
用户注册

分享至

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

  • 作者: 瓜子_kesongbin
  • 来源: 51数据库
  • 2022-10-21

问题描述

我希望我的机器人发送 我的表情,等待 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)
}); 
软件
前端设计
程序设计
Java相关