Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add hidehelp toggle #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

ritsu
Copy link

@ritsu ritsu commented Jan 4, 2018

This adds an option to hide help for commands that a user does not have permissions for. This affects [p]help and [p]help command when typed in a channel, but has no effect on [p]help or [p]help command typed in DMs. The toggle commands are [p]p hidehelp on and [p]p hidehelp off.

I have a working version as a separate cog here:
(the command names are different, but the functionality is the same)
https://github.com/ritsu/RitsuCogs/tree/master/helpless

The way it works is it sets bot.formatter to a derived class that inherits from commands.HelpFormatter and overrides the HelpFormatter.format() and HelpFormatter.filter_command_list() methods. The toggle command just switches bot.formatter between commands.HelpFormatter and the derived class.

It was suggested that I PR this here. I'm happy with either merging it or keeping it as a separate cog, though I think merging makes more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant