Allow specifying privileged intents in info.json #6829

Manually merged
Jackenmen merged 0 commits from Jackenmen/downloader-privileged-intents into V3/develop 2026-11-21 16:10:25 +01:00
Jackenmen commented 2026-11-13 22:36:16 +01:00 (Migrated from github.com)

Description of the changes

This PR adds new optional_privileged_intents and required_privileged_intents keys to cog info.json that 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_intents can only be specified, if required_privileged_intents is specified too and Downloader will ignore it, if it appears on its own.
The internal Downloader API checks required_privileged_intents in 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 info lists 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:

  • Should we let the user know when the required privileged intents changed when the bot has them enabled?
  • Should we let the user know when the optional privileged intents changed (and if so, should we do that when the bot has them enabled too?)?
  • Should we have some command for listing installed cogs grouped by the intent they use (required/optional) along with the reason to help the user grasp what uses intents in their bot?

Have the changes in this PR been tested?

No

### Description of the changes This PR adds new `optional_privileged_intents` and `required_privileged_intents` keys to cog `info.json` that 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_intents` can only be specified, if `required_privileged_intents` is specified too and Downloader will ignore it, if it appears on its own. The internal Downloader API checks `required_privileged_intents` in 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 info` lists 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: - Should we let the user know when the required privileged intents changed when the bot has them enabled? - Should we let the user know when the optional privileged intents changed (and if so, should we do that when the bot has them enabled too?)? - Should we have some command for listing installed cogs grouped by the intent they use (required/optional) along with the reason to help the user grasp what uses intents in their bot? ### Have the changes in this PR been tested? No
Jackenmen commented 2026-11-19 21:14:14 +01:00 (Migrated from github.com)

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_intents stating 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.json that they have or don't have text-based and/or slash commands? Would that be useful?

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_intents` stating 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.json` that they *have* or don't have text-based and/or slash commands? Would that be useful?
EternalllZM commented 2026-11-19 23:01:22 +01:00 (Migrated from github.com)

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.

should we still have some way for cogs to indicate in their info.json that they have or don't have text-based and/or slash commands?

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.

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. > should we still have some way for cogs to indicate in their info.json that they have or don't have text-based and/or slash commands? 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.
Mrcoolgamer11 manually merged commit e374f621aa into V3/develop 2026-11-21 16:10:25 +01:00
Sign in to join this conversation.
No reviewers
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!6829
No description provided.