Add blocking to phone

This commit is contained in:
Dragon Fire
2020-09-02 17:58:05 -04:00
parent 378f71c094
commit 841215a37d
4 changed files with 11 additions and 1 deletions
+1
View File
@@ -248,6 +248,7 @@ in the appropriate channel's topic to use it.
* `<xiao:phone>` Allows a channel to recieve phone calls from the `phone` command.
* `<xiao:phone:no-voicemail>` Prevents this channel from recieving voicemails for missed calls.
* `<xiao:phone:no-random>` Makes the channel only able to be called directly in the `phone` command, rather than be picked at random.
* `<xiao:phone:block:INSERTIDHERE>` Blocks a channel or server from contacting the channel via phone.
* `<xiao:phone-book:hide>` Hides a channel from the `phone-book` command.
* `<xiao:portal>` Allows a channel to recieve portal messages from the `portal-send` command.
* `<xiao:portal:hide-name>` Hides the channel and server name from the `portal-send` command when your channel is picked.
+8
View File
@@ -48,6 +48,8 @@ module.exports = class PhoneCommand extends Command {
&& channel.topic
&& channel.topic.includes('<xiao:phone>')
&& !channel.topic.includes('<xiao:phone:no-random>')
&& !channel.topic.includes(`<xiao:phone:block:${msg.channel.id}>`)
&& !channel.topic.includes(`<xiao:phone:block:${mag.guild.id}>`)
&& !msg.guild.channels.cache.has(channel.id)
&& (channelID ? true : !this.client.inPhoneCall(channel)));
if (!channels.size) return msg.reply('No channels currently allow phone calls...');
@@ -60,6 +62,12 @@ module.exports = class PhoneCommand extends Command {
return msg.reply('This channel does not allow phone calls.');
}
if (this.client.inPhoneCall(channel)) return msg.reply('This channel is already in a call.');
if (channel.topic.includes(`<xiao:phone:block:${msg.channel.id}>`)) {
return msg.reply('That channel has blocked this channel from calling them.');
}
if (channel.topic.includes(`<xiao:phone:block:${mag.guild.id}>`)) {
return msg.replY('That channel has blocked this server from calling them.');
}
} else {
channel = channels.random();
}
+1
View File
@@ -22,6 +22,7 @@ module.exports = class OptionsCommand extends Command {
\`<xiao:phone>\` Allows this channel to recieve phone calls.
\`<xiao:phone:no-voicemail>\` Prevents this channel from recieving voicemails for missed calls.
\`<xiao:phone:no-random>\` Makes the channel only able to be called directly, rather than picked randomly.
\`<xiao:phone:block:INSERTIDHERE>\` Blocks a channel or server from contacting you via phone.
\`<xiao:phone-book:hide>\` Hides this channel from \`phone-book\`.
\`<xiao:portal>\` Marks the channel as a portal channel for \`portal-send\`.
\`<xiao:portal:hide-name>\` Hides the channel's name when the channel is chosen to recieve a portal message.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "119.20.0",
"version": "119.21.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {