Compare commits

...

72 Commits

Author SHA1 Message Date
github-actions[bot]
557c534b67 chore(release): 0.37.99 🎉 (#1088)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-02 15:25:08 +03:00
renovate[bot]
8054f50230 chore(deps): update patch/minor dependencies (#1081)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-31 04:00:52 +03:00
renovate[bot]
74d80b1e77 chore(deps): lock file maintenance (#1082)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-31 04:00:40 +03:00
Danial Raza
a9c6985d63 docs: mark APIApplication#summary and APISticker#asset as unstable (#1080) 2024-08-31 04:00:22 +03:00
Almeida
4b64f84ddf feat: remove unstable from stable fields (#1086) 2024-08-31 03:59:52 +03:00
Almeida
2803e8df2f feat(GuildMemberFlags): IsGuest and DmSettingsUpsellAcknowledged (#1079) 2024-08-29 22:50:15 +03:00
github-actions[bot]
58848bed54 chore(release): 0.37.98 🎉 (#1076)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-26 15:23:06 +03:00
Almeida
f019f0fe97 feat(RESTAPIAttachment): add more properties (#1073) 2024-08-23 12:09:08 +03:00
renovate[bot]
e09ded64b3 chore(deps): lock file maintenance (#1072)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-23 12:08:21 +03:00
renovate[bot]
3aee5c4a0d chore(deps): lock file maintenance (#1071)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-23 11:46:22 +03:00
renovate[bot]
3455ed4cce chore(deps): update patch/minor dependencies (#1070)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-23 03:58:15 +03:00
github-actions[bot]
4ef182d009 chore(release): 0.37.97 🎉 (#1068)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-22 15:22:57 +03:00
Almeida
86a9f965dd refactor(rest): ensure types follow naming pattern (#1065)
Co-authored-by: Synbulat Biishev <signin@syjalo.dev>
2024-08-22 14:41:56 +03:00
github-actions[bot]
b90fddc285 chore(release): 0.37.96 🎉 (#1066)
Build ran for f67043b3f4

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-20 11:22:06 +03:00
Almeida
f67043b3f4 fix: nullable fields for scheduled event editing (#1064) 2024-08-19 17:48:33 +03:00
Almeida
19d2aeb4a8 fix: nullable recurrence_rule on patch (#1063) 2024-08-19 17:39:07 +03:00
github-actions[bot]
31b3766b19 chore(release): 0.37.95 🎉 (#1062)
Build ran for 1b1a865efe

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-19 15:23:04 +03:00
Naiyar
1b1a865efe feat(Routes): voice state endpoint (#1046) 2024-08-16 15:33:15 +03:00
renovate[bot]
a85521aa8b chore(deps): lock file maintenance (#1061)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-16 15:30:44 +03:00
renovate[bot]
8b00031c51 chore(deps): lock file maintenance (#1060)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-16 03:34:11 +03:00
Almeida
147e459a16 fix: interface name (#1059) 2024-08-15 21:16:59 +03:00
Almeida
fbfbc6b23f feat: recurring scheduled events (#1058) 2024-08-15 20:43:55 +03:00
Almeida
906dd8e241 feat(RESTJSONErrorCodes): UnknownStickerPack (#1055) 2024-08-15 20:02:28 +03:00
github-actions[bot]
25efb9c403 chore(release): 0.37.94 🎉 (#1054)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-15 15:32:12 +03:00
Almeida
822956fe78 feat: add Get Sticker Pack endpoint (#1053) 2024-08-15 01:58:20 +03:00
Almeida
d5047639e6 feat(APIApplication): approximate_user_install_count (#1052) 2024-08-15 01:54:52 +03:00
renovate[bot]
cbd8d108ee chore(deps): lock file maintenance (#1049)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-14 23:56:11 +03:00
renovate[bot]
d816bf31ab chore(deps): update dependency eslint-plugin-local to v6 (#1048)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-14 23:46:49 +03:00
renovate[bot]
71602b5c49 chore(deps): update patch/minor dependencies (#1047)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-14 23:46:07 +03:00
Lars_und_so
6ead98b782 feat(RESTOAuth2): add RESTPostOAuth2TokenRevocationQuery (#1050) 2024-08-14 23:45:29 +03:00
TÆMBØ
ea1a6c3c86 feat(Routes): get method on role endpoint (#1051) 2024-08-14 19:03:52 +01:00
renovate[bot]
a59f9f002f chore(deps): lock file maintenance (#1045)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-02 13:22:10 +03:00
renovate[bot]
ace41f38e4 chore(deps): lock file maintenance (#1044)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-02 13:12:14 +03:00
renovate[bot]
25a6f5330f chore(deps): update dependency @typescript-eslint/utils to v8 (#1042)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-02 12:59:39 +03:00
renovate[bot]
4409fc24c1 chore(deps): update dependency @types/node to v20.14.14 (#1041)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-02 12:59:29 +03:00
renovate[bot]
1178c23389 chore(deps): lock file maintenance (#1043)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-02 12:54:09 +03:00
renovate[bot]
34b0ddd105 chore(deps): lock file maintenance (#1039)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-26 09:40:44 +03:00
renovate[bot]
9c1fc9bdee chore(deps): update patch/minor dependencies (#1038)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-26 09:08:53 +03:00
github-actions[bot]
472fe5f837 chore(release): 0.37.93 🎉 (#1037)
Build ran for 588140c0a9

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-22 16:31:52 +04:00
Vlad Frangu
588140c0a9 chore: test for this in tsd land not ts land 2024-07-20 17:18:54 +04:00
Vlad Frangu
799044d3f0 chore: ensure routes definitions emit correct paths
to prevent a repeat of a bug
2024-07-20 17:07:37 +04:00
Back
eb7b3d90dd fix(CDNRoutes): inconsistency in route and wrong JSDoc (#1033) 2024-07-20 12:13:31 +03:00
Suneet Tipirneni
2c1ff0ea34 feat: add support for message forwarding (#971) 2024-07-20 12:11:45 +03:00
Danial Raza
5f22a6baca feat: application emojis (#1036) 2024-07-20 12:07:31 +03:00
renovate[bot]
cbcd51d093 chore(deps): lock file maintenance (#1035)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-20 12:07:01 +03:00
Almeida
4f66b4dd04 feat(ConnectionService): add Roblox (#1032) 2024-07-20 12:05:47 +03:00
Almeida
da9496f291 feat(RESTAPIPartialCurrentUserGuild): add banner (#1028) 2024-07-20 12:05:30 +03:00
renovate[bot]
b1e1c60a07 chore(deps): update patch/minor dependencies (#1034)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-20 12:04:12 +03:00
renovate[bot]
4fdc6db296 chore(deps): update dependency rimraf to v6 (#1030)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-15 01:23:09 +03:00
renovate[bot]
608f0fa8cd chore(deps): lock file maintenance (#1031)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-15 01:15:25 +03:00
renovate[bot]
0e8b624c3e chore(deps): update patch/minor dependencies (#1029)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-15 01:15:04 +03:00
renovate[bot]
1301b3417c chore(deps): update patch/minor dependencies (#1025)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-08 22:19:52 +03:00
renovate[bot]
e098870a08 chore(deps): lock file maintenance (#1026)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-06 13:58:10 +03:00
github-actions[bot]
2049dde09a chore(release): 0.37.92 🎉 (#1024)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-04 15:21:59 +03:00
Almeida
ea7cafaafa chore: ignore deprecated versions on linters (#1023) 2024-07-02 23:55:34 +03:00
Almeida
c05998de27 fix(RESTAPIPollCreate): optional properties (#1022) 2024-07-02 23:34:48 +03:00
renovate[bot]
f50ae60ea9 chore(deps): lock file maintenance (#1021)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-28 15:57:19 +03:00
renovate[bot]
0ebf2afb58 chore(deps): lock file maintenance (#1020)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-28 14:26:19 +03:00
renovate[bot]
ee09eafb76 chore(deps): lock file maintenance (#1019)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-28 04:38:05 +03:00
renovate[bot]
a7fac3dc04 chore(deps): update dependency eslint-plugin-local to v5 (#1018)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-28 04:12:39 +03:00
renovate[bot]
1fd407f481 chore(deps): update patch/minor dependencies (#1017)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-28 04:08:44 +03:00
github-actions[bot]
aa8e307f4d chore(release): 0.37.91 🎉 (#1016)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-27 15:21:42 +03:00
Danial Raza
897fd90bf2 feat(APIAttachment): add title (#1015) 2024-06-26 00:59:23 +03:00
Vlad Frangu
666f0e79bc chore: update my email 2024-06-24 16:07:34 +03:00
renovate[bot]
c9117a7bcc chore(deps): lock file maintenance (#1014)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-21 13:23:43 +03:00
renovate[bot]
fe7ba16e3c chore(deps): lock file maintenance (#1013)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-21 03:42:18 +03:00
renovate[bot]
643bf747be chore(deps): update patch/minor dependencies (#1012)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-21 03:42:04 +03:00
github-actions[bot]
0340b3c3a1 chore(release): 0.37.90 🎉 (#1011)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-18 21:09:32 +03:00
renovate[bot]
45ef182b79 chore(deps): lock file maintenance (#1009)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-18 21:07:00 +03:00
renovate[bot]
17c19750ae chore(deps): update patch/minor dependencies (#1008)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-18 15:51:20 +03:00
TÆMBØ
088dbe016f feat: add premium buttons (#1010) 2024-06-18 11:30:44 +03:00
dependabot[bot]
e3eb86936e chore(deps): bump braces from 3.0.2 to 3.0.3 in /website (#1007)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 15:23:12 +03:00
122 changed files with 3655 additions and 1198 deletions

View File

@@ -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: [] }],
}),
},
};

View File

@@ -1 +1,12 @@
deno/
gateway/v6/*
payloads/v6/*
rest/v6/*
v6.ts
gateway/v8/*
payloads/v8/*
rest/v8/*
utils/v8.ts
v8.ts

View File

@@ -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"
]
}
]
}
}
]
}

View File

@@ -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

View File

@@ -1,3 +1,108 @@
## [0.37.99](https://github.com/discordjs/discord-api-types/compare/0.37.98...0.37.99) (2024-09-02)
### Features
* **GuildMemberFlags:** `IsGuest` and `DmSettingsUpsellAcknowledged` ([#1079](https://github.com/discordjs/discord-api-types/issues/1079)) ([2803e8d](https://github.com/discordjs/discord-api-types/commit/2803e8df2f2105099a1dc6e04193355a926718b9))
* remove unstable from stable fields ([#1086](https://github.com/discordjs/discord-api-types/issues/1086)) ([4b64f84](https://github.com/discordjs/discord-api-types/commit/4b64f84ddf0390f0a8979f57623c5f8c9051484d))
## [0.37.98](https://github.com/discordjs/discord-api-types/compare/0.37.97...0.37.98) (2024-08-26)
### Features
* **RESTAPIAttachment:** add more properties ([#1073](https://github.com/discordjs/discord-api-types/issues/1073)) ([f019f0f](https://github.com/discordjs/discord-api-types/commit/f019f0fe97ad47471dd6656e5fb148dc5761e1e0))
## [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)

View File

@@ -1,3 +1,108 @@
## [0.37.99](https://github.com/discordjs/discord-api-types/compare/0.37.98...0.37.99) (2024-09-02)
### Features
* **GuildMemberFlags:** `IsGuest` and `DmSettingsUpsellAcknowledged` ([#1079](https://github.com/discordjs/discord-api-types/issues/1079)) ([2803e8d](https://github.com/discordjs/discord-api-types/commit/2803e8df2f2105099a1dc6e04193355a926718b9))
* remove unstable from stable fields ([#1086](https://github.com/discordjs/discord-api-types/issues/1086)) ([4b64f84](https://github.com/discordjs/discord-api-types/commit/4b64f84ddf0390f0a8979f57623c5f8c9051484d))
## [0.37.98](https://github.com/discordjs/discord-api-types/compare/0.37.97...0.37.98) (2024-08-26)
### Features
* **RESTAPIAttachment:** add more properties ([#1073](https://github.com/discordjs/discord-api-types/issues/1073)) ([f019f0f](https://github.com/discordjs/discord-api-types/commit/f019f0fe97ad47471dd6656e5fb148dc5761e1e0))
## [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)

View File

@@ -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

View File

@@ -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

View File

@@ -92,14 +92,10 @@ export interface APIApplicationCommand {
nsfw?: boolean;
/**
* Installation context(s) where the command is available, only for globally-scoped commands. Defaults to `GUILD_INSTALL ([0])`
*
* @unstable
*/
integration_types?: ApplicationIntegrationType[];
/**
* Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands `[0,1,2]`.
*
* @unstable
*/
contexts?: InteractionContextType[] | null;
/**
@@ -124,11 +120,11 @@ export enum ApplicationIntegrationType {
/**
* App is installable to servers
*/
GuildInstall = 0,
GuildInstall,
/**
* App is installable to users
*/
UserInstall = 1,
UserInstall,
}
/**
@@ -138,15 +134,15 @@ export enum InteractionContextType {
/**
* Interaction can be used within servers
*/
Guild = 0,
Guild,
/**
* Interaction can be used within DMs with the app's bot user
*/
BotDM = 1,
BotDM,
/**
* Interaction can be used within Group DMs and DMs other than the app's bot user
*/
PrivateChannel = 2,
PrivateChannel,
}
/**

View File

@@ -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,
}

View File

@@ -64,6 +64,7 @@ export interface APIApplication {
* An empty string
*
* @deprecated This field will be removed in v11
* @unstable This field is no longer documented by Discord and will be removed in v11
*/
summary: '';
/**
@@ -108,6 +109,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
*/
@@ -131,8 +136,6 @@ export interface APIApplication {
install_params?: APIApplicationInstallParams;
/**
* Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object
*
* @unstable
*/
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
/**

View File

@@ -573,7 +573,7 @@ export interface APIMessage {
/**
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
@@ -669,8 +669,6 @@ export interface APIMessage {
referenced_message?: APIMessage | null;
/**
* Sent if the message is sent as a result of an interaction
*
* @unstable
*/
interaction_metadata?: APIMessageInteractionMetadata;
/**
@@ -735,6 +733,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 +812,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 +840,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,
/**
* Reference used to point to a message at a point in time
*/
Forward,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
*/
@@ -1393,7 +1413,7 @@ export interface APIEmbedField {
}
/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface APIAttachment {
/**
@@ -1404,6 +1424,10 @@ export interface APIAttachment {
* Name of file attached
*/
filename: string;
/**
* The title of the file
*/
title?: string;
/**
* Description for the file
*/
@@ -1652,7 +1676,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 +1698,7 @@ export enum ButtonStyle {
Success,
Danger,
Link,
Premium,
}
/**
@@ -1868,6 +1904,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 +1976,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'
>;

View File

@@ -689,7 +689,7 @@ export enum GuildMemberFlags {
*/
CompletedOnboarding = 1 << 1,
/**
* Member bypasses guild verification requirements
* Member is exempt from guild verification requirements
*/
BypassesVerification = 1 << 2,
/**
@@ -697,21 +697,29 @@ export enum GuildMemberFlags {
*/
StartedOnboarding = 1 << 3,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* Member is a guest and can only access the voice channel they were invited to
*/
IsGuest = 1 << 4,
/**
* Member has started Server Guide new member actions
*/
StartedHomeActions = 1 << 5,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* Member has completed Server Guide new member actions
*/
CompletedHomeActions = 1 << 6,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* Member's username, display name, or nickname is blocked by AutoMod
*/
AutomodQuarantinedUsernameOrGuildNickname = 1 << 7,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* @deprecated
*/
AutomodQuarantinedBio = 1 << 8,
/**
* Member has dismissed the DM settings upsell
*/
DmSettingsUpsellAcknowledged = 1 << 9,
}
/**

View File

@@ -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

View File

@@ -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;
/**

View File

@@ -33,6 +33,7 @@ export interface APISticker {
* Previously the sticker asset hash, now an empty string
*
* @deprecated
* @unstable This field is no longer documented by Discord and will be removed in v11
*/
asset?: '';
/**

View File

@@ -286,6 +286,7 @@ export enum ConnectionService {
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
RiotGames = 'riotgames',
Roblox = 'roblox',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',

View File

@@ -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
*/

View File

@@ -92,14 +92,10 @@ export interface APIApplicationCommand {
nsfw?: boolean;
/**
* Installation context(s) where the command is available, only for globally-scoped commands. Defaults to `GUILD_INSTALL ([0])`
*
* @unstable
*/
integration_types?: ApplicationIntegrationType[];
/**
* Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands `[0,1,2]`.
*
* @unstable
*/
contexts?: InteractionContextType[] | null;
/**
@@ -124,11 +120,11 @@ export enum ApplicationIntegrationType {
/**
* App is installable to servers
*/
GuildInstall = 0,
GuildInstall,
/**
* App is installable to users
*/
UserInstall = 1,
UserInstall,
}
/**
@@ -138,15 +134,15 @@ export enum InteractionContextType {
/**
* Interaction can be used within servers
*/
Guild = 0,
Guild,
/**
* Interaction can be used within DMs with the app's bot user
*/
BotDM = 1,
BotDM,
/**
* Interaction can be used within Group DMs and DMs other than the app's bot user
*/
PrivateChannel = 2,
PrivateChannel,
}
/**

View File

@@ -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,
}

View File

@@ -64,6 +64,7 @@ export interface APIApplication {
* An empty string
*
* @deprecated This field will be removed in v11
* @unstable This field is no longer documented by Discord and will be removed in v11
*/
summary: '';
/**
@@ -108,6 +109,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
*/
@@ -131,8 +136,6 @@ export interface APIApplication {
install_params?: APIApplicationInstallParams;
/**
* Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object
*
* @unstable
*/
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
/**

View File

@@ -567,7 +567,7 @@ export interface APIMessage {
/**
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
@@ -661,8 +661,6 @@ export interface APIMessage {
referenced_message?: APIMessage | null;
/**
* Sent if the message is sent as a result of an interaction
*
* @unstable
*/
interaction_metadata?: APIMessageInteractionMetadata;
/**
@@ -720,6 +718,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 +797,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 +825,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,
/**
* Reference used to point to a message at a point in time
*/
Forward,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
*/
@@ -1360,7 +1380,7 @@ export interface APIEmbedField {
}
/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface APIAttachment {
/**
@@ -1371,6 +1391,10 @@ export interface APIAttachment {
* Name of file attached
*/
filename: string;
/**
* The title of the file
*/
title?: string;
/**
* Description for the file
*/
@@ -1619,7 +1643,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 +1665,7 @@ export enum ButtonStyle {
Success,
Danger,
Link,
Premium,
}
/**
@@ -1835,6 +1871,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 +1943,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'
>;

View File

@@ -681,7 +681,7 @@ export enum GuildMemberFlags {
*/
CompletedOnboarding = 1 << 1,
/**
* Member bypasses guild verification requirements
* Member is exempt from guild verification requirements
*/
BypassesVerification = 1 << 2,
/**
@@ -689,21 +689,29 @@ export enum GuildMemberFlags {
*/
StartedOnboarding = 1 << 3,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* Member is a guest and can only access the voice channel they were invited to
*/
IsGuest = 1 << 4,
/**
* Member has started Server Guide new member actions
*/
StartedHomeActions = 1 << 5,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* Member has completed Server Guide new member actions
*/
CompletedHomeActions = 1 << 6,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* Member's username, display name, or nickname is blocked by AutoMod
*/
AutomodQuarantinedUsernameOrGuildNickname = 1 << 7,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* @deprecated
*/
AutomodQuarantinedBio = 1 << 8,
/**
* Member has dismissed the DM settings upsell
*/
DmSettingsUpsellAcknowledged = 1 << 9,
}
/**

View File

@@ -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

View File

@@ -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;
/**

View File

@@ -33,6 +33,7 @@ export interface APISticker {
* Previously the sticker asset hash, now an empty string
*
* @deprecated
* @unstable This field is no longer documented by Discord and will be removed in v11
*/
asset?: '';
/**

View File

@@ -285,6 +285,7 @@ export enum ConnectionService {
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
RiotGames = 'riotgames',
Roblox = 'roblox',
PayPal = 'paypal',
Spotify = 'spotify',
Skype = 'skype',

View File

@@ -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
*/

View File

@@ -43,8 +43,8 @@ export enum RESTJSONErrorCodes {
UnknownDiscoverableServerCategory = 10_059,
UnknownSticker,
UnknownInteraction = 10_062,
UnknownStickerPack,
UnknownInteraction,
UnknownApplicationCommand,
UnknownVoiceState = 10_065,

View File

@@ -24,14 +24,20 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} 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 +104,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 +243,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> & {
@@ -250,22 +256,21 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO
};
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* @deprecated Use {@link RESTAPIMessageReference} instead
*/
export interface RESTAPIAttachment {
export type APIMessageReferenceSend = RESTAPIMessageReference;
/**
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export type RESTAPIAttachment = Partial<
Pick<APIAttachment, 'description' | 'duration_secs' | 'filename' | 'title' | 'waveform'>
> & {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
};
/**
* https://discord.com/developers/docs/resources/channel#create-message
@@ -300,7 +305,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 +334,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
/**
* A poll!
*/
poll?: RESTAPIPollCreate | undefined;
poll?: RESTAPIPoll | undefined;
}
/**
@@ -362,7 +367,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
@@ -446,7 +456,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
/**

View File

@@ -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;

View File

@@ -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
*/

View File

@@ -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

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*

View File

@@ -76,6 +76,7 @@ export interface RESTAPIPartialCurrentUserGuild {
id: Snowflake;
name: string;
icon: string | null;
banner: string | null;
owner: boolean;
features: GuildFeature[];
permissions: Permissions;

View File

@@ -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;

View File

@@ -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;
}
/**
@@ -264,7 +264,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
};

View File

@@ -24,14 +24,20 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} 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 +243,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> & {
@@ -250,22 +256,21 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO
};
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* @deprecated Use {@link RESTAPIMessageReference} instead
*/
export interface RESTAPIAttachment {
export type APIMessageReferenceSend = RESTAPIMessageReference;
/**
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export type RESTAPIAttachment = Partial<
Pick<APIAttachment, 'description' | 'duration_secs' | 'filename' | 'title' | 'waveform'>
> & {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
};
/**
* https://discord.com/developers/docs/resources/channel#create-message
@@ -308,7 +313,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 +342,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
/**
* A poll!
*/
poll?: RESTAPIPollCreate | undefined;
poll?: RESTAPIPoll | undefined;
}
/**
@@ -370,7 +375,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
@@ -462,7 +472,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
/**

View File

@@ -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;

View File

@@ -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
*/

View File

@@ -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

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*

View File

@@ -76,6 +76,7 @@ export interface RESTAPIPartialCurrentUserGuild {
id: Snowflake;
name: string;
icon: string | null;
banner: string | null;
owner: boolean;
features: GuildFeature[];
permissions: Permissions;

View File

@@ -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;

View File

@@ -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;
}
/**
@@ -264,7 +264,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
};

View File

@@ -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

View File

@@ -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

1956
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "discord-api-types",
"version": "0.37.89",
"version": "0.37.99",
"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"

View File

@@ -92,14 +92,10 @@ export interface APIApplicationCommand {
nsfw?: boolean;
/**
* Installation context(s) where the command is available, only for globally-scoped commands. Defaults to `GUILD_INSTALL ([0])`
*
* @unstable
*/
integration_types?: ApplicationIntegrationType[];
/**
* Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands `[0,1,2]`.
*
* @unstable
*/
contexts?: InteractionContextType[] | null;
/**
@@ -124,11 +120,11 @@ export enum ApplicationIntegrationType {
/**
* App is installable to servers
*/
GuildInstall = 0,
GuildInstall,
/**
* App is installable to users
*/
UserInstall = 1,
UserInstall,
}
/**
@@ -138,15 +134,15 @@ export enum InteractionContextType {
/**
* Interaction can be used within servers
*/
Guild = 0,
Guild,
/**
* Interaction can be used within DMs with the app's bot user
*/
BotDM = 1,
BotDM,
/**
* Interaction can be used within Group DMs and DMs other than the app's bot user
*/
PrivateChannel = 2,
PrivateChannel,
}
/**

View File

@@ -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,
}

View File

@@ -64,6 +64,7 @@ export interface APIApplication {
* An empty string
*
* @deprecated This field will be removed in v11
* @unstable This field is no longer documented by Discord and will be removed in v11
*/
summary: '';
/**
@@ -108,6 +109,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
*/
@@ -131,8 +136,6 @@ export interface APIApplication {
install_params?: APIApplicationInstallParams;
/**
* Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object
*
* @unstable
*/
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
/**

View File

@@ -573,7 +573,7 @@ export interface APIMessage {
/**
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
@@ -669,8 +669,6 @@ export interface APIMessage {
referenced_message?: APIMessage | null;
/**
* Sent if the message is sent as a result of an interaction
*
* @unstable
*/
interaction_metadata?: APIMessageInteractionMetadata;
/**
@@ -735,6 +733,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 +812,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 +840,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,
/**
* Reference used to point to a message at a point in time
*/
Forward,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
*/
@@ -1393,7 +1413,7 @@ export interface APIEmbedField {
}
/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface APIAttachment {
/**
@@ -1404,6 +1424,10 @@ export interface APIAttachment {
* Name of file attached
*/
filename: string;
/**
* The title of the file
*/
title?: string;
/**
* Description for the file
*/
@@ -1652,7 +1676,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 +1698,7 @@ export enum ButtonStyle {
Success,
Danger,
Link,
Premium,
}
/**
@@ -1868,6 +1904,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 +1976,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'
>;

View File

@@ -689,7 +689,7 @@ export enum GuildMemberFlags {
*/
CompletedOnboarding = 1 << 1,
/**
* Member bypasses guild verification requirements
* Member is exempt from guild verification requirements
*/
BypassesVerification = 1 << 2,
/**
@@ -697,21 +697,29 @@ export enum GuildMemberFlags {
*/
StartedOnboarding = 1 << 3,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* Member is a guest and can only access the voice channel they were invited to
*/
IsGuest = 1 << 4,
/**
* Member has started Server Guide new member actions
*/
StartedHomeActions = 1 << 5,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* Member has completed Server Guide new member actions
*/
CompletedHomeActions = 1 << 6,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* Member's username, display name, or nickname is blocked by AutoMod
*/
AutomodQuarantinedUsernameOrGuildNickname = 1 << 7,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* @deprecated
*/
AutomodQuarantinedBio = 1 << 8,
/**
* Member has dismissed the DM settings upsell
*/
DmSettingsUpsellAcknowledged = 1 << 9,
}
/**

View File

@@ -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

View File

@@ -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;
/**

View File

@@ -33,6 +33,7 @@ export interface APISticker {
* Previously the sticker asset hash, now an empty string
*
* @deprecated
* @unstable This field is no longer documented by Discord and will be removed in v11
*/
asset?: '';
/**

View File

@@ -286,6 +286,7 @@ export enum ConnectionService {
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
RiotGames = 'riotgames',
Roblox = 'roblox',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',

View File

@@ -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
*/

View File

@@ -92,14 +92,10 @@ export interface APIApplicationCommand {
nsfw?: boolean;
/**
* Installation context(s) where the command is available, only for globally-scoped commands. Defaults to `GUILD_INSTALL ([0])`
*
* @unstable
*/
integration_types?: ApplicationIntegrationType[];
/**
* Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands `[0,1,2]`.
*
* @unstable
*/
contexts?: InteractionContextType[] | null;
/**
@@ -124,11 +120,11 @@ export enum ApplicationIntegrationType {
/**
* App is installable to servers
*/
GuildInstall = 0,
GuildInstall,
/**
* App is installable to users
*/
UserInstall = 1,
UserInstall,
}
/**
@@ -138,15 +134,15 @@ export enum InteractionContextType {
/**
* Interaction can be used within servers
*/
Guild = 0,
Guild,
/**
* Interaction can be used within DMs with the app's bot user
*/
BotDM = 1,
BotDM,
/**
* Interaction can be used within Group DMs and DMs other than the app's bot user
*/
PrivateChannel = 2,
PrivateChannel,
}
/**

View File

@@ -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,
}

View File

@@ -64,6 +64,7 @@ export interface APIApplication {
* An empty string
*
* @deprecated This field will be removed in v11
* @unstable This field is no longer documented by Discord and will be removed in v11
*/
summary: '';
/**
@@ -108,6 +109,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
*/
@@ -131,8 +136,6 @@ export interface APIApplication {
install_params?: APIApplicationInstallParams;
/**
* Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object
*
* @unstable
*/
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
/**

View File

@@ -567,7 +567,7 @@ export interface APIMessage {
/**
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
@@ -661,8 +661,6 @@ export interface APIMessage {
referenced_message?: APIMessage | null;
/**
* Sent if the message is sent as a result of an interaction
*
* @unstable
*/
interaction_metadata?: APIMessageInteractionMetadata;
/**
@@ -720,6 +718,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 +797,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 +825,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,
/**
* Reference used to point to a message at a point in time
*/
Forward,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
*/
@@ -1360,7 +1380,7 @@ export interface APIEmbedField {
}
/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface APIAttachment {
/**
@@ -1371,6 +1391,10 @@ export interface APIAttachment {
* Name of file attached
*/
filename: string;
/**
* The title of the file
*/
title?: string;
/**
* Description for the file
*/
@@ -1619,7 +1643,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 +1665,7 @@ export enum ButtonStyle {
Success,
Danger,
Link,
Premium,
}
/**
@@ -1835,6 +1871,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 +1943,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'
>;

View File

@@ -681,7 +681,7 @@ export enum GuildMemberFlags {
*/
CompletedOnboarding = 1 << 1,
/**
* Member bypasses guild verification requirements
* Member is exempt from guild verification requirements
*/
BypassesVerification = 1 << 2,
/**
@@ -689,21 +689,29 @@ export enum GuildMemberFlags {
*/
StartedOnboarding = 1 << 3,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* Member is a guest and can only access the voice channel they were invited to
*/
IsGuest = 1 << 4,
/**
* Member has started Server Guide new member actions
*/
StartedHomeActions = 1 << 5,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* Member has completed Server Guide new member actions
*/
CompletedHomeActions = 1 << 6,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* Member's username, display name, or nickname is blocked by AutoMod
*/
AutomodQuarantinedUsernameOrGuildNickname = 1 << 7,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
* @deprecated
*/
AutomodQuarantinedBio = 1 << 8,
/**
* Member has dismissed the DM settings upsell
*/
DmSettingsUpsellAcknowledged = 1 << 9,
}
/**

View File

@@ -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

View File

@@ -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;
/**

View File

@@ -33,6 +33,7 @@ export interface APISticker {
* Previously the sticker asset hash, now an empty string
*
* @deprecated
* @unstable This field is no longer documented by Discord and will be removed in v11
*/
asset?: '';
/**

View File

@@ -285,6 +285,7 @@ export enum ConnectionService {
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
RiotGames = 'riotgames',
Roblox = 'roblox',
PayPal = 'paypal',
Spotify = 'spotify',
Skype = 'skype',

View File

@@ -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
*/

View File

@@ -43,8 +43,8 @@ export enum RESTJSONErrorCodes {
UnknownDiscoverableServerCategory = 10_059,
UnknownSticker,
UnknownInteraction = 10_062,
UnknownStickerPack,
UnknownInteraction,
UnknownApplicationCommand,
UnknownVoiceState = 10_065,

View File

@@ -24,14 +24,20 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} 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 +104,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 +243,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> & {
@@ -250,22 +256,21 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO
};
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* @deprecated Use {@link RESTAPIMessageReference} instead
*/
export interface RESTAPIAttachment {
export type APIMessageReferenceSend = RESTAPIMessageReference;
/**
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export type RESTAPIAttachment = Partial<
Pick<APIAttachment, 'description' | 'duration_secs' | 'filename' | 'title' | 'waveform'>
> & {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
};
/**
* https://discord.com/developers/docs/resources/channel#create-message
@@ -300,7 +305,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 +334,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
/**
* A poll!
*/
poll?: RESTAPIPollCreate | undefined;
poll?: RESTAPIPoll | undefined;
}
/**
@@ -362,7 +367,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
@@ -446,7 +456,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
/**

View File

@@ -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;

View File

@@ -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
*/

View File

@@ -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

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*

View File

@@ -76,6 +76,7 @@ export interface RESTAPIPartialCurrentUserGuild {
id: Snowflake;
name: string;
icon: string | null;
banner: string | null;
owner: boolean;
features: GuildFeature[];
permissions: Permissions;

View File

@@ -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;

View File

@@ -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;
}
/**
@@ -264,7 +264,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
};

View File

@@ -24,14 +24,20 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} 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 +243,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> & {
@@ -250,22 +256,21 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO
};
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* @deprecated Use {@link RESTAPIMessageReference} instead
*/
export interface RESTAPIAttachment {
export type APIMessageReferenceSend = RESTAPIMessageReference;
/**
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export type RESTAPIAttachment = Partial<
Pick<APIAttachment, 'description' | 'duration_secs' | 'filename' | 'title' | 'waveform'>
> & {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
};
/**
* https://discord.com/developers/docs/resources/channel#create-message
@@ -308,7 +313,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 +342,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
/**
* A poll!
*/
poll?: RESTAPIPollCreate | undefined;
poll?: RESTAPIPoll | undefined;
}
/**
@@ -370,7 +375,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
@@ -462,7 +472,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
/**

View File

@@ -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;

View File

@@ -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
*/

View File

@@ -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

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*/

View File

@@ -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
*

View File

@@ -76,6 +76,7 @@ export interface RESTAPIPartialCurrentUserGuild {
id: Snowflake;
name: string;
icon: string | null;
banner: string | null;
owner: boolean;
features: GuildFeature[];
permissions: Permissions;

Some files were not shown because too many files have changed in this diff Show More