Reputation: 61
{
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.com/hydrabolt/Discord.JS
Upvotes: 1
Views: 9136
Reputation: 61
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.
Upvotes: 2
Reputation: 7533
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
Upvotes: 1