mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-22 19:30:09 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5723cc04bf | ||
|
|
f93b6be252 | ||
|
|
b75b05f0d5 | ||
|
|
47100bcf2c | ||
|
|
a93235c9df | ||
|
|
b1589545e9 | ||
|
|
647905e16b | ||
|
|
f2995073e0 | ||
|
|
6f15e537df | ||
|
|
d338409410 | ||
|
|
ef2a0aeb07 |
42
CHANGELOG.md
42
CHANGELOG.md
@@ -1,3 +1,45 @@
|
||||
# [0.22.0](https://github.com/discordjs/discord-api-types/compare/0.21.0...0.22.0) (2021-07-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **Gateway:** thread list sync now sends an array as documented ([#174](https://github.com/discordjs/discord-api-types/issues/174)) ([a93235c](https://github.com/discordjs/discord-api-types/commit/a93235c9df2bc36a337c03e8ba08986e6e377483))
|
||||
- **MessageComponent:** correct type for emoji ([#176](https://github.com/discordjs/discord-api-types/issues/176)) ([b75b05f](https://github.com/discordjs/discord-api-types/commit/b75b05f0d50014335fefc8bb8969d519ed0076d3))
|
||||
|
||||
### chore
|
||||
|
||||
- **ApplicationCommandOptionType:** casing changes for subcommands ([#175](https://github.com/discordjs/discord-api-types/issues/175)) ([f93b6be](https://github.com/discordjs/discord-api-types/commit/f93b6be2528c80f8dc038282a7d6ddb3c4685c2f))
|
||||
|
||||
### Features
|
||||
|
||||
- thread updates ([#167](https://github.com/discordjs/discord-api-types/issues/167)) ([47100bc](https://github.com/discordjs/discord-api-types/commit/47100bcf2c154146baecb359e1c00ecca9939ffa))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **ApplicationCommandOptionType:** This renames `SubCommand` to `Subcommand`, and `SubCommandGroup` to `SubcommandGroup`
|
||||
- `Routes#channelJoinedArchivedThreads` is now spelled right (from `Routes#channelJoinedArhivedThreads`)
|
||||
- **Gateway:** `GatewayThreadListSync#members` is now an array of APIThreadMember instead of a Record of GatewayThreadListSyncMember
|
||||
|
||||
# [0.21.0](https://github.com/discordjs/discord-api-types/compare/0.20.1...0.21.0) (2021-07-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- change resolved index types to string ([#169](https://github.com/discordjs/discord-api-types/issues/169)) ([d338409](https://github.com/discordjs/discord-api-types/commit/d338409410854cc1f97f9903fdc2565e1f45e778))
|
||||
- export APIPingInteraction ([#168](https://github.com/discordjs/discord-api-types/issues/168)) ([ef2a0ae](https://github.com/discordjs/discord-api-types/commit/ef2a0aeb07cdd04b47e6cb0d40dd8a1b2a77b491))
|
||||
- **APIInteraction:** bring back Ping type ([#164](https://github.com/discordjs/discord-api-types/issues/164)) ([ff75eb3](https://github.com/discordjs/discord-api-types/commit/ff75eb3f5dfd7597968c26133d125cfe40ee5838))
|
||||
|
||||
### Features
|
||||
|
||||
- **ApplicationCommandOptionType:** add Number (10) ([#153](https://github.com/discordjs/discord-api-types/issues/153)) ([6f15e53](https://github.com/discordjs/discord-api-types/commit/6f15e537dfee5bda383572cd725c05246c97ca62))
|
||||
- **Globals:** revert template bigint type to string type ([#171](https://github.com/discordjs/discord-api-types/issues/171)) ([f299507](https://github.com/discordjs/discord-api-types/commit/f2995073e033b050ab459c42b480e626f3f6ae8e))
|
||||
|
||||
### Reverts
|
||||
|
||||
- fix: change resolved index types to string ([#172](https://github.com/discordjs/discord-api-types/issues/172)) ([647905e](https://github.com/discordjs/discord-api-types/commit/647905e16bfeb689e644695657ac5f05920c0c4c))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **Globals:** The type for Snowflake and Permissions is reverted from the `${bigint}` template type back to a normal string type
|
||||
|
||||
## [0.20.2](https://github.com/discordjs/discord-api-types/compare/0.21.0...0.20.2) (2021-07-21)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,3 +1,45 @@
|
||||
# [0.22.0](https://github.com/discordjs/discord-api-types/compare/0.21.0...0.22.0) (2021-07-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **Gateway:** thread list sync now sends an array as documented ([#174](https://github.com/discordjs/discord-api-types/issues/174)) ([a93235c](https://github.com/discordjs/discord-api-types/commit/a93235c9df2bc36a337c03e8ba08986e6e377483))
|
||||
- **MessageComponent:** correct type for emoji ([#176](https://github.com/discordjs/discord-api-types/issues/176)) ([b75b05f](https://github.com/discordjs/discord-api-types/commit/b75b05f0d50014335fefc8bb8969d519ed0076d3))
|
||||
|
||||
### chore
|
||||
|
||||
- **ApplicationCommandOptionType:** casing changes for subcommands ([#175](https://github.com/discordjs/discord-api-types/issues/175)) ([f93b6be](https://github.com/discordjs/discord-api-types/commit/f93b6be2528c80f8dc038282a7d6ddb3c4685c2f))
|
||||
|
||||
### Features
|
||||
|
||||
- thread updates ([#167](https://github.com/discordjs/discord-api-types/issues/167)) ([47100bc](https://github.com/discordjs/discord-api-types/commit/47100bcf2c154146baecb359e1c00ecca9939ffa))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **ApplicationCommandOptionType:** This renames `SubCommand` to `Subcommand`, and `SubCommandGroup` to `SubcommandGroup`
|
||||
- `Routes#channelJoinedArchivedThreads` is now spelled right (from `Routes#channelJoinedArhivedThreads`)
|
||||
- **Gateway:** `GatewayThreadListSync#members` is now an array of APIThreadMember instead of a Record of GatewayThreadListSyncMember
|
||||
|
||||
# [0.21.0](https://github.com/discordjs/discord-api-types/compare/0.20.1...0.21.0) (2021-07-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- change resolved index types to string ([#169](https://github.com/discordjs/discord-api-types/issues/169)) ([d338409](https://github.com/discordjs/discord-api-types/commit/d338409410854cc1f97f9903fdc2565e1f45e778))
|
||||
- export APIPingInteraction ([#168](https://github.com/discordjs/discord-api-types/issues/168)) ([ef2a0ae](https://github.com/discordjs/discord-api-types/commit/ef2a0aeb07cdd04b47e6cb0d40dd8a1b2a77b491))
|
||||
- **APIInteraction:** bring back Ping type ([#164](https://github.com/discordjs/discord-api-types/issues/164)) ([ff75eb3](https://github.com/discordjs/discord-api-types/commit/ff75eb3f5dfd7597968c26133d125cfe40ee5838))
|
||||
|
||||
### Features
|
||||
|
||||
- **ApplicationCommandOptionType:** add Number (10) ([#153](https://github.com/discordjs/discord-api-types/issues/153)) ([6f15e53](https://github.com/discordjs/discord-api-types/commit/6f15e537dfee5bda383572cd725c05246c97ca62))
|
||||
- **Globals:** revert template bigint type to string type ([#171](https://github.com/discordjs/discord-api-types/issues/171)) ([f299507](https://github.com/discordjs/discord-api-types/commit/f2995073e033b050ab459c42b480e626f3f6ae8e))
|
||||
|
||||
### Reverts
|
||||
|
||||
- fix: change resolved index types to string ([#172](https://github.com/discordjs/discord-api-types/issues/172)) ([647905e](https://github.com/discordjs/discord-api-types/commit/647905e16bfeb689e644695657ac5f05920c0c4c))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **Globals:** The type for Snowflake and Permissions is reverted from the `${bigint}` template type back to a normal string type
|
||||
|
||||
## [0.20.2](https://github.com/discordjs/discord-api-types/compare/0.21.0...0.20.2) (2021-07-21)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#snowflakes
|
||||
*/
|
||||
export type Snowflake = `${bigint}`;
|
||||
export type Snowflake = string;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions
|
||||
* @internal
|
||||
*/
|
||||
export type Permissions = `${bigint}`;
|
||||
export type Permissions = string;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#message-formatting-formats
|
||||
|
||||
@@ -68,7 +68,7 @@ export type APIApplicationCommandOption =
|
||||
* If the option is a `SUB_COMMAND` or `SUB_COMMAND_GROUP` type, this nested options will be the parameters
|
||||
*/
|
||||
export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.SubCommand | ApplicationCommandOptionType.SubCommandGroup;
|
||||
type: ApplicationCommandOptionType.Subcommand | ApplicationCommandOptionType.SubcommandGroup;
|
||||
options?: APIApplicationCommandOption[];
|
||||
}
|
||||
|
||||
@@ -79,7 +79,10 @@ export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicat
|
||||
* but they can have a `choices` one
|
||||
*/
|
||||
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer;
|
||||
type:
|
||||
| ApplicationCommandOptionType.String
|
||||
| ApplicationCommandOptionType.Integer
|
||||
| ApplicationCommandOptionType.Number;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
@@ -87,8 +90,8 @@ export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicatio
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#application-command-object-application-command-option-type
|
||||
*/
|
||||
export enum ApplicationCommandOptionType {
|
||||
SubCommand = 1,
|
||||
SubCommandGroup,
|
||||
Subcommand = 1,
|
||||
SubcommandGroup,
|
||||
String,
|
||||
Integer,
|
||||
Boolean,
|
||||
@@ -96,6 +99,7 @@ export enum ApplicationCommandOptionType {
|
||||
Channel,
|
||||
Role,
|
||||
Mentionable,
|
||||
Number,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,13 +149,13 @@ export type APIApplicationCommandInteractionDataOption =
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommand {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.SubCommand;
|
||||
type: ApplicationCommandOptionType.Subcommand;
|
||||
options: APIApplicationCommandInteractionDataOptionWithValues[];
|
||||
}
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommandGroup {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.SubCommandGroup;
|
||||
type: ApplicationCommandOptionType.SubcommandGroup;
|
||||
options: ApplicationCommandInteractionDataOptionSubCommand[];
|
||||
}
|
||||
|
||||
@@ -162,6 +166,7 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
|
||||
| ApplicationCommandInteractionDataOptionUser
|
||||
| ApplicationCommandInteractionDataOptionMentionable
|
||||
| ApplicationCommandInteractionDataOptionInteger
|
||||
| ApplicationCommandInteractionDataOptionNumber
|
||||
| ApplicationCommandInteractionDataOptionBoolean;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionString = InteractionDataOptionBase<
|
||||
@@ -194,6 +199,11 @@ export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOpti
|
||||
number
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionNumber = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Number,
|
||||
number
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionBoolean = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Boolean,
|
||||
boolean
|
||||
|
||||
@@ -955,13 +955,28 @@ interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseMessa
|
||||
/**
|
||||
* The emoji to display to the left of the text
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
/**
|
||||
* The status of the button
|
||||
*/
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export interface APIMessageComponentEmoji {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
id?: Snowflake;
|
||||
/**
|
||||
* Emoji name
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
animated?: boolean;
|
||||
}
|
||||
|
||||
export interface APIButtonComponentWithCustomId
|
||||
extends APIButtonComponentBase<
|
||||
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
|
||||
@@ -1047,7 +1062,7 @@ export interface APISelectMenuOption {
|
||||
/**
|
||||
* The emoji to display to the left of the option
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
/**
|
||||
* Whether this option should be already-selected by default
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,7 @@ import type {
|
||||
|
||||
export * from './_interactions/base.ts';
|
||||
export * from './_interactions/messageComponents.ts';
|
||||
export * from './_interactions/ping.ts';
|
||||
export * from './_interactions/responses.ts';
|
||||
export * from './_interactions/slashCommands.ts';
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ export type APIApplicationCommandOption =
|
||||
* If the option is a `SUB_COMMAND` or `SUB_COMMAND_GROUP` type, this nested options will be the parameters
|
||||
*/
|
||||
export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.SubCommand | ApplicationCommandOptionType.SubCommandGroup;
|
||||
type: ApplicationCommandOptionType.Subcommand | ApplicationCommandOptionType.SubcommandGroup;
|
||||
options?: APIApplicationCommandOption[];
|
||||
}
|
||||
|
||||
@@ -79,7 +79,10 @@ export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicat
|
||||
* but they can have a `choices` one
|
||||
*/
|
||||
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer;
|
||||
type:
|
||||
| ApplicationCommandOptionType.String
|
||||
| ApplicationCommandOptionType.Integer
|
||||
| ApplicationCommandOptionType.Number;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
@@ -87,8 +90,8 @@ export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicatio
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#application-command-object-application-command-option-type
|
||||
*/
|
||||
export enum ApplicationCommandOptionType {
|
||||
SubCommand = 1,
|
||||
SubCommandGroup,
|
||||
Subcommand = 1,
|
||||
SubcommandGroup,
|
||||
String,
|
||||
Integer,
|
||||
Boolean,
|
||||
@@ -96,6 +99,7 @@ export enum ApplicationCommandOptionType {
|
||||
Channel,
|
||||
Role,
|
||||
Mentionable,
|
||||
Number,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,13 +149,13 @@ export type APIApplicationCommandInteractionDataOption =
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommand {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.SubCommand;
|
||||
type: ApplicationCommandOptionType.Subcommand;
|
||||
options: APIApplicationCommandInteractionDataOptionWithValues[];
|
||||
}
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommandGroup {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.SubCommandGroup;
|
||||
type: ApplicationCommandOptionType.SubcommandGroup;
|
||||
options: ApplicationCommandInteractionDataOptionSubCommand[];
|
||||
}
|
||||
|
||||
@@ -162,6 +166,7 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
|
||||
| ApplicationCommandInteractionDataOptionUser
|
||||
| ApplicationCommandInteractionDataOptionMentionable
|
||||
| ApplicationCommandInteractionDataOptionInteger
|
||||
| ApplicationCommandInteractionDataOptionNumber
|
||||
| ApplicationCommandInteractionDataOptionBoolean;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionString = InteractionDataOptionBase<
|
||||
@@ -194,6 +199,11 @@ export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOpti
|
||||
number
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionNumber = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Number,
|
||||
number
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionBoolean = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Boolean,
|
||||
boolean
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIOverwrite } from './channel.ts';
|
||||
import type { APIChannel, APIOverwrite } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
GuildDefaultMessageNotifications,
|
||||
@@ -46,6 +46,14 @@ export interface APIAuditLog {
|
||||
* See https://discord.com/developers/docs/resources/guild#integration-object
|
||||
*/
|
||||
integrations: APIGuildIntegration[];
|
||||
/**
|
||||
* Threads found in the audit log
|
||||
*
|
||||
* Threads referenced in THREAD_CREATE and THREAD_UPDATE events are included in the threads map, since archived threads might not be kept in memory by clients.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
threads: APIChannel[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,6 +152,10 @@ export enum AuditLogEvent {
|
||||
StickerCreate = 90,
|
||||
StickerUpdate,
|
||||
StickerDelete,
|
||||
|
||||
ThreadCreate = 110,
|
||||
ThreadUpdate,
|
||||
ThreadDelete,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -302,7 +314,11 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyGuildId;
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration;
|
||||
|
||||
/**
|
||||
* Returned when an entity's name is changed
|
||||
@@ -611,6 +627,29 @@ export type APIAuditLogChangeKeyAvailable = AuditLogChangeData<'available', bool
|
||||
*/
|
||||
export type APIAuditLogChangeKeyGuildId = AuditLogChangeData<'guild_id', Snowflake>;
|
||||
|
||||
/*
|
||||
* Returned when a thread's archive status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyArchived = AuditLogChangeData<'archived', boolean>;
|
||||
|
||||
/*
|
||||
* Returned when a thread's lock status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyLocked = AuditLogChangeData<'locked', boolean>;
|
||||
|
||||
/*
|
||||
* Returned when a thread's auto archive duration is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAutoArchiveDuration = AuditLogChangeData<'auto_archive_duration', number>;
|
||||
|
||||
/*
|
||||
* Returned when a channel's default auto archive duration for newly created threads is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultAutoArchiveDuration = AuditLogChangeData<
|
||||
'default_auto_archive_duration',
|
||||
number
|
||||
>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D extends unknown> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -72,6 +72,11 @@ export interface APIChannel extends APIPartialChannel {
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*
|
||||
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
|
||||
*
|
||||
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
|
||||
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
/**
|
||||
@@ -1075,13 +1080,28 @@ interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseMessa
|
||||
/**
|
||||
* The emoji to display to the left of the text
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
/**
|
||||
* The status of the button
|
||||
*/
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export interface APIMessageComponentEmoji {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
id?: Snowflake;
|
||||
/**
|
||||
* Emoji name
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
animated?: boolean;
|
||||
}
|
||||
|
||||
export interface APIButtonComponentWithCustomId
|
||||
extends APIButtonComponentBase<
|
||||
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
|
||||
@@ -1167,7 +1187,7 @@ export interface APISelectMenuOption {
|
||||
/**
|
||||
* The emoji to display to the left of the option
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
/**
|
||||
* Whether this option should be already-selected by default
|
||||
*/
|
||||
|
||||
@@ -331,11 +331,9 @@ export interface GatewayThreadListSync {
|
||||
/**
|
||||
* The member objects for the client user in each joined thread that was synced
|
||||
*/
|
||||
members: Record<Snowflake, GatewayThreadListSyncMember>;
|
||||
members: APIThreadMember[];
|
||||
}
|
||||
|
||||
export type GatewayThreadListSyncMember = Omit<APIThreadMember, 'id' | 'user_id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#thread-members-update-thread-members-update-event-fields
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,7 @@ import type {
|
||||
|
||||
export * from './_interactions/base.ts';
|
||||
export * from './_interactions/messageComponents.ts';
|
||||
export * from './_interactions/ping.ts';
|
||||
export * from './_interactions/responses.ts';
|
||||
export * from './_interactions/slashCommands.ts';
|
||||
|
||||
|
||||
@@ -577,6 +577,8 @@ export interface RESTPostAPIChannelMessagesThreadsJSONBody {
|
||||
name: string;
|
||||
/**
|
||||
* The amount of time in minutes to wait before automatically archiving the thread
|
||||
*
|
||||
* The 3 day and 7 day archive durations require the server to be boosted. The [guild features](https://discord.com/developers/docs/resources/guild#guild-object-guild-features) will indicate if a server is able to use those settings.
|
||||
*/
|
||||
auto_archive_duration: ThreadAutoArchiveDuration;
|
||||
}
|
||||
@@ -592,8 +594,15 @@ export type RESTPostAPIChannelMessagesThreadsResult = APIChannel;
|
||||
export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMessagesThreadsJSONBody {
|
||||
/**
|
||||
* The type of thread to create
|
||||
*
|
||||
* In API v9, `type` defaults to `PRIVATE_THREAD`.
|
||||
* In API v10 this will be changed to be a required field, with no default.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*
|
||||
* @default 12
|
||||
*/
|
||||
type: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
|
||||
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -632,6 +641,8 @@ export interface RESTGetAPIChannelThreadsArchivedQuery {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#list-active-threads
|
||||
*
|
||||
* @deprecated Use [List Active Guild Threads](https://discord.com/developers/docs/resources/guild#list-active-threads) instead. Will be removed in v10.
|
||||
*/
|
||||
export type RESTGetAPIChannelThreadsResult = APIThreadList;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import type {
|
||||
APIGuildWidget,
|
||||
APIGuildWidgetSettings,
|
||||
APIRole,
|
||||
APIThreadList,
|
||||
APIVoiceRegion,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
@@ -303,6 +304,11 @@ export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
|
||||
*/
|
||||
export type RESTPatchAPIGuildChannelPositionsResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#list-active-threads
|
||||
*/
|
||||
export type RESTGetAPIGuildThreadsResult = Omit<APIThreadList, 'has_more'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-member
|
||||
*/
|
||||
|
||||
@@ -435,9 +435,19 @@ export const Routes = {
|
||||
return parts.join('/') as `/channels/${Snowflake}/threads` | `/channels/${Snowflake}/messages/${Snowflake}/threads`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/threads/active`
|
||||
*/
|
||||
guildActiveThreads(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/threads/active` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/threads/active`
|
||||
* (deprecated, use [List Active Guild Threads](https://discord.com/developers/docs/resources/guild#list-active-threads) instead.
|
||||
* Will be removed in v10.)
|
||||
* - GET `/channels/{channel.id}/threads/archived/public`
|
||||
* - GET `/channels/{channel.id}/threads/archived/private`
|
||||
*/
|
||||
@@ -456,7 +466,7 @@ export const Routes = {
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/users/@me/threads/archived/prviate`
|
||||
*/
|
||||
channelJoinedArhivedThreads(channelId: Snowflake) {
|
||||
channelJoinedArchivedThreads(channelId: Snowflake) {
|
||||
return `/channels/${channelId}/users/@me/threads/archived/private` as const;
|
||||
},
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#snowflakes
|
||||
*/
|
||||
export type Snowflake = `${bigint}`;
|
||||
export type Snowflake = string;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions
|
||||
* @internal
|
||||
*/
|
||||
export type Permissions = `${bigint}`;
|
||||
export type Permissions = string;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#message-formatting-formats
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.20.2",
|
||||
"version": "0.22.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"version": "0.20.2",
|
||||
"version": "0.22.0",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.14.6",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.20.2",
|
||||
"version": "0.22.0",
|
||||
"description": "Discord API typings that are kept up to date for use in bot library creation.",
|
||||
"main": "./v9.js",
|
||||
"module": "./v9.mjs",
|
||||
|
||||
@@ -68,7 +68,7 @@ export type APIApplicationCommandOption =
|
||||
* If the option is a `SUB_COMMAND` or `SUB_COMMAND_GROUP` type, this nested options will be the parameters
|
||||
*/
|
||||
export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.SubCommand | ApplicationCommandOptionType.SubCommandGroup;
|
||||
type: ApplicationCommandOptionType.Subcommand | ApplicationCommandOptionType.SubcommandGroup;
|
||||
options?: APIApplicationCommandOption[];
|
||||
}
|
||||
|
||||
@@ -79,7 +79,10 @@ export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicat
|
||||
* but they can have a `choices` one
|
||||
*/
|
||||
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer;
|
||||
type:
|
||||
| ApplicationCommandOptionType.String
|
||||
| ApplicationCommandOptionType.Integer
|
||||
| ApplicationCommandOptionType.Number;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
@@ -87,8 +90,8 @@ export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicatio
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#application-command-object-application-command-option-type
|
||||
*/
|
||||
export const enum ApplicationCommandOptionType {
|
||||
SubCommand = 1,
|
||||
SubCommandGroup,
|
||||
Subcommand = 1,
|
||||
SubcommandGroup,
|
||||
String,
|
||||
Integer,
|
||||
Boolean,
|
||||
@@ -96,6 +99,7 @@ export const enum ApplicationCommandOptionType {
|
||||
Channel,
|
||||
Role,
|
||||
Mentionable,
|
||||
Number,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,13 +149,13 @@ export type APIApplicationCommandInteractionDataOption =
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommand {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.SubCommand;
|
||||
type: ApplicationCommandOptionType.Subcommand;
|
||||
options: APIApplicationCommandInteractionDataOptionWithValues[];
|
||||
}
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommandGroup {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.SubCommandGroup;
|
||||
type: ApplicationCommandOptionType.SubcommandGroup;
|
||||
options: ApplicationCommandInteractionDataOptionSubCommand[];
|
||||
}
|
||||
|
||||
@@ -162,6 +166,7 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
|
||||
| ApplicationCommandInteractionDataOptionUser
|
||||
| ApplicationCommandInteractionDataOptionMentionable
|
||||
| ApplicationCommandInteractionDataOptionInteger
|
||||
| ApplicationCommandInteractionDataOptionNumber
|
||||
| ApplicationCommandInteractionDataOptionBoolean;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionString = InteractionDataOptionBase<
|
||||
@@ -194,6 +199,11 @@ export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOpti
|
||||
number
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionNumber = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Number,
|
||||
number
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionBoolean = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Boolean,
|
||||
boolean
|
||||
|
||||
@@ -955,13 +955,28 @@ interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseMessa
|
||||
/**
|
||||
* The emoji to display to the left of the text
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
/**
|
||||
* The status of the button
|
||||
*/
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export interface APIMessageComponentEmoji {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
id?: Snowflake;
|
||||
/**
|
||||
* Emoji name
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
animated?: boolean;
|
||||
}
|
||||
|
||||
export interface APIButtonComponentWithCustomId
|
||||
extends APIButtonComponentBase<
|
||||
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
|
||||
@@ -1047,7 +1062,7 @@ export interface APISelectMenuOption {
|
||||
/**
|
||||
* The emoji to display to the left of the option
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
/**
|
||||
* Whether this option should be already-selected by default
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,7 @@ import type {
|
||||
|
||||
export * from './_interactions/base';
|
||||
export * from './_interactions/messageComponents';
|
||||
export * from './_interactions/ping';
|
||||
export * from './_interactions/responses';
|
||||
export * from './_interactions/slashCommands';
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ export type APIApplicationCommandOption =
|
||||
* If the option is a `SUB_COMMAND` or `SUB_COMMAND_GROUP` type, this nested options will be the parameters
|
||||
*/
|
||||
export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.SubCommand | ApplicationCommandOptionType.SubCommandGroup;
|
||||
type: ApplicationCommandOptionType.Subcommand | ApplicationCommandOptionType.SubcommandGroup;
|
||||
options?: APIApplicationCommandOption[];
|
||||
}
|
||||
|
||||
@@ -79,7 +79,10 @@ export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicat
|
||||
* but they can have a `choices` one
|
||||
*/
|
||||
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.String | ApplicationCommandOptionType.Integer;
|
||||
type:
|
||||
| ApplicationCommandOptionType.String
|
||||
| ApplicationCommandOptionType.Integer
|
||||
| ApplicationCommandOptionType.Number;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
@@ -87,8 +90,8 @@ export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicatio
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#application-command-object-application-command-option-type
|
||||
*/
|
||||
export const enum ApplicationCommandOptionType {
|
||||
SubCommand = 1,
|
||||
SubCommandGroup,
|
||||
Subcommand = 1,
|
||||
SubcommandGroup,
|
||||
String,
|
||||
Integer,
|
||||
Boolean,
|
||||
@@ -96,6 +99,7 @@ export const enum ApplicationCommandOptionType {
|
||||
Channel,
|
||||
Role,
|
||||
Mentionable,
|
||||
Number,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,13 +149,13 @@ export type APIApplicationCommandInteractionDataOption =
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommand {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.SubCommand;
|
||||
type: ApplicationCommandOptionType.Subcommand;
|
||||
options: APIApplicationCommandInteractionDataOptionWithValues[];
|
||||
}
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommandGroup {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.SubCommandGroup;
|
||||
type: ApplicationCommandOptionType.SubcommandGroup;
|
||||
options: ApplicationCommandInteractionDataOptionSubCommand[];
|
||||
}
|
||||
|
||||
@@ -162,6 +166,7 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
|
||||
| ApplicationCommandInteractionDataOptionUser
|
||||
| ApplicationCommandInteractionDataOptionMentionable
|
||||
| ApplicationCommandInteractionDataOptionInteger
|
||||
| ApplicationCommandInteractionDataOptionNumber
|
||||
| ApplicationCommandInteractionDataOptionBoolean;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionString = InteractionDataOptionBase<
|
||||
@@ -194,6 +199,11 @@ export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOpti
|
||||
number
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionNumber = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Number,
|
||||
number
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionBoolean = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Boolean,
|
||||
boolean
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { APIOverwrite } from './channel';
|
||||
import type { APIChannel, APIOverwrite } from './channel';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
GuildDefaultMessageNotifications,
|
||||
@@ -46,6 +46,14 @@ export interface APIAuditLog {
|
||||
* See https://discord.com/developers/docs/resources/guild#integration-object
|
||||
*/
|
||||
integrations: APIGuildIntegration[];
|
||||
/**
|
||||
* Threads found in the audit log
|
||||
*
|
||||
* Threads referenced in THREAD_CREATE and THREAD_UPDATE events are included in the threads map, since archived threads might not be kept in memory by clients.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
threads: APIChannel[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -144,6 +152,10 @@ export const enum AuditLogEvent {
|
||||
StickerCreate = 90,
|
||||
StickerUpdate,
|
||||
StickerDelete,
|
||||
|
||||
ThreadCreate = 110,
|
||||
ThreadUpdate,
|
||||
ThreadDelete,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -302,7 +314,11 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyGuildId;
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration;
|
||||
|
||||
/**
|
||||
* Returned when an entity's name is changed
|
||||
@@ -611,6 +627,29 @@ export type APIAuditLogChangeKeyAvailable = AuditLogChangeData<'available', bool
|
||||
*/
|
||||
export type APIAuditLogChangeKeyGuildId = AuditLogChangeData<'guild_id', Snowflake>;
|
||||
|
||||
/*
|
||||
* Returned when a thread's archive status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyArchived = AuditLogChangeData<'archived', boolean>;
|
||||
|
||||
/*
|
||||
* Returned when a thread's lock status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyLocked = AuditLogChangeData<'locked', boolean>;
|
||||
|
||||
/*
|
||||
* Returned when a thread's auto archive duration is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAutoArchiveDuration = AuditLogChangeData<'auto_archive_duration', number>;
|
||||
|
||||
/*
|
||||
* Returned when a channel's default auto archive duration for newly created threads is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultAutoArchiveDuration = AuditLogChangeData<
|
||||
'default_auto_archive_duration',
|
||||
number
|
||||
>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D extends unknown> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -72,6 +72,11 @@ export interface APIChannel extends APIPartialChannel {
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*
|
||||
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
|
||||
*
|
||||
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
|
||||
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
/**
|
||||
@@ -1075,13 +1080,28 @@ interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseMessa
|
||||
/**
|
||||
* The emoji to display to the left of the text
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
/**
|
||||
* The status of the button
|
||||
*/
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export interface APIMessageComponentEmoji {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
id?: Snowflake;
|
||||
/**
|
||||
* Emoji name
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
animated?: boolean;
|
||||
}
|
||||
|
||||
export interface APIButtonComponentWithCustomId
|
||||
extends APIButtonComponentBase<
|
||||
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
|
||||
@@ -1167,7 +1187,7 @@ export interface APISelectMenuOption {
|
||||
/**
|
||||
* The emoji to display to the left of the option
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
emoji?: APIMessageComponentEmoji;
|
||||
/**
|
||||
* Whether this option should be already-selected by default
|
||||
*/
|
||||
|
||||
@@ -331,11 +331,9 @@ export interface GatewayThreadListSync {
|
||||
/**
|
||||
* The member objects for the client user in each joined thread that was synced
|
||||
*/
|
||||
members: Record<Snowflake, GatewayThreadListSyncMember>;
|
||||
members: APIThreadMember[];
|
||||
}
|
||||
|
||||
export type GatewayThreadListSyncMember = Omit<APIThreadMember, 'id' | 'user_id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#thread-members-update-thread-members-update-event-fields
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,7 @@ import type {
|
||||
|
||||
export * from './_interactions/base';
|
||||
export * from './_interactions/messageComponents';
|
||||
export * from './_interactions/ping';
|
||||
export * from './_interactions/responses';
|
||||
export * from './_interactions/slashCommands';
|
||||
|
||||
|
||||
@@ -577,6 +577,8 @@ export interface RESTPostAPIChannelMessagesThreadsJSONBody {
|
||||
name: string;
|
||||
/**
|
||||
* The amount of time in minutes to wait before automatically archiving the thread
|
||||
*
|
||||
* The 3 day and 7 day archive durations require the server to be boosted. The [guild features](https://discord.com/developers/docs/resources/guild#guild-object-guild-features) will indicate if a server is able to use those settings.
|
||||
*/
|
||||
auto_archive_duration: ThreadAutoArchiveDuration;
|
||||
}
|
||||
@@ -592,8 +594,15 @@ export type RESTPostAPIChannelMessagesThreadsResult = APIChannel;
|
||||
export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMessagesThreadsJSONBody {
|
||||
/**
|
||||
* The type of thread to create
|
||||
*
|
||||
* In API v9, `type` defaults to `PRIVATE_THREAD`.
|
||||
* In API v10 this will be changed to be a required field, with no default.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*
|
||||
* @default 12
|
||||
*/
|
||||
type: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
|
||||
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -632,6 +641,8 @@ export interface RESTGetAPIChannelThreadsArchivedQuery {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#list-active-threads
|
||||
*
|
||||
* @deprecated Use [List Active Guild Threads](https://discord.com/developers/docs/resources/guild#list-active-threads) instead. Will be removed in v10.
|
||||
*/
|
||||
export type RESTGetAPIChannelThreadsResult = APIThreadList;
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import type {
|
||||
APIGuildWidget,
|
||||
APIGuildWidgetSettings,
|
||||
APIRole,
|
||||
APIThreadList,
|
||||
APIVoiceRegion,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
@@ -303,6 +304,11 @@ export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
|
||||
*/
|
||||
export type RESTPatchAPIGuildChannelPositionsResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#list-active-threads
|
||||
*/
|
||||
export type RESTGetAPIGuildThreadsResult = Omit<APIThreadList, 'has_more'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-member
|
||||
*/
|
||||
|
||||
@@ -435,9 +435,19 @@ export const Routes = {
|
||||
return parts.join('/') as `/channels/${Snowflake}/threads` | `/channels/${Snowflake}/messages/${Snowflake}/threads`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/threads/active`
|
||||
*/
|
||||
guildActiveThreads(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/threads/active` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/threads/active`
|
||||
* (deprecated, use [List Active Guild Threads](https://discord.com/developers/docs/resources/guild#list-active-threads) instead.
|
||||
* Will be removed in v10.)
|
||||
* - GET `/channels/{channel.id}/threads/archived/public`
|
||||
* - GET `/channels/{channel.id}/threads/archived/private`
|
||||
*/
|
||||
@@ -456,7 +466,7 @@ export const Routes = {
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/users/@me/threads/archived/prviate`
|
||||
*/
|
||||
channelJoinedArhivedThreads(channelId: Snowflake) {
|
||||
channelJoinedArchivedThreads(channelId: Snowflake) {
|
||||
return `/channels/${channelId}/users/@me/threads/archived/private` as const;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user