mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
Fix
This commit is contained in:
@@ -57,11 +57,11 @@ module.exports = class PhoneCommand extends Command {
|
|||||||
channel = this.client.channels.cache.get(channelID);
|
channel = this.client.channels.cache.get(channelID);
|
||||||
const user = this.client.users.cache.get(channelID);
|
const user = this.client.users.cache.get(channelID);
|
||||||
if (user) return msg.reply('You cannot call DM channels.');
|
if (user) return msg.reply('You cannot call DM channels.');
|
||||||
if (!channel || !channel.guild) return msg.reply('This channel does not exist.');
|
if (!channel || !channel.guild) return msg.reply('That channel does not exist.');
|
||||||
if (!channel.topic || !channel.topic.includes('<xiao:phone>')) {
|
if (!channel.topic || !channel.topic.includes('<xiao:phone>')) {
|
||||||
return msg.reply('This channel does not allow phone calls.');
|
return msg.reply('That channel does not allow phone calls.');
|
||||||
}
|
}
|
||||||
if (this.client.inPhoneCall(channel)) return msg.reply('This channel is already in a call.');
|
if (this.client.inPhoneCall(channel)) return msg.reply('That channel is already in a call.');
|
||||||
if (this.client.isBlockedFromPhone(msg.channel, channel, msg.author)) {
|
if (this.client.isBlockedFromPhone(msg.channel, channel, msg.author)) {
|
||||||
return msg.reply('That channel has blocked this channel from calling them.');
|
return msg.reply('That channel has blocked this channel from calling them.');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,11 +54,11 @@ module.exports = class XiaoClient extends CommandoClient {
|
|||||||
|
|
||||||
isBlockedFromPhone(origin, recipient, caller) {
|
isBlockedFromPhone(origin, recipient, caller) {
|
||||||
return recipient.topic.includes(`<xiao:phone:block:${origin.id}>`)
|
return recipient.topic.includes(`<xiao:phone:block:${origin.id}>`)
|
||||||
&& recipient.topic.includes(`<xiao:phone:block:${caller.id}>`)
|
|| recipient.topic.includes(`<xiao:phone:block:${caller.id}>`)
|
||||||
&& (origin.guild && recipient.topic.includes(`<xiao:phone:block:${origin.guild.id}>`))
|
|| (origin.guild && recipient.topic.includes(`<xiao:phone:block:${origin.guild.id}>`))
|
||||||
&& (origin.guild && origin.topic.includes(`<xiao:phone:block:${recipient.id}>`))
|
|| (origin.guild && origin.topic.includes(`<xiao:phone:block:${recipient.id}>`))
|
||||||
&& (origin.guild && origin.topic.includes(`<xiao:phone:block:${recipient.guild.id}>`))
|
|| (origin.guild && origin.topic.includes(`<xiao:phone:block:${recipient.guild.id}>`))
|
||||||
&& (origin.guild && origin.topic.includes(`<xiao:phone:block:${caller.id}>`));
|
|| (origin.guild && origin.topic.includes(`<xiao:phone:block:${caller.id}>`));
|
||||||
}
|
}
|
||||||
|
|
||||||
importCommandLeaderboard() {
|
importCommandLeaderboard() {
|
||||||
|
|||||||
Reference in New Issue
Block a user