[V3] Enforcing use of our Command objects #1972

Closed
opened 2018-08-02 14:04:07 +02:00 by Tobotimus · 1 comment
Tobotimus commented 2018-08-02 14:04:07 +02:00 (Migrated from github.com)

As we continue to modify the Command objects in redbot.core.commands to tailor the library more towards Red, we create more features which are dependent on the modified behaviour. This has become more apparent with fuzzy help search (which relies on a new method Command.parents - normal discord.ext.commands.Command objects won't appear in fuzzy help) and also possible future changes to the Permissions cog, in order to fix some logic errors and enhance performance overall.

All we ask of cog creators is to replace the line from discord.ext import commands or equivalent with from redbot.core import commands. In exchange, we have more freedom in the features we can add to command objects in order to enhance core features.

Edit:

If you are adamant on maintaining compatibility with other non-red frameworks, it is possible to do a conditional import:

try:
    from redbot.core import commands
except ImportError:
    from discord.ext import commands

Any queries, qualms or suggestions, please comment below.

As we continue to modify the Command objects in `redbot.core.commands` to tailor the library more towards Red, we create more features which are dependent on the modified behaviour. This has become more apparent with fuzzy help search (which relies on a new method `Command.parents` - normal `discord.ext.commands.Command` objects won't appear in fuzzy help) and also possible future changes to the `Permissions` cog, in order to fix some logic errors and enhance performance overall. All we ask of cog creators is to replace the line `from discord.ext import commands` or equivalent with `from redbot.core import commands`. In exchange, we have more freedom in the features we can add to command objects in order to enhance core features. Edit: If you are adamant on maintaining compatibility with other non-red frameworks, it is possible to do a conditional import: ```py try: from redbot.core import commands except ImportError: from discord.ext import commands ``` Any queries, qualms or suggestions, please comment below.
Tobotimus commented 2018-08-13 03:11:10 +02:00 (Migrated from github.com)

Resolved by #1971.

Resolved by #1971.
Sign in to join this conversation.
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot#1972
No description provided.