feat: invite channel (#1232)

This commit is contained in:
Jiralite
2025-05-09 06:39:55 +01:00
committed by GitHub
parent bfaf36e42e
commit 0479cafa1b
8 changed files with 72 additions and 8 deletions

View File

@@ -32,6 +32,22 @@ export interface APIPartialChannel {
name?: string | null;
}
/**
* A channel obtained from fetching an invite.
*/
export interface APIInviteChannel extends Required<APIPartialChannel> {
/**
* Icon hash.
*/
icon?: string | undefined;
/**
* The invite channel's recipients.
*
* @remarks Only includes usernames of users.
*/
recipients?: Pick<APIUser, 'username'>[] | undefined;
}
/**
* This interface is used to allow easy extension for other channel types. While
* also allowing `APIPartialChannel` to be used without breaking.

View File

@@ -3,7 +3,7 @@
*/
import type { APIApplication } from './application.ts';
import type { APIPartialChannel } from './channel.ts';
import type { APIInviteChannel } from './channel.ts';
import type { APIGuild } from './guild.ts';
import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts';
import type { APIInviteStageInstance } from './stageInstance.ts';
@@ -43,7 +43,7 @@ export interface APIInvite {
*
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object}
*/
channel: Required<APIPartialChannel> | null;
channel: APIInviteChannel | null;
/**
* The user who created the invite
*

View File

@@ -32,6 +32,22 @@ export interface APIPartialChannel {
name?: string | null;
}
/**
* A channel obtained from fetching an invite.
*/
export interface APIInviteChannel extends Required<APIPartialChannel> {
/**
* Icon hash.
*/
icon?: string | undefined;
/**
* The invite channel's recipients.
*
* @remarks Only includes usernames of users.
*/
recipients?: Pick<APIUser, 'username'>[] | undefined;
}
/**
* This interface is used to allow easy extension for other channel types. While
* also allowing `APIPartialChannel` to be used without breaking.

View File

@@ -3,7 +3,7 @@
*/
import type { APIApplication } from './application.ts';
import type { APIPartialChannel } from './channel.ts';
import type { APIInviteChannel } from './channel.ts';
import type { APIGuild } from './guild.ts';
import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts';
import type { APIInviteStageInstance } from './stageInstance.ts';
@@ -43,7 +43,7 @@ export interface APIInvite {
*
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object}
*/
channel: Required<APIPartialChannel> | null;
channel: APIInviteChannel | null;
/**
* The user who created the invite
*

View File

@@ -32,6 +32,22 @@ export interface APIPartialChannel {
name?: string | null;
}
/**
* A channel obtained from fetching an invite.
*/
export interface APIInviteChannel extends Required<APIPartialChannel> {
/**
* Icon hash.
*/
icon?: string | undefined;
/**
* The invite channel's recipients.
*
* @remarks Only includes usernames of users.
*/
recipients?: Pick<APIUser, 'username'>[] | undefined;
}
/**
* This interface is used to allow easy extension for other channel types. While
* also allowing `APIPartialChannel` to be used without breaking.

View File

@@ -3,7 +3,7 @@
*/
import type { APIApplication } from './application';
import type { APIPartialChannel } from './channel';
import type { APIInviteChannel } from './channel';
import type { APIGuild } from './guild';
import type { APIGuildScheduledEvent } from './guildScheduledEvent';
import type { APIInviteStageInstance } from './stageInstance';
@@ -43,7 +43,7 @@ export interface APIInvite {
*
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object}
*/
channel: Required<APIPartialChannel> | null;
channel: APIInviteChannel | null;
/**
* The user who created the invite
*

View File

@@ -32,6 +32,22 @@ export interface APIPartialChannel {
name?: string | null;
}
/**
* A channel obtained from fetching an invite.
*/
export interface APIInviteChannel extends Required<APIPartialChannel> {
/**
* Icon hash.
*/
icon?: string | undefined;
/**
* The invite channel's recipients.
*
* @remarks Only includes usernames of users.
*/
recipients?: Pick<APIUser, 'username'>[] | undefined;
}
/**
* This interface is used to allow easy extension for other channel types. While
* also allowing `APIPartialChannel` to be used without breaking.

View File

@@ -3,7 +3,7 @@
*/
import type { APIApplication } from './application';
import type { APIPartialChannel } from './channel';
import type { APIInviteChannel } from './channel';
import type { APIGuild } from './guild';
import type { APIGuildScheduledEvent } from './guildScheduledEvent';
import type { APIInviteStageInstance } from './stageInstance';
@@ -43,7 +43,7 @@ export interface APIInvite {
*
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object}
*/
channel: Required<APIPartialChannel> | null;
channel: APIInviteChannel | null;
/**
* The user who created the invite
*