Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

Hide NSFW commands for non-NSFW channels #1357

Merged
merged 3 commits into from
Oct 19, 2021
Merged

Hide NSFW commands for non-NSFW channels #1357

merged 3 commits into from
Oct 19, 2021

Conversation

Doges
Copy link
Member

@Doges Doges commented Oct 19, 2021

That still does not closes #1316 but it hides it at least

image

@Doges Doges requested a review from a team as a code owner October 19, 2021 22:59
@Doges Doges added scope: code-quality Code quality fix/issue scope: command-system Related to the command preprocessor system labels Oct 19, 2021
@Doges Doges requested a review from a team October 19, 2021 23:03
@@ -38,7 +38,7 @@ module.exports = class Help extends Command {
`**${t('commands:help.specificInformation', { helpString: `\`${prefix}${this.name} ${t('commands:help.commandUsage')}\`` })}**`
].join('\n'))

const validCommands = this.client.commands.filter(c => !c.hidden)
const validCommands = this.client.commands.filter(c => !c.hidden && (!channel.nsfw ? c.category !== 'nsfw' : true))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const validCommands = this.client.commands.filter(c => !c.hidden && (!channel.nsfw ? c.category !== 'nsfw' : true))
const validCommands = this.client.commands.filter(c => !c.hidden && (channel.nsfw || c.category !== 'nsfw'))

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@Doges Doges requested a review from a team October 19, 2021 23:07
@Doges Doges requested a review from a team October 19, 2021 23:09
@Doges Doges merged commit 0fbf905 into dev Oct 19, 2021
@Doges Doges deleted the chore/remove-help-nsfw branch October 19, 2021 23:12
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
scope: code-quality Code quality fix/issue scope: command-system Related to the command preprocessor system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants