Warn users when inviting bot with administrator permissions or restrict bots from requiring it upon invite #4864
Replies: 11 comments 23 replies
-
there are actions bots can carry out that require the admin permission |
Beta Was this translation helpful? Give feedback.
-
Do you want to make this a privileged intent for users as well, who can be compromised just like bots? This isn't going to work... |
Beta Was this translation helpful? Give feedback.
-
Ultimately the problem here is that neither bot developers or server admins are following the principle of least privilege. The reason for this is generally ease of use, which is usually the case made for not following that principle. There are server admins that actually think about permissions (typically bot developers themselves in my experience) based on what they are using the bot for and what the bot needs to do that. They may even change the URL to put their own desired bitfield in / remove it entirely as to have a single role for all bots. It sounds like a good solution here is simply better education on the principle of least privilege for both bot developers and server administrators. On top of that, there should be a more prevalent warning when granting the permission during the OAuth flow, as most people simply click through. |
Beta Was this translation helpful? Give feedback.
-
I think the main issue here is that bots couldn't really provide feedback on why a command failed if permissions were set up incorrectly since they might not be able to even see the command being run to begin with (since they didn't have access to the channel) or simply didn't have permissions to talk in the channel. Once slash commands get enforced for verified bots through the message intent, this should (for the most part) be an issue of the past, since a bot will always be able to respond to commands and tell the user why exactly a command didn't work properly. I totally agree that bots shouldn't request too many permissions but in the past bots were pretty much forced to request the Also, on a side note, it wouldn't be considered a "privileged intent" since intents are a concept for receiving specific gateway events, hence it would rather be considered a "privileged toggle" or something along those lines. |
Beta Was this translation helpful? Give feedback.
-
Rythm had the right to require administrator permission to easily access private channels. |
Beta Was this translation helpful? Give feedback.
-
The issue is discord requires bots to have permission beforehand before being able to add that said permission to other roles. However, a random breaking change was pushed into oauth2 pages 2 months ago that made certain permissions completely inaccessible to bots. |
Beta Was this translation helpful? Give feedback.
-
I agree that bots shouldn't be able to request admin in the invite; if a bot really needs admin for some reason (which is an edge case) then users can modify its roles/permissions in server settings. At a bot list, we have blocked invite links with admin for a long time. |
Beta Was this translation helpful? Give feedback.
-
Users can always uncheck the "Administrator" box at the top of permissions. |
Beta Was this translation helpful? Give feedback.
-
I believe most people have summed it well to why this would be an inefficient solution. The problem at hand is that a server mod/admin/owner are going to invite the bot without the principle of least privilege, and lazily go about it. The Discord Moderator Academy goes over in detail how moderation teams should treat the permission. At the end of the day, it's who invites the bot's decision whether or not they want the bot to carry that privilege. The privilege can always be unchecked, whether a user will actually proceed with it or not. Making a warning on the invite seems like a stopgap solution. The invite is based on the premise of trust. Chances are, most bots invited to guilds are verified already or are on an interim period of receiving it. If someone were to not already trust that verification, then the value to warning users about a permission this risky is already meaningless. |
Beta Was this translation helpful? Give feedback.
-
When seeing questions/screenshots that are often posted in dapi/ddevs, I believe a lot of inexperienced devs just check the A first step would be to remove it from the OAuth URL generator. Someone who wants to request the administrator permission would have to manually set it in the On another note, I also like the idea of requring admins to explicitly set that permission after inviting the bot if absolutely necessarily. |
Beta Was this translation helpful? Give feedback.
-
I think this is a step in the wrong direction. It's already an issue that despite Read Messages being a permission that can already be granted or denied from bots, a separate intent is also needed in order to read messages. If a server manager wants to grant permissions or capabilities to a bot, they should be able to do so. If a bot needs certain permissions to function, and a server manager does not grant those permissions, then the bot failing to function correctly is the fault of the server manager. I think the underlying issue here is not the permissions system itself, but rather the average server owners' ability to understand what they are actually doing when they add a bot to their server. This issue is twofold:
Both of these issues could be resolved with more education about permissions, as well as making granting per-channel permissions easier. For example, if bots had the ability to request permissions and permission overrides in the client, there would be fewer questions and confusions about why a bot isn't working; the bot would simply ask for the permissions it needs in that instance, the server manager would confirm the override, and then the permissions would be fixed. (Note that this system is even more reliable with the introduction of slash commands, as a response to a slash command with such a request would always be possible). I don't want more permissions to go the way of intents. If a server manager wants to grant a bot a permission, they should be able to. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Background information
Currently every bot can be invited with the
ADMINISTRATOR
within thepermissions
field when using an invite link or we can give the bot that permission manually in the server settings. People nowadays tend to just setpermissions=8
because their bot needs to be able to, for example, ban someone due a command they have. However there is no need for such a bot to have theADMINISTRATOR
permission. One perfect example was Rythm, a music bot, that had its invite link withpermissions=8
so that people inviting it would not turn into "some permissions issues" when using the bot.Current issues
The issues are quite clear:
My Proposals
Ideally the second proposal would be more handy and catch people's attention.
Developer Portal Proposal
Make developers actually prove, just like privileged intents procedure, that they actually need this permission when inviting the bot - according to some trusted users there are some very rare cases where the permission might be needed. Server members would later be able to grant the permission to the bot, with the warning already within the description of the permission.

Invite Warning Proposal
Give a clear warning when inviting the bot with this permission that it is a dangerous permission to grant, just like in the description of the permission. There are lots and lots of people who just invite the bot without checking/removing the permissions it actually needs. There are way too many bots being invited with this and only this permission.

Some people invite bots without knowing what permissions it should even have due to their lack of knowledge and experience, as they might be new to the platform.
Hovering would give more insight on why it's red.
Beta Was this translation helpful? Give feedback.
All reactions