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

Update Invite Docs #6233

Closed
wants to merge 5 commits into from
Closed

Conversation

shaydewael
Copy link
Contributor

@shaydewael shaydewael commented Jun 15, 2023

⚠️ The updates included in this are a part of an experiment, and therefore are not guaranteed to ship to 100% of users. Once there is certainty, a date will be added and it'll be updated from a draft to a PR.

Documenting recent behavior change with the update to invites based on their server type. Still finalizing the date in which the deprecation will occur, but it won't be for at least 30 days from the day we announce the date (here and in DDevs api-announcements channel).

This also introduces a new guild partial in interaction replies to make finding the guild's features easier in cases like this.

@sebm253 sebm253 mentioned this pull request Jun 16, 2023
2 tasks
DonovanDMC added a commit to OceanicJS/Oceanic that referenced this pull request Jun 21, 2023
DonovanDMC added a commit to OceanicJS/Oceanic that referenced this pull request Jun 22, 2023
| max_uses | integer | max number of uses or 0 for unlimited. between 0 and 100 | 0 |
| temporary | boolean | whether this invite only grants temporary membership | false |
| unique | boolean | if true, don't try to reuse a similar invite (useful for creating many unique one time use invites) | false |
| target_type | integer | the [type of target](#DOCS_RESOURCES_INVITE/invite-object-invite-target-types) for this voice channel invite | |
| target_user_id | snowflake | the id of the user whose stream to display for this invite, required if `target_type` is 1, the user must be streaming in the channel | |
| target_application_id | snowflake | the id of the embedded application to open for this invite, required if `target_type` is 2, the application must have the `EMBEDDED` flag | |

\* If the channel is within a non-community server, the value of `max_age` cannot be 0—it must be between 1 and 2592000.
Copy link
Contributor

Choose a reason for hiding this comment

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

"0—it" couldn't / shouldn't that be "0, it"

A bit confused with the wording, might be my german tho :p

Copy link
Contributor

Choose a reason for hiding this comment

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

It is valid here but could be spaced out from the other words for clarity

Suggested change
\* If the channel is within a non-community server, the value of `max_age` cannot be 0it must be between 1 and 2592000.
\* If the channel is within a non-community server, the value of `max_age` cannot be 0it must be between 1 and 2592000.

Copy link
Contributor

Choose a reason for hiding this comment

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

This confusion, if any, can be averted by simply removing the superfluous wording.

Suggested change
\* If the channel is within a non-community server, the value of `max_age` cannot be 0—it must be between 1 and 2592000.
\* If the channel is within a non-community server, the value of `max_age` must be between 1 and 2592000.


You can fetch the `features` array for a specific guild using:
1. The [`GET /guilds/<guild_id>`](#DOCS_RESOURCES_GUILD/get-guild) endpoint, or
2. If you're responding to an interaction, you can reference the new guild partial (`guild`) added to [interaction requests](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/interaction-object). The interaction guild partial contains the `id`, `locale`, and `features` array for that guild.
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be worth noting that the guild field might deprecate the fields it contains similarly to #6051? And possibly even mark these as such in the interaction object below?

Create a new [invite](#DOCS_RESOURCES_INVITE/invite-object) object for the channel. Only usable for guild channels. Requires the `CREATE_INSTANT_INVITE` permission. All JSON parameters for this route are optional, however the request body is not. If you are not sending any fields, you still have to send an empty JSON object (`{}`). Returns an [invite](#DOCS_RESOURCES_INVITE/invite-object) object. Fires an [Invite Create](#DOCS_TOPICS_GATEWAY_EVENTS/invite-create) Gateway event.
Create a new [invite](#DOCS_RESOURCES_INVITE/invite-object) object for the channel. Only usable for guild channels. Requires the `CREATE_INSTANT_INVITE` permission. Returns an [invite](#DOCS_RESOURCES_INVITE/invite-object) object. Fires an [Invite Create](#DOCS_TOPICS_GATEWAY_EVENTS/invite-create) Gateway event. All JSON parameters for this route are optional, however the request body is not. If you are not sending any fields, you still have to send an empty JSON object (`{}`).

Invites in non-community servers (which don't contain `"COMMUNITY"` in their [`features` array](#DOCS_RESOURCES_GUILD/guild-object)) are limited to 30 days, so `max_age` cannot be set to 0 when creating an invite within them.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure whether stating the limitation for this endpoint twice (thrice if you count the one in the changelog) is really necessary. Maybe an info / warn box would be a better solution here...

Comment on lines +21 to 23
| guild? | [partial guild](#DOCS_RESOURCES_GUILD/guild-object) object | Guild that the interaction was sent from |
| guild_id? | snowflake | ID for the guild that the interaction was sent from |
| channel? | [partial channel](#DOCS_RESOURCES_CHANNEL/channel-object) object | Channel that the interaction was sent from |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| guild? | [partial guild](#DOCS_RESOURCES_GUILD/guild-object) object | Guild that the interaction was sent from |
| guild_id? | snowflake | ID for the guild that the interaction was sent from |
| channel? | [partial channel](#DOCS_RESOURCES_CHANNEL/channel-object) object | Channel that the interaction was sent from |
| guild? | partial [guild](#DOCS_RESOURCES_GUILD/guild-object) object | Guild that the interaction was sent from |
| guild_id? | snowflake | ID for the guild that the interaction was sent from |
| channel? | partial [channel](#DOCS_RESOURCES_CHANNEL/channel-object) object | Channel that the interaction was sent from |

Checking with other parts of the docs, "partial" usually isn't masked

@MinnDevelopment
Copy link
Contributor

Why is this PR still a draft? Are these changes not happening anymore?

@shaydewael
Copy link
Contributor Author

nah we didn't do this. rest in pieces, non-permanent invites for friend servers 🫡

@shaydewael shaydewael closed this May 15, 2024
@shaydewael shaydewael deleted the add-new-invite-update branch May 15, 2024 17:06
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.

None yet

6 participants