discordrb
discordrb copied to clipboard
API v9 and backwards compatibility
As it stands, the 'upgrade' to API v9 scheduled for release 3.5.0 will break backwards compatibility, because intents are now enforced. This means that attempting to initialise a bot with default Developer Portal settings will now cause:
[ERROR : websocket @ 2022-07-06 11:55:23.781] The websocket connection has closed: (no information)
[ERROR : websocket @ 2022-07-06 11:55:23.782] Websocket close frame received!
[ERROR : websocket @ 2022-07-06 11:55:23.782] Code: 4014
[ERROR : websocket @ 2022-07-06 11:55:23.782] Message: Disallowed intent(s).
[ERROR : websocket @ 2022-07-06 11:55:23.782] You attempted to identify with privileged intents that your bot is not authorized to use
Please enable the privileged intents on the bot page of your application on the discord developer page.
This is not a terrible experience by any means, since it hints at how to fix the problem, but incompatibility like this is still not ideal for a point release. I wonder if we can improve this experience before releasing.
I have some possible solutions (I'm sure there are more, and likely better ones):
- Change the default value of
intentsto the new:unprivilegedvalue I added in #55. This is a poor option because while apps wouldn't crash upon upgrading, they would silently break instead. - Try the old default value
:all, but fall back to:unprivilegedif this is denied, and warn. - Accept that we need to crash, but improve the traceback by informing the user about the
intentsargument and their choices.