Reputation: 35
I was just wondering how I can make a simple countdown command using ms, so that when someone types !timer (time) (s/m/h) it starts a timer for the requested amount of time, and once the countdown is over sends a message
Upvotes: 0
Views: 1213
Reputation:
Assuming you already know how to get the args variable and validate the command:
//msg = <Message>
//client = <Client>
const time = ms(args[0]);
if(!time) return msg.channel.send("invalid time");
client.setTimeout(() => msg.channel.send("time up"), time);
Upvotes: 2