mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-06 14:20:51 +02:00
Fix issue with one-way phone messages
This commit is contained in:
@@ -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
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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>')
|
||||
|
||||
Reference in New Issue
Block a user