Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/400.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何使用deleteMessage在()分钟后让Discord bot清除消息_Javascript_Node.js_Bots - Fatal编程技术网

Javascript 如何使用deleteMessage在()分钟后让Discord bot清除消息

Javascript 如何使用deleteMessage在()分钟后让Discord bot清除消息,javascript,node.js,bots,Javascript,Node.js,Bots,尝试让我的机器人在邮件发送()分钟后删除邮件我将使用什么来执行此操作。如果需要,我使用的库是我建议在setTimeout中使用此函数,就像您当前使用的那样 这就是它最终的样子,谢谢你的帮助。我不熟悉discord.js,但从外观上看,它是客户端对象上的一种方法。所以可能是类似于client.deleteMessage(message)@Joundill是的,非常感谢 { setTimeout(function() { deleteMessage() }, 120000); } bot.

尝试让我的机器人在邮件发送()分钟后删除邮件我将使用什么来执行此操作。如果需要,我使用的库是

我建议在
setTimeout
中使用此函数,就像您当前使用的那样


这就是它最终的样子,谢谢你的帮助。

我不熟悉discord.js,但从外观上看,它是客户端对象上的一种方法。所以可能是类似于
client.deleteMessage(message)
@Joundill是的,非常感谢
{
setTimeout(function()
{
   deleteMessage()
}, 120000);
}
bot.on("message", function(message)
  {
  setTimeout(function()
  {
  bot.deleteMessage(message)
  }, 120000);
});