mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-22 19:30:09 +00:00
Compare commits
63 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ef182d009 | ||
|
|
86a9f965dd | ||
|
|
b90fddc285 | ||
|
|
f67043b3f4 | ||
|
|
19d2aeb4a8 | ||
|
|
31b3766b19 | ||
|
|
1b1a865efe | ||
|
|
a85521aa8b | ||
|
|
8b00031c51 | ||
|
|
147e459a16 | ||
|
|
fbfbc6b23f | ||
|
|
906dd8e241 | ||
|
|
25efb9c403 | ||
|
|
822956fe78 | ||
|
|
d5047639e6 | ||
|
|
cbd8d108ee | ||
|
|
d816bf31ab | ||
|
|
71602b5c49 | ||
|
|
6ead98b782 | ||
|
|
ea1a6c3c86 | ||
|
|
a59f9f002f | ||
|
|
ace41f38e4 | ||
|
|
25a6f5330f | ||
|
|
4409fc24c1 | ||
|
|
1178c23389 | ||
|
|
34b0ddd105 | ||
|
|
9c1fc9bdee | ||
|
|
472fe5f837 | ||
|
|
588140c0a9 | ||
|
|
799044d3f0 | ||
|
|
eb7b3d90dd | ||
|
|
2c1ff0ea34 | ||
|
|
5f22a6baca | ||
|
|
cbcd51d093 | ||
|
|
4f66b4dd04 | ||
|
|
da9496f291 | ||
|
|
b1e1c60a07 | ||
|
|
4fdc6db296 | ||
|
|
608f0fa8cd | ||
|
|
0e8b624c3e | ||
|
|
1301b3417c | ||
|
|
e098870a08 | ||
|
|
2049dde09a | ||
|
|
ea7cafaafa | ||
|
|
c05998de27 | ||
|
|
f50ae60ea9 | ||
|
|
0ebf2afb58 | ||
|
|
ee09eafb76 | ||
|
|
a7fac3dc04 | ||
|
|
1fd407f481 | ||
|
|
aa8e307f4d | ||
|
|
897fd90bf2 | ||
|
|
666f0e79bc | ||
|
|
c9117a7bcc | ||
|
|
fe7ba16e3c | ||
|
|
643bf747be | ||
|
|
0340b3c3a1 | ||
|
|
45ef182b79 | ||
|
|
17c19750ae | ||
|
|
088dbe016f | ||
|
|
e3eb86936e | ||
|
|
d201436233 | ||
|
|
d63bea7dfc |
@@ -37,6 +37,9 @@ const schema = [
|
||||
},
|
||||
] as const;
|
||||
|
||||
const REST_TYPE_NAME_REGEX =
|
||||
/^REST(?:Get|Patch|Post|Put|Delete)[a-zA-Z0-9]+(?:JSONBody|FormDataBody|URLEncodedData|Result|Query)$/;
|
||||
|
||||
export = {
|
||||
rules: {
|
||||
'explicitly-optional-undefined-properties': ESLintUtils.RuleCreator.withoutDocs<Options, 'missingOptional'>({
|
||||
@@ -131,5 +134,54 @@ export = {
|
||||
},
|
||||
defaultOptions: [{ interfaceEndings: [] }],
|
||||
}),
|
||||
'rest-type-naming-convention': ESLintUtils.RuleCreator.withoutDocs<[{ whitelist: string[] }], 'invalidName'>({
|
||||
create: (context) => {
|
||||
const { whitelist } = context.options[0];
|
||||
const whitelistSet = new Set(whitelist);
|
||||
|
||||
return {
|
||||
'TSTypeAliasDeclaration, TSInterfaceDeclaration': (
|
||||
node: TSESTree.TSTypeAliasDeclaration | TSESTree.TSInterfaceDeclaration,
|
||||
) => {
|
||||
if (node.id.type !== AST_NODE_TYPES.Identifier) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { name } = node.id;
|
||||
if (whitelistSet.has(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!REST_TYPE_NAME_REGEX.test(name)) {
|
||||
context.report({
|
||||
node: node.id,
|
||||
messageId: 'invalidName',
|
||||
data: { name },
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
meta: {
|
||||
messages: {
|
||||
invalidName: `{{ name }} does not match REST type naming convention. Must match ${REST_TYPE_NAME_REGEX.source}.`,
|
||||
},
|
||||
type: 'problem',
|
||||
schema: [
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
whitelist: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
] as const,
|
||||
},
|
||||
defaultOptions: [{ whitelist: [] }],
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1 +1,12 @@
|
||||
deno/
|
||||
|
||||
gateway/v6/*
|
||||
payloads/v6/*
|
||||
rest/v6/*
|
||||
v6.ts
|
||||
|
||||
gateway/v8/*
|
||||
payloads/v8/*
|
||||
rest/v8/*
|
||||
utils/v8.ts
|
||||
v8.ts
|
||||
|
||||
@@ -17,5 +17,54 @@
|
||||
"typescript-sort-keys/string-enum": "off",
|
||||
"unicorn/prefer-math-trunc": "off",
|
||||
"jsdoc/no-undefined-types": "off"
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["rest/v10/*.ts", "rest/v9/*.ts"],
|
||||
"excludedFiles": ["rest/v10/index.ts", "rest/v9/index.ts"],
|
||||
"rules": {
|
||||
"local/rest-type-naming-convention": [
|
||||
"error",
|
||||
{
|
||||
"whitelist": [
|
||||
"RESTAPIAttachment",
|
||||
"RESTAPIChannelPatchOverwrite",
|
||||
"RESTAPIGuildChannelResolvable",
|
||||
"RESTAPIGuildCreateOverwrite",
|
||||
"RESTAPIGuildCreatePartialChannel",
|
||||
"RESTAPIGuildCreateRole",
|
||||
"RESTAPIGuildOnboardingPrompt",
|
||||
"RESTAPIGuildOnboardingPromptOption",
|
||||
"RESTAPIMessageReference",
|
||||
"RESTAPIPartialCurrentUserGuild",
|
||||
"RESTAPIPoll",
|
||||
|
||||
"RESTOAuth2AdvancedBotAuthorizationQuery",
|
||||
"RESTOAuth2AdvancedBotAuthorizationQueryResult",
|
||||
"RESTOAuth2AuthorizationQuery",
|
||||
"RESTOAuth2BotAuthorizationQuery",
|
||||
"RESTOAuth2ImplicitAuthorizationQuery",
|
||||
"RESTOAuth2ImplicitAuthorizationURLFragmentResult",
|
||||
|
||||
// Deprecated types
|
||||
"APIChannelPatchOverwrite",
|
||||
"APIGuildChannelResolvable",
|
||||
"APIGuildCreateOverwrite",
|
||||
"APIGuildCreatePartialChannel",
|
||||
"APIGuildCreateRole",
|
||||
"APIMessageReferenceSend",
|
||||
"GetAPIVoiceRegionsResult",
|
||||
"RESTAPIModifyGuildOnboardingPromptData",
|
||||
"RESTAPIModifyGuildOnboardingPromptOptionData",
|
||||
"RESTAPIPollCreate",
|
||||
"RESTDeleteAPIChannelMessageOwnReaction",
|
||||
"RESTGetAPIStickerPack",
|
||||
"RESTOAuth2AuthorizationQueryResult",
|
||||
"RESTPostAPIEntitlementBody"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -24,3 +24,15 @@ CHANGELOG.md
|
||||
# Format all of scripts
|
||||
!scripts/**/*
|
||||
!.prettierrc.mjs
|
||||
|
||||
# Deprecated versions
|
||||
gateway/v6/*
|
||||
payloads/v6/*
|
||||
rest/v6/*
|
||||
v6.ts
|
||||
|
||||
gateway/v8/*
|
||||
payloads/v8/*
|
||||
rest/v8/*
|
||||
utils/v8.ts
|
||||
v8.ts
|
||||
|
||||
95
CHANGELOG.md
95
CHANGELOG.md
@@ -1,3 +1,98 @@
|
||||
## [0.37.97](https://github.com/discordjs/discord-api-types/compare/0.37.96...0.37.97) (2024-08-22)
|
||||
|
||||
|
||||
|
||||
## [0.37.96](https://github.com/discordjs/discord-api-types/compare/0.37.95...0.37.96) (2024-08-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* nullable `recurrence_rule` on patch ([#1063](https://github.com/discordjs/discord-api-types/issues/1063)) ([19d2aeb](https://github.com/discordjs/discord-api-types/commit/19d2aeb4a82dc781558240a674c36eadce270abf))
|
||||
* nullable fields for scheduled event editing ([#1064](https://github.com/discordjs/discord-api-types/issues/1064)) ([f67043b](https://github.com/discordjs/discord-api-types/commit/f67043b3f46eea7286e959d223b78d140deac318))
|
||||
|
||||
|
||||
|
||||
## [0.37.95](https://github.com/discordjs/discord-api-types/compare/0.37.94...0.37.95) (2024-08-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* interface name ([#1059](https://github.com/discordjs/discord-api-types/issues/1059)) ([147e459](https://github.com/discordjs/discord-api-types/commit/147e459a16c8b0e15a0dd50f75d62c6dd9098815))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* recurring scheduled events ([#1058](https://github.com/discordjs/discord-api-types/issues/1058)) ([fbfbc6b](https://github.com/discordjs/discord-api-types/commit/fbfbc6b23f2696f6db5fad8ea1543327d5b3cf07))
|
||||
* **RESTJSONErrorCodes:** `UnknownStickerPack` ([#1055](https://github.com/discordjs/discord-api-types/issues/1055)) ([906dd8e](https://github.com/discordjs/discord-api-types/commit/906dd8e241be6acdf4d6d7b10ce4e7c139b0fd8b))
|
||||
* **Routes:** voice state endpoint ([#1046](https://github.com/discordjs/discord-api-types/issues/1046)) ([1b1a865](https://github.com/discordjs/discord-api-types/commit/1b1a865efe4d95b34055616ed18dc3613b58f317))
|
||||
|
||||
|
||||
|
||||
## [0.37.94](https://github.com/discordjs/discord-api-types/compare/0.37.93...0.37.94) (2024-08-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add Get Sticker Pack endpoint ([#1053](https://github.com/discordjs/discord-api-types/issues/1053)) ([822956f](https://github.com/discordjs/discord-api-types/commit/822956fe788f8eeda5da683189973bd6667cbc96))
|
||||
* **APIApplication:** `approximate_user_install_count` ([#1052](https://github.com/discordjs/discord-api-types/issues/1052)) ([d504763](https://github.com/discordjs/discord-api-types/commit/d5047639e691cc26e865cc6c06a312e09f0fb4c7))
|
||||
* **RESTOAuth2:** add RESTPostOAuth2TokenRevocationQuery ([#1050](https://github.com/discordjs/discord-api-types/issues/1050)) ([6ead98b](https://github.com/discordjs/discord-api-types/commit/6ead98b78218830fee308a0425d9078957a662b2))
|
||||
* **Routes:** get method on role endpoint ([#1051](https://github.com/discordjs/discord-api-types/issues/1051)) ([ea1a6c3](https://github.com/discordjs/discord-api-types/commit/ea1a6c3c86ec0d4c663e2191a488a3716ecdd7cc))
|
||||
|
||||
|
||||
|
||||
## [0.37.93](https://github.com/discordjs/discord-api-types/compare/0.37.92...0.37.93) (2024-07-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **CDNRoutes:** inconsistency in route and wrong JSDoc ([#1033](https://github.com/discordjs/discord-api-types/issues/1033)) ([eb7b3d9](https://github.com/discordjs/discord-api-types/commit/eb7b3d90dd6a847b80d051006a597e77d70caab2))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for message forwarding ([#971](https://github.com/discordjs/discord-api-types/issues/971)) ([2c1ff0e](https://github.com/discordjs/discord-api-types/commit/2c1ff0ea3443fb500315d6c69674a875a11addf6))
|
||||
* application emojis ([#1036](https://github.com/discordjs/discord-api-types/issues/1036)) ([5f22a6b](https://github.com/discordjs/discord-api-types/commit/5f22a6bacabef6b11e170a6f67694359bb3180e8))
|
||||
* **ConnectionService:** add `Roblox` ([#1032](https://github.com/discordjs/discord-api-types/issues/1032)) ([4f66b4d](https://github.com/discordjs/discord-api-types/commit/4f66b4dd049d2ace638374c09a06272bd517ad3a))
|
||||
* **RESTAPIPartialCurrentUserGuild:** add `banner` ([#1028](https://github.com/discordjs/discord-api-types/issues/1028)) ([da9496f](https://github.com/discordjs/discord-api-types/commit/da9496f291fff364b8d35b02363b93933c19823a))
|
||||
|
||||
|
||||
|
||||
## [0.37.92](https://github.com/discordjs/discord-api-types/compare/0.37.91...0.37.92) (2024-07-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **RESTAPIPollCreate:** optional properties ([#1022](https://github.com/discordjs/discord-api-types/issues/1022)) ([c05998d](https://github.com/discordjs/discord-api-types/commit/c05998de274ef7a8d570db9d23c9ad9c228eeccc))
|
||||
|
||||
|
||||
|
||||
## [0.37.91](https://github.com/discordjs/discord-api-types/compare/0.37.90...0.37.91) (2024-06-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIAttachment:** add `title` ([#1015](https://github.com/discordjs/discord-api-types/issues/1015)) ([897fd90](https://github.com/discordjs/discord-api-types/commit/897fd90bf2705d6ff5eebbb21fa8e735fc1e1e22))
|
||||
|
||||
|
||||
|
||||
## [0.37.90](https://github.com/discordjs/discord-api-types/compare/0.37.89...0.37.90) (2024-06-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add premium buttons ([#1010](https://github.com/discordjs/discord-api-types/issues/1010)) ([088dbe0](https://github.com/discordjs/discord-api-types/commit/088dbe016fdb72fb751931938bf7240c34fa64c0))
|
||||
|
||||
|
||||
|
||||
## [0.37.89](https://github.com/discordjs/discord-api-types/compare/0.37.88...0.37.89) (2024-06-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add use external apps permission ([#999](https://github.com/discordjs/discord-api-types/issues/999)) ([d63bea7](https://github.com/discordjs/discord-api-types/commit/d63bea7dfc748472b2e5ed4e2d45752acc1a3d2a))
|
||||
|
||||
|
||||
|
||||
## [0.37.88](https://github.com/discordjs/discord-api-types/compare/0.37.87...0.37.88) (2024-06-10)
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,98 @@
|
||||
## [0.37.97](https://github.com/discordjs/discord-api-types/compare/0.37.96...0.37.97) (2024-08-22)
|
||||
|
||||
|
||||
|
||||
## [0.37.96](https://github.com/discordjs/discord-api-types/compare/0.37.95...0.37.96) (2024-08-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* nullable `recurrence_rule` on patch ([#1063](https://github.com/discordjs/discord-api-types/issues/1063)) ([19d2aeb](https://github.com/discordjs/discord-api-types/commit/19d2aeb4a82dc781558240a674c36eadce270abf))
|
||||
* nullable fields for scheduled event editing ([#1064](https://github.com/discordjs/discord-api-types/issues/1064)) ([f67043b](https://github.com/discordjs/discord-api-types/commit/f67043b3f46eea7286e959d223b78d140deac318))
|
||||
|
||||
|
||||
|
||||
## [0.37.95](https://github.com/discordjs/discord-api-types/compare/0.37.94...0.37.95) (2024-08-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* interface name ([#1059](https://github.com/discordjs/discord-api-types/issues/1059)) ([147e459](https://github.com/discordjs/discord-api-types/commit/147e459a16c8b0e15a0dd50f75d62c6dd9098815))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* recurring scheduled events ([#1058](https://github.com/discordjs/discord-api-types/issues/1058)) ([fbfbc6b](https://github.com/discordjs/discord-api-types/commit/fbfbc6b23f2696f6db5fad8ea1543327d5b3cf07))
|
||||
* **RESTJSONErrorCodes:** `UnknownStickerPack` ([#1055](https://github.com/discordjs/discord-api-types/issues/1055)) ([906dd8e](https://github.com/discordjs/discord-api-types/commit/906dd8e241be6acdf4d6d7b10ce4e7c139b0fd8b))
|
||||
* **Routes:** voice state endpoint ([#1046](https://github.com/discordjs/discord-api-types/issues/1046)) ([1b1a865](https://github.com/discordjs/discord-api-types/commit/1b1a865efe4d95b34055616ed18dc3613b58f317))
|
||||
|
||||
|
||||
|
||||
## [0.37.94](https://github.com/discordjs/discord-api-types/compare/0.37.93...0.37.94) (2024-08-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add Get Sticker Pack endpoint ([#1053](https://github.com/discordjs/discord-api-types/issues/1053)) ([822956f](https://github.com/discordjs/discord-api-types/commit/822956fe788f8eeda5da683189973bd6667cbc96))
|
||||
* **APIApplication:** `approximate_user_install_count` ([#1052](https://github.com/discordjs/discord-api-types/issues/1052)) ([d504763](https://github.com/discordjs/discord-api-types/commit/d5047639e691cc26e865cc6c06a312e09f0fb4c7))
|
||||
* **RESTOAuth2:** add RESTPostOAuth2TokenRevocationQuery ([#1050](https://github.com/discordjs/discord-api-types/issues/1050)) ([6ead98b](https://github.com/discordjs/discord-api-types/commit/6ead98b78218830fee308a0425d9078957a662b2))
|
||||
* **Routes:** get method on role endpoint ([#1051](https://github.com/discordjs/discord-api-types/issues/1051)) ([ea1a6c3](https://github.com/discordjs/discord-api-types/commit/ea1a6c3c86ec0d4c663e2191a488a3716ecdd7cc))
|
||||
|
||||
|
||||
|
||||
## [0.37.93](https://github.com/discordjs/discord-api-types/compare/0.37.92...0.37.93) (2024-07-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **CDNRoutes:** inconsistency in route and wrong JSDoc ([#1033](https://github.com/discordjs/discord-api-types/issues/1033)) ([eb7b3d9](https://github.com/discordjs/discord-api-types/commit/eb7b3d90dd6a847b80d051006a597e77d70caab2))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for message forwarding ([#971](https://github.com/discordjs/discord-api-types/issues/971)) ([2c1ff0e](https://github.com/discordjs/discord-api-types/commit/2c1ff0ea3443fb500315d6c69674a875a11addf6))
|
||||
* application emojis ([#1036](https://github.com/discordjs/discord-api-types/issues/1036)) ([5f22a6b](https://github.com/discordjs/discord-api-types/commit/5f22a6bacabef6b11e170a6f67694359bb3180e8))
|
||||
* **ConnectionService:** add `Roblox` ([#1032](https://github.com/discordjs/discord-api-types/issues/1032)) ([4f66b4d](https://github.com/discordjs/discord-api-types/commit/4f66b4dd049d2ace638374c09a06272bd517ad3a))
|
||||
* **RESTAPIPartialCurrentUserGuild:** add `banner` ([#1028](https://github.com/discordjs/discord-api-types/issues/1028)) ([da9496f](https://github.com/discordjs/discord-api-types/commit/da9496f291fff364b8d35b02363b93933c19823a))
|
||||
|
||||
|
||||
|
||||
## [0.37.92](https://github.com/discordjs/discord-api-types/compare/0.37.91...0.37.92) (2024-07-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **RESTAPIPollCreate:** optional properties ([#1022](https://github.com/discordjs/discord-api-types/issues/1022)) ([c05998d](https://github.com/discordjs/discord-api-types/commit/c05998de274ef7a8d570db9d23c9ad9c228eeccc))
|
||||
|
||||
|
||||
|
||||
## [0.37.91](https://github.com/discordjs/discord-api-types/compare/0.37.90...0.37.91) (2024-06-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIAttachment:** add `title` ([#1015](https://github.com/discordjs/discord-api-types/issues/1015)) ([897fd90](https://github.com/discordjs/discord-api-types/commit/897fd90bf2705d6ff5eebbb21fa8e735fc1e1e22))
|
||||
|
||||
|
||||
|
||||
## [0.37.90](https://github.com/discordjs/discord-api-types/compare/0.37.89...0.37.90) (2024-06-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add premium buttons ([#1010](https://github.com/discordjs/discord-api-types/issues/1010)) ([088dbe0](https://github.com/discordjs/discord-api-types/commit/088dbe016fdb72fb751931938bf7240c34fa64c0))
|
||||
|
||||
|
||||
|
||||
## [0.37.89](https://github.com/discordjs/discord-api-types/compare/0.37.88...0.37.89) (2024-06-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add use external apps permission ([#999](https://github.com/discordjs/discord-api-types/issues/999)) ([d63bea7](https://github.com/discordjs/discord-api-types/commit/d63bea7dfc748472b2e5ed4e2d45752acc1a3d2a))
|
||||
|
||||
|
||||
|
||||
## [0.37.88](https://github.com/discordjs/discord-api-types/compare/0.37.87...0.37.88) (2024-06-10)
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import type {
|
||||
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
|
||||
GatewayThreadListSync as RawGatewayThreadListSync,
|
||||
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
|
||||
GatewayVoiceState,
|
||||
APIVoiceState,
|
||||
InviteTargetType,
|
||||
PresenceUpdateStatus,
|
||||
AutoModerationRuleTriggerType,
|
||||
@@ -785,7 +785,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
voice_states: Omit<GatewayVoiceState, 'guild_id'>[];
|
||||
voice_states: Omit<APIVoiceState, 'guild_id'>[];
|
||||
/**
|
||||
* Users in the guild
|
||||
*
|
||||
@@ -1748,7 +1748,7 @@ export type GatewayVoiceStateUpdateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
|
||||
*/
|
||||
export type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState;
|
||||
export type GatewayVoiceStateUpdateDispatchData = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#voice-server-update
|
||||
|
||||
@@ -28,7 +28,7 @@ import type {
|
||||
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
|
||||
GatewayThreadListSync as RawGatewayThreadListSync,
|
||||
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
|
||||
GatewayVoiceState,
|
||||
APIVoiceState,
|
||||
InviteTargetType,
|
||||
PresenceUpdateStatus,
|
||||
AutoModerationRuleTriggerType,
|
||||
@@ -784,7 +784,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
voice_states: Omit<GatewayVoiceState, 'guild_id'>[];
|
||||
voice_states: Omit<APIVoiceState, 'guild_id'>[];
|
||||
/**
|
||||
* Users in the guild
|
||||
*
|
||||
@@ -1747,7 +1747,7 @@ export type GatewayVoiceStateUpdateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
|
||||
*/
|
||||
export type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState;
|
||||
export type GatewayVoiceStateUpdateDispatchData = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#voice-server-update
|
||||
|
||||
@@ -282,6 +282,12 @@ export const PermissionFlagsBits = {
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendPolls: 1n << 49n,
|
||||
/**
|
||||
* Allows user-installed apps to send public responses. When disabled, users will still be allowed to use their apps but the responses will be ephemeral. This only applies to apps not also installed to the server
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
UseExternalApps: 1n << 50n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
|
||||
@@ -98,6 +98,8 @@ export enum InteractionResponseType {
|
||||
Modal,
|
||||
/**
|
||||
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
|
||||
*
|
||||
* @deprecated See https://discord.com/developers/docs/change-log#premium-apps-new-premium-button-style-deep-linking-url-schemes
|
||||
*/
|
||||
PremiumRequired,
|
||||
}
|
||||
|
||||
@@ -108,6 +108,10 @@ export interface APIApplication {
|
||||
* Approximate count of guilds the application has been added to
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* Approximate count of users that have installed the app
|
||||
*/
|
||||
approximate_user_install_count?: number;
|
||||
/**
|
||||
* Array of redirect URIs for the application
|
||||
*/
|
||||
|
||||
@@ -735,6 +735,10 @@ export interface APIMessage {
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
poll?: APIPoll;
|
||||
/**
|
||||
* The message associated with the message_reference. This is a minimal subset of fields in a message (e.g. author is excluded.)
|
||||
*/
|
||||
message_snapshots?: APIMessageSnapshot[];
|
||||
/**
|
||||
* The call associated with the message
|
||||
*/
|
||||
@@ -810,6 +814,10 @@ export interface APIMessageActivity {
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
/**
|
||||
* Type of reference
|
||||
*/
|
||||
type?: MessageReferenceType;
|
||||
/**
|
||||
* ID of the originating message
|
||||
*/
|
||||
@@ -834,6 +842,20 @@ export enum MessageActivityType {
|
||||
JoinRequest = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-types
|
||||
*/
|
||||
export enum MessageReferenceType {
|
||||
/**
|
||||
* A standard reference used by replies
|
||||
*/
|
||||
Default = 0,
|
||||
/**
|
||||
* Reference used to point to a message at a point in time
|
||||
*/
|
||||
Forward = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
@@ -1404,6 +1426,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* The title of the file
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
@@ -1652,7 +1678,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
url: string;
|
||||
}
|
||||
|
||||
export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
export type APIButtonComponent =
|
||||
| APIButtonComponentWithCustomId
|
||||
| APIButtonComponentWithSKUId
|
||||
| APIButtonComponentWithURL;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
|
||||
@@ -1663,6 +1700,7 @@ export enum ButtonStyle {
|
||||
Success,
|
||||
Danger,
|
||||
Link,
|
||||
Premium,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1868,6 +1906,20 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-snapshot-object
|
||||
*/
|
||||
export interface APIMessageSnapshot {
|
||||
/**
|
||||
* Subset of the message object fields
|
||||
*/
|
||||
message: APIMessageSnapshotFields;
|
||||
/**
|
||||
* Id of the origin message's guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
@@ -1926,3 +1978,16 @@ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuCom
|
||||
|
||||
// Modal components
|
||||
export type APIModalActionRowComponent = APITextInputComponent;
|
||||
|
||||
export type APIMessageSnapshotFields = Pick<
|
||||
APIMessage,
|
||||
| 'attachments'
|
||||
| 'content'
|
||||
| 'edited_timestamp'
|
||||
| 'embeds'
|
||||
| 'flags'
|
||||
| 'mention_roles'
|
||||
| 'mentions'
|
||||
| 'timestamp'
|
||||
| 'type'
|
||||
>;
|
||||
|
||||
@@ -67,6 +67,113 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null;
|
||||
/**
|
||||
* The definition for how often this event should recur
|
||||
*/
|
||||
recurrence_rule: APIGuildScheduledEventRecurrenceRule | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-structure
|
||||
*/
|
||||
export interface APIGuildScheduledEventRecurrenceRule {
|
||||
/**
|
||||
* Starting time of the recurrence interval
|
||||
*/
|
||||
start: string;
|
||||
/**
|
||||
* Ending time of the recurrence interval
|
||||
*/
|
||||
end: string | null;
|
||||
/**
|
||||
* How often the event occurs
|
||||
*/
|
||||
frequency: GuildScheduledEventRecurrenceRuleFrequency;
|
||||
/**
|
||||
* The spacing between the events, defined by `frequency`.
|
||||
* For example, `frequency` of {@apilink GuildScheduledEventRecurrenceRuleFrequency#Weekly} and an `interval` of `2`
|
||||
* would be "every-other week"
|
||||
*/
|
||||
interval: number;
|
||||
/**
|
||||
* Set of specific days within a week for the event to recur on
|
||||
*/
|
||||
by_weekday: GuildScheduledEventRecurrenceRuleWeekday[] | null;
|
||||
/**
|
||||
* List of specific days within a specific week (1-5) to recur on
|
||||
*/
|
||||
by_n_weekday: GuildScheduledEventRecurrenceRuleNWeekday[] | null;
|
||||
/**
|
||||
* Set of specific months to recur on
|
||||
*/
|
||||
by_month: GuildScheduledEventRecurrenceRuleMonth[] | null;
|
||||
/**
|
||||
* Set of specific dates within a month to recur on
|
||||
*/
|
||||
by_month_day: number[] | null;
|
||||
/**
|
||||
* Set of days within a year to recur on (1-364)
|
||||
*/
|
||||
by_year_day: number[] | null;
|
||||
/**
|
||||
* The total amount of times that the event is allowed to recur before stopping
|
||||
*/
|
||||
count: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-frequency
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleFrequency {
|
||||
Yearly,
|
||||
Monthly,
|
||||
Weekly,
|
||||
Daily,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-weekday
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleWeekday {
|
||||
Monday,
|
||||
Tuesday,
|
||||
Wednesday,
|
||||
Thursday,
|
||||
Friday,
|
||||
Saturday,
|
||||
Sunday,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-month
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleMonth {
|
||||
January = 1,
|
||||
February,
|
||||
March,
|
||||
April,
|
||||
May,
|
||||
June,
|
||||
July,
|
||||
August,
|
||||
September,
|
||||
October,
|
||||
November,
|
||||
December,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-nweekday-structure
|
||||
*/
|
||||
export interface GuildScheduledEventRecurrenceRuleNWeekday {
|
||||
/**
|
||||
* The week to reoccur on.
|
||||
*/
|
||||
n: 1 | 2 | 3 | 4 | 5;
|
||||
/**
|
||||
* The day within the week to reoccur on
|
||||
*/
|
||||
day: GuildScheduledEventRecurrenceRuleWeekday;
|
||||
}
|
||||
|
||||
export interface APIStageInstanceGuildScheduledEvent
|
||||
|
||||
@@ -22,10 +22,14 @@ export interface APIPoll {
|
||||
expiry: string;
|
||||
/**
|
||||
* Whether a user can select multiple answers
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
allow_multiselect: boolean;
|
||||
/**
|
||||
* The layout type of the poll
|
||||
*
|
||||
* @default PollLayoutType.Default
|
||||
*/
|
||||
layout_type: PollLayoutType;
|
||||
/**
|
||||
|
||||
@@ -286,6 +286,7 @@ export enum ConnectionService {
|
||||
PlayStationNetwork = 'playstation',
|
||||
Reddit = 'reddit',
|
||||
RiotGames = 'riotgames',
|
||||
Roblox = 'roblox',
|
||||
Spotify = 'spotify',
|
||||
Skype = 'skype',
|
||||
Steam = 'steam',
|
||||
|
||||
@@ -7,8 +7,15 @@ import type { APIGuildMember } from './guild.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*
|
||||
* @deprecated This is deprecated, use {@apilink APIVoiceState}
|
||||
*/
|
||||
export interface GatewayVoiceState {
|
||||
export type GatewayVoiceState = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
export interface APIVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
|
||||
@@ -98,6 +98,8 @@ export enum InteractionResponseType {
|
||||
Modal,
|
||||
/**
|
||||
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
|
||||
*
|
||||
* @deprecated See https://discord.com/developers/docs/change-log#premium-apps-new-premium-button-style-deep-linking-url-schemes
|
||||
*/
|
||||
PremiumRequired,
|
||||
}
|
||||
|
||||
@@ -108,6 +108,10 @@ export interface APIApplication {
|
||||
* Approximate count of guilds the application has been added to
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* Approximate count of users that have installed the app
|
||||
*/
|
||||
approximate_user_install_count?: number;
|
||||
/**
|
||||
* Array of redirect URIs for the application
|
||||
*/
|
||||
|
||||
@@ -720,6 +720,10 @@ export interface APIMessage {
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
poll?: APIPoll;
|
||||
/**
|
||||
* The message associated with the message_reference. This is a minimal subset of fields in a message (e.g. author is excluded.)
|
||||
*/
|
||||
message_snapshots?: APIMessageSnapshot[];
|
||||
/**
|
||||
* The call associated with the message
|
||||
*/
|
||||
@@ -795,6 +799,10 @@ export interface APIMessageActivity {
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
/**
|
||||
* Type of reference
|
||||
*/
|
||||
type?: MessageReferenceType;
|
||||
/**
|
||||
* ID of the originating message
|
||||
*/
|
||||
@@ -819,6 +827,20 @@ export enum MessageActivityType {
|
||||
JoinRequest = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-types
|
||||
*/
|
||||
export enum MessageReferenceType {
|
||||
/**
|
||||
* A standard reference used by replies
|
||||
*/
|
||||
Default = 0,
|
||||
/**
|
||||
* Reference used to point to a message at a point in time
|
||||
*/
|
||||
Forward = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
@@ -1371,6 +1393,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* The title of the file
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
@@ -1619,7 +1645,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
url: string;
|
||||
}
|
||||
|
||||
export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
export type APIButtonComponent =
|
||||
| APIButtonComponentWithCustomId
|
||||
| APIButtonComponentWithSKUId
|
||||
| APIButtonComponentWithURL;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
|
||||
@@ -1630,6 +1667,7 @@ export enum ButtonStyle {
|
||||
Success,
|
||||
Danger,
|
||||
Link,
|
||||
Premium,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1835,6 +1873,20 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-snapshot-object
|
||||
*/
|
||||
export interface APIMessageSnapshot {
|
||||
/**
|
||||
* Subset of the message object fields
|
||||
*/
|
||||
message: APIMessageSnapshotFields;
|
||||
/**
|
||||
* Id of the origin message's guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
@@ -1893,3 +1945,16 @@ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuCom
|
||||
|
||||
// Modal components
|
||||
export type APIModalActionRowComponent = APITextInputComponent;
|
||||
|
||||
export type APIMessageSnapshotFields = Pick<
|
||||
APIMessage,
|
||||
| 'attachments'
|
||||
| 'content'
|
||||
| 'edited_timestamp'
|
||||
| 'embeds'
|
||||
| 'flags'
|
||||
| 'mention_roles'
|
||||
| 'mentions'
|
||||
| 'timestamp'
|
||||
| 'type'
|
||||
>;
|
||||
|
||||
@@ -67,6 +67,113 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null;
|
||||
/**
|
||||
* The definition for how often this event should recur
|
||||
*/
|
||||
recurrence_rule: APIGuildScheduledEventRecurrenceRule | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-structure
|
||||
*/
|
||||
export interface APIGuildScheduledEventRecurrenceRule {
|
||||
/**
|
||||
* Starting time of the recurrence interval
|
||||
*/
|
||||
start: string;
|
||||
/**
|
||||
* Ending time of the recurrence interval
|
||||
*/
|
||||
end: string | null;
|
||||
/**
|
||||
* How often the event occurs
|
||||
*/
|
||||
frequency: GuildScheduledEventRecurrenceRuleFrequency;
|
||||
/**
|
||||
* The spacing between the events, defined by `frequency`.
|
||||
* For example, `frequency` of {@apilink GuildScheduledEventRecurrenceRuleFrequency#Weekly} and an `interval` of `2`
|
||||
* would be "every-other week"
|
||||
*/
|
||||
interval: number;
|
||||
/**
|
||||
* Set of specific days within a week for the event to recur on
|
||||
*/
|
||||
by_weekday: GuildScheduledEventRecurrenceRuleWeekday[] | null;
|
||||
/**
|
||||
* List of specific days within a specific week (1-5) to recur on
|
||||
*/
|
||||
by_n_weekday: GuildScheduledEventRecurrenceRuleNWeekday[] | null;
|
||||
/**
|
||||
* Set of specific months to recur on
|
||||
*/
|
||||
by_month: GuildScheduledEventRecurrenceRuleMonth[] | null;
|
||||
/**
|
||||
* Set of specific dates within a month to recur on
|
||||
*/
|
||||
by_month_day: number[] | null;
|
||||
/**
|
||||
* Set of days within a year to recur on (1-364)
|
||||
*/
|
||||
by_year_day: number[] | null;
|
||||
/**
|
||||
* The total amount of times that the event is allowed to recur before stopping
|
||||
*/
|
||||
count: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-frequency
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleFrequency {
|
||||
Yearly,
|
||||
Monthly,
|
||||
Weekly,
|
||||
Daily,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-weekday
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleWeekday {
|
||||
Monday,
|
||||
Tuesday,
|
||||
Wednesday,
|
||||
Thursday,
|
||||
Friday,
|
||||
Saturday,
|
||||
Sunday,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-month
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleMonth {
|
||||
January = 1,
|
||||
February,
|
||||
March,
|
||||
April,
|
||||
May,
|
||||
June,
|
||||
July,
|
||||
August,
|
||||
September,
|
||||
October,
|
||||
November,
|
||||
December,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-nweekday-structure
|
||||
*/
|
||||
export interface GuildScheduledEventRecurrenceRuleNWeekday {
|
||||
/**
|
||||
* The week to reoccur on.
|
||||
*/
|
||||
n: 1 | 2 | 3 | 4 | 5;
|
||||
/**
|
||||
* The day within the week to reoccur on
|
||||
*/
|
||||
day: GuildScheduledEventRecurrenceRuleWeekday;
|
||||
}
|
||||
|
||||
export interface APIStageInstanceGuildScheduledEvent
|
||||
|
||||
@@ -22,10 +22,14 @@ export interface APIPoll {
|
||||
expiry: string;
|
||||
/**
|
||||
* Whether a user can select multiple answers
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
allow_multiselect: boolean;
|
||||
/**
|
||||
* The layout type of the poll
|
||||
*
|
||||
* @default PollLayoutType.Default
|
||||
*/
|
||||
layout_type: PollLayoutType;
|
||||
/**
|
||||
|
||||
@@ -285,6 +285,7 @@ export enum ConnectionService {
|
||||
PlayStationNetwork = 'playstation',
|
||||
Reddit = 'reddit',
|
||||
RiotGames = 'riotgames',
|
||||
Roblox = 'roblox',
|
||||
PayPal = 'paypal',
|
||||
Spotify = 'spotify',
|
||||
Skype = 'skype',
|
||||
|
||||
@@ -7,8 +7,15 @@ import type { APIGuildMember } from './guild.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*
|
||||
* @deprecated This is deprecated, use {@apilink APIVoiceState}
|
||||
*/
|
||||
export interface GatewayVoiceState {
|
||||
export type GatewayVoiceState = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
export interface APIVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
|
||||
@@ -43,8 +43,8 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
UnknownDiscoverableServerCategory = 10_059,
|
||||
UnknownSticker,
|
||||
|
||||
UnknownInteraction = 10_062,
|
||||
UnknownStickerPack,
|
||||
UnknownInteraction,
|
||||
UnknownApplicationCommand,
|
||||
|
||||
UnknownVoiceState = 10_065,
|
||||
|
||||
@@ -26,12 +26,17 @@ import type {
|
||||
ChannelFlags,
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type { RESTAPIPollCreate } from './poll.ts';
|
||||
import type { RESTAPIPoll } from './poll.ts';
|
||||
|
||||
export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIChannelPatchOverwrite} instead
|
||||
*/
|
||||
export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel
|
||||
*/
|
||||
@@ -98,7 +103,7 @@ export interface RESTPatchAPIChannelJSONBody {
|
||||
*
|
||||
* Channel types: all excluding newsThread, publicThread, privateThread
|
||||
*/
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined;
|
||||
permission_overwrites?: RESTAPIChannelPatchOverwrite[] | null | undefined;
|
||||
/**
|
||||
* ID of the new parent category for a channel
|
||||
*
|
||||
@@ -237,7 +242,7 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Required<Pick<APIMessageReference, 'message_id'>>
|
||||
> &
|
||||
StrictPartial<APIMessageReference> & {
|
||||
@@ -249,6 +254,11 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO
|
||||
fail_if_not_exists?: boolean | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIMessageReference} instead
|
||||
*/
|
||||
export type APIMessageReferenceSend = RESTAPIMessageReference;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
@@ -300,7 +310,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend | undefined;
|
||||
message_reference?: RESTAPIMessageReference | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
@@ -329,7 +339,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
poll?: RESTAPIPoll | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,7 +372,12 @@ export type RESTPutAPIChannelMessageReactionResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-own-reaction
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = never;
|
||||
export type RESTDeleteAPIChannelMessageOwnReactionResult = never;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTDeleteAPIChannelMessageOwnReactionResult} instead
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = RESTDeleteAPIChannelMessageOwnReactionResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-user-reaction
|
||||
|
||||
@@ -59,3 +59,40 @@ export type RESTPatchAPIGuildEmojiResult = APIEmoji;
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIGuildEmojiResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-application-emojis
|
||||
*/
|
||||
export interface RESTGetAPIApplicationEmojisResult {
|
||||
items: APIEmoji[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#get-application-emoji
|
||||
*/
|
||||
export type RESTGetAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params
|
||||
*/
|
||||
export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSONBody, 'image' | 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-application-emoji
|
||||
*/
|
||||
export type RESTPostAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
|
||||
*/
|
||||
export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJSONBody, 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
|
||||
*/
|
||||
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-application-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIApplicationEmojiResult = never;
|
||||
|
||||
@@ -37,14 +37,25 @@ import type {
|
||||
} from '../../utils/internals.ts';
|
||||
import type { RESTPutAPIChannelPermissionJSONBody } from './channel.ts';
|
||||
|
||||
export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
export type APIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
|
||||
export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead
|
||||
*/
|
||||
export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite;
|
||||
|
||||
export type RESTAPIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildChannelResolvable} instead
|
||||
*/
|
||||
export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable;
|
||||
|
||||
export type RESTAPIGuildCreatePartialChannel = StrictPartial<
|
||||
DistributivePick<
|
||||
APIGuildChannelResolvable,
|
||||
RESTAPIGuildChannelResolvable,
|
||||
| 'available_tags'
|
||||
| 'bitrate'
|
||||
| 'default_auto_archive_duration'
|
||||
@@ -66,13 +77,23 @@ export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
name: string;
|
||||
id?: number | string | undefined;
|
||||
parent_id?: number | string | null | undefined;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
|
||||
permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined;
|
||||
};
|
||||
|
||||
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreatePartialChannel} instead
|
||||
*/
|
||||
export type APIGuildCreatePartialChannel = RESTAPIGuildCreatePartialChannel;
|
||||
|
||||
export interface RESTAPIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreateRole} instead
|
||||
*/
|
||||
export type APIGuildCreateRole = RESTAPIGuildCreateRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
*/
|
||||
@@ -124,7 +145,7 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
roles?: APIGuildCreateRole[] | undefined;
|
||||
roles?: RESTAPIGuildCreateRole[] | undefined;
|
||||
/**
|
||||
* New guild's channels
|
||||
*
|
||||
@@ -138,7 +159,7 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels?: APIGuildCreatePartialChannel[] | undefined;
|
||||
channels?: RESTAPIGuildCreatePartialChannel[] | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
@@ -333,7 +354,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
*/
|
||||
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<APIGuildCreatePartialChannel, 'id'>;
|
||||
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<RESTAPIGuildCreatePartialChannel, 'id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
@@ -739,6 +760,11 @@ export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-role
|
||||
*/
|
||||
export type RESTGetAPIGuildRoleResult = APIRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
*/
|
||||
@@ -891,48 +917,6 @@ export interface RESTPatchAPIGuildMemberVerificationJSONBody {
|
||||
|
||||
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
|
||||
*/
|
||||
@@ -967,20 +951,25 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
/**
|
||||
* Prompts shown during onboarding and in customize community
|
||||
*/
|
||||
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
|
||||
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
export type RESTAPIGuildOnboardingPrompt = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
|
||||
|
||||
export type RESTAPIGuildOnboardingPromptOption = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> & {
|
||||
@@ -998,6 +987,11 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossibl
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardingPromptOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { StrictPartial } from '../../utils/internals.ts';
|
||||
import type { Nullable, StrictPartial } from '../../utils/internals.ts';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
APIGuildScheduledEventRecurrenceRule,
|
||||
APIGuildScheduledEventUser,
|
||||
GuildScheduledEventEntityType,
|
||||
GuildScheduledEventPrivacyLevel,
|
||||
@@ -64,6 +65,10 @@ export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null | undefined;
|
||||
/**
|
||||
* The definition for how often this event should recur
|
||||
*/
|
||||
recurrence_rule?: APIGuildScheduledEventRecurrenceRule | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,20 +94,17 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | null | undefined;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string | null | undefined;
|
||||
};
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> &
|
||||
StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
|
||||
@@ -32,6 +32,7 @@ export const Routes = {
|
||||
applicationRoleConnectionMetadata(applicationId: Snowflake) {
|
||||
return `/applications/${applicationId}/role-connections/metadata` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/auto-moderation/rules`
|
||||
@@ -344,6 +345,7 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - PATCH `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/roles/{role.id}`
|
||||
*/
|
||||
@@ -786,6 +788,8 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/voice-states/@me`
|
||||
* - GET `/guilds/{guild.id}/voice-states/{user.id}`
|
||||
* - PATCH `/guilds/{guild.id}/voice-states/@me`
|
||||
* - PATCH `/guilds/{guild.id}/voice-states/{user.id}`
|
||||
*/
|
||||
@@ -854,6 +858,14 @@ export const Routes = {
|
||||
return '/sticker-packs' as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/sticker-packs/{pack.id}`
|
||||
*/
|
||||
stickerPack(packId: Snowflake) {
|
||||
return `/sticker-packs/${packId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/sticker-packs`
|
||||
@@ -912,8 +924,8 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/${guild.id}/onboarding`
|
||||
* - PUT `/guilds/${guild.id}/onboarding`
|
||||
* - GET `/guilds/{guild.id}/onboarding`
|
||||
* - PUT `/guilds/{guild.id}/onboarding`
|
||||
*/
|
||||
guildOnboarding(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/onboarding` as const;
|
||||
@@ -963,11 +975,30 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
|
||||
* - POST `/applications/{application.id}/entitlements/{entitlement.id}/consume`
|
||||
*/
|
||||
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
|
||||
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/emojis`
|
||||
* - POST `/applications/{application.id}/emojis`
|
||||
*/
|
||||
applicationEmojis(applicationId: Snowflake) {
|
||||
return `/applications/${applicationId}/emojis` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/emojis/{emoji.id}`
|
||||
* - PATCH `/applications/{application.id}/emojis/{emoji.id}`
|
||||
* - DELETE `/applications/{application.id}/emojis/{emoji.id}`
|
||||
*/
|
||||
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
|
||||
return `/applications/${applicationId}/emojis/${emojiId}` as const;
|
||||
},
|
||||
};
|
||||
|
||||
export const StickerPackApplicationId = '710982414301790216';
|
||||
@@ -995,14 +1026,14 @@ export const CDNRoutes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/icons/{guild.id}.{png|jpeg|webp|gif}`
|
||||
* - GET `/icons/{guild.id}/{guild.icon}.{png|jpeg|webp|gif}`
|
||||
*
|
||||
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP, GIF
|
||||
*/
|
||||
guildIcon<Format extends GuildIconFormat>(guildId: Snowflake, guildIcon: string, format: Format) {
|
||||
return `icons/${guildId}/${guildIcon}.${format}` as const;
|
||||
return `/icons/${guildId}/${guildIcon}.${format}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1081,7 +1112,7 @@ export const CDNRoutes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/users/{user.id}/{guild_member.avatar}.{png|jpeg|webp|gif}`
|
||||
* - GET `/guilds/{guild.id}/users/{user.id}/avatars/{guild_member.avatar}.{png|jpeg|webp|gif}`
|
||||
*
|
||||
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
|
||||
*
|
||||
@@ -1201,7 +1232,7 @@ export const CDNRoutes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
|
||||
* - GET `/team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@ export type RESTGetAPIEntitlementsResult = APIEntitlement[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
|
||||
*/
|
||||
export interface RESTPostAPIEntitlementBody {
|
||||
export interface RESTPostAPIEntitlementJSONBody {
|
||||
/**
|
||||
* ID of the SKU to grant the entitlement to
|
||||
*/
|
||||
@@ -61,6 +61,11 @@ export interface RESTPostAPIEntitlementBody {
|
||||
owner_type: EntitlementOwnerType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTPostAPIEntitlementJSONBody} instead
|
||||
*/
|
||||
export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
|
||||
*/
|
||||
|
||||
@@ -40,14 +40,27 @@ export interface RESTOAuth2AuthorizationQuery {
|
||||
prompt?: 'consent' | 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-token-revocation-example
|
||||
*/
|
||||
export interface RESTPostOAuth2TokenRevocationQuery {
|
||||
token: string;
|
||||
token_type_hint?: 'access_token' | 'refresh_token';
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
|
||||
*/
|
||||
export interface RESTOAuth2AuthorizationQueryResult {
|
||||
export interface RESTPostOAuth2AuthorizationQueryResult {
|
||||
code: string;
|
||||
state?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTPostOAuth2AuthorizationQueryResult} instead
|
||||
*/
|
||||
export type RESTOAuth2AuthorizationQueryResult = RESTPostOAuth2AuthorizationQueryResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
|
||||
*/
|
||||
|
||||
@@ -20,17 +20,26 @@ export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure
|
||||
*/
|
||||
export interface RESTAPIPollCreate extends Omit<APIPoll, 'answers' | 'expiry' | 'results'> {
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 7 days
|
||||
*/
|
||||
duration: number;
|
||||
export interface RESTAPIPoll
|
||||
extends Omit<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
|
||||
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: Omit<APIPollAnswer, 'answer_id'>[];
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 32 days
|
||||
*
|
||||
* @default 24
|
||||
*/
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIPoll} instead
|
||||
*/
|
||||
export type RESTAPIPollCreate = RESTAPIPoll;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,16 @@ export interface RESTGetStickerPacksResult {
|
||||
sticker_packs: APIStickerPack[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#get-sticker-pack
|
||||
*/
|
||||
export type RESTGetAPIStickerPackResult = APIStickerPack;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTGetAPIStickerPackResult} instead
|
||||
*/
|
||||
export type RESTGetAPIStickerPack = RESTGetAPIStickerPackResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
|
||||
*
|
||||
|
||||
@@ -76,6 +76,7 @@ export interface RESTAPIPartialCurrentUserGuild {
|
||||
id: Snowflake;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
banner: string | null;
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
permissions: Permissions;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { APIVoiceRegion } from '../../payloads/v10/mod.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIVoiceRegion, APIVoiceState } from '../../payloads/v10/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#list-voice-regions
|
||||
@@ -9,3 +10,55 @@ export type RESTGetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
* @deprecated This was exported with the wrong name, use `RESTGetAPIVoiceRegionsResult` instead
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = RESTGetAPIVoiceRegionsResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#get-current-user-voice-state
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceStateCurrentMemberResult = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#get-user-voice-state
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceStateUserResult = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals.ts';
|
||||
import type { RESTAPIAttachment } from './channel.ts';
|
||||
import type { RESTAPIPollCreate } from './poll.ts';
|
||||
import type { RESTAPIPoll } from './poll.ts';
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
@@ -158,7 +158,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
poll?: RESTAPIPoll | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,12 +26,17 @@ import type {
|
||||
ChannelFlags,
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type { RESTAPIPollCreate } from './poll.ts';
|
||||
import type { RESTAPIPoll } from './poll.ts';
|
||||
|
||||
export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIChannelPatchOverwrite} instead
|
||||
*/
|
||||
export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel
|
||||
*/
|
||||
@@ -237,7 +242,7 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Required<Pick<APIMessageReference, 'message_id'>>
|
||||
> &
|
||||
StrictPartial<APIMessageReference> & {
|
||||
@@ -249,6 +254,11 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO
|
||||
fail_if_not_exists?: boolean | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIMessageReference} instead
|
||||
*/
|
||||
export type APIMessageReferenceSend = RESTAPIMessageReference;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
@@ -308,7 +318,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend | undefined;
|
||||
message_reference?: RESTAPIMessageReference | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
@@ -337,7 +347,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
poll?: RESTAPIPoll | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -370,7 +380,12 @@ export type RESTPutAPIChannelMessageReactionResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-own-reaction
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = never;
|
||||
export type RESTDeleteAPIChannelMessageOwnReactionResult = never;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTDeleteAPIChannelMessageOwnReactionResult} instead
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = RESTDeleteAPIChannelMessageOwnReactionResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-user-reaction
|
||||
|
||||
@@ -59,3 +59,40 @@ export type RESTPatchAPIGuildEmojiResult = APIEmoji;
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIGuildEmojiResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-application-emojis
|
||||
*/
|
||||
export interface RESTGetAPIApplicationEmojisResult {
|
||||
items: APIEmoji[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#get-application-emoji
|
||||
*/
|
||||
export type RESTGetAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params
|
||||
*/
|
||||
export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSONBody, 'image' | 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-application-emoji
|
||||
*/
|
||||
export type RESTPostAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
|
||||
*/
|
||||
export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJSONBody, 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
|
||||
*/
|
||||
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-application-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIApplicationEmojiResult = never;
|
||||
|
||||
@@ -37,14 +37,25 @@ import type {
|
||||
} from '../../utils/internals.ts';
|
||||
import type { RESTPutAPIChannelPermissionJSONBody } from './channel.ts';
|
||||
|
||||
export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
export type APIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
|
||||
export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead
|
||||
*/
|
||||
export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite;
|
||||
|
||||
export type RESTAPIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildChannelResolvable} instead
|
||||
*/
|
||||
export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable;
|
||||
|
||||
export type RESTAPIGuildCreatePartialChannel = StrictPartial<
|
||||
DistributivePick<
|
||||
APIGuildChannelResolvable,
|
||||
RESTAPIGuildChannelResolvable,
|
||||
| 'available_tags'
|
||||
| 'bitrate'
|
||||
| 'default_auto_archive_duration'
|
||||
@@ -66,13 +77,23 @@ export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
name: string;
|
||||
id?: number | string | undefined;
|
||||
parent_id?: number | string | null | undefined;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
|
||||
permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined;
|
||||
};
|
||||
|
||||
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreatePartialChannel} instead
|
||||
*/
|
||||
export type APIGuildCreatePartialChannel = RESTAPIGuildCreatePartialChannel;
|
||||
|
||||
export interface RESTAPIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreateRole} instead
|
||||
*/
|
||||
export type APIGuildCreateRole = RESTAPIGuildCreateRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
*/
|
||||
@@ -124,7 +145,7 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
roles?: APIGuildCreateRole[] | undefined;
|
||||
roles?: RESTAPIGuildCreateRole[] | undefined;
|
||||
/**
|
||||
* New guild's channels
|
||||
*
|
||||
@@ -138,7 +159,7 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels?: APIGuildCreatePartialChannel[] | undefined;
|
||||
channels?: RESTAPIGuildCreatePartialChannel[] | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
@@ -333,7 +354,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
*/
|
||||
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<APIGuildCreatePartialChannel, 'id'>;
|
||||
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<RESTAPIGuildCreatePartialChannel, 'id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
@@ -745,6 +766,11 @@ export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-role
|
||||
*/
|
||||
export type RESTGetAPIGuildRoleResult = APIRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
*/
|
||||
@@ -897,48 +923,6 @@ export interface RESTPatchAPIGuildMemberVerificationJSONBody {
|
||||
|
||||
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
|
||||
*/
|
||||
@@ -973,20 +957,25 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
/**
|
||||
* Prompts shown during onboarding and in customize community
|
||||
*/
|
||||
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
|
||||
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
export type RESTAPIGuildOnboardingPrompt = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
|
||||
|
||||
export type RESTAPIGuildOnboardingPromptOption = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> & {
|
||||
@@ -1004,6 +993,11 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossibl
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardingPromptOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
|
||||
*/
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { StrictPartial } from '../../utils/internals.ts';
|
||||
import type { Nullable, StrictPartial } from '../../utils/internals.ts';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
APIGuildScheduledEventRecurrenceRule,
|
||||
APIGuildScheduledEventUser,
|
||||
GuildScheduledEventEntityType,
|
||||
GuildScheduledEventPrivacyLevel,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
GuildScheduledEventStatus,
|
||||
APIGuildScheduledEventUser,
|
||||
} from '../../v9.ts';
|
||||
|
||||
/**
|
||||
@@ -64,6 +65,10 @@ export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null | undefined;
|
||||
/**
|
||||
* The definition for how often this event should recur
|
||||
*/
|
||||
recurrence_rule?: APIGuildScheduledEventRecurrenceRule | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,20 +94,17 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | null | undefined;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string | null | undefined;
|
||||
};
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> &
|
||||
StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
|
||||
@@ -32,6 +32,7 @@ export const Routes = {
|
||||
applicationRoleConnectionMetadata(applicationId: Snowflake) {
|
||||
return `/applications/${applicationId}/role-connections/metadata` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/auto-moderation/rules`
|
||||
@@ -344,6 +345,7 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - PATCH `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/roles/{role.id}`
|
||||
*/
|
||||
@@ -795,6 +797,8 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/voice-states/@me`
|
||||
* - GET `/guilds/{guild.id}/voice-states/{user.id}`
|
||||
* - PATCH `/guilds/{guild.id}/voice-states/@me`
|
||||
* - PATCH `/guilds/{guild.id}/voice-states/{user.id}`
|
||||
*/
|
||||
@@ -863,6 +867,14 @@ export const Routes = {
|
||||
return '/sticker-packs' as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/sticker-packs/{pack.id}`
|
||||
*/
|
||||
stickerPack(packId: Snowflake) {
|
||||
return `/sticker-packs/${packId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/sticker-packs`
|
||||
@@ -921,8 +933,8 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/${guild.id}/onboarding`
|
||||
* - PUT `/guilds/${guild.id}/onboarding`
|
||||
* - GET `/guilds/{guild.id}/onboarding`
|
||||
* - PUT `/guilds/{guild.id}/onboarding`
|
||||
*/
|
||||
guildOnboarding(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/onboarding` as const;
|
||||
@@ -972,11 +984,30 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
|
||||
* - POST `/applications/{application.id}/entitlements/{entitlement.id}/consume`
|
||||
*/
|
||||
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
|
||||
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/emojis`
|
||||
* - POST `/applications/{application.id}/emojis`
|
||||
*/
|
||||
applicationEmojis(applicationId: Snowflake) {
|
||||
return `/applications/${applicationId}/emojis` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/emojis/{emoji.id}`
|
||||
* - PATCH `/applications/{application.id}/emojis/{emoji.id}`
|
||||
* - DELETE `/applications/{application.id}/emojis/{emoji.id}`
|
||||
*/
|
||||
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
|
||||
return `/applications/${applicationId}/emojis/${emojiId}` as const;
|
||||
},
|
||||
};
|
||||
|
||||
export const StickerPackApplicationId = '710982414301790216';
|
||||
@@ -1004,14 +1035,14 @@ export const CDNRoutes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/icons/{guild.id}.{png|jpeg|webp|gif}`
|
||||
* - GET `/icons/{guild.id}/{guild.icon}.{png|jpeg|webp|gif}`
|
||||
*
|
||||
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP, GIF
|
||||
*/
|
||||
guildIcon<Format extends GuildIconFormat>(guildId: Snowflake, guildIcon: string, format: Format) {
|
||||
return `icons/${guildId}/${guildIcon}.${format}` as const;
|
||||
return `/icons/${guildId}/${guildIcon}.${format}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1090,7 +1121,7 @@ export const CDNRoutes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/users/{user.id}/{guild_member.avatar}.{png|jpeg|webp|gif}`
|
||||
* - GET `/guilds/{guild.id}/users/{user.id}/avatars/{guild_member.avatar}.{png|jpeg|webp|gif}`
|
||||
*
|
||||
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
|
||||
*
|
||||
@@ -1210,7 +1241,7 @@ export const CDNRoutes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
|
||||
* - GET `/team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@ export type RESTGetAPIEntitlementsResult = APIEntitlement[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
|
||||
*/
|
||||
export interface RESTPostAPIEntitlementBody {
|
||||
export interface RESTPostAPIEntitlementJSONBody {
|
||||
/**
|
||||
* ID of the SKU to grant the entitlement to
|
||||
*/
|
||||
@@ -61,6 +61,11 @@ export interface RESTPostAPIEntitlementBody {
|
||||
owner_type: EntitlementOwnerType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTPostAPIEntitlementJSONBody} instead
|
||||
*/
|
||||
export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
|
||||
*/
|
||||
|
||||
@@ -40,14 +40,27 @@ export interface RESTOAuth2AuthorizationQuery {
|
||||
prompt?: 'consent' | 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-token-revocation-example
|
||||
*/
|
||||
export interface RESTPostOAuth2TokenRevocationQuery {
|
||||
token: string;
|
||||
token_type_hint?: 'access_token' | 'refresh_token';
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
|
||||
*/
|
||||
export interface RESTOAuth2AuthorizationQueryResult {
|
||||
export interface RESTPostOAuth2AuthorizationQueryResult {
|
||||
code: string;
|
||||
state?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTPostOAuth2AuthorizationQueryResult} instead
|
||||
*/
|
||||
export type RESTOAuth2AuthorizationQueryResult = RESTPostOAuth2AuthorizationQueryResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
|
||||
*/
|
||||
|
||||
@@ -20,17 +20,26 @@ export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure
|
||||
*/
|
||||
export interface RESTAPIPollCreate extends Omit<APIPoll, 'answers' | 'expiry' | 'results'> {
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 7 days
|
||||
*/
|
||||
duration: number;
|
||||
export interface RESTAPIPoll
|
||||
extends Omit<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
|
||||
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: Omit<APIPollAnswer, 'answer_id'>[];
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 32 days
|
||||
*
|
||||
* @default 24
|
||||
*/
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIPoll} instead
|
||||
*/
|
||||
export type RESTAPIPollCreate = RESTAPIPoll;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,16 @@ export interface RESTGetStickerPacksResult {
|
||||
sticker_packs: APIStickerPack[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#get-sticker-pack
|
||||
*/
|
||||
export type RESTGetAPIStickerPackResult = APIStickerPack;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTGetAPIStickerPackResult} instead
|
||||
*/
|
||||
export type RESTGetAPIStickerPack = RESTGetAPIStickerPackResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
|
||||
*
|
||||
|
||||
@@ -76,6 +76,7 @@ export interface RESTAPIPartialCurrentUserGuild {
|
||||
id: Snowflake;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
banner: string | null;
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
permissions: Permissions;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { APIVoiceRegion } from '../../payloads/v9/mod.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIVoiceRegion, APIVoiceState } from '../../payloads/v9/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#list-voice-regions
|
||||
@@ -9,3 +10,55 @@ export type RESTGetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
* @deprecated This was exported with the wrong name, use `RESTGetAPIVoiceRegionsResult` instead
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = RESTGetAPIVoiceRegionsResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#get-current-user-voice-state
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceStateCurrentMemberResult = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#get-user-voice-state
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceStateUserResult = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals.ts';
|
||||
import type { RESTAPIAttachment } from './channel.ts';
|
||||
import type { RESTAPIPollCreate } from './poll.ts';
|
||||
import type { RESTAPIPoll } from './poll.ts';
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
@@ -158,7 +158,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
poll?: RESTAPIPoll | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,7 +28,7 @@ import type {
|
||||
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
|
||||
GatewayThreadListSync as RawGatewayThreadListSync,
|
||||
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
|
||||
GatewayVoiceState,
|
||||
APIVoiceState,
|
||||
InviteTargetType,
|
||||
PresenceUpdateStatus,
|
||||
AutoModerationRuleTriggerType,
|
||||
@@ -785,7 +785,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
voice_states: Omit<GatewayVoiceState, 'guild_id'>[];
|
||||
voice_states: Omit<APIVoiceState, 'guild_id'>[];
|
||||
/**
|
||||
* Users in the guild
|
||||
*
|
||||
@@ -1748,7 +1748,7 @@ export type GatewayVoiceStateUpdateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
|
||||
*/
|
||||
export type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState;
|
||||
export type GatewayVoiceStateUpdateDispatchData = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#voice-server-update
|
||||
|
||||
@@ -28,7 +28,7 @@ import type {
|
||||
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
|
||||
GatewayThreadListSync as RawGatewayThreadListSync,
|
||||
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
|
||||
GatewayVoiceState,
|
||||
APIVoiceState,
|
||||
InviteTargetType,
|
||||
PresenceUpdateStatus,
|
||||
AutoModerationRuleTriggerType,
|
||||
@@ -784,7 +784,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
voice_states: Omit<GatewayVoiceState, 'guild_id'>[];
|
||||
voice_states: Omit<APIVoiceState, 'guild_id'>[];
|
||||
/**
|
||||
* Users in the guild
|
||||
*
|
||||
@@ -1747,7 +1747,7 @@ export type GatewayVoiceStateUpdateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
|
||||
*/
|
||||
export type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState;
|
||||
export type GatewayVoiceStateUpdateDispatchData = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#voice-server-update
|
||||
|
||||
1782
package-lock.json
generated
1782
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
12
package.json
12
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.37.88",
|
||||
"version": "0.37.97",
|
||||
"description": "Discord API typings that are kept up to date for use in bot library creation.",
|
||||
"homepage": "https://discord-api-types.dev",
|
||||
"exports": {
|
||||
@@ -113,7 +113,7 @@
|
||||
"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",
|
||||
"test:types": "tsd -t ./v10.d.ts",
|
||||
"test:types": "tsd -t ./v10.d.ts && tsd -t ./v9.d.ts",
|
||||
"posttest:types": "npm run clean:node"
|
||||
},
|
||||
"keywords": [
|
||||
@@ -122,7 +122,7 @@
|
||||
"types",
|
||||
"discordjs"
|
||||
],
|
||||
"author": "Vlad Frangu <kingdgrizzle@gmail.com>",
|
||||
"author": "Vlad Frangu <me@vladfrangu.dev>",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"{gateway,payloads,rest,rpc,voice,utils}/**/*.{js,js.map,d.ts,d.ts.map,mjs}",
|
||||
@@ -137,13 +137,13 @@
|
||||
"@sapphire/prettier-config": "^2.0.0",
|
||||
"@types/conventional-recommended-bump": "^9.0.3",
|
||||
"@types/node": "^20.11.24",
|
||||
"@typescript-eslint/utils": "^7.1.1",
|
||||
"@typescript-eslint/utils": "^8.0.0",
|
||||
"conventional-changelog-cli": "^4.1.0",
|
||||
"conventional-recommended-bump": "^9.0.0",
|
||||
"eslint": "^8.57.0",
|
||||
"eslint-config-neon": "^0.1.59",
|
||||
"eslint-import-resolver-typescript": "^3.6.1",
|
||||
"eslint-plugin-local": "^4.2.1",
|
||||
"eslint-plugin-local": "^6.0.0",
|
||||
"gen-esm-wrapper": "^1.1.3",
|
||||
"husky": "^9.0.11",
|
||||
"is-ci": "^3.0.1",
|
||||
@@ -151,7 +151,7 @@
|
||||
"npm-run-all2": "^6.0.0",
|
||||
"prettier": "^3.2.5",
|
||||
"pretty-quick": "^4.0.0",
|
||||
"rimraf": "^5.0.5",
|
||||
"rimraf": "^6.0.0",
|
||||
"tsd": "^0.31.0",
|
||||
"tsutils": "^3.21.0",
|
||||
"typescript": "^5.3.3"
|
||||
|
||||
@@ -282,6 +282,12 @@ export const PermissionFlagsBits = {
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendPolls: 1n << 49n,
|
||||
/**
|
||||
* Allows user-installed apps to send public responses. When disabled, users will still be allowed to use their apps but the responses will be ephemeral. This only applies to apps not also installed to the server
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
UseExternalApps: 1n << 50n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
|
||||
@@ -98,6 +98,8 @@ export enum InteractionResponseType {
|
||||
Modal,
|
||||
/**
|
||||
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
|
||||
*
|
||||
* @deprecated See https://discord.com/developers/docs/change-log#premium-apps-new-premium-button-style-deep-linking-url-schemes
|
||||
*/
|
||||
PremiumRequired,
|
||||
}
|
||||
|
||||
@@ -108,6 +108,10 @@ export interface APIApplication {
|
||||
* Approximate count of guilds the application has been added to
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* Approximate count of users that have installed the app
|
||||
*/
|
||||
approximate_user_install_count?: number;
|
||||
/**
|
||||
* Array of redirect URIs for the application
|
||||
*/
|
||||
|
||||
@@ -735,6 +735,10 @@ export interface APIMessage {
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
poll?: APIPoll;
|
||||
/**
|
||||
* The message associated with the message_reference. This is a minimal subset of fields in a message (e.g. author is excluded.)
|
||||
*/
|
||||
message_snapshots?: APIMessageSnapshot[];
|
||||
/**
|
||||
* The call associated with the message
|
||||
*/
|
||||
@@ -810,6 +814,10 @@ export interface APIMessageActivity {
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
/**
|
||||
* Type of reference
|
||||
*/
|
||||
type?: MessageReferenceType;
|
||||
/**
|
||||
* ID of the originating message
|
||||
*/
|
||||
@@ -834,6 +842,20 @@ export enum MessageActivityType {
|
||||
JoinRequest = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-types
|
||||
*/
|
||||
export enum MessageReferenceType {
|
||||
/**
|
||||
* A standard reference used by replies
|
||||
*/
|
||||
Default = 0,
|
||||
/**
|
||||
* Reference used to point to a message at a point in time
|
||||
*/
|
||||
Forward = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
@@ -1404,6 +1426,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* The title of the file
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
@@ -1652,7 +1678,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
url: string;
|
||||
}
|
||||
|
||||
export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
export type APIButtonComponent =
|
||||
| APIButtonComponentWithCustomId
|
||||
| APIButtonComponentWithSKUId
|
||||
| APIButtonComponentWithURL;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
|
||||
@@ -1663,6 +1700,7 @@ export enum ButtonStyle {
|
||||
Success,
|
||||
Danger,
|
||||
Link,
|
||||
Premium,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1868,6 +1906,20 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-snapshot-object
|
||||
*/
|
||||
export interface APIMessageSnapshot {
|
||||
/**
|
||||
* Subset of the message object fields
|
||||
*/
|
||||
message: APIMessageSnapshotFields;
|
||||
/**
|
||||
* Id of the origin message's guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
@@ -1926,3 +1978,16 @@ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuCom
|
||||
|
||||
// Modal components
|
||||
export type APIModalActionRowComponent = APITextInputComponent;
|
||||
|
||||
export type APIMessageSnapshotFields = Pick<
|
||||
APIMessage,
|
||||
| 'attachments'
|
||||
| 'content'
|
||||
| 'edited_timestamp'
|
||||
| 'embeds'
|
||||
| 'flags'
|
||||
| 'mention_roles'
|
||||
| 'mentions'
|
||||
| 'timestamp'
|
||||
| 'type'
|
||||
>;
|
||||
|
||||
@@ -67,6 +67,113 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null;
|
||||
/**
|
||||
* The definition for how often this event should recur
|
||||
*/
|
||||
recurrence_rule: APIGuildScheduledEventRecurrenceRule | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-structure
|
||||
*/
|
||||
export interface APIGuildScheduledEventRecurrenceRule {
|
||||
/**
|
||||
* Starting time of the recurrence interval
|
||||
*/
|
||||
start: string;
|
||||
/**
|
||||
* Ending time of the recurrence interval
|
||||
*/
|
||||
end: string | null;
|
||||
/**
|
||||
* How often the event occurs
|
||||
*/
|
||||
frequency: GuildScheduledEventRecurrenceRuleFrequency;
|
||||
/**
|
||||
* The spacing between the events, defined by `frequency`.
|
||||
* For example, `frequency` of {@apilink GuildScheduledEventRecurrenceRuleFrequency#Weekly} and an `interval` of `2`
|
||||
* would be "every-other week"
|
||||
*/
|
||||
interval: number;
|
||||
/**
|
||||
* Set of specific days within a week for the event to recur on
|
||||
*/
|
||||
by_weekday: GuildScheduledEventRecurrenceRuleWeekday[] | null;
|
||||
/**
|
||||
* List of specific days within a specific week (1-5) to recur on
|
||||
*/
|
||||
by_n_weekday: GuildScheduledEventRecurrenceRuleNWeekday[] | null;
|
||||
/**
|
||||
* Set of specific months to recur on
|
||||
*/
|
||||
by_month: GuildScheduledEventRecurrenceRuleMonth[] | null;
|
||||
/**
|
||||
* Set of specific dates within a month to recur on
|
||||
*/
|
||||
by_month_day: number[] | null;
|
||||
/**
|
||||
* Set of days within a year to recur on (1-364)
|
||||
*/
|
||||
by_year_day: number[] | null;
|
||||
/**
|
||||
* The total amount of times that the event is allowed to recur before stopping
|
||||
*/
|
||||
count: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-frequency
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleFrequency {
|
||||
Yearly,
|
||||
Monthly,
|
||||
Weekly,
|
||||
Daily,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-weekday
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleWeekday {
|
||||
Monday,
|
||||
Tuesday,
|
||||
Wednesday,
|
||||
Thursday,
|
||||
Friday,
|
||||
Saturday,
|
||||
Sunday,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-month
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleMonth {
|
||||
January = 1,
|
||||
February,
|
||||
March,
|
||||
April,
|
||||
May,
|
||||
June,
|
||||
July,
|
||||
August,
|
||||
September,
|
||||
October,
|
||||
November,
|
||||
December,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-nweekday-structure
|
||||
*/
|
||||
export interface GuildScheduledEventRecurrenceRuleNWeekday {
|
||||
/**
|
||||
* The week to reoccur on.
|
||||
*/
|
||||
n: 1 | 2 | 3 | 4 | 5;
|
||||
/**
|
||||
* The day within the week to reoccur on
|
||||
*/
|
||||
day: GuildScheduledEventRecurrenceRuleWeekday;
|
||||
}
|
||||
|
||||
export interface APIStageInstanceGuildScheduledEvent
|
||||
|
||||
@@ -22,10 +22,14 @@ export interface APIPoll {
|
||||
expiry: string;
|
||||
/**
|
||||
* Whether a user can select multiple answers
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
allow_multiselect: boolean;
|
||||
/**
|
||||
* The layout type of the poll
|
||||
*
|
||||
* @default PollLayoutType.Default
|
||||
*/
|
||||
layout_type: PollLayoutType;
|
||||
/**
|
||||
|
||||
@@ -286,6 +286,7 @@ export enum ConnectionService {
|
||||
PlayStationNetwork = 'playstation',
|
||||
Reddit = 'reddit',
|
||||
RiotGames = 'riotgames',
|
||||
Roblox = 'roblox',
|
||||
Spotify = 'spotify',
|
||||
Skype = 'skype',
|
||||
Steam = 'steam',
|
||||
|
||||
@@ -7,8 +7,15 @@ import type { APIGuildMember } from './guild';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*
|
||||
* @deprecated This is deprecated, use {@apilink APIVoiceState}
|
||||
*/
|
||||
export interface GatewayVoiceState {
|
||||
export type GatewayVoiceState = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
export interface APIVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
|
||||
@@ -98,6 +98,8 @@ export enum InteractionResponseType {
|
||||
Modal,
|
||||
/**
|
||||
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
|
||||
*
|
||||
* @deprecated See https://discord.com/developers/docs/change-log#premium-apps-new-premium-button-style-deep-linking-url-schemes
|
||||
*/
|
||||
PremiumRequired,
|
||||
}
|
||||
|
||||
@@ -108,6 +108,10 @@ export interface APIApplication {
|
||||
* Approximate count of guilds the application has been added to
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* Approximate count of users that have installed the app
|
||||
*/
|
||||
approximate_user_install_count?: number;
|
||||
/**
|
||||
* Array of redirect URIs for the application
|
||||
*/
|
||||
|
||||
@@ -720,6 +720,10 @@ export interface APIMessage {
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
poll?: APIPoll;
|
||||
/**
|
||||
* The message associated with the message_reference. This is a minimal subset of fields in a message (e.g. author is excluded.)
|
||||
*/
|
||||
message_snapshots?: APIMessageSnapshot[];
|
||||
/**
|
||||
* The call associated with the message
|
||||
*/
|
||||
@@ -795,6 +799,10 @@ export interface APIMessageActivity {
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
/**
|
||||
* Type of reference
|
||||
*/
|
||||
type?: MessageReferenceType;
|
||||
/**
|
||||
* ID of the originating message
|
||||
*/
|
||||
@@ -819,6 +827,20 @@ export enum MessageActivityType {
|
||||
JoinRequest = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-types
|
||||
*/
|
||||
export enum MessageReferenceType {
|
||||
/**
|
||||
* A standard reference used by replies
|
||||
*/
|
||||
Default = 0,
|
||||
/**
|
||||
* Reference used to point to a message at a point in time
|
||||
*/
|
||||
Forward = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
@@ -1371,6 +1393,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* The title of the file
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
@@ -1619,7 +1645,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
url: string;
|
||||
}
|
||||
|
||||
export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
export type APIButtonComponent =
|
||||
| APIButtonComponentWithCustomId
|
||||
| APIButtonComponentWithSKUId
|
||||
| APIButtonComponentWithURL;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
|
||||
@@ -1630,6 +1667,7 @@ export enum ButtonStyle {
|
||||
Success,
|
||||
Danger,
|
||||
Link,
|
||||
Premium,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1835,6 +1873,20 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-snapshot-object
|
||||
*/
|
||||
export interface APIMessageSnapshot {
|
||||
/**
|
||||
* Subset of the message object fields
|
||||
*/
|
||||
message: APIMessageSnapshotFields;
|
||||
/**
|
||||
* Id of the origin message's guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
@@ -1893,3 +1945,16 @@ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuCom
|
||||
|
||||
// Modal components
|
||||
export type APIModalActionRowComponent = APITextInputComponent;
|
||||
|
||||
export type APIMessageSnapshotFields = Pick<
|
||||
APIMessage,
|
||||
| 'attachments'
|
||||
| 'content'
|
||||
| 'edited_timestamp'
|
||||
| 'embeds'
|
||||
| 'flags'
|
||||
| 'mention_roles'
|
||||
| 'mentions'
|
||||
| 'timestamp'
|
||||
| 'type'
|
||||
>;
|
||||
|
||||
@@ -67,6 +67,113 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null;
|
||||
/**
|
||||
* The definition for how often this event should recur
|
||||
*/
|
||||
recurrence_rule: APIGuildScheduledEventRecurrenceRule | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-structure
|
||||
*/
|
||||
export interface APIGuildScheduledEventRecurrenceRule {
|
||||
/**
|
||||
* Starting time of the recurrence interval
|
||||
*/
|
||||
start: string;
|
||||
/**
|
||||
* Ending time of the recurrence interval
|
||||
*/
|
||||
end: string | null;
|
||||
/**
|
||||
* How often the event occurs
|
||||
*/
|
||||
frequency: GuildScheduledEventRecurrenceRuleFrequency;
|
||||
/**
|
||||
* The spacing between the events, defined by `frequency`.
|
||||
* For example, `frequency` of {@apilink GuildScheduledEventRecurrenceRuleFrequency#Weekly} and an `interval` of `2`
|
||||
* would be "every-other week"
|
||||
*/
|
||||
interval: number;
|
||||
/**
|
||||
* Set of specific days within a week for the event to recur on
|
||||
*/
|
||||
by_weekday: GuildScheduledEventRecurrenceRuleWeekday[] | null;
|
||||
/**
|
||||
* List of specific days within a specific week (1-5) to recur on
|
||||
*/
|
||||
by_n_weekday: GuildScheduledEventRecurrenceRuleNWeekday[] | null;
|
||||
/**
|
||||
* Set of specific months to recur on
|
||||
*/
|
||||
by_month: GuildScheduledEventRecurrenceRuleMonth[] | null;
|
||||
/**
|
||||
* Set of specific dates within a month to recur on
|
||||
*/
|
||||
by_month_day: number[] | null;
|
||||
/**
|
||||
* Set of days within a year to recur on (1-364)
|
||||
*/
|
||||
by_year_day: number[] | null;
|
||||
/**
|
||||
* The total amount of times that the event is allowed to recur before stopping
|
||||
*/
|
||||
count: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-frequency
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleFrequency {
|
||||
Yearly,
|
||||
Monthly,
|
||||
Weekly,
|
||||
Daily,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-weekday
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleWeekday {
|
||||
Monday,
|
||||
Tuesday,
|
||||
Wednesday,
|
||||
Thursday,
|
||||
Friday,
|
||||
Saturday,
|
||||
Sunday,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-month
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleMonth {
|
||||
January = 1,
|
||||
February,
|
||||
March,
|
||||
April,
|
||||
May,
|
||||
June,
|
||||
July,
|
||||
August,
|
||||
September,
|
||||
October,
|
||||
November,
|
||||
December,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-nweekday-structure
|
||||
*/
|
||||
export interface GuildScheduledEventRecurrenceRuleNWeekday {
|
||||
/**
|
||||
* The week to reoccur on.
|
||||
*/
|
||||
n: 1 | 2 | 3 | 4 | 5;
|
||||
/**
|
||||
* The day within the week to reoccur on
|
||||
*/
|
||||
day: GuildScheduledEventRecurrenceRuleWeekday;
|
||||
}
|
||||
|
||||
export interface APIStageInstanceGuildScheduledEvent
|
||||
|
||||
@@ -22,10 +22,14 @@ export interface APIPoll {
|
||||
expiry: string;
|
||||
/**
|
||||
* Whether a user can select multiple answers
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
allow_multiselect: boolean;
|
||||
/**
|
||||
* The layout type of the poll
|
||||
*
|
||||
* @default PollLayoutType.Default
|
||||
*/
|
||||
layout_type: PollLayoutType;
|
||||
/**
|
||||
|
||||
@@ -285,6 +285,7 @@ export enum ConnectionService {
|
||||
PlayStationNetwork = 'playstation',
|
||||
Reddit = 'reddit',
|
||||
RiotGames = 'riotgames',
|
||||
Roblox = 'roblox',
|
||||
PayPal = 'paypal',
|
||||
Spotify = 'spotify',
|
||||
Skype = 'skype',
|
||||
|
||||
@@ -7,8 +7,15 @@ import type { APIGuildMember } from './guild';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*
|
||||
* @deprecated This is deprecated, use {@apilink APIVoiceState}
|
||||
*/
|
||||
export interface GatewayVoiceState {
|
||||
export type GatewayVoiceState = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
export interface APIVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
|
||||
@@ -43,8 +43,8 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
UnknownDiscoverableServerCategory = 10_059,
|
||||
UnknownSticker,
|
||||
|
||||
UnknownInteraction = 10_062,
|
||||
UnknownStickerPack,
|
||||
UnknownInteraction,
|
||||
UnknownApplicationCommand,
|
||||
|
||||
UnknownVoiceState = 10_065,
|
||||
|
||||
@@ -26,12 +26,17 @@ import type {
|
||||
ChannelFlags,
|
||||
} from '../../payloads/v10/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
|
||||
import type { RESTAPIPollCreate } from './poll';
|
||||
import type { RESTAPIPoll } from './poll';
|
||||
|
||||
export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIChannelPatchOverwrite} instead
|
||||
*/
|
||||
export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel
|
||||
*/
|
||||
@@ -98,7 +103,7 @@ export interface RESTPatchAPIChannelJSONBody {
|
||||
*
|
||||
* Channel types: all excluding newsThread, publicThread, privateThread
|
||||
*/
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined;
|
||||
permission_overwrites?: RESTAPIChannelPatchOverwrite[] | null | undefined;
|
||||
/**
|
||||
* ID of the new parent category for a channel
|
||||
*
|
||||
@@ -237,7 +242,7 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Required<Pick<APIMessageReference, 'message_id'>>
|
||||
> &
|
||||
StrictPartial<APIMessageReference> & {
|
||||
@@ -249,6 +254,11 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO
|
||||
fail_if_not_exists?: boolean | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIMessageReference} instead
|
||||
*/
|
||||
export type APIMessageReferenceSend = RESTAPIMessageReference;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
@@ -300,7 +310,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend | undefined;
|
||||
message_reference?: RESTAPIMessageReference | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
@@ -329,7 +339,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
poll?: RESTAPIPoll | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -362,7 +372,12 @@ export type RESTPutAPIChannelMessageReactionResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-own-reaction
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = never;
|
||||
export type RESTDeleteAPIChannelMessageOwnReactionResult = never;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTDeleteAPIChannelMessageOwnReactionResult} instead
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = RESTDeleteAPIChannelMessageOwnReactionResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-user-reaction
|
||||
|
||||
@@ -59,3 +59,40 @@ export type RESTPatchAPIGuildEmojiResult = APIEmoji;
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIGuildEmojiResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-application-emojis
|
||||
*/
|
||||
export interface RESTGetAPIApplicationEmojisResult {
|
||||
items: APIEmoji[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#get-application-emoji
|
||||
*/
|
||||
export type RESTGetAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params
|
||||
*/
|
||||
export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSONBody, 'image' | 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-application-emoji
|
||||
*/
|
||||
export type RESTPostAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
|
||||
*/
|
||||
export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJSONBody, 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
|
||||
*/
|
||||
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-application-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIApplicationEmojiResult = never;
|
||||
|
||||
@@ -37,14 +37,25 @@ import type {
|
||||
} from '../../utils/internals';
|
||||
import type { RESTPutAPIChannelPermissionJSONBody } from './channel';
|
||||
|
||||
export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
export type APIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
|
||||
export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead
|
||||
*/
|
||||
export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite;
|
||||
|
||||
export type RESTAPIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildChannelResolvable} instead
|
||||
*/
|
||||
export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable;
|
||||
|
||||
export type RESTAPIGuildCreatePartialChannel = StrictPartial<
|
||||
DistributivePick<
|
||||
APIGuildChannelResolvable,
|
||||
RESTAPIGuildChannelResolvable,
|
||||
| 'available_tags'
|
||||
| 'bitrate'
|
||||
| 'default_auto_archive_duration'
|
||||
@@ -66,13 +77,23 @@ export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
name: string;
|
||||
id?: number | string | undefined;
|
||||
parent_id?: number | string | null | undefined;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
|
||||
permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined;
|
||||
};
|
||||
|
||||
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreatePartialChannel} instead
|
||||
*/
|
||||
export type APIGuildCreatePartialChannel = RESTAPIGuildCreatePartialChannel;
|
||||
|
||||
export interface RESTAPIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreateRole} instead
|
||||
*/
|
||||
export type APIGuildCreateRole = RESTAPIGuildCreateRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
*/
|
||||
@@ -124,7 +145,7 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
roles?: APIGuildCreateRole[] | undefined;
|
||||
roles?: RESTAPIGuildCreateRole[] | undefined;
|
||||
/**
|
||||
* New guild's channels
|
||||
*
|
||||
@@ -138,7 +159,7 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels?: APIGuildCreatePartialChannel[] | undefined;
|
||||
channels?: RESTAPIGuildCreatePartialChannel[] | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
@@ -333,7 +354,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
*/
|
||||
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<APIGuildCreatePartialChannel, 'id'>;
|
||||
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<RESTAPIGuildCreatePartialChannel, 'id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
@@ -739,6 +760,11 @@ export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-role
|
||||
*/
|
||||
export type RESTGetAPIGuildRoleResult = APIRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
*/
|
||||
@@ -891,48 +917,6 @@ export interface RESTPatchAPIGuildMemberVerificationJSONBody {
|
||||
|
||||
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
|
||||
*/
|
||||
@@ -967,20 +951,25 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
/**
|
||||
* Prompts shown during onboarding and in customize community
|
||||
*/
|
||||
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
|
||||
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
export type RESTAPIGuildOnboardingPrompt = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
|
||||
|
||||
export type RESTAPIGuildOnboardingPromptOption = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> & {
|
||||
@@ -998,6 +987,11 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossibl
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardingPromptOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { StrictPartial } from '../../utils/internals';
|
||||
import type { Nullable, StrictPartial } from '../../utils/internals';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
APIGuildScheduledEventRecurrenceRule,
|
||||
APIGuildScheduledEventUser,
|
||||
GuildScheduledEventEntityType,
|
||||
GuildScheduledEventPrivacyLevel,
|
||||
@@ -64,6 +65,10 @@ export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null | undefined;
|
||||
/**
|
||||
* The definition for how often this event should recur
|
||||
*/
|
||||
recurrence_rule?: APIGuildScheduledEventRecurrenceRule | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,20 +94,17 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | null | undefined;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string | null | undefined;
|
||||
};
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> &
|
||||
StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
|
||||
@@ -32,6 +32,7 @@ export const Routes = {
|
||||
applicationRoleConnectionMetadata(applicationId: Snowflake) {
|
||||
return `/applications/${applicationId}/role-connections/metadata` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/auto-moderation/rules`
|
||||
@@ -344,6 +345,7 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - PATCH `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/roles/{role.id}`
|
||||
*/
|
||||
@@ -786,6 +788,8 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/voice-states/@me`
|
||||
* - GET `/guilds/{guild.id}/voice-states/{user.id}`
|
||||
* - PATCH `/guilds/{guild.id}/voice-states/@me`
|
||||
* - PATCH `/guilds/{guild.id}/voice-states/{user.id}`
|
||||
*/
|
||||
@@ -854,6 +858,14 @@ export const Routes = {
|
||||
return '/sticker-packs' as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/sticker-packs/{pack.id}`
|
||||
*/
|
||||
stickerPack(packId: Snowflake) {
|
||||
return `/sticker-packs/${packId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/sticker-packs`
|
||||
@@ -912,8 +924,8 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/${guild.id}/onboarding`
|
||||
* - PUT `/guilds/${guild.id}/onboarding`
|
||||
* - GET `/guilds/{guild.id}/onboarding`
|
||||
* - PUT `/guilds/{guild.id}/onboarding`
|
||||
*/
|
||||
guildOnboarding(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/onboarding` as const;
|
||||
@@ -963,11 +975,30 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
|
||||
* - POST `/applications/{application.id}/entitlements/{entitlement.id}/consume`
|
||||
*/
|
||||
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
|
||||
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/emojis`
|
||||
* - POST `/applications/{application.id}/emojis`
|
||||
*/
|
||||
applicationEmojis(applicationId: Snowflake) {
|
||||
return `/applications/${applicationId}/emojis` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/emojis/{emoji.id}`
|
||||
* - PATCH `/applications/{application.id}/emojis/{emoji.id}`
|
||||
* - DELETE `/applications/{application.id}/emojis/{emoji.id}`
|
||||
*/
|
||||
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
|
||||
return `/applications/${applicationId}/emojis/${emojiId}` as const;
|
||||
},
|
||||
};
|
||||
|
||||
export const StickerPackApplicationId = '710982414301790216';
|
||||
@@ -995,14 +1026,14 @@ export const CDNRoutes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/icons/{guild.id}.{png|jpeg|webp|gif}`
|
||||
* - GET `/icons/{guild.id}/{guild.icon}.{png|jpeg|webp|gif}`
|
||||
*
|
||||
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP, GIF
|
||||
*/
|
||||
guildIcon<Format extends GuildIconFormat>(guildId: Snowflake, guildIcon: string, format: Format) {
|
||||
return `icons/${guildId}/${guildIcon}.${format}` as const;
|
||||
return `/icons/${guildId}/${guildIcon}.${format}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1081,7 +1112,7 @@ export const CDNRoutes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/users/{user.id}/{guild_member.avatar}.{png|jpeg|webp|gif}`
|
||||
* - GET `/guilds/{guild.id}/users/{user.id}/avatars/{guild_member.avatar}.{png|jpeg|webp|gif}`
|
||||
*
|
||||
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
|
||||
*
|
||||
@@ -1201,7 +1232,7 @@ export const CDNRoutes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
|
||||
* - GET `/team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@ export type RESTGetAPIEntitlementsResult = APIEntitlement[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
|
||||
*/
|
||||
export interface RESTPostAPIEntitlementBody {
|
||||
export interface RESTPostAPIEntitlementJSONBody {
|
||||
/**
|
||||
* ID of the SKU to grant the entitlement to
|
||||
*/
|
||||
@@ -61,6 +61,11 @@ export interface RESTPostAPIEntitlementBody {
|
||||
owner_type: EntitlementOwnerType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTPostAPIEntitlementJSONBody} instead
|
||||
*/
|
||||
export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
|
||||
*/
|
||||
|
||||
@@ -40,14 +40,27 @@ export interface RESTOAuth2AuthorizationQuery {
|
||||
prompt?: 'consent' | 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-token-revocation-example
|
||||
*/
|
||||
export interface RESTPostOAuth2TokenRevocationQuery {
|
||||
token: string;
|
||||
token_type_hint?: 'access_token' | 'refresh_token';
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
|
||||
*/
|
||||
export interface RESTOAuth2AuthorizationQueryResult {
|
||||
export interface RESTPostOAuth2AuthorizationQueryResult {
|
||||
code: string;
|
||||
state?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTPostOAuth2AuthorizationQueryResult} instead
|
||||
*/
|
||||
export type RESTOAuth2AuthorizationQueryResult = RESTPostOAuth2AuthorizationQueryResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
|
||||
*/
|
||||
|
||||
@@ -20,17 +20,26 @@ export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure
|
||||
*/
|
||||
export interface RESTAPIPollCreate extends Omit<APIPoll, 'answers' | 'expiry' | 'results'> {
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 7 days
|
||||
*/
|
||||
duration: number;
|
||||
export interface RESTAPIPoll
|
||||
extends Omit<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
|
||||
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: Omit<APIPollAnswer, 'answer_id'>[];
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 32 days
|
||||
*
|
||||
* @default 24
|
||||
*/
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIPoll} instead
|
||||
*/
|
||||
export type RESTAPIPollCreate = RESTAPIPoll;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,16 @@ export interface RESTGetStickerPacksResult {
|
||||
sticker_packs: APIStickerPack[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#get-sticker-pack
|
||||
*/
|
||||
export type RESTGetAPIStickerPackResult = APIStickerPack;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTGetAPIStickerPackResult} instead
|
||||
*/
|
||||
export type RESTGetAPIStickerPack = RESTGetAPIStickerPackResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
|
||||
*
|
||||
|
||||
@@ -76,6 +76,7 @@ export interface RESTAPIPartialCurrentUserGuild {
|
||||
id: Snowflake;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
banner: string | null;
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
permissions: Permissions;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { APIVoiceRegion } from '../../payloads/v10/index';
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { APIVoiceRegion, APIVoiceState } from '../../payloads/v10/index';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#list-voice-regions
|
||||
@@ -9,3 +10,55 @@ export type RESTGetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
* @deprecated This was exported with the wrong name, use `RESTGetAPIVoiceRegionsResult` instead
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = RESTGetAPIVoiceRegionsResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#get-current-user-voice-state
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceStateCurrentMemberResult = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#get-user-voice-state
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceStateUserResult = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
} from '../../payloads/v10/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals';
|
||||
import type { RESTAPIAttachment } from './channel';
|
||||
import type { RESTAPIPollCreate } from './poll';
|
||||
import type { RESTAPIPoll } from './poll';
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
@@ -158,7 +158,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
poll?: RESTAPIPoll | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -26,12 +26,17 @@ import type {
|
||||
ChannelFlags,
|
||||
} from '../../payloads/v9/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
|
||||
import type { RESTAPIPollCreate } from './poll';
|
||||
import type { RESTAPIPoll } from './poll';
|
||||
|
||||
export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIChannelPatchOverwrite} instead
|
||||
*/
|
||||
export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel
|
||||
*/
|
||||
@@ -237,7 +242,7 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Required<Pick<APIMessageReference, 'message_id'>>
|
||||
> &
|
||||
StrictPartial<APIMessageReference> & {
|
||||
@@ -249,6 +254,11 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO
|
||||
fail_if_not_exists?: boolean | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIMessageReference} instead
|
||||
*/
|
||||
export type APIMessageReferenceSend = RESTAPIMessageReference;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
@@ -308,7 +318,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend | undefined;
|
||||
message_reference?: RESTAPIMessageReference | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
@@ -337,7 +347,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
poll?: RESTAPIPoll | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -370,7 +380,12 @@ export type RESTPutAPIChannelMessageReactionResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-own-reaction
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = never;
|
||||
export type RESTDeleteAPIChannelMessageOwnReactionResult = never;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTDeleteAPIChannelMessageOwnReactionResult} instead
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = RESTDeleteAPIChannelMessageOwnReactionResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-user-reaction
|
||||
|
||||
@@ -59,3 +59,40 @@ export type RESTPatchAPIGuildEmojiResult = APIEmoji;
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIGuildEmojiResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-application-emojis
|
||||
*/
|
||||
export interface RESTGetAPIApplicationEmojisResult {
|
||||
items: APIEmoji[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#get-application-emoji
|
||||
*/
|
||||
export type RESTGetAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params
|
||||
*/
|
||||
export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSONBody, 'image' | 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-application-emoji
|
||||
*/
|
||||
export type RESTPostAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
|
||||
*/
|
||||
export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJSONBody, 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
|
||||
*/
|
||||
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-application-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIApplicationEmojiResult = never;
|
||||
|
||||
104
rest/v9/guild.ts
104
rest/v9/guild.ts
@@ -37,14 +37,25 @@ import type {
|
||||
} from '../../utils/internals';
|
||||
import type { RESTPutAPIChannelPermissionJSONBody } from './channel';
|
||||
|
||||
export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
export type APIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
|
||||
export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead
|
||||
*/
|
||||
export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite;
|
||||
|
||||
export type RESTAPIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildChannelResolvable} instead
|
||||
*/
|
||||
export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable;
|
||||
|
||||
export type RESTAPIGuildCreatePartialChannel = StrictPartial<
|
||||
DistributivePick<
|
||||
APIGuildChannelResolvable,
|
||||
RESTAPIGuildChannelResolvable,
|
||||
| 'available_tags'
|
||||
| 'bitrate'
|
||||
| 'default_auto_archive_duration'
|
||||
@@ -66,13 +77,23 @@ export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
name: string;
|
||||
id?: number | string | undefined;
|
||||
parent_id?: number | string | null | undefined;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
|
||||
permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined;
|
||||
};
|
||||
|
||||
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreatePartialChannel} instead
|
||||
*/
|
||||
export type APIGuildCreatePartialChannel = RESTAPIGuildCreatePartialChannel;
|
||||
|
||||
export interface RESTAPIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreateRole} instead
|
||||
*/
|
||||
export type APIGuildCreateRole = RESTAPIGuildCreateRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
*/
|
||||
@@ -124,7 +145,7 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
roles?: APIGuildCreateRole[] | undefined;
|
||||
roles?: RESTAPIGuildCreateRole[] | undefined;
|
||||
/**
|
||||
* New guild's channels
|
||||
*
|
||||
@@ -138,7 +159,7 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels?: APIGuildCreatePartialChannel[] | undefined;
|
||||
channels?: RESTAPIGuildCreatePartialChannel[] | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
@@ -333,7 +354,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
*/
|
||||
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<APIGuildCreatePartialChannel, 'id'>;
|
||||
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<RESTAPIGuildCreatePartialChannel, 'id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
@@ -745,6 +766,11 @@ export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-role
|
||||
*/
|
||||
export type RESTGetAPIGuildRoleResult = APIRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
*/
|
||||
@@ -897,48 +923,6 @@ export interface RESTPatchAPIGuildMemberVerificationJSONBody {
|
||||
|
||||
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
|
||||
*/
|
||||
@@ -973,20 +957,25 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
/**
|
||||
* Prompts shown during onboarding and in customize community
|
||||
*/
|
||||
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
|
||||
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
export type RESTAPIGuildOnboardingPrompt = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
|
||||
|
||||
export type RESTAPIGuildOnboardingPromptOption = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> & {
|
||||
@@ -1004,6 +993,11 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossibl
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardingPromptOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
|
||||
*/
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { StrictPartial } from '../../utils/internals';
|
||||
import type { Nullable, StrictPartial } from '../../utils/internals';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
APIGuildScheduledEventRecurrenceRule,
|
||||
APIGuildScheduledEventUser,
|
||||
GuildScheduledEventEntityType,
|
||||
GuildScheduledEventPrivacyLevel,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
GuildScheduledEventStatus,
|
||||
APIGuildScheduledEventUser,
|
||||
} from '../../v9';
|
||||
|
||||
/**
|
||||
@@ -64,6 +65,10 @@ export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null | undefined;
|
||||
/**
|
||||
* The definition for how often this event should recur
|
||||
*/
|
||||
recurrence_rule?: APIGuildScheduledEventRecurrenceRule | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,20 +94,17 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | null | undefined;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string | null | undefined;
|
||||
};
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> &
|
||||
StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
|
||||
@@ -32,6 +32,7 @@ export const Routes = {
|
||||
applicationRoleConnectionMetadata(applicationId: Snowflake) {
|
||||
return `/applications/${applicationId}/role-connections/metadata` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/auto-moderation/rules`
|
||||
@@ -344,6 +345,7 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - PATCH `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/roles/{role.id}`
|
||||
*/
|
||||
@@ -795,6 +797,8 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/voice-states/@me`
|
||||
* - GET `/guilds/{guild.id}/voice-states/{user.id}`
|
||||
* - PATCH `/guilds/{guild.id}/voice-states/@me`
|
||||
* - PATCH `/guilds/{guild.id}/voice-states/{user.id}`
|
||||
*/
|
||||
@@ -863,6 +867,14 @@ export const Routes = {
|
||||
return '/sticker-packs' as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/sticker-packs/{pack.id}`
|
||||
*/
|
||||
stickerPack(packId: Snowflake) {
|
||||
return `/sticker-packs/${packId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/sticker-packs`
|
||||
@@ -921,8 +933,8 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/${guild.id}/onboarding`
|
||||
* - PUT `/guilds/${guild.id}/onboarding`
|
||||
* - GET `/guilds/{guild.id}/onboarding`
|
||||
* - PUT `/guilds/{guild.id}/onboarding`
|
||||
*/
|
||||
guildOnboarding(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/onboarding` as const;
|
||||
@@ -972,11 +984,30 @@ export const Routes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
|
||||
* - POST `/applications/{application.id}/entitlements/{entitlement.id}/consume`
|
||||
*/
|
||||
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
|
||||
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/emojis`
|
||||
* - POST `/applications/{application.id}/emojis`
|
||||
*/
|
||||
applicationEmojis(applicationId: Snowflake) {
|
||||
return `/applications/${applicationId}/emojis` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/emojis/{emoji.id}`
|
||||
* - PATCH `/applications/{application.id}/emojis/{emoji.id}`
|
||||
* - DELETE `/applications/{application.id}/emojis/{emoji.id}`
|
||||
*/
|
||||
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
|
||||
return `/applications/${applicationId}/emojis/${emojiId}` as const;
|
||||
},
|
||||
};
|
||||
|
||||
export const StickerPackApplicationId = '710982414301790216';
|
||||
@@ -1004,14 +1035,14 @@ export const CDNRoutes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/icons/{guild.id}.{png|jpeg|webp|gif}`
|
||||
* - GET `/icons/{guild.id}/{guild.icon}.{png|jpeg|webp|gif}`
|
||||
*
|
||||
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP, GIF
|
||||
*/
|
||||
guildIcon<Format extends GuildIconFormat>(guildId: Snowflake, guildIcon: string, format: Format) {
|
||||
return `icons/${guildId}/${guildIcon}.${format}` as const;
|
||||
return `/icons/${guildId}/${guildIcon}.${format}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1090,7 +1121,7 @@ export const CDNRoutes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/users/{user.id}/{guild_member.avatar}.{png|jpeg|webp|gif}`
|
||||
* - GET `/guilds/{guild.id}/users/{user.id}/avatars/{guild_member.avatar}.{png|jpeg|webp|gif}`
|
||||
*
|
||||
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
|
||||
*
|
||||
@@ -1210,7 +1241,7 @@ export const CDNRoutes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
|
||||
* - GET `/team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@ export type RESTGetAPIEntitlementsResult = APIEntitlement[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
|
||||
*/
|
||||
export interface RESTPostAPIEntitlementBody {
|
||||
export interface RESTPostAPIEntitlementJSONBody {
|
||||
/**
|
||||
* ID of the SKU to grant the entitlement to
|
||||
*/
|
||||
@@ -61,6 +61,11 @@ export interface RESTPostAPIEntitlementBody {
|
||||
owner_type: EntitlementOwnerType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTPostAPIEntitlementJSONBody} instead
|
||||
*/
|
||||
export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
|
||||
*/
|
||||
|
||||
@@ -40,14 +40,27 @@ export interface RESTOAuth2AuthorizationQuery {
|
||||
prompt?: 'consent' | 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-token-revocation-example
|
||||
*/
|
||||
export interface RESTPostOAuth2TokenRevocationQuery {
|
||||
token: string;
|
||||
token_type_hint?: 'access_token' | 'refresh_token';
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
|
||||
*/
|
||||
export interface RESTOAuth2AuthorizationQueryResult {
|
||||
export interface RESTPostOAuth2AuthorizationQueryResult {
|
||||
code: string;
|
||||
state?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTPostOAuth2AuthorizationQueryResult} instead
|
||||
*/
|
||||
export type RESTOAuth2AuthorizationQueryResult = RESTPostOAuth2AuthorizationQueryResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
|
||||
*/
|
||||
|
||||
@@ -20,17 +20,26 @@ export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure
|
||||
*/
|
||||
export interface RESTAPIPollCreate extends Omit<APIPoll, 'answers' | 'expiry' | 'results'> {
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 7 days
|
||||
*/
|
||||
duration: number;
|
||||
export interface RESTAPIPoll
|
||||
extends Omit<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
|
||||
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: Omit<APIPollAnswer, 'answer_id'>[];
|
||||
/**
|
||||
* Number of hours the poll should be open for, up to 32 days
|
||||
*
|
||||
* @default 24
|
||||
*/
|
||||
duration?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIPoll} instead
|
||||
*/
|
||||
export type RESTAPIPollCreate = RESTAPIPoll;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
|
||||
@@ -12,6 +12,16 @@ export interface RESTGetStickerPacksResult {
|
||||
sticker_packs: APIStickerPack[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#get-sticker-pack
|
||||
*/
|
||||
export type RESTGetAPIStickerPackResult = APIStickerPack;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTGetAPIStickerPackResult} instead
|
||||
*/
|
||||
export type RESTGetAPIStickerPack = RESTGetAPIStickerPackResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
|
||||
*
|
||||
|
||||
@@ -76,6 +76,7 @@ export interface RESTAPIPartialCurrentUserGuild {
|
||||
id: Snowflake;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
banner: string | null;
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
permissions: Permissions;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { APIVoiceRegion } from '../../payloads/v9/index';
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { APIVoiceRegion, APIVoiceState } from '../../payloads/v9/index';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#list-voice-regions
|
||||
@@ -9,3 +10,55 @@ export type RESTGetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
* @deprecated This was exported with the wrong name, use `RESTGetAPIVoiceRegionsResult` instead
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = RESTGetAPIVoiceRegionsResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#get-current-user-voice-state
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceStateCurrentMemberResult = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#get-user-voice-state
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceStateUserResult = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
} from '../../payloads/v9/index';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals';
|
||||
import type { RESTAPIAttachment } from './channel';
|
||||
import type { RESTAPIPollCreate } from './poll';
|
||||
import type { RESTAPIPoll } from './poll';
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
@@ -158,7 +158,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPollCreate | undefined;
|
||||
poll?: RESTAPIPoll | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,6 +18,7 @@ await mkdir(denoPath);
|
||||
*/
|
||||
function convertImports(source) {
|
||||
return source.replaceAll(
|
||||
// eslint-disable-next-line prefer-named-capture-group
|
||||
/from '(.*)'/g,
|
||||
/**
|
||||
* @param _ Something
|
||||
|
||||
5
tests/v10/routes.test-d.ts
Normal file
5
tests/v10/routes.test-d.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { expectAssignable } from 'tsd';
|
||||
import { CDNRoutes, Routes } from '../../rest/v10/index';
|
||||
|
||||
expectAssignable<Record<string, (...args: any[]) => `/${string}`>>(Routes);
|
||||
expectAssignable<Record<string, (...args: any[]) => `/${string}`>>(CDNRoutes);
|
||||
5
tests/v9/routes.test-d.ts
Normal file
5
tests/v9/routes.test-d.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { expectAssignable } from 'tsd';
|
||||
import { CDNRoutes, Routes } from '../../rest/v9/index';
|
||||
|
||||
expectAssignable<Record<string, (...args: any[]) => `/${string}`>>(Routes);
|
||||
expectAssignable<Record<string, (...args: any[]) => `/${string}`>>(CDNRoutes);
|
||||
28
website/package-lock.json
generated
28
website/package-lock.json
generated
@@ -7213,11 +7213,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/braces": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||
"dependencies": {
|
||||
"fill-range": "^7.0.1"
|
||||
"fill-range": "^7.1.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
@@ -10982,9 +10982,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||
"dependencies": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
},
|
||||
@@ -26483,11 +26483,11 @@
|
||||
}
|
||||
},
|
||||
"braces": {
|
||||
"version": "3.0.2",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
|
||||
"integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
|
||||
"version": "3.0.3",
|
||||
"resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
|
||||
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||
"requires": {
|
||||
"fill-range": "^7.0.1"
|
||||
"fill-range": "^7.1.1"
|
||||
}
|
||||
},
|
||||
"browserslist": {
|
||||
@@ -29222,9 +29222,9 @@
|
||||
"integrity": "sha512-pjmC+bkIF8XI7fWaH8KxHcZL3DPybs1roSKP4rKDvy20tAWwIObE4+JIseG2byfGKhud5ZnM4YSGKBz7Sh0ndQ=="
|
||||
},
|
||||
"fill-range": {
|
||||
"version": "7.0.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
|
||||
"integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
|
||||
"version": "7.1.1",
|
||||
"resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
|
||||
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||
"requires": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "discord-api-types-website",
|
||||
"version": "1.0.0",
|
||||
"description": "Website for discord-api-types, hosted on https://discord-api-types.dev",
|
||||
"author": "Vlad Frangu <kingdgrizzle@gmail.com>",
|
||||
"author": "Vlad Frangu <me@vladfrangu.dev>",
|
||||
"license": "MIT",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user