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

age restricted commands do not respect Guild.nsfw

Open puppy0cam opened this issue 2 months ago • 3 comments

Description

Here is how things currently work:

  • ApplicationCommand.nsfw = true, Guild.nsfw = true, Channel.nsfw = true - Command Allowed - Expected
  • ApplicationCommand.nsfw = true, Guild.nsfw = true, Channel.nsfw = false - Command Restricted - Unexpected !!!
  • ApplicationCommand.nsfw = true, Guild.nsfw = false, Channel.nsfw = true - Command Allowed - Expected
  • ApplicationCommand.nsfw = true, Guild.nsfw = false, Channel.nsfw = false - Command Restricted - Expected
  • ApplicationCommand.nsfw = false, Guild.nsfw = true, Channel.nsfw = true - Command Allowed - Expected
  • ApplicationCommand.nsfw = false, Guild.nsfw = true, Channel.nsfw = false - Command Allowed - Expected
  • ApplicationCommand.nsfw = false, Guild.nsfw = false, Channel.nsfw = true - Command Allowed - Expected
  • ApplicationCommand.nsfw = false, Guild.nsfw = false, Channel.nsfw = false - Command Allowed - Expected

I believe the unexpected case to be unintended because the owner configured server level age restriction setting also disables the ability to toggle the age restriction setting for channels and will always show in channel settings as if the channel is age restricted even if Channel.nsfw is actually set to false.

Steps to Reproduce

Create a command with nsfw set to true Create a channel with nsfw set to false Change the Age Restricted Server setting in the access tab of server settings to true Attempt to run the nsfw command in the channel you created

Expected Behavior

The command resolves and can be used

Current Behavior

The command does not appear in the UI, and cannot be executed

Screenshots/Videos

No response

Client and System Information

stable 459631 (e97e9b1) Host 1.0.9212 x64 (70471) Build Override: N/A Windows 10 64-bit (10.0.19045)

puppy0cam avatar Oct 21 '25 06:10 puppy0cam

Everything works correctly If the guild is nswf, then all channels are also nsfw, regardless of whether they are configured that way channel.nsfw is the saved channel setting, as they were before guild.nsfw was installed

vakiliner avatar Oct 21 '25 11:10 vakiliner

A video demonstrating the issue since @vakiliner seems to have misunderstood what the problem is.

https://github.com/user-attachments/assets/0bf86a7b-1f3d-4eff-95c5-de3a167bc6fa

puppy0cam avatar Oct 21 '25 11:10 puppy0cam

Oops, looks like I wasn't fully awake or didn't figure out the issue due to bad formatting on my phone Now I know it's definitely a bug

vakiliner avatar Oct 21 '25 11:10 vakiliner