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

fix(GatewayGuildDeleteDispatchData): make unavailable optional #862

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Saghetti0
Copy link
Contributor

The unavailable field in GatewayGuildDeleteDispatchData can be undefined, but in the API types, it's marked as always present. Even though the documentation specifies that it's an unavailable guild, and the example object has the field present, it says that the field can be not set:

If the unavailable field is not set, the user was removed from the guild.

I also confirmed this with some of my own testing. I added and then kicked a bot from a guild, and got a guild delete event without the unavailable field. One thing I'm not sure about though is if the optional should be on APIUnavailableGuild instead of the dispatch, as the docs are vague on the details.

Copy link

vercel bot commented Dec 28, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
discord-api-types ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 28, 2023 7:21am

@@ -847,7 +847,8 @@ export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.Guild
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-delete
*/
export type GatewayGuildDeleteDispatchData = APIUnavailableGuild;
export type GatewayGuildDeleteDispatchData = Omit<APIUnavailableGuild, 'unavailable'> &
Copy link
Member

Choose a reason for hiding this comment

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

Lets make this its own interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants