Squid-Plugins icon indicating copy to clipboard operation
Squid-Plugins copied to clipboard

Add hidehelp toggle

Open ritsu opened this issue 7 years ago • 0 comments

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.

ritsu avatar Jan 04 '18 01:01 ritsu