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 application invites and update docs for stream invites #2690

Merged
merged 3 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions docs/resources/Channel.md
Original file line number Diff line number Diff line change
Expand Up @@ -967,14 +967,15 @@ Create a new [invite](#DOCS_RESOURCES_INVITE/invite-object) object for the chann

###### JSON Params

| Field | Type | Description | Default |
| ----------------- | ------- | --------------------------------------------------------------------------------------------------- | ---------------- |
| max_age | integer | duration of invite in seconds before expiry, or 0 for never. between 0 and 604800 (7 days) | 86400 (24 hours) |
| 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_user_id? | string | the target user id for this invite | |
| target_user_type? | integer | the [type of user target](#DOCS_RESOURCES_INVITE/invite-object-target-user-types) for this invite | |
| Field | Type | Description | Default |
|-----------------------|-----------|-------------------------------------------------------------------------------------------------------------------------------------------|------------------|
| max_age | integer | duration of invite in seconds before expiry, or 0 for never. between 0 and 604800 (7 days) | 86400 (24 hours) |
| 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 | |

## Delete Channel Permission % DELETE /channels/{channel.id#DOCS_RESOURCES_CHANNEL/channel-object}/permissions/{overwrite.id#DOCS_RESOURCES_CHANNEL/overwrite-object}

Expand Down
38 changes: 20 additions & 18 deletions docs/resources/Invite.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@ Represents a code that when used, adds a user to a guild or group DM channel.

###### Invite Structure

| Field | Type | Description |
| --------------------------- | ---------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
| code | string | the invite code (unique ID) |
| guild? | partial [guild](#DOCS_RESOURCES_GUILD/guild-object) object | the guild this invite is for |
| channel | partial [channel](#DOCS_RESOURCES_CHANNEL/channel-object) object | the channel this invite is for |
| inviter? | [user](#DOCS_RESOURCES_USER/user-object) object | the user who created the invite |
| target_user? | partial [user](#DOCS_RESOURCES_USER/user-object) object | the target user for this invite |
| target_user_type? | integer | the [type of user target](#DOCS_RESOURCES_INVITE/invite-object-target-user-types) for this invite |
| approximate_presence_count? | integer | approximate count of online members (only present when target_user is set) |
| approximate_member_count? | integer | approximate count of total members |

###### Target User Types

| Type | Value |
| ------ | ----- |
| STREAM | 1 |
| Field | Type | Description |
|-----------------------------|------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
| code | string | the invite code (unique ID) |
| guild? | partial [guild](#DOCS_RESOURCES_GUILD/guild-object) object | the guild this invite is for |
| channel | partial [channel](#DOCS_RESOURCES_CHANNEL/channel-object) object | the channel this invite is for |
| inviter? | [user](#DOCS_RESOURCES_USER/user-object) object | the user who created the invite |
| target_type? | integer | the [type of target](#DOCS_RESOURCES_INVITE/invite-object-invite-target-types) for this voice channel invite |
| target_user? | [user](#DOCS_RESOURCES_USER/user-object) object | the user whose stream to display for this voice channel stream invite |
| target_application? | partial [application](#DOCS_TOPICS_OAUTH2/application) object | the embedded application to open for this voice channel embedded application invite |
| approximate_presence_count? | integer | approximate count of online members, returned from the `GET /invites/<code>` endpoint when `with_counts` is `true` |
| approximate_member_count? | integer | approximate count of total members, returned from the `GET /invites/<code>` endpoint when `with_counts` is `true` |

###### Invite Target Types

| Type | Value |
|----------------------|-------|
| STREAM | 1 |
| EMBEDDED_APPLICATION | 2 |

###### Example Invite Object

Expand Down Expand Up @@ -51,14 +53,14 @@ Represents a code that when used, adds a user to a guild or group DM channel.
"discriminator": "7653",
"public_flags": 131328
},
"target_type": 1,
"target_user": {
"id": "165176875973476352",
"username": "bob",
"avatar": "deadbeef",
"discriminator": "1234",
"public_flags": 64
},
"target_user_type": 1
}
}
```

Expand Down
27 changes: 14 additions & 13 deletions docs/topics/Gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -881,19 +881,20 @@ Sent when a new invite to a channel is created.

###### Invite Create Event Fields

| Field | Type | Description |
|-------------------|---------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
| channel_id | snowflake | the channel the invite is for |
| code | string | the unique invite [code](#DOCS_RESOURCES_INVITE/invite-object) |
| created_at | timestamp | the time at which the invite was created |
| guild_id? | snowflake | the guild of the invite |
| inviter? | [user](#DOCS_RESOURCES_USER/user-object) object | the user that created the invite |
| max_age | integer | how long the invite is valid for (in seconds) |
| max_uses | integer | the maximum number of times the invite can be used |
| target_user? | partial [user](#DOCS_RESOURCES_USER/user-object) object | the target user for this invite |
| target_user_type? | integer | the [type of user target](#DOCS_RESOURCES_INVITE/invite-object-target-user-types) for this invite |
| temporary | boolean | whether or not the invite is temporary (invited users will be kicked on disconnect unless they're assigned a role) |
| uses | integer | how many times the invite has been used (always will be 0) |
| Field | Type | Description |
|---------------------|----------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|
| channel_id | snowflake | the channel the invite is for |
| code | string | the unique invite [code](#DOCS_RESOURCES_INVITE/invite-object) |
| created_at | timestamp | the time at which the invite was created |
| guild_id? | snowflake | the guild of the invite |
| inviter? | [user](#DOCS_RESOURCES_USER/user-object) object | the user that created the invite |
| max_age | integer | how long the invite is valid for (in seconds) |
| max_uses | integer | the maximum number of times the invite can be used |
| target_type? | integer | the [type of target](#DOCS_RESOURCES_INVITE/invite-object-invite-target-types) for this voice channel invite |
| target_user? | [user](#DOCS_RESOURCES_USER/user-object) object | the user whose stream to display for this voice channel stream invite |
| target_application? | partial [application](#DOCS_TOPICS_OAUTH2/application-object) object | the embedded application to open for this voice channel embedded application invite |
| temporary | boolean | whether or not the invite is temporary (invited users will be kicked on disconnect unless they're assigned a role) |
| uses | integer | how many times the invite has been used (always will be 0) |

### Invite Delete

Expand Down