mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-21 10:50:08 +00:00
Compare commits
126 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4ef182d009 | ||
|
|
86a9f965dd | ||
|
|
b90fddc285 | ||
|
|
f67043b3f4 | ||
|
|
19d2aeb4a8 | ||
|
|
31b3766b19 | ||
|
|
1b1a865efe | ||
|
|
a85521aa8b | ||
|
|
8b00031c51 | ||
|
|
147e459a16 | ||
|
|
fbfbc6b23f | ||
|
|
906dd8e241 | ||
|
|
25efb9c403 | ||
|
|
822956fe78 | ||
|
|
d5047639e6 | ||
|
|
cbd8d108ee | ||
|
|
d816bf31ab | ||
|
|
71602b5c49 | ||
|
|
6ead98b782 | ||
|
|
ea1a6c3c86 | ||
|
|
a59f9f002f | ||
|
|
ace41f38e4 | ||
|
|
25a6f5330f | ||
|
|
4409fc24c1 | ||
|
|
1178c23389 | ||
|
|
34b0ddd105 | ||
|
|
9c1fc9bdee | ||
|
|
472fe5f837 | ||
|
|
588140c0a9 | ||
|
|
799044d3f0 | ||
|
|
eb7b3d90dd | ||
|
|
2c1ff0ea34 | ||
|
|
5f22a6baca | ||
|
|
cbcd51d093 | ||
|
|
4f66b4dd04 | ||
|
|
da9496f291 | ||
|
|
b1e1c60a07 | ||
|
|
4fdc6db296 | ||
|
|
608f0fa8cd | ||
|
|
0e8b624c3e | ||
|
|
1301b3417c | ||
|
|
e098870a08 | ||
|
|
2049dde09a | ||
|
|
ea7cafaafa | ||
|
|
c05998de27 | ||
|
|
f50ae60ea9 | ||
|
|
0ebf2afb58 | ||
|
|
ee09eafb76 | ||
|
|
a7fac3dc04 | ||
|
|
1fd407f481 | ||
|
|
aa8e307f4d | ||
|
|
897fd90bf2 | ||
|
|
666f0e79bc | ||
|
|
c9117a7bcc | ||
|
|
fe7ba16e3c | ||
|
|
643bf747be | ||
|
|
0340b3c3a1 | ||
|
|
45ef182b79 | ||
|
|
17c19750ae | ||
|
|
088dbe016f | ||
|
|
e3eb86936e | ||
|
|
d201436233 | ||
|
|
d63bea7dfc | ||
|
|
e330d3dcde | ||
|
|
fdb2d0a3c0 | ||
|
|
8657befda4 | ||
|
|
173f9ed0fa | ||
|
|
fdc04089e1 | ||
|
|
c6a72a55e5 | ||
|
|
98544fa56a | ||
|
|
3ce9610ba0 | ||
|
|
509746003a | ||
|
|
f859a96974 | ||
|
|
344e43b307 | ||
|
|
709153564e | ||
|
|
782a711236 | ||
|
|
566f2bc2c7 | ||
|
|
2627c0c98c | ||
|
|
0c46476110 | ||
|
|
d273000c32 | ||
|
|
5678a63875 | ||
|
|
f9913cb9a1 | ||
|
|
16a6a46832 | ||
|
|
79d9875c5d | ||
|
|
ddb2bde077 | ||
|
|
c8bfdebf24 | ||
|
|
707fd2e36e | ||
|
|
a69286a361 | ||
|
|
c457b8d059 | ||
|
|
7650ce4f72 | ||
|
|
65eebd92d6 | ||
|
|
0fafe5e901 | ||
|
|
0fce829175 | ||
|
|
33d5b14f22 | ||
|
|
aa7d1ee943 | ||
|
|
3e4c34cace | ||
|
|
8c603dc838 | ||
|
|
f9155dddb8 | ||
|
|
d0e4018607 | ||
|
|
189e91d62c | ||
|
|
2eae29d8ca | ||
|
|
2c595f7b20 | ||
|
|
cf4ecedced | ||
|
|
4e37de7f72 | ||
|
|
c9f2c5b020 | ||
|
|
312947de1e | ||
|
|
3ae6d722fd | ||
|
|
fddb2257db | ||
|
|
8de6d6bb4c | ||
|
|
c4ee7907c2 | ||
|
|
02695c5c19 | ||
|
|
fcc48a43e6 | ||
|
|
308d7d40f4 | ||
|
|
1572c2d291 | ||
|
|
a36449a028 | ||
|
|
29d88445e9 | ||
|
|
df3457a520 | ||
|
|
e1653f8f3e | ||
|
|
369d7b712f | ||
|
|
df495ecd20 | ||
|
|
ee7fc06b75 | ||
|
|
c6899314eb | ||
|
|
547d6d118f | ||
|
|
2831452fbd | ||
|
|
3c00105453 | ||
|
|
781f8f198a |
@@ -37,6 +37,9 @@ const schema = [
|
||||
},
|
||||
] as const;
|
||||
|
||||
const REST_TYPE_NAME_REGEX =
|
||||
/^REST(?:Get|Patch|Post|Put|Delete)[a-zA-Z0-9]+(?:JSONBody|FormDataBody|URLEncodedData|Result|Query)$/;
|
||||
|
||||
export = {
|
||||
rules: {
|
||||
'explicitly-optional-undefined-properties': ESLintUtils.RuleCreator.withoutDocs<Options, 'missingOptional'>({
|
||||
@@ -131,5 +134,54 @@ export = {
|
||||
},
|
||||
defaultOptions: [{ interfaceEndings: [] }],
|
||||
}),
|
||||
'rest-type-naming-convention': ESLintUtils.RuleCreator.withoutDocs<[{ whitelist: string[] }], 'invalidName'>({
|
||||
create: (context) => {
|
||||
const { whitelist } = context.options[0];
|
||||
const whitelistSet = new Set(whitelist);
|
||||
|
||||
return {
|
||||
'TSTypeAliasDeclaration, TSInterfaceDeclaration': (
|
||||
node: TSESTree.TSTypeAliasDeclaration | TSESTree.TSInterfaceDeclaration,
|
||||
) => {
|
||||
if (node.id.type !== AST_NODE_TYPES.Identifier) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { name } = node.id;
|
||||
if (whitelistSet.has(name)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!REST_TYPE_NAME_REGEX.test(name)) {
|
||||
context.report({
|
||||
node: node.id,
|
||||
messageId: 'invalidName',
|
||||
data: { name },
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
meta: {
|
||||
messages: {
|
||||
invalidName: `{{ name }} does not match REST type naming convention. Must match ${REST_TYPE_NAME_REGEX.source}.`,
|
||||
},
|
||||
type: 'problem',
|
||||
schema: [
|
||||
{
|
||||
type: 'object',
|
||||
properties: {
|
||||
whitelist: {
|
||||
type: 'array',
|
||||
items: {
|
||||
type: 'string',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
] as const,
|
||||
},
|
||||
defaultOptions: [{ whitelist: [] }],
|
||||
}),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1 +1,12 @@
|
||||
deno/
|
||||
|
||||
gateway/v6/*
|
||||
payloads/v6/*
|
||||
rest/v6/*
|
||||
v6.ts
|
||||
|
||||
gateway/v8/*
|
||||
payloads/v8/*
|
||||
rest/v8/*
|
||||
utils/v8.ts
|
||||
v8.ts
|
||||
|
||||
@@ -17,5 +17,54 @@
|
||||
"typescript-sort-keys/string-enum": "off",
|
||||
"unicorn/prefer-math-trunc": "off",
|
||||
"jsdoc/no-undefined-types": "off"
|
||||
}
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["rest/v10/*.ts", "rest/v9/*.ts"],
|
||||
"excludedFiles": ["rest/v10/index.ts", "rest/v9/index.ts"],
|
||||
"rules": {
|
||||
"local/rest-type-naming-convention": [
|
||||
"error",
|
||||
{
|
||||
"whitelist": [
|
||||
"RESTAPIAttachment",
|
||||
"RESTAPIChannelPatchOverwrite",
|
||||
"RESTAPIGuildChannelResolvable",
|
||||
"RESTAPIGuildCreateOverwrite",
|
||||
"RESTAPIGuildCreatePartialChannel",
|
||||
"RESTAPIGuildCreateRole",
|
||||
"RESTAPIGuildOnboardingPrompt",
|
||||
"RESTAPIGuildOnboardingPromptOption",
|
||||
"RESTAPIMessageReference",
|
||||
"RESTAPIPartialCurrentUserGuild",
|
||||
"RESTAPIPoll",
|
||||
|
||||
"RESTOAuth2AdvancedBotAuthorizationQuery",
|
||||
"RESTOAuth2AdvancedBotAuthorizationQueryResult",
|
||||
"RESTOAuth2AuthorizationQuery",
|
||||
"RESTOAuth2BotAuthorizationQuery",
|
||||
"RESTOAuth2ImplicitAuthorizationQuery",
|
||||
"RESTOAuth2ImplicitAuthorizationURLFragmentResult",
|
||||
|
||||
// Deprecated types
|
||||
"APIChannelPatchOverwrite",
|
||||
"APIGuildChannelResolvable",
|
||||
"APIGuildCreateOverwrite",
|
||||
"APIGuildCreatePartialChannel",
|
||||
"APIGuildCreateRole",
|
||||
"APIMessageReferenceSend",
|
||||
"GetAPIVoiceRegionsResult",
|
||||
"RESTAPIModifyGuildOnboardingPromptData",
|
||||
"RESTAPIModifyGuildOnboardingPromptOptionData",
|
||||
"RESTAPIPollCreate",
|
||||
"RESTDeleteAPIChannelMessageOwnReaction",
|
||||
"RESTGetAPIStickerPack",
|
||||
"RESTOAuth2AuthorizationQueryResult",
|
||||
"RESTPostAPIEntitlementBody"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
4
.github/workflows/check-deno.yml
vendored
4
.github/workflows/check-deno.yml
vendored
@@ -10,6 +10,10 @@ jobs:
|
||||
check_deno:
|
||||
name: Ensure Deno types are in sync with the code
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v4
|
||||
|
||||
@@ -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
|
||||
|
||||
190
CHANGELOG.md
190
CHANGELOG.md
@@ -1,3 +1,193 @@
|
||||
## [0.37.97](https://github.com/discordjs/discord-api-types/compare/0.37.96...0.37.97) (2024-08-22)
|
||||
|
||||
|
||||
|
||||
## [0.37.96](https://github.com/discordjs/discord-api-types/compare/0.37.95...0.37.96) (2024-08-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* nullable `recurrence_rule` on patch ([#1063](https://github.com/discordjs/discord-api-types/issues/1063)) ([19d2aeb](https://github.com/discordjs/discord-api-types/commit/19d2aeb4a82dc781558240a674c36eadce270abf))
|
||||
* nullable fields for scheduled event editing ([#1064](https://github.com/discordjs/discord-api-types/issues/1064)) ([f67043b](https://github.com/discordjs/discord-api-types/commit/f67043b3f46eea7286e959d223b78d140deac318))
|
||||
|
||||
|
||||
|
||||
## [0.37.95](https://github.com/discordjs/discord-api-types/compare/0.37.94...0.37.95) (2024-08-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* interface name ([#1059](https://github.com/discordjs/discord-api-types/issues/1059)) ([147e459](https://github.com/discordjs/discord-api-types/commit/147e459a16c8b0e15a0dd50f75d62c6dd9098815))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* recurring scheduled events ([#1058](https://github.com/discordjs/discord-api-types/issues/1058)) ([fbfbc6b](https://github.com/discordjs/discord-api-types/commit/fbfbc6b23f2696f6db5fad8ea1543327d5b3cf07))
|
||||
* **RESTJSONErrorCodes:** `UnknownStickerPack` ([#1055](https://github.com/discordjs/discord-api-types/issues/1055)) ([906dd8e](https://github.com/discordjs/discord-api-types/commit/906dd8e241be6acdf4d6d7b10ce4e7c139b0fd8b))
|
||||
* **Routes:** voice state endpoint ([#1046](https://github.com/discordjs/discord-api-types/issues/1046)) ([1b1a865](https://github.com/discordjs/discord-api-types/commit/1b1a865efe4d95b34055616ed18dc3613b58f317))
|
||||
|
||||
|
||||
|
||||
## [0.37.94](https://github.com/discordjs/discord-api-types/compare/0.37.93...0.37.94) (2024-08-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add Get Sticker Pack endpoint ([#1053](https://github.com/discordjs/discord-api-types/issues/1053)) ([822956f](https://github.com/discordjs/discord-api-types/commit/822956fe788f8eeda5da683189973bd6667cbc96))
|
||||
* **APIApplication:** `approximate_user_install_count` ([#1052](https://github.com/discordjs/discord-api-types/issues/1052)) ([d504763](https://github.com/discordjs/discord-api-types/commit/d5047639e691cc26e865cc6c06a312e09f0fb4c7))
|
||||
* **RESTOAuth2:** add RESTPostOAuth2TokenRevocationQuery ([#1050](https://github.com/discordjs/discord-api-types/issues/1050)) ([6ead98b](https://github.com/discordjs/discord-api-types/commit/6ead98b78218830fee308a0425d9078957a662b2))
|
||||
* **Routes:** get method on role endpoint ([#1051](https://github.com/discordjs/discord-api-types/issues/1051)) ([ea1a6c3](https://github.com/discordjs/discord-api-types/commit/ea1a6c3c86ec0d4c663e2191a488a3716ecdd7cc))
|
||||
|
||||
|
||||
|
||||
## [0.37.93](https://github.com/discordjs/discord-api-types/compare/0.37.92...0.37.93) (2024-07-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **CDNRoutes:** inconsistency in route and wrong JSDoc ([#1033](https://github.com/discordjs/discord-api-types/issues/1033)) ([eb7b3d9](https://github.com/discordjs/discord-api-types/commit/eb7b3d90dd6a847b80d051006a597e77d70caab2))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for message forwarding ([#971](https://github.com/discordjs/discord-api-types/issues/971)) ([2c1ff0e](https://github.com/discordjs/discord-api-types/commit/2c1ff0ea3443fb500315d6c69674a875a11addf6))
|
||||
* application emojis ([#1036](https://github.com/discordjs/discord-api-types/issues/1036)) ([5f22a6b](https://github.com/discordjs/discord-api-types/commit/5f22a6bacabef6b11e170a6f67694359bb3180e8))
|
||||
* **ConnectionService:** add `Roblox` ([#1032](https://github.com/discordjs/discord-api-types/issues/1032)) ([4f66b4d](https://github.com/discordjs/discord-api-types/commit/4f66b4dd049d2ace638374c09a06272bd517ad3a))
|
||||
* **RESTAPIPartialCurrentUserGuild:** add `banner` ([#1028](https://github.com/discordjs/discord-api-types/issues/1028)) ([da9496f](https://github.com/discordjs/discord-api-types/commit/da9496f291fff364b8d35b02363b93933c19823a))
|
||||
|
||||
|
||||
|
||||
## [0.37.92](https://github.com/discordjs/discord-api-types/compare/0.37.91...0.37.92) (2024-07-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **RESTAPIPollCreate:** optional properties ([#1022](https://github.com/discordjs/discord-api-types/issues/1022)) ([c05998d](https://github.com/discordjs/discord-api-types/commit/c05998de274ef7a8d570db9d23c9ad9c228eeccc))
|
||||
|
||||
|
||||
|
||||
## [0.37.91](https://github.com/discordjs/discord-api-types/compare/0.37.90...0.37.91) (2024-06-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIAttachment:** add `title` ([#1015](https://github.com/discordjs/discord-api-types/issues/1015)) ([897fd90](https://github.com/discordjs/discord-api-types/commit/897fd90bf2705d6ff5eebbb21fa8e735fc1e1e22))
|
||||
|
||||
|
||||
|
||||
## [0.37.90](https://github.com/discordjs/discord-api-types/compare/0.37.89...0.37.90) (2024-06-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add premium buttons ([#1010](https://github.com/discordjs/discord-api-types/issues/1010)) ([088dbe0](https://github.com/discordjs/discord-api-types/commit/088dbe016fdb72fb751931938bf7240c34fa64c0))
|
||||
|
||||
|
||||
|
||||
## [0.37.89](https://github.com/discordjs/discord-api-types/compare/0.37.88...0.37.89) (2024-06-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add use external apps permission ([#999](https://github.com/discordjs/discord-api-types/issues/999)) ([d63bea7](https://github.com/discordjs/discord-api-types/commit/d63bea7dfc748472b2e5ed4e2d45752acc1a3d2a))
|
||||
|
||||
|
||||
|
||||
## [0.37.88](https://github.com/discordjs/discord-api-types/compare/0.37.87...0.37.88) (2024-06-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **APIGuildMember:** make user required and omit in messages ([#998](https://github.com/discordjs/discord-api-types/issues/998)) ([98544fa](https://github.com/discordjs/discord-api-types/commit/98544fa56aa7d6e98b23ead4e898a5f8424a437a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **AuditLogEvent:** home settings events ([#1000](https://github.com/discordjs/discord-api-types/issues/1000)) ([c6a72a5](https://github.com/discordjs/discord-api-types/commit/c6a72a55e5aa77413cfdb639b1c89b1a0774b624))
|
||||
* **MessageType:** add incident related types ([#1004](https://github.com/discordjs/discord-api-types/issues/1004)) ([173f9ed](https://github.com/discordjs/discord-api-types/commit/173f9ed0fa9daf838c050aa246bc533f4c788c3b))
|
||||
* **RouteBases:** Add media URL ([#1001](https://github.com/discordjs/discord-api-types/issues/1001)) ([fdc0408](https://github.com/discordjs/discord-api-types/commit/fdc04089e17e682c7db46990580a853c7b852957))
|
||||
|
||||
|
||||
|
||||
## [0.37.87](https://github.com/discordjs/discord-api-types/compare/0.37.86...0.37.87) (2024-06-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Correct types for `APIAuditLogChangeKey$Add` and `APIAuditLogChangeKey$Remove` ([#955](https://github.com/discordjs/discord-api-types/issues/955)) ([f859a96](https://github.com/discordjs/discord-api-types/commit/f859a96974e3188a18df575466e09b32fb70fbda))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **AutoModeration:** add blocking words in member profile ([#740](https://github.com/discordjs/discord-api-types/issues/740)) ([5097460](https://github.com/discordjs/discord-api-types/commit/509746003a5544fc1b1a28a5a58a3cfe27e200ca))
|
||||
|
||||
|
||||
|
||||
## [0.37.86](https://github.com/discordjs/discord-api-types/compare/0.37.85...0.37.86) (2024-05-27)
|
||||
|
||||
|
||||
|
||||
## [0.37.85](https://github.com/discordjs/discord-api-types/compare/0.37.84...0.37.85) (2024-05-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add gateway events payload for super reactions ([#878](https://github.com/discordjs/discord-api-types/issues/878)) ([16a6a46](https://github.com/discordjs/discord-api-types/commit/16a6a4683204cbf101372a233e235ebf6cb4df4e))
|
||||
* add type query param for get reactions endpoint ([#879](https://github.com/discordjs/discord-api-types/issues/879)) ([ddb2bde](https://github.com/discordjs/discord-api-types/commit/ddb2bde07776f0b9f370ab8ff6bf5c95be0138fd))
|
||||
* **APIMessage:** add `call` ([#983](https://github.com/discordjs/discord-api-types/issues/983)) ([79d9875](https://github.com/discordjs/discord-api-types/commit/79d9875c5d480b4ff4817edfecb58cd5c19c0d7b))
|
||||
|
||||
|
||||
|
||||
## [0.37.84](https://github.com/discordjs/discord-api-types/compare/0.37.83...0.37.84) (2024-05-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **RESTJSONErrorCodes:** add error code 40333 ([#854](https://github.com/discordjs/discord-api-types/issues/854)) ([65eebd9](https://github.com/discordjs/discord-api-types/commit/65eebd92d636d4ea8e3319c8df84208f1d6ce94f))
|
||||
* support avatar decorations ([#834](https://github.com/discordjs/discord-api-types/issues/834)) ([7650ce4](https://github.com/discordjs/discord-api-types/commit/7650ce4f7244c04f30e31938965e5023aa858945))
|
||||
* user-installable apps ([#921](https://github.com/discordjs/discord-api-types/issues/921)) ([c457b8d](https://github.com/discordjs/discord-api-types/commit/c457b8d0596561fd1122e1d96bd168b322de368e))
|
||||
|
||||
|
||||
|
||||
## [0.37.83](https://github.com/discordjs/discord-api-types/compare/0.37.82...0.37.83) (2024-04-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIAuditLogChange:** add missing keys ([#964](https://github.com/discordjs/discord-api-types/issues/964)) ([4e37de7](https://github.com/discordjs/discord-api-types/commit/4e37de7f72ad6b9502d3e3db97b10910d9970a92))
|
||||
* one time premium app purchases ([#966](https://github.com/discordjs/discord-api-types/issues/966)) ([c9f2c5b](https://github.com/discordjs/discord-api-types/commit/c9f2c5b020b4c7a36330fe06463106e9cfd38fca))
|
||||
|
||||
|
||||
|
||||
## [0.37.82](https://github.com/discordjs/discord-api-types/compare/0.37.81...0.37.82) (2024-04-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIInvite:** add `type` ([#858](https://github.com/discordjs/discord-api-types/issues/858)) ([c4ee790](https://github.com/discordjs/discord-api-types/commit/c4ee7907c2acf334e898862ed3d7d468dbdaaf5f))
|
||||
* **AuditLogEvent:** onboarding events ([#795](https://github.com/discordjs/discord-api-types/issues/795)) ([fddb225](https://github.com/discordjs/discord-api-types/commit/fddb2257db7aac29129ec5d941c46fba167e2de8))
|
||||
* **ConnectionService:** add `domain` ([#818](https://github.com/discordjs/discord-api-types/issues/818)) ([3ae6d72](https://github.com/discordjs/discord-api-types/commit/3ae6d722fd0b5aa18eb932a51172bba144c2d4ff))
|
||||
|
||||
|
||||
|
||||
## [0.37.81](https://github.com/discordjs/discord-api-types/compare/0.37.80...0.37.81) (2024-04-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Polls:** correct APIPollAnswer properties ([#962](https://github.com/discordjs/discord-api-types/issues/962)) ([308d7d4](https://github.com/discordjs/discord-api-types/commit/308d7d40f45b7e3e78a6b13350d3ad7c8fd81b47))
|
||||
|
||||
|
||||
|
||||
## [0.37.80](https://github.com/discordjs/discord-api-types/compare/0.37.79...0.37.80) (2024-04-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for polls ([#925](https://github.com/discordjs/discord-api-types/issues/925)) ([a36449a](https://github.com/discordjs/discord-api-types/commit/a36449a0283b733c59f5fdc0d6c3f2f786f0514d))
|
||||
|
||||
|
||||
|
||||
## [0.37.79](https://github.com/discordjs/discord-api-types/compare/0.37.78...0.37.79) (2024-04-04)
|
||||
|
||||
|
||||
|
||||
@@ -1,3 +1,193 @@
|
||||
## [0.37.97](https://github.com/discordjs/discord-api-types/compare/0.37.96...0.37.97) (2024-08-22)
|
||||
|
||||
|
||||
|
||||
## [0.37.96](https://github.com/discordjs/discord-api-types/compare/0.37.95...0.37.96) (2024-08-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* nullable `recurrence_rule` on patch ([#1063](https://github.com/discordjs/discord-api-types/issues/1063)) ([19d2aeb](https://github.com/discordjs/discord-api-types/commit/19d2aeb4a82dc781558240a674c36eadce270abf))
|
||||
* nullable fields for scheduled event editing ([#1064](https://github.com/discordjs/discord-api-types/issues/1064)) ([f67043b](https://github.com/discordjs/discord-api-types/commit/f67043b3f46eea7286e959d223b78d140deac318))
|
||||
|
||||
|
||||
|
||||
## [0.37.95](https://github.com/discordjs/discord-api-types/compare/0.37.94...0.37.95) (2024-08-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* interface name ([#1059](https://github.com/discordjs/discord-api-types/issues/1059)) ([147e459](https://github.com/discordjs/discord-api-types/commit/147e459a16c8b0e15a0dd50f75d62c6dd9098815))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* recurring scheduled events ([#1058](https://github.com/discordjs/discord-api-types/issues/1058)) ([fbfbc6b](https://github.com/discordjs/discord-api-types/commit/fbfbc6b23f2696f6db5fad8ea1543327d5b3cf07))
|
||||
* **RESTJSONErrorCodes:** `UnknownStickerPack` ([#1055](https://github.com/discordjs/discord-api-types/issues/1055)) ([906dd8e](https://github.com/discordjs/discord-api-types/commit/906dd8e241be6acdf4d6d7b10ce4e7c139b0fd8b))
|
||||
* **Routes:** voice state endpoint ([#1046](https://github.com/discordjs/discord-api-types/issues/1046)) ([1b1a865](https://github.com/discordjs/discord-api-types/commit/1b1a865efe4d95b34055616ed18dc3613b58f317))
|
||||
|
||||
|
||||
|
||||
## [0.37.94](https://github.com/discordjs/discord-api-types/compare/0.37.93...0.37.94) (2024-08-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add Get Sticker Pack endpoint ([#1053](https://github.com/discordjs/discord-api-types/issues/1053)) ([822956f](https://github.com/discordjs/discord-api-types/commit/822956fe788f8eeda5da683189973bd6667cbc96))
|
||||
* **APIApplication:** `approximate_user_install_count` ([#1052](https://github.com/discordjs/discord-api-types/issues/1052)) ([d504763](https://github.com/discordjs/discord-api-types/commit/d5047639e691cc26e865cc6c06a312e09f0fb4c7))
|
||||
* **RESTOAuth2:** add RESTPostOAuth2TokenRevocationQuery ([#1050](https://github.com/discordjs/discord-api-types/issues/1050)) ([6ead98b](https://github.com/discordjs/discord-api-types/commit/6ead98b78218830fee308a0425d9078957a662b2))
|
||||
* **Routes:** get method on role endpoint ([#1051](https://github.com/discordjs/discord-api-types/issues/1051)) ([ea1a6c3](https://github.com/discordjs/discord-api-types/commit/ea1a6c3c86ec0d4c663e2191a488a3716ecdd7cc))
|
||||
|
||||
|
||||
|
||||
## [0.37.93](https://github.com/discordjs/discord-api-types/compare/0.37.92...0.37.93) (2024-07-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **CDNRoutes:** inconsistency in route and wrong JSDoc ([#1033](https://github.com/discordjs/discord-api-types/issues/1033)) ([eb7b3d9](https://github.com/discordjs/discord-api-types/commit/eb7b3d90dd6a847b80d051006a597e77d70caab2))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for message forwarding ([#971](https://github.com/discordjs/discord-api-types/issues/971)) ([2c1ff0e](https://github.com/discordjs/discord-api-types/commit/2c1ff0ea3443fb500315d6c69674a875a11addf6))
|
||||
* application emojis ([#1036](https://github.com/discordjs/discord-api-types/issues/1036)) ([5f22a6b](https://github.com/discordjs/discord-api-types/commit/5f22a6bacabef6b11e170a6f67694359bb3180e8))
|
||||
* **ConnectionService:** add `Roblox` ([#1032](https://github.com/discordjs/discord-api-types/issues/1032)) ([4f66b4d](https://github.com/discordjs/discord-api-types/commit/4f66b4dd049d2ace638374c09a06272bd517ad3a))
|
||||
* **RESTAPIPartialCurrentUserGuild:** add `banner` ([#1028](https://github.com/discordjs/discord-api-types/issues/1028)) ([da9496f](https://github.com/discordjs/discord-api-types/commit/da9496f291fff364b8d35b02363b93933c19823a))
|
||||
|
||||
|
||||
|
||||
## [0.37.92](https://github.com/discordjs/discord-api-types/compare/0.37.91...0.37.92) (2024-07-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **RESTAPIPollCreate:** optional properties ([#1022](https://github.com/discordjs/discord-api-types/issues/1022)) ([c05998d](https://github.com/discordjs/discord-api-types/commit/c05998de274ef7a8d570db9d23c9ad9c228eeccc))
|
||||
|
||||
|
||||
|
||||
## [0.37.91](https://github.com/discordjs/discord-api-types/compare/0.37.90...0.37.91) (2024-06-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIAttachment:** add `title` ([#1015](https://github.com/discordjs/discord-api-types/issues/1015)) ([897fd90](https://github.com/discordjs/discord-api-types/commit/897fd90bf2705d6ff5eebbb21fa8e735fc1e1e22))
|
||||
|
||||
|
||||
|
||||
## [0.37.90](https://github.com/discordjs/discord-api-types/compare/0.37.89...0.37.90) (2024-06-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add premium buttons ([#1010](https://github.com/discordjs/discord-api-types/issues/1010)) ([088dbe0](https://github.com/discordjs/discord-api-types/commit/088dbe016fdb72fb751931938bf7240c34fa64c0))
|
||||
|
||||
|
||||
|
||||
## [0.37.89](https://github.com/discordjs/discord-api-types/compare/0.37.88...0.37.89) (2024-06-13)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Add use external apps permission ([#999](https://github.com/discordjs/discord-api-types/issues/999)) ([d63bea7](https://github.com/discordjs/discord-api-types/commit/d63bea7dfc748472b2e5ed4e2d45752acc1a3d2a))
|
||||
|
||||
|
||||
|
||||
## [0.37.88](https://github.com/discordjs/discord-api-types/compare/0.37.87...0.37.88) (2024-06-10)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **APIGuildMember:** make user required and omit in messages ([#998](https://github.com/discordjs/discord-api-types/issues/998)) ([98544fa](https://github.com/discordjs/discord-api-types/commit/98544fa56aa7d6e98b23ead4e898a5f8424a437a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **AuditLogEvent:** home settings events ([#1000](https://github.com/discordjs/discord-api-types/issues/1000)) ([c6a72a5](https://github.com/discordjs/discord-api-types/commit/c6a72a55e5aa77413cfdb639b1c89b1a0774b624))
|
||||
* **MessageType:** add incident related types ([#1004](https://github.com/discordjs/discord-api-types/issues/1004)) ([173f9ed](https://github.com/discordjs/discord-api-types/commit/173f9ed0fa9daf838c050aa246bc533f4c788c3b))
|
||||
* **RouteBases:** Add media URL ([#1001](https://github.com/discordjs/discord-api-types/issues/1001)) ([fdc0408](https://github.com/discordjs/discord-api-types/commit/fdc04089e17e682c7db46990580a853c7b852957))
|
||||
|
||||
|
||||
|
||||
## [0.37.87](https://github.com/discordjs/discord-api-types/compare/0.37.86...0.37.87) (2024-06-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Correct types for `APIAuditLogChangeKey$Add` and `APIAuditLogChangeKey$Remove` ([#955](https://github.com/discordjs/discord-api-types/issues/955)) ([f859a96](https://github.com/discordjs/discord-api-types/commit/f859a96974e3188a18df575466e09b32fb70fbda))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **AutoModeration:** add blocking words in member profile ([#740](https://github.com/discordjs/discord-api-types/issues/740)) ([5097460](https://github.com/discordjs/discord-api-types/commit/509746003a5544fc1b1a28a5a58a3cfe27e200ca))
|
||||
|
||||
|
||||
|
||||
## [0.37.86](https://github.com/discordjs/discord-api-types/compare/0.37.85...0.37.86) (2024-05-27)
|
||||
|
||||
|
||||
|
||||
## [0.37.85](https://github.com/discordjs/discord-api-types/compare/0.37.84...0.37.85) (2024-05-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add gateway events payload for super reactions ([#878](https://github.com/discordjs/discord-api-types/issues/878)) ([16a6a46](https://github.com/discordjs/discord-api-types/commit/16a6a4683204cbf101372a233e235ebf6cb4df4e))
|
||||
* add type query param for get reactions endpoint ([#879](https://github.com/discordjs/discord-api-types/issues/879)) ([ddb2bde](https://github.com/discordjs/discord-api-types/commit/ddb2bde07776f0b9f370ab8ff6bf5c95be0138fd))
|
||||
* **APIMessage:** add `call` ([#983](https://github.com/discordjs/discord-api-types/issues/983)) ([79d9875](https://github.com/discordjs/discord-api-types/commit/79d9875c5d480b4ff4817edfecb58cd5c19c0d7b))
|
||||
|
||||
|
||||
|
||||
## [0.37.84](https://github.com/discordjs/discord-api-types/compare/0.37.83...0.37.84) (2024-05-16)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **RESTJSONErrorCodes:** add error code 40333 ([#854](https://github.com/discordjs/discord-api-types/issues/854)) ([65eebd9](https://github.com/discordjs/discord-api-types/commit/65eebd92d636d4ea8e3319c8df84208f1d6ce94f))
|
||||
* support avatar decorations ([#834](https://github.com/discordjs/discord-api-types/issues/834)) ([7650ce4](https://github.com/discordjs/discord-api-types/commit/7650ce4f7244c04f30e31938965e5023aa858945))
|
||||
* user-installable apps ([#921](https://github.com/discordjs/discord-api-types/issues/921)) ([c457b8d](https://github.com/discordjs/discord-api-types/commit/c457b8d0596561fd1122e1d96bd168b322de368e))
|
||||
|
||||
|
||||
|
||||
## [0.37.83](https://github.com/discordjs/discord-api-types/compare/0.37.82...0.37.83) (2024-04-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIAuditLogChange:** add missing keys ([#964](https://github.com/discordjs/discord-api-types/issues/964)) ([4e37de7](https://github.com/discordjs/discord-api-types/commit/4e37de7f72ad6b9502d3e3db97b10910d9970a92))
|
||||
* one time premium app purchases ([#966](https://github.com/discordjs/discord-api-types/issues/966)) ([c9f2c5b](https://github.com/discordjs/discord-api-types/commit/c9f2c5b020b4c7a36330fe06463106e9cfd38fca))
|
||||
|
||||
|
||||
|
||||
## [0.37.82](https://github.com/discordjs/discord-api-types/compare/0.37.81...0.37.82) (2024-04-25)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIInvite:** add `type` ([#858](https://github.com/discordjs/discord-api-types/issues/858)) ([c4ee790](https://github.com/discordjs/discord-api-types/commit/c4ee7907c2acf334e898862ed3d7d468dbdaaf5f))
|
||||
* **AuditLogEvent:** onboarding events ([#795](https://github.com/discordjs/discord-api-types/issues/795)) ([fddb225](https://github.com/discordjs/discord-api-types/commit/fddb2257db7aac29129ec5d941c46fba167e2de8))
|
||||
* **ConnectionService:** add `domain` ([#818](https://github.com/discordjs/discord-api-types/issues/818)) ([3ae6d72](https://github.com/discordjs/discord-api-types/commit/3ae6d722fd0b5aa18eb932a51172bba144c2d4ff))
|
||||
|
||||
|
||||
|
||||
## [0.37.81](https://github.com/discordjs/discord-api-types/compare/0.37.80...0.37.81) (2024-04-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **Polls:** correct APIPollAnswer properties ([#962](https://github.com/discordjs/discord-api-types/issues/962)) ([308d7d4](https://github.com/discordjs/discord-api-types/commit/308d7d40f45b7e3e78a6b13350d3ad7c8fd81b47))
|
||||
|
||||
|
||||
|
||||
## [0.37.80](https://github.com/discordjs/discord-api-types/compare/0.37.79...0.37.80) (2024-04-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for polls ([#925](https://github.com/discordjs/discord-api-types/issues/925)) ([a36449a](https://github.com/discordjs/discord-api-types/commit/a36449a0283b733c59f5fdc0d6c3f2f786f0514d))
|
||||
|
||||
|
||||
|
||||
## [0.37.79](https://github.com/discordjs/discord-api-types/compare/0.37.78...0.37.79) (2024-04-04)
|
||||
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import type {
|
||||
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
|
||||
GatewayThreadListSync as RawGatewayThreadListSync,
|
||||
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
|
||||
GatewayVoiceState,
|
||||
APIVoiceState,
|
||||
InviteTargetType,
|
||||
PresenceUpdateStatus,
|
||||
AutoModerationRuleTriggerType,
|
||||
@@ -36,6 +36,7 @@ import type {
|
||||
APIEntitlement,
|
||||
ChannelType,
|
||||
} from '../payloads/v10/mod.ts';
|
||||
import type { ReactionType } from '../rest/v10/mod.ts';
|
||||
import type { Nullable } from '../utils/internals.ts';
|
||||
|
||||
export * from './common.ts';
|
||||
@@ -203,6 +204,8 @@ export enum GatewayIntentBits {
|
||||
GuildScheduledEvents = 1 << 16,
|
||||
AutoModerationConfiguration = 1 << 20,
|
||||
AutoModerationExecution = 1 << 21,
|
||||
GuildMessagePolls = 1 << 24,
|
||||
DirectMessagePolls = 1 << 25,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -260,6 +263,8 @@ export enum GatewayDispatchEvents {
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
|
||||
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
|
||||
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
|
||||
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
|
||||
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
|
||||
@@ -328,6 +333,8 @@ export type GatewayDispatchPayload =
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessagePollVoteAddDispatch
|
||||
| GatewayMessagePollVoteRemoveDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
@@ -778,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
|
||||
*
|
||||
@@ -1400,7 +1407,7 @@ export interface GatewayMessageEventExtraFields {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
member?: Omit<APIGuildMember, 'user'>;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
@@ -1480,7 +1487,7 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
'member' | 'message_author_id'
|
||||
'burst_colors' | 'member' | 'message_author_id'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -1741,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
|
||||
@@ -1813,6 +1820,45 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add
|
||||
*/
|
||||
export type GatewayMessagePollVoteAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteAdd,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove
|
||||
*/
|
||||
export type GatewayMessagePollVoteRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteRemove,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayMessagePollVoteDispatchData {
|
||||
/**
|
||||
* ID of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* ID of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* ID of the answer
|
||||
*/
|
||||
answer_id: number;
|
||||
}
|
||||
|
||||
// #endregion Dispatch Payloads
|
||||
|
||||
// #region Sendable Payloads
|
||||
@@ -2120,6 +2166,18 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors: string[];
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
},
|
||||
O
|
||||
>
|
||||
|
||||
@@ -28,13 +28,14 @@ import type {
|
||||
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
|
||||
GatewayThreadListSync as RawGatewayThreadListSync,
|
||||
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
|
||||
GatewayVoiceState,
|
||||
APIVoiceState,
|
||||
InviteTargetType,
|
||||
PresenceUpdateStatus,
|
||||
AutoModerationRuleTriggerType,
|
||||
APIAuditLogEntry,
|
||||
ChannelType,
|
||||
} from '../payloads/v9/mod.ts';
|
||||
import type { ReactionType } from '../rest/v9/mod.ts';
|
||||
import type { Nullable } from '../utils/internals.ts';
|
||||
import type { APIEntitlement } from '../v10.ts';
|
||||
|
||||
@@ -202,6 +203,8 @@ export enum GatewayIntentBits {
|
||||
GuildScheduledEvents = 1 << 16,
|
||||
AutoModerationConfiguration = 1 << 20,
|
||||
AutoModerationExecution = 1 << 21,
|
||||
GuildMessagePolls = 1 << 24,
|
||||
DirectMessagePolls = 1 << 25,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -259,6 +262,8 @@ export enum GatewayDispatchEvents {
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
|
||||
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
|
||||
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
|
||||
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
|
||||
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
|
||||
@@ -327,6 +332,8 @@ export type GatewayDispatchPayload =
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessagePollVoteAddDispatch
|
||||
| GatewayMessagePollVoteRemoveDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
@@ -777,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
|
||||
*
|
||||
@@ -1399,7 +1406,7 @@ export interface GatewayMessageEventExtraFields {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
member?: Omit<APIGuildMember, 'user'>;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
@@ -1479,7 +1486,7 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
'member' | 'message_author_id'
|
||||
'burst_colors' | 'member' | 'message_author_id'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -1740,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
|
||||
@@ -1812,6 +1819,45 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add
|
||||
*/
|
||||
export type GatewayMessagePollVoteAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteAdd,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove
|
||||
*/
|
||||
export type GatewayMessagePollVoteRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteRemove,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayMessagePollVoteDispatchData {
|
||||
/**
|
||||
* ID of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* ID of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* ID of the answer
|
||||
*/
|
||||
answer_id: number;
|
||||
}
|
||||
|
||||
// #endregion Dispatch Payloads
|
||||
|
||||
// #region Sendable Payloads
|
||||
@@ -2119,6 +2165,18 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors?: string[];
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
},
|
||||
O
|
||||
>
|
||||
|
||||
@@ -276,6 +276,18 @@ export const PermissionFlagsBits = {
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendVoiceMessages: 1n << 46n,
|
||||
/**
|
||||
* Allows sending polls
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendPolls: 1n << 49n,
|
||||
/**
|
||||
* Allows user-installed apps to send public responses. When disabled, users will still be allowed to use their apps but the responses will be ephemeral. This only applies to apps not also installed to the server
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
UseExternalApps: 1n << 50n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,6 +74,8 @@ export interface APIApplicationCommand {
|
||||
default_member_permissions: Permissions | null;
|
||||
/**
|
||||
* Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible
|
||||
*
|
||||
* @deprecated Use `contexts` instead
|
||||
*/
|
||||
dm_permission?: boolean;
|
||||
/**
|
||||
@@ -88,6 +90,18 @@ export interface APIApplicationCommand {
|
||||
* Indicates whether the command is age-restricted, defaults to `false`
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
@@ -103,6 +117,38 @@ export enum ApplicationCommandType {
|
||||
Message,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-integration-types
|
||||
*/
|
||||
export enum ApplicationIntegrationType {
|
||||
/**
|
||||
* App is installable to servers
|
||||
*/
|
||||
GuildInstall = 0,
|
||||
/**
|
||||
* App is installable to users
|
||||
*/
|
||||
UserInstall = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types
|
||||
*/
|
||||
export enum InteractionContextType {
|
||||
/**
|
||||
* Interaction can be used within servers
|
||||
*/
|
||||
Guild = 0,
|
||||
/**
|
||||
* Interaction can be used within DMs with the app's bot user
|
||||
*/
|
||||
BotDM = 1,
|
||||
/**
|
||||
* Interaction can be used within Group DMs and DMs other than the app's bot user
|
||||
*/
|
||||
PrivateChannel = 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { APIRole, LocaleString } from '../../../v10.ts';
|
||||
import type { APIRole, ApplicationIntegrationType, InteractionContextType, LocaleString } from '../../../v10.ts';
|
||||
import type {
|
||||
APIAttachment,
|
||||
APIChannel,
|
||||
@@ -14,6 +14,40 @@ import type { APIEntitlement } from '../monetization.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object
|
||||
*/
|
||||
export interface APIMessageInteractionMetadata {
|
||||
/**
|
||||
* ID of the interaction
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Type of interaction
|
||||
*/
|
||||
type: InteractionType;
|
||||
/**
|
||||
* User who triggered the interaction
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* ID of the original response message, present only on follow-up messages
|
||||
*/
|
||||
original_response_message_id?: Snowflake;
|
||||
/**
|
||||
* ID of the message that contained interactive component, present only on messages created from component interactions
|
||||
*/
|
||||
interacted_message_id?: Snowflake;
|
||||
/**
|
||||
* Metadata for the interaction that was used to open the modal, present only on modal submit interactions
|
||||
*/
|
||||
triggering_interaction_metadata?: APIMessageInteractionMetadata;
|
||||
}
|
||||
|
||||
export type PartialAPIMessageInteractionGuildMember = Pick<
|
||||
APIGuildMember,
|
||||
| 'avatar'
|
||||
@@ -122,7 +156,7 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
/**
|
||||
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
|
||||
*/
|
||||
app_permissions?: Permissions;
|
||||
app_permissions: Permissions;
|
||||
/**
|
||||
* The selected language of the invoking user
|
||||
*/
|
||||
@@ -135,8 +169,20 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
|
||||
*/
|
||||
entitlements: APIEntitlement[];
|
||||
/**
|
||||
* Mapping of installation contexts that the interaction was authorized for to related user or guild IDs.
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* Context where the interaction was triggered from
|
||||
*/
|
||||
context?: InteractionContextType;
|
||||
}
|
||||
|
||||
export type APIAuthorizingIntegrationOwnersMap = {
|
||||
[key in ApplicationIntegrationType]?: Snowflake;
|
||||
};
|
||||
|
||||
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'guild_id' | 'member'
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { LocalizationMap } from '../common.ts';
|
||||
import type { APIPartialGuild } from './guild.ts';
|
||||
import type { ApplicationIntegrationType } from './interactions.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APITeam } from './teams.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
@@ -107,6 +108,10 @@ export interface APIApplication {
|
||||
* Approximate count of guilds the application has been added to
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* Approximate count of users that have installed the app
|
||||
*/
|
||||
approximate_user_install_count?: number;
|
||||
/**
|
||||
* Array of redirect URIs for the application
|
||||
*/
|
||||
@@ -128,6 +133,12 @@ export interface APIApplication {
|
||||
* Settings for the application's default in-app authorization link, if enabled
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
@@ -139,6 +150,14 @@ export interface APIApplicationInstallParams {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
export interface APIApplicationIntegrationTypeConfiguration {
|
||||
oauth2_install_params?: APIApplicationInstallParams;
|
||||
}
|
||||
|
||||
export type APIApplicationIntegrationTypesConfigMap = {
|
||||
[key in ApplicationIntegrationType]?: APIApplicationIntegrationTypeConfiguration;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
AutoModerationRuleEventType,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from './autoModeration.ts';
|
||||
import type { APIChannel, APIOverwrite } from './channel.ts';
|
||||
import type { APIChannel, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIOverwrite } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
APIGuildIntegrationType,
|
||||
@@ -205,6 +205,15 @@ export enum AuditLogEvent {
|
||||
|
||||
CreatorMonetizationRequestCreated = 150,
|
||||
CreatorMonetizationTermsAccepted,
|
||||
|
||||
OnboardingPromptCreate = 163,
|
||||
OnboardingPromptUpdate,
|
||||
OnboardingPromptDelete,
|
||||
OnboardingCreate,
|
||||
OnboardingUpdate,
|
||||
|
||||
HomeSettingsCreate = 190,
|
||||
HomeSettingsUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,6 +356,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyAvailableTags
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
@@ -357,6 +367,8 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDefaultReactionEmoji
|
||||
| APIAuditLogChangeKeyDefaultThreadRateLimitPerUser
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
@@ -369,6 +381,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFlags
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyHoist
|
||||
@@ -523,12 +536,12 @@ export type APIAuditLogChangeKeyVanityURLCode = AuditLogChangeData<'vanity_url_c
|
||||
/**
|
||||
* Returned when new role(s) are added
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Add = AuditLogChangeData<'$add', APIRole[]>;
|
||||
export type APIAuditLogChangeKey$Add = AuditLogChangeData<'$add', Pick<APIRole, 'id' | 'name'>[]>;
|
||||
|
||||
/**
|
||||
* Returned when role(s) are removed
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Remove = AuditLogChangeData<'$remove', APIRole[]>;
|
||||
export type APIAuditLogChangeKey$Remove = AuditLogChangeData<'$remove', Pick<APIRole, 'id' | 'name'>[]>;
|
||||
|
||||
/**
|
||||
* Returned when there is a change in number of days after which inactive and role-unassigned members are kicked
|
||||
@@ -826,6 +839,33 @@ export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles',
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's available tags gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvailableTags = AuditLogChangeData<'available_tags', APIGuildForumTag[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's default reaction emoji gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultReactionEmoji = AuditLogChangeData<
|
||||
'default_reaction_emoji',
|
||||
APIGuildForumDefaultReactionEmoji
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a channel flag gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyFlags = AuditLogChangeData<'flags', number>;
|
||||
|
||||
/**
|
||||
* Returned when a thread's amount of seconds a user has to wait before creating another thread
|
||||
* gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultThreadRateLimitPerUser = AuditLogChangeData<
|
||||
'default_thread_rate_limit_per_user',
|
||||
number
|
||||
>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -74,6 +74,10 @@ export enum AutoModerationRuleTriggerType {
|
||||
* Check if content contains more mentions than allowed (Maximum of 1 per guild)
|
||||
*/
|
||||
MentionSpam,
|
||||
/**
|
||||
* Check if member profile contains words from a user defined list of keywords (Maximum of 1 per guild)
|
||||
*/
|
||||
MemberProfile,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,7 +90,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
|
||||
* A keyword can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
keyword_filter?: string[];
|
||||
/**
|
||||
@@ -101,7 +105,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
|
||||
* A allowed-word can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.KeywordPreset}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
allow_list?: string[];
|
||||
/**
|
||||
@@ -109,7 +113,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
|
||||
*
|
||||
* Only Rust flavored regex is currently supported (Maximum of 260 characters)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
regex_patterns?: string[];
|
||||
/**
|
||||
@@ -152,6 +156,10 @@ export enum AutoModerationRuleEventType {
|
||||
* When a member sends or edits a message in the guild
|
||||
*/
|
||||
MessageSend = 1,
|
||||
/**
|
||||
* When a member edits their profile
|
||||
*/
|
||||
MemberUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,6 +195,10 @@ export enum AutoModerationActionType {
|
||||
* Timeout user for specified duration, this action type can be set if the bot has `MODERATE_MEMBERS` permission
|
||||
*/
|
||||
Timeout,
|
||||
/**
|
||||
* Prevents a member from using text, voice, or other interactions
|
||||
*/
|
||||
BlockMemberInteraction,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,9 @@ import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { APIApplication } from './application.ts';
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions.ts';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction, APIMessageInteractionMetadata } from './interactions.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIPoll } from './poll.ts';
|
||||
import type { APISticker, APIStickerItem } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
@@ -666,8 +667,16 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object
|
||||
*/
|
||||
referenced_message?: APIMessage | null;
|
||||
/**
|
||||
* Sent if the message is sent as a result of an interaction
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
interaction_metadata?: APIMessageInteractionMetadata;
|
||||
/**
|
||||
* Sent if the message is a response to an Interaction
|
||||
*
|
||||
* @deprecated In favor of `interaction_metadata`
|
||||
*/
|
||||
interaction?: APIMessageInteraction;
|
||||
/**
|
||||
@@ -715,6 +724,25 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
/**
|
||||
* A poll!
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
call?: APIMessageCall;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -757,6 +785,11 @@ export enum MessageType {
|
||||
StageRaiseHand,
|
||||
StageTopic,
|
||||
GuildApplicationPremiumSubscription,
|
||||
|
||||
GuildIncidentAlertModeEnabled = 36,
|
||||
GuildIncidentAlertModeDisabled,
|
||||
GuildIncidentReportRaid,
|
||||
GuildIncidentReportFalseAlarm,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -781,6 +814,10 @@ export interface APIMessageActivity {
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
/**
|
||||
* Type of reference
|
||||
*/
|
||||
type?: MessageReferenceType;
|
||||
/**
|
||||
* ID of the originating message
|
||||
*/
|
||||
@@ -805,6 +842,20 @@ export enum MessageActivityType {
|
||||
JoinRequest = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-types
|
||||
*/
|
||||
export enum MessageReferenceType {
|
||||
/**
|
||||
* A standard reference used by replies
|
||||
*/
|
||||
Default = 0,
|
||||
/**
|
||||
* Reference used to point to a message at a point in time
|
||||
*/
|
||||
Forward = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
@@ -859,6 +910,20 @@ export enum MessageFlags {
|
||||
IsVoiceMessage = 1 << 13,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-call-object-message-call-object-structure
|
||||
*/
|
||||
export interface APIMessageCall {
|
||||
/**
|
||||
* Array of user ids that participated in the call
|
||||
*/
|
||||
participants: Snowflake[];
|
||||
/**
|
||||
* ISO8601 timestamp when the call ended
|
||||
*/
|
||||
ended_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#role-subscription-data-object-role-subscription-data-object-structure
|
||||
*/
|
||||
@@ -1361,6 +1426,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* The title of the file
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
@@ -1609,7 +1678,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
url: string;
|
||||
}
|
||||
|
||||
export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
export type APIButtonComponent =
|
||||
| APIButtonComponentWithCustomId
|
||||
| APIButtonComponentWithSKUId
|
||||
| APIButtonComponentWithURL;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
|
||||
@@ -1620,6 +1700,7 @@ export enum ButtonStyle {
|
||||
Success,
|
||||
Danger,
|
||||
Link,
|
||||
Premium,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1825,6 +1906,20 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-snapshot-object
|
||||
*/
|
||||
export interface APIMessageSnapshot {
|
||||
/**
|
||||
* Subset of the message object fields
|
||||
*/
|
||||
message: APIMessageSnapshotFields;
|
||||
/**
|
||||
* Id of the origin message's guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
@@ -1883,3 +1978,16 @@ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuCom
|
||||
|
||||
// Modal components
|
||||
export type APIModalActionRowComponent = APITextInputComponent;
|
||||
|
||||
export type APIMessageSnapshotFields = Pick<
|
||||
APIMessage,
|
||||
| 'attachments'
|
||||
| 'content'
|
||||
| 'edited_timestamp'
|
||||
| 'embeds'
|
||||
| 'flags'
|
||||
| 'mention_roles'
|
||||
| 'mentions'
|
||||
| 'timestamp'
|
||||
| 'type'
|
||||
>;
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { PresenceUpdateReceiveStatus } from './gateway.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APISticker } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIAvatarDecorationData, APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -621,7 +621,7 @@ export interface APIGuildMember {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
user?: APIUser;
|
||||
user: APIUser;
|
||||
/**
|
||||
* This users guild nickname
|
||||
*/
|
||||
@@ -668,6 +668,12 @@ export interface APIGuildMember {
|
||||
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
|
||||
*/
|
||||
communication_disabled_until?: string | null;
|
||||
/**
|
||||
* The data for the member's guild avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -90,6 +90,19 @@ export interface APIInvite {
|
||||
* The guild scheduled event data, returned from the `GET /invites/<code>` endpoint when `guild_scheduled_event_id` is a valid guild scheduled event id
|
||||
*/
|
||||
guild_scheduled_event?: APIGuildScheduledEvent;
|
||||
/**
|
||||
* The invite type
|
||||
*/
|
||||
type: InviteType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object-invite-types
|
||||
*/
|
||||
export enum InviteType {
|
||||
Guild,
|
||||
GroupDM,
|
||||
Friend,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@ export * from './guildScheduledEvent.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './poll.ts';
|
||||
export * from './permissions.ts';
|
||||
export * from './stageInstance.ts';
|
||||
export * from './sticker.ts';
|
||||
|
||||
@@ -40,16 +40,48 @@ export interface APIEntitlement {
|
||||
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
|
||||
*/
|
||||
ends_at?: string;
|
||||
/**
|
||||
* For consumable items, whether or not the entitlement has been consumed
|
||||
*/
|
||||
consumed?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
|
||||
*/
|
||||
export enum EntitlementType {
|
||||
/**
|
||||
* Entitlement was purchased by user
|
||||
*/
|
||||
Purchase = 1,
|
||||
/**
|
||||
* Entitlement for Discord Nitro subscription
|
||||
*/
|
||||
PremiumSubscription,
|
||||
/**
|
||||
* Entitlement was gifted by developer
|
||||
*/
|
||||
DeveloperGift,
|
||||
/**
|
||||
* Entitlement was purchased by a dev in application test mode
|
||||
*/
|
||||
TestModePurchase,
|
||||
/**
|
||||
* Entitlement was granted when the SKU was free
|
||||
*/
|
||||
FreePurchase,
|
||||
/**
|
||||
* Entitlement was gifted by another user
|
||||
*/
|
||||
UserGift,
|
||||
/**
|
||||
* Entitlement was claimed by user for free as a Nitro Subscriber
|
||||
*/
|
||||
PremiumPurchase,
|
||||
/**
|
||||
* Entitlement was purchased as an app subscription
|
||||
*/
|
||||
ApplicationSubscription = 8,
|
||||
ApplicationSubscription,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,6 +136,14 @@ export enum SKUFlags {
|
||||
}
|
||||
|
||||
export enum SKUType {
|
||||
/**
|
||||
* Durable one-time purchase
|
||||
*/
|
||||
Durable = 2,
|
||||
/**
|
||||
* Consumable one-time purchase
|
||||
*/
|
||||
Consumable = 3,
|
||||
/**
|
||||
* Represents a recurring subscription
|
||||
*/
|
||||
|
||||
111
deno/payloads/v10/poll.ts
Normal file
111
deno/payloads/v10/poll.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/poll
|
||||
*/
|
||||
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure
|
||||
*/
|
||||
export interface APIPoll {
|
||||
/**
|
||||
* The question of the poll
|
||||
*/
|
||||
question: APIPollMedia;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* The results of the poll
|
||||
*/
|
||||
results?: APIPollResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#layout-type
|
||||
*/
|
||||
export enum PollLayoutType {
|
||||
/**
|
||||
* The, uhm, default layout type
|
||||
*/
|
||||
Default = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-media-object-poll-media-object-structure
|
||||
*/
|
||||
export interface APIPollMedia {
|
||||
/**
|
||||
* The text of the field
|
||||
*
|
||||
* The maximum length is `300` for the question, and `55` for any answer
|
||||
*/
|
||||
text?: string;
|
||||
/**
|
||||
* The emoji of the field
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure
|
||||
*/
|
||||
export interface APIPollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
/**
|
||||
* The data of the answer
|
||||
*/
|
||||
poll_media: APIPollMedia;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure
|
||||
*/
|
||||
export interface APIPollResults {
|
||||
/**
|
||||
* Whether the votes have been precisely counted
|
||||
*/
|
||||
is_finalized: boolean;
|
||||
/**
|
||||
* The counts for each answer
|
||||
*/
|
||||
answer_counts: APIPollAnswerCount[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-answer-count-object-structure
|
||||
*/
|
||||
export interface APIPollAnswerCount {
|
||||
/**
|
||||
* The `answer_id`
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* The number of votes for this answer
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* Whether the current user voted for this answer
|
||||
*/
|
||||
me_voted: boolean;
|
||||
}
|
||||
@@ -87,8 +87,16 @@ export interface APIUser {
|
||||
* The user's avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*
|
||||
* @deprecated Use `avatar_decoration_data` instead
|
||||
*/
|
||||
avatar_decoration?: string | null;
|
||||
/**
|
||||
* The data for the user's avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -267,6 +275,7 @@ export interface APIConnection {
|
||||
export enum ConnectionService {
|
||||
BattleNet = 'battlenet',
|
||||
BungieNet = 'bungie',
|
||||
Domain = 'domain',
|
||||
eBay = 'ebay',
|
||||
EpicGames = 'epicgames',
|
||||
Facebook = 'facebook',
|
||||
@@ -277,6 +286,7 @@ export enum ConnectionService {
|
||||
PlayStationNetwork = 'playstation',
|
||||
Reddit = 'reddit',
|
||||
RiotGames = 'riotgames',
|
||||
Roblox = 'roblox',
|
||||
Spotify = 'spotify',
|
||||
Skype = 'skype',
|
||||
Steam = 'steam',
|
||||
@@ -319,3 +329,19 @@ export interface APIApplicationRoleConnection {
|
||||
*/
|
||||
metadata: Record<string, number | string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
export interface APIAvatarDecorationData {
|
||||
/**
|
||||
* The avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
asset: string;
|
||||
/**
|
||||
* The id of the avatar decoration's SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -74,6 +74,8 @@ export interface APIApplicationCommand {
|
||||
default_member_permissions: Permissions | null;
|
||||
/**
|
||||
* Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible
|
||||
*
|
||||
* @deprecated Use `contexts` instead
|
||||
*/
|
||||
dm_permission?: boolean;
|
||||
/**
|
||||
@@ -88,6 +90,18 @@ export interface APIApplicationCommand {
|
||||
* Indicates whether the command is age-restricted, defaults to `false`
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
@@ -103,6 +117,38 @@ export enum ApplicationCommandType {
|
||||
Message,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-integration-types
|
||||
*/
|
||||
export enum ApplicationIntegrationType {
|
||||
/**
|
||||
* App is installable to servers
|
||||
*/
|
||||
GuildInstall = 0,
|
||||
/**
|
||||
* App is installable to users
|
||||
*/
|
||||
UserInstall = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types
|
||||
*/
|
||||
export enum InteractionContextType {
|
||||
/**
|
||||
* Interaction can be used within servers
|
||||
*/
|
||||
Guild = 0,
|
||||
/**
|
||||
* Interaction can be used within DMs with the app's bot user
|
||||
*/
|
||||
BotDM = 1,
|
||||
/**
|
||||
* Interaction can be used within Group DMs and DMs other than the app's bot user
|
||||
*/
|
||||
PrivateChannel = 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { APIRole, LocaleString } from '../../../v9.ts';
|
||||
import type { APIRole, ApplicationIntegrationType, InteractionContextType, LocaleString } from '../../../v9.ts';
|
||||
import type {
|
||||
APIAttachment,
|
||||
APIChannel,
|
||||
@@ -14,6 +14,40 @@ import type { APIEntitlement } from '../monetization.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object
|
||||
*/
|
||||
export interface APIMessageInteractionMetadata {
|
||||
/**
|
||||
* ID of the interaction
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Type of interaction
|
||||
*/
|
||||
type: InteractionType;
|
||||
/**
|
||||
* User who triggered the interaction
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* ID of the original response message, present only on follow-up messages
|
||||
*/
|
||||
original_response_message_id?: Snowflake;
|
||||
/**
|
||||
* ID of the message that contained interactive component, present only on messages created from component interactions
|
||||
*/
|
||||
interacted_message_id?: Snowflake;
|
||||
/**
|
||||
* Metadata for the interaction that was used to open the modal, present only on modal submit interactions
|
||||
*/
|
||||
triggering_interaction_metadata?: APIMessageInteractionMetadata;
|
||||
}
|
||||
|
||||
export type PartialAPIMessageInteractionGuildMember = Pick<
|
||||
APIGuildMember,
|
||||
| 'avatar'
|
||||
@@ -122,7 +156,7 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
/**
|
||||
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
|
||||
*/
|
||||
app_permissions?: Permissions;
|
||||
app_permissions: Permissions;
|
||||
/**
|
||||
* The selected language of the invoking user
|
||||
*/
|
||||
@@ -135,8 +169,20 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
|
||||
*/
|
||||
entitlements: APIEntitlement[];
|
||||
/**
|
||||
* Mapping of installation contexts that the interaction was authorized for to related user or guild IDs.
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* Context where the interaction was triggered from
|
||||
*/
|
||||
context?: InteractionContextType;
|
||||
}
|
||||
|
||||
export type APIAuthorizingIntegrationOwnersMap = {
|
||||
[key in ApplicationIntegrationType]?: Snowflake;
|
||||
};
|
||||
|
||||
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'guild_id' | 'member'
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { LocalizationMap } from '../common.ts';
|
||||
import type { APIPartialGuild } from './guild.ts';
|
||||
import type { ApplicationIntegrationType } from './interactions.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APITeam } from './teams.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
@@ -107,6 +108,10 @@ export interface APIApplication {
|
||||
* Approximate count of guilds the application has been added to
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* Approximate count of users that have installed the app
|
||||
*/
|
||||
approximate_user_install_count?: number;
|
||||
/**
|
||||
* Array of redirect URIs for the application
|
||||
*/
|
||||
@@ -128,6 +133,12 @@ export interface APIApplication {
|
||||
* Settings for the application's default in-app authorization link, if enabled
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
@@ -139,6 +150,14 @@ export interface APIApplicationInstallParams {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
export interface APIApplicationIntegrationTypeConfiguration {
|
||||
oauth2_install_params?: APIApplicationInstallParams;
|
||||
}
|
||||
|
||||
export type APIApplicationIntegrationTypesConfigMap = {
|
||||
[key in ApplicationIntegrationType]?: APIApplicationIntegrationTypeConfiguration;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
AutoModerationRuleEventType,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from './autoModeration.ts';
|
||||
import type { APIChannel, APIOverwrite } from './channel.ts';
|
||||
import type { APIChannel, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIOverwrite } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
APIGuildIntegrationType,
|
||||
@@ -205,6 +205,15 @@ export enum AuditLogEvent {
|
||||
|
||||
CreatorMonetizationRequestCreated = 150,
|
||||
CreatorMonetizationTermsAccepted,
|
||||
|
||||
OnboardingPromptCreate = 163,
|
||||
OnboardingPromptUpdate,
|
||||
OnboardingPromptDelete,
|
||||
OnboardingCreate,
|
||||
OnboardingUpdate,
|
||||
|
||||
HomeSettingsCreate = 190,
|
||||
HomeSettingsUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,6 +356,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyAvailableTags
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
@@ -357,6 +367,8 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDefaultReactionEmoji
|
||||
| APIAuditLogChangeKeyDefaultThreadRateLimitPerUser
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
@@ -369,6 +381,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFlags
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyHoist
|
||||
@@ -523,12 +536,12 @@ export type APIAuditLogChangeKeyVanityURLCode = AuditLogChangeData<'vanity_url_c
|
||||
/**
|
||||
* Returned when new role(s) are added
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Add = AuditLogChangeData<'$add', APIRole[]>;
|
||||
export type APIAuditLogChangeKey$Add = AuditLogChangeData<'$add', Pick<APIRole, 'id' | 'name'>[]>;
|
||||
|
||||
/**
|
||||
* Returned when role(s) are removed
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Remove = AuditLogChangeData<'$remove', APIRole[]>;
|
||||
export type APIAuditLogChangeKey$Remove = AuditLogChangeData<'$remove', Pick<APIRole, 'id' | 'name'>[]>;
|
||||
|
||||
/**
|
||||
* Returned when there is a change in number of days after which inactive and role-unassigned members are kicked
|
||||
@@ -826,6 +839,33 @@ export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles',
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's available tags gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvailableTags = AuditLogChangeData<'available_tags', APIGuildForumTag[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's default reaction emoji gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultReactionEmoji = AuditLogChangeData<
|
||||
'default_reaction_emoji',
|
||||
APIGuildForumDefaultReactionEmoji
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a channel flag gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyFlags = AuditLogChangeData<'flags', number>;
|
||||
|
||||
/**
|
||||
* Returned when a thread's amount of seconds a user has to wait before creating another thread
|
||||
* gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultThreadRateLimitPerUser = AuditLogChangeData<
|
||||
'default_thread_rate_limit_per_user',
|
||||
number
|
||||
>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -74,6 +74,10 @@ export enum AutoModerationRuleTriggerType {
|
||||
* Check if content contains more mentions than allowed (Maximum of 1 per guild)
|
||||
*/
|
||||
MentionSpam,
|
||||
/**
|
||||
* Check if member profile contains words from a user defined list of keywords (Maximum of 1 per guild)
|
||||
*/
|
||||
MemberProfile,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,7 +90,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
|
||||
* A keyword can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
keyword_filter?: string[];
|
||||
/**
|
||||
@@ -101,7 +105,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
|
||||
* A allowed-word can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.KeywordPreset}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
allow_list?: string[];
|
||||
/**
|
||||
@@ -109,7 +113,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
|
||||
*
|
||||
* Only Rust flavored regex is currently supported (Maximum of 260 characters)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
regex_patterns?: string[];
|
||||
/**
|
||||
@@ -152,6 +156,10 @@ export enum AutoModerationRuleEventType {
|
||||
* When a member sends or edits a message in the guild
|
||||
*/
|
||||
MessageSend = 1,
|
||||
/**
|
||||
* When a member edits their profile
|
||||
*/
|
||||
MemberUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,6 +195,10 @@ export enum AutoModerationActionType {
|
||||
* Timeout user for specified duration, this action type can be set if the bot has `MODERATE_MEMBERS` permission
|
||||
*/
|
||||
Timeout,
|
||||
/**
|
||||
* Prevents a member from using text, voice, or other interactions
|
||||
*/
|
||||
BlockMemberInteraction,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,9 @@ import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { APIApplication } from './application.ts';
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions.ts';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction, APIMessageInteractionMetadata } from './interactions.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIPoll } from './poll.ts';
|
||||
import type { APISticker, APIStickerItem } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
@@ -658,6 +659,12 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object
|
||||
*/
|
||||
referenced_message?: APIMessage | null;
|
||||
/**
|
||||
* Sent if the message is sent as a result of an interaction
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
interaction_metadata?: APIMessageInteractionMetadata;
|
||||
/**
|
||||
* Sent if the message is a response to an Interaction
|
||||
*/
|
||||
@@ -702,6 +709,25 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
/**
|
||||
* A poll!
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
call?: APIMessageCall;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -744,6 +770,11 @@ export enum MessageType {
|
||||
StageRaiseHand,
|
||||
StageTopic,
|
||||
GuildApplicationPremiumSubscription,
|
||||
|
||||
GuildIncidentAlertModeEnabled = 36,
|
||||
GuildIncidentAlertModeDisabled,
|
||||
GuildIncidentReportRaid,
|
||||
GuildIncidentReportFalseAlarm,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -768,6 +799,10 @@ export interface APIMessageActivity {
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
/**
|
||||
* Type of reference
|
||||
*/
|
||||
type?: MessageReferenceType;
|
||||
/**
|
||||
* ID of the originating message
|
||||
*/
|
||||
@@ -792,6 +827,20 @@ export enum MessageActivityType {
|
||||
JoinRequest = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-types
|
||||
*/
|
||||
export enum MessageReferenceType {
|
||||
/**
|
||||
* A standard reference used by replies
|
||||
*/
|
||||
Default = 0,
|
||||
/**
|
||||
* Reference used to point to a message at a point in time
|
||||
*/
|
||||
Forward = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
@@ -846,6 +895,20 @@ export enum MessageFlags {
|
||||
IsVoiceMessage = 1 << 13,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-call-object-message-call-object-structure
|
||||
*/
|
||||
export interface APIMessageCall {
|
||||
/**
|
||||
* Array of user ids that participated in the call
|
||||
*/
|
||||
participants: Snowflake[];
|
||||
/**
|
||||
* ISO8601 timestamp when the call ended
|
||||
*/
|
||||
ended_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#followed-channel-object
|
||||
*/
|
||||
@@ -1330,6 +1393,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* The title of the file
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
@@ -1578,7 +1645,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
url: string;
|
||||
}
|
||||
|
||||
export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
export type APIButtonComponent =
|
||||
| APIButtonComponentWithCustomId
|
||||
| APIButtonComponentWithSKUId
|
||||
| APIButtonComponentWithURL;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
|
||||
@@ -1589,6 +1667,7 @@ export enum ButtonStyle {
|
||||
Success,
|
||||
Danger,
|
||||
Link,
|
||||
Premium,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1794,6 +1873,20 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-snapshot-object
|
||||
*/
|
||||
export interface APIMessageSnapshot {
|
||||
/**
|
||||
* Subset of the message object fields
|
||||
*/
|
||||
message: APIMessageSnapshotFields;
|
||||
/**
|
||||
* Id of the origin message's guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
@@ -1852,3 +1945,16 @@ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuCom
|
||||
|
||||
// Modal components
|
||||
export type APIModalActionRowComponent = APITextInputComponent;
|
||||
|
||||
export type APIMessageSnapshotFields = Pick<
|
||||
APIMessage,
|
||||
| 'attachments'
|
||||
| 'content'
|
||||
| 'edited_timestamp'
|
||||
| 'embeds'
|
||||
| 'flags'
|
||||
| 'mention_roles'
|
||||
| 'mentions'
|
||||
| 'timestamp'
|
||||
| 'type'
|
||||
>;
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { PresenceUpdateReceiveStatus } from './gateway.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APISticker } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIAvatarDecorationData, APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -613,7 +613,7 @@ export interface APIGuildMember {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
user?: APIUser;
|
||||
user: APIUser;
|
||||
/**
|
||||
* This users guild nickname
|
||||
*/
|
||||
@@ -660,6 +660,12 @@ export interface APIGuildMember {
|
||||
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
|
||||
*/
|
||||
communication_disabled_until?: string | null;
|
||||
/**
|
||||
* The data for the member's guild avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -90,6 +90,19 @@ export interface APIInvite {
|
||||
* The guild scheduled event data, returned from the `GET /invites/<code>` endpoint when `guild_scheduled_event_id` is a valid guild scheduled event id
|
||||
*/
|
||||
guild_scheduled_event?: APIGuildScheduledEvent;
|
||||
/**
|
||||
* The invite type
|
||||
*/
|
||||
type: InviteType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object-invite-types
|
||||
*/
|
||||
export enum InviteType {
|
||||
Guild,
|
||||
GroupDM,
|
||||
Friend,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@ export * from './guildScheduledEvent.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './poll.ts';
|
||||
export * from './permissions.ts';
|
||||
export * from './stageInstance.ts';
|
||||
export * from './sticker.ts';
|
||||
|
||||
@@ -40,16 +40,48 @@ export interface APIEntitlement {
|
||||
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
|
||||
*/
|
||||
ends_at?: string;
|
||||
/**
|
||||
* For consumable items, whether or not the entitlement has been consumed
|
||||
*/
|
||||
consumed?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
|
||||
*/
|
||||
export enum EntitlementType {
|
||||
/**
|
||||
* Entitlement was purchased by user
|
||||
*/
|
||||
Purchase = 1,
|
||||
/**
|
||||
* Entitlement for Discord Nitro subscription
|
||||
*/
|
||||
PremiumSubscription,
|
||||
/**
|
||||
* Entitlement was gifted by developer
|
||||
*/
|
||||
DeveloperGift,
|
||||
/**
|
||||
* Entitlement was purchased by a dev in application test mode
|
||||
*/
|
||||
TestModePurchase,
|
||||
/**
|
||||
* Entitlement was granted when the SKU was free
|
||||
*/
|
||||
FreePurchase,
|
||||
/**
|
||||
* Entitlement was gifted by another user
|
||||
*/
|
||||
UserGift,
|
||||
/**
|
||||
* Entitlement was claimed by user for free as a Nitro Subscriber
|
||||
*/
|
||||
PremiumPurchase,
|
||||
/**
|
||||
* Entitlement was purchased as an app subscription
|
||||
*/
|
||||
ApplicationSubscription = 8,
|
||||
ApplicationSubscription,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,6 +136,14 @@ export enum SKUFlags {
|
||||
}
|
||||
|
||||
export enum SKUType {
|
||||
/**
|
||||
* Durable one-time purchase
|
||||
*/
|
||||
Durable = 2,
|
||||
/**
|
||||
* Consumable one-time purchase
|
||||
*/
|
||||
Consumable = 3,
|
||||
/**
|
||||
* Represents a recurring subscription
|
||||
*/
|
||||
|
||||
111
deno/payloads/v9/poll.ts
Normal file
111
deno/payloads/v9/poll.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/poll
|
||||
*/
|
||||
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure
|
||||
*/
|
||||
export interface APIPoll {
|
||||
/**
|
||||
* The question of the poll
|
||||
*/
|
||||
question: APIPollMedia;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* The results of the poll
|
||||
*/
|
||||
results?: APIPollResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#layout-type
|
||||
*/
|
||||
export enum PollLayoutType {
|
||||
/**
|
||||
* The, uhm, default layout type
|
||||
*/
|
||||
Default = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-media-object-poll-media-object-structure
|
||||
*/
|
||||
export interface APIPollMedia {
|
||||
/**
|
||||
* The text of the field
|
||||
*
|
||||
* The maximum length is `300` for the question, and `55` for any answer
|
||||
*/
|
||||
text?: string;
|
||||
/**
|
||||
* The emoji of the field
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure
|
||||
*/
|
||||
export interface APIPollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
/**
|
||||
* The data of the answer
|
||||
*/
|
||||
poll_media: APIPollMedia;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure
|
||||
*/
|
||||
export interface APIPollResults {
|
||||
/**
|
||||
* Whether the votes have been precisely counted
|
||||
*/
|
||||
is_finalized: boolean;
|
||||
/**
|
||||
* The counts for each answer
|
||||
*/
|
||||
answer_counts: APIPollAnswerCount[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-answer-count-object-structure
|
||||
*/
|
||||
export interface APIPollAnswerCount {
|
||||
/**
|
||||
* The `answer_id`
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* The number of votes for this answer
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* Whether the current user voted for this answer
|
||||
*/
|
||||
me_voted: boolean;
|
||||
}
|
||||
@@ -87,8 +87,16 @@ export interface APIUser {
|
||||
* The user's avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*
|
||||
* @deprecated Use `avatar_decoration_data` instead
|
||||
*/
|
||||
avatar_decoration?: string | null;
|
||||
/**
|
||||
* The data for the user's avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -267,6 +275,7 @@ export interface APIConnection {
|
||||
export enum ConnectionService {
|
||||
BattleNet = 'battlenet',
|
||||
BungieNet = 'bungie',
|
||||
Domain = 'domain',
|
||||
eBay = 'ebay',
|
||||
EpicGames = 'epicgames',
|
||||
Facebook = 'facebook',
|
||||
@@ -276,6 +285,7 @@ export enum ConnectionService {
|
||||
PlayStationNetwork = 'playstation',
|
||||
Reddit = 'reddit',
|
||||
RiotGames = 'riotgames',
|
||||
Roblox = 'roblox',
|
||||
PayPal = 'paypal',
|
||||
Spotify = 'spotify',
|
||||
Skype = 'skype',
|
||||
@@ -319,3 +329,19 @@ export interface APIApplicationRoleConnection {
|
||||
*/
|
||||
metadata: Record<string, number | string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
export interface APIAvatarDecorationData {
|
||||
/**
|
||||
* The avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
asset: string;
|
||||
/**
|
||||
* The id of the avatar decoration's SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
@@ -7,8 +7,15 @@ import type { APIGuildMember } from './guild.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*
|
||||
* @deprecated This is deprecated, use {@apilink APIVoiceState}
|
||||
*/
|
||||
export interface GatewayVoiceState {
|
||||
export type GatewayVoiceState = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
export interface APIVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
|
||||
@@ -43,8 +43,8 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
UnknownDiscoverableServerCategory = 10_059,
|
||||
UnknownSticker,
|
||||
|
||||
UnknownInteraction = 10_062,
|
||||
UnknownStickerPack,
|
||||
UnknownInteraction,
|
||||
UnknownApplicationCommand,
|
||||
|
||||
UnknownVoiceState = 10_065,
|
||||
@@ -156,6 +156,8 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
AnEntitlementHasAlreadyBeenGrantedForThisResource = 40_074,
|
||||
|
||||
CloudflareIsBlockingYourRequest = 40_333,
|
||||
|
||||
MissingAccess = 50_001,
|
||||
InvalidAccountType,
|
||||
CannotExecuteActionOnDMChannel,
|
||||
@@ -295,6 +297,14 @@ export enum RESTJSONErrorCodes {
|
||||
CannotUpdateOnboardingWhileBelowRequirements,
|
||||
|
||||
FailedToBanUsers = 500_000,
|
||||
|
||||
PollVotingBlocked = 520_000,
|
||||
PollExpired,
|
||||
InvalidChannelTypeForPollCreation,
|
||||
CannotEditAPollMessage,
|
||||
CannotUseAnEmojiIncludedWithThePoll,
|
||||
|
||||
CannotExpireANonPollMessage = 520_006,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,7 @@ export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
|
||||
| 'description'
|
||||
| 'flags'
|
||||
| 'install_params'
|
||||
| 'integration_types_config'
|
||||
| 'interactions_endpoint_url'
|
||||
| 'role_connections_verification_url'
|
||||
| 'tags'
|
||||
|
||||
@@ -26,11 +26,17 @@ import type {
|
||||
ChannelFlags,
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.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
|
||||
*/
|
||||
@@ -97,7 +103,7 @@ export interface RESTPatchAPIChannelJSONBody {
|
||||
*
|
||||
* Channel types: all excluding newsThread, publicThread, privateThread
|
||||
*/
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined;
|
||||
permission_overwrites?: RESTAPIChannelPatchOverwrite[] | null | undefined;
|
||||
/**
|
||||
* ID of the new parent category for a channel
|
||||
*
|
||||
@@ -236,7 +242,7 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Required<Pick<APIMessageReference, 'message_id'>>
|
||||
> &
|
||||
StrictPartial<APIMessageReference> & {
|
||||
@@ -248,6 +254,11 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO
|
||||
fail_if_not_exists?: boolean | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIMessageReference} instead
|
||||
*/
|
||||
export type APIMessageReferenceSend = RESTAPIMessageReference;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
@@ -299,7 +310,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend | undefined;
|
||||
message_reference?: RESTAPIMessageReference | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
@@ -325,6 +336,10 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
* If another message was created by the same author with the same nonce, that message will be returned and no new message will be created.
|
||||
*/
|
||||
enforce_nonce?: boolean | undefined;
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPoll | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -357,7 +372,12 @@ export type RESTPutAPIChannelMessageReactionResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-own-reaction
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = never;
|
||||
export type RESTDeleteAPIChannelMessageOwnReactionResult = never;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTDeleteAPIChannelMessageOwnReactionResult} instead
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = RESTDeleteAPIChannelMessageOwnReactionResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-user-reaction
|
||||
@@ -368,6 +388,10 @@ export type RESTDeleteAPIChannelMessageUserReactionResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
/**
|
||||
* The reaction type
|
||||
*/
|
||||
type?: ReactionType;
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
@@ -380,6 +404,14 @@ export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions-reaction-types
|
||||
*/
|
||||
export enum ReactionType {
|
||||
Normal,
|
||||
Super,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
|
||||
@@ -59,3 +59,40 @@ export type RESTPatchAPIGuildEmojiResult = APIEmoji;
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIGuildEmojiResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-application-emojis
|
||||
*/
|
||||
export interface RESTGetAPIApplicationEmojisResult {
|
||||
items: APIEmoji[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#get-application-emoji
|
||||
*/
|
||||
export type RESTGetAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params
|
||||
*/
|
||||
export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSONBody, 'image' | 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-application-emoji
|
||||
*/
|
||||
export type RESTPostAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
|
||||
*/
|
||||
export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJSONBody, 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
|
||||
*/
|
||||
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-application-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIApplicationEmojiResult = never;
|
||||
|
||||
@@ -37,14 +37,25 @@ import type {
|
||||
} from '../../utils/internals.ts';
|
||||
import type { RESTPutAPIChannelPermissionJSONBody } from './channel.ts';
|
||||
|
||||
export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
export type APIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
|
||||
export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead
|
||||
*/
|
||||
export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite;
|
||||
|
||||
export type RESTAPIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildChannelResolvable} instead
|
||||
*/
|
||||
export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable;
|
||||
|
||||
export type RESTAPIGuildCreatePartialChannel = StrictPartial<
|
||||
DistributivePick<
|
||||
APIGuildChannelResolvable,
|
||||
RESTAPIGuildChannelResolvable,
|
||||
| 'available_tags'
|
||||
| 'bitrate'
|
||||
| 'default_auto_archive_duration'
|
||||
@@ -66,13 +77,23 @@ export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
name: string;
|
||||
id?: number | string | undefined;
|
||||
parent_id?: number | string | null | undefined;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
|
||||
permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined;
|
||||
};
|
||||
|
||||
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreatePartialChannel} instead
|
||||
*/
|
||||
export type APIGuildCreatePartialChannel = RESTAPIGuildCreatePartialChannel;
|
||||
|
||||
export interface RESTAPIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreateRole} instead
|
||||
*/
|
||||
export type APIGuildCreateRole = RESTAPIGuildCreateRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
*/
|
||||
@@ -124,7 +145,7 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
roles?: APIGuildCreateRole[] | undefined;
|
||||
roles?: RESTAPIGuildCreateRole[] | undefined;
|
||||
/**
|
||||
* New guild's channels
|
||||
*
|
||||
@@ -138,7 +159,7 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels?: APIGuildCreatePartialChannel[] | undefined;
|
||||
channels?: RESTAPIGuildCreatePartialChannel[] | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
@@ -333,7 +354,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
*/
|
||||
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<APIGuildCreatePartialChannel, 'id'>;
|
||||
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<RESTAPIGuildCreatePartialChannel, 'id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
@@ -739,6 +760,11 @@ export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-role
|
||||
*/
|
||||
export type RESTGetAPIGuildRoleResult = APIRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
*/
|
||||
@@ -891,48 +917,6 @@ export interface RESTPatchAPIGuildMemberVerificationJSONBody {
|
||||
|
||||
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
|
||||
*/
|
||||
@@ -967,20 +951,25 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
/**
|
||||
* Prompts shown during onboarding and in customize community
|
||||
*/
|
||||
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
|
||||
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
export type RESTAPIGuildOnboardingPrompt = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
|
||||
|
||||
export type RESTAPIGuildOnboardingPromptOption = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> & {
|
||||
@@ -998,6 +987,11 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossibl
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardingPromptOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
|
||||
*/
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { StrictPartial } from '../../utils/internals.ts';
|
||||
import type { Nullable, StrictPartial } from '../../utils/internals.ts';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
APIGuildScheduledEventRecurrenceRule,
|
||||
APIGuildScheduledEventUser,
|
||||
GuildScheduledEventEntityType,
|
||||
GuildScheduledEventPrivacyLevel,
|
||||
@@ -64,6 +65,10 @@ export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null | undefined;
|
||||
/**
|
||||
* The definition for how often this event should recur
|
||||
*/
|
||||
recurrence_rule?: APIGuildScheduledEventRecurrenceRule | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,20 +94,17 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | null | undefined;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string | null | undefined;
|
||||
};
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> &
|
||||
StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
|
||||
@@ -6,7 +6,11 @@ import type {
|
||||
APIInteractionResponseCallbackData,
|
||||
ApplicationCommandType,
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type {
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
NonNullableFields,
|
||||
StrictPartial,
|
||||
} from '../../utils/internals.ts';
|
||||
import type {
|
||||
RESTDeleteAPIWebhookWithTokenMessageResult,
|
||||
RESTGetAPIWebhookWithTokenMessageResult,
|
||||
@@ -43,16 +47,21 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
> &
|
||||
Partial<Pick<APIApplicationCommand, 'default_member_permissions'>>
|
||||
Partial<
|
||||
NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,6 +12,7 @@ export * from './guildScheduledEvent.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './poll.ts';
|
||||
export * from './stageInstance.ts';
|
||||
export * from './sticker.ts';
|
||||
export * from './template.ts';
|
||||
@@ -31,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`
|
||||
@@ -343,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}`
|
||||
*/
|
||||
@@ -461,6 +464,22 @@ export const Routes = {
|
||||
return `/guilds/${guildId}/templates/${code}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/polls/{message.id}/answers/{answer_id}`
|
||||
*/
|
||||
pollAnswerVoters(channelId: Snowflake, messageId: Snowflake, answerId: number) {
|
||||
return `/channels/${channelId}/polls/${messageId}/answers/${answerId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/polls/{message.id}/expire`
|
||||
*/
|
||||
expirePoll(channelId: Snowflake, messageId: Snowflake) {
|
||||
return `/channels/${channelId}/polls/${messageId}/expire` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/threads`
|
||||
@@ -769,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}`
|
||||
*/
|
||||
@@ -837,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`
|
||||
@@ -895,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;
|
||||
@@ -943,6 +972,33 @@ export const Routes = {
|
||||
guildBulkBan(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/bulk-ban` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - 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';
|
||||
@@ -970,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;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1056,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
|
||||
*
|
||||
@@ -1076,11 +1132,23 @@ export const CDNRoutes = {
|
||||
* - GET `/avatar-decorations/{user.id}/{user.avatar_decoration}.png`
|
||||
*
|
||||
* This route supports the extension: PNG
|
||||
*
|
||||
* @deprecated Use {@link CDNRoutes.avatarDecoration} instead.
|
||||
*/
|
||||
userAvatarDecoration(userId: Snowflake, userAvatarDecoration: string) {
|
||||
return `/avatar-decorations/${userId}/${userAvatarDecoration}.png` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/avatar-decoration-presets/{avatar_decoration_data_asset}.png`
|
||||
*
|
||||
* This route supports the extension: PNG
|
||||
*/
|
||||
avatarDecoration(avatarDecorationDataAsset: string) {
|
||||
return `/avatar-decoration-presets/${avatarDecorationDataAsset}.png` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/app-icons/{application.id}/{application.icon}.{png|jpeg|webp}`
|
||||
@@ -1164,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
|
||||
*/
|
||||
@@ -1257,6 +1325,7 @@ export interface CDNQuery {
|
||||
export const RouteBases = {
|
||||
api: `https://discord.com/api/v${APIVersion}`,
|
||||
cdn: 'https://cdn.discordapp.com',
|
||||
media: 'https://media.discordapp.net',
|
||||
invite: 'https://discord.gg',
|
||||
template: 'https://discord.new',
|
||||
gift: 'https://discord.gift',
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
@@ -83,3 +88,8 @@ export type RESTDeleteAPIEntitlementResult = never;
|
||||
* https://discord.com/developers/docs/monetization/skus#list-skus
|
||||
*/
|
||||
export type RESTGetAPISKUsResult = APISKU[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement
|
||||
*/
|
||||
export type RESTPostAPIEntitlementConsumeResult = never;
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
56
deno/rest/v10/poll.ts
Normal file
56
deno/rest/v10/poll.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIMessage, APIPoll, APIPollAnswer, APIUser } from '../../v10.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* Max number of users to return (1-100)
|
||||
*
|
||||
* @default 25
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure
|
||||
*/
|
||||
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
|
||||
*/
|
||||
export interface RESTGetAPIPollAnswerVotersResult {
|
||||
/**
|
||||
* Users who voted for this answer
|
||||
*/
|
||||
users: APIUser[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#expire-poll
|
||||
*/
|
||||
export type RESTPostAPIPollExpireResult = APIMessage;
|
||||
@@ -12,6 +12,16 @@ export interface RESTGetStickerPacksResult {
|
||||
sticker_packs: APIStickerPack[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#get-sticker-pack
|
||||
*/
|
||||
export type RESTGetAPIStickerPackResult = APIStickerPack;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTGetAPIStickerPackResult} instead
|
||||
*/
|
||||
export type RESTGetAPIStickerPack = RESTGetAPIStickerPackResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
|
||||
*
|
||||
|
||||
@@ -76,6 +76,7 @@ export interface RESTAPIPartialCurrentUserGuild {
|
||||
id: Snowflake;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
banner: string | null;
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
permissions: Permissions;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { APIVoiceRegion } from '../../payloads/v10/mod.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIVoiceRegion, APIVoiceState } from '../../payloads/v10/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#list-voice-regions
|
||||
@@ -9,3 +10,55 @@ export type RESTGetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
* @deprecated This was exported with the wrong name, use `RESTGetAPIVoiceRegionsResult` instead
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = RESTGetAPIVoiceRegionsResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#get-current-user-voice-state
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceStateCurrentMemberResult = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#get-user-voice-state
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceStateUserResult = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
@@ -10,6 +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 { RESTAPIPoll } from './poll.ts';
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
@@ -154,6 +155,10 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
* Array of tag ids to apply to the thread
|
||||
*/
|
||||
applied_tags?: Snowflake[] | undefined;
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPoll | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,7 @@ export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
|
||||
| 'description'
|
||||
| 'flags'
|
||||
| 'install_params'
|
||||
| 'integration_types_config'
|
||||
| 'interactions_endpoint_url'
|
||||
| 'role_connections_verification_url'
|
||||
| 'tags'
|
||||
|
||||
@@ -26,11 +26,17 @@ import type {
|
||||
ChannelFlags,
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.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
|
||||
*/
|
||||
@@ -236,7 +242,7 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Required<Pick<APIMessageReference, 'message_id'>>
|
||||
> &
|
||||
StrictPartial<APIMessageReference> & {
|
||||
@@ -248,6 +254,11 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO
|
||||
fail_if_not_exists?: boolean | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIMessageReference} instead
|
||||
*/
|
||||
export type APIMessageReferenceSend = RESTAPIMessageReference;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
@@ -307,7 +318,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend | undefined;
|
||||
message_reference?: RESTAPIMessageReference | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
@@ -333,6 +344,10 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
* If another message was created by the same author with the same nonce, that message will be returned and no new message will be created.
|
||||
*/
|
||||
enforce_nonce?: boolean | undefined;
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPoll | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -365,7 +380,12 @@ export type RESTPutAPIChannelMessageReactionResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-own-reaction
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = never;
|
||||
export type RESTDeleteAPIChannelMessageOwnReactionResult = never;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTDeleteAPIChannelMessageOwnReactionResult} instead
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = RESTDeleteAPIChannelMessageOwnReactionResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-user-reaction
|
||||
@@ -376,6 +396,10 @@ export type RESTDeleteAPIChannelMessageUserReactionResult = never;
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
/**
|
||||
* The reaction type
|
||||
*/
|
||||
type?: ReactionType;
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
@@ -388,6 +412,14 @@ export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions-reaction-types
|
||||
*/
|
||||
export enum ReactionType {
|
||||
Normal,
|
||||
Super,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
|
||||
@@ -59,3 +59,40 @@ export type RESTPatchAPIGuildEmojiResult = APIEmoji;
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIGuildEmojiResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-application-emojis
|
||||
*/
|
||||
export interface RESTGetAPIApplicationEmojisResult {
|
||||
items: APIEmoji[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#get-application-emoji
|
||||
*/
|
||||
export type RESTGetAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params
|
||||
*/
|
||||
export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSONBody, 'image' | 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-application-emoji
|
||||
*/
|
||||
export type RESTPostAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
|
||||
*/
|
||||
export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJSONBody, 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
|
||||
*/
|
||||
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-application-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIApplicationEmojiResult = never;
|
||||
|
||||
@@ -37,14 +37,25 @@ import type {
|
||||
} from '../../utils/internals.ts';
|
||||
import type { RESTPutAPIChannelPermissionJSONBody } from './channel.ts';
|
||||
|
||||
export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
export type APIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
|
||||
export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead
|
||||
*/
|
||||
export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite;
|
||||
|
||||
export type RESTAPIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildChannelResolvable} instead
|
||||
*/
|
||||
export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable;
|
||||
|
||||
export type RESTAPIGuildCreatePartialChannel = StrictPartial<
|
||||
DistributivePick<
|
||||
APIGuildChannelResolvable,
|
||||
RESTAPIGuildChannelResolvable,
|
||||
| 'available_tags'
|
||||
| 'bitrate'
|
||||
| 'default_auto_archive_duration'
|
||||
@@ -66,13 +77,23 @@ export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
name: string;
|
||||
id?: number | string | undefined;
|
||||
parent_id?: number | string | null | undefined;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
|
||||
permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined;
|
||||
};
|
||||
|
||||
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreatePartialChannel} instead
|
||||
*/
|
||||
export type APIGuildCreatePartialChannel = RESTAPIGuildCreatePartialChannel;
|
||||
|
||||
export interface RESTAPIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildCreateRole} instead
|
||||
*/
|
||||
export type APIGuildCreateRole = RESTAPIGuildCreateRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
*/
|
||||
@@ -124,7 +145,7 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
roles?: APIGuildCreateRole[] | undefined;
|
||||
roles?: RESTAPIGuildCreateRole[] | undefined;
|
||||
/**
|
||||
* New guild's channels
|
||||
*
|
||||
@@ -138,7 +159,7 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels?: APIGuildCreatePartialChannel[] | undefined;
|
||||
channels?: RESTAPIGuildCreatePartialChannel[] | undefined;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
@@ -333,7 +354,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
*/
|
||||
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<APIGuildCreatePartialChannel, 'id'>;
|
||||
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<RESTAPIGuildCreatePartialChannel, 'id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
@@ -745,6 +766,11 @@ export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
mentionable?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-role
|
||||
*/
|
||||
export type RESTGetAPIGuildRoleResult = APIRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
*/
|
||||
@@ -897,48 +923,6 @@ export interface RESTPatchAPIGuildMemberVerificationJSONBody {
|
||||
|
||||
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
|
||||
*/
|
||||
@@ -973,20 +957,25 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP
|
||||
/**
|
||||
* Prompts shown during onboarding and in customize community
|
||||
*/
|
||||
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
|
||||
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
export type RESTAPIGuildOnboardingPrompt = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
|
||||
options: RESTAPIGuildOnboardingPromptOption[];
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
|
||||
|
||||
export type RESTAPIGuildOnboardingPromptOption = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> & {
|
||||
@@ -1004,6 +993,11 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossibl
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.
|
||||
*/
|
||||
export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardingPromptOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
|
||||
*/
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { StrictPartial } from '../../utils/internals.ts';
|
||||
import type { Nullable, StrictPartial } from '../../utils/internals.ts';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
APIGuildScheduledEventRecurrenceRule,
|
||||
APIGuildScheduledEventUser,
|
||||
GuildScheduledEventEntityType,
|
||||
GuildScheduledEventPrivacyLevel,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
GuildScheduledEventStatus,
|
||||
APIGuildScheduledEventUser,
|
||||
} from '../../v9.ts';
|
||||
|
||||
/**
|
||||
@@ -64,6 +65,10 @@ export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null | undefined;
|
||||
/**
|
||||
* The definition for how often this event should recur
|
||||
*/
|
||||
recurrence_rule?: APIGuildScheduledEventRecurrenceRule | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,20 +94,17 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata | null | undefined;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string | null | undefined;
|
||||
};
|
||||
export type RESTPatchAPIGuildScheduledEventJSONBody = Nullable<
|
||||
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> &
|
||||
StrictPartial<
|
||||
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
|
||||
> & {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
|
||||
@@ -6,7 +6,11 @@ import type {
|
||||
APIInteractionResponseCallbackData,
|
||||
ApplicationCommandType,
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
import type {
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
NonNullableFields,
|
||||
StrictPartial,
|
||||
} from '../../utils/internals.ts';
|
||||
import type {
|
||||
RESTDeleteAPIWebhookWithTokenMessageResult,
|
||||
RESTGetAPIWebhookWithTokenMessageResult,
|
||||
@@ -43,16 +47,21 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'application_id'
|
||||
| 'contexts'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'integration_types'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
> &
|
||||
Partial<Pick<APIApplicationCommand, 'default_member_permissions'>>
|
||||
Partial<
|
||||
NonNullableFields<Pick<APIApplicationCommand, 'contexts'>> &
|
||||
Pick<APIApplicationCommand, 'default_member_permissions' | 'integration_types'>
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,6 +12,7 @@ export * from './guildScheduledEvent.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './poll.ts';
|
||||
export * from './stageInstance.ts';
|
||||
export * from './sticker.ts';
|
||||
export * from './template.ts';
|
||||
@@ -31,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`
|
||||
@@ -343,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}`
|
||||
*/
|
||||
@@ -461,6 +464,22 @@ export const Routes = {
|
||||
return `/guilds/${guildId}/templates/${code}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/polls/{message.id}/answers/{answer_id}`
|
||||
*/
|
||||
pollAnswerVoters(channelId: Snowflake, messageId: Snowflake, answerId: number) {
|
||||
return `/channels/${channelId}/polls/${messageId}/answers/${answerId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/polls/{message.id}/expire`
|
||||
*/
|
||||
expirePoll(channelId: Snowflake, messageId: Snowflake) {
|
||||
return `/channels/${channelId}/polls/${messageId}/expire` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/threads`
|
||||
@@ -778,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}`
|
||||
*/
|
||||
@@ -846,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`
|
||||
@@ -904,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;
|
||||
@@ -952,6 +981,33 @@ export const Routes = {
|
||||
guildBulkBan(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/bulk-ban` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - 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';
|
||||
@@ -979,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;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1065,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
|
||||
*
|
||||
@@ -1085,11 +1141,23 @@ export const CDNRoutes = {
|
||||
* - GET `/avatar-decorations/{user.id}/{user.avatar_decoration}.png`
|
||||
*
|
||||
* This route supports the extension: PNG
|
||||
*
|
||||
* @deprecated Use {@link CDNRoutes.avatarDecoration} instead.
|
||||
*/
|
||||
userAvatarDecoration(userId: Snowflake, userAvatarDecoration: string) {
|
||||
return `/avatar-decorations/${userId}/${userAvatarDecoration}.png` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/avatar-decoration-presets/{avatar_decoration_data_asset}.png`
|
||||
*
|
||||
* This route supports the extension: PNG
|
||||
*/
|
||||
avatarDecoration(avatarDecorationDataAsset: string) {
|
||||
return `/avatar-decoration-presets/${avatarDecorationDataAsset}.png` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/app-icons/{application.id}/{application.icon}.{png|jpeg|webp}`
|
||||
@@ -1173,7 +1241,7 @@ export const CDNRoutes = {
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
|
||||
* - GET `/team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
|
||||
@@ -46,7 +46,7 @@ export type RESTGetAPIEntitlementsResult = APIEntitlement[];
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
|
||||
*/
|
||||
export interface RESTPostAPIEntitlementBody {
|
||||
export interface RESTPostAPIEntitlementJSONBody {
|
||||
/**
|
||||
* ID of the SKU to grant the entitlement to
|
||||
*/
|
||||
@@ -61,6 +61,11 @@ export interface RESTPostAPIEntitlementBody {
|
||||
owner_type: EntitlementOwnerType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTPostAPIEntitlementJSONBody} instead
|
||||
*/
|
||||
export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
|
||||
*/
|
||||
@@ -83,3 +88,8 @@ export type RESTDeleteAPIEntitlementResult = never;
|
||||
* https://discord.com/developers/docs/monetization/skus#list-skus
|
||||
*/
|
||||
export type RESTGetAPISKUsResult = APISKU[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement
|
||||
*/
|
||||
export type RESTPostAPIEntitlementConsumeResult = never;
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
56
deno/rest/v9/poll.ts
Normal file
56
deno/rest/v9/poll.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIMessage, APIPoll, APIPollAnswer, APIUser } from '../../v9.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#get-answer-voters
|
||||
*/
|
||||
export interface RESTGetAPIPollAnswerVotersQuery {
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* Max number of users to return (1-100)
|
||||
*
|
||||
* @default 25
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure
|
||||
*/
|
||||
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
|
||||
*/
|
||||
export interface RESTGetAPIPollAnswerVotersResult {
|
||||
/**
|
||||
* Users who voted for this answer
|
||||
*/
|
||||
users: APIUser[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#expire-poll
|
||||
*/
|
||||
export type RESTPostAPIPollExpireResult = APIMessage;
|
||||
@@ -12,6 +12,16 @@ export interface RESTGetStickerPacksResult {
|
||||
sticker_packs: APIStickerPack[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#get-sticker-pack
|
||||
*/
|
||||
export type RESTGetAPIStickerPackResult = APIStickerPack;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTGetAPIStickerPackResult} instead
|
||||
*/
|
||||
export type RESTGetAPIStickerPack = RESTGetAPIStickerPackResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
|
||||
*
|
||||
|
||||
@@ -76,6 +76,7 @@ export interface RESTAPIPartialCurrentUserGuild {
|
||||
id: Snowflake;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
banner: string | null;
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
permissions: Permissions;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { APIVoiceRegion } from '../../payloads/v9/mod.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIVoiceRegion, APIVoiceState } from '../../payloads/v9/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#list-voice-regions
|
||||
@@ -9,3 +10,55 @@ export type RESTGetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
* @deprecated This was exported with the wrong name, use `RESTGetAPIVoiceRegionsResult` instead
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = RESTGetAPIVoiceRegionsResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#get-current-user-voice-state
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceStateCurrentMemberResult = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#get-user-voice-state
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceStateUserResult = APIVoiceState;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
|
||||
*/
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
@@ -10,6 +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 { RESTAPIPoll } from './poll.ts';
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
@@ -154,6 +155,10 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
* Array of tag ids to apply to the thread
|
||||
*/
|
||||
applied_tags?: Snowflake[] | undefined;
|
||||
/**
|
||||
* A poll!
|
||||
*/
|
||||
poll?: RESTAPIPoll | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,6 +2,10 @@ export type Nullable<T> = {
|
||||
[P in keyof T]: T[P] | null;
|
||||
};
|
||||
|
||||
export type NonNullableFields<T> = {
|
||||
[P in keyof T]: NonNullable<T[P]>;
|
||||
};
|
||||
|
||||
export type AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base> = {
|
||||
[K in keyof Base]: Base[K] extends Exclude<Base[K], undefined> ?
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]>
|
||||
|
||||
@@ -28,7 +28,7 @@ import type {
|
||||
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
|
||||
GatewayThreadListSync as RawGatewayThreadListSync,
|
||||
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
|
||||
GatewayVoiceState,
|
||||
APIVoiceState,
|
||||
InviteTargetType,
|
||||
PresenceUpdateStatus,
|
||||
AutoModerationRuleTriggerType,
|
||||
@@ -36,6 +36,7 @@ import type {
|
||||
APIEntitlement,
|
||||
ChannelType,
|
||||
} from '../payloads/v10/index';
|
||||
import type { ReactionType } from '../rest/v10/index';
|
||||
import type { Nullable } from '../utils/internals';
|
||||
|
||||
export * from './common';
|
||||
@@ -203,6 +204,8 @@ export enum GatewayIntentBits {
|
||||
GuildScheduledEvents = 1 << 16,
|
||||
AutoModerationConfiguration = 1 << 20,
|
||||
AutoModerationExecution = 1 << 21,
|
||||
GuildMessagePolls = 1 << 24,
|
||||
DirectMessagePolls = 1 << 25,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -260,6 +263,8 @@ export enum GatewayDispatchEvents {
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
|
||||
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
|
||||
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
|
||||
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
|
||||
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
|
||||
@@ -328,6 +333,8 @@ export type GatewayDispatchPayload =
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessagePollVoteAddDispatch
|
||||
| GatewayMessagePollVoteRemoveDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
@@ -778,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
|
||||
*
|
||||
@@ -1400,7 +1407,7 @@ export interface GatewayMessageEventExtraFields {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
member?: Omit<APIGuildMember, 'user'>;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
@@ -1480,7 +1487,7 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
'member' | 'message_author_id'
|
||||
'burst_colors' | 'member' | 'message_author_id'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -1741,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
|
||||
@@ -1813,6 +1820,45 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add
|
||||
*/
|
||||
export type GatewayMessagePollVoteAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteAdd,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove
|
||||
*/
|
||||
export type GatewayMessagePollVoteRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteRemove,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayMessagePollVoteDispatchData {
|
||||
/**
|
||||
* ID of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* ID of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* ID of the answer
|
||||
*/
|
||||
answer_id: number;
|
||||
}
|
||||
|
||||
// #endregion Dispatch Payloads
|
||||
|
||||
// #region Sendable Payloads
|
||||
@@ -2120,6 +2166,18 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors: string[];
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
},
|
||||
O
|
||||
>
|
||||
|
||||
@@ -28,13 +28,14 @@ import type {
|
||||
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
|
||||
GatewayThreadListSync as RawGatewayThreadListSync,
|
||||
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
|
||||
GatewayVoiceState,
|
||||
APIVoiceState,
|
||||
InviteTargetType,
|
||||
PresenceUpdateStatus,
|
||||
AutoModerationRuleTriggerType,
|
||||
APIAuditLogEntry,
|
||||
ChannelType,
|
||||
} from '../payloads/v9/index';
|
||||
import type { ReactionType } from '../rest/v9/index';
|
||||
import type { Nullable } from '../utils/internals';
|
||||
import type { APIEntitlement } from '../v10';
|
||||
|
||||
@@ -202,6 +203,8 @@ export enum GatewayIntentBits {
|
||||
GuildScheduledEvents = 1 << 16,
|
||||
AutoModerationConfiguration = 1 << 20,
|
||||
AutoModerationExecution = 1 << 21,
|
||||
GuildMessagePolls = 1 << 24,
|
||||
DirectMessagePolls = 1 << 25,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -259,6 +262,8 @@ export enum GatewayDispatchEvents {
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
|
||||
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
|
||||
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
|
||||
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
|
||||
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
|
||||
@@ -327,6 +332,8 @@ export type GatewayDispatchPayload =
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessagePollVoteAddDispatch
|
||||
| GatewayMessagePollVoteRemoveDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
@@ -777,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
|
||||
*
|
||||
@@ -1399,7 +1406,7 @@ export interface GatewayMessageEventExtraFields {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
member?: Omit<APIGuildMember, 'user'>;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
@@ -1479,7 +1486,7 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<
|
||||
GatewayDispatchEvents.MessageReactionRemove,
|
||||
'member' | 'message_author_id'
|
||||
'burst_colors' | 'member' | 'message_author_id'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -1740,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
|
||||
@@ -1812,6 +1819,45 @@ export interface GatewayGuildAuditLogEntryCreateDispatchData extends APIAuditLog
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add
|
||||
*/
|
||||
export type GatewayMessagePollVoteAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteAdd,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove
|
||||
*/
|
||||
export type GatewayMessagePollVoteRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessagePollVoteRemove,
|
||||
GatewayMessagePollVoteDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayMessagePollVoteDispatchData {
|
||||
/**
|
||||
* ID of the user
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* ID of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
message_id: Snowflake;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* ID of the answer
|
||||
*/
|
||||
answer_id: number;
|
||||
}
|
||||
|
||||
// #endregion Dispatch Payloads
|
||||
|
||||
// #region Sendable Payloads
|
||||
@@ -2119,6 +2165,18 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
|
||||
* The id of the user that posted the message that was reacted to
|
||||
*/
|
||||
message_author_id?: Snowflake;
|
||||
/**
|
||||
* True if this is a super-reaction
|
||||
*/
|
||||
burst: boolean;
|
||||
/**
|
||||
* Colors used for super-reaction animation in "#rrggbb" format
|
||||
*/
|
||||
burst_colors?: string[];
|
||||
/**
|
||||
* The type of reaction
|
||||
*/
|
||||
type: ReactionType;
|
||||
},
|
||||
O
|
||||
>
|
||||
|
||||
4090
package-lock.json
generated
4090
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
14
package.json
14
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.37.79",
|
||||
"version": "0.37.97",
|
||||
"description": "Discord API typings that are kept up to date for use in bot library creation.",
|
||||
"homepage": "https://discord-api-types.dev",
|
||||
"exports": {
|
||||
@@ -113,7 +113,7 @@
|
||||
"prepublishOnly": "run-s clean test:lint build:node",
|
||||
"test:lint": "prettier --check . && eslint --ext mjs,ts \"{gateway,payloads,rest,rpc,voice,utils}/**/*.ts\" \"{globals,v*}.ts\" \"scripts/**/*.mjs\"",
|
||||
"pretest:types": "tsc",
|
||||
"test:types": "tsd -t ./v10.d.ts",
|
||||
"test:types": "tsd -t ./v10.d.ts && tsd -t ./v9.d.ts",
|
||||
"posttest:types": "npm run clean:node"
|
||||
},
|
||||
"keywords": [
|
||||
@@ -122,7 +122,7 @@
|
||||
"types",
|
||||
"discordjs"
|
||||
],
|
||||
"author": "Vlad Frangu <kingdgrizzle@gmail.com>",
|
||||
"author": "Vlad Frangu <me@vladfrangu.dev>",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"{gateway,payloads,rest,rpc,voice,utils}/**/*.{js,js.map,d.ts,d.ts.map,mjs}",
|
||||
@@ -132,18 +132,18 @@
|
||||
"@commitlint/cli": "^19.0.3",
|
||||
"@commitlint/config-angular": "^19.0.3",
|
||||
"@favware/npm-deprecate": "^1.0.7",
|
||||
"@octokit/action": "^6.0.7",
|
||||
"@octokit/action": "^7.0.0",
|
||||
"@octokit/webhooks-types": "^7.3.2",
|
||||
"@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"
|
||||
|
||||
@@ -276,6 +276,18 @@ export const PermissionFlagsBits = {
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendVoiceMessages: 1n << 46n,
|
||||
/**
|
||||
* Allows sending polls
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendPolls: 1n << 49n,
|
||||
/**
|
||||
* Allows user-installed apps to send public responses. When disabled, users will still be allowed to use their apps but the responses will be ephemeral. This only applies to apps not also installed to the server
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
UseExternalApps: 1n << 50n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
|
||||
@@ -74,6 +74,8 @@ export interface APIApplicationCommand {
|
||||
default_member_permissions: Permissions | null;
|
||||
/**
|
||||
* Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible
|
||||
*
|
||||
* @deprecated Use `contexts` instead
|
||||
*/
|
||||
dm_permission?: boolean;
|
||||
/**
|
||||
@@ -88,6 +90,18 @@ export interface APIApplicationCommand {
|
||||
* Indicates whether the command is age-restricted, defaults to `false`
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
@@ -103,6 +117,38 @@ export enum ApplicationCommandType {
|
||||
Message,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-integration-types
|
||||
*/
|
||||
export enum ApplicationIntegrationType {
|
||||
/**
|
||||
* App is installable to servers
|
||||
*/
|
||||
GuildInstall = 0,
|
||||
/**
|
||||
* App is installable to users
|
||||
*/
|
||||
UserInstall = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types
|
||||
*/
|
||||
export enum InteractionContextType {
|
||||
/**
|
||||
* Interaction can be used within servers
|
||||
*/
|
||||
Guild = 0,
|
||||
/**
|
||||
* Interaction can be used within DMs with the app's bot user
|
||||
*/
|
||||
BotDM = 1,
|
||||
/**
|
||||
* Interaction can be used within Group DMs and DMs other than the app's bot user
|
||||
*/
|
||||
PrivateChannel = 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals';
|
||||
import type { APIRole, LocaleString } from '../../../v10';
|
||||
import type { APIRole, ApplicationIntegrationType, InteractionContextType, LocaleString } from '../../../v10';
|
||||
import type {
|
||||
APIAttachment,
|
||||
APIChannel,
|
||||
@@ -14,6 +14,40 @@ import type { APIEntitlement } from '../monetization';
|
||||
import type { APIUser } from '../user';
|
||||
import type { InteractionType } from './responses';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object
|
||||
*/
|
||||
export interface APIMessageInteractionMetadata {
|
||||
/**
|
||||
* ID of the interaction
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Type of interaction
|
||||
*/
|
||||
type: InteractionType;
|
||||
/**
|
||||
* User who triggered the interaction
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* ID of the original response message, present only on follow-up messages
|
||||
*/
|
||||
original_response_message_id?: Snowflake;
|
||||
/**
|
||||
* ID of the message that contained interactive component, present only on messages created from component interactions
|
||||
*/
|
||||
interacted_message_id?: Snowflake;
|
||||
/**
|
||||
* Metadata for the interaction that was used to open the modal, present only on modal submit interactions
|
||||
*/
|
||||
triggering_interaction_metadata?: APIMessageInteractionMetadata;
|
||||
}
|
||||
|
||||
export type PartialAPIMessageInteractionGuildMember = Pick<
|
||||
APIGuildMember,
|
||||
| 'avatar'
|
||||
@@ -122,7 +156,7 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
/**
|
||||
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
|
||||
*/
|
||||
app_permissions?: Permissions;
|
||||
app_permissions: Permissions;
|
||||
/**
|
||||
* The selected language of the invoking user
|
||||
*/
|
||||
@@ -135,8 +169,20 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
|
||||
*/
|
||||
entitlements: APIEntitlement[];
|
||||
/**
|
||||
* Mapping of installation contexts that the interaction was authorized for to related user or guild IDs.
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* Context where the interaction was triggered from
|
||||
*/
|
||||
context?: InteractionContextType;
|
||||
}
|
||||
|
||||
export type APIAuthorizingIntegrationOwnersMap = {
|
||||
[key in ApplicationIntegrationType]?: Snowflake;
|
||||
};
|
||||
|
||||
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'guild_id' | 'member'
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import type { Permissions, Snowflake } from '../../globals';
|
||||
import type { LocalizationMap } from '../common';
|
||||
import type { APIPartialGuild } from './guild';
|
||||
import type { ApplicationIntegrationType } from './interactions';
|
||||
import type { OAuth2Scopes } from './oauth2';
|
||||
import type { APITeam } from './teams';
|
||||
import type { APIUser } from './user';
|
||||
@@ -107,6 +108,10 @@ export interface APIApplication {
|
||||
* Approximate count of guilds the application has been added to
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* Approximate count of users that have installed the app
|
||||
*/
|
||||
approximate_user_install_count?: number;
|
||||
/**
|
||||
* Array of redirect URIs for the application
|
||||
*/
|
||||
@@ -128,6 +133,12 @@ export interface APIApplication {
|
||||
* Settings for the application's default in-app authorization link, if enabled
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
@@ -139,6 +150,14 @@ export interface APIApplicationInstallParams {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
export interface APIApplicationIntegrationTypeConfiguration {
|
||||
oauth2_install_params?: APIApplicationInstallParams;
|
||||
}
|
||||
|
||||
export type APIApplicationIntegrationTypesConfigMap = {
|
||||
[key in ApplicationIntegrationType]?: APIApplicationIntegrationTypeConfiguration;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
AutoModerationRuleEventType,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from './autoModeration';
|
||||
import type { APIChannel, APIOverwrite } from './channel';
|
||||
import type { APIChannel, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIOverwrite } from './channel';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
APIGuildIntegrationType,
|
||||
@@ -205,6 +205,15 @@ export enum AuditLogEvent {
|
||||
|
||||
CreatorMonetizationRequestCreated = 150,
|
||||
CreatorMonetizationTermsAccepted,
|
||||
|
||||
OnboardingPromptCreate = 163,
|
||||
OnboardingPromptUpdate,
|
||||
OnboardingPromptDelete,
|
||||
OnboardingCreate,
|
||||
OnboardingUpdate,
|
||||
|
||||
HomeSettingsCreate = 190,
|
||||
HomeSettingsUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,6 +356,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyAvailableTags
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
@@ -357,6 +367,8 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDefaultReactionEmoji
|
||||
| APIAuditLogChangeKeyDefaultThreadRateLimitPerUser
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
@@ -369,6 +381,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFlags
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyHoist
|
||||
@@ -523,12 +536,12 @@ export type APIAuditLogChangeKeyVanityURLCode = AuditLogChangeData<'vanity_url_c
|
||||
/**
|
||||
* Returned when new role(s) are added
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Add = AuditLogChangeData<'$add', APIRole[]>;
|
||||
export type APIAuditLogChangeKey$Add = AuditLogChangeData<'$add', Pick<APIRole, 'id' | 'name'>[]>;
|
||||
|
||||
/**
|
||||
* Returned when role(s) are removed
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Remove = AuditLogChangeData<'$remove', APIRole[]>;
|
||||
export type APIAuditLogChangeKey$Remove = AuditLogChangeData<'$remove', Pick<APIRole, 'id' | 'name'>[]>;
|
||||
|
||||
/**
|
||||
* Returned when there is a change in number of days after which inactive and role-unassigned members are kicked
|
||||
@@ -826,6 +839,33 @@ export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles',
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's available tags gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvailableTags = AuditLogChangeData<'available_tags', APIGuildForumTag[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's default reaction emoji gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultReactionEmoji = AuditLogChangeData<
|
||||
'default_reaction_emoji',
|
||||
APIGuildForumDefaultReactionEmoji
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a channel flag gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyFlags = AuditLogChangeData<'flags', number>;
|
||||
|
||||
/**
|
||||
* Returned when a thread's amount of seconds a user has to wait before creating another thread
|
||||
* gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultThreadRateLimitPerUser = AuditLogChangeData<
|
||||
'default_thread_rate_limit_per_user',
|
||||
number
|
||||
>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -74,6 +74,10 @@ export enum AutoModerationRuleTriggerType {
|
||||
* Check if content contains more mentions than allowed (Maximum of 1 per guild)
|
||||
*/
|
||||
MentionSpam,
|
||||
/**
|
||||
* Check if member profile contains words from a user defined list of keywords (Maximum of 1 per guild)
|
||||
*/
|
||||
MemberProfile,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,7 +90,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
|
||||
* A keyword can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
keyword_filter?: string[];
|
||||
/**
|
||||
@@ -101,7 +105,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
|
||||
* A allowed-word can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.KeywordPreset}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
allow_list?: string[];
|
||||
/**
|
||||
@@ -109,7 +113,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
|
||||
*
|
||||
* Only Rust flavored regex is currently supported (Maximum of 260 characters)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
regex_patterns?: string[];
|
||||
/**
|
||||
@@ -152,6 +156,10 @@ export enum AutoModerationRuleEventType {
|
||||
* When a member sends or edits a message in the guild
|
||||
*/
|
||||
MessageSend = 1,
|
||||
/**
|
||||
* When a member edits their profile
|
||||
*/
|
||||
MemberUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,6 +195,10 @@ export enum AutoModerationActionType {
|
||||
* Timeout user for specified duration, this action type can be set if the bot has `MODERATE_MEMBERS` permission
|
||||
*/
|
||||
Timeout,
|
||||
/**
|
||||
* Prevents a member from using text, voice, or other interactions
|
||||
*/
|
||||
BlockMemberInteraction,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,9 @@ import type { Permissions, Snowflake } from '../../globals';
|
||||
import type { APIApplication } from './application';
|
||||
import type { APIPartialEmoji } from './emoji';
|
||||
import type { APIGuildMember } from './guild';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction, APIMessageInteractionMetadata } from './interactions';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APIPoll } from './poll';
|
||||
import type { APISticker, APIStickerItem } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
|
||||
@@ -666,8 +667,16 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object
|
||||
*/
|
||||
referenced_message?: APIMessage | null;
|
||||
/**
|
||||
* Sent if the message is sent as a result of an interaction
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
interaction_metadata?: APIMessageInteractionMetadata;
|
||||
/**
|
||||
* Sent if the message is a response to an Interaction
|
||||
*
|
||||
* @deprecated In favor of `interaction_metadata`
|
||||
*/
|
||||
interaction?: APIMessageInteraction;
|
||||
/**
|
||||
@@ -715,6 +724,25 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
/**
|
||||
* A poll!
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
call?: APIMessageCall;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -757,6 +785,11 @@ export enum MessageType {
|
||||
StageRaiseHand,
|
||||
StageTopic,
|
||||
GuildApplicationPremiumSubscription,
|
||||
|
||||
GuildIncidentAlertModeEnabled = 36,
|
||||
GuildIncidentAlertModeDisabled,
|
||||
GuildIncidentReportRaid,
|
||||
GuildIncidentReportFalseAlarm,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -781,6 +814,10 @@ export interface APIMessageActivity {
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
/**
|
||||
* Type of reference
|
||||
*/
|
||||
type?: MessageReferenceType;
|
||||
/**
|
||||
* ID of the originating message
|
||||
*/
|
||||
@@ -805,6 +842,20 @@ export enum MessageActivityType {
|
||||
JoinRequest = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-types
|
||||
*/
|
||||
export enum MessageReferenceType {
|
||||
/**
|
||||
* A standard reference used by replies
|
||||
*/
|
||||
Default = 0,
|
||||
/**
|
||||
* Reference used to point to a message at a point in time
|
||||
*/
|
||||
Forward = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
@@ -859,6 +910,20 @@ export enum MessageFlags {
|
||||
IsVoiceMessage = 1 << 13,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-call-object-message-call-object-structure
|
||||
*/
|
||||
export interface APIMessageCall {
|
||||
/**
|
||||
* Array of user ids that participated in the call
|
||||
*/
|
||||
participants: Snowflake[];
|
||||
/**
|
||||
* ISO8601 timestamp when the call ended
|
||||
*/
|
||||
ended_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#role-subscription-data-object-role-subscription-data-object-structure
|
||||
*/
|
||||
@@ -1361,6 +1426,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* The title of the file
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
@@ -1609,7 +1678,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
url: string;
|
||||
}
|
||||
|
||||
export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
export type APIButtonComponent =
|
||||
| APIButtonComponentWithCustomId
|
||||
| APIButtonComponentWithSKUId
|
||||
| APIButtonComponentWithURL;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
|
||||
@@ -1620,6 +1700,7 @@ export enum ButtonStyle {
|
||||
Success,
|
||||
Danger,
|
||||
Link,
|
||||
Premium,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1825,6 +1906,20 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-snapshot-object
|
||||
*/
|
||||
export interface APIMessageSnapshot {
|
||||
/**
|
||||
* Subset of the message object fields
|
||||
*/
|
||||
message: APIMessageSnapshotFields;
|
||||
/**
|
||||
* Id of the origin message's guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
@@ -1883,3 +1978,16 @@ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuCom
|
||||
|
||||
// Modal components
|
||||
export type APIModalActionRowComponent = APITextInputComponent;
|
||||
|
||||
export type APIMessageSnapshotFields = Pick<
|
||||
APIMessage,
|
||||
| 'attachments'
|
||||
| 'content'
|
||||
| 'edited_timestamp'
|
||||
| 'embeds'
|
||||
| 'flags'
|
||||
| 'mention_roles'
|
||||
| 'mentions'
|
||||
| 'timestamp'
|
||||
| 'type'
|
||||
>;
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { PresenceUpdateReceiveStatus } from './gateway';
|
||||
import type { OAuth2Scopes } from './oauth2';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APISticker } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
import type { APIAvatarDecorationData, APIUser } from './user';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -621,7 +621,7 @@ export interface APIGuildMember {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
user?: APIUser;
|
||||
user: APIUser;
|
||||
/**
|
||||
* This users guild nickname
|
||||
*/
|
||||
@@ -668,6 +668,12 @@ export interface APIGuildMember {
|
||||
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
|
||||
*/
|
||||
communication_disabled_until?: string | null;
|
||||
/**
|
||||
* The data for the member's guild avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -10,6 +10,7 @@ export * from './guildScheduledEvent';
|
||||
export * from './interactions';
|
||||
export * from './invite';
|
||||
export * from './oauth2';
|
||||
export * from './poll';
|
||||
export * from './permissions';
|
||||
export * from './stageInstance';
|
||||
export * from './sticker';
|
||||
|
||||
@@ -90,6 +90,19 @@ export interface APIInvite {
|
||||
* The guild scheduled event data, returned from the `GET /invites/<code>` endpoint when `guild_scheduled_event_id` is a valid guild scheduled event id
|
||||
*/
|
||||
guild_scheduled_event?: APIGuildScheduledEvent;
|
||||
/**
|
||||
* The invite type
|
||||
*/
|
||||
type: InviteType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object-invite-types
|
||||
*/
|
||||
export enum InviteType {
|
||||
Guild,
|
||||
GroupDM,
|
||||
Friend,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -40,16 +40,48 @@ export interface APIEntitlement {
|
||||
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
|
||||
*/
|
||||
ends_at?: string;
|
||||
/**
|
||||
* For consumable items, whether or not the entitlement has been consumed
|
||||
*/
|
||||
consumed?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
|
||||
*/
|
||||
export enum EntitlementType {
|
||||
/**
|
||||
* Entitlement was purchased by user
|
||||
*/
|
||||
Purchase = 1,
|
||||
/**
|
||||
* Entitlement for Discord Nitro subscription
|
||||
*/
|
||||
PremiumSubscription,
|
||||
/**
|
||||
* Entitlement was gifted by developer
|
||||
*/
|
||||
DeveloperGift,
|
||||
/**
|
||||
* Entitlement was purchased by a dev in application test mode
|
||||
*/
|
||||
TestModePurchase,
|
||||
/**
|
||||
* Entitlement was granted when the SKU was free
|
||||
*/
|
||||
FreePurchase,
|
||||
/**
|
||||
* Entitlement was gifted by another user
|
||||
*/
|
||||
UserGift,
|
||||
/**
|
||||
* Entitlement was claimed by user for free as a Nitro Subscriber
|
||||
*/
|
||||
PremiumPurchase,
|
||||
/**
|
||||
* Entitlement was purchased as an app subscription
|
||||
*/
|
||||
ApplicationSubscription = 8,
|
||||
ApplicationSubscription,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,6 +136,14 @@ export enum SKUFlags {
|
||||
}
|
||||
|
||||
export enum SKUType {
|
||||
/**
|
||||
* Durable one-time purchase
|
||||
*/
|
||||
Durable = 2,
|
||||
/**
|
||||
* Consumable one-time purchase
|
||||
*/
|
||||
Consumable = 3,
|
||||
/**
|
||||
* Represents a recurring subscription
|
||||
*/
|
||||
|
||||
111
payloads/v10/poll.ts
Normal file
111
payloads/v10/poll.ts
Normal file
@@ -0,0 +1,111 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/poll
|
||||
*/
|
||||
|
||||
import type { APIPartialEmoji } from './emoji';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-object-poll-object-structure
|
||||
*/
|
||||
export interface APIPoll {
|
||||
/**
|
||||
* The question of the poll
|
||||
*/
|
||||
question: APIPollMedia;
|
||||
/**
|
||||
* Each of the answers available in the poll, up to 10
|
||||
*/
|
||||
answers: APIPollAnswer[];
|
||||
/**
|
||||
* The time when the poll ends (IS08601 timestamp)
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* The results of the poll
|
||||
*/
|
||||
results?: APIPollResults;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#layout-type
|
||||
*/
|
||||
export enum PollLayoutType {
|
||||
/**
|
||||
* The, uhm, default layout type
|
||||
*/
|
||||
Default = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-media-object-poll-media-object-structure
|
||||
*/
|
||||
export interface APIPollMedia {
|
||||
/**
|
||||
* The text of the field
|
||||
*
|
||||
* The maximum length is `300` for the question, and `55` for any answer
|
||||
*/
|
||||
text?: string;
|
||||
/**
|
||||
* The emoji of the field
|
||||
*/
|
||||
emoji?: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-answer-object-poll-answer-object-structure
|
||||
*/
|
||||
export interface APIPollAnswer {
|
||||
/**
|
||||
* The ID of the answer. Starts at `1` for the first answer and goes up sequentially
|
||||
*/
|
||||
answer_id: number;
|
||||
/**
|
||||
* The data of the answer
|
||||
*/
|
||||
poll_media: APIPollMedia;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-results-object-structure
|
||||
*/
|
||||
export interface APIPollResults {
|
||||
/**
|
||||
* Whether the votes have been precisely counted
|
||||
*/
|
||||
is_finalized: boolean;
|
||||
/**
|
||||
* The counts for each answer
|
||||
*/
|
||||
answer_counts: APIPollAnswerCount[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/poll#poll-results-object-poll-answer-count-object-structure
|
||||
*/
|
||||
export interface APIPollAnswerCount {
|
||||
/**
|
||||
* The `answer_id`
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* The number of votes for this answer
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* Whether the current user voted for this answer
|
||||
*/
|
||||
me_voted: boolean;
|
||||
}
|
||||
@@ -87,8 +87,16 @@ export interface APIUser {
|
||||
* The user's avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*
|
||||
* @deprecated Use `avatar_decoration_data` instead
|
||||
*/
|
||||
avatar_decoration?: string | null;
|
||||
/**
|
||||
* The data for the user's avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -267,6 +275,7 @@ export interface APIConnection {
|
||||
export enum ConnectionService {
|
||||
BattleNet = 'battlenet',
|
||||
BungieNet = 'bungie',
|
||||
Domain = 'domain',
|
||||
eBay = 'ebay',
|
||||
EpicGames = 'epicgames',
|
||||
Facebook = 'facebook',
|
||||
@@ -277,6 +286,7 @@ export enum ConnectionService {
|
||||
PlayStationNetwork = 'playstation',
|
||||
Reddit = 'reddit',
|
||||
RiotGames = 'riotgames',
|
||||
Roblox = 'roblox',
|
||||
Spotify = 'spotify',
|
||||
Skype = 'skype',
|
||||
Steam = 'steam',
|
||||
@@ -319,3 +329,19 @@ export interface APIApplicationRoleConnection {
|
||||
*/
|
||||
metadata: Record<string, number | string>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
export interface APIAvatarDecorationData {
|
||||
/**
|
||||
* The avatar decoration hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
asset: string;
|
||||
/**
|
||||
* The id of the avatar decoration's SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
|
||||
@@ -74,6 +74,8 @@ export interface APIApplicationCommand {
|
||||
default_member_permissions: Permissions | null;
|
||||
/**
|
||||
* Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible
|
||||
*
|
||||
* @deprecated Use `contexts` instead
|
||||
*/
|
||||
dm_permission?: boolean;
|
||||
/**
|
||||
@@ -88,6 +90,18 @@ export interface APIApplicationCommand {
|
||||
* Indicates whether the command is age-restricted, defaults to `false`
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
@@ -103,6 +117,38 @@ export enum ApplicationCommandType {
|
||||
Message,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-integration-types
|
||||
*/
|
||||
export enum ApplicationIntegrationType {
|
||||
/**
|
||||
* App is installable to servers
|
||||
*/
|
||||
GuildInstall = 0,
|
||||
/**
|
||||
* App is installable to users
|
||||
*/
|
||||
UserInstall = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types
|
||||
*/
|
||||
export enum InteractionContextType {
|
||||
/**
|
||||
* Interaction can be used within servers
|
||||
*/
|
||||
Guild = 0,
|
||||
/**
|
||||
* Interaction can be used within DMs with the app's bot user
|
||||
*/
|
||||
BotDM = 1,
|
||||
/**
|
||||
* Interaction can be used within Group DMs and DMs other than the app's bot user
|
||||
*/
|
||||
PrivateChannel = 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals';
|
||||
import type { APIRole, LocaleString } from '../../../v9';
|
||||
import type { APIRole, ApplicationIntegrationType, InteractionContextType, LocaleString } from '../../../v9';
|
||||
import type {
|
||||
APIAttachment,
|
||||
APIChannel,
|
||||
@@ -14,6 +14,40 @@ import type { APIEntitlement } from '../monetization';
|
||||
import type { APIUser } from '../user';
|
||||
import type { InteractionType } from './responses';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object
|
||||
*/
|
||||
export interface APIMessageInteractionMetadata {
|
||||
/**
|
||||
* ID of the interaction
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Type of interaction
|
||||
*/
|
||||
type: InteractionType;
|
||||
/**
|
||||
* User who triggered the interaction
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* ID of the original response message, present only on follow-up messages
|
||||
*/
|
||||
original_response_message_id?: Snowflake;
|
||||
/**
|
||||
* ID of the message that contained interactive component, present only on messages created from component interactions
|
||||
*/
|
||||
interacted_message_id?: Snowflake;
|
||||
/**
|
||||
* Metadata for the interaction that was used to open the modal, present only on modal submit interactions
|
||||
*/
|
||||
triggering_interaction_metadata?: APIMessageInteractionMetadata;
|
||||
}
|
||||
|
||||
export type PartialAPIMessageInteractionGuildMember = Pick<
|
||||
APIGuildMember,
|
||||
| 'avatar'
|
||||
@@ -122,7 +156,7 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
/**
|
||||
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
|
||||
*/
|
||||
app_permissions?: Permissions;
|
||||
app_permissions: Permissions;
|
||||
/**
|
||||
* The selected language of the invoking user
|
||||
*/
|
||||
@@ -135,8 +169,20 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
|
||||
*/
|
||||
entitlements: APIEntitlement[];
|
||||
/**
|
||||
* Mapping of installation contexts that the interaction was authorized for to related user or guild IDs.
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* Context where the interaction was triggered from
|
||||
*/
|
||||
context?: InteractionContextType;
|
||||
}
|
||||
|
||||
export type APIAuthorizingIntegrationOwnersMap = {
|
||||
[key in ApplicationIntegrationType]?: Snowflake;
|
||||
};
|
||||
|
||||
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'guild_id' | 'member'
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
import type { Permissions, Snowflake } from '../../globals';
|
||||
import type { LocalizationMap } from '../common';
|
||||
import type { APIPartialGuild } from './guild';
|
||||
import type { ApplicationIntegrationType } from './interactions';
|
||||
import type { OAuth2Scopes } from './oauth2';
|
||||
import type { APITeam } from './teams';
|
||||
import type { APIUser } from './user';
|
||||
@@ -107,6 +108,10 @@ export interface APIApplication {
|
||||
* Approximate count of guilds the application has been added to
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* Approximate count of users that have installed the app
|
||||
*/
|
||||
approximate_user_install_count?: number;
|
||||
/**
|
||||
* Array of redirect URIs for the application
|
||||
*/
|
||||
@@ -128,6 +133,12 @@ export interface APIApplication {
|
||||
* Settings for the application's default in-app authorization link, if enabled
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
@@ -139,6 +150,14 @@ export interface APIApplicationInstallParams {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
export interface APIApplicationIntegrationTypeConfiguration {
|
||||
oauth2_install_params?: APIApplicationInstallParams;
|
||||
}
|
||||
|
||||
export type APIApplicationIntegrationTypesConfigMap = {
|
||||
[key in ApplicationIntegrationType]?: APIApplicationIntegrationTypeConfiguration;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
|
||||
@@ -10,7 +10,7 @@ import type {
|
||||
AutoModerationRuleEventType,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from './autoModeration';
|
||||
import type { APIChannel, APIOverwrite } from './channel';
|
||||
import type { APIChannel, APIGuildForumDefaultReactionEmoji, APIGuildForumTag, APIOverwrite } from './channel';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
APIGuildIntegrationType,
|
||||
@@ -205,6 +205,15 @@ export enum AuditLogEvent {
|
||||
|
||||
CreatorMonetizationRequestCreated = 150,
|
||||
CreatorMonetizationTermsAccepted,
|
||||
|
||||
OnboardingPromptCreate = 163,
|
||||
OnboardingPromptUpdate,
|
||||
OnboardingPromptDelete,
|
||||
OnboardingCreate,
|
||||
OnboardingUpdate,
|
||||
|
||||
HomeSettingsCreate = 190,
|
||||
HomeSettingsUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -347,6 +356,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyAvailableTags
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
@@ -357,6 +367,8 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDefaultReactionEmoji
|
||||
| APIAuditLogChangeKeyDefaultThreadRateLimitPerUser
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
@@ -369,6 +381,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFlags
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyHoist
|
||||
@@ -523,12 +536,12 @@ export type APIAuditLogChangeKeyVanityURLCode = AuditLogChangeData<'vanity_url_c
|
||||
/**
|
||||
* Returned when new role(s) are added
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Add = AuditLogChangeData<'$add', APIRole[]>;
|
||||
export type APIAuditLogChangeKey$Add = AuditLogChangeData<'$add', Pick<APIRole, 'id' | 'name'>[]>;
|
||||
|
||||
/**
|
||||
* Returned when role(s) are removed
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Remove = AuditLogChangeData<'$remove', APIRole[]>;
|
||||
export type APIAuditLogChangeKey$Remove = AuditLogChangeData<'$remove', Pick<APIRole, 'id' | 'name'>[]>;
|
||||
|
||||
/**
|
||||
* Returned when there is a change in number of days after which inactive and role-unassigned members are kicked
|
||||
@@ -826,6 +839,33 @@ export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles',
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's available tags gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvailableTags = AuditLogChangeData<'available_tags', APIGuildForumTag[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's default reaction emoji gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultReactionEmoji = AuditLogChangeData<
|
||||
'default_reaction_emoji',
|
||||
APIGuildForumDefaultReactionEmoji
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a channel flag gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyFlags = AuditLogChangeData<'flags', number>;
|
||||
|
||||
/**
|
||||
* Returned when a thread's amount of seconds a user has to wait before creating another thread
|
||||
* gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultThreadRateLimitPerUser = AuditLogChangeData<
|
||||
'default_thread_rate_limit_per_user',
|
||||
number
|
||||
>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -74,6 +74,10 @@ export enum AutoModerationRuleTriggerType {
|
||||
* Check if content contains more mentions than allowed (Maximum of 1 per guild)
|
||||
*/
|
||||
MentionSpam,
|
||||
/**
|
||||
* Check if member profile contains words from a user defined list of keywords (Maximum of 1 per guild)
|
||||
*/
|
||||
MemberProfile,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,7 +90,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
|
||||
* A keyword can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
keyword_filter?: string[];
|
||||
/**
|
||||
@@ -101,7 +105,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
|
||||
* A allowed-word can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.KeywordPreset}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
allow_list?: string[];
|
||||
/**
|
||||
@@ -109,7 +113,7 @@ export interface APIAutoModerationRuleTriggerMetadata {
|
||||
*
|
||||
* Only Rust flavored regex is currently supported (Maximum of 260 characters)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
regex_patterns?: string[];
|
||||
/**
|
||||
@@ -152,6 +156,10 @@ export enum AutoModerationRuleEventType {
|
||||
* When a member sends or edits a message in the guild
|
||||
*/
|
||||
MessageSend = 1,
|
||||
/**
|
||||
* When a member edits their profile
|
||||
*/
|
||||
MemberUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -187,6 +195,10 @@ export enum AutoModerationActionType {
|
||||
* Timeout user for specified duration, this action type can be set if the bot has `MODERATE_MEMBERS` permission
|
||||
*/
|
||||
Timeout,
|
||||
/**
|
||||
* Prevents a member from using text, voice, or other interactions
|
||||
*/
|
||||
BlockMemberInteraction,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,8 +6,9 @@ import type { Permissions, Snowflake } from '../../globals';
|
||||
import type { APIApplication } from './application';
|
||||
import type { APIPartialEmoji } from './emoji';
|
||||
import type { APIGuildMember } from './guild';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction, APIMessageInteractionMetadata } from './interactions';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APIPoll } from './poll';
|
||||
import type { APISticker, APIStickerItem } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
|
||||
@@ -658,6 +659,12 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object
|
||||
*/
|
||||
referenced_message?: APIMessage | null;
|
||||
/**
|
||||
* Sent if the message is sent as a result of an interaction
|
||||
*
|
||||
* @unstable
|
||||
*/
|
||||
interaction_metadata?: APIMessageInteractionMetadata;
|
||||
/**
|
||||
* Sent if the message is a response to an Interaction
|
||||
*/
|
||||
@@ -702,6 +709,25 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
/**
|
||||
* A poll!
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
call?: APIMessageCall;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -744,6 +770,11 @@ export enum MessageType {
|
||||
StageRaiseHand,
|
||||
StageTopic,
|
||||
GuildApplicationPremiumSubscription,
|
||||
|
||||
GuildIncidentAlertModeEnabled = 36,
|
||||
GuildIncidentAlertModeDisabled,
|
||||
GuildIncidentReportRaid,
|
||||
GuildIncidentReportFalseAlarm,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -768,6 +799,10 @@ export interface APIMessageActivity {
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
/**
|
||||
* Type of reference
|
||||
*/
|
||||
type?: MessageReferenceType;
|
||||
/**
|
||||
* ID of the originating message
|
||||
*/
|
||||
@@ -792,6 +827,20 @@ export enum MessageActivityType {
|
||||
JoinRequest = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-types
|
||||
*/
|
||||
export enum MessageReferenceType {
|
||||
/**
|
||||
* A standard reference used by replies
|
||||
*/
|
||||
Default = 0,
|
||||
/**
|
||||
* Reference used to point to a message at a point in time
|
||||
*/
|
||||
Forward = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
@@ -846,6 +895,20 @@ export enum MessageFlags {
|
||||
IsVoiceMessage = 1 << 13,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-call-object-message-call-object-structure
|
||||
*/
|
||||
export interface APIMessageCall {
|
||||
/**
|
||||
* Array of user ids that participated in the call
|
||||
*/
|
||||
participants: Snowflake[];
|
||||
/**
|
||||
* ISO8601 timestamp when the call ended
|
||||
*/
|
||||
ended_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#followed-channel-object
|
||||
*/
|
||||
@@ -1330,6 +1393,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* The title of the file
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
@@ -1578,7 +1645,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
url: string;
|
||||
}
|
||||
|
||||
export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
export type APIButtonComponent =
|
||||
| APIButtonComponentWithCustomId
|
||||
| APIButtonComponentWithSKUId
|
||||
| APIButtonComponentWithURL;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
|
||||
@@ -1589,6 +1667,7 @@ export enum ButtonStyle {
|
||||
Success,
|
||||
Danger,
|
||||
Link,
|
||||
Premium,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1794,6 +1873,20 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-snapshot-object
|
||||
*/
|
||||
export interface APIMessageSnapshot {
|
||||
/**
|
||||
* Subset of the message object fields
|
||||
*/
|
||||
message: APIMessageSnapshotFields;
|
||||
/**
|
||||
* Id of the origin message's guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
@@ -1852,3 +1945,16 @@ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuCom
|
||||
|
||||
// Modal components
|
||||
export type APIModalActionRowComponent = APITextInputComponent;
|
||||
|
||||
export type APIMessageSnapshotFields = Pick<
|
||||
APIMessage,
|
||||
| 'attachments'
|
||||
| 'content'
|
||||
| 'edited_timestamp'
|
||||
| 'embeds'
|
||||
| 'flags'
|
||||
| 'mention_roles'
|
||||
| 'mentions'
|
||||
| 'timestamp'
|
||||
| 'type'
|
||||
>;
|
||||
|
||||
@@ -8,7 +8,7 @@ import type { PresenceUpdateReceiveStatus } from './gateway';
|
||||
import type { OAuth2Scopes } from './oauth2';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APISticker } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
import type { APIAvatarDecorationData, APIUser } from './user';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -613,7 +613,7 @@ export interface APIGuildMember {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
user?: APIUser;
|
||||
user: APIUser;
|
||||
/**
|
||||
* This users guild nickname
|
||||
*/
|
||||
@@ -660,6 +660,12 @@ export interface APIGuildMember {
|
||||
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
|
||||
*/
|
||||
communication_disabled_until?: string | null;
|
||||
/**
|
||||
* The data for the member's guild avatar decoration
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#avatar-decoration-data-object
|
||||
*/
|
||||
avatar_decoration_data?: APIAvatarDecorationData | null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -10,6 +10,7 @@ export * from './guildScheduledEvent';
|
||||
export * from './interactions';
|
||||
export * from './invite';
|
||||
export * from './oauth2';
|
||||
export * from './poll';
|
||||
export * from './permissions';
|
||||
export * from './stageInstance';
|
||||
export * from './sticker';
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user