JDA icon indicating copy to clipboard operation
JDA copied to clipboard

Update Invite to match Discord changes

Open My-Name-Is-Jeff opened this issue 1 year ago • 10 comments

Pull Request Etiquette

Changes

  • [x] Internal code
  • [x] Library interface (affecting end-user code)
  • [x] Documentation
  • [ ] Other: _____

Closes Issue: NaN

Description

Discord made all the previous expanded Invite properties (max_uses, temporary, creation, etc...) except for uses accessible without authentication, so remove the expanded property and deprecate usages

Additionally, update docs to remove the outdated notice that certain fields require expansion

Adds a new method getTimeExpires to return the expires_at field of an invite, which is null if the invite never expires

Add the FRIEND InviteType and a way to parse it

Change EntityBuilder to use the type id to determine invite type

My-Name-Is-Jeff avatar Jul 15 '23 00:07 My-Name-Is-Jeff

Could you please link the appropriate Discord API docs PR/commit that documents this change?

freya022 avatar Jul 15 '23 07:07 freya022

Could you please link the appropriate Discord API docs PR/commit that documents this change?

There doesn't seem to be any docs changes, noticed the changes after exceptions were thrown when trying to resolve guild invites

Probably should have opened a GH Issue but thought it was redundant

My-Name-Is-Jeff avatar Jul 15 '23 08:07 My-Name-Is-Jeff

Looks like there is still a compilation issue here with the constructor usage. Have you tested whether the usage of with_expiration=true makes a difference? It doesn't seem like we use it at all, currently.

MinnDevelopment avatar Jul 28 '23 14:07 MinnDevelopment

Looks like there is still a compilation issue here with the constructor usage. Have you tested whether the usage of with_expiration=true makes a difference? It doesn't seem like we use it at all, currently.

from what I recall the with_expiration query makes no difference on the response body whether or not it its true or false

My-Name-Is-Jeff avatar Jul 28 '23 20:07 My-Name-Is-Jeff

Should compile now, missed an internal usage

My-Name-Is-Jeff avatar Jul 28 '23 20:07 My-Name-Is-Jeff

Gonna hold off on merging this, still waiting for some info regarding the API stability here.

MinnDevelopment avatar Jul 28 '23 23:07 MinnDevelopment

I've been told that the changes to expanding invites will need to be reverted. The API will not continue to return the expanded object on the resolve endpoint in the future.

MinnDevelopment avatar Aug 01 '23 07:08 MinnDevelopment

I've been told that the changes to expanding invites will need to be reverted. The API will not continue to return the expanded object on the resolve endpoint in the future.

Seems like Discord. I'll check after they revert the changes and see if there's anything left.

My-Name-Is-Jeff avatar Aug 01 '23 07:08 My-Name-Is-Jeff

Change to max_age field noted here: https://github.com/discord/discord-api-docs/pull/6233

My-Name-Is-Jeff avatar Aug 01 '23 07:08 My-Name-Is-Jeff

I've gone ahead and converted this PR into a draft, until it has been adjusted. If you don't want to continue working on it, feel free to close it and open an issue instead.

MinnDevelopment avatar Aug 14 '23 10:08 MinnDevelopment