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

Incorrect 400 message from /guilds/{guild.id}/incident-actions

Open Noxillio opened this issue 10 months ago • 0 comments

Description

When specifying a timestamp for dms_disabled_until further in the future than 24 hours (+ 1 minute for whatever reason), the API delivers a 400 response but reads DMs disabled until time cannot exceed 12 hours into the future.

The accurate count is (as mentioned before) 24 hours 1 minute in the future, but could probably get away with changing the message to reflect 24 hours. Not sure why that minute's there, it's probably something I'm just not familiar with yet as I'm new to undocumented stuff, but it's there.

This problem does not affect invites_disabled_until, the message for that one reflects 24 hours and that is accurate. Though the extra minute exists there too, again that's just probably something widely known that I'm not familiar with yet.

Steps to Reproduce

  1. Execute curl -XPUT -H "Content-type: application/json" -d '{"dms_disabled_until":"2025-01-01T00:00:00.000Z"}' 'https://discord.com/api/guilds/{guild.id}/incident-actions' and ensure to include an authorization header for a user which has sufficient permissions for the guild. You can use any timestamp further than 24 hours into the future but I'm fairly certain 2025 should cover that.
  2. Change the timestamp to something further than 12 hours (but less than 24 hours) into the future, then run the command again.

Expected Behavior

  1. The request should fail and give a correct message indicating 24 hours rather than 12 (i.e. DMs disabled until time cannot exceed 24 hours into the future).
  2. No problems.

Current Behavior

  1. The request fails and gives the message described indicating the incorrect time frame of 12 hours rather than 24 (DMs disabled until time cannot exceed 12 hours into the future).
  2. The request will succeed despite the timestamp being more than 12 hours in the future and contradicting the message given.

Screenshots/Videos

No response

Client and System Information

Postman for Windows Version 10.24.16 Architecture x64 Platform win32 10.0.22631

Noxillio avatar Apr 14 '24 06:04 Noxillio