From 23f87a8ff2939927101cb51c8da7ed038422f246 Mon Sep 17 00:00:00 2001 From: Vlad Frangu Date: Mon, 4 Mar 2024 21:29:45 +0200 Subject: [PATCH] chore: fix rimraf and build script --- .../index.ts | 0 .../tsconfig.json | 0 .eslintrc.json | 3 +- .gitignore | 6 +- deno/gateway/common.ts | 2 +- deno/gateway/v10.ts | 64 ++++----- deno/gateway/v6.ts | 40 +++--- deno/gateway/v8.ts | 34 ++--- deno/gateway/v9.ts | 62 ++++----- deno/payloads/v10/auditLog.ts | 130 +++++++++--------- deno/payloads/v10/channel.ts | 60 ++++---- deno/payloads/v10/gateway.ts | 6 +- deno/payloads/v10/guild.ts | 4 +- deno/payloads/v10/guildScheduledEvent.ts | 4 +- deno/payloads/v10/interactions.ts | 10 +- deno/payloads/v10/invite.ts | 12 +- deno/payloads/v10/sticker.ts | 2 +- deno/payloads/v10/user.ts | 2 +- deno/payloads/v6/auditLog.ts | 84 +++++------ deno/payloads/v6/channel.ts | 2 +- deno/payloads/v6/gateway.ts | 4 +- deno/payloads/v8/auditLog.ts | 114 +++++++-------- deno/payloads/v8/channel.ts | 28 ++-- deno/payloads/v8/gateway.ts | 6 +- deno/payloads/v8/guild.ts | 2 +- deno/payloads/v8/guildScheduledEvent.ts | 4 +- deno/payloads/v8/interactions.ts | 10 +- deno/payloads/v8/invite.ts | 12 +- deno/payloads/v8/sticker.ts | 2 +- deno/payloads/v9/auditLog.ts | 130 +++++++++--------- deno/payloads/v9/channel.ts | 60 ++++---- deno/payloads/v9/gateway.ts | 6 +- deno/payloads/v9/guild.ts | 4 +- deno/payloads/v9/guildScheduledEvent.ts | 4 +- deno/payloads/v9/interactions.ts | 10 +- deno/payloads/v9/invite.ts | 12 +- deno/payloads/v9/sticker.ts | 2 +- deno/payloads/v9/user.ts | 2 +- deno/rest/v10/application.ts | 22 +-- deno/rest/v10/channel.ts | 20 +-- deno/rest/v10/guild.ts | 50 +++---- deno/rest/v10/interactions.ts | 24 ++-- deno/rest/v10/mod.ts | 34 ++--- deno/rest/v10/monetization.ts | 2 +- deno/rest/v10/oauth2.ts | 4 +- deno/rest/v10/user.ts | 2 +- deno/rest/v10/webhook.ts | 14 +- deno/rest/v6/guild.ts | 4 +- deno/rest/v8/channel.ts | 24 ++-- deno/rest/v8/guild.ts | 6 +- deno/rest/v8/interactions.ts | 16 +-- deno/rest/v8/mod.ts | 2 +- deno/rest/v8/oauth2.ts | 4 +- deno/rest/v8/webhook.ts | 18 +-- deno/rest/v9/application.ts | 22 +-- deno/rest/v9/channel.ts | 20 +-- deno/rest/v9/guild.ts | 50 +++---- deno/rest/v9/interactions.ts | 24 ++-- deno/rest/v9/mod.ts | 36 ++--- deno/rest/v9/monetization.ts | 2 +- deno/rest/v9/oauth2.ts | 4 +- deno/rest/v9/user.ts | 2 +- deno/rest/v9/webhook.ts | 14 +- gateway/common.ts | 2 +- gateway/v10.ts | 64 ++++----- gateway/v6.ts | 40 +++--- gateway/v8.ts | 34 ++--- gateway/v9.ts | 62 ++++----- package.json | 4 +- payloads/v10/auditLog.ts | 130 +++++++++--------- payloads/v10/channel.ts | 60 ++++---- payloads/v10/gateway.ts | 6 +- payloads/v10/guild.ts | 4 +- payloads/v10/guildScheduledEvent.ts | 4 +- payloads/v10/interactions.ts | 10 +- payloads/v10/invite.ts | 12 +- payloads/v10/sticker.ts | 2 +- payloads/v10/user.ts | 2 +- payloads/v6/auditLog.ts | 84 +++++------ payloads/v6/channel.ts | 2 +- payloads/v6/gateway.ts | 4 +- payloads/v8/auditLog.ts | 114 +++++++-------- payloads/v8/channel.ts | 28 ++-- payloads/v8/gateway.ts | 6 +- payloads/v8/guild.ts | 2 +- payloads/v8/guildScheduledEvent.ts | 4 +- payloads/v8/interactions.ts | 10 +- payloads/v8/invite.ts | 12 +- payloads/v8/sticker.ts | 2 +- payloads/v9/auditLog.ts | 130 +++++++++--------- payloads/v9/channel.ts | 60 ++++---- payloads/v9/gateway.ts | 6 +- payloads/v9/guild.ts | 4 +- payloads/v9/guildScheduledEvent.ts | 4 +- payloads/v9/interactions.ts | 10 +- payloads/v9/invite.ts | 12 +- payloads/v9/sticker.ts | 2 +- payloads/v9/user.ts | 2 +- rest/v10/application.ts | 22 +-- rest/v10/channel.ts | 20 +-- rest/v10/guild.ts | 50 +++---- rest/v10/index.ts | 34 ++--- rest/v10/interactions.ts | 24 ++-- rest/v10/monetization.ts | 2 +- rest/v10/oauth2.ts | 4 +- rest/v10/user.ts | 2 +- rest/v10/webhook.ts | 14 +- rest/v6/guild.ts | 4 +- rest/v8/channel.ts | 24 ++-- rest/v8/guild.ts | 6 +- rest/v8/index.ts | 2 +- rest/v8/interactions.ts | 16 +-- rest/v8/oauth2.ts | 4 +- rest/v8/webhook.ts | 18 +-- rest/v9/application.ts | 22 +-- rest/v9/channel.ts | 20 +-- rest/v9/guild.ts | 50 +++---- rest/v9/index.ts | 36 ++--- rest/v9/interactions.ts | 24 ++-- rest/v9/monetization.ts | 2 +- rest/v9/oauth2.ts | 4 +- rest/v9/user.ts | 2 +- rest/v9/webhook.ts | 14 +- scripts/actions/create-release.mjs | 1 + website/{.prettierrc.js => .prettierrc.mjs} | 4 +- .../Common/LoadingSkeleton.module.css | 40 +++++- 126 files changed, 1401 insertions(+), 1357 deletions(-) rename {.eslintplugin => .eslint-plugin-local}/index.ts (100%) rename {.eslintplugin => .eslint-plugin-local}/tsconfig.json (100%) rename website/{.prettierrc.js => .prettierrc.mjs} (74%) diff --git a/.eslintplugin/index.ts b/.eslint-plugin-local/index.ts similarity index 100% rename from .eslintplugin/index.ts rename to .eslint-plugin-local/index.ts diff --git a/.eslintplugin/tsconfig.json b/.eslint-plugin-local/tsconfig.json similarity index 100% rename from .eslintplugin/tsconfig.json rename to .eslint-plugin-local/tsconfig.json diff --git a/.eslintrc.json b/.eslintrc.json index 39a3ee24..ab5a35e9 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -15,6 +15,7 @@ "tsdoc/syntax": "off", "typescript-sort-keys/interface": "off", "typescript-sort-keys/string-enum": "off", - "unicorn/prefer-math-trunc": "off" + "unicorn/prefer-math-trunc": "off", + "jsdoc/no-undefined-types": "off" } } diff --git a/.gitignore b/.gitignore index 1e7a273f..fd9e2f8b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,9 @@ node_modules/ # Custom ESLint rules -.eslintplugin/* -!.eslintplugin/index.ts -!.eslintplugin/tsconfig.json +.eslint-plugin-local/* +!.eslint-plugin-local/index.ts +!.eslint-plugin-local/tsconfig.json # Don't commit build outputs globals.js diff --git a/deno/gateway/common.ts b/deno/gateway/common.ts index 13405d89..a2181d68 100644 --- a/deno/gateway/common.ts +++ b/deno/gateway/common.ts @@ -3,6 +3,6 @@ */ export interface GatewayURLQuery { v: string; - encoding: 'json' | 'etf'; + encoding: 'etf' | 'json'; compress?: 'zlib-stream'; } diff --git a/deno/gateway/v10.ts b/deno/gateway/v10.ts index 73b5b035..c4e3eb65 100644 --- a/deno/gateway/v10.ts +++ b/deno/gateway/v10.ts @@ -278,27 +278,29 @@ export enum GatewayDispatchEvents { export type GatewaySendPayload = | GatewayHeartbeat | GatewayIdentify - | GatewayUpdatePresence - | GatewayVoiceStateUpdate + | GatewayRequestGuildMembers | GatewayResume - | GatewayRequestGuildMembers; + | GatewayUpdatePresence + | GatewayVoiceStateUpdate; export type GatewayReceivePayload = - | GatewayHello - | GatewayHeartbeatRequest + | GatewayDispatchPayload | GatewayHeartbeatAck + | GatewayHeartbeatRequest + | GatewayHello | GatewayInvalidSession - | GatewayReconnect - | GatewayDispatchPayload; + | GatewayReconnect; export type GatewayDispatchPayload = - | GatewayAutoModerationRuleModifyDispatch + | GatewayApplicationCommandPermissionsUpdateDispatch + | GatewayAutoModerationActionExecutionDispatch | GatewayAutoModerationRuleCreateDispatch | GatewayAutoModerationRuleDeleteDispatch - | GatewayAutoModerationActionExecutionDispatch - | GatewayApplicationCommandPermissionsUpdateDispatch + | GatewayAutoModerationRuleModifyDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch + | GatewayEntitlementModifyDispatch + | GatewayGuildAuditLogEntryCreateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildCreateDispatch | GatewayGuildDeleteDispatch @@ -312,8 +314,8 @@ export type GatewayDispatchPayload = | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch - | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventDeleteDispatch + | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildStickersUpdateDispatch @@ -332,24 +334,22 @@ export type GatewayDispatchPayload = | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch + | GatewayReadyDispatch + | GatewayResumedDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch - | GatewayReadyDispatch - | GatewayResumedDispatch + | GatewayThreadCreateDispatch + | GatewayThreadDeleteDispatch | GatewayThreadListSyncDispatch | GatewayThreadMembersUpdateDispatch | GatewayThreadMemberUpdateDispatch - | GatewayThreadCreateDispatch | GatewayThreadUpdateDispatch - | GatewayThreadDeleteDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch - | GatewayWebhooksUpdateDispatch - | GatewayGuildAuditLogEntryCreateDispatch - | GatewayEntitlementModifyDispatch; + | GatewayWebhooksUpdateDispatch; // #region Dispatch Payloads @@ -454,7 +454,7 @@ export interface GatewayReadyDispatchData { * * See https://discord.com/developers/docs/resources/application#application-object */ - application: Pick; + application: Pick; } /** @@ -469,8 +469,8 @@ export type GatewayResumedDispatch = DataPayload; @@ -694,8 +694,8 @@ export type GatewayEntitlementModifyDispatchData = APIEntitlement; */ export type GatewayEntitlementModifyDispatch = DataPayload< | GatewayDispatchEvents.EntitlementCreate - | GatewayDispatchEvents.EntitlementUpdate - | GatewayDispatchEvents.EntitlementDelete, + | GatewayDispatchEvents.EntitlementDelete + | GatewayDispatchEvents.EntitlementUpdate, GatewayEntitlementModifyDispatchData >; @@ -1014,10 +1014,10 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway-events#guild-member-update */ -export type GatewayGuildMemberUpdateDispatchData = Omit & +export type GatewayGuildMemberUpdateDispatchData = Nullable> & + Omit & Partial> & - Required> & - Nullable> & { + Required> & { /** * The id of the guild */ @@ -1362,7 +1362,7 @@ export type GatewayMessageCreateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway-events#message-create */ -export type GatewayMessageCreateDispatchData = Omit & GatewayMessageEventExtraFields; +export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit; /** * https://discord.com/developers/docs/topics/gateway-events#message-update @@ -1375,8 +1375,8 @@ export type GatewayMessageUpdateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway-events#message-update */ -export type GatewayMessageUpdateDispatchData = Omit, 'mentions'> & - GatewayMessageEventExtraFields & { +export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & + Omit, 'mentions'> & { /** * ID of the message */ @@ -1979,8 +1979,8 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG * https://discord.com/developers/docs/topics/gateway-events#request-guild-members */ export type GatewayRequestGuildMembersData = - | GatewayRequestGuildMembersDataWithUserIds - | GatewayRequestGuildMembersDataWithQuery; + | GatewayRequestGuildMembersDataWithQuery + | GatewayRequestGuildMembersDataWithUserIds; /** * https://discord.com/developers/docs/topics/gateway-events#update-voice-state @@ -2073,7 +2073,7 @@ interface BasePayload { t?: string; } -type NonDispatchPayload = Omit & { +type NonDispatchPayload = Omit & { t: null; s: null; }; diff --git a/deno/gateway/v6.ts b/deno/gateway/v6.ts index 619f8778..35fff739 100644 --- a/deno/gateway/v6.ts +++ b/deno/gateway/v6.ts @@ -184,56 +184,56 @@ export enum GatewayDispatchEvents { export type GatewaySendPayload = | GatewayHeartbeat | GatewayIdentify - | GatewayUpdatePresence - | GatewayVoiceStateUpdate + | GatewayRequestGuildMembers | GatewayResume - | GatewayRequestGuildMembers; + | GatewayUpdatePresence + | GatewayVoiceStateUpdate; /** * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. */ export type GatewayReceivePayload = - | GatewayHello - | GatewayHeartbeatRequest + | GatewayDispatchPayload | GatewayHeartbeatAck + | GatewayHeartbeatRequest + | GatewayHello | GatewayInvalidSession - | GatewayReconnect - | GatewayDispatchPayload; + | GatewayReconnect; /** * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. */ export type GatewayDispatchPayload = - | GatewayReadyDispatch - | GatewayResumedDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch - | GatewayGuildModifyDispatch - | GatewayGuildDeleteDispatch | GatewayGuildBanModifyDispatch + | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch - | GatewayGuildMemberUpdateDispatch | GatewayGuildMembersChunkDispatch - | GatewayGuildRoleModifyDispatch + | GatewayGuildMemberUpdateDispatch + | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch + | GatewayGuildRoleModifyDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch - | GatewayMessageUpdateDispatch - | GatewayMessageDeleteDispatch | GatewayMessageDeleteBulkDispatch + | GatewayMessageDeleteDispatch | GatewayMessageReactionAddDispatch - | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveAllDispatch + | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch + | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch + | GatewayReadyDispatch + | GatewayResumedDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch - | GatewayVoiceStateUpdateDispatch | GatewayVoiceServerUpdateDispatch + | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch; // #region Dispatch Payloads @@ -571,7 +571,7 @@ export type GatewayMessageCreateDispatch = DataPayload + Partial & { id: string; channel_id: string } >; /** @@ -768,11 +768,11 @@ export interface GatewayResume { export interface GatewayRequestGuildMembers { op: GatewayOPCodes.RequestGuildMembers; d: { - guild_id: string | string[]; + guild_id: string[] | string; query?: string; limit: number; presences?: boolean; - user_ids?: string | string[]; + user_ids?: string[] | string; nonce?: string; }; } diff --git a/deno/gateway/v8.ts b/deno/gateway/v8.ts index 1f008143..da40e6bf 100644 --- a/deno/gateway/v8.ts +++ b/deno/gateway/v8.ts @@ -258,21 +258,21 @@ export enum GatewayDispatchEvents { export type GatewaySendPayload = | GatewayHeartbeat | GatewayIdentify - | GatewayUpdatePresence - | GatewayVoiceStateUpdate + | GatewayRequestGuildMembers | GatewayResume - | GatewayRequestGuildMembers; + | GatewayUpdatePresence + | GatewayVoiceStateUpdate; /** * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type GatewayReceivePayload = - | GatewayHello - | GatewayHeartbeatRequest + | GatewayDispatchPayload | GatewayHeartbeatAck + | GatewayHeartbeatRequest + | GatewayHello | GatewayInvalidSession - | GatewayReconnect - | GatewayDispatchPayload; + | GatewayReconnect; /** * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. @@ -292,8 +292,8 @@ export type GatewayDispatchPayload = | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch - | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventDeleteDispatch + | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildStickersUpdateDispatch @@ -312,11 +312,11 @@ export type GatewayDispatchPayload = | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch + | GatewayReadyDispatch + | GatewayResumedDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch - | GatewayReadyDispatch - | GatewayResumedDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch @@ -440,7 +440,7 @@ export interface GatewayReadyDispatchData { * * See https://discord.com/developers/docs/resources/application#application-object */ - application: Pick; + application: Pick; } /** @@ -805,10 +805,10 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload< * * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type GatewayGuildMemberUpdateDispatchData = Omit & +export type GatewayGuildMemberUpdateDispatchData = Nullable> & + Omit & Partial> & - Required> & - Nullable> & { + Required> & { /** * The id of the guild */ @@ -1243,10 +1243,10 @@ export type GatewayMessageUpdateDispatch = DataPayload< * * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type GatewayMessageUpdateDispatchData = { +export type GatewayMessageUpdateDispatchData = Partial & { id: Snowflake; channel_id: Snowflake; -} & Partial; +}; /** * https://discord.com/developers/docs/topics/gateway#message-delete @@ -1849,7 +1849,7 @@ interface BasePayload { t?: string; } -type NonDispatchPayload = Omit & { +type NonDispatchPayload = Omit & { t: null; s: null; }; diff --git a/deno/gateway/v9.ts b/deno/gateway/v9.ts index 2ad370bf..b13baa24 100644 --- a/deno/gateway/v9.ts +++ b/deno/gateway/v9.ts @@ -277,27 +277,29 @@ export enum GatewayDispatchEvents { export type GatewaySendPayload = | GatewayHeartbeat | GatewayIdentify - | GatewayUpdatePresence - | GatewayVoiceStateUpdate + | GatewayRequestGuildMembers | GatewayResume - | GatewayRequestGuildMembers; + | GatewayUpdatePresence + | GatewayVoiceStateUpdate; export type GatewayReceivePayload = - | GatewayHello - | GatewayHeartbeatRequest + | GatewayDispatchPayload | GatewayHeartbeatAck + | GatewayHeartbeatRequest + | GatewayHello | GatewayInvalidSession - | GatewayReconnect - | GatewayDispatchPayload; + | GatewayReconnect; export type GatewayDispatchPayload = | GatewayApplicationCommandPermissionsUpdateDispatch - | GatewayAutoModerationRuleModifyDispatch + | GatewayAutoModerationActionExecutionDispatch | GatewayAutoModerationRuleCreateDispatch | GatewayAutoModerationRuleDeleteDispatch - | GatewayAutoModerationActionExecutionDispatch + | GatewayAutoModerationRuleModifyDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch + | GatewayEntitlementModifyDispatch + | GatewayGuildAuditLogEntryCreateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildCreateDispatch | GatewayGuildDeleteDispatch @@ -311,8 +313,8 @@ export type GatewayDispatchPayload = | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch - | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventDeleteDispatch + | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildStickersUpdateDispatch @@ -331,24 +333,22 @@ export type GatewayDispatchPayload = | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch + | GatewayReadyDispatch + | GatewayResumedDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch - | GatewayReadyDispatch - | GatewayResumedDispatch + | GatewayThreadCreateDispatch + | GatewayThreadDeleteDispatch | GatewayThreadListSyncDispatch | GatewayThreadMembersUpdateDispatch | GatewayThreadMemberUpdateDispatch - | GatewayThreadCreateDispatch | GatewayThreadUpdateDispatch - | GatewayThreadDeleteDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch - | GatewayWebhooksUpdateDispatch - | GatewayGuildAuditLogEntryCreateDispatch - | GatewayEntitlementModifyDispatch; + | GatewayWebhooksUpdateDispatch; // #region Dispatch Payloads @@ -453,7 +453,7 @@ export interface GatewayReadyDispatchData { * * See https://discord.com/developers/docs/resources/application#application-object */ - application: Pick; + application: Pick; } /** @@ -468,8 +468,8 @@ export type GatewayResumedDispatch = DataPayload; @@ -693,8 +693,8 @@ export type GatewayEntitlementModifyDispatchData = APIEntitlement; */ export type GatewayEntitlementModifyDispatch = DataPayload< | GatewayDispatchEvents.EntitlementCreate - | GatewayDispatchEvents.EntitlementUpdate - | GatewayDispatchEvents.EntitlementDelete, + | GatewayDispatchEvents.EntitlementDelete + | GatewayDispatchEvents.EntitlementUpdate, GatewayEntitlementModifyDispatchData >; @@ -1013,10 +1013,10 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway-events#guild-member-update */ -export type GatewayGuildMemberUpdateDispatchData = Omit & +export type GatewayGuildMemberUpdateDispatchData = Nullable> & + Omit & Partial> & - Required> & - Nullable> & { + Required> & { /** * The id of the guild */ @@ -1361,7 +1361,7 @@ export type GatewayMessageCreateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway-events#message-create */ -export type GatewayMessageCreateDispatchData = Omit & GatewayMessageEventExtraFields; +export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit; /** * https://discord.com/developers/docs/topics/gateway-events#message-update @@ -1374,8 +1374,8 @@ export type GatewayMessageUpdateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway-events#message-update */ -export type GatewayMessageUpdateDispatchData = Omit, 'mentions'> & - GatewayMessageEventExtraFields & { +export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & + Omit, 'mentions'> & { /** * ID of the message */ @@ -1978,8 +1978,8 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG * https://discord.com/developers/docs/topics/gateway-events#request-guild-members */ export type GatewayRequestGuildMembersData = - | GatewayRequestGuildMembersDataWithUserIds - | GatewayRequestGuildMembersDataWithQuery; + | GatewayRequestGuildMembersDataWithQuery + | GatewayRequestGuildMembersDataWithUserIds; /** * https://discord.com/developers/docs/topics/gateway-events#update-voice-state @@ -2072,7 +2072,7 @@ interface BasePayload { t?: string; } -type NonDispatchPayload = Omit & { +type NonDispatchPayload = Omit & { t: null; s: null; }; diff --git a/deno/payloads/v10/auditLog.ts b/deno/payloads/v10/auditLog.ts index 62f31ea8..7a4ad440 100644 --- a/deno/payloads/v10/auditLog.ts +++ b/deno/payloads/v10/auditLog.ts @@ -335,82 +335,82 @@ export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`; * https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */ export type APIAuditLogChange = - | APIAuditLogChangeKeyName - | APIAuditLogChangeKeyDescription - | APIAuditLogChangeKeyIconHash - | APIAuditLogChangeKeyImageHash - | APIAuditLogChangeKeySplashHash - | APIAuditLogChangeKeyDiscoverySplashHash - | APIAuditLogChangeKeyBannerHash - | APIAuditLogChangeKeyOwnerId - | APIAuditLogChangeKeyRegion - | APIAuditLogChangeKeyPreferredLocale - | APIAuditLogChangeKeyAFKChannelId - | APIAuditLogChangeKeyAFKTimeout - | APIAuditLogChangeKeyRulesChannelId - | APIAuditLogChangeKeyPublicUpdatesChannelId - | APIAuditLogChangeKeyMFALevel - | APIAuditLogChangeKeyVerificationLevel - | APIAuditLogChangeKeyExplicitContentFilter - | APIAuditLogChangeKeyDefaultMessageNotifications - | APIAuditLogChangeKeyVanityURLCode | APIAuditLogChangeKey$Add | APIAuditLogChangeKey$Remove - | APIAuditLogChangeKeyPruneDeleteDays - | APIAuditLogChangeKeyWidgetEnabled - | APIAuditLogChangeKeyWidgetChannelId - | APIAuditLogChangeKeySystemChannelId - | APIAuditLogChangeKeyPosition - | APIAuditLogChangeKeyTopic - | APIAuditLogChangeKeyBitrate - | APIAuditLogChangeKeyPermissionOverwrites - | APIAuditLogChangeKeyNSFW - | APIAuditLogChangeKeyApplicationId - | APIAuditLogChangeKeyRateLimitPerUser - | APIAuditLogChangeKeyPermissions - | APIAuditLogChangeKeyColor - | APIAuditLogChangeKeyHoist - | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyActions + | APIAuditLogChangeKeyAFKChannelId + | APIAuditLogChangeKeyAFKTimeout | APIAuditLogChangeKeyAllow - | APIAuditLogChangeKeyDeny - | APIAuditLogChangeKeyCode - | APIAuditLogChangeKeyChannelId - | APIAuditLogChangeKeyInviterId - | APIAuditLogChangeKeyMaxUses - | APIAuditLogChangeKeyUses - | APIAuditLogChangeKeyMaxAge - | APIAuditLogChangeKeyTemporary - | APIAuditLogChangeKeyDeaf - | APIAuditLogChangeKeyMute - | APIAuditLogChangeKeyNick + | APIAuditLogChangeKeyApplicationId + | APIAuditLogChangeKeyArchived + | APIAuditLogChangeKeyAsset + | APIAuditLogChangeKeyAutoArchiveDuration + | APIAuditLogChangeKeyAvailable | APIAuditLogChangeKeyAvatarHash - | APIAuditLogChangeKeyId - | APIAuditLogChangeKeyType + | APIAuditLogChangeKeyBannerHash + | APIAuditLogChangeKeyBitrate + | APIAuditLogChangeKeyChannelId + | APIAuditLogChangeKeyCode + | APIAuditLogChangeKeyColor + | APIAuditLogChangeKeyCommunicationDisabledUntil + | APIAuditLogChangeKeyDeaf + | APIAuditLogChangeKeyDefaultAutoArchiveDuration + | APIAuditLogChangeKeyDefaultMessageNotifications + | APIAuditLogChangeKeyDeny + | APIAuditLogChangeKeyDescription + | APIAuditLogChangeKeyDiscoverySplashHash + | APIAuditLogChangeKeyEnabled | APIAuditLogChangeKeyEnableEmoticons + | APIAuditLogChangeKeyEntityType + | APIAuditLogChangeKeyEventType + | APIAuditLogChangeKeyExemptChannels + | APIAuditLogChangeKeyExemptRoles | APIAuditLogChangeKeyExpireBehavior | APIAuditLogChangeKeyExpireGracePeriod - | APIAuditLogChangeKeyUserLimit - | APIAuditLogChangeKeyPrivacyLevel - | APIAuditLogChangeKeyTags + | APIAuditLogChangeKeyExplicitContentFilter | APIAuditLogChangeKeyFormatType - | APIAuditLogChangeKeyAsset - | APIAuditLogChangeKeyAvailable | APIAuditLogChangeKeyGuildId - | APIAuditLogChangeKeyArchived - | APIAuditLogChangeKeyLocked - | APIAuditLogChangeKeyAutoArchiveDuration - | APIAuditLogChangeKeyDefaultAutoArchiveDuration - | APIAuditLogChangeKeyEntityType - | APIAuditLogChangeKeyStatus + | APIAuditLogChangeKeyHoist + | APIAuditLogChangeKeyIconHash + | APIAuditLogChangeKeyId + | APIAuditLogChangeKeyImageHash + | APIAuditLogChangeKeyInviterId | APIAuditLogChangeKeyLocation - | APIAuditLogChangeKeyCommunicationDisabledUntil - | APIAuditLogChangeKeyTriggerType - | APIAuditLogChangeKeyEventType + | APIAuditLogChangeKeyLocked + | APIAuditLogChangeKeyMaxAge + | APIAuditLogChangeKeyMaxUses + | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyMFALevel + | APIAuditLogChangeKeyMute + | APIAuditLogChangeKeyName + | APIAuditLogChangeKeyNick + | APIAuditLogChangeKeyNSFW + | APIAuditLogChangeKeyOwnerId + | APIAuditLogChangeKeyPermissionOverwrites + | APIAuditLogChangeKeyPermissions + | APIAuditLogChangeKeyPosition + | APIAuditLogChangeKeyPreferredLocale + | APIAuditLogChangeKeyPrivacyLevel + | APIAuditLogChangeKeyPruneDeleteDays + | APIAuditLogChangeKeyPublicUpdatesChannelId + | APIAuditLogChangeKeyRateLimitPerUser + | APIAuditLogChangeKeyRegion + | APIAuditLogChangeKeyRulesChannelId + | APIAuditLogChangeKeySplashHash + | APIAuditLogChangeKeyStatus + | APIAuditLogChangeKeySystemChannelId + | APIAuditLogChangeKeyTags + | APIAuditLogChangeKeyTemporary + | APIAuditLogChangeKeyTopic | APIAuditLogChangeKeyTriggerMetadata - | APIAuditLogChangeKeyActions - | APIAuditLogChangeKeyEnabled - | APIAuditLogChangeKeyExemptRoles - | APIAuditLogChangeKeyExemptChannels; + | APIAuditLogChangeKeyTriggerType + | APIAuditLogChangeKeyType + | APIAuditLogChangeKeyUserLimit + | APIAuditLogChangeKeyUses + | APIAuditLogChangeKeyVanityURLCode + | APIAuditLogChangeKeyVerificationLevel + | APIAuditLogChangeKeyWidgetChannelId + | APIAuditLogChangeKeyWidgetEnabled; /** * Returned when an entity's name is changed diff --git a/deno/payloads/v10/channel.ts b/deno/payloads/v10/channel.ts index dc969d7f..a30379b0 100644 --- a/deno/payloads/v10/channel.ts +++ b/deno/payloads/v10/channel.ts @@ -41,15 +41,15 @@ export interface APIChannelBase extends APIPartialChannel } export type TextChannelType = + | ChannelType.AnnouncementThread | ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildAnnouncement - | ChannelType.PublicThread - | ChannelType.PrivateThread - | ChannelType.AnnouncementThread + | ChannelType.GuildStageVoice | ChannelType.GuildText | ChannelType.GuildVoice - | ChannelType.GuildStageVoice; + | ChannelType.PrivateThread + | ChannelType.PublicThread; export type GuildChannelType = Exclude; @@ -110,7 +110,7 @@ export interface APIGuildChannel extends Omit; -export interface APIGuildTextChannel +export interface APIGuildTextChannel extends Omit, 'name'>, APIGuildChannel { /** @@ -134,7 +134,7 @@ export type APIGuildCategoryChannel = APIGuildChannel export interface APIVoiceChannelBase extends APIGuildChannel, - Omit, 'name' | 'last_pin_timestamp'> { + Omit, 'last_pin_timestamp' | 'name'> { /** * The bitrate (in bits) of the voice or stage channel */ @@ -204,7 +204,7 @@ export interface APIGroupDMChannel extends Omit, 'name'>, @@ -373,16 +373,16 @@ export type APIGuildMediaChannel = APIThreadOnlyChannel; * https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */ export type APIChannel = - | APIGroupDMChannel | APIDMChannel - | APITextChannel - | APINewsChannel - | APIGuildVoiceChannel - | APIGuildStageVoiceChannel + | APIGroupDMChannel | APIGuildCategoryChannel - | APIThreadChannel | APIGuildForumChannel - | APIGuildMediaChannel; + | APIGuildMediaChannel + | APIGuildStageVoiceChannel + | APIGuildVoiceChannel + | APINewsChannel + | APITextChannel + | APIThreadChannel; /** * https://discord.com/developers/docs/resources/channel#channel-object-channel-types @@ -607,7 +607,7 @@ export interface APIMessage { * **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE` * event to ensure it got sent** */ - nonce?: string | number; + nonce?: number | string; /** * Whether this message is pinned */ @@ -1594,7 +1594,7 @@ export interface APIMessageComponentEmoji { export interface APIButtonComponentWithCustomId extends APIButtonComponentBase< - ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger + ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success > { /** * The custom_id to be sent in the interaction when clicked @@ -1635,11 +1635,11 @@ export enum TextInputStyle { */ export interface APIBaseSelectMenuComponent< T extends - | ComponentType.StringSelect - | ComponentType.UserSelect - | ComponentType.RoleSelect + | ComponentType.ChannelSelect | ComponentType.MentionableSelect - | ComponentType.ChannelSelect, + | ComponentType.RoleSelect + | ComponentType.StringSelect + | ComponentType.UserSelect, > extends APIBaseComponent { /** * A developer-defined identifier for the select menu, max 100 characters @@ -1671,10 +1671,10 @@ export interface APIBaseSelectMenuComponent< export interface APIBaseAutoPopulatedSelectMenuComponent< T extends - | ComponentType.UserSelect - | ComponentType.RoleSelect + | ComponentType.ChannelSelect | ComponentType.MentionableSelect - | ComponentType.ChannelSelect, + | ComponentType.RoleSelect + | ComponentType.UserSelect, D extends SelectMenuDefaultValueType, > extends APIBaseSelectMenuComponent { /** @@ -1714,7 +1714,7 @@ export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent< */ export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent< ComponentType.MentionableSelect, - SelectMenuDefaultValueType.User | SelectMenuDefaultValueType.Role + SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User >; /** @@ -1755,11 +1755,11 @@ export type APIAutoPopulatedSelectMenuComponent = * https://discord.com/developers/docs/interactions/message-components#select-menus */ export type APISelectMenuComponent = - | APIStringSelectComponent - | APIUserSelectComponent - | APIRoleSelectComponent + | APIChannelSelectComponent | APIMentionableSelectComponent - | APIChannelSelectComponent; + | APIRoleSelectComponent + | APIStringSelectComponent + | APIUserSelectComponent; /** * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure @@ -1871,8 +1871,8 @@ export enum ChannelFlags { /** * https://discord.com/developers/docs/interactions/message-components#message-components */ -export type APIMessageComponent = APIMessageActionRowComponent | APIActionRowComponent; -export type APIModalComponent = APIModalActionRowComponent | APIActionRowComponent; +export type APIMessageComponent = APIActionRowComponent | APIMessageActionRowComponent; +export type APIModalComponent = APIActionRowComponent | APIModalActionRowComponent; export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent; diff --git a/deno/payloads/v10/gateway.ts b/deno/payloads/v10/gateway.ts index 5e22f98e..9c1eb11f 100644 --- a/deno/payloads/v10/gateway.ts +++ b/deno/payloads/v10/gateway.ts @@ -227,7 +227,7 @@ export interface GatewayActivity { /** * The custom buttons shown in the Rich Presence (max 2) */ - buttons?: string[] | GatewayActivityButton[]; + buttons?: GatewayActivityButton[] | string[]; } /** @@ -292,7 +292,7 @@ export interface GatewayActivityTimestamps { /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji */ -export type GatewayActivityEmoji = Partial> & Pick; +export type GatewayActivityEmoji = Partial> & Pick; /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party @@ -318,7 +318,7 @@ export type GatewayActivityAssets = Partial< /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets */ -export type GatewayActivitySecrets = Partial>; +export type GatewayActivitySecrets = Partial>; /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags diff --git a/deno/payloads/v10/guild.ts b/deno/payloads/v10/guild.ts index e23bc156..77d7210b 100644 --- a/deno/payloads/v10/guild.ts +++ b/deno/payloads/v10/guild.ts @@ -121,7 +121,7 @@ export interface APIGuild extends APIPartialGuild { /** * afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600` */ - afk_timeout: 60 | 300 | 900 | 1_800 | 3_600; + afk_timeout: 1_800 | 3_600 | 60 | 300 | 900; /** * `true` if the guild widget is enabled */ @@ -806,7 +806,7 @@ export interface APIGuildIntegration { scopes?: OAuth2Scopes[]; } -export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription'; +export type APIGuildIntegrationType = 'discord' | 'guild_subscription' | 'twitch' | 'youtube'; /** * https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors diff --git a/deno/payloads/v10/guildScheduledEvent.ts b/deno/payloads/v10/guildScheduledEvent.ts index 4a8babbd..26c0767b 100644 --- a/deno/payloads/v10/guildScheduledEvent.ts +++ b/deno/payloads/v10/guildScheduledEvent.ts @@ -90,9 +90,9 @@ export interface APIExternalGuildScheduledEvent * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure */ export type APIGuildScheduledEvent = + | APIExternalGuildScheduledEvent | APIStageInstanceGuildScheduledEvent - | APIVoiceGuildScheduledEvent - | APIExternalGuildScheduledEvent; + | APIVoiceGuildScheduledEvent; /** * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata diff --git a/deno/payloads/v10/interactions.ts b/deno/payloads/v10/interactions.ts index 822e497d..d5bec3d8 100644 --- a/deno/payloads/v10/interactions.ts +++ b/deno/payloads/v10/interactions.ts @@ -32,26 +32,26 @@ export * from './_interactions/responses.ts'; * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object */ export type APIInteraction = - | APIPingInteraction + | APIApplicationCommandAutocompleteInteraction | APIApplicationCommandInteraction | APIMessageComponentInteraction - | APIApplicationCommandAutocompleteInteraction - | APIModalSubmitInteraction; + | APIModalSubmitInteraction + | APIPingInteraction; /** * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object */ export type APIDMInteraction = + | APIApplicationCommandAutocompleteDMInteraction | APIApplicationCommandDMInteraction | APIMessageComponentDMInteraction - | APIApplicationCommandAutocompleteDMInteraction | APIModalSubmitDMInteraction; /** * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object */ export type APIGuildInteraction = + | APIApplicationCommandAutocompleteGuildInteraction | APIApplicationCommandGuildInteraction | APIMessageComponentGuildInteraction - | APIApplicationCommandAutocompleteGuildInteraction | APIModalSubmitGuildInteraction; diff --git a/deno/payloads/v10/invite.ts b/deno/payloads/v10/invite.ts index 26cea78b..d6423df9 100644 --- a/deno/payloads/v10/invite.ts +++ b/deno/payloads/v10/invite.ts @@ -11,17 +11,17 @@ import type { APIUser } from './user.ts'; export type APIInviteGuild = Pick< APIGuild, - | 'id' - | 'name' - | 'splash' | 'banner' - | 'icon' - | 'vanity_url_code' | 'description' | 'features' - | 'verification_level' + | 'icon' + | 'id' + | 'name' | 'nsfw_level' | 'premium_subscription_count' + | 'splash' + | 'vanity_url_code' + | 'verification_level' >; /** diff --git a/deno/payloads/v10/sticker.ts b/deno/payloads/v10/sticker.ts index a5e5b918..4bcd3636 100644 --- a/deno/payloads/v10/sticker.ts +++ b/deno/payloads/v10/sticker.ts @@ -92,7 +92,7 @@ export enum StickerFormatType { /** * https://discord.com/developers/docs/resources/sticker#sticker-item-object */ -export type APIStickerItem = Pick; +export type APIStickerItem = Pick; /** * https://discord.com/developers/docs/resources/sticker#sticker-pack-object diff --git a/deno/payloads/v10/user.ts b/deno/payloads/v10/user.ts index 9857c627..7056ae6a 100644 --- a/deno/payloads/v10/user.ts +++ b/deno/payloads/v10/user.ts @@ -316,5 +316,5 @@ export interface APIApplicationRoleConnection { /** * Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected */ - metadata: Record; + metadata: Record; } diff --git a/deno/payloads/v6/auditLog.ts b/deno/payloads/v6/auditLog.ts index e94446a6..64070434 100644 --- a/deno/payloads/v6/auditLog.ts +++ b/deno/payloads/v6/auditLog.ts @@ -176,56 +176,56 @@ export enum AuditLogOptionsType { * @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8. */ export type APIAuditLogChange = - | APIAuditLogChangeKeyName - | APIAuditLogChangeKeyIconHash - | APIAuditLogChangeKeySplashHash - | APIAuditLogChangeKeyOwnerID - | APIAuditLogChangeKeyRegion - | APIAuditLogChangeKeyAFKChannelID - | APIAuditLogChangeKeyAFKTimeout - | APIAuditLogChangeKeyMFALevel - | APIAuditLogChangeKeyVerificationLevel - | APIAuditLogChangeKeyExplicitContentFilter - | APIAuditLogChangeKeyDefaultMessageNotifications - | APIAuditLogChangeKeyVanityURLCode | APIAuditLogChangeKey$Add | APIAuditLogChangeKey$Remove - | APIAuditLogChangeKeyPruneDeleteDays - | APIAuditLogChangeKeyWidgetEnabled - | APIAuditLogChangeKeyWidgetChannelID - | APIAuditLogChangeKeySystemChannelID - | APIAuditLogChangeKeyPosition - | APIAuditLogChangeKeyTopic - | APIAuditLogChangeKeyBitrate - | APIAuditLogChangeKeyPermissionOverwrites - | APIAuditLogChangeKeyNSFW - | APIAuditLogChangeKeyApplicationID - | APIAuditLogChangeKeyRateLimitPerUser - | APIAuditLogChangeKeyPermissions - | APIAuditLogChangeKeyPermissionsNew - | APIAuditLogChangeKeyColor - | APIAuditLogChangeKeyHoist - | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyAFKChannelID + | APIAuditLogChangeKeyAFKTimeout | APIAuditLogChangeKeyAllow | APIAuditLogChangeKeyAllowNew + | APIAuditLogChangeKeyApplicationID + | APIAuditLogChangeKeyAvatarHash + | APIAuditLogChangeKeyBitrate + | APIAuditLogChangeKeyChannelID + | APIAuditLogChangeKeyCode + | APIAuditLogChangeKeyColor + | APIAuditLogChangeKeyDeaf + | APIAuditLogChangeKeyDefaultMessageNotifications | APIAuditLogChangeKeyDeny | APIAuditLogChangeKeyDenyNew - | APIAuditLogChangeKeyCode - | APIAuditLogChangeKeyChannelID - | APIAuditLogChangeKeyInviterID - | APIAuditLogChangeKeyMaxUses - | APIAuditLogChangeKeyUses - | APIAuditLogChangeKeyMaxAge - | APIAuditLogChangeKeyTemporary - | APIAuditLogChangeKeyDeaf - | APIAuditLogChangeKeyMute - | APIAuditLogChangeKeyNick - | APIAuditLogChangeKeyAvatarHash - | APIAuditLogChangeKeyID - | APIAuditLogChangeKeyType | APIAuditLogChangeKeyEnableEmoticons | APIAuditLogChangeKeyExpireBehavior - | APIAuditLogChangeKeyExpireGracePeriod; + | APIAuditLogChangeKeyExpireGracePeriod + | APIAuditLogChangeKeyExplicitContentFilter + | APIAuditLogChangeKeyHoist + | APIAuditLogChangeKeyIconHash + | APIAuditLogChangeKeyID + | APIAuditLogChangeKeyInviterID + | APIAuditLogChangeKeyMaxAge + | APIAuditLogChangeKeyMaxUses + | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyMFALevel + | APIAuditLogChangeKeyMute + | APIAuditLogChangeKeyName + | APIAuditLogChangeKeyNick + | APIAuditLogChangeKeyNSFW + | APIAuditLogChangeKeyOwnerID + | APIAuditLogChangeKeyPermissionOverwrites + | APIAuditLogChangeKeyPermissions + | APIAuditLogChangeKeyPermissionsNew + | APIAuditLogChangeKeyPosition + | APIAuditLogChangeKeyPruneDeleteDays + | APIAuditLogChangeKeyRateLimitPerUser + | APIAuditLogChangeKeyRegion + | APIAuditLogChangeKeySplashHash + | APIAuditLogChangeKeySystemChannelID + | APIAuditLogChangeKeyTemporary + | APIAuditLogChangeKeyTopic + | APIAuditLogChangeKeyType + | APIAuditLogChangeKeyUses + | APIAuditLogChangeKeyVanityURLCode + | APIAuditLogChangeKeyVerificationLevel + | APIAuditLogChangeKeyWidgetChannelID + | APIAuditLogChangeKeyWidgetEnabled; /** * Returned when a guild's name is changed diff --git a/deno/payloads/v6/channel.ts b/deno/payloads/v6/channel.ts index 042acd0d..d38fe526 100644 --- a/deno/payloads/v6/channel.ts +++ b/deno/payloads/v6/channel.ts @@ -78,7 +78,7 @@ export interface APIMessage { attachments: APIAttachment[]; embeds: APIEmbed[]; reactions?: APIReaction[]; - nonce?: string | number; + nonce?: number | string; pinned: boolean; webhook_id?: string; type: MessageType; diff --git a/deno/payloads/v6/gateway.ts b/deno/payloads/v6/gateway.ts index c81f533d..4556e70c 100644 --- a/deno/payloads/v6/gateway.ts +++ b/deno/payloads/v6/gateway.ts @@ -123,7 +123,7 @@ export interface GatewayActivityTimestamps { * * @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8. */ -export type GatewayActivityEmoji = Partial> & Pick; +export type GatewayActivityEmoji = Partial> & Pick; /** * https://discord.com/developers/docs/topics/gateway#activity-object-activity-party @@ -149,7 +149,7 @@ export type GatewayActivityAssets = Partial< * * @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8. */ -export type GatewayActivitySecrets = Partial>; +export type GatewayActivitySecrets = Partial>; /** * https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags diff --git a/deno/payloads/v8/auditLog.ts b/deno/payloads/v8/auditLog.ts index 52718932..5d28d28a 100644 --- a/deno/payloads/v8/auditLog.ts +++ b/deno/payloads/v8/auditLog.ts @@ -271,70 +271,70 @@ export enum AuditLogOptionsType { * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type APIAuditLogChange = - | APIAuditLogChangeKeyName - | APIAuditLogChangeKeyDescription - | APIAuditLogChangeKeyIconHash - | APIAuditLogChangeKeySplashHash - | APIAuditLogChangeKeyDiscoverySplashHash - | APIAuditLogChangeKeyBannerHash - | APIAuditLogChangeKeyOwnerId - | APIAuditLogChangeKeyRegion - | APIAuditLogChangeKeyPreferredLocale - | APIAuditLogChangeKeyAFKChannelId - | APIAuditLogChangeKeyAFKTimeout - | APIAuditLogChangeKeyRulesChannelId - | APIAuditLogChangeKeyPublicUpdatesChannelId - | APIAuditLogChangeKeyMFALevel - | APIAuditLogChangeKeyVerificationLevel - | APIAuditLogChangeKeyExplicitContentFilter - | APIAuditLogChangeKeyDefaultMessageNotifications - | APIAuditLogChangeKeyVanityURLCode | APIAuditLogChangeKey$Add | APIAuditLogChangeKey$Remove - | APIAuditLogChangeKeyPruneDeleteDays - | APIAuditLogChangeKeyWidgetEnabled - | APIAuditLogChangeKeyWidgetChannelId - | APIAuditLogChangeKeySystemChannelId - | APIAuditLogChangeKeyPosition - | APIAuditLogChangeKeyTopic - | APIAuditLogChangeKeyBitrate - | APIAuditLogChangeKeyPermissionOverwrites - | APIAuditLogChangeKeyNSFW - | APIAuditLogChangeKeyApplicationId - | APIAuditLogChangeKeyRateLimitPerUser - | APIAuditLogChangeKeyPermissions - | APIAuditLogChangeKeyColor - | APIAuditLogChangeKeyHoist - | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyAFKChannelId + | APIAuditLogChangeKeyAFKTimeout | APIAuditLogChangeKeyAllow - | APIAuditLogChangeKeyDeny - | APIAuditLogChangeKeyCode - | APIAuditLogChangeKeyChannelId - | APIAuditLogChangeKeyInviterId - | APIAuditLogChangeKeyMaxUses - | APIAuditLogChangeKeyUses - | APIAuditLogChangeKeyMaxAge - | APIAuditLogChangeKeyTemporary - | APIAuditLogChangeKeyDeaf - | APIAuditLogChangeKeyMute - | APIAuditLogChangeKeyNick - | APIAuditLogChangeKeyAvatarHash - | APIAuditLogChangeKeyId - | APIAuditLogChangeKeyType - | APIAuditLogChangeKeyEnableEmoticons - | APIAuditLogChangeKeyExpireBehavior - | APIAuditLogChangeKeyExpireGracePeriod - | APIAuditLogChangeKeyUserLimit - | APIAuditLogChangeKeyPrivacyLevel - | APIAuditLogChangeKeyTags - | APIAuditLogChangeKeyFormatType + | APIAuditLogChangeKeyApplicationId | APIAuditLogChangeKeyAsset | APIAuditLogChangeKeyAvailable - | APIAuditLogChangeKeyGuildId + | APIAuditLogChangeKeyAvatarHash + | APIAuditLogChangeKeyBannerHash + | APIAuditLogChangeKeyBitrate + | APIAuditLogChangeKeyChannelId + | APIAuditLogChangeKeyCode + | APIAuditLogChangeKeyColor + | APIAuditLogChangeKeyCommunicationDisabledUntil + | APIAuditLogChangeKeyDeaf + | APIAuditLogChangeKeyDefaultMessageNotifications + | APIAuditLogChangeKeyDeny + | APIAuditLogChangeKeyDescription + | APIAuditLogChangeKeyDiscoverySplashHash + | APIAuditLogChangeKeyEnableEmoticons | APIAuditLogChangeKeyEntityType - | APIAuditLogChangeKeyStatus + | APIAuditLogChangeKeyExpireBehavior + | APIAuditLogChangeKeyExpireGracePeriod + | APIAuditLogChangeKeyExplicitContentFilter + | APIAuditLogChangeKeyFormatType + | APIAuditLogChangeKeyGuildId + | APIAuditLogChangeKeyHoist + | APIAuditLogChangeKeyIconHash + | APIAuditLogChangeKeyId + | APIAuditLogChangeKeyInviterId | APIAuditLogChangeKeyLocation - | APIAuditLogChangeKeyCommunicationDisabledUntil; + | APIAuditLogChangeKeyMaxAge + | APIAuditLogChangeKeyMaxUses + | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyMFALevel + | APIAuditLogChangeKeyMute + | APIAuditLogChangeKeyName + | APIAuditLogChangeKeyNick + | APIAuditLogChangeKeyNSFW + | APIAuditLogChangeKeyOwnerId + | APIAuditLogChangeKeyPermissionOverwrites + | APIAuditLogChangeKeyPermissions + | APIAuditLogChangeKeyPosition + | APIAuditLogChangeKeyPreferredLocale + | APIAuditLogChangeKeyPrivacyLevel + | APIAuditLogChangeKeyPruneDeleteDays + | APIAuditLogChangeKeyPublicUpdatesChannelId + | APIAuditLogChangeKeyRateLimitPerUser + | APIAuditLogChangeKeyRegion + | APIAuditLogChangeKeyRulesChannelId + | APIAuditLogChangeKeySplashHash + | APIAuditLogChangeKeyStatus + | APIAuditLogChangeKeySystemChannelId + | APIAuditLogChangeKeyTags + | APIAuditLogChangeKeyTemporary + | APIAuditLogChangeKeyTopic + | APIAuditLogChangeKeyType + | APIAuditLogChangeKeyUserLimit + | APIAuditLogChangeKeyUses + | APIAuditLogChangeKeyVanityURLCode + | APIAuditLogChangeKeyVerificationLevel + | APIAuditLogChangeKeyWidgetChannelId + | APIAuditLogChangeKeyWidgetEnabled; /** * Returned when an entity's name is changed diff --git a/deno/payloads/v8/channel.ts b/deno/payloads/v8/channel.ts index db0180e2..97b8ca95 100644 --- a/deno/payloads/v8/channel.ts +++ b/deno/payloads/v8/channel.ts @@ -53,11 +53,11 @@ export type TextChannelType = ChannelType.DM | ChannelType.GroupDM | ChannelType * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type GuildChannelType = Exclude< - | TextChannelType - | ChannelType.GuildVoice - | ChannelType.GuildStageVoice | ChannelType.GuildNews - | ChannelType.GuildStore, + | ChannelType.GuildStageVoice + | ChannelType.GuildStore + | ChannelType.GuildVoice + | TextChannelType, ChannelType.DM | ChannelType.GroupDM >; @@ -218,14 +218,14 @@ export interface APIGroupDMChannel extends APIDMChannelBase * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type APIChannel = - | APIGroupDMChannel | APIDMChannel - | APITextChannel - | APINewsChannel - | APIGuildStoreChannel - | APIVoiceChannel + | APIGroupDMChannel | APIGuildCategoryChannel - | APINewsChannel; + | APIGuildStoreChannel + | APINewsChannel + | APINewsChannel + | APITextChannel + | APIVoiceChannel; /** * https://discord.com/developers/docs/resources/channel#channel-object-channel-types @@ -397,7 +397,7 @@ export interface APIMessage { * **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE` * event to ensure it got sent** */ - nonce?: string | number; + nonce?: number | string; /** * Whether this message is pinned */ @@ -1170,7 +1170,7 @@ export interface APIMessageComponentEmoji { */ export interface APIButtonComponentWithCustomId extends APIButtonComponentBase< - ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger + ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success > { /** * The custom_id to be sent in the interaction when clicked @@ -1327,11 +1327,11 @@ export interface APITextInputComponent extends APIBaseComponent; +export type APIMessageComponent = APIActionRowComponent | APIMessageActionRowComponent; /** * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type APIModalComponent = APIModalActionRowComponent | APIActionRowComponent; +export type APIModalComponent = APIActionRowComponent | APIModalActionRowComponent; /** * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. diff --git a/deno/payloads/v8/gateway.ts b/deno/payloads/v8/gateway.ts index 7b7295a6..8f1c0ada 100644 --- a/deno/payloads/v8/gateway.ts +++ b/deno/payloads/v8/gateway.ts @@ -219,7 +219,7 @@ export interface GatewayActivity { /** * The custom buttons shown in the Rich Presence (max 2) */ - buttons?: string[] | GatewayActivityButton[]; + buttons?: GatewayActivityButton[] | string[]; } /** @@ -284,7 +284,7 @@ export interface GatewayActivityTimestamps { * * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type GatewayActivityEmoji = Partial> & Pick; +export type GatewayActivityEmoji = Partial> & Pick; /** * https://discord.com/developers/docs/topics/gateway#activity-object-activity-party @@ -316,7 +316,7 @@ export type GatewayActivityAssets = Partial< * * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type GatewayActivitySecrets = Partial>; +export type GatewayActivitySecrets = Partial>; /** * https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags diff --git a/deno/payloads/v8/guild.ts b/deno/payloads/v8/guild.ts index 8be22efd..74337653 100644 --- a/deno/payloads/v8/guild.ts +++ b/deno/payloads/v8/guild.ts @@ -790,7 +790,7 @@ export interface APIGuildIntegration { /** * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type APIGuildInteractionType = 'twitch' | 'youtube' | 'discord'; +export type APIGuildInteractionType = 'discord' | 'twitch' | 'youtube'; /** * https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors diff --git a/deno/payloads/v8/guildScheduledEvent.ts b/deno/payloads/v8/guildScheduledEvent.ts index d0569de0..e4bba582 100644 --- a/deno/payloads/v8/guildScheduledEvent.ts +++ b/deno/payloads/v8/guildScheduledEvent.ts @@ -104,9 +104,9 @@ export interface APIExternalGuildScheduledEvent * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type APIGuildScheduledEvent = + | APIExternalGuildScheduledEvent | APIStageInstanceGuildScheduledEvent - | APIVoiceGuildScheduledEvent - | APIExternalGuildScheduledEvent; + | APIVoiceGuildScheduledEvent; /** * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata diff --git a/deno/payloads/v8/interactions.ts b/deno/payloads/v8/interactions.ts index 48d22f81..4ec83e12 100644 --- a/deno/payloads/v8/interactions.ts +++ b/deno/payloads/v8/interactions.ts @@ -34,11 +34,11 @@ export * from './_interactions/responses.ts'; * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type APIInteraction = - | APIPingInteraction + | APIApplicationCommandAutocompleteInteraction | APIApplicationCommandInteraction | APIMessageComponentInteraction - | APIApplicationCommandAutocompleteInteraction - | APIModalSubmitInteraction; + | APIModalSubmitInteraction + | APIPingInteraction; /** * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object @@ -46,9 +46,9 @@ export type APIInteraction = * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type APIDMInteraction = + | APIApplicationCommandAutocompleteDMInteraction | APIApplicationCommandDMInteraction | APIMessageComponentDMInteraction - | APIApplicationCommandAutocompleteDMInteraction | APIModalSubmitDMInteraction; /** @@ -57,7 +57,7 @@ export type APIDMInteraction = * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type APIGuildInteraction = + | APIApplicationCommandAutocompleteGuildInteraction | APIApplicationCommandGuildInteraction | APIMessageComponentGuildInteraction - | APIApplicationCommandAutocompleteGuildInteraction | APIModalSubmitGuildInteraction; diff --git a/deno/payloads/v8/invite.ts b/deno/payloads/v8/invite.ts index e5cf7c7f..9075df8b 100644 --- a/deno/payloads/v8/invite.ts +++ b/deno/payloads/v8/invite.ts @@ -11,17 +11,17 @@ import type { APIUser } from './user.ts'; export type APIInviteGuild = Pick< APIGuild, - | 'id' - | 'name' - | 'splash' | 'banner' - | 'icon' - | 'vanity_url_code' | 'description' | 'features' - | 'verification_level' + | 'icon' + | 'id' + | 'name' | 'nsfw_level' | 'premium_subscription_count' + | 'splash' + | 'vanity_url_code' + | 'verification_level' >; /** diff --git a/deno/payloads/v8/sticker.ts b/deno/payloads/v8/sticker.ts index ed7468b3..bdb01428 100644 --- a/deno/payloads/v8/sticker.ts +++ b/deno/payloads/v8/sticker.ts @@ -99,7 +99,7 @@ export enum StickerFormatType { * * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type APIStickerItem = Pick; +export type APIStickerItem = Pick; /** * https://discord.com/developers/docs/resources/sticker#sticker-pack-object diff --git a/deno/payloads/v9/auditLog.ts b/deno/payloads/v9/auditLog.ts index 62f31ea8..7a4ad440 100644 --- a/deno/payloads/v9/auditLog.ts +++ b/deno/payloads/v9/auditLog.ts @@ -335,82 +335,82 @@ export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`; * https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */ export type APIAuditLogChange = - | APIAuditLogChangeKeyName - | APIAuditLogChangeKeyDescription - | APIAuditLogChangeKeyIconHash - | APIAuditLogChangeKeyImageHash - | APIAuditLogChangeKeySplashHash - | APIAuditLogChangeKeyDiscoverySplashHash - | APIAuditLogChangeKeyBannerHash - | APIAuditLogChangeKeyOwnerId - | APIAuditLogChangeKeyRegion - | APIAuditLogChangeKeyPreferredLocale - | APIAuditLogChangeKeyAFKChannelId - | APIAuditLogChangeKeyAFKTimeout - | APIAuditLogChangeKeyRulesChannelId - | APIAuditLogChangeKeyPublicUpdatesChannelId - | APIAuditLogChangeKeyMFALevel - | APIAuditLogChangeKeyVerificationLevel - | APIAuditLogChangeKeyExplicitContentFilter - | APIAuditLogChangeKeyDefaultMessageNotifications - | APIAuditLogChangeKeyVanityURLCode | APIAuditLogChangeKey$Add | APIAuditLogChangeKey$Remove - | APIAuditLogChangeKeyPruneDeleteDays - | APIAuditLogChangeKeyWidgetEnabled - | APIAuditLogChangeKeyWidgetChannelId - | APIAuditLogChangeKeySystemChannelId - | APIAuditLogChangeKeyPosition - | APIAuditLogChangeKeyTopic - | APIAuditLogChangeKeyBitrate - | APIAuditLogChangeKeyPermissionOverwrites - | APIAuditLogChangeKeyNSFW - | APIAuditLogChangeKeyApplicationId - | APIAuditLogChangeKeyRateLimitPerUser - | APIAuditLogChangeKeyPermissions - | APIAuditLogChangeKeyColor - | APIAuditLogChangeKeyHoist - | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyActions + | APIAuditLogChangeKeyAFKChannelId + | APIAuditLogChangeKeyAFKTimeout | APIAuditLogChangeKeyAllow - | APIAuditLogChangeKeyDeny - | APIAuditLogChangeKeyCode - | APIAuditLogChangeKeyChannelId - | APIAuditLogChangeKeyInviterId - | APIAuditLogChangeKeyMaxUses - | APIAuditLogChangeKeyUses - | APIAuditLogChangeKeyMaxAge - | APIAuditLogChangeKeyTemporary - | APIAuditLogChangeKeyDeaf - | APIAuditLogChangeKeyMute - | APIAuditLogChangeKeyNick + | APIAuditLogChangeKeyApplicationId + | APIAuditLogChangeKeyArchived + | APIAuditLogChangeKeyAsset + | APIAuditLogChangeKeyAutoArchiveDuration + | APIAuditLogChangeKeyAvailable | APIAuditLogChangeKeyAvatarHash - | APIAuditLogChangeKeyId - | APIAuditLogChangeKeyType + | APIAuditLogChangeKeyBannerHash + | APIAuditLogChangeKeyBitrate + | APIAuditLogChangeKeyChannelId + | APIAuditLogChangeKeyCode + | APIAuditLogChangeKeyColor + | APIAuditLogChangeKeyCommunicationDisabledUntil + | APIAuditLogChangeKeyDeaf + | APIAuditLogChangeKeyDefaultAutoArchiveDuration + | APIAuditLogChangeKeyDefaultMessageNotifications + | APIAuditLogChangeKeyDeny + | APIAuditLogChangeKeyDescription + | APIAuditLogChangeKeyDiscoverySplashHash + | APIAuditLogChangeKeyEnabled | APIAuditLogChangeKeyEnableEmoticons + | APIAuditLogChangeKeyEntityType + | APIAuditLogChangeKeyEventType + | APIAuditLogChangeKeyExemptChannels + | APIAuditLogChangeKeyExemptRoles | APIAuditLogChangeKeyExpireBehavior | APIAuditLogChangeKeyExpireGracePeriod - | APIAuditLogChangeKeyUserLimit - | APIAuditLogChangeKeyPrivacyLevel - | APIAuditLogChangeKeyTags + | APIAuditLogChangeKeyExplicitContentFilter | APIAuditLogChangeKeyFormatType - | APIAuditLogChangeKeyAsset - | APIAuditLogChangeKeyAvailable | APIAuditLogChangeKeyGuildId - | APIAuditLogChangeKeyArchived - | APIAuditLogChangeKeyLocked - | APIAuditLogChangeKeyAutoArchiveDuration - | APIAuditLogChangeKeyDefaultAutoArchiveDuration - | APIAuditLogChangeKeyEntityType - | APIAuditLogChangeKeyStatus + | APIAuditLogChangeKeyHoist + | APIAuditLogChangeKeyIconHash + | APIAuditLogChangeKeyId + | APIAuditLogChangeKeyImageHash + | APIAuditLogChangeKeyInviterId | APIAuditLogChangeKeyLocation - | APIAuditLogChangeKeyCommunicationDisabledUntil - | APIAuditLogChangeKeyTriggerType - | APIAuditLogChangeKeyEventType + | APIAuditLogChangeKeyLocked + | APIAuditLogChangeKeyMaxAge + | APIAuditLogChangeKeyMaxUses + | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyMFALevel + | APIAuditLogChangeKeyMute + | APIAuditLogChangeKeyName + | APIAuditLogChangeKeyNick + | APIAuditLogChangeKeyNSFW + | APIAuditLogChangeKeyOwnerId + | APIAuditLogChangeKeyPermissionOverwrites + | APIAuditLogChangeKeyPermissions + | APIAuditLogChangeKeyPosition + | APIAuditLogChangeKeyPreferredLocale + | APIAuditLogChangeKeyPrivacyLevel + | APIAuditLogChangeKeyPruneDeleteDays + | APIAuditLogChangeKeyPublicUpdatesChannelId + | APIAuditLogChangeKeyRateLimitPerUser + | APIAuditLogChangeKeyRegion + | APIAuditLogChangeKeyRulesChannelId + | APIAuditLogChangeKeySplashHash + | APIAuditLogChangeKeyStatus + | APIAuditLogChangeKeySystemChannelId + | APIAuditLogChangeKeyTags + | APIAuditLogChangeKeyTemporary + | APIAuditLogChangeKeyTopic | APIAuditLogChangeKeyTriggerMetadata - | APIAuditLogChangeKeyActions - | APIAuditLogChangeKeyEnabled - | APIAuditLogChangeKeyExemptRoles - | APIAuditLogChangeKeyExemptChannels; + | APIAuditLogChangeKeyTriggerType + | APIAuditLogChangeKeyType + | APIAuditLogChangeKeyUserLimit + | APIAuditLogChangeKeyUses + | APIAuditLogChangeKeyVanityURLCode + | APIAuditLogChangeKeyVerificationLevel + | APIAuditLogChangeKeyWidgetChannelId + | APIAuditLogChangeKeyWidgetEnabled; /** * Returned when an entity's name is changed diff --git a/deno/payloads/v9/channel.ts b/deno/payloads/v9/channel.ts index 50f09a9e..b3ee6c1b 100644 --- a/deno/payloads/v9/channel.ts +++ b/deno/payloads/v9/channel.ts @@ -41,15 +41,15 @@ export interface APIChannelBase extends APIPartialChannel } export type TextChannelType = + | ChannelType.AnnouncementThread | ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildAnnouncement - | ChannelType.PublicThread - | ChannelType.PrivateThread - | ChannelType.AnnouncementThread + | ChannelType.GuildStageVoice | ChannelType.GuildText | ChannelType.GuildVoice - | ChannelType.GuildStageVoice; + | ChannelType.PrivateThread + | ChannelType.PublicThread; export type GuildChannelType = Exclude; @@ -110,7 +110,7 @@ export interface APIGuildChannel extends Omit; -export interface APIGuildTextChannel +export interface APIGuildTextChannel extends Omit, 'name'>, APIGuildChannel { /** @@ -134,7 +134,7 @@ export type APIGuildCategoryChannel = APIGuildChannel export interface APIVoiceChannelBase extends APIGuildChannel, - Omit, 'name' | 'last_pin_timestamp'> { + Omit, 'last_pin_timestamp' | 'name'> { /** * The bitrate (in bits) of the voice or stage channel */ @@ -200,7 +200,7 @@ export interface APIGroupDMChannel extends Omit, 'name'>, @@ -369,16 +369,16 @@ export type APIGuildMediaChannel = APIThreadOnlyChannel; * https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */ export type APIChannel = - | APIGroupDMChannel | APIDMChannel - | APITextChannel - | APINewsChannel - | APIGuildVoiceChannel - | APIGuildStageVoiceChannel + | APIGroupDMChannel | APIGuildCategoryChannel - | APIThreadChannel | APIGuildForumChannel - | APIGuildMediaChannel; + | APIGuildMediaChannel + | APIGuildStageVoiceChannel + | APIGuildVoiceChannel + | APINewsChannel + | APITextChannel + | APIThreadChannel; /** * https://discord.com/developers/docs/resources/channel#channel-object-channel-types @@ -599,7 +599,7 @@ export interface APIMessage { * **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE` * event to ensure it got sent** */ - nonce?: string | number; + nonce?: number | string; /** * Whether this message is pinned */ @@ -1563,7 +1563,7 @@ export interface APIMessageComponentEmoji { export interface APIButtonComponentWithCustomId extends APIButtonComponentBase< - ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger + ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success > { /** * The custom_id to be sent in the interaction when clicked @@ -1604,11 +1604,11 @@ export enum TextInputStyle { */ export interface APIBaseSelectMenuComponent< T extends - | ComponentType.StringSelect - | ComponentType.UserSelect - | ComponentType.RoleSelect + | ComponentType.ChannelSelect | ComponentType.MentionableSelect - | ComponentType.ChannelSelect, + | ComponentType.RoleSelect + | ComponentType.StringSelect + | ComponentType.UserSelect, > extends APIBaseComponent { /** * A developer-defined identifier for the select menu, max 100 characters @@ -1640,10 +1640,10 @@ export interface APIBaseSelectMenuComponent< export interface APIBaseAutoPopulatedSelectMenuComponent< T extends - | ComponentType.UserSelect - | ComponentType.RoleSelect + | ComponentType.ChannelSelect | ComponentType.MentionableSelect - | ComponentType.ChannelSelect, + | ComponentType.RoleSelect + | ComponentType.UserSelect, D extends SelectMenuDefaultValueType, > extends APIBaseSelectMenuComponent { /** @@ -1683,7 +1683,7 @@ export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent< */ export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent< ComponentType.MentionableSelect, - SelectMenuDefaultValueType.User | SelectMenuDefaultValueType.Role + SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User >; /** @@ -1724,11 +1724,11 @@ export type APIAutoPopulatedSelectMenuComponent = * https://discord.com/developers/docs/interactions/message-components#select-menus */ export type APISelectMenuComponent = - | APIStringSelectComponent - | APIUserSelectComponent - | APIRoleSelectComponent + | APIChannelSelectComponent | APIMentionableSelectComponent - | APIChannelSelectComponent; + | APIRoleSelectComponent + | APIStringSelectComponent + | APIUserSelectComponent; /** * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure @@ -1840,8 +1840,8 @@ export enum ChannelFlags { /** * https://discord.com/developers/docs/interactions/message-components#message-components */ -export type APIMessageComponent = APIMessageActionRowComponent | APIActionRowComponent; -export type APIModalComponent = APIModalActionRowComponent | APIActionRowComponent; +export type APIMessageComponent = APIActionRowComponent | APIMessageActionRowComponent; +export type APIModalComponent = APIActionRowComponent | APIModalActionRowComponent; export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent; diff --git a/deno/payloads/v9/gateway.ts b/deno/payloads/v9/gateway.ts index c9cee3ed..1d78e6da 100644 --- a/deno/payloads/v9/gateway.ts +++ b/deno/payloads/v9/gateway.ts @@ -215,7 +215,7 @@ export interface GatewayActivity { /** * The custom buttons shown in the Rich Presence (max 2) */ - buttons?: string[] | GatewayActivityButton[]; + buttons?: GatewayActivityButton[] | string[]; } /** @@ -280,7 +280,7 @@ export interface GatewayActivityTimestamps { /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji */ -export type GatewayActivityEmoji = Partial> & Pick; +export type GatewayActivityEmoji = Partial> & Pick; /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party @@ -306,7 +306,7 @@ export type GatewayActivityAssets = Partial< /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets */ -export type GatewayActivitySecrets = Partial>; +export type GatewayActivitySecrets = Partial>; /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags diff --git a/deno/payloads/v9/guild.ts b/deno/payloads/v9/guild.ts index 67b18fbd..51860a14 100644 --- a/deno/payloads/v9/guild.ts +++ b/deno/payloads/v9/guild.ts @@ -121,7 +121,7 @@ export interface APIGuild extends APIPartialGuild { /** * afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600` */ - afk_timeout: 60 | 300 | 900 | 1_800 | 3_600; + afk_timeout: 1_800 | 3_600 | 60 | 300 | 900; /** * `true` if the guild widget is enabled */ @@ -798,7 +798,7 @@ export interface APIGuildIntegration { scopes?: OAuth2Scopes[]; } -export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription'; +export type APIGuildIntegrationType = 'discord' | 'guild_subscription' | 'twitch' | 'youtube'; /** * https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors diff --git a/deno/payloads/v9/guildScheduledEvent.ts b/deno/payloads/v9/guildScheduledEvent.ts index 4a8babbd..26c0767b 100644 --- a/deno/payloads/v9/guildScheduledEvent.ts +++ b/deno/payloads/v9/guildScheduledEvent.ts @@ -90,9 +90,9 @@ export interface APIExternalGuildScheduledEvent * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure */ export type APIGuildScheduledEvent = + | APIExternalGuildScheduledEvent | APIStageInstanceGuildScheduledEvent - | APIVoiceGuildScheduledEvent - | APIExternalGuildScheduledEvent; + | APIVoiceGuildScheduledEvent; /** * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata diff --git a/deno/payloads/v9/interactions.ts b/deno/payloads/v9/interactions.ts index 822e497d..d5bec3d8 100644 --- a/deno/payloads/v9/interactions.ts +++ b/deno/payloads/v9/interactions.ts @@ -32,26 +32,26 @@ export * from './_interactions/responses.ts'; * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object */ export type APIInteraction = - | APIPingInteraction + | APIApplicationCommandAutocompleteInteraction | APIApplicationCommandInteraction | APIMessageComponentInteraction - | APIApplicationCommandAutocompleteInteraction - | APIModalSubmitInteraction; + | APIModalSubmitInteraction + | APIPingInteraction; /** * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object */ export type APIDMInteraction = + | APIApplicationCommandAutocompleteDMInteraction | APIApplicationCommandDMInteraction | APIMessageComponentDMInteraction - | APIApplicationCommandAutocompleteDMInteraction | APIModalSubmitDMInteraction; /** * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object */ export type APIGuildInteraction = + | APIApplicationCommandAutocompleteGuildInteraction | APIApplicationCommandGuildInteraction | APIMessageComponentGuildInteraction - | APIApplicationCommandAutocompleteGuildInteraction | APIModalSubmitGuildInteraction; diff --git a/deno/payloads/v9/invite.ts b/deno/payloads/v9/invite.ts index 26cea78b..d6423df9 100644 --- a/deno/payloads/v9/invite.ts +++ b/deno/payloads/v9/invite.ts @@ -11,17 +11,17 @@ import type { APIUser } from './user.ts'; export type APIInviteGuild = Pick< APIGuild, - | 'id' - | 'name' - | 'splash' | 'banner' - | 'icon' - | 'vanity_url_code' | 'description' | 'features' - | 'verification_level' + | 'icon' + | 'id' + | 'name' | 'nsfw_level' | 'premium_subscription_count' + | 'splash' + | 'vanity_url_code' + | 'verification_level' >; /** diff --git a/deno/payloads/v9/sticker.ts b/deno/payloads/v9/sticker.ts index a5e5b918..4bcd3636 100644 --- a/deno/payloads/v9/sticker.ts +++ b/deno/payloads/v9/sticker.ts @@ -92,7 +92,7 @@ export enum StickerFormatType { /** * https://discord.com/developers/docs/resources/sticker#sticker-item-object */ -export type APIStickerItem = Pick; +export type APIStickerItem = Pick; /** * https://discord.com/developers/docs/resources/sticker#sticker-pack-object diff --git a/deno/payloads/v9/user.ts b/deno/payloads/v9/user.ts index 3cf43065..41b14e18 100644 --- a/deno/payloads/v9/user.ts +++ b/deno/payloads/v9/user.ts @@ -316,5 +316,5 @@ export interface APIApplicationRoleConnection { /** * Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected */ - metadata: Record; + metadata: Record; } diff --git a/deno/rest/v10/application.ts b/deno/rest/v10/application.ts index e20aecd1..a5bb289b 100644 --- a/deno/rest/v10/application.ts +++ b/deno/rest/v10/application.ts @@ -25,17 +25,17 @@ export type RESTGetCurrentApplicationResult = APIApplication; * https://discord.com/developers/docs/resources/application#edit-current-application */ export type RESTPatchCurrentApplicationJSONBody = StrictPartial< - Pick< - APIApplication, - | 'custom_install_url' - | 'description' - | 'flags' - | 'role_connections_verification_url' - | 'install_params' - | 'interactions_endpoint_url' - | 'tags' - > & - Nullable> + Nullable> & + Pick< + APIApplication, + | 'custom_install_url' + | 'description' + | 'flags' + | 'install_params' + | 'interactions_endpoint_url' + | 'role_connections_verification_url' + | 'tags' + > >; /** diff --git a/deno/rest/v10/channel.ts b/deno/rest/v10/channel.ts index a6a727f6..ad4a4099 100644 --- a/deno/rest/v10/channel.ts +++ b/deno/rest/v10/channel.ts @@ -236,8 +236,10 @@ export type RESTGetAPIChannelMessageResult = APIMessage; /** * https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */ -export type APIMessageReferenceSend = StrictPartial & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface>> & { +export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Required> +> & + StrictPartial & { /** * Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message * @@ -309,7 +311,7 @@ export interface RESTPostAPIChannelMessageJSONBody { * * See https://discord.com/developers/docs/resources/sticker#sticker-object */ - sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined; + sticker_ids?: [Snowflake, Snowflake, Snowflake] | [Snowflake, Snowflake] | [Snowflake] | undefined; /** * Attachment objects with filename and description */ @@ -329,13 +331,13 @@ export interface RESTPostAPIChannelMessageJSONBody { * https://discord.com/developers/docs/resources/channel#create-message */ export type RESTPostAPIChannelMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIChannelMessageJSONBody); /** * https://discord.com/developers/docs/resources/channel#create-message @@ -442,13 +444,13 @@ export interface RESTPatchAPIChannelMessageJSONBody { * https://discord.com/developers/docs/resources/channel#edit-message */ export type RESTPatchAPIChannelMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPatchAPIChannelMessageJSONBody); /** * https://discord.com/developers/docs/resources/channel#edit-message diff --git a/deno/rest/v10/guild.ts b/deno/rest/v10/guild.ts index 67a69bde..5e6bd9aa 100644 --- a/deno/rest/v10/guild.ts +++ b/deno/rest/v10/guild.ts @@ -45,22 +45,22 @@ export type APIGuildChannelResolvable = Exclude > & { name: string; @@ -142,15 +142,15 @@ export interface RESTPostAPIGuildsJSONBody { /** * ID for afk channel */ - afk_channel_id?: number | Snowflake | null | undefined; + afk_channel_id?: Snowflake | number | null | undefined; /** * afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600` */ - afk_timeout?: 60 | 300 | 900 | 1_800 | 3_600 | undefined; + afk_timeout?: 1_800 | 3_600 | 60 | 300 | 900 | undefined; /** * The id of the channel where guild notices such as welcome messages and boost events are posted */ - system_channel_id?: number | Snowflake | null | undefined; + system_channel_id?: Snowflake | number | null | undefined; /** * System channel flags * @@ -246,7 +246,7 @@ export interface RESTPatchAPIGuildJSONBody { /** * afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600` */ - afk_timeout?: 60 | 300 | 900 | 1_800 | 3_600 | undefined; + afk_timeout?: 1_800 | 3_600 | 60 | 300 | 900 | undefined; /** * base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature) * @@ -942,20 +942,20 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined; }; -export type RESTAPIModifyGuildOnboardingPromptData = Pick & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Partial> - > & { +export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Partial> +> & + Pick & { /** * Options available within the prompt */ options: RESTAPIModifyGuildOnboardingPromptOptionData[]; }; -export type RESTAPIModifyGuildOnboardingPromptOptionData = Pick & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Partial> - > & { +export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Partial> +> & + Pick & { /** * Emoji id */ diff --git a/deno/rest/v10/interactions.ts b/deno/rest/v10/interactions.ts index aac1a382..a6abe174 100644 --- a/deno/rest/v10/interactions.ts +++ b/deno/rest/v10/interactions.ts @@ -42,15 +42,15 @@ export type RESTGetAPIApplicationCommandResult = APIApplicationCommand; type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Omit< APIApplicationCommand, - | 'id' | 'application_id' + | 'default_member_permissions' + | 'description_localized' | 'description' + | 'guild_id' + | 'id' + | 'name_localized' | 'type' | 'version' - | 'guild_id' - | 'name_localized' - | 'description_localized' - | 'default_member_permissions' > & Partial> >; @@ -67,7 +67,7 @@ export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPos * https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */ export interface RESTPostAPIContextMenuApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody { - type: ApplicationCommandType.User | ApplicationCommandType.Message; + type: ApplicationCommandType.Message | ApplicationCommandType.User; } /** @@ -166,13 +166,13 @@ export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse; * https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */ export type RESTPostAPIInteractionCallbackFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionCallbackJSONBody); /** * https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response @@ -208,13 +208,13 @@ export type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallb * https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message */ export type RESTPostAPIInteractionFollowupFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionFollowupJSONBody); /** * https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message diff --git a/deno/rest/v10/mod.ts b/deno/rest/v10/mod.ts index d83b2cff..3f6bc6a5 100644 --- a/deno/rest/v10/mod.ts +++ b/deno/rest/v10/mod.ts @@ -473,7 +473,7 @@ export const Routes = { parts.push('threads'); - return parts.join('/') as `/channels/${Snowflake}/threads` | `/channels/${Snowflake}/messages/${Snowflake}/threads`; + return parts.join('/') as `/channels/${Snowflake}/messages/${Snowflake}/threads` | `/channels/${Snowflake}/threads`; }, /** @@ -489,7 +489,7 @@ export const Routes = { * - GET `/channels/{channel.id}/threads/archived/public` * - GET `/channels/{channel.id}/threads/archived/private` */ - channelThreads(channelId: Snowflake, archivedStatus: 'public' | 'private') { + channelThreads(channelId: Snowflake, archivedStatus: 'private' | 'public') { return `/channels/${channelId}/threads/archived/${archivedStatus}` as const; }, @@ -516,8 +516,8 @@ export const Routes = { if (userId) parts.push(userId); return parts.join('/') as - | `/channels/${Snowflake}/thread-members` - | `/channels/${Snowflake}/thread-members/${Snowflake | '@me'}`; + | `/channels/${Snowflake}/thread-members/${Snowflake | '@me'}` + | `/channels/${Snowflake}/thread-members`; }, /** @@ -623,7 +623,7 @@ export const Routes = { if (webhookToken) parts.push(webhookToken); - return parts.join('/') as `/webhooks/${Snowflake}` | `/webhooks/${Snowflake}/${string}`; + return parts.join('/') as `/webhooks/${Snowflake}/${string}` | `/webhooks/${Snowflake}`; }, /** @@ -1213,23 +1213,23 @@ export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5; export type EmojiFormat = Exclude; export type GuildIconFormat = Exclude; -export type GuildSplashFormat = Exclude; -export type GuildDiscoverySplashFormat = Exclude; +export type GuildSplashFormat = Exclude; +export type GuildDiscoverySplashFormat = Exclude; export type GuildBannerFormat = Exclude; export type UserBannerFormat = Exclude; export type DefaultUserAvatar = Extract; export type UserAvatarFormat = Exclude; export type GuildMemberAvatarFormat = Exclude; -export type ApplicationIconFormat = Exclude; -export type ApplicationCoverFormat = Exclude; -export type ApplicationAssetFormat = Exclude; -export type AchievementIconFormat = Exclude; -export type StickerPackBannerFormat = Exclude; -export type TeamIconFormat = Exclude; -export type StorePageAssetFormat = Exclude; -export type StickerFormat = Extract; -export type RoleIconFormat = Exclude; -export type GuildScheduledEventCoverFormat = Exclude; +export type ApplicationIconFormat = Exclude; +export type ApplicationCoverFormat = Exclude; +export type ApplicationAssetFormat = Exclude; +export type AchievementIconFormat = Exclude; +export type StickerPackBannerFormat = Exclude; +export type TeamIconFormat = Exclude; +export type StorePageAssetFormat = Exclude; +export type StickerFormat = Extract; +export type RoleIconFormat = Exclude; +export type GuildScheduledEventCoverFormat = Exclude; export type GuildMemberBannerFormat = Exclude; export interface CDNQuery { diff --git a/deno/rest/v10/monetization.ts b/deno/rest/v10/monetization.ts index dd40f9f0..cf07900c 100644 --- a/deno/rest/v10/monetization.ts +++ b/deno/rest/v10/monetization.ts @@ -64,7 +64,7 @@ export interface RESTPostAPIEntitlementBody { /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */ -export type RESTPostAPIEntitlementResult = Partial>; +export type RESTPostAPIEntitlementResult = Partial>; /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement diff --git a/deno/rest/v10/oauth2.ts b/deno/rest/v10/oauth2.ts index a6e8601e..d3ccee2e 100644 --- a/deno/rest/v10/oauth2.ts +++ b/deno/rest/v10/oauth2.ts @@ -122,8 +122,8 @@ export interface RESTOAuth2BotAuthorizationQuery { */ scope: | OAuth2Scopes.Bot - | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${OAuth2Scopes.Bot}${' ' | '%20'}${string}` + | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`; /** * The permissions you're requesting @@ -151,8 +151,8 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery { */ scope: | OAuth2Scopes.Bot - | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${OAuth2Scopes.Bot}${' ' | '%20'}${string}` + | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`; /** * The required permissions bitfield, stringified diff --git a/deno/rest/v10/user.ts b/deno/rest/v10/user.ts index e52b81db..4bfd5692 100644 --- a/deno/rest/v10/user.ts +++ b/deno/rest/v10/user.ts @@ -129,7 +129,7 @@ export interface RESTPutAPICurrentUserApplicationRoleConnectionJSONBody { /** * Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected */ - metadata?: Record | undefined; + metadata?: Record | undefined; } /** diff --git a/deno/rest/v10/webhook.ts b/deno/rest/v10/webhook.ts index c1bc9904..561e4407 100644 --- a/deno/rest/v10/webhook.ts +++ b/deno/rest/v10/webhook.ts @@ -160,13 +160,13 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { * https://discord.com/developers/docs/resources/webhook#execute-webhook */ export type RESTPostAPIWebhookWithTokenFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIWebhookWithTokenJSONBody); /** * https://discord.com/developers/docs/resources/webhook#execute-webhook-query-string-params @@ -252,7 +252,7 @@ export interface RESTGetAPIWebhookWithTokenMessageQuery { * https://discord.com/developers/docs/resources/webhook#edit-webhook-message */ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Nullable> + Nullable> > & { /** * Attached files to keep @@ -268,13 +268,13 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly * https://discord.com/developers/docs/resources/webhook#edit-webhook-message */ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPatchAPIWebhookWithTokenMessageJSONBody); /** * https://discord.com/developers/docs/resources/webhook#edit-webhook-message diff --git a/deno/rest/v6/guild.ts b/deno/rest/v6/guild.ts index db90dd28..684b5cd5 100644 --- a/deno/rest/v6/guild.ts +++ b/deno/rest/v6/guild.ts @@ -29,7 +29,7 @@ export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionsJSO * @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8. */ export type APIGuildCreatePartialChannel = Partial< - Pick + Pick > & { name: string; id?: number | string | undefined; @@ -142,7 +142,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[]; export type RESTPostAPIGuildChannelJSONBody = Partial< Pick< APIChannel, - 'type' | 'permission_overwrites' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user' | 'parent_id' + 'bitrate' | 'nsfw' | 'parent_id' | 'permission_overwrites' | 'rate_limit_per_user' | 'topic' | 'type' | 'user_limit' > > & Required>; diff --git a/deno/rest/v8/channel.ts b/deno/rest/v8/channel.ts index 0e0c23ce..a104dc91 100644 --- a/deno/rest/v8/channel.ts +++ b/deno/rest/v8/channel.ts @@ -176,8 +176,10 @@ export type RESTGetAPIChannelMessageResult = APIMessage; * * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type APIMessageReferenceSend = StrictPartial & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface>> & { +export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Required> +> & + StrictPartial & { /** * Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message * @@ -241,11 +243,11 @@ export interface RESTPostAPIChannelMessageJSONBody { * * See https://discord.com/developers/docs/resources/sticker#sticker-object */ - sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined; + sticker_ids?: [Snowflake, Snowflake, Snowflake] | [Snowflake, Snowflake] | [Snowflake] | undefined; /** * Attachment objects with filename and description */ - attachments?: (Pick & Partial>)[] | undefined; + attachments?: (Partial> & Pick)[] | undefined; /** * Message flags combined as a bitfield */ @@ -258,13 +260,13 @@ export interface RESTPostAPIChannelMessageJSONBody { * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPostAPIChannelMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIChannelMessageJSONBody); /** * https://discord.com/developers/docs/resources/channel#create-message @@ -386,7 +388,7 @@ export interface RESTPatchAPIChannelMessageJSONBody { * * See https://discord.com/developers/docs/resources/channel#attachment-object */ - attachments?: (Pick & Partial>)[] | undefined; + attachments?: (Partial> & Pick)[] | undefined; /** * The components to include with the message * @@ -401,13 +403,13 @@ export interface RESTPatchAPIChannelMessageJSONBody { * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPatchAPIChannelMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPatchAPIChannelMessageJSONBody); /** * https://discord.com/developers/docs/resources/channel#edit-message diff --git a/deno/rest/v8/guild.ts b/deno/rest/v8/guild.ts index 247cfa5a..291d9e0d 100644 --- a/deno/rest/v8/guild.ts +++ b/deno/rest/v8/guild.ts @@ -43,7 +43,7 @@ export type APIGuildChannelResolvable = Exclude, - 'type' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user' + 'bitrate' | 'nsfw' | 'rate_limit_per_user' | 'topic' | 'type' | 'user_limit' > > & { name: string; @@ -130,7 +130,7 @@ export interface RESTPostAPIGuildsJSONBody { /** * ID for afk channel */ - afk_channel_id?: number | Snowflake | null | undefined; + afk_channel_id?: Snowflake | number | null | undefined; /** * AFK timeout in seconds */ @@ -138,7 +138,7 @@ export interface RESTPostAPIGuildsJSONBody { /** * The id of the channel where guild notices such as welcome messages and boost events are posted */ - system_channel_id?: number | Snowflake | null | undefined; + system_channel_id?: Snowflake | number | null | undefined; /** * System channel flags * diff --git a/deno/rest/v8/interactions.ts b/deno/rest/v8/interactions.ts index 5953c1d4..168e4e5d 100644 --- a/deno/rest/v8/interactions.ts +++ b/deno/rest/v8/interactions.ts @@ -31,7 +31,7 @@ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[]; export type RESTGetAPIApplicationCommandResult = APIApplicationCommand; type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Omit + Omit >; /** @@ -50,7 +50,7 @@ export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPos * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export interface RESTPostAPIContextMenuApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody { - type: ApplicationCommandType.User | ApplicationCommandType.Message; + type: ApplicationCommandType.Message | ApplicationCommandType.User; } /** @@ -166,13 +166,13 @@ export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse; * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPostAPIInteractionCallbackFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionCallbackJSONBody); /** * https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response @@ -222,13 +222,13 @@ export type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallb * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPostAPIInteractionFollowupFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionFollowupJSONBody); /** * https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message diff --git a/deno/rest/v8/mod.ts b/deno/rest/v8/mod.ts index 44889fce..dfe4070e 100644 --- a/deno/rest/v8/mod.ts +++ b/deno/rest/v8/mod.ts @@ -518,7 +518,7 @@ export const Routes = { if (webhookToken) parts.push(webhookToken); - return parts.join('/') as `/webhooks/${Snowflake}` | `/webhooks/${Snowflake}/${string}`; + return parts.join('/') as `/webhooks/${Snowflake}/${string}` | `/webhooks/${Snowflake}`; }, /** diff --git a/deno/rest/v8/oauth2.ts b/deno/rest/v8/oauth2.ts index db1988dd..f9652f3c 100644 --- a/deno/rest/v8/oauth2.ts +++ b/deno/rest/v8/oauth2.ts @@ -150,8 +150,8 @@ export interface RESTOAuth2BotAuthorizationQuery { */ scope: | OAuth2Scopes.Bot - | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${OAuth2Scopes.Bot}${' ' | '%20'}${string}` + | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`; /** * The permissions you're requesting @@ -181,8 +181,8 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery { */ scope: | OAuth2Scopes.Bot - | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${OAuth2Scopes.Bot}${' ' | '%20'}${string}` + | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`; /** * The required permissions bitfield, stringified diff --git a/deno/rest/v8/webhook.ts b/deno/rest/v8/webhook.ts index 2fe1fe12..e108301f 100644 --- a/deno/rest/v8/webhook.ts +++ b/deno/rest/v8/webhook.ts @@ -166,7 +166,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { /** * Attachment objects with filename and description */ - attachments?: (Pick & Partial>)[] | undefined; + attachments?: (Partial> & Pick)[] | undefined; /** * Message flags combined as a bitfield */ @@ -179,13 +179,13 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPostAPIWebhookWithTokenFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIWebhookWithTokenJSONBody); /** * https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params @@ -284,7 +284,7 @@ export type RESTGetAPIWebhookWithTokenMessageResult = APIMessage; * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Nullable> + Nullable> > & { /** * Attached files to keep @@ -293,7 +293,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly * * See https://discord.com/developers/docs/resources/channel#attachment-object */ - attachments?: (Pick & Partial>)[] | undefined; + attachments?: (Partial> & Pick)[] | undefined; }; /** @@ -302,13 +302,13 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPatchAPIWebhookWithTokenMessageJSONBody); /** * https://discord.com/developers/docs/resources/webhook#edit-webhook-message diff --git a/deno/rest/v9/application.ts b/deno/rest/v9/application.ts index cf29fd02..f73095e3 100644 --- a/deno/rest/v9/application.ts +++ b/deno/rest/v9/application.ts @@ -25,17 +25,17 @@ export type RESTGetCurrentApplicationResult = APIApplication; * https://discord.com/developers/docs/resources/application#edit-current-application */ export type RESTPatchCurrentApplicationJSONBody = StrictPartial< - Pick< - APIApplication, - | 'custom_install_url' - | 'description' - | 'flags' - | 'role_connections_verification_url' - | 'install_params' - | 'interactions_endpoint_url' - | 'tags' - > & - Nullable> + Nullable> & + Pick< + APIApplication, + | 'custom_install_url' + | 'description' + | 'flags' + | 'install_params' + | 'interactions_endpoint_url' + | 'role_connections_verification_url' + | 'tags' + > >; /** diff --git a/deno/rest/v9/channel.ts b/deno/rest/v9/channel.ts index 019507f5..8b863554 100644 --- a/deno/rest/v9/channel.ts +++ b/deno/rest/v9/channel.ts @@ -236,8 +236,10 @@ export type RESTGetAPIChannelMessageResult = APIMessage; /** * https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */ -export type APIMessageReferenceSend = StrictPartial & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface>> & { +export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Required> +> & + StrictPartial & { /** * Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message * @@ -317,7 +319,7 @@ export interface RESTPostAPIChannelMessageJSONBody { * * See https://discord.com/developers/docs/resources/sticker#sticker-object */ - sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined; + sticker_ids?: [Snowflake, Snowflake, Snowflake] | [Snowflake, Snowflake] | [Snowflake] | undefined; /** * Attachment objects with filename and description */ @@ -337,13 +339,13 @@ export interface RESTPostAPIChannelMessageJSONBody { * https://discord.com/developers/docs/resources/channel#create-message */ export type RESTPostAPIChannelMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIChannelMessageJSONBody); /** * https://discord.com/developers/docs/resources/channel#create-message @@ -458,13 +460,13 @@ export interface RESTPatchAPIChannelMessageJSONBody { * https://discord.com/developers/docs/resources/channel#edit-message */ export type RESTPatchAPIChannelMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPatchAPIChannelMessageJSONBody); /** * https://discord.com/developers/docs/resources/channel#edit-message diff --git a/deno/rest/v9/guild.ts b/deno/rest/v9/guild.ts index 144bcb37..d9928582 100644 --- a/deno/rest/v9/guild.ts +++ b/deno/rest/v9/guild.ts @@ -45,22 +45,22 @@ export type APIGuildChannelResolvable = Exclude > & { name: string; @@ -142,15 +142,15 @@ export interface RESTPostAPIGuildsJSONBody { /** * ID for afk channel */ - afk_channel_id?: number | Snowflake | null | undefined; + afk_channel_id?: Snowflake | number | null | undefined; /** * afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600` */ - afk_timeout?: 60 | 300 | 900 | 1_800 | 3_600 | undefined; + afk_timeout?: 1_800 | 3_600 | 60 | 300 | 900 | undefined; /** * The id of the channel where guild notices such as welcome messages and boost events are posted */ - system_channel_id?: number | Snowflake | null | undefined; + system_channel_id?: Snowflake | number | null | undefined; /** * System channel flags * @@ -246,7 +246,7 @@ export interface RESTPatchAPIGuildJSONBody { /** * afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600` */ - afk_timeout?: 60 | 300 | 900 | 1_800 | 3_600 | undefined; + afk_timeout?: 1_800 | 3_600 | 60 | 300 | 900 | undefined; /** * base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature) * @@ -948,20 +948,20 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined; }; -export type RESTAPIModifyGuildOnboardingPromptData = Pick & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Partial> - > & { +export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Partial> +> & + Pick & { /** * Options available within the prompt */ options: RESTAPIModifyGuildOnboardingPromptOptionData[]; }; -export type RESTAPIModifyGuildOnboardingPromptOptionData = Pick & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Partial> - > & { +export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Partial> +> & + Pick & { /** * Emoji id */ diff --git a/deno/rest/v9/interactions.ts b/deno/rest/v9/interactions.ts index 1ff68fbb..b6f2a985 100644 --- a/deno/rest/v9/interactions.ts +++ b/deno/rest/v9/interactions.ts @@ -42,15 +42,15 @@ export type RESTGetAPIApplicationCommandResult = APIApplicationCommand; type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Omit< APIApplicationCommand, - | 'id' | 'application_id' + | 'default_member_permissions' + | 'description_localized' | 'description' + | 'guild_id' + | 'id' + | 'name_localized' | 'type' | 'version' - | 'guild_id' - | 'name_localized' - | 'description_localized' - | 'default_member_permissions' > & Partial> >; @@ -67,7 +67,7 @@ export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPos * https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */ export interface RESTPostAPIContextMenuApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody { - type: ApplicationCommandType.User | ApplicationCommandType.Message; + type: ApplicationCommandType.Message | ApplicationCommandType.User; } /** @@ -166,13 +166,13 @@ export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse; * https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */ export type RESTPostAPIInteractionCallbackFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionCallbackJSONBody); /** * https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response @@ -208,13 +208,13 @@ export type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallb * https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message */ export type RESTPostAPIInteractionFollowupFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionFollowupJSONBody); /** * https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message diff --git a/deno/rest/v9/mod.ts b/deno/rest/v9/mod.ts index cc651f4b..7b843c1a 100644 --- a/deno/rest/v9/mod.ts +++ b/deno/rest/v9/mod.ts @@ -473,7 +473,7 @@ export const Routes = { parts.push('threads'); - return parts.join('/') as `/channels/${Snowflake}/threads` | `/channels/${Snowflake}/messages/${Snowflake}/threads`; + return parts.join('/') as `/channels/${Snowflake}/messages/${Snowflake}/threads` | `/channels/${Snowflake}/threads`; }, /** @@ -491,7 +491,7 @@ export const Routes = { * - GET `/channels/{channel.id}/threads/archived/public` * - GET `/channels/{channel.id}/threads/archived/private` */ - channelThreads(channelId: Snowflake, archived?: 'public' | 'private') { + channelThreads(channelId: Snowflake, archived?: 'private' | 'public') { const parts = ['', 'channels', channelId, 'threads']; if (archived) parts.push('archived', archived); @@ -499,7 +499,7 @@ export const Routes = { return parts.join('/') as | `/channels/${Snowflake}/threads/active` - | `/channels/${Snowflake}/threads/archived/${'public' | 'private'}`; + | `/channels/${Snowflake}/threads/archived/${'private' | 'public'}`; }, /** @@ -525,8 +525,8 @@ export const Routes = { if (userId) parts.push(userId); return parts.join('/') as - | `/channels/${Snowflake}/thread-members` - | `/channels/${Snowflake}/thread-members/${Snowflake | '@me'}`; + | `/channels/${Snowflake}/thread-members/${Snowflake | '@me'}` + | `/channels/${Snowflake}/thread-members`; }, /** @@ -632,7 +632,7 @@ export const Routes = { if (webhookToken) parts.push(webhookToken); - return parts.join('/') as `/webhooks/${Snowflake}` | `/webhooks/${Snowflake}/${string}`; + return parts.join('/') as `/webhooks/${Snowflake}/${string}` | `/webhooks/${Snowflake}`; }, /** @@ -1222,23 +1222,23 @@ export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5; export type EmojiFormat = Exclude; export type GuildIconFormat = Exclude; -export type GuildSplashFormat = Exclude; -export type GuildDiscoverySplashFormat = Exclude; +export type GuildSplashFormat = Exclude; +export type GuildDiscoverySplashFormat = Exclude; export type GuildBannerFormat = Exclude; export type UserBannerFormat = Exclude; export type DefaultUserAvatar = Extract; export type UserAvatarFormat = Exclude; export type GuildMemberAvatarFormat = Exclude; -export type ApplicationIconFormat = Exclude; -export type ApplicationCoverFormat = Exclude; -export type ApplicationAssetFormat = Exclude; -export type AchievementIconFormat = Exclude; -export type StickerPackBannerFormat = Exclude; -export type StorePageAssetFormat = Exclude; -export type TeamIconFormat = Exclude; -export type StickerFormat = Extract; -export type RoleIconFormat = Exclude; -export type GuildScheduledEventCoverFormat = Exclude; +export type ApplicationIconFormat = Exclude; +export type ApplicationCoverFormat = Exclude; +export type ApplicationAssetFormat = Exclude; +export type AchievementIconFormat = Exclude; +export type StickerPackBannerFormat = Exclude; +export type StorePageAssetFormat = Exclude; +export type TeamIconFormat = Exclude; +export type StickerFormat = Extract; +export type RoleIconFormat = Exclude; +export type GuildScheduledEventCoverFormat = Exclude; export type GuildMemberBannerFormat = Exclude; export interface CDNQuery { diff --git a/deno/rest/v9/monetization.ts b/deno/rest/v9/monetization.ts index dd40f9f0..cf07900c 100644 --- a/deno/rest/v9/monetization.ts +++ b/deno/rest/v9/monetization.ts @@ -64,7 +64,7 @@ export interface RESTPostAPIEntitlementBody { /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */ -export type RESTPostAPIEntitlementResult = Partial>; +export type RESTPostAPIEntitlementResult = Partial>; /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement diff --git a/deno/rest/v9/oauth2.ts b/deno/rest/v9/oauth2.ts index 641d7861..a2ea2124 100644 --- a/deno/rest/v9/oauth2.ts +++ b/deno/rest/v9/oauth2.ts @@ -122,8 +122,8 @@ export interface RESTOAuth2BotAuthorizationQuery { */ scope: | OAuth2Scopes.Bot - | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${OAuth2Scopes.Bot}${' ' | '%20'}${string}` + | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`; /** * The permissions you're requesting @@ -151,8 +151,8 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery { */ scope: | OAuth2Scopes.Bot - | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${OAuth2Scopes.Bot}${' ' | '%20'}${string}` + | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`; /** * The required permissions bitfield, stringified diff --git a/deno/rest/v9/user.ts b/deno/rest/v9/user.ts index 00f698ec..c7576216 100644 --- a/deno/rest/v9/user.ts +++ b/deno/rest/v9/user.ts @@ -129,7 +129,7 @@ export interface RESTPutAPICurrentUserApplicationRoleConnectionJSONBody { /** * Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected */ - metadata?: Record | undefined; + metadata?: Record | undefined; } /** diff --git a/deno/rest/v9/webhook.ts b/deno/rest/v9/webhook.ts index 649e9ad3..b2081ce6 100644 --- a/deno/rest/v9/webhook.ts +++ b/deno/rest/v9/webhook.ts @@ -160,13 +160,13 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { * https://discord.com/developers/docs/resources/webhook#execute-webhook */ export type RESTPostAPIWebhookWithTokenFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIWebhookWithTokenJSONBody); /** * https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params @@ -252,7 +252,7 @@ export interface RESTGetAPIWebhookWithTokenMessageQuery { * https://discord.com/developers/docs/resources/webhook#edit-webhook-message */ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Nullable> + Nullable> > & { /** * Attached files to keep @@ -268,13 +268,13 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly * https://discord.com/developers/docs/resources/webhook#edit-webhook-message */ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPatchAPIWebhookWithTokenMessageJSONBody); /** * https://discord.com/developers/docs/resources/webhook#edit-webhook-message diff --git a/gateway/common.ts b/gateway/common.ts index 13405d89..a2181d68 100644 --- a/gateway/common.ts +++ b/gateway/common.ts @@ -3,6 +3,6 @@ */ export interface GatewayURLQuery { v: string; - encoding: 'json' | 'etf'; + encoding: 'etf' | 'json'; compress?: 'zlib-stream'; } diff --git a/gateway/v10.ts b/gateway/v10.ts index 8ed2c034..14500cfe 100644 --- a/gateway/v10.ts +++ b/gateway/v10.ts @@ -278,27 +278,29 @@ export enum GatewayDispatchEvents { export type GatewaySendPayload = | GatewayHeartbeat | GatewayIdentify - | GatewayUpdatePresence - | GatewayVoiceStateUpdate + | GatewayRequestGuildMembers | GatewayResume - | GatewayRequestGuildMembers; + | GatewayUpdatePresence + | GatewayVoiceStateUpdate; export type GatewayReceivePayload = - | GatewayHello - | GatewayHeartbeatRequest + | GatewayDispatchPayload | GatewayHeartbeatAck + | GatewayHeartbeatRequest + | GatewayHello | GatewayInvalidSession - | GatewayReconnect - | GatewayDispatchPayload; + | GatewayReconnect; export type GatewayDispatchPayload = - | GatewayAutoModerationRuleModifyDispatch + | GatewayApplicationCommandPermissionsUpdateDispatch + | GatewayAutoModerationActionExecutionDispatch | GatewayAutoModerationRuleCreateDispatch | GatewayAutoModerationRuleDeleteDispatch - | GatewayAutoModerationActionExecutionDispatch - | GatewayApplicationCommandPermissionsUpdateDispatch + | GatewayAutoModerationRuleModifyDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch + | GatewayEntitlementModifyDispatch + | GatewayGuildAuditLogEntryCreateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildCreateDispatch | GatewayGuildDeleteDispatch @@ -312,8 +314,8 @@ export type GatewayDispatchPayload = | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch - | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventDeleteDispatch + | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildStickersUpdateDispatch @@ -332,24 +334,22 @@ export type GatewayDispatchPayload = | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch + | GatewayReadyDispatch + | GatewayResumedDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch - | GatewayReadyDispatch - | GatewayResumedDispatch + | GatewayThreadCreateDispatch + | GatewayThreadDeleteDispatch | GatewayThreadListSyncDispatch | GatewayThreadMembersUpdateDispatch | GatewayThreadMemberUpdateDispatch - | GatewayThreadCreateDispatch | GatewayThreadUpdateDispatch - | GatewayThreadDeleteDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch - | GatewayWebhooksUpdateDispatch - | GatewayGuildAuditLogEntryCreateDispatch - | GatewayEntitlementModifyDispatch; + | GatewayWebhooksUpdateDispatch; // #region Dispatch Payloads @@ -454,7 +454,7 @@ export interface GatewayReadyDispatchData { * * See https://discord.com/developers/docs/resources/application#application-object */ - application: Pick; + application: Pick; } /** @@ -469,8 +469,8 @@ export type GatewayResumedDispatch = DataPayload; @@ -694,8 +694,8 @@ export type GatewayEntitlementModifyDispatchData = APIEntitlement; */ export type GatewayEntitlementModifyDispatch = DataPayload< | GatewayDispatchEvents.EntitlementCreate - | GatewayDispatchEvents.EntitlementUpdate - | GatewayDispatchEvents.EntitlementDelete, + | GatewayDispatchEvents.EntitlementDelete + | GatewayDispatchEvents.EntitlementUpdate, GatewayEntitlementModifyDispatchData >; @@ -1014,10 +1014,10 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway-events#guild-member-update */ -export type GatewayGuildMemberUpdateDispatchData = Omit & +export type GatewayGuildMemberUpdateDispatchData = Nullable> & + Omit & Partial> & - Required> & - Nullable> & { + Required> & { /** * The id of the guild */ @@ -1362,7 +1362,7 @@ export type GatewayMessageCreateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway-events#message-create */ -export type GatewayMessageCreateDispatchData = Omit & GatewayMessageEventExtraFields; +export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit; /** * https://discord.com/developers/docs/topics/gateway-events#message-update @@ -1375,8 +1375,8 @@ export type GatewayMessageUpdateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway-events#message-update */ -export type GatewayMessageUpdateDispatchData = Omit, 'mentions'> & - GatewayMessageEventExtraFields & { +export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & + Omit, 'mentions'> & { /** * ID of the message */ @@ -1979,8 +1979,8 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG * https://discord.com/developers/docs/topics/gateway-events#request-guild-members */ export type GatewayRequestGuildMembersData = - | GatewayRequestGuildMembersDataWithUserIds - | GatewayRequestGuildMembersDataWithQuery; + | GatewayRequestGuildMembersDataWithQuery + | GatewayRequestGuildMembersDataWithUserIds; /** * https://discord.com/developers/docs/topics/gateway-events#update-voice-state @@ -2073,7 +2073,7 @@ interface BasePayload { t?: string; } -type NonDispatchPayload = Omit & { +type NonDispatchPayload = Omit & { t: null; s: null; }; diff --git a/gateway/v6.ts b/gateway/v6.ts index 0fdbb3ce..c85642c4 100644 --- a/gateway/v6.ts +++ b/gateway/v6.ts @@ -184,56 +184,56 @@ export enum GatewayDispatchEvents { export type GatewaySendPayload = | GatewayHeartbeat | GatewayIdentify - | GatewayUpdatePresence - | GatewayVoiceStateUpdate + | GatewayRequestGuildMembers | GatewayResume - | GatewayRequestGuildMembers; + | GatewayUpdatePresence + | GatewayVoiceStateUpdate; /** * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. */ export type GatewayReceivePayload = - | GatewayHello - | GatewayHeartbeatRequest + | GatewayDispatchPayload | GatewayHeartbeatAck + | GatewayHeartbeatRequest + | GatewayHello | GatewayInvalidSession - | GatewayReconnect - | GatewayDispatchPayload; + | GatewayReconnect; /** * @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8. */ export type GatewayDispatchPayload = - | GatewayReadyDispatch - | GatewayResumedDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch - | GatewayGuildModifyDispatch - | GatewayGuildDeleteDispatch | GatewayGuildBanModifyDispatch + | GatewayGuildDeleteDispatch | GatewayGuildEmojisUpdateDispatch | GatewayGuildIntegrationsUpdateDispatch | GatewayGuildMemberAddDispatch | GatewayGuildMemberRemoveDispatch - | GatewayGuildMemberUpdateDispatch | GatewayGuildMembersChunkDispatch - | GatewayGuildRoleModifyDispatch + | GatewayGuildMemberUpdateDispatch + | GatewayGuildModifyDispatch | GatewayGuildRoleDeleteDispatch + | GatewayGuildRoleModifyDispatch | GatewayInviteCreateDispatch | GatewayInviteDeleteDispatch | GatewayMessageCreateDispatch - | GatewayMessageUpdateDispatch - | GatewayMessageDeleteDispatch | GatewayMessageDeleteBulkDispatch + | GatewayMessageDeleteDispatch | GatewayMessageReactionAddDispatch - | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveAllDispatch + | GatewayMessageReactionRemoveDispatch | GatewayMessageReactionRemoveEmojiDispatch + | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch + | GatewayReadyDispatch + | GatewayResumedDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch - | GatewayVoiceStateUpdateDispatch | GatewayVoiceServerUpdateDispatch + | GatewayVoiceStateUpdateDispatch | GatewayWebhooksUpdateDispatch; // #region Dispatch Payloads @@ -571,7 +571,7 @@ export type GatewayMessageCreateDispatch = DataPayload + Partial & { id: string; channel_id: string } >; /** @@ -768,11 +768,11 @@ export interface GatewayResume { export interface GatewayRequestGuildMembers { op: GatewayOPCodes.RequestGuildMembers; d: { - guild_id: string | string[]; + guild_id: string[] | string; query?: string; limit: number; presences?: boolean; - user_ids?: string | string[]; + user_ids?: string[] | string; nonce?: string; }; } diff --git a/gateway/v8.ts b/gateway/v8.ts index a13a6bf1..62c9d3c4 100644 --- a/gateway/v8.ts +++ b/gateway/v8.ts @@ -258,21 +258,21 @@ export enum GatewayDispatchEvents { export type GatewaySendPayload = | GatewayHeartbeat | GatewayIdentify - | GatewayUpdatePresence - | GatewayVoiceStateUpdate + | GatewayRequestGuildMembers | GatewayResume - | GatewayRequestGuildMembers; + | GatewayUpdatePresence + | GatewayVoiceStateUpdate; /** * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type GatewayReceivePayload = - | GatewayHello - | GatewayHeartbeatRequest + | GatewayDispatchPayload | GatewayHeartbeatAck + | GatewayHeartbeatRequest + | GatewayHello | GatewayInvalidSession - | GatewayReconnect - | GatewayDispatchPayload; + | GatewayReconnect; /** * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. @@ -292,8 +292,8 @@ export type GatewayDispatchPayload = | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch - | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventDeleteDispatch + | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildStickersUpdateDispatch @@ -312,11 +312,11 @@ export type GatewayDispatchPayload = | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch + | GatewayReadyDispatch + | GatewayResumedDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch - | GatewayReadyDispatch - | GatewayResumedDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch @@ -440,7 +440,7 @@ export interface GatewayReadyDispatchData { * * See https://discord.com/developers/docs/resources/application#application-object */ - application: Pick; + application: Pick; } /** @@ -805,10 +805,10 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload< * * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type GatewayGuildMemberUpdateDispatchData = Omit & +export type GatewayGuildMemberUpdateDispatchData = Nullable> & + Omit & Partial> & - Required> & - Nullable> & { + Required> & { /** * The id of the guild */ @@ -1243,10 +1243,10 @@ export type GatewayMessageUpdateDispatch = DataPayload< * * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type GatewayMessageUpdateDispatchData = { +export type GatewayMessageUpdateDispatchData = Partial & { id: Snowflake; channel_id: Snowflake; -} & Partial; +}; /** * https://discord.com/developers/docs/topics/gateway#message-delete @@ -1849,7 +1849,7 @@ interface BasePayload { t?: string; } -type NonDispatchPayload = Omit & { +type NonDispatchPayload = Omit & { t: null; s: null; }; diff --git a/gateway/v9.ts b/gateway/v9.ts index 0a0bf0fa..e66a6c88 100644 --- a/gateway/v9.ts +++ b/gateway/v9.ts @@ -277,27 +277,29 @@ export enum GatewayDispatchEvents { export type GatewaySendPayload = | GatewayHeartbeat | GatewayIdentify - | GatewayUpdatePresence - | GatewayVoiceStateUpdate + | GatewayRequestGuildMembers | GatewayResume - | GatewayRequestGuildMembers; + | GatewayUpdatePresence + | GatewayVoiceStateUpdate; export type GatewayReceivePayload = - | GatewayHello - | GatewayHeartbeatRequest + | GatewayDispatchPayload | GatewayHeartbeatAck + | GatewayHeartbeatRequest + | GatewayHello | GatewayInvalidSession - | GatewayReconnect - | GatewayDispatchPayload; + | GatewayReconnect; export type GatewayDispatchPayload = | GatewayApplicationCommandPermissionsUpdateDispatch - | GatewayAutoModerationRuleModifyDispatch + | GatewayAutoModerationActionExecutionDispatch | GatewayAutoModerationRuleCreateDispatch | GatewayAutoModerationRuleDeleteDispatch - | GatewayAutoModerationActionExecutionDispatch + | GatewayAutoModerationRuleModifyDispatch | GatewayChannelModifyDispatch | GatewayChannelPinsUpdateDispatch + | GatewayEntitlementModifyDispatch + | GatewayGuildAuditLogEntryCreateDispatch | GatewayGuildBanModifyDispatch | GatewayGuildCreateDispatch | GatewayGuildDeleteDispatch @@ -311,8 +313,8 @@ export type GatewayDispatchPayload = | GatewayGuildRoleDeleteDispatch | GatewayGuildRoleModifyDispatch | GatewayGuildScheduledEventCreateDispatch - | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventDeleteDispatch + | GatewayGuildScheduledEventUpdateDispatch | GatewayGuildScheduledEventUserAddDispatch | GatewayGuildScheduledEventUserRemoveDispatch | GatewayGuildStickersUpdateDispatch @@ -331,24 +333,22 @@ export type GatewayDispatchPayload = | GatewayMessageReactionRemoveEmojiDispatch | GatewayMessageUpdateDispatch | GatewayPresenceUpdateDispatch + | GatewayReadyDispatch + | GatewayResumedDispatch | GatewayStageInstanceCreateDispatch | GatewayStageInstanceDeleteDispatch | GatewayStageInstanceUpdateDispatch - | GatewayReadyDispatch - | GatewayResumedDispatch + | GatewayThreadCreateDispatch + | GatewayThreadDeleteDispatch | GatewayThreadListSyncDispatch | GatewayThreadMembersUpdateDispatch | GatewayThreadMemberUpdateDispatch - | GatewayThreadCreateDispatch | GatewayThreadUpdateDispatch - | GatewayThreadDeleteDispatch | GatewayTypingStartDispatch | GatewayUserUpdateDispatch | GatewayVoiceServerUpdateDispatch | GatewayVoiceStateUpdateDispatch - | GatewayWebhooksUpdateDispatch - | GatewayGuildAuditLogEntryCreateDispatch - | GatewayEntitlementModifyDispatch; + | GatewayWebhooksUpdateDispatch; // #region Dispatch Payloads @@ -453,7 +453,7 @@ export interface GatewayReadyDispatchData { * * See https://discord.com/developers/docs/resources/application#application-object */ - application: Pick; + application: Pick; } /** @@ -468,8 +468,8 @@ export type GatewayResumedDispatch = DataPayload; @@ -693,8 +693,8 @@ export type GatewayEntitlementModifyDispatchData = APIEntitlement; */ export type GatewayEntitlementModifyDispatch = DataPayload< | GatewayDispatchEvents.EntitlementCreate - | GatewayDispatchEvents.EntitlementUpdate - | GatewayDispatchEvents.EntitlementDelete, + | GatewayDispatchEvents.EntitlementDelete + | GatewayDispatchEvents.EntitlementUpdate, GatewayEntitlementModifyDispatchData >; @@ -1013,10 +1013,10 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway-events#guild-member-update */ -export type GatewayGuildMemberUpdateDispatchData = Omit & +export type GatewayGuildMemberUpdateDispatchData = Nullable> & + Omit & Partial> & - Required> & - Nullable> & { + Required> & { /** * The id of the guild */ @@ -1361,7 +1361,7 @@ export type GatewayMessageCreateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway-events#message-create */ -export type GatewayMessageCreateDispatchData = Omit & GatewayMessageEventExtraFields; +export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit; /** * https://discord.com/developers/docs/topics/gateway-events#message-update @@ -1374,8 +1374,8 @@ export type GatewayMessageUpdateDispatch = DataPayload< /** * https://discord.com/developers/docs/topics/gateway-events#message-update */ -export type GatewayMessageUpdateDispatchData = Omit, 'mentions'> & - GatewayMessageEventExtraFields & { +export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & + Omit, 'mentions'> & { /** * ID of the message */ @@ -1978,8 +1978,8 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG * https://discord.com/developers/docs/topics/gateway-events#request-guild-members */ export type GatewayRequestGuildMembersData = - | GatewayRequestGuildMembersDataWithUserIds - | GatewayRequestGuildMembersDataWithQuery; + | GatewayRequestGuildMembersDataWithQuery + | GatewayRequestGuildMembersDataWithUserIds; /** * https://discord.com/developers/docs/topics/gateway-events#update-voice-state @@ -2072,7 +2072,7 @@ interface BasePayload { t?: string; } -type NonDispatchPayload = Omit & { +type NonDispatchPayload = Omit & { t: null; s: null; }; diff --git a/package.json b/package.json index b654ca3a..58ddcf16 100644 --- a/package.json +++ b/package.json @@ -97,7 +97,7 @@ "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s", "ci:pr": "run-s changelog lint build:deno && node ./scripts/bump-website-version.mjs", "clean:deno": "rimraf deno/", - "clean:node": "rimraf {gateway,payloads,rest,rpc,voice,utils}/**/*.{js,mjs,d.ts,*map} {globals,v*}.{js,mjs,d.ts,*map}", + "clean:node": "rimraf --glob {gateway,payloads,rest,rpc,voice,utils}/**/*.{js,mjs,d.ts,*map} {globals,v*}.{js,mjs,d.ts,*map}", "clean": "run-p clean:*", "esm:gateway": "gen-esm-wrapper ./gateway/index.js ./gateway/index.mjs", "esm:globals": "gen-esm-wrapper ./globals.js ./globals.mjs", @@ -109,7 +109,7 @@ "esm:voice": "gen-esm-wrapper ./voice/index.js ./voice/index.mjs", "lint": "prettier --write . && eslint --fix --ext mjs,ts {gateway,payloads,rest,rpc,voice,utils}/**/*.ts {globals,v*}.ts scripts/**/*.mjs", "postpublish": "run-s clean:node build:deno", - "prepare": "tsc -p ./.eslintplugin && (is-ci || husky)", + "prepare": "tsc -p ./.eslint-plugin-local && (is-ci || husky)", "prepublishOnly": "run-s clean test:lint build:node", "test:lint": "prettier --check . && eslint --ext mjs,ts {gateway,payloads,rest,rpc,voice,utils}/**/*.ts {globals,v*}.ts scripts/**/*.mjs", "pretest:types": "tsc", diff --git a/payloads/v10/auditLog.ts b/payloads/v10/auditLog.ts index 24e4dad1..25810eed 100644 --- a/payloads/v10/auditLog.ts +++ b/payloads/v10/auditLog.ts @@ -335,82 +335,82 @@ export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`; * https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */ export type APIAuditLogChange = - | APIAuditLogChangeKeyName - | APIAuditLogChangeKeyDescription - | APIAuditLogChangeKeyIconHash - | APIAuditLogChangeKeyImageHash - | APIAuditLogChangeKeySplashHash - | APIAuditLogChangeKeyDiscoverySplashHash - | APIAuditLogChangeKeyBannerHash - | APIAuditLogChangeKeyOwnerId - | APIAuditLogChangeKeyRegion - | APIAuditLogChangeKeyPreferredLocale - | APIAuditLogChangeKeyAFKChannelId - | APIAuditLogChangeKeyAFKTimeout - | APIAuditLogChangeKeyRulesChannelId - | APIAuditLogChangeKeyPublicUpdatesChannelId - | APIAuditLogChangeKeyMFALevel - | APIAuditLogChangeKeyVerificationLevel - | APIAuditLogChangeKeyExplicitContentFilter - | APIAuditLogChangeKeyDefaultMessageNotifications - | APIAuditLogChangeKeyVanityURLCode | APIAuditLogChangeKey$Add | APIAuditLogChangeKey$Remove - | APIAuditLogChangeKeyPruneDeleteDays - | APIAuditLogChangeKeyWidgetEnabled - | APIAuditLogChangeKeyWidgetChannelId - | APIAuditLogChangeKeySystemChannelId - | APIAuditLogChangeKeyPosition - | APIAuditLogChangeKeyTopic - | APIAuditLogChangeKeyBitrate - | APIAuditLogChangeKeyPermissionOverwrites - | APIAuditLogChangeKeyNSFW - | APIAuditLogChangeKeyApplicationId - | APIAuditLogChangeKeyRateLimitPerUser - | APIAuditLogChangeKeyPermissions - | APIAuditLogChangeKeyColor - | APIAuditLogChangeKeyHoist - | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyActions + | APIAuditLogChangeKeyAFKChannelId + | APIAuditLogChangeKeyAFKTimeout | APIAuditLogChangeKeyAllow - | APIAuditLogChangeKeyDeny - | APIAuditLogChangeKeyCode - | APIAuditLogChangeKeyChannelId - | APIAuditLogChangeKeyInviterId - | APIAuditLogChangeKeyMaxUses - | APIAuditLogChangeKeyUses - | APIAuditLogChangeKeyMaxAge - | APIAuditLogChangeKeyTemporary - | APIAuditLogChangeKeyDeaf - | APIAuditLogChangeKeyMute - | APIAuditLogChangeKeyNick + | APIAuditLogChangeKeyApplicationId + | APIAuditLogChangeKeyArchived + | APIAuditLogChangeKeyAsset + | APIAuditLogChangeKeyAutoArchiveDuration + | APIAuditLogChangeKeyAvailable | APIAuditLogChangeKeyAvatarHash - | APIAuditLogChangeKeyId - | APIAuditLogChangeKeyType + | APIAuditLogChangeKeyBannerHash + | APIAuditLogChangeKeyBitrate + | APIAuditLogChangeKeyChannelId + | APIAuditLogChangeKeyCode + | APIAuditLogChangeKeyColor + | APIAuditLogChangeKeyCommunicationDisabledUntil + | APIAuditLogChangeKeyDeaf + | APIAuditLogChangeKeyDefaultAutoArchiveDuration + | APIAuditLogChangeKeyDefaultMessageNotifications + | APIAuditLogChangeKeyDeny + | APIAuditLogChangeKeyDescription + | APIAuditLogChangeKeyDiscoverySplashHash + | APIAuditLogChangeKeyEnabled | APIAuditLogChangeKeyEnableEmoticons + | APIAuditLogChangeKeyEntityType + | APIAuditLogChangeKeyEventType + | APIAuditLogChangeKeyExemptChannels + | APIAuditLogChangeKeyExemptRoles | APIAuditLogChangeKeyExpireBehavior | APIAuditLogChangeKeyExpireGracePeriod - | APIAuditLogChangeKeyUserLimit - | APIAuditLogChangeKeyPrivacyLevel - | APIAuditLogChangeKeyTags + | APIAuditLogChangeKeyExplicitContentFilter | APIAuditLogChangeKeyFormatType - | APIAuditLogChangeKeyAsset - | APIAuditLogChangeKeyAvailable | APIAuditLogChangeKeyGuildId - | APIAuditLogChangeKeyArchived - | APIAuditLogChangeKeyLocked - | APIAuditLogChangeKeyAutoArchiveDuration - | APIAuditLogChangeKeyDefaultAutoArchiveDuration - | APIAuditLogChangeKeyEntityType - | APIAuditLogChangeKeyStatus + | APIAuditLogChangeKeyHoist + | APIAuditLogChangeKeyIconHash + | APIAuditLogChangeKeyId + | APIAuditLogChangeKeyImageHash + | APIAuditLogChangeKeyInviterId | APIAuditLogChangeKeyLocation - | APIAuditLogChangeKeyCommunicationDisabledUntil - | APIAuditLogChangeKeyTriggerType - | APIAuditLogChangeKeyEventType + | APIAuditLogChangeKeyLocked + | APIAuditLogChangeKeyMaxAge + | APIAuditLogChangeKeyMaxUses + | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyMFALevel + | APIAuditLogChangeKeyMute + | APIAuditLogChangeKeyName + | APIAuditLogChangeKeyNick + | APIAuditLogChangeKeyNSFW + | APIAuditLogChangeKeyOwnerId + | APIAuditLogChangeKeyPermissionOverwrites + | APIAuditLogChangeKeyPermissions + | APIAuditLogChangeKeyPosition + | APIAuditLogChangeKeyPreferredLocale + | APIAuditLogChangeKeyPrivacyLevel + | APIAuditLogChangeKeyPruneDeleteDays + | APIAuditLogChangeKeyPublicUpdatesChannelId + | APIAuditLogChangeKeyRateLimitPerUser + | APIAuditLogChangeKeyRegion + | APIAuditLogChangeKeyRulesChannelId + | APIAuditLogChangeKeySplashHash + | APIAuditLogChangeKeyStatus + | APIAuditLogChangeKeySystemChannelId + | APIAuditLogChangeKeyTags + | APIAuditLogChangeKeyTemporary + | APIAuditLogChangeKeyTopic | APIAuditLogChangeKeyTriggerMetadata - | APIAuditLogChangeKeyActions - | APIAuditLogChangeKeyEnabled - | APIAuditLogChangeKeyExemptRoles - | APIAuditLogChangeKeyExemptChannels; + | APIAuditLogChangeKeyTriggerType + | APIAuditLogChangeKeyType + | APIAuditLogChangeKeyUserLimit + | APIAuditLogChangeKeyUses + | APIAuditLogChangeKeyVanityURLCode + | APIAuditLogChangeKeyVerificationLevel + | APIAuditLogChangeKeyWidgetChannelId + | APIAuditLogChangeKeyWidgetEnabled; /** * Returned when an entity's name is changed diff --git a/payloads/v10/channel.ts b/payloads/v10/channel.ts index 6cedec61..71246755 100644 --- a/payloads/v10/channel.ts +++ b/payloads/v10/channel.ts @@ -41,15 +41,15 @@ export interface APIChannelBase extends APIPartialChannel } export type TextChannelType = + | ChannelType.AnnouncementThread | ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildAnnouncement - | ChannelType.PublicThread - | ChannelType.PrivateThread - | ChannelType.AnnouncementThread + | ChannelType.GuildStageVoice | ChannelType.GuildText | ChannelType.GuildVoice - | ChannelType.GuildStageVoice; + | ChannelType.PrivateThread + | ChannelType.PublicThread; export type GuildChannelType = Exclude; @@ -110,7 +110,7 @@ export interface APIGuildChannel extends Omit; -export interface APIGuildTextChannel +export interface APIGuildTextChannel extends Omit, 'name'>, APIGuildChannel { /** @@ -134,7 +134,7 @@ export type APIGuildCategoryChannel = APIGuildChannel export interface APIVoiceChannelBase extends APIGuildChannel, - Omit, 'name' | 'last_pin_timestamp'> { + Omit, 'last_pin_timestamp' | 'name'> { /** * The bitrate (in bits) of the voice or stage channel */ @@ -204,7 +204,7 @@ export interface APIGroupDMChannel extends Omit, 'name'>, @@ -373,16 +373,16 @@ export type APIGuildMediaChannel = APIThreadOnlyChannel; * https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */ export type APIChannel = - | APIGroupDMChannel | APIDMChannel - | APITextChannel - | APINewsChannel - | APIGuildVoiceChannel - | APIGuildStageVoiceChannel + | APIGroupDMChannel | APIGuildCategoryChannel - | APIThreadChannel | APIGuildForumChannel - | APIGuildMediaChannel; + | APIGuildMediaChannel + | APIGuildStageVoiceChannel + | APIGuildVoiceChannel + | APINewsChannel + | APITextChannel + | APIThreadChannel; /** * https://discord.com/developers/docs/resources/channel#channel-object-channel-types @@ -607,7 +607,7 @@ export interface APIMessage { * **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE` * event to ensure it got sent** */ - nonce?: string | number; + nonce?: number | string; /** * Whether this message is pinned */ @@ -1594,7 +1594,7 @@ export interface APIMessageComponentEmoji { export interface APIButtonComponentWithCustomId extends APIButtonComponentBase< - ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger + ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success > { /** * The custom_id to be sent in the interaction when clicked @@ -1635,11 +1635,11 @@ export enum TextInputStyle { */ export interface APIBaseSelectMenuComponent< T extends - | ComponentType.StringSelect - | ComponentType.UserSelect - | ComponentType.RoleSelect + | ComponentType.ChannelSelect | ComponentType.MentionableSelect - | ComponentType.ChannelSelect, + | ComponentType.RoleSelect + | ComponentType.StringSelect + | ComponentType.UserSelect, > extends APIBaseComponent { /** * A developer-defined identifier for the select menu, max 100 characters @@ -1671,10 +1671,10 @@ export interface APIBaseSelectMenuComponent< export interface APIBaseAutoPopulatedSelectMenuComponent< T extends - | ComponentType.UserSelect - | ComponentType.RoleSelect + | ComponentType.ChannelSelect | ComponentType.MentionableSelect - | ComponentType.ChannelSelect, + | ComponentType.RoleSelect + | ComponentType.UserSelect, D extends SelectMenuDefaultValueType, > extends APIBaseSelectMenuComponent { /** @@ -1714,7 +1714,7 @@ export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent< */ export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent< ComponentType.MentionableSelect, - SelectMenuDefaultValueType.User | SelectMenuDefaultValueType.Role + SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User >; /** @@ -1755,11 +1755,11 @@ export type APIAutoPopulatedSelectMenuComponent = * https://discord.com/developers/docs/interactions/message-components#select-menus */ export type APISelectMenuComponent = - | APIStringSelectComponent - | APIUserSelectComponent - | APIRoleSelectComponent + | APIChannelSelectComponent | APIMentionableSelectComponent - | APIChannelSelectComponent; + | APIRoleSelectComponent + | APIStringSelectComponent + | APIUserSelectComponent; /** * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure @@ -1871,8 +1871,8 @@ export enum ChannelFlags { /** * https://discord.com/developers/docs/interactions/message-components#message-components */ -export type APIMessageComponent = APIMessageActionRowComponent | APIActionRowComponent; -export type APIModalComponent = APIModalActionRowComponent | APIActionRowComponent; +export type APIMessageComponent = APIActionRowComponent | APIMessageActionRowComponent; +export type APIModalComponent = APIActionRowComponent | APIModalActionRowComponent; export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent; diff --git a/payloads/v10/gateway.ts b/payloads/v10/gateway.ts index 67e1c649..1a1b65b5 100644 --- a/payloads/v10/gateway.ts +++ b/payloads/v10/gateway.ts @@ -227,7 +227,7 @@ export interface GatewayActivity { /** * The custom buttons shown in the Rich Presence (max 2) */ - buttons?: string[] | GatewayActivityButton[]; + buttons?: GatewayActivityButton[] | string[]; } /** @@ -292,7 +292,7 @@ export interface GatewayActivityTimestamps { /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji */ -export type GatewayActivityEmoji = Partial> & Pick; +export type GatewayActivityEmoji = Partial> & Pick; /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party @@ -318,7 +318,7 @@ export type GatewayActivityAssets = Partial< /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets */ -export type GatewayActivitySecrets = Partial>; +export type GatewayActivitySecrets = Partial>; /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags diff --git a/payloads/v10/guild.ts b/payloads/v10/guild.ts index 7bad46f3..cf656067 100644 --- a/payloads/v10/guild.ts +++ b/payloads/v10/guild.ts @@ -121,7 +121,7 @@ export interface APIGuild extends APIPartialGuild { /** * afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600` */ - afk_timeout: 60 | 300 | 900 | 1_800 | 3_600; + afk_timeout: 1_800 | 3_600 | 60 | 300 | 900; /** * `true` if the guild widget is enabled */ @@ -806,7 +806,7 @@ export interface APIGuildIntegration { scopes?: OAuth2Scopes[]; } -export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription'; +export type APIGuildIntegrationType = 'discord' | 'guild_subscription' | 'twitch' | 'youtube'; /** * https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors diff --git a/payloads/v10/guildScheduledEvent.ts b/payloads/v10/guildScheduledEvent.ts index 736be4c1..06db53e6 100644 --- a/payloads/v10/guildScheduledEvent.ts +++ b/payloads/v10/guildScheduledEvent.ts @@ -90,9 +90,9 @@ export interface APIExternalGuildScheduledEvent * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure */ export type APIGuildScheduledEvent = + | APIExternalGuildScheduledEvent | APIStageInstanceGuildScheduledEvent - | APIVoiceGuildScheduledEvent - | APIExternalGuildScheduledEvent; + | APIVoiceGuildScheduledEvent; /** * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata diff --git a/payloads/v10/interactions.ts b/payloads/v10/interactions.ts index 8dc73522..5986877f 100644 --- a/payloads/v10/interactions.ts +++ b/payloads/v10/interactions.ts @@ -32,26 +32,26 @@ export * from './_interactions/responses'; * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object */ export type APIInteraction = - | APIPingInteraction + | APIApplicationCommandAutocompleteInteraction | APIApplicationCommandInteraction | APIMessageComponentInteraction - | APIApplicationCommandAutocompleteInteraction - | APIModalSubmitInteraction; + | APIModalSubmitInteraction + | APIPingInteraction; /** * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object */ export type APIDMInteraction = + | APIApplicationCommandAutocompleteDMInteraction | APIApplicationCommandDMInteraction | APIMessageComponentDMInteraction - | APIApplicationCommandAutocompleteDMInteraction | APIModalSubmitDMInteraction; /** * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object */ export type APIGuildInteraction = + | APIApplicationCommandAutocompleteGuildInteraction | APIApplicationCommandGuildInteraction | APIMessageComponentGuildInteraction - | APIApplicationCommandAutocompleteGuildInteraction | APIModalSubmitGuildInteraction; diff --git a/payloads/v10/invite.ts b/payloads/v10/invite.ts index e4e867f8..d2562862 100644 --- a/payloads/v10/invite.ts +++ b/payloads/v10/invite.ts @@ -11,17 +11,17 @@ import type { APIUser } from './user'; export type APIInviteGuild = Pick< APIGuild, - | 'id' - | 'name' - | 'splash' | 'banner' - | 'icon' - | 'vanity_url_code' | 'description' | 'features' - | 'verification_level' + | 'icon' + | 'id' + | 'name' | 'nsfw_level' | 'premium_subscription_count' + | 'splash' + | 'vanity_url_code' + | 'verification_level' >; /** diff --git a/payloads/v10/sticker.ts b/payloads/v10/sticker.ts index fc83bd20..ca87c7e2 100644 --- a/payloads/v10/sticker.ts +++ b/payloads/v10/sticker.ts @@ -92,7 +92,7 @@ export enum StickerFormatType { /** * https://discord.com/developers/docs/resources/sticker#sticker-item-object */ -export type APIStickerItem = Pick; +export type APIStickerItem = Pick; /** * https://discord.com/developers/docs/resources/sticker#sticker-pack-object diff --git a/payloads/v10/user.ts b/payloads/v10/user.ts index b5cba88d..d499b660 100644 --- a/payloads/v10/user.ts +++ b/payloads/v10/user.ts @@ -316,5 +316,5 @@ export interface APIApplicationRoleConnection { /** * Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected */ - metadata: Record; + metadata: Record; } diff --git a/payloads/v6/auditLog.ts b/payloads/v6/auditLog.ts index 9237683a..7ee1f573 100644 --- a/payloads/v6/auditLog.ts +++ b/payloads/v6/auditLog.ts @@ -176,56 +176,56 @@ export enum AuditLogOptionsType { * @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8. */ export type APIAuditLogChange = - | APIAuditLogChangeKeyName - | APIAuditLogChangeKeyIconHash - | APIAuditLogChangeKeySplashHash - | APIAuditLogChangeKeyOwnerID - | APIAuditLogChangeKeyRegion - | APIAuditLogChangeKeyAFKChannelID - | APIAuditLogChangeKeyAFKTimeout - | APIAuditLogChangeKeyMFALevel - | APIAuditLogChangeKeyVerificationLevel - | APIAuditLogChangeKeyExplicitContentFilter - | APIAuditLogChangeKeyDefaultMessageNotifications - | APIAuditLogChangeKeyVanityURLCode | APIAuditLogChangeKey$Add | APIAuditLogChangeKey$Remove - | APIAuditLogChangeKeyPruneDeleteDays - | APIAuditLogChangeKeyWidgetEnabled - | APIAuditLogChangeKeyWidgetChannelID - | APIAuditLogChangeKeySystemChannelID - | APIAuditLogChangeKeyPosition - | APIAuditLogChangeKeyTopic - | APIAuditLogChangeKeyBitrate - | APIAuditLogChangeKeyPermissionOverwrites - | APIAuditLogChangeKeyNSFW - | APIAuditLogChangeKeyApplicationID - | APIAuditLogChangeKeyRateLimitPerUser - | APIAuditLogChangeKeyPermissions - | APIAuditLogChangeKeyPermissionsNew - | APIAuditLogChangeKeyColor - | APIAuditLogChangeKeyHoist - | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyAFKChannelID + | APIAuditLogChangeKeyAFKTimeout | APIAuditLogChangeKeyAllow | APIAuditLogChangeKeyAllowNew + | APIAuditLogChangeKeyApplicationID + | APIAuditLogChangeKeyAvatarHash + | APIAuditLogChangeKeyBitrate + | APIAuditLogChangeKeyChannelID + | APIAuditLogChangeKeyCode + | APIAuditLogChangeKeyColor + | APIAuditLogChangeKeyDeaf + | APIAuditLogChangeKeyDefaultMessageNotifications | APIAuditLogChangeKeyDeny | APIAuditLogChangeKeyDenyNew - | APIAuditLogChangeKeyCode - | APIAuditLogChangeKeyChannelID - | APIAuditLogChangeKeyInviterID - | APIAuditLogChangeKeyMaxUses - | APIAuditLogChangeKeyUses - | APIAuditLogChangeKeyMaxAge - | APIAuditLogChangeKeyTemporary - | APIAuditLogChangeKeyDeaf - | APIAuditLogChangeKeyMute - | APIAuditLogChangeKeyNick - | APIAuditLogChangeKeyAvatarHash - | APIAuditLogChangeKeyID - | APIAuditLogChangeKeyType | APIAuditLogChangeKeyEnableEmoticons | APIAuditLogChangeKeyExpireBehavior - | APIAuditLogChangeKeyExpireGracePeriod; + | APIAuditLogChangeKeyExpireGracePeriod + | APIAuditLogChangeKeyExplicitContentFilter + | APIAuditLogChangeKeyHoist + | APIAuditLogChangeKeyIconHash + | APIAuditLogChangeKeyID + | APIAuditLogChangeKeyInviterID + | APIAuditLogChangeKeyMaxAge + | APIAuditLogChangeKeyMaxUses + | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyMFALevel + | APIAuditLogChangeKeyMute + | APIAuditLogChangeKeyName + | APIAuditLogChangeKeyNick + | APIAuditLogChangeKeyNSFW + | APIAuditLogChangeKeyOwnerID + | APIAuditLogChangeKeyPermissionOverwrites + | APIAuditLogChangeKeyPermissions + | APIAuditLogChangeKeyPermissionsNew + | APIAuditLogChangeKeyPosition + | APIAuditLogChangeKeyPruneDeleteDays + | APIAuditLogChangeKeyRateLimitPerUser + | APIAuditLogChangeKeyRegion + | APIAuditLogChangeKeySplashHash + | APIAuditLogChangeKeySystemChannelID + | APIAuditLogChangeKeyTemporary + | APIAuditLogChangeKeyTopic + | APIAuditLogChangeKeyType + | APIAuditLogChangeKeyUses + | APIAuditLogChangeKeyVanityURLCode + | APIAuditLogChangeKeyVerificationLevel + | APIAuditLogChangeKeyWidgetChannelID + | APIAuditLogChangeKeyWidgetEnabled; /** * Returned when a guild's name is changed diff --git a/payloads/v6/channel.ts b/payloads/v6/channel.ts index 93d836d2..819a5d73 100644 --- a/payloads/v6/channel.ts +++ b/payloads/v6/channel.ts @@ -78,7 +78,7 @@ export interface APIMessage { attachments: APIAttachment[]; embeds: APIEmbed[]; reactions?: APIReaction[]; - nonce?: string | number; + nonce?: number | string; pinned: boolean; webhook_id?: string; type: MessageType; diff --git a/payloads/v6/gateway.ts b/payloads/v6/gateway.ts index 45319882..ec464afa 100644 --- a/payloads/v6/gateway.ts +++ b/payloads/v6/gateway.ts @@ -123,7 +123,7 @@ export interface GatewayActivityTimestamps { * * @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8. */ -export type GatewayActivityEmoji = Partial> & Pick; +export type GatewayActivityEmoji = Partial> & Pick; /** * https://discord.com/developers/docs/topics/gateway#activity-object-activity-party @@ -149,7 +149,7 @@ export type GatewayActivityAssets = Partial< * * @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8. */ -export type GatewayActivitySecrets = Partial>; +export type GatewayActivitySecrets = Partial>; /** * https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags diff --git a/payloads/v8/auditLog.ts b/payloads/v8/auditLog.ts index 173076d5..956cef72 100644 --- a/payloads/v8/auditLog.ts +++ b/payloads/v8/auditLog.ts @@ -271,70 +271,70 @@ export enum AuditLogOptionsType { * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type APIAuditLogChange = - | APIAuditLogChangeKeyName - | APIAuditLogChangeKeyDescription - | APIAuditLogChangeKeyIconHash - | APIAuditLogChangeKeySplashHash - | APIAuditLogChangeKeyDiscoverySplashHash - | APIAuditLogChangeKeyBannerHash - | APIAuditLogChangeKeyOwnerId - | APIAuditLogChangeKeyRegion - | APIAuditLogChangeKeyPreferredLocale - | APIAuditLogChangeKeyAFKChannelId - | APIAuditLogChangeKeyAFKTimeout - | APIAuditLogChangeKeyRulesChannelId - | APIAuditLogChangeKeyPublicUpdatesChannelId - | APIAuditLogChangeKeyMFALevel - | APIAuditLogChangeKeyVerificationLevel - | APIAuditLogChangeKeyExplicitContentFilter - | APIAuditLogChangeKeyDefaultMessageNotifications - | APIAuditLogChangeKeyVanityURLCode | APIAuditLogChangeKey$Add | APIAuditLogChangeKey$Remove - | APIAuditLogChangeKeyPruneDeleteDays - | APIAuditLogChangeKeyWidgetEnabled - | APIAuditLogChangeKeyWidgetChannelId - | APIAuditLogChangeKeySystemChannelId - | APIAuditLogChangeKeyPosition - | APIAuditLogChangeKeyTopic - | APIAuditLogChangeKeyBitrate - | APIAuditLogChangeKeyPermissionOverwrites - | APIAuditLogChangeKeyNSFW - | APIAuditLogChangeKeyApplicationId - | APIAuditLogChangeKeyRateLimitPerUser - | APIAuditLogChangeKeyPermissions - | APIAuditLogChangeKeyColor - | APIAuditLogChangeKeyHoist - | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyAFKChannelId + | APIAuditLogChangeKeyAFKTimeout | APIAuditLogChangeKeyAllow - | APIAuditLogChangeKeyDeny - | APIAuditLogChangeKeyCode - | APIAuditLogChangeKeyChannelId - | APIAuditLogChangeKeyInviterId - | APIAuditLogChangeKeyMaxUses - | APIAuditLogChangeKeyUses - | APIAuditLogChangeKeyMaxAge - | APIAuditLogChangeKeyTemporary - | APIAuditLogChangeKeyDeaf - | APIAuditLogChangeKeyMute - | APIAuditLogChangeKeyNick - | APIAuditLogChangeKeyAvatarHash - | APIAuditLogChangeKeyId - | APIAuditLogChangeKeyType - | APIAuditLogChangeKeyEnableEmoticons - | APIAuditLogChangeKeyExpireBehavior - | APIAuditLogChangeKeyExpireGracePeriod - | APIAuditLogChangeKeyUserLimit - | APIAuditLogChangeKeyPrivacyLevel - | APIAuditLogChangeKeyTags - | APIAuditLogChangeKeyFormatType + | APIAuditLogChangeKeyApplicationId | APIAuditLogChangeKeyAsset | APIAuditLogChangeKeyAvailable - | APIAuditLogChangeKeyGuildId + | APIAuditLogChangeKeyAvatarHash + | APIAuditLogChangeKeyBannerHash + | APIAuditLogChangeKeyBitrate + | APIAuditLogChangeKeyChannelId + | APIAuditLogChangeKeyCode + | APIAuditLogChangeKeyColor + | APIAuditLogChangeKeyCommunicationDisabledUntil + | APIAuditLogChangeKeyDeaf + | APIAuditLogChangeKeyDefaultMessageNotifications + | APIAuditLogChangeKeyDeny + | APIAuditLogChangeKeyDescription + | APIAuditLogChangeKeyDiscoverySplashHash + | APIAuditLogChangeKeyEnableEmoticons | APIAuditLogChangeKeyEntityType - | APIAuditLogChangeKeyStatus + | APIAuditLogChangeKeyExpireBehavior + | APIAuditLogChangeKeyExpireGracePeriod + | APIAuditLogChangeKeyExplicitContentFilter + | APIAuditLogChangeKeyFormatType + | APIAuditLogChangeKeyGuildId + | APIAuditLogChangeKeyHoist + | APIAuditLogChangeKeyIconHash + | APIAuditLogChangeKeyId + | APIAuditLogChangeKeyInviterId | APIAuditLogChangeKeyLocation - | APIAuditLogChangeKeyCommunicationDisabledUntil; + | APIAuditLogChangeKeyMaxAge + | APIAuditLogChangeKeyMaxUses + | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyMFALevel + | APIAuditLogChangeKeyMute + | APIAuditLogChangeKeyName + | APIAuditLogChangeKeyNick + | APIAuditLogChangeKeyNSFW + | APIAuditLogChangeKeyOwnerId + | APIAuditLogChangeKeyPermissionOverwrites + | APIAuditLogChangeKeyPermissions + | APIAuditLogChangeKeyPosition + | APIAuditLogChangeKeyPreferredLocale + | APIAuditLogChangeKeyPrivacyLevel + | APIAuditLogChangeKeyPruneDeleteDays + | APIAuditLogChangeKeyPublicUpdatesChannelId + | APIAuditLogChangeKeyRateLimitPerUser + | APIAuditLogChangeKeyRegion + | APIAuditLogChangeKeyRulesChannelId + | APIAuditLogChangeKeySplashHash + | APIAuditLogChangeKeyStatus + | APIAuditLogChangeKeySystemChannelId + | APIAuditLogChangeKeyTags + | APIAuditLogChangeKeyTemporary + | APIAuditLogChangeKeyTopic + | APIAuditLogChangeKeyType + | APIAuditLogChangeKeyUserLimit + | APIAuditLogChangeKeyUses + | APIAuditLogChangeKeyVanityURLCode + | APIAuditLogChangeKeyVerificationLevel + | APIAuditLogChangeKeyWidgetChannelId + | APIAuditLogChangeKeyWidgetEnabled; /** * Returned when an entity's name is changed diff --git a/payloads/v8/channel.ts b/payloads/v8/channel.ts index fcb6d850..ce7c63bc 100644 --- a/payloads/v8/channel.ts +++ b/payloads/v8/channel.ts @@ -53,11 +53,11 @@ export type TextChannelType = ChannelType.DM | ChannelType.GroupDM | ChannelType * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type GuildChannelType = Exclude< - | TextChannelType - | ChannelType.GuildVoice - | ChannelType.GuildStageVoice | ChannelType.GuildNews - | ChannelType.GuildStore, + | ChannelType.GuildStageVoice + | ChannelType.GuildStore + | ChannelType.GuildVoice + | TextChannelType, ChannelType.DM | ChannelType.GroupDM >; @@ -218,14 +218,14 @@ export interface APIGroupDMChannel extends APIDMChannelBase * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type APIChannel = - | APIGroupDMChannel | APIDMChannel - | APITextChannel - | APINewsChannel - | APIGuildStoreChannel - | APIVoiceChannel + | APIGroupDMChannel | APIGuildCategoryChannel - | APINewsChannel; + | APIGuildStoreChannel + | APINewsChannel + | APINewsChannel + | APITextChannel + | APIVoiceChannel; /** * https://discord.com/developers/docs/resources/channel#channel-object-channel-types @@ -397,7 +397,7 @@ export interface APIMessage { * **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE` * event to ensure it got sent** */ - nonce?: string | number; + nonce?: number | string; /** * Whether this message is pinned */ @@ -1170,7 +1170,7 @@ export interface APIMessageComponentEmoji { */ export interface APIButtonComponentWithCustomId extends APIButtonComponentBase< - ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger + ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success > { /** * The custom_id to be sent in the interaction when clicked @@ -1327,11 +1327,11 @@ export interface APITextInputComponent extends APIBaseComponent; +export type APIMessageComponent = APIActionRowComponent | APIMessageActionRowComponent; /** * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type APIModalComponent = APIModalActionRowComponent | APIActionRowComponent; +export type APIModalComponent = APIActionRowComponent | APIModalActionRowComponent; /** * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. diff --git a/payloads/v8/gateway.ts b/payloads/v8/gateway.ts index 32a6e5bb..23e59db9 100644 --- a/payloads/v8/gateway.ts +++ b/payloads/v8/gateway.ts @@ -219,7 +219,7 @@ export interface GatewayActivity { /** * The custom buttons shown in the Rich Presence (max 2) */ - buttons?: string[] | GatewayActivityButton[]; + buttons?: GatewayActivityButton[] | string[]; } /** @@ -284,7 +284,7 @@ export interface GatewayActivityTimestamps { * * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type GatewayActivityEmoji = Partial> & Pick; +export type GatewayActivityEmoji = Partial> & Pick; /** * https://discord.com/developers/docs/topics/gateway#activity-object-activity-party @@ -316,7 +316,7 @@ export type GatewayActivityAssets = Partial< * * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type GatewayActivitySecrets = Partial>; +export type GatewayActivitySecrets = Partial>; /** * https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags diff --git a/payloads/v8/guild.ts b/payloads/v8/guild.ts index 36812ae7..d28fd890 100644 --- a/payloads/v8/guild.ts +++ b/payloads/v8/guild.ts @@ -790,7 +790,7 @@ export interface APIGuildIntegration { /** * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type APIGuildInteractionType = 'twitch' | 'youtube' | 'discord'; +export type APIGuildInteractionType = 'discord' | 'twitch' | 'youtube'; /** * https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors diff --git a/payloads/v8/guildScheduledEvent.ts b/payloads/v8/guildScheduledEvent.ts index 3b522335..4d5e98bf 100644 --- a/payloads/v8/guildScheduledEvent.ts +++ b/payloads/v8/guildScheduledEvent.ts @@ -104,9 +104,9 @@ export interface APIExternalGuildScheduledEvent * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type APIGuildScheduledEvent = + | APIExternalGuildScheduledEvent | APIStageInstanceGuildScheduledEvent - | APIVoiceGuildScheduledEvent - | APIExternalGuildScheduledEvent; + | APIVoiceGuildScheduledEvent; /** * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata diff --git a/payloads/v8/interactions.ts b/payloads/v8/interactions.ts index f087072a..67853e62 100644 --- a/payloads/v8/interactions.ts +++ b/payloads/v8/interactions.ts @@ -34,11 +34,11 @@ export * from './_interactions/responses'; * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type APIInteraction = - | APIPingInteraction + | APIApplicationCommandAutocompleteInteraction | APIApplicationCommandInteraction | APIMessageComponentInteraction - | APIApplicationCommandAutocompleteInteraction - | APIModalSubmitInteraction; + | APIModalSubmitInteraction + | APIPingInteraction; /** * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object @@ -46,9 +46,9 @@ export type APIInteraction = * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type APIDMInteraction = + | APIApplicationCommandAutocompleteDMInteraction | APIApplicationCommandDMInteraction | APIMessageComponentDMInteraction - | APIApplicationCommandAutocompleteDMInteraction | APIModalSubmitDMInteraction; /** @@ -57,7 +57,7 @@ export type APIDMInteraction = * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type APIGuildInteraction = + | APIApplicationCommandAutocompleteGuildInteraction | APIApplicationCommandGuildInteraction | APIMessageComponentGuildInteraction - | APIApplicationCommandAutocompleteGuildInteraction | APIModalSubmitGuildInteraction; diff --git a/payloads/v8/invite.ts b/payloads/v8/invite.ts index b7024631..8e7f727d 100644 --- a/payloads/v8/invite.ts +++ b/payloads/v8/invite.ts @@ -11,17 +11,17 @@ import type { APIUser } from './user'; export type APIInviteGuild = Pick< APIGuild, - | 'id' - | 'name' - | 'splash' | 'banner' - | 'icon' - | 'vanity_url_code' | 'description' | 'features' - | 'verification_level' + | 'icon' + | 'id' + | 'name' | 'nsfw_level' | 'premium_subscription_count' + | 'splash' + | 'vanity_url_code' + | 'verification_level' >; /** diff --git a/payloads/v8/sticker.ts b/payloads/v8/sticker.ts index 93f49e5f..57e2f7a1 100644 --- a/payloads/v8/sticker.ts +++ b/payloads/v8/sticker.ts @@ -99,7 +99,7 @@ export enum StickerFormatType { * * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type APIStickerItem = Pick; +export type APIStickerItem = Pick; /** * https://discord.com/developers/docs/resources/sticker#sticker-pack-object diff --git a/payloads/v9/auditLog.ts b/payloads/v9/auditLog.ts index 24e4dad1..25810eed 100644 --- a/payloads/v9/auditLog.ts +++ b/payloads/v9/auditLog.ts @@ -335,82 +335,82 @@ export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`; * https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure */ export type APIAuditLogChange = - | APIAuditLogChangeKeyName - | APIAuditLogChangeKeyDescription - | APIAuditLogChangeKeyIconHash - | APIAuditLogChangeKeyImageHash - | APIAuditLogChangeKeySplashHash - | APIAuditLogChangeKeyDiscoverySplashHash - | APIAuditLogChangeKeyBannerHash - | APIAuditLogChangeKeyOwnerId - | APIAuditLogChangeKeyRegion - | APIAuditLogChangeKeyPreferredLocale - | APIAuditLogChangeKeyAFKChannelId - | APIAuditLogChangeKeyAFKTimeout - | APIAuditLogChangeKeyRulesChannelId - | APIAuditLogChangeKeyPublicUpdatesChannelId - | APIAuditLogChangeKeyMFALevel - | APIAuditLogChangeKeyVerificationLevel - | APIAuditLogChangeKeyExplicitContentFilter - | APIAuditLogChangeKeyDefaultMessageNotifications - | APIAuditLogChangeKeyVanityURLCode | APIAuditLogChangeKey$Add | APIAuditLogChangeKey$Remove - | APIAuditLogChangeKeyPruneDeleteDays - | APIAuditLogChangeKeyWidgetEnabled - | APIAuditLogChangeKeyWidgetChannelId - | APIAuditLogChangeKeySystemChannelId - | APIAuditLogChangeKeyPosition - | APIAuditLogChangeKeyTopic - | APIAuditLogChangeKeyBitrate - | APIAuditLogChangeKeyPermissionOverwrites - | APIAuditLogChangeKeyNSFW - | APIAuditLogChangeKeyApplicationId - | APIAuditLogChangeKeyRateLimitPerUser - | APIAuditLogChangeKeyPermissions - | APIAuditLogChangeKeyColor - | APIAuditLogChangeKeyHoist - | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyActions + | APIAuditLogChangeKeyAFKChannelId + | APIAuditLogChangeKeyAFKTimeout | APIAuditLogChangeKeyAllow - | APIAuditLogChangeKeyDeny - | APIAuditLogChangeKeyCode - | APIAuditLogChangeKeyChannelId - | APIAuditLogChangeKeyInviterId - | APIAuditLogChangeKeyMaxUses - | APIAuditLogChangeKeyUses - | APIAuditLogChangeKeyMaxAge - | APIAuditLogChangeKeyTemporary - | APIAuditLogChangeKeyDeaf - | APIAuditLogChangeKeyMute - | APIAuditLogChangeKeyNick + | APIAuditLogChangeKeyApplicationId + | APIAuditLogChangeKeyArchived + | APIAuditLogChangeKeyAsset + | APIAuditLogChangeKeyAutoArchiveDuration + | APIAuditLogChangeKeyAvailable | APIAuditLogChangeKeyAvatarHash - | APIAuditLogChangeKeyId - | APIAuditLogChangeKeyType + | APIAuditLogChangeKeyBannerHash + | APIAuditLogChangeKeyBitrate + | APIAuditLogChangeKeyChannelId + | APIAuditLogChangeKeyCode + | APIAuditLogChangeKeyColor + | APIAuditLogChangeKeyCommunicationDisabledUntil + | APIAuditLogChangeKeyDeaf + | APIAuditLogChangeKeyDefaultAutoArchiveDuration + | APIAuditLogChangeKeyDefaultMessageNotifications + | APIAuditLogChangeKeyDeny + | APIAuditLogChangeKeyDescription + | APIAuditLogChangeKeyDiscoverySplashHash + | APIAuditLogChangeKeyEnabled | APIAuditLogChangeKeyEnableEmoticons + | APIAuditLogChangeKeyEntityType + | APIAuditLogChangeKeyEventType + | APIAuditLogChangeKeyExemptChannels + | APIAuditLogChangeKeyExemptRoles | APIAuditLogChangeKeyExpireBehavior | APIAuditLogChangeKeyExpireGracePeriod - | APIAuditLogChangeKeyUserLimit - | APIAuditLogChangeKeyPrivacyLevel - | APIAuditLogChangeKeyTags + | APIAuditLogChangeKeyExplicitContentFilter | APIAuditLogChangeKeyFormatType - | APIAuditLogChangeKeyAsset - | APIAuditLogChangeKeyAvailable | APIAuditLogChangeKeyGuildId - | APIAuditLogChangeKeyArchived - | APIAuditLogChangeKeyLocked - | APIAuditLogChangeKeyAutoArchiveDuration - | APIAuditLogChangeKeyDefaultAutoArchiveDuration - | APIAuditLogChangeKeyEntityType - | APIAuditLogChangeKeyStatus + | APIAuditLogChangeKeyHoist + | APIAuditLogChangeKeyIconHash + | APIAuditLogChangeKeyId + | APIAuditLogChangeKeyImageHash + | APIAuditLogChangeKeyInviterId | APIAuditLogChangeKeyLocation - | APIAuditLogChangeKeyCommunicationDisabledUntil - | APIAuditLogChangeKeyTriggerType - | APIAuditLogChangeKeyEventType + | APIAuditLogChangeKeyLocked + | APIAuditLogChangeKeyMaxAge + | APIAuditLogChangeKeyMaxUses + | APIAuditLogChangeKeyMentionable + | APIAuditLogChangeKeyMFALevel + | APIAuditLogChangeKeyMute + | APIAuditLogChangeKeyName + | APIAuditLogChangeKeyNick + | APIAuditLogChangeKeyNSFW + | APIAuditLogChangeKeyOwnerId + | APIAuditLogChangeKeyPermissionOverwrites + | APIAuditLogChangeKeyPermissions + | APIAuditLogChangeKeyPosition + | APIAuditLogChangeKeyPreferredLocale + | APIAuditLogChangeKeyPrivacyLevel + | APIAuditLogChangeKeyPruneDeleteDays + | APIAuditLogChangeKeyPublicUpdatesChannelId + | APIAuditLogChangeKeyRateLimitPerUser + | APIAuditLogChangeKeyRegion + | APIAuditLogChangeKeyRulesChannelId + | APIAuditLogChangeKeySplashHash + | APIAuditLogChangeKeyStatus + | APIAuditLogChangeKeySystemChannelId + | APIAuditLogChangeKeyTags + | APIAuditLogChangeKeyTemporary + | APIAuditLogChangeKeyTopic | APIAuditLogChangeKeyTriggerMetadata - | APIAuditLogChangeKeyActions - | APIAuditLogChangeKeyEnabled - | APIAuditLogChangeKeyExemptRoles - | APIAuditLogChangeKeyExemptChannels; + | APIAuditLogChangeKeyTriggerType + | APIAuditLogChangeKeyType + | APIAuditLogChangeKeyUserLimit + | APIAuditLogChangeKeyUses + | APIAuditLogChangeKeyVanityURLCode + | APIAuditLogChangeKeyVerificationLevel + | APIAuditLogChangeKeyWidgetChannelId + | APIAuditLogChangeKeyWidgetEnabled; /** * Returned when an entity's name is changed diff --git a/payloads/v9/channel.ts b/payloads/v9/channel.ts index 32b21027..db7d2846 100644 --- a/payloads/v9/channel.ts +++ b/payloads/v9/channel.ts @@ -41,15 +41,15 @@ export interface APIChannelBase extends APIPartialChannel } export type TextChannelType = + | ChannelType.AnnouncementThread | ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildAnnouncement - | ChannelType.PublicThread - | ChannelType.PrivateThread - | ChannelType.AnnouncementThread + | ChannelType.GuildStageVoice | ChannelType.GuildText | ChannelType.GuildVoice - | ChannelType.GuildStageVoice; + | ChannelType.PrivateThread + | ChannelType.PublicThread; export type GuildChannelType = Exclude; @@ -110,7 +110,7 @@ export interface APIGuildChannel extends Omit; -export interface APIGuildTextChannel +export interface APIGuildTextChannel extends Omit, 'name'>, APIGuildChannel { /** @@ -134,7 +134,7 @@ export type APIGuildCategoryChannel = APIGuildChannel export interface APIVoiceChannelBase extends APIGuildChannel, - Omit, 'name' | 'last_pin_timestamp'> { + Omit, 'last_pin_timestamp' | 'name'> { /** * The bitrate (in bits) of the voice or stage channel */ @@ -200,7 +200,7 @@ export interface APIGroupDMChannel extends Omit, 'name'>, @@ -369,16 +369,16 @@ export type APIGuildMediaChannel = APIThreadOnlyChannel; * https://discord.com/developers/docs/resources/channel#channel-object-channel-structure */ export type APIChannel = - | APIGroupDMChannel | APIDMChannel - | APITextChannel - | APINewsChannel - | APIGuildVoiceChannel - | APIGuildStageVoiceChannel + | APIGroupDMChannel | APIGuildCategoryChannel - | APIThreadChannel | APIGuildForumChannel - | APIGuildMediaChannel; + | APIGuildMediaChannel + | APIGuildStageVoiceChannel + | APIGuildVoiceChannel + | APINewsChannel + | APITextChannel + | APIThreadChannel; /** * https://discord.com/developers/docs/resources/channel#channel-object-channel-types @@ -599,7 +599,7 @@ export interface APIMessage { * **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE` * event to ensure it got sent** */ - nonce?: string | number; + nonce?: number | string; /** * Whether this message is pinned */ @@ -1563,7 +1563,7 @@ export interface APIMessageComponentEmoji { export interface APIButtonComponentWithCustomId extends APIButtonComponentBase< - ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger + ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success > { /** * The custom_id to be sent in the interaction when clicked @@ -1604,11 +1604,11 @@ export enum TextInputStyle { */ export interface APIBaseSelectMenuComponent< T extends - | ComponentType.StringSelect - | ComponentType.UserSelect - | ComponentType.RoleSelect + | ComponentType.ChannelSelect | ComponentType.MentionableSelect - | ComponentType.ChannelSelect, + | ComponentType.RoleSelect + | ComponentType.StringSelect + | ComponentType.UserSelect, > extends APIBaseComponent { /** * A developer-defined identifier for the select menu, max 100 characters @@ -1640,10 +1640,10 @@ export interface APIBaseSelectMenuComponent< export interface APIBaseAutoPopulatedSelectMenuComponent< T extends - | ComponentType.UserSelect - | ComponentType.RoleSelect + | ComponentType.ChannelSelect | ComponentType.MentionableSelect - | ComponentType.ChannelSelect, + | ComponentType.RoleSelect + | ComponentType.UserSelect, D extends SelectMenuDefaultValueType, > extends APIBaseSelectMenuComponent { /** @@ -1683,7 +1683,7 @@ export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent< */ export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent< ComponentType.MentionableSelect, - SelectMenuDefaultValueType.User | SelectMenuDefaultValueType.Role + SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User >; /** @@ -1724,11 +1724,11 @@ export type APIAutoPopulatedSelectMenuComponent = * https://discord.com/developers/docs/interactions/message-components#select-menus */ export type APISelectMenuComponent = - | APIStringSelectComponent - | APIUserSelectComponent - | APIRoleSelectComponent + | APIChannelSelectComponent | APIMentionableSelectComponent - | APIChannelSelectComponent; + | APIRoleSelectComponent + | APIStringSelectComponent + | APIUserSelectComponent; /** * https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure @@ -1840,8 +1840,8 @@ export enum ChannelFlags { /** * https://discord.com/developers/docs/interactions/message-components#message-components */ -export type APIMessageComponent = APIMessageActionRowComponent | APIActionRowComponent; -export type APIModalComponent = APIModalActionRowComponent | APIActionRowComponent; +export type APIMessageComponent = APIActionRowComponent | APIMessageActionRowComponent; +export type APIModalComponent = APIActionRowComponent | APIModalActionRowComponent; export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent; diff --git a/payloads/v9/gateway.ts b/payloads/v9/gateway.ts index 48d87f47..04af98d8 100644 --- a/payloads/v9/gateway.ts +++ b/payloads/v9/gateway.ts @@ -215,7 +215,7 @@ export interface GatewayActivity { /** * The custom buttons shown in the Rich Presence (max 2) */ - buttons?: string[] | GatewayActivityButton[]; + buttons?: GatewayActivityButton[] | string[]; } /** @@ -280,7 +280,7 @@ export interface GatewayActivityTimestamps { /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji */ -export type GatewayActivityEmoji = Partial> & Pick; +export type GatewayActivityEmoji = Partial> & Pick; /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party @@ -306,7 +306,7 @@ export type GatewayActivityAssets = Partial< /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets */ -export type GatewayActivitySecrets = Partial>; +export type GatewayActivitySecrets = Partial>; /** * https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags diff --git a/payloads/v9/guild.ts b/payloads/v9/guild.ts index 59912747..ff154b02 100644 --- a/payloads/v9/guild.ts +++ b/payloads/v9/guild.ts @@ -121,7 +121,7 @@ export interface APIGuild extends APIPartialGuild { /** * afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600` */ - afk_timeout: 60 | 300 | 900 | 1_800 | 3_600; + afk_timeout: 1_800 | 3_600 | 60 | 300 | 900; /** * `true` if the guild widget is enabled */ @@ -798,7 +798,7 @@ export interface APIGuildIntegration { scopes?: OAuth2Scopes[]; } -export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription'; +export type APIGuildIntegrationType = 'discord' | 'guild_subscription' | 'twitch' | 'youtube'; /** * https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors diff --git a/payloads/v9/guildScheduledEvent.ts b/payloads/v9/guildScheduledEvent.ts index 736be4c1..06db53e6 100644 --- a/payloads/v9/guildScheduledEvent.ts +++ b/payloads/v9/guildScheduledEvent.ts @@ -90,9 +90,9 @@ export interface APIExternalGuildScheduledEvent * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure */ export type APIGuildScheduledEvent = + | APIExternalGuildScheduledEvent | APIStageInstanceGuildScheduledEvent - | APIVoiceGuildScheduledEvent - | APIExternalGuildScheduledEvent; + | APIVoiceGuildScheduledEvent; /** * https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata diff --git a/payloads/v9/interactions.ts b/payloads/v9/interactions.ts index 8dc73522..5986877f 100644 --- a/payloads/v9/interactions.ts +++ b/payloads/v9/interactions.ts @@ -32,26 +32,26 @@ export * from './_interactions/responses'; * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object */ export type APIInteraction = - | APIPingInteraction + | APIApplicationCommandAutocompleteInteraction | APIApplicationCommandInteraction | APIMessageComponentInteraction - | APIApplicationCommandAutocompleteInteraction - | APIModalSubmitInteraction; + | APIModalSubmitInteraction + | APIPingInteraction; /** * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object */ export type APIDMInteraction = + | APIApplicationCommandAutocompleteDMInteraction | APIApplicationCommandDMInteraction | APIMessageComponentDMInteraction - | APIApplicationCommandAutocompleteDMInteraction | APIModalSubmitDMInteraction; /** * https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object */ export type APIGuildInteraction = + | APIApplicationCommandAutocompleteGuildInteraction | APIApplicationCommandGuildInteraction | APIMessageComponentGuildInteraction - | APIApplicationCommandAutocompleteGuildInteraction | APIModalSubmitGuildInteraction; diff --git a/payloads/v9/invite.ts b/payloads/v9/invite.ts index e4e867f8..d2562862 100644 --- a/payloads/v9/invite.ts +++ b/payloads/v9/invite.ts @@ -11,17 +11,17 @@ import type { APIUser } from './user'; export type APIInviteGuild = Pick< APIGuild, - | 'id' - | 'name' - | 'splash' | 'banner' - | 'icon' - | 'vanity_url_code' | 'description' | 'features' - | 'verification_level' + | 'icon' + | 'id' + | 'name' | 'nsfw_level' | 'premium_subscription_count' + | 'splash' + | 'vanity_url_code' + | 'verification_level' >; /** diff --git a/payloads/v9/sticker.ts b/payloads/v9/sticker.ts index fc83bd20..ca87c7e2 100644 --- a/payloads/v9/sticker.ts +++ b/payloads/v9/sticker.ts @@ -92,7 +92,7 @@ export enum StickerFormatType { /** * https://discord.com/developers/docs/resources/sticker#sticker-item-object */ -export type APIStickerItem = Pick; +export type APIStickerItem = Pick; /** * https://discord.com/developers/docs/resources/sticker#sticker-pack-object diff --git a/payloads/v9/user.ts b/payloads/v9/user.ts index 7c2d78c3..a2089dbc 100644 --- a/payloads/v9/user.ts +++ b/payloads/v9/user.ts @@ -316,5 +316,5 @@ export interface APIApplicationRoleConnection { /** * Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected */ - metadata: Record; + metadata: Record; } diff --git a/rest/v10/application.ts b/rest/v10/application.ts index a4879fda..f9145254 100644 --- a/rest/v10/application.ts +++ b/rest/v10/application.ts @@ -25,17 +25,17 @@ export type RESTGetCurrentApplicationResult = APIApplication; * https://discord.com/developers/docs/resources/application#edit-current-application */ export type RESTPatchCurrentApplicationJSONBody = StrictPartial< - Pick< - APIApplication, - | 'custom_install_url' - | 'description' - | 'flags' - | 'role_connections_verification_url' - | 'install_params' - | 'interactions_endpoint_url' - | 'tags' - > & - Nullable> + Nullable> & + Pick< + APIApplication, + | 'custom_install_url' + | 'description' + | 'flags' + | 'install_params' + | 'interactions_endpoint_url' + | 'role_connections_verification_url' + | 'tags' + > >; /** diff --git a/rest/v10/channel.ts b/rest/v10/channel.ts index 1bd4a1d2..5091e578 100644 --- a/rest/v10/channel.ts +++ b/rest/v10/channel.ts @@ -236,8 +236,10 @@ export type RESTGetAPIChannelMessageResult = APIMessage; /** * https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */ -export type APIMessageReferenceSend = StrictPartial & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface>> & { +export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Required> +> & + StrictPartial & { /** * Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message * @@ -309,7 +311,7 @@ export interface RESTPostAPIChannelMessageJSONBody { * * See https://discord.com/developers/docs/resources/sticker#sticker-object */ - sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined; + sticker_ids?: [Snowflake, Snowflake, Snowflake] | [Snowflake, Snowflake] | [Snowflake] | undefined; /** * Attachment objects with filename and description */ @@ -329,13 +331,13 @@ export interface RESTPostAPIChannelMessageJSONBody { * https://discord.com/developers/docs/resources/channel#create-message */ export type RESTPostAPIChannelMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIChannelMessageJSONBody); /** * https://discord.com/developers/docs/resources/channel#create-message @@ -442,13 +444,13 @@ export interface RESTPatchAPIChannelMessageJSONBody { * https://discord.com/developers/docs/resources/channel#edit-message */ export type RESTPatchAPIChannelMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPatchAPIChannelMessageJSONBody); /** * https://discord.com/developers/docs/resources/channel#edit-message diff --git a/rest/v10/guild.ts b/rest/v10/guild.ts index c3ae0143..8db028f3 100644 --- a/rest/v10/guild.ts +++ b/rest/v10/guild.ts @@ -45,22 +45,22 @@ export type APIGuildChannelResolvable = Exclude > & { name: string; @@ -142,15 +142,15 @@ export interface RESTPostAPIGuildsJSONBody { /** * ID for afk channel */ - afk_channel_id?: number | Snowflake | null | undefined; + afk_channel_id?: Snowflake | number | null | undefined; /** * afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600` */ - afk_timeout?: 60 | 300 | 900 | 1_800 | 3_600 | undefined; + afk_timeout?: 1_800 | 3_600 | 60 | 300 | 900 | undefined; /** * The id of the channel where guild notices such as welcome messages and boost events are posted */ - system_channel_id?: number | Snowflake | null | undefined; + system_channel_id?: Snowflake | number | null | undefined; /** * System channel flags * @@ -246,7 +246,7 @@ export interface RESTPatchAPIGuildJSONBody { /** * afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600` */ - afk_timeout?: 60 | 300 | 900 | 1_800 | 3_600 | undefined; + afk_timeout?: 1_800 | 3_600 | 60 | 300 | 900 | undefined; /** * base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature) * @@ -942,20 +942,20 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined; }; -export type RESTAPIModifyGuildOnboardingPromptData = Pick & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Partial> - > & { +export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Partial> +> & + Pick & { /** * Options available within the prompt */ options: RESTAPIModifyGuildOnboardingPromptOptionData[]; }; -export type RESTAPIModifyGuildOnboardingPromptOptionData = Pick & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Partial> - > & { +export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Partial> +> & + Pick & { /** * Emoji id */ diff --git a/rest/v10/index.ts b/rest/v10/index.ts index 8f1b9b81..e7e62a04 100644 --- a/rest/v10/index.ts +++ b/rest/v10/index.ts @@ -473,7 +473,7 @@ export const Routes = { parts.push('threads'); - return parts.join('/') as `/channels/${Snowflake}/threads` | `/channels/${Snowflake}/messages/${Snowflake}/threads`; + return parts.join('/') as `/channels/${Snowflake}/messages/${Snowflake}/threads` | `/channels/${Snowflake}/threads`; }, /** @@ -489,7 +489,7 @@ export const Routes = { * - GET `/channels/{channel.id}/threads/archived/public` * - GET `/channels/{channel.id}/threads/archived/private` */ - channelThreads(channelId: Snowflake, archivedStatus: 'public' | 'private') { + channelThreads(channelId: Snowflake, archivedStatus: 'private' | 'public') { return `/channels/${channelId}/threads/archived/${archivedStatus}` as const; }, @@ -516,8 +516,8 @@ export const Routes = { if (userId) parts.push(userId); return parts.join('/') as - | `/channels/${Snowflake}/thread-members` - | `/channels/${Snowflake}/thread-members/${Snowflake | '@me'}`; + | `/channels/${Snowflake}/thread-members/${Snowflake | '@me'}` + | `/channels/${Snowflake}/thread-members`; }, /** @@ -623,7 +623,7 @@ export const Routes = { if (webhookToken) parts.push(webhookToken); - return parts.join('/') as `/webhooks/${Snowflake}` | `/webhooks/${Snowflake}/${string}`; + return parts.join('/') as `/webhooks/${Snowflake}/${string}` | `/webhooks/${Snowflake}`; }, /** @@ -1213,23 +1213,23 @@ export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5; export type EmojiFormat = Exclude; export type GuildIconFormat = Exclude; -export type GuildSplashFormat = Exclude; -export type GuildDiscoverySplashFormat = Exclude; +export type GuildSplashFormat = Exclude; +export type GuildDiscoverySplashFormat = Exclude; export type GuildBannerFormat = Exclude; export type UserBannerFormat = Exclude; export type DefaultUserAvatar = Extract; export type UserAvatarFormat = Exclude; export type GuildMemberAvatarFormat = Exclude; -export type ApplicationIconFormat = Exclude; -export type ApplicationCoverFormat = Exclude; -export type ApplicationAssetFormat = Exclude; -export type AchievementIconFormat = Exclude; -export type StickerPackBannerFormat = Exclude; -export type TeamIconFormat = Exclude; -export type StorePageAssetFormat = Exclude; -export type StickerFormat = Extract; -export type RoleIconFormat = Exclude; -export type GuildScheduledEventCoverFormat = Exclude; +export type ApplicationIconFormat = Exclude; +export type ApplicationCoverFormat = Exclude; +export type ApplicationAssetFormat = Exclude; +export type AchievementIconFormat = Exclude; +export type StickerPackBannerFormat = Exclude; +export type TeamIconFormat = Exclude; +export type StorePageAssetFormat = Exclude; +export type StickerFormat = Extract; +export type RoleIconFormat = Exclude; +export type GuildScheduledEventCoverFormat = Exclude; export type GuildMemberBannerFormat = Exclude; export interface CDNQuery { diff --git a/rest/v10/interactions.ts b/rest/v10/interactions.ts index e587bfd3..35925892 100644 --- a/rest/v10/interactions.ts +++ b/rest/v10/interactions.ts @@ -42,15 +42,15 @@ export type RESTGetAPIApplicationCommandResult = APIApplicationCommand; type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Omit< APIApplicationCommand, - | 'id' | 'application_id' + | 'default_member_permissions' + | 'description_localized' | 'description' + | 'guild_id' + | 'id' + | 'name_localized' | 'type' | 'version' - | 'guild_id' - | 'name_localized' - | 'description_localized' - | 'default_member_permissions' > & Partial> >; @@ -67,7 +67,7 @@ export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPos * https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */ export interface RESTPostAPIContextMenuApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody { - type: ApplicationCommandType.User | ApplicationCommandType.Message; + type: ApplicationCommandType.Message | ApplicationCommandType.User; } /** @@ -166,13 +166,13 @@ export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse; * https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */ export type RESTPostAPIInteractionCallbackFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionCallbackJSONBody); /** * https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response @@ -208,13 +208,13 @@ export type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallb * https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message */ export type RESTPostAPIInteractionFollowupFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionFollowupJSONBody); /** * https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message diff --git a/rest/v10/monetization.ts b/rest/v10/monetization.ts index 54d800a5..23967cde 100644 --- a/rest/v10/monetization.ts +++ b/rest/v10/monetization.ts @@ -64,7 +64,7 @@ export interface RESTPostAPIEntitlementBody { /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */ -export type RESTPostAPIEntitlementResult = Partial>; +export type RESTPostAPIEntitlementResult = Partial>; /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement diff --git a/rest/v10/oauth2.ts b/rest/v10/oauth2.ts index 29c067ea..fb70aba1 100644 --- a/rest/v10/oauth2.ts +++ b/rest/v10/oauth2.ts @@ -122,8 +122,8 @@ export interface RESTOAuth2BotAuthorizationQuery { */ scope: | OAuth2Scopes.Bot - | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${OAuth2Scopes.Bot}${' ' | '%20'}${string}` + | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`; /** * The permissions you're requesting @@ -151,8 +151,8 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery { */ scope: | OAuth2Scopes.Bot - | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${OAuth2Scopes.Bot}${' ' | '%20'}${string}` + | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`; /** * The required permissions bitfield, stringified diff --git a/rest/v10/user.ts b/rest/v10/user.ts index 13ffd0f9..19e63fb3 100644 --- a/rest/v10/user.ts +++ b/rest/v10/user.ts @@ -129,7 +129,7 @@ export interface RESTPutAPICurrentUserApplicationRoleConnectionJSONBody { /** * Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected */ - metadata?: Record | undefined; + metadata?: Record | undefined; } /** diff --git a/rest/v10/webhook.ts b/rest/v10/webhook.ts index 63220a05..5dc01159 100644 --- a/rest/v10/webhook.ts +++ b/rest/v10/webhook.ts @@ -160,13 +160,13 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { * https://discord.com/developers/docs/resources/webhook#execute-webhook */ export type RESTPostAPIWebhookWithTokenFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIWebhookWithTokenJSONBody); /** * https://discord.com/developers/docs/resources/webhook#execute-webhook-query-string-params @@ -252,7 +252,7 @@ export interface RESTGetAPIWebhookWithTokenMessageQuery { * https://discord.com/developers/docs/resources/webhook#edit-webhook-message */ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Nullable> + Nullable> > & { /** * Attached files to keep @@ -268,13 +268,13 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly * https://discord.com/developers/docs/resources/webhook#edit-webhook-message */ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPatchAPIWebhookWithTokenMessageJSONBody); /** * https://discord.com/developers/docs/resources/webhook#edit-webhook-message diff --git a/rest/v6/guild.ts b/rest/v6/guild.ts index 0687a651..7da704fc 100644 --- a/rest/v6/guild.ts +++ b/rest/v6/guild.ts @@ -29,7 +29,7 @@ export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionsJSO * @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8. */ export type APIGuildCreatePartialChannel = Partial< - Pick + Pick > & { name: string; id?: number | string | undefined; @@ -142,7 +142,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[]; export type RESTPostAPIGuildChannelJSONBody = Partial< Pick< APIChannel, - 'type' | 'permission_overwrites' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user' | 'parent_id' + 'bitrate' | 'nsfw' | 'parent_id' | 'permission_overwrites' | 'rate_limit_per_user' | 'topic' | 'type' | 'user_limit' > > & Required>; diff --git a/rest/v8/channel.ts b/rest/v8/channel.ts index 0f4644b1..2c1b746f 100644 --- a/rest/v8/channel.ts +++ b/rest/v8/channel.ts @@ -176,8 +176,10 @@ export type RESTGetAPIChannelMessageResult = APIMessage; * * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ -export type APIMessageReferenceSend = StrictPartial & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface>> & { +export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Required> +> & + StrictPartial & { /** * Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message * @@ -241,11 +243,11 @@ export interface RESTPostAPIChannelMessageJSONBody { * * See https://discord.com/developers/docs/resources/sticker#sticker-object */ - sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined; + sticker_ids?: [Snowflake, Snowflake, Snowflake] | [Snowflake, Snowflake] | [Snowflake] | undefined; /** * Attachment objects with filename and description */ - attachments?: (Pick & Partial>)[] | undefined; + attachments?: (Partial> & Pick)[] | undefined; /** * Message flags combined as a bitfield */ @@ -258,13 +260,13 @@ export interface RESTPostAPIChannelMessageJSONBody { * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPostAPIChannelMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIChannelMessageJSONBody); /** * https://discord.com/developers/docs/resources/channel#create-message @@ -386,7 +388,7 @@ export interface RESTPatchAPIChannelMessageJSONBody { * * See https://discord.com/developers/docs/resources/channel#attachment-object */ - attachments?: (Pick & Partial>)[] | undefined; + attachments?: (Partial> & Pick)[] | undefined; /** * The components to include with the message * @@ -401,13 +403,13 @@ export interface RESTPatchAPIChannelMessageJSONBody { * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPatchAPIChannelMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPatchAPIChannelMessageJSONBody); /** * https://discord.com/developers/docs/resources/channel#edit-message diff --git a/rest/v8/guild.ts b/rest/v8/guild.ts index 30280904..af95fd69 100644 --- a/rest/v8/guild.ts +++ b/rest/v8/guild.ts @@ -43,7 +43,7 @@ export type APIGuildChannelResolvable = Exclude, - 'type' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user' + 'bitrate' | 'nsfw' | 'rate_limit_per_user' | 'topic' | 'type' | 'user_limit' > > & { name: string; @@ -130,7 +130,7 @@ export interface RESTPostAPIGuildsJSONBody { /** * ID for afk channel */ - afk_channel_id?: number | Snowflake | null | undefined; + afk_channel_id?: Snowflake | number | null | undefined; /** * AFK timeout in seconds */ @@ -138,7 +138,7 @@ export interface RESTPostAPIGuildsJSONBody { /** * The id of the channel where guild notices such as welcome messages and boost events are posted */ - system_channel_id?: number | Snowflake | null | undefined; + system_channel_id?: Snowflake | number | null | undefined; /** * System channel flags * diff --git a/rest/v8/index.ts b/rest/v8/index.ts index 01002eb0..693a4a01 100644 --- a/rest/v8/index.ts +++ b/rest/v8/index.ts @@ -518,7 +518,7 @@ export const Routes = { if (webhookToken) parts.push(webhookToken); - return parts.join('/') as `/webhooks/${Snowflake}` | `/webhooks/${Snowflake}/${string}`; + return parts.join('/') as `/webhooks/${Snowflake}/${string}` | `/webhooks/${Snowflake}`; }, /** diff --git a/rest/v8/interactions.ts b/rest/v8/interactions.ts index fb5fa550..440e17c1 100644 --- a/rest/v8/interactions.ts +++ b/rest/v8/interactions.ts @@ -31,7 +31,7 @@ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[]; export type RESTGetAPIApplicationCommandResult = APIApplicationCommand; type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Omit + Omit >; /** @@ -50,7 +50,7 @@ export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPos * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export interface RESTPostAPIContextMenuApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody { - type: ApplicationCommandType.User | ApplicationCommandType.Message; + type: ApplicationCommandType.Message | ApplicationCommandType.User; } /** @@ -166,13 +166,13 @@ export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse; * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPostAPIInteractionCallbackFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionCallbackJSONBody); /** * https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response @@ -222,13 +222,13 @@ export type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallb * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPostAPIInteractionFollowupFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionFollowupJSONBody); /** * https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message diff --git a/rest/v8/oauth2.ts b/rest/v8/oauth2.ts index c23f85e0..99131f91 100644 --- a/rest/v8/oauth2.ts +++ b/rest/v8/oauth2.ts @@ -150,8 +150,8 @@ export interface RESTOAuth2BotAuthorizationQuery { */ scope: | OAuth2Scopes.Bot - | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${OAuth2Scopes.Bot}${' ' | '%20'}${string}` + | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`; /** * The permissions you're requesting @@ -181,8 +181,8 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery { */ scope: | OAuth2Scopes.Bot - | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${OAuth2Scopes.Bot}${' ' | '%20'}${string}` + | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`; /** * The required permissions bitfield, stringified diff --git a/rest/v8/webhook.ts b/rest/v8/webhook.ts index cb7d743e..dcad50ef 100644 --- a/rest/v8/webhook.ts +++ b/rest/v8/webhook.ts @@ -166,7 +166,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { /** * Attachment objects with filename and description */ - attachments?: (Pick & Partial>)[] | undefined; + attachments?: (Partial> & Pick)[] | undefined; /** * Message flags combined as a bitfield */ @@ -179,13 +179,13 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPostAPIWebhookWithTokenFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIWebhookWithTokenJSONBody); /** * https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params @@ -284,7 +284,7 @@ export type RESTGetAPIWebhookWithTokenMessageResult = APIMessage; * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Nullable> + Nullable> > & { /** * Attached files to keep @@ -293,7 +293,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly * * See https://discord.com/developers/docs/resources/channel#attachment-object */ - attachments?: (Pick & Partial>)[] | undefined; + attachments?: (Partial> & Pick)[] | undefined; }; /** @@ -302,13 +302,13 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPatchAPIWebhookWithTokenMessageJSONBody); /** * https://discord.com/developers/docs/resources/webhook#edit-webhook-message diff --git a/rest/v9/application.ts b/rest/v9/application.ts index 6e50d0d3..25dcb5f1 100644 --- a/rest/v9/application.ts +++ b/rest/v9/application.ts @@ -25,17 +25,17 @@ export type RESTGetCurrentApplicationResult = APIApplication; * https://discord.com/developers/docs/resources/application#edit-current-application */ export type RESTPatchCurrentApplicationJSONBody = StrictPartial< - Pick< - APIApplication, - | 'custom_install_url' - | 'description' - | 'flags' - | 'role_connections_verification_url' - | 'install_params' - | 'interactions_endpoint_url' - | 'tags' - > & - Nullable> + Nullable> & + Pick< + APIApplication, + | 'custom_install_url' + | 'description' + | 'flags' + | 'install_params' + | 'interactions_endpoint_url' + | 'role_connections_verification_url' + | 'tags' + > >; /** diff --git a/rest/v9/channel.ts b/rest/v9/channel.ts index 0645a143..0aa010bb 100644 --- a/rest/v9/channel.ts +++ b/rest/v9/channel.ts @@ -236,8 +236,10 @@ export type RESTGetAPIChannelMessageResult = APIMessage; /** * https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure */ -export type APIMessageReferenceSend = StrictPartial & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface>> & { +export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Required> +> & + StrictPartial & { /** * Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message * @@ -317,7 +319,7 @@ export interface RESTPostAPIChannelMessageJSONBody { * * See https://discord.com/developers/docs/resources/sticker#sticker-object */ - sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined; + sticker_ids?: [Snowflake, Snowflake, Snowflake] | [Snowflake, Snowflake] | [Snowflake] | undefined; /** * Attachment objects with filename and description */ @@ -337,13 +339,13 @@ export interface RESTPostAPIChannelMessageJSONBody { * https://discord.com/developers/docs/resources/channel#create-message */ export type RESTPostAPIChannelMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIChannelMessageJSONBody); /** * https://discord.com/developers/docs/resources/channel#create-message @@ -458,13 +460,13 @@ export interface RESTPatchAPIChannelMessageJSONBody { * https://discord.com/developers/docs/resources/channel#edit-message */ export type RESTPatchAPIChannelMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPatchAPIChannelMessageJSONBody); /** * https://discord.com/developers/docs/resources/channel#edit-message diff --git a/rest/v9/guild.ts b/rest/v9/guild.ts index fc99f74f..e1417da9 100644 --- a/rest/v9/guild.ts +++ b/rest/v9/guild.ts @@ -45,22 +45,22 @@ export type APIGuildChannelResolvable = Exclude > & { name: string; @@ -142,15 +142,15 @@ export interface RESTPostAPIGuildsJSONBody { /** * ID for afk channel */ - afk_channel_id?: number | Snowflake | null | undefined; + afk_channel_id?: Snowflake | number | null | undefined; /** * afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600` */ - afk_timeout?: 60 | 300 | 900 | 1_800 | 3_600 | undefined; + afk_timeout?: 1_800 | 3_600 | 60 | 300 | 900 | undefined; /** * The id of the channel where guild notices such as welcome messages and boost events are posted */ - system_channel_id?: number | Snowflake | null | undefined; + system_channel_id?: Snowflake | number | null | undefined; /** * System channel flags * @@ -246,7 +246,7 @@ export interface RESTPatchAPIGuildJSONBody { /** * afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600` */ - afk_timeout?: 60 | 300 | 900 | 1_800 | 3_600 | undefined; + afk_timeout?: 1_800 | 3_600 | 60 | 300 | 900 | undefined; /** * base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature) * @@ -948,20 +948,20 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined; }; -export type RESTAPIModifyGuildOnboardingPromptData = Pick & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Partial> - > & { +export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Partial> +> & + Pick & { /** * Options available within the prompt */ options: RESTAPIModifyGuildOnboardingPromptOptionData[]; }; -export type RESTAPIModifyGuildOnboardingPromptOptionData = Pick & - AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Partial> - > & { +export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< + Partial> +> & + Pick & { /** * Emoji id */ diff --git a/rest/v9/index.ts b/rest/v9/index.ts index c13dc972..5964ab7a 100644 --- a/rest/v9/index.ts +++ b/rest/v9/index.ts @@ -473,7 +473,7 @@ export const Routes = { parts.push('threads'); - return parts.join('/') as `/channels/${Snowflake}/threads` | `/channels/${Snowflake}/messages/${Snowflake}/threads`; + return parts.join('/') as `/channels/${Snowflake}/messages/${Snowflake}/threads` | `/channels/${Snowflake}/threads`; }, /** @@ -491,7 +491,7 @@ export const Routes = { * - GET `/channels/{channel.id}/threads/archived/public` * - GET `/channels/{channel.id}/threads/archived/private` */ - channelThreads(channelId: Snowflake, archived?: 'public' | 'private') { + channelThreads(channelId: Snowflake, archived?: 'private' | 'public') { const parts = ['', 'channels', channelId, 'threads']; if (archived) parts.push('archived', archived); @@ -499,7 +499,7 @@ export const Routes = { return parts.join('/') as | `/channels/${Snowflake}/threads/active` - | `/channels/${Snowflake}/threads/archived/${'public' | 'private'}`; + | `/channels/${Snowflake}/threads/archived/${'private' | 'public'}`; }, /** @@ -525,8 +525,8 @@ export const Routes = { if (userId) parts.push(userId); return parts.join('/') as - | `/channels/${Snowflake}/thread-members` - | `/channels/${Snowflake}/thread-members/${Snowflake | '@me'}`; + | `/channels/${Snowflake}/thread-members/${Snowflake | '@me'}` + | `/channels/${Snowflake}/thread-members`; }, /** @@ -632,7 +632,7 @@ export const Routes = { if (webhookToken) parts.push(webhookToken); - return parts.join('/') as `/webhooks/${Snowflake}` | `/webhooks/${Snowflake}/${string}`; + return parts.join('/') as `/webhooks/${Snowflake}/${string}` | `/webhooks/${Snowflake}`; }, /** @@ -1222,23 +1222,23 @@ export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5; export type EmojiFormat = Exclude; export type GuildIconFormat = Exclude; -export type GuildSplashFormat = Exclude; -export type GuildDiscoverySplashFormat = Exclude; +export type GuildSplashFormat = Exclude; +export type GuildDiscoverySplashFormat = Exclude; export type GuildBannerFormat = Exclude; export type UserBannerFormat = Exclude; export type DefaultUserAvatar = Extract; export type UserAvatarFormat = Exclude; export type GuildMemberAvatarFormat = Exclude; -export type ApplicationIconFormat = Exclude; -export type ApplicationCoverFormat = Exclude; -export type ApplicationAssetFormat = Exclude; -export type AchievementIconFormat = Exclude; -export type StickerPackBannerFormat = Exclude; -export type StorePageAssetFormat = Exclude; -export type TeamIconFormat = Exclude; -export type StickerFormat = Extract; -export type RoleIconFormat = Exclude; -export type GuildScheduledEventCoverFormat = Exclude; +export type ApplicationIconFormat = Exclude; +export type ApplicationCoverFormat = Exclude; +export type ApplicationAssetFormat = Exclude; +export type AchievementIconFormat = Exclude; +export type StickerPackBannerFormat = Exclude; +export type StorePageAssetFormat = Exclude; +export type TeamIconFormat = Exclude; +export type StickerFormat = Extract; +export type RoleIconFormat = Exclude; +export type GuildScheduledEventCoverFormat = Exclude; export type GuildMemberBannerFormat = Exclude; export interface CDNQuery { diff --git a/rest/v9/interactions.ts b/rest/v9/interactions.ts index 61c743b7..687e3c43 100644 --- a/rest/v9/interactions.ts +++ b/rest/v9/interactions.ts @@ -42,15 +42,15 @@ export type RESTGetAPIApplicationCommandResult = APIApplicationCommand; type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< Omit< APIApplicationCommand, - | 'id' | 'application_id' + | 'default_member_permissions' + | 'description_localized' | 'description' + | 'guild_id' + | 'id' + | 'name_localized' | 'type' | 'version' - | 'guild_id' - | 'name_localized' - | 'description_localized' - | 'default_member_permissions' > & Partial> >; @@ -67,7 +67,7 @@ export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPos * https://discord.com/developers/docs/interactions/application-commands#create-global-application-command */ export interface RESTPostAPIContextMenuApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody { - type: ApplicationCommandType.User | ApplicationCommandType.Message; + type: ApplicationCommandType.Message | ApplicationCommandType.User; } /** @@ -166,13 +166,13 @@ export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse; * https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response */ export type RESTPostAPIInteractionCallbackFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionCallbackJSONBody); /** * https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response @@ -208,13 +208,13 @@ export type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallb * https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message */ export type RESTPostAPIInteractionFollowupFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionFollowupJSONBody); /** * https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message diff --git a/rest/v9/monetization.ts b/rest/v9/monetization.ts index 54d800a5..23967cde 100644 --- a/rest/v9/monetization.ts +++ b/rest/v9/monetization.ts @@ -64,7 +64,7 @@ export interface RESTPostAPIEntitlementBody { /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement */ -export type RESTPostAPIEntitlementResult = Partial>; +export type RESTPostAPIEntitlementResult = Partial>; /** * https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement diff --git a/rest/v9/oauth2.ts b/rest/v9/oauth2.ts index 1fbeb561..8ad1fb75 100644 --- a/rest/v9/oauth2.ts +++ b/rest/v9/oauth2.ts @@ -122,8 +122,8 @@ export interface RESTOAuth2BotAuthorizationQuery { */ scope: | OAuth2Scopes.Bot - | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${OAuth2Scopes.Bot}${' ' | '%20'}${string}` + | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`; /** * The permissions you're requesting @@ -151,8 +151,8 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery { */ scope: | OAuth2Scopes.Bot - | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${OAuth2Scopes.Bot}${' ' | '%20'}${string}` + | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}` | `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`; /** * The required permissions bitfield, stringified diff --git a/rest/v9/user.ts b/rest/v9/user.ts index 89924dbf..756e9e72 100644 --- a/rest/v9/user.ts +++ b/rest/v9/user.ts @@ -129,7 +129,7 @@ export interface RESTPutAPICurrentUserApplicationRoleConnectionJSONBody { /** * Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected */ - metadata?: Record | undefined; + metadata?: Record | undefined; } /** diff --git a/rest/v9/webhook.ts b/rest/v9/webhook.ts index 6bb6c96f..e0a8099c 100644 --- a/rest/v9/webhook.ts +++ b/rest/v9/webhook.ts @@ -160,13 +160,13 @@ export interface RESTPostAPIWebhookWithTokenJSONBody { * https://discord.com/developers/docs/resources/webhook#execute-webhook */ export type RESTPostAPIWebhookWithTokenFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPostAPIWebhookWithTokenJSONBody); /** * https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params @@ -252,7 +252,7 @@ export interface RESTGetAPIWebhookWithTokenMessageQuery { * https://discord.com/developers/docs/resources/webhook#edit-webhook-message */ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface< - Nullable> + Nullable> > & { /** * Attached files to keep @@ -268,13 +268,13 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly * https://discord.com/developers/docs/resources/webhook#edit-webhook-message */ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody = - | ({ + | (Record<`files[${bigint}]`, unknown> & { /** * JSON stringified message body */ payload_json?: string | undefined; - } & Record<`files[${bigint}]`, unknown>) - | (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>); + }) + | (Record<`files[${bigint}]`, unknown> & RESTPatchAPIWebhookWithTokenMessageJSONBody); /** * https://discord.com/developers/docs/resources/webhook#edit-webhook-message diff --git a/scripts/actions/create-release.mjs b/scripts/actions/create-release.mjs index 5dc91d58..57cf24f9 100644 --- a/scripts/actions/create-release.mjs +++ b/scripts/actions/create-release.mjs @@ -19,6 +19,7 @@ const previousReleases = await octokit.repos.listReleases({ }); // Releases are sorted from newest to oldest, this should work™️ +// eslint-disable-next-line no-shadow -- are you stupid or are you high, line 80 is in fuck all compared to you const previousRelease = previousReleases.data.find((release) => !release.draft); console.log('👀 Previous release version:', previousRelease?.tag_name); diff --git a/website/.prettierrc.js b/website/.prettierrc.mjs similarity index 74% rename from website/.prettierrc.js rename to website/.prettierrc.mjs index f10e2de2..f1f5dc0f 100644 --- a/website/.prettierrc.js +++ b/website/.prettierrc.mjs @@ -1,6 +1,6 @@ -const sapphirePrettierConfig = require('@sapphire/prettier-config'); +import sapphirePrettierConfig from '@sapphire/prettier-config'; -module.exports = { +export default { ...sapphirePrettierConfig, overrides: [ ...sapphirePrettierConfig.overrides, diff --git a/website/src/components/Common/LoadingSkeleton.module.css b/website/src/components/Common/LoadingSkeleton.module.css index 8393aff9..a3495678 100644 --- a/website/src/components/Common/LoadingSkeleton.module.css +++ b/website/src/components/Common/LoadingSkeleton.module.css @@ -9,20 +9,50 @@ background: linear-gradient(0.25turn, transparent, #fff, transparent), linear-gradient(#eee, #eee), linear-gradient(#eee, #eee), linear-gradient(#eee, #eee), linear-gradient(#eee, #eee), linear-gradient(#eee, #eee); background-repeat: no-repeat; - background-size: 315px 210px, 315px 30px, 315px 30px, 315px 30px, 315px 30px, 315px 30px; - background-position: -315px 0, 0 0, 0 45px, 0 90px, 0 135px, 0 180px; + background-size: + 315px 210px, + 315px 30px, + 315px 30px, + 315px 30px, + 315px 30px, + 315px 30px; + background-position: + -315px 0, + 0 0, + 0 45px, + 0 90px, + 0 135px, + 0 180px; } .darkLoadingSkeleton { background: linear-gradient(0.25turn, transparent, #444, transparent), linear-gradient(#333, #333), linear-gradient(#333, #333), linear-gradient(#333, #333), linear-gradient(#333, #333), linear-gradient(#333, #333); background-repeat: no-repeat; - background-size: 315px 210px, 315px 30px, 315px 30px, 315px 30px, 315px 30px, 315px 30px; - background-position: -315px 0, 0 0, 0 45px, 0 90px, 0 135px, 0 180px; + background-size: + 315px 210px, + 315px 30px, + 315px 30px, + 315px 30px, + 315px 30px, + 315px 30px; + background-position: + -315px 0, + 0 0, + 0 45px, + 0 90px, + 0 135px, + 0 180px; } @keyframes loading { to { - background-position: 315px 0, 0 0, 0 45px, 0 90px, 0 135px, 0 180px; + background-position: + 315px 0, + 0 0, + 0 45px, + 0 90px, + 0 135px, + 0 180px; } }