From 98a0e189ca35803e37511c297a82fe4149332c95 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Fri, 28 Feb 2020 15:31:21 -0500 Subject: [PATCH] Fix issue with one-way phone messages --- Xiao.js | 1 - commands/other/phone.js | 3 +++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Xiao.js b/Xiao.js index 584662fe..cca684e2 100644 --- a/Xiao.js +++ b/Xiao.js @@ -66,7 +66,6 @@ client.on('message', async msg => { if (origin) await origin.send(origin.recipient, msg); if (recipient) await recipient.send(recipient.origin, msg); } catch (err) { - console.log(err); return; // eslint-disable-line no-useless-return } }); diff --git a/commands/other/phone.js b/commands/other/phone.js index 9777cf97..6f6170a7 100644 --- a/commands/other/phone.js +++ b/commands/other/phone.js @@ -14,6 +14,9 @@ module.exports = class PhoneCommand extends Command { } async run(msg) { + if (!msg.channel.topic || !msg.channel.topic.includes('')) { + return msg.say('You can only start a call in a channel with `` in the topic.'); + } const channels = this.client.channels.cache.filter(channel => channel.type === 'text' && channel.topic && channel.topic.includes('')