discord / discord-api-docs

Official Discord API Documentation
https://discord.com/developers/docs/intro
Other
5.95k stars 1.26k forks source link

Invite for private voice channel is missing `channel` field #4995

Closed shiftinv closed 2 years ago

shiftinv commented 2 years ago

Description

Fetching an invite to a private voice channel (i.e. with view channel or connect permissions denied for @everyone) without authorization returns an object that is lacking a channel field, but contains "channel_id": null. The documentation states that channel is nullable, but not optional. It appears to work fine with other channel types (text, stage, forum), or when fetching the invite using the token of a bot that can access the channel.

Steps to Reproduce

expand ```sh # create channel with connect (or view channel) perms denied for `@everyone` $ curl -H "$AUTH" -H "Content-Type: application/json" \ -d '{"name": "voice", "type": 2, "permission_overwrites": [{"id": , "type": 0, "deny": 1048576}]}' \ https://discord.com/api/v10/guilds//channels { "id": "", ..., } # create invite for channel $ curl -H "$AUTH" -H "Content-Type: application/json" -d '{}' https://discord.com/api/v10/channels//invites { "id": "", ..., } # fetch invite - note: no auth $ curl https://discord.com/api/v10/invites/ { "code": "", "type": 0, "expires_at": "2022-05-28T19:30:31+00:00", "guild": { "id": "...", "name": "", "splash": null, "banner": null, "description": null, "icon": null, "features": [], "verification_level": 1, "vanity_url_code": null, "premium_subscription_count": 0, "nsfw": false, "nsfw_level": 0 }, "channel_id": null, "inviter": { "id": "...", "username": "...", "avatar": "4856a4a8f45fabeafb8ddbdebc5ba108", "avatar_decoration": null, "discriminator": "0992", "public_flags": 0, "bot": true } } ```

Expected Behavior

The returned invite data should contain a channel object.

Current Behavior

Without sufficient permissions or with no authorization at all, the returned data doesn't contain a channel object.

Screenshots/Videos

No response

Client and System Information

curl 7.68.0, Debian 11

devsnek commented 2 years ago

This should be fixed as of last week.