Rework how privileged intents are handled #6828
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!6828
Loading…
Reference in a new issue
No description provided.
Delete branch "support-disabling-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 does a few things:
redbot --edit- intent configuration is now part of core config.--(disable|enable)-privileged-intentflag 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.
--disable-intentfor disabling privileged intents.--disable-intentwill remain as an unsupported flag that can be used to disable any non-privileged intent.Existing instances keep their presences intent enabled.
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
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:
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.
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
presencesfor core functionality (likegameroles, 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.jsonwith 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.Yes, updating intents documentation is one of the things I still need to do. It will be in a separate PR.
See #6829 (just a spec at the time of writing this comment).
Regardless of what Downloader does, cog creators can choose to raise CogLoadError when the required privileged intent is needed.
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.