Phone Block Command

This commit is contained in:
Dragon Fire
2020-09-03 16:05:14 -04:00
parent 5a9c4418e1
commit 59b661ec2d
3 changed files with 41 additions and 2 deletions
+2 -1
View File
@@ -255,7 +255,7 @@ in the appropriate channel's topic to use it.
## Commands
Total: 539
Total: 540
### Utility:
@@ -820,6 +820,7 @@ Total: 539
* **admin-phone:** Starts an admin phone call with a server. (Owner-Only)
* **hang-up:** Hangs up the current phone call.
* **phone-block:** Gives instructions for blocking a channel or server.
* **phone-book:** Looks up phone-enabled servers.
* **phone-info:** Gives information on the current phone call.
* **phone:** Starts a phone call with a random server.
+38
View File
@@ -0,0 +1,38 @@
const Command = require('../../structures/Command');
const { stripIndents } = require('common-tags');
module.exports = class PhoneBlockCommand extends Command {
constructor(client) {
super(client, {
name: 'phone-block',
aliases: ['call-block'],
group: 'phone',
memberName: 'phone-block',
description: 'Gives instructions for blocking a channel or server.',
guildOnly: true,
args: [
{
key: 'query',
prompt: 'What channel would you like to search for?',
type: 'string'
}
]
});
}
run(msg, { query }) {
const channels = this.client.channels.cache.filter(channel => {
const search = query.toLowerCase();
return channel.guild
&& (channel.guild.name.toLowerCase().includes(search) || channel.name.includes(search) || channel.id === search);
});
if (!channels.size) return msg.reply('Could not find any results.');
if (channels.size > 1) return msg.reply(`Found ${channels.size} channels, please be more specific (or use ID).`);
const channel = channels.first();
return msg.say(stripIndents`
__To block **#${channel.name} (${channel.id})**:__
Just the channel: Place \`<xiao:phone:block:${channel.id}>\` in this channel's topic
The entire server: Place \`<xiao:phone:block:${channel.guild.id}>\` in this channel's topic
`);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "119.22.0",
"version": "119.23.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {