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.
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 achannel
field, but contains"channel_id": null
. The documentation states thatchannel
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":", ..., } # 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