Compare commits

..

5 Commits

Author SHA1 Message Date
Vlad Frangu
7ecf9b2c16 chore(release): 0.26.1 🎉 (#285) 2022-01-02 03:22:53 +02:00
Vlad Frangu
fe1f5313a8 fix(APIApplicationCommandOption): correct type for integer and number (#284) 2022-01-02 03:19:25 +02:00
Jiralite
0cf51abc26 feat(APIAuditLogChangeData): Add communication_disabled_until (#281) 2021-12-27 18:30:02 +02:00
cherryblossom000
751aee6fa7 feat(APIGuildScheduledEvent): add more precise types for stage instance/voice/external events (#278)
This commit turns `APIGuildScheduledEvent` into a union of
`APIStageInstanceGuildScheduledEvent`, `APIVoiceGuildScheduledEvent`,
and `APIExternalGuildScheduledEvent`, which each has more precise types
according to [the docs][1].

This commit also fixes a bug as previously
`APIGuildScheduledEvent#entity_metadata` was not nullable, even though
it should be.

[1]: https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-field-requirements-by-entity-type
2021-12-26 16:56:43 +02:00
Almeida
9f4f59c8e5 feat(ApplicationFlags): add embedded application flags (#277)
While Discord considers it not relevant, invites for in-app applications use at least one of these flags. Reference PR: https://github.com/discord/discord-api-docs/pull/4248
2021-12-25 14:30:10 +02:00
28 changed files with 199 additions and 43 deletions

View File

@@ -1,3 +1,15 @@
## [0.26.1](https://github.com/discordjs/discord-api-types/compare/0.26.0...0.26.1) (2022-01-02)
### Bug Fixes
- **APIApplicationCommandOption:** correct type for integer and number ([#284](https://github.com/discordjs/discord-api-types/issues/284)) ([fe1f531](https://github.com/discordjs/discord-api-types/commit/fe1f5313a8fc13d0a2433738cce9be37f5d9eeb5))
### Features
- **APIAuditLogChangeData:** Add `communication_disabled_until` ([#281](https://github.com/discordjs/discord-api-types/issues/281)) ([0cf51ab](https://github.com/discordjs/discord-api-types/commit/0cf51abc267bd6246a7952e7f6a23fa8c5db290a))
- **APIGuildScheduledEvent:** add more precise types for stage instance/voice/external events ([#278](https://github.com/discordjs/discord-api-types/issues/278)) ([751aee6](https://github.com/discordjs/discord-api-types/commit/751aee6fa7d4c542324a30e9b9bc641b0e7a8bf4))
- **ApplicationFlags:** add embedded application flags ([#277](https://github.com/discordjs/discord-api-types/issues/277)) ([9f4f59c](https://github.com/discordjs/discord-api-types/commit/9f4f59c8e55f78caf614e27e28b6bca939665ca5))
# [0.26.0](https://github.com/discordjs/discord-api-types/compare/0.25.2...0.26.0) (2021-12-24)
### Bug Fixes

View File

@@ -1,3 +1,15 @@
## [0.26.1](https://github.com/discordjs/discord-api-types/compare/0.26.0...0.26.1) (2022-01-02)
### Bug Fixes
- **APIApplicationCommandOption:** correct type for integer and number ([#284](https://github.com/discordjs/discord-api-types/issues/284)) ([fe1f531](https://github.com/discordjs/discord-api-types/commit/fe1f5313a8fc13d0a2433738cce9be37f5d9eeb5))
### Features
- **APIAuditLogChangeData:** Add `communication_disabled_until` ([#281](https://github.com/discordjs/discord-api-types/issues/281)) ([0cf51ab](https://github.com/discordjs/discord-api-types/commit/0cf51abc267bd6246a7952e7f6a23fa8c5db290a))
- **APIGuildScheduledEvent:** add more precise types for stage instance/voice/external events ([#278](https://github.com/discordjs/discord-api-types/issues/278)) ([751aee6](https://github.com/discordjs/discord-api-types/commit/751aee6fa7d4c542324a30e9b9bc641b0e7a8bf4))
- **ApplicationFlags:** add embedded application flags ([#277](https://github.com/discordjs/discord-api-types/issues/277)) ([9f4f59c](https://github.com/discordjs/discord-api-types/commit/9f4f59c8e55f78caf614e27e28b6bca939665ca5))
# [0.26.0](https://github.com/discordjs/discord-api-types/compare/0.25.2...0.26.0) (2021-12-24)
### Bug Fixes

View File

@@ -5,7 +5,7 @@ import type {
} from './base.ts';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
export interface APIApplicationCommandIntegerOptionBase
interface APIApplicationCommandIntegerOptionBase
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Integer> {
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.

View File

@@ -5,7 +5,7 @@ import type {
} from './base.ts';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
export interface APIApplicationCommandNumberOptionBase
interface APIApplicationCommandNumberOptionBase
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Number> {
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.

View File

@@ -14,7 +14,7 @@ import type {
APIApplicationCommandInteractionDataStringOption,
} from './_chatInput/string.ts';
import type {
APIApplicationCommandIntegerOptionBase,
APIApplicationCommandIntegerOption,
APIApplicationCommandInteractionDataIntegerOption,
} from './_chatInput/integer.ts';
import type {
@@ -38,7 +38,7 @@ import type {
APIApplicationCommandInteractionDataMentionableOption,
} from './_chatInput/mentionable.ts';
import type {
APIApplicationCommandNumberOptionBase,
APIApplicationCommandNumberOption,
APIApplicationCommandInteractionDataNumberOption,
} from './_chatInput/number.ts';
import type {
@@ -67,13 +67,13 @@ export * from './_chatInput/shared.ts';
*/
export type APIApplicationCommandBasicOption =
| APIApplicationCommandStringOption
| APIApplicationCommandIntegerOptionBase
| APIApplicationCommandIntegerOption
| APIApplicationCommandBooleanOption
| APIApplicationCommandUserOption
| APIApplicationCommandChannelOption
| APIApplicationCommandRoleOption
| APIApplicationCommandMentionableOption
| APIApplicationCommandNumberOptionBase;
| APIApplicationCommandNumberOption;
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure

View File

@@ -97,6 +97,7 @@ export interface APIApplication {
* https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
export enum ApplicationFlags {
EmbeddedReleased = 1 << 1,
ManagedEmoji = 1 << 2,
GroupDMCreate = 1 << 4,
RPCHasConnected = 1 << 11,
@@ -108,4 +109,5 @@ export enum ApplicationFlags {
Embedded = 1 << 17,
GatewayMessageContent = 1 << 18,
GatewayMessageContentLimited = 1 << 19,
EmbeddedFirstParty = 1 << 20,
}

View File

@@ -320,7 +320,8 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyGuildId
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeyLocation;
| APIAuditLogChangeKeyLocation
| APIAuditLogChangeKeyCommunicationDisabledUntil;
/**
* Returned when an entity's name is changed
@@ -644,6 +645,11 @@ export type APIAuditLogChangeKeyStatus = AuditLogChangeData<'status', GuildSched
*/
export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string>;
/**
* Returned when a user's timeout is changed
*/
export type APIAuditLogChangeKeyCommunicationDisabledUntil = AuditLogChangeData<'communication_disabled_until', string>;
interface AuditLogChangeData<K extends string, D> {
key: K;
/**

View File

@@ -2,7 +2,7 @@ import type { APIUser } from './user.ts';
import type { APIGuildMember } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
export interface APIGuildScheduledEvent {
interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType> {
/**
* The id of the guild event
*/
@@ -46,7 +46,7 @@ export interface APIGuildScheduledEvent {
/**
* The type of hosting entity associated with the scheduled event
*/
entity_type: GuildScheduledEventEntityType;
entity_type: Type;
/**
* The id of the hosting entity associated with the scheduled event
*/
@@ -54,7 +54,7 @@ export interface APIGuildScheduledEvent {
/**
* The entity metadata for the scheduled event
*/
entity_metadata: APIGuildScheduledEventEntityMetadata;
entity_metadata: APIGuildScheduledEventEntityMetadata | null;
/**
* The user that created the scheduled event
*/
@@ -65,6 +65,31 @@ export interface APIGuildScheduledEvent {
user_count?: number;
}
export interface APIStageInstanceGuildScheduledEvent
extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.StageInstance> {
channel_id: Snowflake;
entity_metadata: null;
}
export interface APIVoiceGuildScheduledEvent extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.Voice> {
channel_id: Snowflake;
entity_metadata: null;
}
export interface APIExternalGuildScheduledEvent
extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.External> {
channel_id: null;
entity_metadata: Required<APIGuildScheduledEventEntityMetadata>;
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
*/
export type APIGuildScheduledEvent =
| APIStageInstanceGuildScheduledEvent
| APIVoiceGuildScheduledEvent
| APIExternalGuildScheduledEvent;
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
*/

View File

@@ -5,7 +5,7 @@ import type {
} from './base.ts';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
export interface APIApplicationCommandIntegerOptionBase
interface APIApplicationCommandIntegerOptionBase
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Integer> {
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.

View File

@@ -5,7 +5,7 @@ import type {
} from './base.ts';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
export interface APIApplicationCommandNumberOptionBase
interface APIApplicationCommandNumberOptionBase
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Number> {
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.

View File

@@ -14,7 +14,7 @@ import type {
APIApplicationCommandInteractionDataStringOption,
} from './_chatInput/string.ts';
import type {
APIApplicationCommandIntegerOptionBase,
APIApplicationCommandIntegerOption,
APIApplicationCommandInteractionDataIntegerOption,
} from './_chatInput/integer.ts';
import type {
@@ -38,7 +38,7 @@ import type {
APIApplicationCommandInteractionDataMentionableOption,
} from './_chatInput/mentionable.ts';
import type {
APIApplicationCommandNumberOptionBase,
APIApplicationCommandNumberOption,
APIApplicationCommandInteractionDataNumberOption,
} from './_chatInput/number.ts';
import type {
@@ -67,13 +67,13 @@ export * from './_chatInput/shared.ts';
*/
export type APIApplicationCommandBasicOption =
| APIApplicationCommandStringOption
| APIApplicationCommandIntegerOptionBase
| APIApplicationCommandIntegerOption
| APIApplicationCommandBooleanOption
| APIApplicationCommandUserOption
| APIApplicationCommandChannelOption
| APIApplicationCommandRoleOption
| APIApplicationCommandMentionableOption
| APIApplicationCommandNumberOptionBase;
| APIApplicationCommandNumberOption;
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure

View File

@@ -97,6 +97,7 @@ export interface APIApplication {
* https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
export enum ApplicationFlags {
EmbeddedReleased = 1 << 1,
ManagedEmoji = 1 << 2,
GroupDMCreate = 1 << 4,
RPCHasConnected = 1 << 11,
@@ -108,4 +109,5 @@ export enum ApplicationFlags {
Embedded = 1 << 17,
GatewayMessageContent = 1 << 18,
GatewayMessageContentLimited = 1 << 19,
EmbeddedFirstParty = 1 << 20,
}

View File

@@ -336,7 +336,8 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeyLocation;
| APIAuditLogChangeKeyLocation
| APIAuditLogChangeKeyCommunicationDisabledUntil;
/**
* Returned when an entity's name is changed
@@ -683,6 +684,11 @@ export type APIAuditLogChangeKeyStatus = AuditLogChangeData<'status', GuildSched
*/
export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string>;
/**
* Returned when a user's timeout is changed
*/
export type APIAuditLogChangeKeyCommunicationDisabledUntil = AuditLogChangeData<'communication_disabled_until', string>;
interface AuditLogChangeData<K extends string, D> {
key: K;
/**

View File

@@ -2,7 +2,7 @@ import type { APIUser } from './user.ts';
import type { APIGuildMember } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
export interface APIGuildScheduledEvent {
interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType> {
/**
* The id of the guild event
*/
@@ -46,7 +46,7 @@ export interface APIGuildScheduledEvent {
/**
* The type of hosting entity associated with the scheduled event
*/
entity_type: GuildScheduledEventEntityType;
entity_type: Type;
/**
* The id of the hosting entity associated with the scheduled event
*/
@@ -54,7 +54,7 @@ export interface APIGuildScheduledEvent {
/**
* The entity metadata for the scheduled event
*/
entity_metadata: APIGuildScheduledEventEntityMetadata;
entity_metadata: APIGuildScheduledEventEntityMetadata | null;
/**
* The user that created the scheduled event
*/
@@ -65,6 +65,31 @@ export interface APIGuildScheduledEvent {
user_count?: number;
}
export interface APIStageInstanceGuildScheduledEvent
extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.StageInstance> {
channel_id: Snowflake;
entity_metadata: null;
}
export interface APIVoiceGuildScheduledEvent extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.Voice> {
channel_id: Snowflake;
entity_metadata: null;
}
export interface APIExternalGuildScheduledEvent
extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.External> {
channel_id: null;
entity_metadata: Required<APIGuildScheduledEventEntityMetadata>;
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
*/
export type APIGuildScheduledEvent =
| APIStageInstanceGuildScheduledEvent
| APIVoiceGuildScheduledEvent
| APIExternalGuildScheduledEvent;
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
*/

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "discord-api-types",
"version": "0.26.0",
"version": "0.26.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "discord-api-types",
"version": "0.26.0",
"version": "0.26.1",
"license": "MIT",
"devDependencies": {
"@babel/core": "^7.16.5",

View File

@@ -1,6 +1,6 @@
{
"name": "discord-api-types",
"version": "0.26.0",
"version": "0.26.1",
"description": "Discord API typings that are kept up to date for use in bot library creation.",
"types": "./v9.d.ts",
"exports": {

View File

@@ -5,7 +5,7 @@ import type {
} from './base';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared';
export interface APIApplicationCommandIntegerOptionBase
interface APIApplicationCommandIntegerOptionBase
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Integer> {
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.

View File

@@ -5,7 +5,7 @@ import type {
} from './base';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared';
export interface APIApplicationCommandNumberOptionBase
interface APIApplicationCommandNumberOptionBase
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Number> {
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.

View File

@@ -14,7 +14,7 @@ import type {
APIApplicationCommandInteractionDataStringOption,
} from './_chatInput/string';
import type {
APIApplicationCommandIntegerOptionBase,
APIApplicationCommandIntegerOption,
APIApplicationCommandInteractionDataIntegerOption,
} from './_chatInput/integer';
import type {
@@ -38,7 +38,7 @@ import type {
APIApplicationCommandInteractionDataMentionableOption,
} from './_chatInput/mentionable';
import type {
APIApplicationCommandNumberOptionBase,
APIApplicationCommandNumberOption,
APIApplicationCommandInteractionDataNumberOption,
} from './_chatInput/number';
import type {
@@ -67,13 +67,13 @@ export * from './_chatInput/shared';
*/
export type APIApplicationCommandBasicOption =
| APIApplicationCommandStringOption
| APIApplicationCommandIntegerOptionBase
| APIApplicationCommandIntegerOption
| APIApplicationCommandBooleanOption
| APIApplicationCommandUserOption
| APIApplicationCommandChannelOption
| APIApplicationCommandRoleOption
| APIApplicationCommandMentionableOption
| APIApplicationCommandNumberOptionBase;
| APIApplicationCommandNumberOption;
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure

View File

@@ -97,6 +97,7 @@ export interface APIApplication {
* https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
export const enum ApplicationFlags {
EmbeddedReleased = 1 << 1,
ManagedEmoji = 1 << 2,
GroupDMCreate = 1 << 4,
RPCHasConnected = 1 << 11,
@@ -108,4 +109,5 @@ export const enum ApplicationFlags {
Embedded = 1 << 17,
GatewayMessageContent = 1 << 18,
GatewayMessageContentLimited = 1 << 19,
EmbeddedFirstParty = 1 << 20,
}

View File

@@ -320,7 +320,8 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyGuildId
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeyLocation;
| APIAuditLogChangeKeyLocation
| APIAuditLogChangeKeyCommunicationDisabledUntil;
/**
* Returned when an entity's name is changed
@@ -644,6 +645,11 @@ export type APIAuditLogChangeKeyStatus = AuditLogChangeData<'status', GuildSched
*/
export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string>;
/**
* Returned when a user's timeout is changed
*/
export type APIAuditLogChangeKeyCommunicationDisabledUntil = AuditLogChangeData<'communication_disabled_until', string>;
interface AuditLogChangeData<K extends string, D> {
key: K;
/**

View File

@@ -2,7 +2,7 @@ import type { APIUser } from './user';
import type { APIGuildMember } from './guild';
import type { Snowflake } from '../../globals';
export interface APIGuildScheduledEvent {
interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType> {
/**
* The id of the guild event
*/
@@ -46,7 +46,7 @@ export interface APIGuildScheduledEvent {
/**
* The type of hosting entity associated with the scheduled event
*/
entity_type: GuildScheduledEventEntityType;
entity_type: Type;
/**
* The id of the hosting entity associated with the scheduled event
*/
@@ -54,7 +54,7 @@ export interface APIGuildScheduledEvent {
/**
* The entity metadata for the scheduled event
*/
entity_metadata: APIGuildScheduledEventEntityMetadata;
entity_metadata: APIGuildScheduledEventEntityMetadata | null;
/**
* The user that created the scheduled event
*/
@@ -65,6 +65,31 @@ export interface APIGuildScheduledEvent {
user_count?: number;
}
export interface APIStageInstanceGuildScheduledEvent
extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.StageInstance> {
channel_id: Snowflake;
entity_metadata: null;
}
export interface APIVoiceGuildScheduledEvent extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.Voice> {
channel_id: Snowflake;
entity_metadata: null;
}
export interface APIExternalGuildScheduledEvent
extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.External> {
channel_id: null;
entity_metadata: Required<APIGuildScheduledEventEntityMetadata>;
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
*/
export type APIGuildScheduledEvent =
| APIStageInstanceGuildScheduledEvent
| APIVoiceGuildScheduledEvent
| APIExternalGuildScheduledEvent;
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
*/

View File

@@ -5,7 +5,7 @@ import type {
} from './base';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared';
export interface APIApplicationCommandIntegerOptionBase
interface APIApplicationCommandIntegerOptionBase
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Integer> {
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.

View File

@@ -5,7 +5,7 @@ import type {
} from './base';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared';
export interface APIApplicationCommandNumberOptionBase
interface APIApplicationCommandNumberOptionBase
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Number> {
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.

View File

@@ -14,7 +14,7 @@ import type {
APIApplicationCommandInteractionDataStringOption,
} from './_chatInput/string';
import type {
APIApplicationCommandIntegerOptionBase,
APIApplicationCommandIntegerOption,
APIApplicationCommandInteractionDataIntegerOption,
} from './_chatInput/integer';
import type {
@@ -38,7 +38,7 @@ import type {
APIApplicationCommandInteractionDataMentionableOption,
} from './_chatInput/mentionable';
import type {
APIApplicationCommandNumberOptionBase,
APIApplicationCommandNumberOption,
APIApplicationCommandInteractionDataNumberOption,
} from './_chatInput/number';
import type {
@@ -67,13 +67,13 @@ export * from './_chatInput/shared';
*/
export type APIApplicationCommandBasicOption =
| APIApplicationCommandStringOption
| APIApplicationCommandIntegerOptionBase
| APIApplicationCommandIntegerOption
| APIApplicationCommandBooleanOption
| APIApplicationCommandUserOption
| APIApplicationCommandChannelOption
| APIApplicationCommandRoleOption
| APIApplicationCommandMentionableOption
| APIApplicationCommandNumberOptionBase;
| APIApplicationCommandNumberOption;
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure

View File

@@ -97,6 +97,7 @@ export interface APIApplication {
* https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
export const enum ApplicationFlags {
EmbeddedReleased = 1 << 1,
ManagedEmoji = 1 << 2,
GroupDMCreate = 1 << 4,
RPCHasConnected = 1 << 11,
@@ -108,4 +109,5 @@ export const enum ApplicationFlags {
Embedded = 1 << 17,
GatewayMessageContent = 1 << 18,
GatewayMessageContentLimited = 1 << 19,
EmbeddedFirstParty = 1 << 20,
}

View File

@@ -336,7 +336,8 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeyLocation;
| APIAuditLogChangeKeyLocation
| APIAuditLogChangeKeyCommunicationDisabledUntil;
/**
* Returned when an entity's name is changed
@@ -683,6 +684,11 @@ export type APIAuditLogChangeKeyStatus = AuditLogChangeData<'status', GuildSched
*/
export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string>;
/**
* Returned when a user's timeout is changed
*/
export type APIAuditLogChangeKeyCommunicationDisabledUntil = AuditLogChangeData<'communication_disabled_until', string>;
interface AuditLogChangeData<K extends string, D> {
key: K;
/**

View File

@@ -2,7 +2,7 @@ import type { APIUser } from './user';
import type { APIGuildMember } from './guild';
import type { Snowflake } from '../../globals';
export interface APIGuildScheduledEvent {
interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType> {
/**
* The id of the guild event
*/
@@ -46,7 +46,7 @@ export interface APIGuildScheduledEvent {
/**
* The type of hosting entity associated with the scheduled event
*/
entity_type: GuildScheduledEventEntityType;
entity_type: Type;
/**
* The id of the hosting entity associated with the scheduled event
*/
@@ -54,7 +54,7 @@ export interface APIGuildScheduledEvent {
/**
* The entity metadata for the scheduled event
*/
entity_metadata: APIGuildScheduledEventEntityMetadata;
entity_metadata: APIGuildScheduledEventEntityMetadata | null;
/**
* The user that created the scheduled event
*/
@@ -65,6 +65,31 @@ export interface APIGuildScheduledEvent {
user_count?: number;
}
export interface APIStageInstanceGuildScheduledEvent
extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.StageInstance> {
channel_id: Snowflake;
entity_metadata: null;
}
export interface APIVoiceGuildScheduledEvent extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.Voice> {
channel_id: Snowflake;
entity_metadata: null;
}
export interface APIExternalGuildScheduledEvent
extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.External> {
channel_id: null;
entity_metadata: Required<APIGuildScheduledEventEntityMetadata>;
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
*/
export type APIGuildScheduledEvent =
| APIStageInstanceGuildScheduledEvent
| APIVoiceGuildScheduledEvent
| APIExternalGuildScheduledEvent;
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
*/