From 471b1d84614e0e32d464915e978be1ccbaf8b095 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Mon, 10 Apr 2017 15:17:22 +0000 Subject: [PATCH] Fix Info Command --- commands/botinfo/info.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/commands/botinfo/info.js b/commands/botinfo/info.js index 09298906..044c75a0 100644 --- a/commands/botinfo/info.js +++ b/commands/botinfo/info.js @@ -20,13 +20,7 @@ module.exports = class InfoCommand extends commando.Command { key: 'shardID', prompt: 'Which Shard would you like to get data for?', type: 'integer', - validate: shardID => { - if (shardID < this.client.shardCount && shardID > -1) { - return true; - } - return 'Invalid Shard ID.'; - }, - default: this.client.shard.id + default: '' }] }); } @@ -36,7 +30,13 @@ module.exports = class InfoCommand extends commando.Command { if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return; if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!'); } - const shardID = args.shardID; + let shardID = args.shardID; + if (!shardID) { + shardID = this.client.shard.id; + } + else if (shardID > this.client.shardCount - 1 && shardID < 0) { + return message.say(':x: Error! Invalid Shard!'); + } const memory = await this.client.shard.broadcastEval('Math.round(process.memoryUsage().heapUsed / 1024 / 1024)'); const uptime = await this.client.shard.fetchClientValues('uptime'); const guilds = await this.client.shard.fetchClientValues('guilds.size');