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 proper ChannelOverwriteEntryInfo deserialization for field "type" #1993

Conversation

syncblaze
Copy link
Contributor

@syncblaze syncblaze commented Aug 4, 2024

Summary

field "type" of ChannelOverwriteEntryInfo does not get deserialized properly. I've added a conversion from a str to an int to deserialize into the PermissionOverwriteType Enum.

This is because of discord beeing inconsistent. Normaly the PermissionOverwriteType is represented as an int. Docs but when sent as Optional Audit Entry Info, it is an string. Docs

Checklist

  • I have run nox and all the pipelines have passed.
  • I have made unittests according to the code I have added/modified/deleted.

Related issues

Fix #1992

@syncblaze
Copy link
Contributor Author

i looked through git blame and this was originally fixed by adding the Union[...,str] which was added here but i dont really see a reason to follow the inconsistent behaviour of discord, converting the str to an int and with that into a PermissionOverwriteType object an would make it easier for everybody

@davfsa davfsa merged commit 5592b52 into hikari-py:master Aug 4, 2024
27 checks passed
@syncblaze syncblaze deleted the fix_channel_overwrite_entry_info_deserialization branch August 4, 2024 13:12
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.

field "type" of ChannelOverwriteEntryInfo does not get deserialized properly
2 participants