Only let user use a number between 3 and 100

This commit is contained in:
Supositware 2019-01-21 15:43:51 +01:00
parent 960deeeeb3
commit c309885d63

View file

@ -1,4 +1,4 @@
const { Command } = require('discord-akairo'); const { Command, Argument } = require('discord-akairo');
class dominoCommand extends Command { class dominoCommand extends Command {
constructor() { constructor() {
@ -8,7 +8,7 @@ class dominoCommand extends Command {
args: [ args: [
{ {
id: 'number', id: 'number',
type: 'integer', type: Argument.range('number', 3, 100),
default: 10 default: 10
} }
], ],
@ -21,8 +21,6 @@ class dominoCommand extends Command {
} }
async exec(message, args) { async exec(message, args) {
if (args.domino < 2)
return message.channel.send('Can\'t do less than 3');
let domino = 'I'; let domino = 'I';
message.util.send(domino.repeat(args.number)) message.util.send(domino.repeat(args.number))