discord-api-docs icon indicating copy to clipboard operation
discord-api-docs copied to clipboard

[Permissions V2] Slash commands not appearing for some users when not setting a permission override

Open elkowar opened this issue 3 years ago • 7 comments

Description

It seems like the default_member_permissions field is currently not working properly, causing members to not have access to commands that they should have access to.

Commands are either invisible to members when they should have access to them (according to default_member_permissions as well as the integration settings), or are visible (sometimes in cases where they shouldn't be) but fail to execute without ever hitting our bot instance. More details described below.

Steps to Reproduce

Set up a server and a bot that exposes commands. Some of these slash commands should specify the default_member_permissions field. It seems as though it's necessary to specify at least some restrictions in the integration tab for this to occur consistently (i.e. a channel restriction for one channel.) Then, get enough users for the issue to occur (it seems somewhat inconsistent for which users it occurs (see current behavior below) so you might need a bigger-ish samplesize) and have them try to execute commands. Some members will not see any commands available to them, unless you give them a role or channel that the commands have an explicit permission override for.

Expected Behavior

Commands show up for members that are allowed to use them according to default_member_permissions or the permissions tab in the integration settings, and don't show up for users that aren't allowed to use them. Furthermore, commands don't fail with "This interaction failed" without ever hitting the Bot instance in cases where the command availability is broken.

Current Behavior

Leaving out the default_member_permissions field, or setting it to a value like USE_SLASH_COMMANDS does not consistently make commands appear for users.

Specifically, the behaviour I'm observing with this is the following:

  • All the commands are showing up as expected in the integration tab
  • Setting @everyone and # all channels to allow the command makes some commands available for some users, but not for everyone. For most users, the commands do not show up in the command menu at all (even after a force reload of the client, or even a reinstall on mobile)
  • Even when two users have exactly identical roles, permissions and are both using the web-client, some of them can use all commands as expected, whilst others can't.
  • As soon as I specify a permission override, either by allowing the commands to be used by some role explicitly, or in some channel explicitly, the commands can be seen by everyone, and can be ran as expected. This means a current workaround is adding explicit channel overrides for each and every channel, or adding a role to every user and then using that.

When setting USE_SLASH_COMMANDS as the default_member_permissions field, most users can see the commands seemingly. However, the commands are still broken: When they try to run some of the commands (it appears that some commands just work:tm:, whereas others just don't -- the commands seem to be consistent, but the member-specific behavior isn't), they get a "This interaction failed" error message immediately. Looking at our bots logs, we are never receiving the InteractionCreate event for these commands -- thus, this is definitely a bug in the discord API.

Furthermore, even with the workaround specified above, some things behave strangely: Having a command be restricted from @everyone explicitly, and just making it available for a specific role (whilst having it be allowed for all channels, which I assume should be lower priority and get overruled by the role override) makes the command still show up for members that don't have that role. However, when they try to run those commands that should be unavailable, they get the same "This interaction failed" that was described above -- no event is ever received by our bot in these cases.

Screenshots/Videos

No response

Client and System Information

This has been reproduced in the web client, the android client and the iOS client -- showing inconsistent behavior across different users that are using the same client (and, to the best of my knowledge, client version) and have the same exact roles and permissions.

elkowar avatar May 19 '22 08:05 elkowar

Do you mean something like this I can't use the slash commands on any server, even the one I Own check image below image image

DrissBoumlik avatar Dec 02 '22 03:12 DrissBoumlik

The issue appears for me on the macOS client, and web client (safari, chrome). Slash commands work for me without issue on iPadOS and iOS. Other users on a discord I run are reporting similar issues as well.

Edit: I've seemed to resolve it by disabling Legacy Chat Input under Accessibility. I had turned this setting on to resolve and issue with not being able to copy/paste into the input field on the Windows client.

image

emilyCringe avatar Dec 07 '22 13:12 emilyCringe

The issue in the screenshot is not related to permissions, it's because you have "legacy chat input" enabled in accessibility settings. If you turn that off you should be able to use slash commands.

advaith1 avatar Dec 07 '22 13:12 advaith1

The issue appears for me on the macOS client, and web client (safari, chrome). Slash commands work for me without issue on iPadOS and iOS. Other users on a discord I run are reporting similar issues as well.

Edit: I've seemed to resolve it by disabling Legacy Chat Input under Accessibility. I had turned this setting on to resolve and issue with not being able to copy/paste into the input field on the Windows client.

image

this work to me, thanks

KiieL21 avatar Dec 24 '22 22:12 KiieL21

We are facing that issue. While in some discord servers with less permission tweaking every user can see the slash commands, in others I'm on the "can't use slash" team.

lcti-caveira avatar Jun 19 '23 20:06 lcti-caveira

I suspect, I am facing the same issue on a server I run - almost all of our users can use slash commands both in DMs and server channels but we have a few users (at least one confirmed) who are unable to see/use commands in DM.

  1. Legacy chat input disabled
  2. User can see and use commands in server channels
  3. User can't see commands in DMs (https://cdn.discordapp.com/attachments/1051530970152575056/1133320432045543516/Screenshot_20230725-044926.png, https://cdn.discordapp.com/attachments/1051530970152575056/1133320432322363452/Screenshot_20230725-045004.png, https://cdn.discordapp.com/attachments/1051530970152575056/1133321057881825350/rn_image_picker_lib_temp_5c4b5f81-81a3-4958-b2f6-e171016c9021.jpg)
  4. The issue is account specific, i.e. affecting both Desktop client and ios for a specific user
  5. Slash commands are enabled for all users and roles
  6. I am running latest version of discrod.py, I do not set any specific permissions in the python code and the command has been synced.

AstraliteHeart avatar Jul 25 '23 10:07 AstraliteHeart

I'm having the same problem, commands don't appear even when having all the permisions.

AbhigaelCarranza avatar Sep 21 '23 00:09 AbhigaelCarranza