feat: APIWebhookSourceChannel (#1235)

This commit is contained in:
Jiralite
2025-05-11 10:46:37 +01:00
committed by GitHub
parent c64362a711
commit ca206593ef
8 changed files with 32 additions and 8 deletions

View File

@@ -3,6 +3,7 @@
*/
import type { Permissions, Snowflake } from '../../globals.ts';
import type { _NonNullableFields } from '../../utils/internals.ts';
import type { APIApplication } from './application.ts';
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
@@ -48,6 +49,11 @@ export interface APIInviteChannel extends Required<APIPartialChannel> {
recipients?: Pick<APIUser, 'username'>[] | undefined;
}
/**
* Source channel of channel follower webhooks.
*/
export type APIWebhookSourceChannel = Required<_NonNullableFields<Pick<APIPartialChannel, 'id' | 'name'>>>;
/**
* This interface is used to allow easy extension for other channel types. While
* also allowing `APIPartialChannel` to be used without breaking.

View File

@@ -6,11 +6,11 @@ import type { Snowflake } from '../../globals.ts';
import type {
APIEntitlement,
APIGuild,
APIPartialChannel,
APIPartialGuild,
APIUser,
ApplicationIntegrationType,
OAuth2Scopes,
APIWebhookSourceChannel,
} from './mod.ts';
/**
@@ -64,7 +64,7 @@ export interface APIWebhook {
/**
* The channel that this webhook is following (returned for Channel Follower Webhooks)
*/
source_channel?: APIPartialChannel;
source_channel?: APIWebhookSourceChannel;
/**
* The url used for executing the webhook (returned by the webhooks OAuth2 flow)
*/

View File

@@ -3,6 +3,7 @@
*/
import type { Permissions, Snowflake } from '../../globals.ts';
import type { _NonNullableFields } from '../../utils/internals.ts';
import type { APIApplication } from './application.ts';
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
@@ -48,6 +49,11 @@ export interface APIInviteChannel extends Required<APIPartialChannel> {
recipients?: Pick<APIUser, 'username'>[] | undefined;
}
/**
* Source channel of channel follower webhooks.
*/
export type APIWebhookSourceChannel = Required<_NonNullableFields<Pick<APIPartialChannel, 'id' | 'name'>>>;
/**
* This interface is used to allow easy extension for other channel types. While
* also allowing `APIPartialChannel` to be used without breaking.

View File

@@ -6,11 +6,11 @@ import type { Snowflake } from '../../globals.ts';
import type {
APIEntitlement,
APIGuild,
APIPartialChannel,
APIPartialGuild,
APIUser,
ApplicationIntegrationType,
OAuth2Scopes,
APIWebhookSourceChannel,
} from './mod.ts';
/**
@@ -64,7 +64,7 @@ export interface APIWebhook {
/**
* The channel that this webhook is following (returned for Channel Follower Webhooks)
*/
source_channel?: APIPartialChannel;
source_channel?: APIWebhookSourceChannel;
/**
* The url used for executing the webhook (returned by the webhooks OAuth2 flow)
*/

View File

@@ -3,6 +3,7 @@
*/
import type { Permissions, Snowflake } from '../../globals';
import type { _NonNullableFields } from '../../utils/internals';
import type { APIApplication } from './application';
import type { APIPartialEmoji } from './emoji';
import type { APIGuildMember } from './guild';
@@ -48,6 +49,11 @@ export interface APIInviteChannel extends Required<APIPartialChannel> {
recipients?: Pick<APIUser, 'username'>[] | undefined;
}
/**
* Source channel of channel follower webhooks.
*/
export type APIWebhookSourceChannel = Required<_NonNullableFields<Pick<APIPartialChannel, 'id' | 'name'>>>;
/**
* This interface is used to allow easy extension for other channel types. While
* also allowing `APIPartialChannel` to be used without breaking.

View File

@@ -6,11 +6,11 @@ import type { Snowflake } from '../../globals';
import type {
APIEntitlement,
APIGuild,
APIPartialChannel,
APIPartialGuild,
APIUser,
ApplicationIntegrationType,
OAuth2Scopes,
APIWebhookSourceChannel,
} from './index';
/**
@@ -64,7 +64,7 @@ export interface APIWebhook {
/**
* The channel that this webhook is following (returned for Channel Follower Webhooks)
*/
source_channel?: APIPartialChannel;
source_channel?: APIWebhookSourceChannel;
/**
* The url used for executing the webhook (returned by the webhooks OAuth2 flow)
*/

View File

@@ -3,6 +3,7 @@
*/
import type { Permissions, Snowflake } from '../../globals';
import type { _NonNullableFields } from '../../utils/internals';
import type { APIApplication } from './application';
import type { APIPartialEmoji } from './emoji';
import type { APIGuildMember } from './guild';
@@ -48,6 +49,11 @@ export interface APIInviteChannel extends Required<APIPartialChannel> {
recipients?: Pick<APIUser, 'username'>[] | undefined;
}
/**
* Source channel of channel follower webhooks.
*/
export type APIWebhookSourceChannel = Required<_NonNullableFields<Pick<APIPartialChannel, 'id' | 'name'>>>;
/**
* This interface is used to allow easy extension for other channel types. While
* also allowing `APIPartialChannel` to be used without breaking.

View File

@@ -6,11 +6,11 @@ import type { Snowflake } from '../../globals';
import type {
APIEntitlement,
APIGuild,
APIPartialChannel,
APIPartialGuild,
APIUser,
ApplicationIntegrationType,
OAuth2Scopes,
APIWebhookSourceChannel,
} from './index';
/**
@@ -64,7 +64,7 @@ export interface APIWebhook {
/**
* The channel that this webhook is following (returned for Channel Follower Webhooks)
*/
source_channel?: APIPartialChannel;
source_channel?: APIWebhookSourceChannel;
/**
* The url used for executing the webhook (returned by the webhooks OAuth2 flow)
*/