From bc62bec1d7f4d3adf8d206aa8a934495b0e3b861 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 28 Feb 2020 15:50:45 -0500 Subject: [PATCH] Disallow new calls in channels that already have one --- commands/other/phone.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/commands/other/phone.js b/commands/other/phone.js index 6f6170a7..6440bb5f 100644 --- a/commands/other/phone.js +++ b/commands/other/phone.js @@ -17,6 +17,9 @@ module.exports = class PhoneCommand extends Command { if (!msg.channel.topic || !msg.channel.topic.includes('')) { return msg.say('You can only start a call in a channel with `` in the topic.'); } + if (this.client.phone.some(call => [call.origin.id, call.recipient.id].includes(msg.channel.id))) { + return msg.say('This channel is already in a phone call.'); + } const channels = this.client.channels.cache.filter(channel => channel.type === 'text' && channel.topic && channel.topic.includes('')