Fix issue with one-way phone messages

This commit is contained in:
Dragon Fire
2020-02-28 15:31:21 -05:00
parent d902f57715
commit 98a0e189ca
2 changed files with 3 additions and 1 deletions
-1
View File
@@ -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
}
});
+3
View File
@@ -14,6 +14,9 @@ module.exports = class PhoneCommand extends Command {
}
async run(msg) {
if (!msg.channel.topic || !msg.channel.topic.includes('<xiao:phone>')) {
return msg.say('You can only start a call in a channel with `<xiao:phone>` in the topic.');
}
const channels = this.client.channels.cache.filter(channel => channel.type === 'text'
&& channel.topic
&& channel.topic.includes('<xiao:phone>')