From fc4a194a28e4c0ed8a1bd854171d2c087fa7460e Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 1 Mar 2020 22:09:58 -0500 Subject: [PATCH] Fix phone count --- commands/other/phone.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/commands/other/phone.js b/commands/other/phone.js index 899eedb8..8317e8b7 100644 --- a/commands/other/phone.js +++ b/commands/other/phone.js @@ -10,6 +10,14 @@ module.exports = class PhoneCommand extends Command { memberName: 'phone', description: 'Starts a phone call with a random server.', guildOnly: true, + args: [ + { + key: 'count', + prompt: 'Would you like to get the count of channels?', + type: 'boolean', + default: false + } + ], credit: [ { name: 'Tatsumaki', @@ -20,7 +28,7 @@ module.exports = class PhoneCommand extends Command { }); } - async run(msg) { + async run(msg, { count }) { if (!msg.channel.topic || !msg.channel.topic.includes('')) { return msg.say('You can only start a call in a channel with `` in the topic.'); } @@ -31,9 +39,7 @@ module.exports = class PhoneCommand extends Command { && channel.topic && channel.topic.includes('') && !msg.guild.channels.cache.has(channel.id)); - if (message.toLowerCase() === 'count') { - return msg.say(`☎️ **${channels.size}** currently open lines.`); - } + if (count) return msg.say(`☎️ **${channels.size}** currently open lines.`); if (!channels.size) return msg.reply('No channels currently allow phone calls...'); const channel = channels.random(); try {