discord-api-docs
discord-api-docs copied to clipboard
API returns wrong error when AutoMod trigger_metadata is not sent
Description
When the trigger_metadata field is not sent, but the trigger type requires it, the API returns an error saying a field named metadata
is required, but it actually requires a trigger_metadata
field. If a metadata
field is sent, it is ignored and the error is still returned.
Steps to Reproduce
POST https://discord.com/api/v10/guilds/:id/auto-moderation/rules
{
"name": "test",
"event_type": 1,
"trigger_type": 1,
"actions": [
{
"type": 1
}
]
}
Expected Behavior
An error about trigger_metadata being missing
Current Behavior
{
"code": 50035,
"errors": {
"metadata": {
"_errors": [
{
"code": "BASE_TYPE_REQUIRED",
"message": "This field is required"
}
]
}
},
"message": "Invalid Form Body"
}
Screenshots/Videos
No response
Client and System Information
Postman on Windows 11
looks like this has been fixed
looks like this has been fixed
Wow you noticed it less than an hour after it got deployed. Thanks for reporting this, and sorry it took us this long to address this.