mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 05:54:33 +02:00
Fix phone count
This commit is contained in:
+10
-4
@@ -10,6 +10,14 @@ module.exports = class PhoneCommand extends Command {
|
|||||||
memberName: 'phone',
|
memberName: 'phone',
|
||||||
description: 'Starts a phone call with a random server.',
|
description: 'Starts a phone call with a random server.',
|
||||||
guildOnly: true,
|
guildOnly: true,
|
||||||
|
args: [
|
||||||
|
{
|
||||||
|
key: 'count',
|
||||||
|
prompt: 'Would you like to get the count of channels?',
|
||||||
|
type: 'boolean',
|
||||||
|
default: false
|
||||||
|
}
|
||||||
|
],
|
||||||
credit: [
|
credit: [
|
||||||
{
|
{
|
||||||
name: 'Tatsumaki',
|
name: 'Tatsumaki',
|
||||||
@@ -20,7 +28,7 @@ module.exports = class PhoneCommand extends Command {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
async run(msg) {
|
async run(msg, { count }) {
|
||||||
if (!msg.channel.topic || !msg.channel.topic.includes('<xiao:phone>')) {
|
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.');
|
return msg.say('You can only start a call in a channel with `<xiao:phone>` in the topic.');
|
||||||
}
|
}
|
||||||
@@ -31,9 +39,7 @@ module.exports = class PhoneCommand extends Command {
|
|||||||
&& channel.topic
|
&& channel.topic
|
||||||
&& channel.topic.includes('<xiao:phone>')
|
&& channel.topic.includes('<xiao:phone>')
|
||||||
&& !msg.guild.channels.cache.has(channel.id));
|
&& !msg.guild.channels.cache.has(channel.id));
|
||||||
if (message.toLowerCase() === 'count') {
|
if (count) return msg.say(`☎️ **${channels.size}** currently open lines.`);
|
||||||
return msg.say(`☎️ **${channels.size}** currently open lines.`);
|
|
||||||
}
|
|
||||||
if (!channels.size) return msg.reply('No channels currently allow phone calls...');
|
if (!channels.size) return msg.reply('No channels currently allow phone calls...');
|
||||||
const channel = channels.random();
|
const channel = channels.random();
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user