Fix thing when first arg is NaN
This commit is contained in:
parent
f3e3fd9dbc
commit
5f4a0056d7
1 changed files with 4 additions and 1 deletions
|
@ -5,7 +5,10 @@ module.exports = {
|
||||||
execute({message, args}) {
|
execute({message, args}) {
|
||||||
if(args.length < 2)
|
if(args.length < 2)
|
||||||
return message.channel.send("Please specify a time in minutes, and a message to send after the timer has finished");
|
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 time = parseInt(args[0]);
|
||||||
|
if(isNaN(time))
|
||||||
|
return message.channel.send("Specify a time in number of minutes");
|
||||||
|
time = time * 60000;
|
||||||
let sendText = args.slice(1).join(" ");
|
let sendText = args.slice(1).join(" ");
|
||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
message.channel.send(`<@${message.author.id}>, ${sendText}`);
|
message.channel.send(`<@${message.author.id}>, ${sendText}`);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue