Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for slash commands option errors #162

Merged
merged 2 commits into from
Jan 10, 2021

Conversation

HopeBaron
Copy link
Member

No description provided.

)
@SerialName("_errors")
val errors: List<DiscordErrorDetail> = emptyList(),
val optionErrors: List<Map<String, DiscordFieldError>> = emptyList()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there's a field consistently named options.
What I think is going on is that Discord provides the name of the failed property as a key, but I'm not certain, did you check this on multiple invalid structures?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is consistently named options for slash commands with options else it will contain a _errors field yeah.
I don't assume it to be named options I go through the elements looking for what we know exists which is _errors

@HopeBaron HopeBaron merged commit aa3cc58 into 0.7.x Jan 10, 2021
@HopeBaron HopeBaron deleted the fixes/0.7.x/discord-error-response branch March 11, 2021 07:29
@HopeBaron HopeBaron mentioned this pull request Apr 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants