mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 06:42:50 +02:00
portal status
This commit is contained in:
@@ -0,0 +1,22 @@
|
|||||||
|
const { Command } = require('discord.js-commando');
|
||||||
|
|
||||||
|
module.exports = class PortalStatusCommand extends Command {
|
||||||
|
constructor(client) {
|
||||||
|
super(client, {
|
||||||
|
name: 'portal-status',
|
||||||
|
group: 'portal',
|
||||||
|
memberName: 'portal-status',
|
||||||
|
description: 'Shows the number of currently opened portals.'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
run(msg) {
|
||||||
|
const channels = this.client.provider.get('global', 'portals', []);
|
||||||
|
const local = msg.channel.type === 'text' ? channels.filter(c => !msg.guild.channels.has(c.id)).size : null;
|
||||||
|
return msg.say(
|
||||||
|
`There are currently **${channels.length}** open portals${msg.channel.type === 'text'
|
||||||
|
? `, **${local}** of which are in this server.`
|
||||||
|
: '.'}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user