mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 14:00:22 +02:00
Hide auto reply commands in help if in bot list server
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
const { MessageEmbed } = require('discord.js');
|
const { MessageEmbed } = require('discord.js');
|
||||||
const { stripIndents } = require('common-tags');
|
const { stripIndents } = require('common-tags');
|
||||||
|
const AutoReplyCommand = require('../../structures/commands/AutoReply');
|
||||||
|
|
||||||
module.exports = class HelpCommand extends Command {
|
module.exports = class HelpCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -30,7 +31,14 @@ module.exports = class HelpCommand extends Command {
|
|||||||
let cmdCount = 0;
|
let cmdCount = 0;
|
||||||
for (const group of this.client.registry.groups.values()) {
|
for (const group of this.client.registry.groups.values()) {
|
||||||
const owner = this.client.isOwner(msg.author);
|
const owner = this.client.isOwner(msg.author);
|
||||||
const commands = group.commands.filter(cmd => (owner ? true : !cmd.ownerOnly) && !cmd.hidden);
|
const commands = group.commands.filter(cmd => {
|
||||||
|
if (owner) return true;
|
||||||
|
if (cmd.ownerOnly || cmd.hidden) return false;
|
||||||
|
if (this.client.botListGuilds.includes(msg.guild.id) && cmd instanceof AutoReplyCommand) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
});
|
||||||
if (!commands.size) continue;
|
if (!commands.size) continue;
|
||||||
cmdCount += commands.size;
|
cmdCount += commands.size;
|
||||||
embed.addField(
|
embed.addField(
|
||||||
|
|||||||
Reference in New Issue
Block a user