chance, remove timer, avatar is a link again

This commit is contained in:
Daniel Odendahl Jr
2018-03-09 03:06:15 +00:00
parent c965d443da
commit 3a14617543
6 changed files with 34 additions and 48 deletions
-33
View File
@@ -1,33 +0,0 @@
const { Command } = require('discord.js-commando');
const { wait } = require('../../util/Util');
module.exports = class TimerCommand extends Command {
constructor(client) {
super(client, {
name: 'timer',
group: 'other',
memberName: 'timer',
description: 'Sets a timer for a certain amount of time.',
args: [
{
key: 'seconds',
prompt: 'How many seconds do you want to set a timer for?',
type: 'float',
min: 1,
max: 600
}
]
});
this.timers = new Set();
}
async run(msg, { seconds }) {
if (this.timers.has(msg.author.id)) return msg.reply('You can only have one timer at a time.');
this.timers.add(msg.author.id);
await msg.say(`Setting a timer for ${seconds} seconds...`);
await wait(seconds * 1000);
this.timers.delete(msg.author.id);
return msg.reply('Time\'s up!');
}
};