discord-api-docs
discord-api-docs copied to clipboard
Cached Slash Commands aren't updated properly when changing roles via "View Server As Role"
Description
When you are using the View Server As Role feature and you change your roles, the slash commands shown as available will not update until you change channels. It seems like it's just an issue with the local cache not clearing.
This happens on the initial load, and any time you use the dropdown to change roles.
Steps to Reproduce
- Create a Slash Command (
/report
) - Create a Role ("Reporter").
- In the Permissions V2 UI, change the /report command to only be usable by people with the Reporter role.
- Give yourself the "Reporter" role.
- Change channels, then try to use the /report command. It will be available. [Correct ✅]
- Go to Server Settings > Roles > Default Permissions > select @everyone > "..." menu > View Server As Role.
- Try to use the /report command. It will be available [Incorrect ⛔]
- Change to a different channel.
- Try to use the /report command, it will be unavailable [Correct ✅]
- Use the "Select Roles" dropdown at the top and enable the Reporter role.
- Try to use the /report command again. It will still be unavailable [Incorrect ⛔].
- Change the channel you are looking at and try to use the /report command. It will be available [Correct ✅]
Expected Behavior
When you change roles using View Server As Role, the Application/Slash Commands that are correct for the changed role settings should be immediately available. The locally cached slash commands should be refreshed automatically.
Current Behavior
The Slash Commands to not properly update. You must change channels in order to see the correct Slash Commands.
Screenshots/Videos
In this image "/devtest" is in place of "/report" in the repro steps.
-
The command is available:
-
You set the permissions to only those with a specific role (here "Feedback Viewer", in repro steps "Reporter".
-
You view the server as "everyone".
-
You can still see the command in the command list.
-
Change channels, command is no longer available.
Client and System Information
Tested on Windows Desktop Client
Stable 130832 (367507e) Host 1.0.9004 Windows 10 64-Bit (10.0.19043)
and
Ptb 130866 (7d0dbc4) Host 1.0.1014 Windows 10 64-Bit (10.0.19043)