Add timer command
This commit is contained in:
parent
be673a9fad
commit
517f13291f
1 changed files with 14 additions and 0 deletions
14
commands/misc/timer.js
Normal file
14
commands/misc/timer.js
Normal file
|
@ -0,0 +1,14 @@
|
|||
module.exports = {
|
||||
name: "timer",
|
||||
description: "Set a timer for a time in minutes. Bot will mention you and the custom message after time has passed.",
|
||||
execute({message, args}) {
|
||||
if(args.length < 2)
|
||||
return message.channel.send("Please specify a time in minutes, and a message to send after the timer has finished");
|
||||
let time = args[0] * 60000;
|
||||
let sendText = args.slice(1).join(" ");
|
||||
let timer = setTimeout(function(){
|
||||
message.channel.send(`<@${message.author.id}>, ${sendText}`);
|
||||
}, time);
|
||||
message.channel.send(`I will remind you in ${time / 60000} seconds`);
|
||||
}
|
||||
};
|
Loading…
Add table
Reference in a new issue