From 17f5caa671da50a79d61393f5a970ce59c5d875e Mon Sep 17 00:00:00 2001 From: Vitor Lopes Date: Fri, 13 May 2022 14:27:00 +0100 Subject: [PATCH] refactor: separate `GUILD_CREATE` fields from `APIGuild` object (#423) BREAKING CHANGE: APIGuild now correctly shows just the properties that are obtainable through rest/GUILD_UPDATE, while the extra fields have been moved to GatewayGuildCreateDispatchData to correctly represent the data received --- deno/gateway/v10.ts | 80 +++++++++++++++++++++++++++++++++++++- deno/gateway/v9.ts | 80 +++++++++++++++++++++++++++++++++++++- deno/payloads/v10/guild.ts | 80 +------------------------------------- deno/payloads/v9/guild.ts | 80 +------------------------------------- gateway/v10.ts | 80 +++++++++++++++++++++++++++++++++++++- gateway/v9.ts | 80 +++++++++++++++++++++++++++++++++++++- payloads/v10/guild.ts | 80 +------------------------------------- payloads/v9/guild.ts | 80 +------------------------------------- 8 files changed, 316 insertions(+), 324 deletions(-) diff --git a/deno/gateway/v10.ts b/deno/gateway/v10.ts index 88d63fc3..8a03d92f 100644 --- a/deno/gateway/v10.ts +++ b/deno/gateway/v10.ts @@ -3,6 +3,7 @@ */ import type { Snowflake } from '../globals.ts'; +import type { GatewayPresenceUpdate } from '../payloads/v10/gateway.ts'; import type { APIApplication, APIChannel, @@ -509,7 +510,6 @@ export type GatewayGuildModifyDispatch = DataPayload< >; /** - * https://discord.com/developers/docs/topics/gateway#guild-create * https://discord.com/developers/docs/topics/gateway#guild-update */ export type GatewayGuildModifyDispatchData = APIGuild; @@ -521,8 +521,84 @@ export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch; /** * https://discord.com/developers/docs/topics/gateway#guild-create + * https://discord.com/developers/docs/topics/gateway#guild-create-guild-create-extra-fields */ -export type GatewayGuildCreateDispatchData = GatewayGuildModifyDispatchData; +export type GatewayGuildCreateDispatchData = APIGuild & { + /** + * When this guild was joined at + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + */ + joined_at: string; + /** + * `true` if this is considered a large guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + */ + large: boolean; + /** + * Total number of members in this guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + */ + member_count: number; + /** + * States of members currently in voice channels; lacks the `guild_id` key + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/voice#voice-state-object + */ + voice_states: Omit[]; + /** + * Users in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/guild#guild-member-object + */ + members: APIGuildMember[]; + /** + * Channels in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/channel#channel-object + */ + channels: APIChannel[]; + /** + * Threads in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/channel#channel-object + */ + threads: APIChannel[]; + /** + * Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold` + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/topics/gateway#presence-update + */ + presences: GatewayPresenceUpdate[]; + /** + * The stage instances in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure + */ + stage_instances: APIStageInstance[]; + /** + * The scheduled events in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object + */ + guild_scheduled_events: APIGuildScheduledEvent[]; +}; /** * https://discord.com/developers/docs/topics/gateway#guild-update diff --git a/deno/gateway/v9.ts b/deno/gateway/v9.ts index 95eb02dd..2066212d 100644 --- a/deno/gateway/v9.ts +++ b/deno/gateway/v9.ts @@ -3,6 +3,7 @@ */ import type { Snowflake } from '../globals.ts'; +import type { GatewayPresenceUpdate } from '../payloads/v9/gateway.ts'; import type { APIApplication, APIChannel, @@ -508,7 +509,6 @@ export type GatewayGuildModifyDispatch = DataPayload< >; /** - * https://discord.com/developers/docs/topics/gateway#guild-create * https://discord.com/developers/docs/topics/gateway#guild-update */ export type GatewayGuildModifyDispatchData = APIGuild; @@ -520,8 +520,84 @@ export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch; /** * https://discord.com/developers/docs/topics/gateway#guild-create + * https://discord.com/developers/docs/topics/gateway#guild-create-guild-create-extra-fields */ -export type GatewayGuildCreateDispatchData = GatewayGuildModifyDispatchData; +export type GatewayGuildCreateDispatchData = APIGuild & { + /** + * When this guild was joined at + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + */ + joined_at: string; + /** + * `true` if this is considered a large guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + */ + large: boolean; + /** + * Total number of members in this guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + */ + member_count: number; + /** + * States of members currently in voice channels; lacks the `guild_id` key + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/voice#voice-state-object + */ + voice_states: Omit[]; + /** + * Users in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/guild#guild-member-object + */ + members: APIGuildMember[]; + /** + * Channels in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/channel#channel-object + */ + channels: APIChannel[]; + /** + * Threads in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/channel#channel-object + */ + threads: APIChannel[]; + /** + * Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold` + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/topics/gateway#presence-update + */ + presences: GatewayPresenceUpdate[]; + /** + * The stage instances in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure + */ + stage_instances: APIStageInstance[]; + /** + * The scheduled events in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object + */ + guild_scheduled_events: APIGuildScheduledEvent[]; +}; /** * https://discord.com/developers/docs/topics/gateway#guild-update diff --git a/deno/payloads/v10/guild.ts b/deno/payloads/v10/guild.ts index 77aae69f..4a5c66e4 100644 --- a/deno/payloads/v10/guild.ts +++ b/deno/payloads/v10/guild.ts @@ -2,15 +2,11 @@ * Types extracted from https://discord.com/developers/docs/resources/guild */ -import type { APIChannel } from './channel.ts'; import type { APIEmoji } from './emoji.ts'; -import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway.ts'; -import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts'; +import type { PresenceUpdateStatus } from './gateway.ts'; import type { APIRole } from './permissions.ts'; -import type { APIStageInstance } from './stageInstance.ts'; import type { APISticker } from './sticker.ts'; import type { APIUser } from './user.ts'; -import type { GatewayVoiceState } from './voice.ts'; import type { Permissions, Snowflake } from '../../globals.ts'; /** @@ -196,64 +192,6 @@ export interface APIGuild extends APIPartialGuild { * The id of the channel where Community guilds can display rules and/or guidelines */ rules_channel_id: Snowflake | null; - /** - * When this guild was joined at - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - */ - joined_at?: string; - /** - * `true` if this is considered a large guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - */ - large?: boolean; - /** - * Total number of members in this guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - */ - member_count?: number; - /** - * States of members currently in voice channels; lacks the `guild_id` key - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/voice#voice-state-object - */ - voice_states?: Omit[]; - /** - * Users in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/guild#guild-member-object - */ - members?: APIGuildMember[]; - /** - * Channels in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/channel#channel-object - */ - channels?: APIChannel[]; - /** - * Threads in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/channel#channel-object - */ - threads?: APIChannel[]; - /** - * Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold` - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/topics/gateway#presence-update - */ - presences?: GatewayPresenceUpdate[]; /** * The maximum number of presences for the guild (`null` is always returned, apart from the largest of guilds) */ @@ -320,14 +258,6 @@ export interface APIGuild extends APIPartialGuild { * See https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level */ nsfw_level: GuildNSFWLevel; - /** - * The stage instances in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure - */ - stage_instances?: APIStageInstance[]; /** * Custom guild stickers * @@ -338,14 +268,6 @@ export interface APIGuild extends APIPartialGuild { * Whether the guild has the boost progress bar enabled. */ premium_progress_bar_enabled: boolean; - /** - * The scheduled events in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object - */ - guild_scheduled_events?: APIGuildScheduledEvent[]; /** * The type of Student Hub the guild is */ diff --git a/deno/payloads/v9/guild.ts b/deno/payloads/v9/guild.ts index 77aae69f..4a5c66e4 100644 --- a/deno/payloads/v9/guild.ts +++ b/deno/payloads/v9/guild.ts @@ -2,15 +2,11 @@ * Types extracted from https://discord.com/developers/docs/resources/guild */ -import type { APIChannel } from './channel.ts'; import type { APIEmoji } from './emoji.ts'; -import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway.ts'; -import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts'; +import type { PresenceUpdateStatus } from './gateway.ts'; import type { APIRole } from './permissions.ts'; -import type { APIStageInstance } from './stageInstance.ts'; import type { APISticker } from './sticker.ts'; import type { APIUser } from './user.ts'; -import type { GatewayVoiceState } from './voice.ts'; import type { Permissions, Snowflake } from '../../globals.ts'; /** @@ -196,64 +192,6 @@ export interface APIGuild extends APIPartialGuild { * The id of the channel where Community guilds can display rules and/or guidelines */ rules_channel_id: Snowflake | null; - /** - * When this guild was joined at - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - */ - joined_at?: string; - /** - * `true` if this is considered a large guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - */ - large?: boolean; - /** - * Total number of members in this guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - */ - member_count?: number; - /** - * States of members currently in voice channels; lacks the `guild_id` key - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/voice#voice-state-object - */ - voice_states?: Omit[]; - /** - * Users in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/guild#guild-member-object - */ - members?: APIGuildMember[]; - /** - * Channels in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/channel#channel-object - */ - channels?: APIChannel[]; - /** - * Threads in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/channel#channel-object - */ - threads?: APIChannel[]; - /** - * Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold` - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/topics/gateway#presence-update - */ - presences?: GatewayPresenceUpdate[]; /** * The maximum number of presences for the guild (`null` is always returned, apart from the largest of guilds) */ @@ -320,14 +258,6 @@ export interface APIGuild extends APIPartialGuild { * See https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level */ nsfw_level: GuildNSFWLevel; - /** - * The stage instances in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure - */ - stage_instances?: APIStageInstance[]; /** * Custom guild stickers * @@ -338,14 +268,6 @@ export interface APIGuild extends APIPartialGuild { * Whether the guild has the boost progress bar enabled. */ premium_progress_bar_enabled: boolean; - /** - * The scheduled events in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object - */ - guild_scheduled_events?: APIGuildScheduledEvent[]; /** * The type of Student Hub the guild is */ diff --git a/gateway/v10.ts b/gateway/v10.ts index 1868f02b..25b5d9d6 100644 --- a/gateway/v10.ts +++ b/gateway/v10.ts @@ -3,6 +3,7 @@ */ import type { Snowflake } from '../globals'; +import type { GatewayPresenceUpdate } from '../payloads/v10/gateway'; import type { APIApplication, APIChannel, @@ -509,7 +510,6 @@ export type GatewayGuildModifyDispatch = DataPayload< >; /** - * https://discord.com/developers/docs/topics/gateway#guild-create * https://discord.com/developers/docs/topics/gateway#guild-update */ export type GatewayGuildModifyDispatchData = APIGuild; @@ -521,8 +521,84 @@ export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch; /** * https://discord.com/developers/docs/topics/gateway#guild-create + * https://discord.com/developers/docs/topics/gateway#guild-create-guild-create-extra-fields */ -export type GatewayGuildCreateDispatchData = GatewayGuildModifyDispatchData; +export type GatewayGuildCreateDispatchData = APIGuild & { + /** + * When this guild was joined at + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + */ + joined_at: string; + /** + * `true` if this is considered a large guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + */ + large: boolean; + /** + * Total number of members in this guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + */ + member_count: number; + /** + * States of members currently in voice channels; lacks the `guild_id` key + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/voice#voice-state-object + */ + voice_states: Omit[]; + /** + * Users in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/guild#guild-member-object + */ + members: APIGuildMember[]; + /** + * Channels in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/channel#channel-object + */ + channels: APIChannel[]; + /** + * Threads in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/channel#channel-object + */ + threads: APIChannel[]; + /** + * Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold` + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/topics/gateway#presence-update + */ + presences: GatewayPresenceUpdate[]; + /** + * The stage instances in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure + */ + stage_instances: APIStageInstance[]; + /** + * The scheduled events in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object + */ + guild_scheduled_events: APIGuildScheduledEvent[]; +}; /** * https://discord.com/developers/docs/topics/gateway#guild-update diff --git a/gateway/v9.ts b/gateway/v9.ts index e72ec682..a3135faf 100644 --- a/gateway/v9.ts +++ b/gateway/v9.ts @@ -3,6 +3,7 @@ */ import type { Snowflake } from '../globals'; +import type { GatewayPresenceUpdate } from '../payloads/v9/gateway'; import type { APIApplication, APIChannel, @@ -508,7 +509,6 @@ export type GatewayGuildModifyDispatch = DataPayload< >; /** - * https://discord.com/developers/docs/topics/gateway#guild-create * https://discord.com/developers/docs/topics/gateway#guild-update */ export type GatewayGuildModifyDispatchData = APIGuild; @@ -520,8 +520,84 @@ export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch; /** * https://discord.com/developers/docs/topics/gateway#guild-create + * https://discord.com/developers/docs/topics/gateway#guild-create-guild-create-extra-fields */ -export type GatewayGuildCreateDispatchData = GatewayGuildModifyDispatchData; +export type GatewayGuildCreateDispatchData = APIGuild & { + /** + * When this guild was joined at + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + */ + joined_at: string; + /** + * `true` if this is considered a large guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + */ + large: boolean; + /** + * Total number of members in this guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + */ + member_count: number; + /** + * States of members currently in voice channels; lacks the `guild_id` key + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/voice#voice-state-object + */ + voice_states: Omit[]; + /** + * Users in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/guild#guild-member-object + */ + members: APIGuildMember[]; + /** + * Channels in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/channel#channel-object + */ + channels: APIChannel[]; + /** + * Threads in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/channel#channel-object + */ + threads: APIChannel[]; + /** + * Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold` + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/topics/gateway#presence-update + */ + presences: GatewayPresenceUpdate[]; + /** + * The stage instances in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure + */ + stage_instances: APIStageInstance[]; + /** + * The scheduled events in the guild + * + * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** + * + * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object + */ + guild_scheduled_events: APIGuildScheduledEvent[]; +}; /** * https://discord.com/developers/docs/topics/gateway#guild-update diff --git a/payloads/v10/guild.ts b/payloads/v10/guild.ts index e59dd8ff..85342c9b 100644 --- a/payloads/v10/guild.ts +++ b/payloads/v10/guild.ts @@ -2,15 +2,11 @@ * Types extracted from https://discord.com/developers/docs/resources/guild */ -import type { APIChannel } from './channel'; import type { APIEmoji } from './emoji'; -import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway'; -import type { APIGuildScheduledEvent } from './guildScheduledEvent'; +import type { PresenceUpdateStatus } from './gateway'; import type { APIRole } from './permissions'; -import type { APIStageInstance } from './stageInstance'; import type { APISticker } from './sticker'; import type { APIUser } from './user'; -import type { GatewayVoiceState } from './voice'; import type { Permissions, Snowflake } from '../../globals'; /** @@ -196,64 +192,6 @@ export interface APIGuild extends APIPartialGuild { * The id of the channel where Community guilds can display rules and/or guidelines */ rules_channel_id: Snowflake | null; - /** - * When this guild was joined at - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - */ - joined_at?: string; - /** - * `true` if this is considered a large guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - */ - large?: boolean; - /** - * Total number of members in this guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - */ - member_count?: number; - /** - * States of members currently in voice channels; lacks the `guild_id` key - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/voice#voice-state-object - */ - voice_states?: Omit[]; - /** - * Users in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/guild#guild-member-object - */ - members?: APIGuildMember[]; - /** - * Channels in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/channel#channel-object - */ - channels?: APIChannel[]; - /** - * Threads in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/channel#channel-object - */ - threads?: APIChannel[]; - /** - * Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold` - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/topics/gateway#presence-update - */ - presences?: GatewayPresenceUpdate[]; /** * The maximum number of presences for the guild (`null` is always returned, apart from the largest of guilds) */ @@ -320,14 +258,6 @@ export interface APIGuild extends APIPartialGuild { * See https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level */ nsfw_level: GuildNSFWLevel; - /** - * The stage instances in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure - */ - stage_instances?: APIStageInstance[]; /** * Custom guild stickers * @@ -338,14 +268,6 @@ export interface APIGuild extends APIPartialGuild { * Whether the guild has the boost progress bar enabled. */ premium_progress_bar_enabled: boolean; - /** - * The scheduled events in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object - */ - guild_scheduled_events?: APIGuildScheduledEvent[]; /** * The type of Student Hub the guild is */ diff --git a/payloads/v9/guild.ts b/payloads/v9/guild.ts index e59dd8ff..85342c9b 100644 --- a/payloads/v9/guild.ts +++ b/payloads/v9/guild.ts @@ -2,15 +2,11 @@ * Types extracted from https://discord.com/developers/docs/resources/guild */ -import type { APIChannel } from './channel'; import type { APIEmoji } from './emoji'; -import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway'; -import type { APIGuildScheduledEvent } from './guildScheduledEvent'; +import type { PresenceUpdateStatus } from './gateway'; import type { APIRole } from './permissions'; -import type { APIStageInstance } from './stageInstance'; import type { APISticker } from './sticker'; import type { APIUser } from './user'; -import type { GatewayVoiceState } from './voice'; import type { Permissions, Snowflake } from '../../globals'; /** @@ -196,64 +192,6 @@ export interface APIGuild extends APIPartialGuild { * The id of the channel where Community guilds can display rules and/or guidelines */ rules_channel_id: Snowflake | null; - /** - * When this guild was joined at - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - */ - joined_at?: string; - /** - * `true` if this is considered a large guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - */ - large?: boolean; - /** - * Total number of members in this guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - */ - member_count?: number; - /** - * States of members currently in voice channels; lacks the `guild_id` key - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/voice#voice-state-object - */ - voice_states?: Omit[]; - /** - * Users in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/guild#guild-member-object - */ - members?: APIGuildMember[]; - /** - * Channels in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/channel#channel-object - */ - channels?: APIChannel[]; - /** - * Threads in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/channel#channel-object - */ - threads?: APIChannel[]; - /** - * Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold` - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/topics/gateway#presence-update - */ - presences?: GatewayPresenceUpdate[]; /** * The maximum number of presences for the guild (`null` is always returned, apart from the largest of guilds) */ @@ -320,14 +258,6 @@ export interface APIGuild extends APIPartialGuild { * See https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level */ nsfw_level: GuildNSFWLevel; - /** - * The stage instances in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure - */ - stage_instances?: APIStageInstance[]; /** * Custom guild stickers * @@ -338,14 +268,6 @@ export interface APIGuild extends APIPartialGuild { * Whether the guild has the boost progress bar enabled. */ premium_progress_bar_enabled: boolean; - /** - * The scheduled events in the guild - * - * **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event** - * - * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object - */ - guild_scheduled_events?: APIGuildScheduledEvent[]; /** * The type of Student Hub the guild is */