From c309885d6362898634ee7fda52e9c64f44f05995 Mon Sep 17 00:00:00 2001 From: Supositware Date: Mon, 21 Jan 2019 15:43:51 +0100 Subject: [PATCH] Only let user use a number between 3 and 100 --- commands/hidden/domino.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/commands/hidden/domino.js b/commands/hidden/domino.js index 4f112bc..0bbe90b 100644 --- a/commands/hidden/domino.js +++ b/commands/hidden/domino.js @@ -1,4 +1,4 @@ -const { Command } = require('discord-akairo'); +const { Command, Argument } = require('discord-akairo'); class dominoCommand extends Command { constructor() { @@ -8,7 +8,7 @@ class dominoCommand extends Command { args: [ { id: 'number', - type: 'integer', + type: Argument.range('number', 3, 100), default: 10 } ], @@ -21,8 +21,6 @@ class dominoCommand extends Command { } async exec(message, args) { - if (args.domino < 2) - return message.channel.send('Can\'t do less than 3'); let domino = 'I'; message.util.send(domino.repeat(args.number))