Fix in Info Command

This commit is contained in:
Daniel Odendahl Jr
2017-04-10 20:30:52 +00:00
parent 83091d1690
commit 7132427aca
+4 -3
View File
@@ -20,7 +20,7 @@ module.exports = class InfoCommand extends commando.Command {
key: 'shardID',
prompt: 'Which Shard would you like to get data for?',
type: 'integer',
default: ''
default: NaN
}]
});
}
@@ -30,8 +30,9 @@ 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 || this.client.shard.id;
if (shardID > this.client.options.shardCount - 1 || shardID < 0) {
let shardID = args.shardID + 1 || this.client.shardID + 1;
shardID = shardID - 1;
if (shardID > this.client.options.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)');