【问题标题】:If a msg is deleted send another msg Discord.js如果一条消息被删除发送另一条消息 Discord.js
【发布时间】:2020-07-05 07:38:35
【问题描述】:

我正在尝试做某事:如果有人说嘿,机器人会发送“是”,但如果原始消息被删除(“嘿”),我希望机器人发送“啊哈哈哈哈”

这是我的代码:

client.on('message', msg => {
  if(msg.content.includes("hey")) {
    msg.channel.send("Yes").then(Mess => {
      if(Mess.messageDelete) {
        msg.channel.send('ahahahahah')
      }
    })
  }
})

谢谢!

【问题讨论】:

    标签: node.js discord.js


    【解决方案1】:

    只需使用msg.deleted:

    client.on('message', msg => {
      if(msg.content.includes("hey")) {
        msg.channel.send("Yes").then(Mess => {
          if(msg.deleted) {
            msg.channel.send('ahahahahah')
          }
        })
      }
    })
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-03-06
      • 1970-01-01
      • 2017-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-05-17
      • 1970-01-01
      相关资源
      最近更新 更多