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

Improve unreleased Command.is_enabled() and document related methods #6209

Conversation

Jackenmen
Copy link
Member

Description of the changes

Changes the unreleased Command.is_enabled() method (see #5552 where that was introduced) to have a more reasonable public API. I also added documentation to this method and some additional preservations to Command.disable/enable_in() methods. The public aspect of this API was not touched on during the previous review which means that we would be intentionally exposing an API we did not intend to. This means that this PR should be considered a release blocker.

This resolves #4130 and closes #5001. Note that these methods are named opposite than in both of mentioned issues - is_enabled() instead of is_disabled(). I'm not necessarily sure that I prefer it but it is consistent with the existing enabled attribute so it probably makes more sense this way.

Have the changes in this PR been tested?

Yes

@Jackenmen Jackenmen added Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing. Type: Enhancement Something meant to enhance existing Red features. Release Blocker This needs handling prior to the next non-hotfix release. labels Jul 23, 2023
@Jackenmen Jackenmen added this to the 3.5.3 milestone Jul 23, 2023
@github-actions github-actions bot added the Category: Core - API - Commands Package This is related to the `redbot.core.commands` package or `redbot.core.checks` module. label Jul 23, 2023
@Jackenmen Jackenmen added the Changelog Entry: Added Changelog entry for this PR has already been added to changelog PR. label Jul 23, 2023
redbot/core/commands/commands.py Outdated Show resolved Hide resolved
redbot/core/commands/commands.py Outdated Show resolved Hide resolved
@Flame442 Flame442 self-assigned this Jul 24, 2023
Co-authored-by: Michael Oliveira <[email protected]>
@Flame442 Flame442 merged commit 6f920da into Cog-Creators:V3/develop Jul 24, 2023
16 checks passed
@Jackenmen Jackenmen deleted the improve_unreleased_public_method_and_add_docstrings branch July 24, 2023 06:17
Dav-Git pushed a commit to Dav-Git/Red-DiscordBot that referenced this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Core - API - Commands Package This is related to the `redbot.core.commands` package or `redbot.core.checks` module. Changelog Entry: Added Changelog entry for this PR has already been added to changelog PR. Release Blocker This needs handling prior to the next non-hotfix release. Type: Bug Unexpected behavior, result, or exception. In case of PRs, it is a fix for the foregoing. Type: Enhancement Something meant to enhance existing Red features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[API] add ability to check for disabled command
2 participants