Allow specifying privileged intents in info.json #6829
No reviewers
Labels
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 project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!6829
Loading…
Reference in a new issue
No description provided.
Delete branch "Jackenmen/downloader-privileged-intents"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description of the changes
This PR adds new
optional_privileged_intentsandrequired_privileged_intentskeys to coginfo.jsonthat specify the privileged intents that the cog needs. The required ones block the cog from being installed, while optional ones serve mostly as metadata that may be presented to the user to let them know that some functionality may be unavailable.optional_privileged_intentscan only be specified, ifrequired_privileged_intentsis specified too and Downloader will ignore it, if it appears on its own.The internal Downloader API checks
required_privileged_intentsin order to prevent install/update of a cog with missing required intents. Everything else (default "required" privileged intents and optional privileged intents) is handled entirely through Downloader cog's UI as it's informational-only.[p]cog infolists optional and required privileged intents along with the statement about the reason it's needed.Link to rendered info.json documentation:
https://red-discordbot--6829.org.readthedocs.build/en/6829/guide_publish_cogs.html#keys-specific-to-the-cog-info-json-case-sensitive
There are some things that may still need to be considered:
Have the changes in this PR been tested?
No
Something I'm wondering is whether these two keys are really enough metadata. One common case is text-based commands - you could argue that any cog that has those can take advantage of the Message Content Intent so does that mean the cog should list that intent as optional? I don't think it would be at all helpful, if almost all cogs listed "message_content" in their
optional_privileged_intentsstating they can use it for their text-based commands.I imagine we can avoid this from happening with proper documentation (the one that's currently in this PR is not enough) but, should we still have some way for cogs to indicate in their
info.jsonthat they have or don't have text-based and/or slash commands? Would that be useful?Considering that commands can be issued via --mentionable (or setting prefix to bot mention) without message intent, I would say to lean towards "message_content" in info.json being used for features that are unrelated to command issuance.
Using prefix commands as justification for an intent request just leads to automatic denial, so Red should follow that guideline as well in terms of design.
Only if it means the entire cog can be controlled through that method. Does "has slash commands" imply you can ignore prefix commands entirely and the cog works entirely? Things to consider.