mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add ability to see phone and portal channel counts
This commit is contained in:
@@ -31,6 +31,9 @@ module.exports = class PhoneCommand extends Command {
|
||||
&& channel.topic
|
||||
&& channel.topic.includes('<xiao:phone>')
|
||||
&& !msg.guild.channels.cache.has(channel.id));
|
||||
if (message.toLowerCase() === 'count') {
|
||||
return msg.say(`☎️ **${channels.size}** currently open lines.`);
|
||||
}
|
||||
if (!channels.size) return msg.reply('No channels currently allow phone calls...');
|
||||
const channel = channels.random();
|
||||
try {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { oneLine } = require('common-tags');
|
||||
const { PORTAL_EMOJI_ID, PORTAL_EMOJI_NAME } = process.env;
|
||||
|
||||
module.exports = class PortalSendCommand extends Command {
|
||||
@@ -29,13 +28,14 @@ module.exports = class PortalSendCommand extends Command {
|
||||
if (msg.channel.type === 'text') {
|
||||
channels = channels.filter(channel => !msg.guild.channels.cache.has(channel.id));
|
||||
}
|
||||
if (message.toLowerCase() === 'count') {
|
||||
return msg.say(`**${this.portalEmoji} ${channels.size}** currently open portals.`);
|
||||
}
|
||||
if (!channels.size) return msg.reply('No channels have an open portal...');
|
||||
const channel = channels.random();
|
||||
try {
|
||||
await channel.send(oneLine`
|
||||
**${this.portalEmoji} ${msg.author.tag} (${msg.channel.type === 'text' ? msg.guild.name : 'DM'}):**
|
||||
${message}
|
||||
`);
|
||||
const displayName = msg.channel.type === 'text' ? msg.guild.name : 'DM';
|
||||
await channel.send(`**${this.portalEmoji} ${msg.author.tag} (${displayName}):** ${message}`);
|
||||
return msg.say(`Message sent to **${channel.name}** in **${channel.guild.name}**!`);
|
||||
} catch (err) {
|
||||
return msg.reply('Failed to send the message. Try again later!');
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "111.1.4",
|
||||
"version": "111.1.5",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user