javascript - How to use deleteMessage to get a Discord bot to clear a messge after () minutes - Stack Overflow

{setTimeout(function(){deleteMessage()}, 120000);}Trying to get my bot to delete a message after ()

{
setTimeout(function()
{
   deleteMessage()
}, 120000);
}

Trying to get my bot to delete a message after () minutes of it being sent what would I use to do this. If needed, the library I used was .JS

{
setTimeout(function()
{
   deleteMessage()
}, 120000);
}

Trying to get my bot to delete a message after () minutes of it being sent what would I use to do this. If needed, the library I used was https://github./hydrabolt/Discord.JS

Share Improve this question edited Jul 26, 2016 at 3:45 Josh P asked Jul 26, 2016 at 3:28 Josh PJosh P 592 silver badges11 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 2
bot.on("message", function(message)
  {
  setTimeout(function()
  {
  bot.deleteMessage(message)
  }, 120000);
});

This is what it ended up looking like, thank you Joundill for the help.

I suggest using this function in a setTimeout, like you currently have.

http://discordjs.readthedocs.io/en/latest/docs_client.html#deletemessage-message-options-callback

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745275429a4620010.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信