最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin1浏览0评论
{
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

发布评论

评论列表(0)

  1. 暂无评论