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

Document invites type field #4746

Closed
wants to merge 1 commit into from
Closed

Document invites type field #4746

wants to merge 1 commit into from

Conversation

Zoddo
Copy link
Contributor

@Zoddo Zoddo commented Apr 3, 2022

Invite objects have a type property that can be used to differentiate guild invites (type = 0) from group DM invites (type = 1).
Bots can be exposed to group DM invites when they are posted/provided by users.

Invite objects have a `type` property that can be used to differentiate guild invites (`type = 0`) from group DM invites (`type = 1`).
Bots can be exposed to group DM invites when they are posted/provided by users.
@Jupith
Copy link
Contributor

Jupith commented Apr 3, 2022

These were previously removed from a pr prior to being merged by night, #4334

@Zoddo
Copy link
Contributor Author

Zoddo commented Apr 3, 2022

Ok, I didn't find it before submitting this PR.

However, I'm wondering why this shouldn't be documented. It's a cleaner way to check the type of invite than checking if guild is null, and is less susceptible to break if another invite type is introduced in the future.

@dolfies
Copy link

dolfies commented Apr 3, 2022

FRIEND also exists as type 2 (friend invites didn't ship but you can still come across them).

@Zoddo
Copy link
Contributor Author

Zoddo commented Apr 3, 2022

As friend invites didn't ship, I expect Discord to revoke them at some point. Specifically documenting these is likely not a good idea (nor going to be accepted); you should treat them as an unknown invite type.

@night night closed this Apr 4, 2022
@Zoddo
Copy link
Contributor Author

Zoddo commented Apr 4, 2022

@night Could we get a response on this point?

I'm wondering why this shouldn't be documented. It's a cleaner way to check the type of invite than checking if guild is null, and is less susceptible to break if another invite type is introduced in the future.

If Discord has a reason for not wanting us to use it, I'd prefer to know it 😃
I'm probably not the only one tempted to use it when seeing this field.

@advaith1 advaith1 mentioned this pull request Dec 10, 2023
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.

4 participants