Remora.Discord
Remora.Discord copied to clipboard
Add invite metadata to guild invites response
Adds the keys in the invite metadata object (https://discord.com/developers/docs/resources/invite#invite-metadata-object) to the type returned by GET /guilds/{guildID}/invites.
Thanks for the PR. Velvet mentioned it already that you are missing the JSON property name configuration for the temporary field and the registration of the type itself in Remora.Discord.API.
Add the type here.
For the property configuration have a look here.
Jax must decide if the name InviteWithMetadata is fine or we should stick to the original name InviteMetadata as it is called in the Discord docs.
For the test files you would need to create a subfolder in Remora.Discord.Tests: here
and for the actual test you need to add an additional test class in Remora.Discord.API.Tests: here
I've registered the type now, thanks for the pointers!
I only named the type InviteWithMetadata because it's not actually a separate object, but an extension of the Invite type, and I couldn't quickly find a similar situation in the existing library--either name is fine.
There's already a test for this endpoint here, but it just tests with an empty array response. I couldn't find any test for an endpoint that returns an array that doesn't use an empty array response, so I'm not 100% sure how to add a test for that, sorry.
The endpoint does not need more testing. It is a test about the actual JSON object.
The endpoint does not need more testing. It is a test about the actual JSON object.
Ah, got it! I didn't realize those tests were separate. I added those now, and they all pass (and aren't skipped), so I think I did it right?
LGTM! Thanks again. Now let's wait on review of @Nihlus and his final word about the InviteMetadata vs InviteWithMetadata.