mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-30 07:20:10 +00:00
refactor(GatewayGuildCreateDispatchData): Narrow channels and threads types (#1146)
* refactor: narrow guild create types * refactor: use `GuildChannelType` and `ThreadChannelType`
This commit is contained in:
@@ -37,6 +37,8 @@ import type {
|
||||
ChannelType,
|
||||
APISubscription,
|
||||
APISoundboardSound,
|
||||
GuildChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../payloads/v10/mod.ts';
|
||||
import type { ReactionType } from '../rest/v10/mod.ts';
|
||||
import type { Nullable } from '../utils/internals.ts';
|
||||
@@ -879,7 +881,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels: APIChannel[];
|
||||
channels: (APIChannel & { type: Exclude<GuildChannelType, ThreadChannelType> })[];
|
||||
/**
|
||||
* Threads in the guild
|
||||
*
|
||||
@@ -887,7 +889,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
threads: APIChannel[];
|
||||
threads: (APIChannel & { type: ThreadChannelType })[];
|
||||
/**
|
||||
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
|
||||
*
|
||||
|
||||
@@ -36,6 +36,8 @@ import type {
|
||||
ChannelType,
|
||||
APISubscription,
|
||||
APISoundboardSound,
|
||||
GuildChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../payloads/v9/mod.ts';
|
||||
import type { ReactionType } from '../rest/v9/mod.ts';
|
||||
import type { Nullable } from '../utils/internals.ts';
|
||||
@@ -878,7 +880,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels: APIChannel[];
|
||||
channels: (APIChannel & { type: Exclude<GuildChannelType, ThreadChannelType> })[];
|
||||
/**
|
||||
* Threads in the guild
|
||||
*
|
||||
@@ -886,7 +888,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
threads: APIChannel[];
|
||||
threads: (APIChannel & { type: ThreadChannelType })[];
|
||||
/**
|
||||
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
|
||||
*
|
||||
|
||||
@@ -37,6 +37,8 @@ import type {
|
||||
ChannelType,
|
||||
APISubscription,
|
||||
APISoundboardSound,
|
||||
GuildChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../payloads/v10/index';
|
||||
import type { ReactionType } from '../rest/v10/index';
|
||||
import type { Nullable } from '../utils/internals';
|
||||
@@ -879,7 +881,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels: APIChannel[];
|
||||
channels: (APIChannel & { type: Exclude<GuildChannelType, ThreadChannelType> })[];
|
||||
/**
|
||||
* Threads in the guild
|
||||
*
|
||||
@@ -887,7 +889,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
threads: APIChannel[];
|
||||
threads: (APIChannel & { type: ThreadChannelType })[];
|
||||
/**
|
||||
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
|
||||
*
|
||||
|
||||
@@ -36,6 +36,8 @@ import type {
|
||||
ChannelType,
|
||||
APISubscription,
|
||||
APISoundboardSound,
|
||||
GuildChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../payloads/v9/index';
|
||||
import type { ReactionType } from '../rest/v9/index';
|
||||
import type { Nullable } from '../utils/internals';
|
||||
@@ -878,7 +880,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels: APIChannel[];
|
||||
channels: (APIChannel & { type: Exclude<GuildChannelType, ThreadChannelType> })[];
|
||||
/**
|
||||
* Threads in the guild
|
||||
*
|
||||
@@ -886,7 +888,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
threads: APIChannel[];
|
||||
threads: (APIChannel & { type: ThreadChannelType })[];
|
||||
/**
|
||||
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user