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

Have DefaultHelpCommand use get_bot_mapping #9329

Open
3 tasks done
DanielBaulig opened this issue Apr 3, 2023 · 1 comment
Open
3 tasks done

Have DefaultHelpCommand use get_bot_mapping #9329

DanielBaulig opened this issue Apr 3, 2023 · 1 comment
Labels
unconfirmed bug A bug report that needs triaging

Comments

@DanielBaulig
Copy link

Summary

DefaultHelpCommand does not use and ignores the mapping provided to send_bot_help.

Reproduction Steps

It's impossible to customize the DefaultHelpCommand implementation by altering it's get_bot_mapping implementation.

from discord.ext import commands

class CustomizedDefaultHelpCommand(commands.DefaultHelpCommand):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
    def get_bot_mapping(self):
        mapping = super().get_bot_mapping()
        # make some arbitrary changes to mapping
        return mapping

It seems DefaultHelpCommand just ignores the mapping argument passed to it and "scours" the bot manually itself. There doesn't seem to be a good reason for that, but maybe I am missing something?

Would it be possible to rewrite DefaultHelpCommand's send_bot_help implementation to use the provided mapping instead of gathering one itself? That way it would be easily possible to adjust which commands to display and how without having to reimplement send_bot_help itself.

Minimal Reproducible Code

See above.

Expected Results

Overriding and changing get_bot_mapping should result in the actual output of send_bot_help to change.

Actual Results

Output of send_bot_help remains unphased.

Intents

message_content = True, but seems irrelevant

System Information

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

I've been trying to change the structure of the !help output to better suit my cog layout/structure. Also see the following SO question for more background: https://stackoverflow.com/questions/75908271/how-to-make-a-cog-a-prefix-command-group

@DanielBaulig DanielBaulig added the unconfirmed bug A bug report that needs triaging label Apr 3, 2023
@DanielBaulig
Copy link
Author

I'd be happy to provide a pull request to make the necessary changes if I can expect it to be accepted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unconfirmed bug A bug report that needs triaging
Projects
None yet
Development

No branches or pull requests

1 participant