Rework how privileged intents are handled #6828

Merged
Jackenmen merged 8 commits from support-disabling-privileged-intents into V3/develop 2026-11-15 21:43:58 +01:00
Jackenmen commented 2026-11-13 17:29:12 +01:00 (Migrated from github.com)

Description of the changes

This does a few things:

  • Allows enabling/disabling privileged intents through redbot --edit - intent configuration is now part of core config.
  • Adds a new supported --(disable|enable)-privileged-intent flag for controlling privileged intents.
    Both enable and disable are available because intent configuration is now part of core config and this flag simply changes the value of the intent flag for current run.
  • Deprecates use of --disable-intent for disabling privileged intents.
    --disable-intent will remain as an unsupported flag that can be used to disable any non-privileged intent.
  • Makes new instances have presences intent disabled by default.
    Existing instances keep their presences intent enabled.
  • Updates debuginfo to list privileged intents separately from disabled non-privileged intents
  • Adds privileged intents to general info table that's printed when bot is ready

I was considering whether to also allow enabling/disabling intents through [p]set intents (or similar) but figured it probably doesn't make much sense to have it, considering you'd need to restart the bot for it to work.

Have the changes in this PR been tested?

Yes

### Description of the changes This does a few things: - Allows enabling/disabling privileged intents through `redbot --edit` - intent configuration is now part of core config. - Adds a new *supported* `--(disable|enable)-privileged-intent` flag for controlling privileged intents. Both enable and disable are available because intent configuration is now part of core config and this flag simply changes the value of the intent flag for current run. - Deprecates use of `--disable-intent` for disabling privileged intents. `--disable-intent` will remain as an unsupported flag that can be used to disable *any* non-privileged intent. - Makes new instances have presences intent disabled by default. Existing instances keep their presences intent enabled. - Updates debuginfo to list privileged intents separately from disabled non-privileged intents - Adds privileged intents to general info table that's printed when bot is ready I was considering whether to also allow enabling/disabling intents through `[p]set intents` (or similar) but figured it probably doesn't make much sense to have it, considering you'd need to restart the bot for it to work. ### Have the changes in this PR been tested? Yes
EternalllZM commented 2026-11-13 22:29:17 +01:00 (Migrated from github.com)

Great PR and I think it's a step in the right direction if intents are going to be gatekept by increasingly frustrating and seemingly arbitrary restrictions. My two cents for what it's worth that I can see becoming a headache:

Makes new instances have presences intent disabled by default.

As of latest, which will be "stable" during 3.5.25, the docs mention enabling all three intents (current stable does too). It needs to be considered whether all three are continued to be recommended for enabling.

I was considering whether to also allow enabling/disabling intents through [p]set intents (or similar) but figured it probably doesn't make much sense to have it, considering you'd need to restart the bot for it to work.

If core has no use for the presences intent, Downloader should at least tell users about it. Whether that is the first time the Downloader cog loads, when a repo is added, or similar relevant actions. The notice should say that some cogs may require this intent, explain how to enable it (flags aren't documented too well right now [somewhat by design]), and maybe show what intents are currently enabled or disabled.

While not Red's main focus, cog creators would appreciate this too for troubleshooting purposes. It would be annoying for the several verified cogs that require presences for core functionality (like gameroles, for example) to constantly walk users through enabling the intent.

The general info table does print this as mentioned in the PR, but only to the console and the user looking for it on startup. Also, anyone running the bot as a systemd service never sees it unless they dig through the service logs. Lastly, the info cannot be accessed anywhere in the bot either.

The alternative is having every cog creator populate info.json with what intents are required by the cog and produce a warning/notice when the current enabled intents don't match what is required, which is a much larger effort to accomplish than the above. Though could also be considered.

Great PR and I think it's a step in the right direction if intents are going to be gatekept by increasingly frustrating and seemingly arbitrary restrictions. My two cents for what it's worth that I can see becoming a headache: > Makes new instances have presences intent disabled by default. As of [latest](https://docs.discord.red/en/latest/bot_application_guide.html#enabling-privileged-intents), which will be "stable" during 3.5.25, the docs mention enabling all three intents (current [stable](https://docs.discord.red/en/stable/bot_application_guide.html#enabling-privileged-intents) does too). It needs to be considered whether all three are continued to be recommended for enabling. > I was considering whether to also allow enabling/disabling intents through [p]set intents (or similar) but figured it probably doesn't make much sense to have it, considering you'd need to restart the bot for it to work. If core has no use for the presences intent, Downloader should at least tell users about it. Whether that is the first time the Downloader cog loads, when a repo is added, or similar relevant actions. The notice should say that some cogs may require this intent, explain how to enable it (flags aren't documented too well right now [somewhat by design]), and maybe show what intents are currently enabled or disabled. While not Red's main focus, cog creators would appreciate this too for troubleshooting purposes. It would be annoying for the several verified cogs that require `presences` for core functionality (like `gameroles`, for example) to constantly walk users through enabling the intent. The general info table does print this as mentioned in the PR, but only to the console and the user looking for it on startup. Also, anyone running the bot as a systemd service never sees it unless they dig through the service logs. Lastly, the info cannot be accessed anywhere in the bot either. The alternative is having every cog creator populate `info.json` with what intents are required by the cog and produce a warning/notice when the current enabled intents don't match what is required, which is a much larger effort to accomplish than the above. Though could also be considered.
Jackenmen commented 2026-11-13 22:42:11 +01:00 (Migrated from github.com)

As of latest, which will be "stable" during 3.5.25, the docs mention enabling all three intents (current stable does too). It needs to be considered whether all three are continued to be recommended for enabling.

Yes, updating intents documentation is one of the things I still need to do. It will be in a separate PR.

If core has no use for the presences intent, Downloader should at least tell users about it. Whether that is the first time the Downloader cog loads, when a repo is added, or similar relevant actions. The notice should say that some cogs may require this intent, explain how to enable it (flags aren't documented too well right now [somewhat by design]), and maybe show what intents are currently enabled or disabled.

The alternative is having every cog creator populate info.json with what intents are required by the cog and produce a warning/notice when the current enabled intents don't match what is required, which is a much larger effort to accomplish than the above. Though could also be considered.

See #6829 (just a spec at the time of writing this comment).

While not Red's main focus, cog creators would appreciate this too for troubleshooting purposes. It would be annoying for the several verified cogs that require presences for core functionality (like gameroles, for example) to constantly walk users through enabling the intent.

Regardless of what Downloader does, cog creators can choose to raise CogLoadError when the required privileged intent is needed.

The general info table does print this as mentioned in the PR, but only to the console and the user looking for it on startup. Also, anyone running the bot as a systemd service never sees it unless they dig through the service logs. Lastly, the info cannot be accessed anywhere in the bot either.

It's also included in output of [p]debuginfo. I'm not sure we'd want to put anywhere else (e.g. [p]set showsettings) considering you cannot configure it with a command in Discord.

> As of [latest](https://docs.discord.red/en/latest/bot_application_guide.html#enabling-privileged-intents), which will be "stable" during 3.5.25, the docs mention enabling all three intents (current [stable](https://docs.discord.red/en/stable/bot_application_guide.html#enabling-privileged-intents) does too). It needs to be considered whether all three are continued to be recommended for enabling. Yes, updating intents documentation is one of the things I still need to do. It will be in a separate PR. > If core has no use for the presences intent, Downloader should at least tell users about it. Whether that is the first time the Downloader cog loads, when a repo is added, or similar relevant actions. The notice should say that some cogs may require this intent, explain how to enable it (flags aren't documented too well right now [somewhat by design]), and maybe show what intents are currently enabled or disabled. > The alternative is having every cog creator populate info.json with what intents are required by the cog and produce a warning/notice when the current enabled intents don't match what is required, which is a much larger effort to accomplish than the above. Though could also be considered. See #6829 (just a spec at the time of writing this comment). > While not Red's main focus, cog creators would appreciate this too for troubleshooting purposes. It would be annoying for the several verified cogs that require presences for core functionality (like gameroles, for example) to constantly walk users through enabling the intent. Regardless of what Downloader does, cog creators can choose to raise CogLoadError when the required privileged intent is needed. > The general info table does print this as mentioned in the PR, but only to the console and the user looking for it on startup. Also, anyone running the bot as a systemd service never sees it unless they dig through the service logs. Lastly, the info cannot be accessed anywhere in the bot either. It's also included in output of `[p]debuginfo`. I'm not sure we'd want to put anywhere else (e.g. `[p]set showsettings`) considering you cannot configure it with a command in Discord.
Flame442 (Migrated from github.com) approved these changes 2026-11-15 21:43:41 +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!6828
No description provided.