mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-22 11:20:10 +00:00
Compare commits
215 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
557c534b67 | ||
|
|
8054f50230 | ||
|
|
74d80b1e77 | ||
|
|
a9c6985d63 | ||
|
|
4b64f84ddf | ||
|
|
2803e8df2f | ||
|
|
58848bed54 | ||
|
|
f019f0fe97 | ||
|
|
e09ded64b3 | ||
|
|
3aee5c4a0d | ||
|
|
3455ed4cce | ||
|
|
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 | ||
|
|
77f5dde20e | ||
|
|
e2b3eb5654 | ||
|
|
46cc9ae288 | ||
|
|
5934e43d01 | ||
|
|
5ae3514498 | ||
|
|
0322478a21 | ||
|
|
33d3806d89 | ||
|
|
aa5f15ed7d | ||
|
|
22b5f47787 | ||
|
|
ddf0a7bdba | ||
|
|
e70fa70526 | ||
|
|
90c70c01bd | ||
|
|
3442d5657a | ||
|
|
43803d6c52 | ||
|
|
0c3383558d | ||
|
|
e030fe2ab7 | ||
|
|
634df000c6 | ||
|
|
495148dc46 | ||
|
|
61ce329f61 | ||
|
|
7dcad582ce | ||
|
|
4db44b553d | ||
|
|
ccb7ef479c | ||
|
|
37b08a293f | ||
|
|
db89f0ef66 | ||
|
|
47c9ad0e70 | ||
|
|
eaaa8254b9 | ||
|
|
1d5646e5a0 | ||
|
|
b7ae342faa | ||
|
|
698282f4b0 | ||
|
|
19327a5d66 | ||
|
|
66958cb67e | ||
|
|
bd7e1e7b4f | ||
|
|
6ce581c0db | ||
|
|
7f22d4da37 | ||
|
|
d6d2fb69c9 | ||
|
|
dfc109f3f1 | ||
|
|
1377730766 | ||
|
|
22e6bafd39 | ||
|
|
5e175e1595 | ||
|
|
fcf14c3ea2 | ||
|
|
8640cdd360 | ||
|
|
1f83534ccb | ||
|
|
affc669a73 | ||
|
|
15fe19b39d | ||
|
|
c83a604076 | ||
|
|
6887b8fc46 | ||
|
|
f509930e00 | ||
|
|
597b7f7fb0 | ||
|
|
badf590103 | ||
|
|
d7d089e3cd | ||
|
|
36e8d3caed | ||
|
|
9fc46f8ecb | ||
|
|
930162c7a6 | ||
|
|
1cf1a57365 | ||
|
|
a39a5d9d41 | ||
|
|
a0e00ffaf7 | ||
|
|
45e2d17c65 | ||
|
|
8691b992e0 | ||
|
|
36d1b4ba50 | ||
|
|
de02125eec | ||
|
|
8acc356d27 | ||
|
|
803e5b31b9 | ||
|
|
c7e0e32aa5 | ||
|
|
5aec2d293e | ||
|
|
5e09570716 | ||
|
|
d98c991c35 | ||
|
|
2814d7e2f5 | ||
|
|
23f87a8ff2 | ||
|
|
1d39612329 | ||
|
|
ef31e116b6 | ||
|
|
abbd4b2e21 | ||
|
|
5e295706b8 | ||
|
|
803dcd7bdd | ||
|
|
62de95fd6f | ||
|
|
4f46175c3c | ||
|
|
150dc46b87 | ||
|
|
c008413a8a | ||
|
|
9564941b3a |
@@ -35,7 +35,10 @@ 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: {
|
||||
@@ -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: [] }],
|
||||
}),
|
||||
},
|
||||
};
|
||||
9
.eslint-plugin-local/tsconfig.json
Normal file
9
.eslint-plugin-local/tsconfig.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"declaration": false,
|
||||
"declarationMap": false,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["./index.ts"]
|
||||
}
|
||||
@@ -1 +1,12 @@
|
||||
deno/
|
||||
|
||||
gateway/v6/*
|
||||
payloads/v6/*
|
||||
rest/v6/*
|
||||
v6.ts
|
||||
|
||||
gateway/v8/*
|
||||
payloads/v8/*
|
||||
rest/v8/*
|
||||
utils/v8.ts
|
||||
v8.ts
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
{
|
||||
"compileOnSave": true,
|
||||
"compilerOptions": {
|
||||
"alwaysStrict": true,
|
||||
"lib": ["esnext"],
|
||||
"module": "commonjs",
|
||||
"noUnusedParameters": true,
|
||||
"sourceMap": true,
|
||||
"declaration": false,
|
||||
"noUnusedLocals": true,
|
||||
"removeComments": false,
|
||||
"target": "ES2020",
|
||||
"importsNotUsedAsValues": "error",
|
||||
"strictNullChecks": true,
|
||||
"preserveConstEnums": true,
|
||||
"exactOptionalPropertyTypes": true,
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["./index.ts"]
|
||||
}
|
||||
@@ -15,6 +15,56 @@
|
||||
"tsdoc/syntax": "off",
|
||||
"typescript-sort-keys/interface": "off",
|
||||
"typescript-sort-keys/string-enum": "off",
|
||||
"unicorn/prefer-math-trunc": "off"
|
||||
}
|
||||
"unicorn/prefer-math-trunc": "off",
|
||||
"jsdoc/no-undefined-types": "off"
|
||||
},
|
||||
"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"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
26
.github/CODE_OF_CONDUCT.md
vendored
26
.github/CODE_OF_CONDUCT.md
vendored
@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
- Using welcoming and inclusive language
|
||||
- Being respectful of differing viewpoints and experiences
|
||||
- Gracefully accepting constructive criticism
|
||||
- Focusing on what is best for the community
|
||||
- Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
- The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
- Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
- Public or private harassment
|
||||
- Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
- Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
|
||||
6
.github/COMMIT_CONVENTION.md
vendored
6
.github/COMMIT_CONVENTION.md
vendored
@@ -74,9 +74,9 @@ The scope could be anything specifying the place of the commit change. For examp
|
||||
|
||||
The subject contains a succinct description of the change:
|
||||
|
||||
- use the imperative, present tense: "change" not "changed" nor "changes"
|
||||
- don't capitalize the first letter
|
||||
- no dot (.) at the end
|
||||
- use the imperative, present tense: "change" not "changed" nor "changes"
|
||||
- don't capitalize the first letter
|
||||
- no dot (.) at the end
|
||||
|
||||
### Body
|
||||
|
||||
|
||||
44
.github/CONTRIBUTING.md
vendored
44
.github/CONTRIBUTING.md
vendored
@@ -2,39 +2,39 @@
|
||||
|
||||
**The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the [Discord server](https://discord.gg/djs) instead of opening an issue, or on [GitHub Discussions](https://github.com/discordjs/discord-api-types/discussions) – you will get redirected there anyway.**
|
||||
|
||||
- [Code of Conduct](https://github.com/discordjs/discord-api-types/blob/main/.github/CODE_OF_CONDUCT.md)
|
||||
- [Pull Request Guidelines](#pull-request-guidelines)
|
||||
- [Development Setup](#development-setup)
|
||||
- [Project Structure](#project-structure)
|
||||
- [Contributing Tests](#contributing-tests)
|
||||
- [Code of Conduct](https://github.com/discordjs/discord-api-types/blob/main/.github/CODE_OF_CONDUCT.md)
|
||||
- [Pull Request Guidelines](#pull-request-guidelines)
|
||||
- [Development Setup](#development-setup)
|
||||
- [Project Structure](#project-structure)
|
||||
- [Contributing Tests](#contributing-tests)
|
||||
|
||||
## Pull Request Guidelines
|
||||
|
||||
- Checkout a topic branch from a base branch, e.g. `main`, and merge back against that branch.
|
||||
- Checkout a topic branch from a base branch, e.g. `main`, and merge back against that branch.
|
||||
|
||||
- If adding a new feature:
|
||||
- If adding a new feature:
|
||||
|
||||
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it.
|
||||
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it.
|
||||
|
||||
- If fixing a bug:
|
||||
- If fixing a bug:
|
||||
|
||||
- If you are resolving a special issue, add `fix/close #xxxx[,#xxxx]` (#xxxx is the issue id) in your PR body for a better release log, e.g.
|
||||
- If you are resolving a special issue, add `fix/close #xxxx[,#xxxx]` (#xxxx is the issue id) in your PR body for a better release log, e.g.
|
||||
|
||||
```
|
||||
fix(Guild): handle events correctly
|
||||
```
|
||||
fix(Guild): handle events correctly
|
||||
|
||||
close #28
|
||||
```
|
||||
close #28
|
||||
```
|
||||
|
||||
- Provide a detailed description of the bug in the PR. Live demo preferred.
|
||||
- Provide a detailed description of the bug in the PR. Live demo preferred.
|
||||
|
||||
- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging.
|
||||
- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging.
|
||||
|
||||
- Make sure tests pass!
|
||||
- Make sure tests pass!
|
||||
|
||||
- Commit messages must follow the [commit message convention](./COMMIT_CONVENTION.md) so that changelogs can be automatically generated. Commit messages are automatically validated before commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)).
|
||||
- Commit messages must follow the [commit message convention](./COMMIT_CONVENTION.md) so that changelogs can be automatically generated. Commit messages are automatically validated before commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)).
|
||||
|
||||
- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)).
|
||||
- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)).
|
||||
|
||||
## Development Setup
|
||||
|
||||
@@ -48,6 +48,6 @@ $ npm i # install the dependencies of the project
|
||||
|
||||
A high level overview of tools used:
|
||||
|
||||
- [TypeScript](https://www.typescriptlang.org/) as the development language
|
||||
- [ESLint](https://eslint.org/) for code-style
|
||||
- [Prettier](https://prettier.io/) for code formatting
|
||||
- [TypeScript](https://www.typescriptlang.org/) as the development language
|
||||
- [ESLint](https://eslint.org/) for code-style
|
||||
- [Prettier](https://prettier.io/) for code formatting
|
||||
|
||||
87
.github/labeler.yml
vendored
87
.github/labeler.yml
vendored
@@ -1,58 +1,83 @@
|
||||
chore:
|
||||
- any: ['*']
|
||||
all:
|
||||
[
|
||||
'!deno/**/*',
|
||||
'!gateway/**/*',
|
||||
'!payloads/**/*',
|
||||
'!rest/**/*',
|
||||
'!rpc/**/*',
|
||||
'!tests/**/*',
|
||||
'!utils/**/*',
|
||||
'!voice/**/*',
|
||||
]
|
||||
- changed-files:
|
||||
- all-globs-to-any-file:
|
||||
- '*'
|
||||
- '!deno/**/*'
|
||||
- '!gateway/**/*'
|
||||
- '!payloads/**/*'
|
||||
- '!rest/**/*'
|
||||
- '!rpc/**/*'
|
||||
- '!tests/**/*'
|
||||
- '!utils/**/*'
|
||||
- '!voice/**/*'
|
||||
|
||||
ci:
|
||||
- .github/**/*
|
||||
- .husky/**/*
|
||||
- scripts/actions/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- .github/**/*
|
||||
- .husky/**/*
|
||||
- scripts/actions/**/*
|
||||
|
||||
dependencies:
|
||||
- package.json
|
||||
- package-lock.json
|
||||
- website/package.json
|
||||
- website/package-lock.json
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- package.json
|
||||
- package-lock.json
|
||||
- website/package.json
|
||||
- website/package-lock.json
|
||||
|
||||
'topic:deno':
|
||||
- scripts/deno.mjs
|
||||
- scripts/actions/report-deno-not-ran.mjs
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- scripts/deno.mjs
|
||||
- scripts/actions/report-deno-not-ran.mjs
|
||||
|
||||
'topic:gateway':
|
||||
- gateway/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- gateway/**/*
|
||||
|
||||
'topic:payloads':
|
||||
- payloads/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- payloads/**/*
|
||||
|
||||
'topic:rest':
|
||||
- rest/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- rest/**/*
|
||||
|
||||
'topic:rpc':
|
||||
- rpc/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- rpc/**/*
|
||||
|
||||
'topic:scripts':
|
||||
- scripts/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- scripts/**/*
|
||||
|
||||
'topic:tests':
|
||||
- tests/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- tests/**/*
|
||||
|
||||
'topic:utils':
|
||||
- utils/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- utils/**/*
|
||||
|
||||
'topic:voice':
|
||||
- voice/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- voice/**/*
|
||||
|
||||
'topic:globals':
|
||||
- globals.ts
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- globals.ts
|
||||
|
||||
'topic:website':
|
||||
- website/**/*
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- website/**/*
|
||||
|
||||
12
.github/workflows/check-deno.yml
vendored
12
.github/workflows/check-deno.yml
vendored
@@ -10,14 +10,18 @@ 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@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js v16
|
||||
uses: actions/setup-node@v2
|
||||
- name: Use Node.js v20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
|
||||
16
.github/workflows/cicd.yml
vendored
16
.github/workflows/cicd.yml
vendored
@@ -12,15 +12,15 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Add problem matcher
|
||||
run: echo "::add-matcher::.github/problemMatchers/eslint.json" && echo "::add-matcher::.github/problemMatchers/tsc.json"
|
||||
|
||||
- name: Use Node.js v16
|
||||
uses: actions/setup-node@v2
|
||||
- name: Use Node.js v20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
cache: npm
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
@@ -42,12 +42,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Use Node.js v16
|
||||
uses: actions/setup-node@v2
|
||||
- name: Use Node.js v20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
|
||||
@@ -17,14 +17,14 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node v16
|
||||
uses: actions/setup-node@v2
|
||||
- name: Install Node v20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- name: Install dependencies
|
||||
@@ -65,18 +65,22 @@ jobs:
|
||||
create_release:
|
||||
name: Create release and publish
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
|
||||
if: github.repository_owner == 'discordjs' && github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release)') && !contains(github.event.head_commit.message, '[skip ci]')
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node v16
|
||||
uses: actions/setup-node@v2
|
||||
- name: Install Node v20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- name: Install dependencies
|
||||
|
||||
4
.github/workflows/labelsync.yml
vendored
4
.github/workflows/labelsync.yml
vendored
@@ -14,9 +14,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Label sync
|
||||
uses: crazy-max/ghaction-github-labeler@v3
|
||||
uses: crazy-max/ghaction-github-labeler@v5
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
5
.github/workflows/pr-automation.yml
vendored
5
.github/workflows/pr-automation.yml
vendored
@@ -5,10 +5,13 @@ on:
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Automatically label PR
|
||||
uses: actions/labeler@v3
|
||||
uses: actions/labeler@v5
|
||||
with:
|
||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
sync-labels: true
|
||||
|
||||
26
.github/workflows/publish-next.yml
vendored
26
.github/workflows/publish-next.yml
vendored
@@ -8,28 +8,34 @@ on:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
concurrency:
|
||||
group: publish-next
|
||||
cancel-in-progress: true
|
||||
|
||||
name: Publish @next release to npm
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write
|
||||
if: github.repository_owner == 'discordjs' && !(github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release)'))
|
||||
steps:
|
||||
- name: Cancel previous publish attempts
|
||||
uses: styfle/cancel-workflow-action@0.9.1
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
# - name: Cancel previous publish attempts
|
||||
# uses: styfle/cancel-workflow-action@0.12.1
|
||||
# with:
|
||||
# access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node v16
|
||||
uses: actions/setup-node@v2
|
||||
- name: Install Node v20
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: 16
|
||||
node-version: 20
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts
|
||||
run: npm ci
|
||||
|
||||
- name: Bump version
|
||||
run: node ./scripts/bump-version.mjs
|
||||
@@ -42,6 +48,6 @@ jobs:
|
||||
- name: Publish new @next version
|
||||
run: |
|
||||
npm version $(jq --raw-output '.version' package.json)-next.$(git rev-parse --short HEAD).$(date +%s)
|
||||
npm publish --tag next || true
|
||||
npm publish --tag next
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
|
||||
6
.gitignore
vendored
6
.gitignore
vendored
@@ -1,9 +1,9 @@
|
||||
node_modules/
|
||||
|
||||
# Custom ESLint rules
|
||||
.eslintplugin/*
|
||||
!.eslintplugin/index.ts
|
||||
!.eslintplugin/tsconfig.json
|
||||
.eslint-plugin-local/*
|
||||
!.eslint-plugin-local/index.ts
|
||||
!.eslint-plugin-local/tsconfig.json
|
||||
|
||||
# Don't commit build outputs
|
||||
globals.js
|
||||
|
||||
1
.husky/.gitignore
vendored
1
.husky/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
_
|
||||
@@ -1,4 +1 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx --no-install commitlint --edit $1
|
||||
|
||||
@@ -1,4 +1 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx --no-install pretty-quick --staged && npx --no-install lint-staged && npm run build:deno && git add deno
|
||||
|
||||
@@ -18,3 +18,21 @@ website/build
|
||||
|
||||
# Miscellaneous
|
||||
CODEOWNERS
|
||||
renovate.json
|
||||
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
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"printWidth": 120,
|
||||
"useTabs": true,
|
||||
"singleQuote": true,
|
||||
"quoteProps": "as-needed",
|
||||
"trailingComma": "all",
|
||||
"endOfLine": "lf"
|
||||
}
|
||||
12
.prettierrc.mjs
Normal file
12
.prettierrc.mjs
Normal file
@@ -0,0 +1,12 @@
|
||||
import sapphirePrettierConfig from '@sapphire/prettier-config';
|
||||
|
||||
export default {
|
||||
...sapphirePrettierConfig,
|
||||
printWidth: 120,
|
||||
useTabs: true,
|
||||
singleQuote: true,
|
||||
quoteProps: 'as-needed',
|
||||
trailingComma: 'all',
|
||||
endOfLine: 'lf',
|
||||
experimentalTernaries: true,
|
||||
};
|
||||
271
CHANGELOG.md
271
CHANGELOG.md
@@ -1,3 +1,274 @@
|
||||
## [0.37.99](https://github.com/discordjs/discord-api-types/compare/0.37.98...0.37.99) (2024-09-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **GuildMemberFlags:** `IsGuest` and `DmSettingsUpsellAcknowledged` ([#1079](https://github.com/discordjs/discord-api-types/issues/1079)) ([2803e8d](https://github.com/discordjs/discord-api-types/commit/2803e8df2f2105099a1dc6e04193355a926718b9))
|
||||
* remove unstable from stable fields ([#1086](https://github.com/discordjs/discord-api-types/issues/1086)) ([4b64f84](https://github.com/discordjs/discord-api-types/commit/4b64f84ddf0390f0a8979f57623c5f8c9051484d))
|
||||
|
||||
|
||||
|
||||
## [0.37.98](https://github.com/discordjs/discord-api-types/compare/0.37.97...0.37.98) (2024-08-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **RESTAPIAttachment:** add more properties ([#1073](https://github.com/discordjs/discord-api-types/issues/1073)) ([f019f0f](https://github.com/discordjs/discord-api-types/commit/f019f0fe97ad47471dd6656e5fb148dc5761e1e0))
|
||||
|
||||
|
||||
|
||||
## [0.37.97](https://github.com/discordjs/discord-api-types/compare/0.37.96...0.37.97) (2024-08-22)
|
||||
|
||||
|
||||
|
||||
## [0.37.96](https://github.com/discordjs/discord-api-types/compare/0.37.95...0.37.96) (2024-08-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* nullable `recurrence_rule` on patch ([#1063](https://github.com/discordjs/discord-api-types/issues/1063)) ([19d2aeb](https://github.com/discordjs/discord-api-types/commit/19d2aeb4a82dc781558240a674c36eadce270abf))
|
||||
* nullable fields for scheduled event editing ([#1064](https://github.com/discordjs/discord-api-types/issues/1064)) ([f67043b](https://github.com/discordjs/discord-api-types/commit/f67043b3f46eea7286e959d223b78d140deac318))
|
||||
|
||||
|
||||
|
||||
## [0.37.95](https://github.com/discordjs/discord-api-types/compare/0.37.94...0.37.95) (2024-08-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* interface name ([#1059](https://github.com/discordjs/discord-api-types/issues/1059)) ([147e459](https://github.com/discordjs/discord-api-types/commit/147e459a16c8b0e15a0dd50f75d62c6dd9098815))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* recurring scheduled events ([#1058](https://github.com/discordjs/discord-api-types/issues/1058)) ([fbfbc6b](https://github.com/discordjs/discord-api-types/commit/fbfbc6b23f2696f6db5fad8ea1543327d5b3cf07))
|
||||
* **RESTJSONErrorCodes:** `UnknownStickerPack` ([#1055](https://github.com/discordjs/discord-api-types/issues/1055)) ([906dd8e](https://github.com/discordjs/discord-api-types/commit/906dd8e241be6acdf4d6d7b10ce4e7c139b0fd8b))
|
||||
* **Routes:** voice state endpoint ([#1046](https://github.com/discordjs/discord-api-types/issues/1046)) ([1b1a865](https://github.com/discordjs/discord-api-types/commit/1b1a865efe4d95b34055616ed18dc3613b58f317))
|
||||
|
||||
|
||||
|
||||
## [0.37.94](https://github.com/discordjs/discord-api-types/compare/0.37.93...0.37.94) (2024-08-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add Get Sticker Pack endpoint ([#1053](https://github.com/discordjs/discord-api-types/issues/1053)) ([822956f](https://github.com/discordjs/discord-api-types/commit/822956fe788f8eeda5da683189973bd6667cbc96))
|
||||
* **APIApplication:** `approximate_user_install_count` ([#1052](https://github.com/discordjs/discord-api-types/issues/1052)) ([d504763](https://github.com/discordjs/discord-api-types/commit/d5047639e691cc26e865cc6c06a312e09f0fb4c7))
|
||||
* **RESTOAuth2:** add RESTPostOAuth2TokenRevocationQuery ([#1050](https://github.com/discordjs/discord-api-types/issues/1050)) ([6ead98b](https://github.com/discordjs/discord-api-types/commit/6ead98b78218830fee308a0425d9078957a662b2))
|
||||
* **Routes:** get method on role endpoint ([#1051](https://github.com/discordjs/discord-api-types/issues/1051)) ([ea1a6c3](https://github.com/discordjs/discord-api-types/commit/ea1a6c3c86ec0d4c663e2191a488a3716ecdd7cc))
|
||||
|
||||
|
||||
|
||||
## [0.37.93](https://github.com/discordjs/discord-api-types/compare/0.37.92...0.37.93) (2024-07-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **CDNRoutes:** inconsistency in route and wrong JSDoc ([#1033](https://github.com/discordjs/discord-api-types/issues/1033)) ([eb7b3d9](https://github.com/discordjs/discord-api-types/commit/eb7b3d90dd6a847b80d051006a597e77d70caab2))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for message forwarding ([#971](https://github.com/discordjs/discord-api-types/issues/971)) ([2c1ff0e](https://github.com/discordjs/discord-api-types/commit/2c1ff0ea3443fb500315d6c69674a875a11addf6))
|
||||
* application emojis ([#1036](https://github.com/discordjs/discord-api-types/issues/1036)) ([5f22a6b](https://github.com/discordjs/discord-api-types/commit/5f22a6bacabef6b11e170a6f67694359bb3180e8))
|
||||
* **ConnectionService:** add `Roblox` ([#1032](https://github.com/discordjs/discord-api-types/issues/1032)) ([4f66b4d](https://github.com/discordjs/discord-api-types/commit/4f66b4dd049d2ace638374c09a06272bd517ad3a))
|
||||
* **RESTAPIPartialCurrentUserGuild:** add `banner` ([#1028](https://github.com/discordjs/discord-api-types/issues/1028)) ([da9496f](https://github.com/discordjs/discord-api-types/commit/da9496f291fff364b8d35b02363b93933c19823a))
|
||||
|
||||
|
||||
|
||||
## [0.37.92](https://github.com/discordjs/discord-api-types/compare/0.37.91...0.37.92) (2024-07-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **RESTAPIPollCreate:** optional properties ([#1022](https://github.com/discordjs/discord-api-types/issues/1022)) ([c05998d](https://github.com/discordjs/discord-api-types/commit/c05998de274ef7a8d570db9d23c9ad9c228eeccc))
|
||||
|
||||
|
||||
|
||||
## [0.37.91](https://github.com/discordjs/discord-api-types/compare/0.37.90...0.37.91) (2024-06-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIAttachment:** add `title` ([#1015](https://github.com/discordjs/discord-api-types/issues/1015)) ([897fd90](https://github.com/discordjs/discord-api-types/commit/897fd90bf2705d6ff5eebbb21fa8e735fc1e1e22))
|
||||
|
||||
|
||||
|
||||
## [0.37.90](https://github.com/discordjs/discord-api-types/compare/0.37.89...0.37.90) (2024-06-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add premium buttons ([#1010](https://github.com/discordjs/discord-api-types/issues/1010)) ([088dbe0](https://github.com/discordjs/discord-api-types/commit/088dbe016fdb72fb751931938bf7240c34fa64c0))
|
||||
|
||||
|
||||
|
||||
## [0.37.89](https://github.com/discordjs/discord-api-types/compare/0.37.88...0.37.89) (2024-06-13)
|
||||
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ConnectionService:** add bungie connection ([#907](https://github.com/discordjs/discord-api-types/issues/907)) ([22b5f47](https://github.com/discordjs/discord-api-types/commit/22b5f4778778baec7f414c4b253e96b0949de948))
|
||||
|
||||
|
||||
|
||||
## [0.37.78](https://github.com/discordjs/discord-api-types/compare/0.37.77...0.37.78) (2024-04-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* bot banners ([#906](https://github.com/discordjs/discord-api-types/issues/906)) ([495148d](https://github.com/discordjs/discord-api-types/commit/495148dc466fcc3cd47ff62377369a97a9cec13d))
|
||||
* **Guild:** add `RESTPostAPIGuildBulkBan` result and json body ([#910](https://github.com/discordjs/discord-api-types/issues/910)) ([61ce329](https://github.com/discordjs/discord-api-types/commit/61ce329f614d5bc923c3ab4d2b318aa2e66c767b))
|
||||
* **RESTJSONErrorCodes:** Add `500_000` ([#908](https://github.com/discordjs/discord-api-types/issues/908)) ([4db44b5](https://github.com/discordjs/discord-api-types/commit/4db44b553d7164415b9f20468716beb5223fcec0))
|
||||
* **Routes:** Add `guildBulkBan()` route ([#909](https://github.com/discordjs/discord-api-types/issues/909)) ([7dcad58](https://github.com/discordjs/discord-api-types/commit/7dcad582ce2fa16ac7bde35f5b158648c2c7c9bf))
|
||||
|
||||
|
||||
|
||||
## [0.37.77](https://github.com/discordjs/discord-api-types/compare/0.37.76...0.37.77) (2024-03-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIAuditLogChange:** add `APIAuditLogChangeKeySystemChannelFlags` ([#933](https://github.com/discordjs/discord-api-types/issues/933)) ([47c9ad0](https://github.com/discordjs/discord-api-types/commit/47c9ad0e7043c098d103107e95f8a97e67ad3eb4))
|
||||
|
||||
|
||||
|
||||
## [0.37.76](https://github.com/discordjs/discord-api-types/compare/0.37.75...0.37.76) (2024-03-21)
|
||||
|
||||
|
||||
|
||||
## [0.37.75](https://github.com/discordjs/discord-api-types/compare/0.37.74...0.37.75) (2024-03-18)
|
||||
|
||||
|
||||
|
||||
## [0.37.74](https://github.com/discordjs/discord-api-types/compare/0.37.73...0.37.74) (2024-03-14)
|
||||
|
||||
|
||||
|
||||
## [0.37.73](https://github.com/discordjs/discord-api-types/compare/0.37.71...0.37.73) (2024-03-07)
|
||||
|
||||
|
||||
|
||||
## [0.37.72](https://github.com/discordjs/discord-api-types/compare/0.37.71...0.37.72) (2024-03-07)
|
||||
|
||||
|
||||
|
||||
## [0.37.71](https://github.com/discordjs/discord-api-types/compare/0.37.70...0.37.71) (2024-02-26)
|
||||
|
||||
### Features
|
||||
|
||||
- add initial support for super reactions ([#744](https://github.com/discordjs/discord-api-types/issues/744)) ([150dc46](https://github.com/discordjs/discord-api-types/commit/150dc46b8739ca9cf10a46bb48d390f70c679b6e))
|
||||
|
||||
## [0.37.70](https://github.com/discordjs/discord-api-types/compare/0.37.69...0.37.70) (2024-02-15)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTPostAPIChannelMessageJSONBody:** add enforce_nonce ([#874](https://github.com/discordjs/discord-api-types/issues/874)) ([9564941](https://github.com/discordjs/discord-api-types/commit/9564941b3ae51c8bc9b1f915d66b43775089db18))
|
||||
|
||||
## [0.37.69](https://github.com/discordjs/discord-api-types/compare/0.37.68...0.37.69) (2024-02-08)
|
||||
|
||||
### Features
|
||||
|
||||
20
README.md
20
README.md
@@ -77,25 +77,25 @@ import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
|
||||
|
||||
The exports of each API version is split into three main parts:
|
||||
|
||||
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
|
||||
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
|
||||
|
||||
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
|
||||
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
|
||||
|
||||
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
|
||||
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
|
||||
|
||||
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
|
||||
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
|
||||
|
||||
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
|
||||
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
|
||||
|
||||
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
|
||||
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
|
||||
|
||||
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
|
||||
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
|
||||
|
||||
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
|
||||
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
|
||||
|
||||
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
|
||||
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
|
||||
|
||||
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
|
||||
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
|
||||
|
||||
**A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs),
|
||||
that are mentioned in an open pull request, or known through other means _and have received the green light to be used_.
|
||||
|
||||
@@ -1,3 +1,274 @@
|
||||
## [0.37.99](https://github.com/discordjs/discord-api-types/compare/0.37.98...0.37.99) (2024-09-02)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **GuildMemberFlags:** `IsGuest` and `DmSettingsUpsellAcknowledged` ([#1079](https://github.com/discordjs/discord-api-types/issues/1079)) ([2803e8d](https://github.com/discordjs/discord-api-types/commit/2803e8df2f2105099a1dc6e04193355a926718b9))
|
||||
* remove unstable from stable fields ([#1086](https://github.com/discordjs/discord-api-types/issues/1086)) ([4b64f84](https://github.com/discordjs/discord-api-types/commit/4b64f84ddf0390f0a8979f57623c5f8c9051484d))
|
||||
|
||||
|
||||
|
||||
## [0.37.98](https://github.com/discordjs/discord-api-types/compare/0.37.97...0.37.98) (2024-08-26)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **RESTAPIAttachment:** add more properties ([#1073](https://github.com/discordjs/discord-api-types/issues/1073)) ([f019f0f](https://github.com/discordjs/discord-api-types/commit/f019f0fe97ad47471dd6656e5fb148dc5761e1e0))
|
||||
|
||||
|
||||
|
||||
## [0.37.97](https://github.com/discordjs/discord-api-types/compare/0.37.96...0.37.97) (2024-08-22)
|
||||
|
||||
|
||||
|
||||
## [0.37.96](https://github.com/discordjs/discord-api-types/compare/0.37.95...0.37.96) (2024-08-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* nullable `recurrence_rule` on patch ([#1063](https://github.com/discordjs/discord-api-types/issues/1063)) ([19d2aeb](https://github.com/discordjs/discord-api-types/commit/19d2aeb4a82dc781558240a674c36eadce270abf))
|
||||
* nullable fields for scheduled event editing ([#1064](https://github.com/discordjs/discord-api-types/issues/1064)) ([f67043b](https://github.com/discordjs/discord-api-types/commit/f67043b3f46eea7286e959d223b78d140deac318))
|
||||
|
||||
|
||||
|
||||
## [0.37.95](https://github.com/discordjs/discord-api-types/compare/0.37.94...0.37.95) (2024-08-19)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* interface name ([#1059](https://github.com/discordjs/discord-api-types/issues/1059)) ([147e459](https://github.com/discordjs/discord-api-types/commit/147e459a16c8b0e15a0dd50f75d62c6dd9098815))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* recurring scheduled events ([#1058](https://github.com/discordjs/discord-api-types/issues/1058)) ([fbfbc6b](https://github.com/discordjs/discord-api-types/commit/fbfbc6b23f2696f6db5fad8ea1543327d5b3cf07))
|
||||
* **RESTJSONErrorCodes:** `UnknownStickerPack` ([#1055](https://github.com/discordjs/discord-api-types/issues/1055)) ([906dd8e](https://github.com/discordjs/discord-api-types/commit/906dd8e241be6acdf4d6d7b10ce4e7c139b0fd8b))
|
||||
* **Routes:** voice state endpoint ([#1046](https://github.com/discordjs/discord-api-types/issues/1046)) ([1b1a865](https://github.com/discordjs/discord-api-types/commit/1b1a865efe4d95b34055616ed18dc3613b58f317))
|
||||
|
||||
|
||||
|
||||
## [0.37.94](https://github.com/discordjs/discord-api-types/compare/0.37.93...0.37.94) (2024-08-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add Get Sticker Pack endpoint ([#1053](https://github.com/discordjs/discord-api-types/issues/1053)) ([822956f](https://github.com/discordjs/discord-api-types/commit/822956fe788f8eeda5da683189973bd6667cbc96))
|
||||
* **APIApplication:** `approximate_user_install_count` ([#1052](https://github.com/discordjs/discord-api-types/issues/1052)) ([d504763](https://github.com/discordjs/discord-api-types/commit/d5047639e691cc26e865cc6c06a312e09f0fb4c7))
|
||||
* **RESTOAuth2:** add RESTPostOAuth2TokenRevocationQuery ([#1050](https://github.com/discordjs/discord-api-types/issues/1050)) ([6ead98b](https://github.com/discordjs/discord-api-types/commit/6ead98b78218830fee308a0425d9078957a662b2))
|
||||
* **Routes:** get method on role endpoint ([#1051](https://github.com/discordjs/discord-api-types/issues/1051)) ([ea1a6c3](https://github.com/discordjs/discord-api-types/commit/ea1a6c3c86ec0d4c663e2191a488a3716ecdd7cc))
|
||||
|
||||
|
||||
|
||||
## [0.37.93](https://github.com/discordjs/discord-api-types/compare/0.37.92...0.37.93) (2024-07-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **CDNRoutes:** inconsistency in route and wrong JSDoc ([#1033](https://github.com/discordjs/discord-api-types/issues/1033)) ([eb7b3d9](https://github.com/discordjs/discord-api-types/commit/eb7b3d90dd6a847b80d051006a597e77d70caab2))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add support for message forwarding ([#971](https://github.com/discordjs/discord-api-types/issues/971)) ([2c1ff0e](https://github.com/discordjs/discord-api-types/commit/2c1ff0ea3443fb500315d6c69674a875a11addf6))
|
||||
* application emojis ([#1036](https://github.com/discordjs/discord-api-types/issues/1036)) ([5f22a6b](https://github.com/discordjs/discord-api-types/commit/5f22a6bacabef6b11e170a6f67694359bb3180e8))
|
||||
* **ConnectionService:** add `Roblox` ([#1032](https://github.com/discordjs/discord-api-types/issues/1032)) ([4f66b4d](https://github.com/discordjs/discord-api-types/commit/4f66b4dd049d2ace638374c09a06272bd517ad3a))
|
||||
* **RESTAPIPartialCurrentUserGuild:** add `banner` ([#1028](https://github.com/discordjs/discord-api-types/issues/1028)) ([da9496f](https://github.com/discordjs/discord-api-types/commit/da9496f291fff364b8d35b02363b93933c19823a))
|
||||
|
||||
|
||||
|
||||
## [0.37.92](https://github.com/discordjs/discord-api-types/compare/0.37.91...0.37.92) (2024-07-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **RESTAPIPollCreate:** optional properties ([#1022](https://github.com/discordjs/discord-api-types/issues/1022)) ([c05998d](https://github.com/discordjs/discord-api-types/commit/c05998de274ef7a8d570db9d23c9ad9c228eeccc))
|
||||
|
||||
|
||||
|
||||
## [0.37.91](https://github.com/discordjs/discord-api-types/compare/0.37.90...0.37.91) (2024-06-27)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIAttachment:** add `title` ([#1015](https://github.com/discordjs/discord-api-types/issues/1015)) ([897fd90](https://github.com/discordjs/discord-api-types/commit/897fd90bf2705d6ff5eebbb21fa8e735fc1e1e22))
|
||||
|
||||
|
||||
|
||||
## [0.37.90](https://github.com/discordjs/discord-api-types/compare/0.37.89...0.37.90) (2024-06-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add premium buttons ([#1010](https://github.com/discordjs/discord-api-types/issues/1010)) ([088dbe0](https://github.com/discordjs/discord-api-types/commit/088dbe016fdb72fb751931938bf7240c34fa64c0))
|
||||
|
||||
|
||||
|
||||
## [0.37.89](https://github.com/discordjs/discord-api-types/compare/0.37.88...0.37.89) (2024-06-13)
|
||||
|
||||
|
||||
### 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)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **ConnectionService:** add bungie connection ([#907](https://github.com/discordjs/discord-api-types/issues/907)) ([22b5f47](https://github.com/discordjs/discord-api-types/commit/22b5f4778778baec7f414c4b253e96b0949de948))
|
||||
|
||||
|
||||
|
||||
## [0.37.78](https://github.com/discordjs/discord-api-types/compare/0.37.77...0.37.78) (2024-04-01)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* bot banners ([#906](https://github.com/discordjs/discord-api-types/issues/906)) ([495148d](https://github.com/discordjs/discord-api-types/commit/495148dc466fcc3cd47ff62377369a97a9cec13d))
|
||||
* **Guild:** add `RESTPostAPIGuildBulkBan` result and json body ([#910](https://github.com/discordjs/discord-api-types/issues/910)) ([61ce329](https://github.com/discordjs/discord-api-types/commit/61ce329f614d5bc923c3ab4d2b318aa2e66c767b))
|
||||
* **RESTJSONErrorCodes:** Add `500_000` ([#908](https://github.com/discordjs/discord-api-types/issues/908)) ([4db44b5](https://github.com/discordjs/discord-api-types/commit/4db44b553d7164415b9f20468716beb5223fcec0))
|
||||
* **Routes:** Add `guildBulkBan()` route ([#909](https://github.com/discordjs/discord-api-types/issues/909)) ([7dcad58](https://github.com/discordjs/discord-api-types/commit/7dcad582ce2fa16ac7bde35f5b158648c2c7c9bf))
|
||||
|
||||
|
||||
|
||||
## [0.37.77](https://github.com/discordjs/discord-api-types/compare/0.37.76...0.37.77) (2024-03-28)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **APIAuditLogChange:** add `APIAuditLogChangeKeySystemChannelFlags` ([#933](https://github.com/discordjs/discord-api-types/issues/933)) ([47c9ad0](https://github.com/discordjs/discord-api-types/commit/47c9ad0e7043c098d103107e95f8a97e67ad3eb4))
|
||||
|
||||
|
||||
|
||||
## [0.37.76](https://github.com/discordjs/discord-api-types/compare/0.37.75...0.37.76) (2024-03-21)
|
||||
|
||||
|
||||
|
||||
## [0.37.75](https://github.com/discordjs/discord-api-types/compare/0.37.74...0.37.75) (2024-03-18)
|
||||
|
||||
|
||||
|
||||
## [0.37.74](https://github.com/discordjs/discord-api-types/compare/0.37.73...0.37.74) (2024-03-14)
|
||||
|
||||
|
||||
|
||||
## [0.37.73](https://github.com/discordjs/discord-api-types/compare/0.37.71...0.37.73) (2024-03-07)
|
||||
|
||||
|
||||
|
||||
## [0.37.72](https://github.com/discordjs/discord-api-types/compare/0.37.71...0.37.72) (2024-03-07)
|
||||
|
||||
|
||||
|
||||
## [0.37.71](https://github.com/discordjs/discord-api-types/compare/0.37.70...0.37.71) (2024-02-26)
|
||||
|
||||
### Features
|
||||
|
||||
- add initial support for super reactions ([#744](https://github.com/discordjs/discord-api-types/issues/744)) ([150dc46](https://github.com/discordjs/discord-api-types/commit/150dc46b8739ca9cf10a46bb48d390f70c679b6e))
|
||||
|
||||
## [0.37.70](https://github.com/discordjs/discord-api-types/compare/0.37.69...0.37.70) (2024-02-15)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTPostAPIChannelMessageJSONBody:** add enforce_nonce ([#874](https://github.com/discordjs/discord-api-types/issues/874)) ([9564941](https://github.com/discordjs/discord-api-types/commit/9564941b3ae51c8bc9b1f915d66b43775089db18))
|
||||
|
||||
## [0.37.69](https://github.com/discordjs/discord-api-types/compare/0.37.68...0.37.69) (2024-02-08)
|
||||
|
||||
### Features
|
||||
|
||||
@@ -77,25 +77,25 @@ import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
|
||||
|
||||
The exports of each API version is split into three main parts:
|
||||
|
||||
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
|
||||
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
|
||||
|
||||
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
|
||||
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
|
||||
|
||||
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
|
||||
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
|
||||
|
||||
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
|
||||
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
|
||||
|
||||
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
|
||||
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
|
||||
|
||||
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
|
||||
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
|
||||
|
||||
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
|
||||
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
|
||||
|
||||
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
|
||||
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
|
||||
|
||||
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
|
||||
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
|
||||
|
||||
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
|
||||
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
|
||||
|
||||
**A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs),
|
||||
that are mentioned in an open pull request, or known through other means _and have received the green light to be used_.
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
*/
|
||||
export interface GatewayURLQuery {
|
||||
v: string;
|
||||
encoding: 'json' | 'etf';
|
||||
encoding: 'etf' | 'json';
|
||||
compress?: 'zlib-stream';
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
@@ -278,27 +283,29 @@ export enum GatewayDispatchEvents {
|
||||
export type GatewaySendPayload =
|
||||
| GatewayHeartbeat
|
||||
| GatewayIdentify
|
||||
| GatewayUpdatePresence
|
||||
| GatewayVoiceStateUpdate
|
||||
| GatewayRequestGuildMembers
|
||||
| GatewayResume
|
||||
| GatewayRequestGuildMembers;
|
||||
| GatewayUpdatePresence
|
||||
| GatewayVoiceStateUpdate;
|
||||
|
||||
export type GatewayReceivePayload =
|
||||
| GatewayHello
|
||||
| GatewayHeartbeatRequest
|
||||
| GatewayDispatchPayload
|
||||
| GatewayHeartbeatAck
|
||||
| GatewayHeartbeatRequest
|
||||
| GatewayHello
|
||||
| GatewayInvalidSession
|
||||
| GatewayReconnect
|
||||
| GatewayDispatchPayload;
|
||||
| GatewayReconnect;
|
||||
|
||||
export type GatewayDispatchPayload =
|
||||
| GatewayAutoModerationRuleModifyDispatch
|
||||
| GatewayApplicationCommandPermissionsUpdateDispatch
|
||||
| GatewayAutoModerationActionExecutionDispatch
|
||||
| GatewayAutoModerationRuleCreateDispatch
|
||||
| GatewayAutoModerationRuleDeleteDispatch
|
||||
| GatewayAutoModerationActionExecutionDispatch
|
||||
| GatewayApplicationCommandPermissionsUpdateDispatch
|
||||
| GatewayAutoModerationRuleModifyDispatch
|
||||
| GatewayChannelModifyDispatch
|
||||
| GatewayChannelPinsUpdateDispatch
|
||||
| GatewayEntitlementModifyDispatch
|
||||
| GatewayGuildAuditLogEntryCreateDispatch
|
||||
| GatewayGuildBanModifyDispatch
|
||||
| GatewayGuildCreateDispatch
|
||||
| GatewayGuildDeleteDispatch
|
||||
@@ -312,8 +319,8 @@ export type GatewayDispatchPayload =
|
||||
| GatewayGuildRoleDeleteDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayGuildScheduledEventCreateDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventDeleteDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventUserAddDispatch
|
||||
| GatewayGuildScheduledEventUserRemoveDispatch
|
||||
| GatewayGuildStickersUpdateDispatch
|
||||
@@ -326,30 +333,30 @@ export type GatewayDispatchPayload =
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessagePollVoteAddDispatch
|
||||
| GatewayMessagePollVoteRemoveDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
| GatewayMessageReactionRemoveEmojiDispatch
|
||||
| GatewayMessageUpdateDispatch
|
||||
| GatewayPresenceUpdateDispatch
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayStageInstanceCreateDispatch
|
||||
| GatewayStageInstanceDeleteDispatch
|
||||
| GatewayStageInstanceUpdateDispatch
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayThreadCreateDispatch
|
||||
| GatewayThreadDeleteDispatch
|
||||
| GatewayThreadListSyncDispatch
|
||||
| GatewayThreadMembersUpdateDispatch
|
||||
| GatewayThreadMemberUpdateDispatch
|
||||
| GatewayThreadCreateDispatch
|
||||
| GatewayThreadUpdateDispatch
|
||||
| GatewayThreadDeleteDispatch
|
||||
| GatewayTypingStartDispatch
|
||||
| GatewayUserUpdateDispatch
|
||||
| GatewayVoiceServerUpdateDispatch
|
||||
| GatewayVoiceStateUpdateDispatch
|
||||
| GatewayWebhooksUpdateDispatch
|
||||
| GatewayGuildAuditLogEntryCreateDispatch
|
||||
| GatewayEntitlementModifyDispatch;
|
||||
| GatewayWebhooksUpdateDispatch;
|
||||
|
||||
// #region Dispatch Payloads
|
||||
|
||||
@@ -454,7 +461,7 @@ export interface GatewayReadyDispatchData {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/application#application-object
|
||||
*/
|
||||
application: Pick<APIApplication, 'id' | 'flags'>;
|
||||
application: Pick<APIApplication, 'flags' | 'id'>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -469,8 +476,8 @@ export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed,
|
||||
*/
|
||||
export type GatewayAutoModerationRuleModifyDispatch = DataPayload<
|
||||
| GatewayDispatchEvents.AutoModerationRuleCreate
|
||||
| GatewayDispatchEvents.AutoModerationRuleUpdate
|
||||
| GatewayDispatchEvents.AutoModerationRuleDelete,
|
||||
| GatewayDispatchEvents.AutoModerationRuleDelete
|
||||
| GatewayDispatchEvents.AutoModerationRuleUpdate,
|
||||
GatewayAutoModerationRuleModifyDispatchData
|
||||
>;
|
||||
|
||||
@@ -694,8 +701,8 @@ export type GatewayEntitlementModifyDispatchData = APIEntitlement;
|
||||
*/
|
||||
export type GatewayEntitlementModifyDispatch = DataPayload<
|
||||
| GatewayDispatchEvents.EntitlementCreate
|
||||
| GatewayDispatchEvents.EntitlementUpdate
|
||||
| GatewayDispatchEvents.EntitlementDelete,
|
||||
| GatewayDispatchEvents.EntitlementDelete
|
||||
| GatewayDispatchEvents.EntitlementUpdate,
|
||||
GatewayEntitlementModifyDispatchData
|
||||
>;
|
||||
|
||||
@@ -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
|
||||
*
|
||||
@@ -1014,10 +1021,10 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#guild-member-update
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatchData = Omit<APIGuildMember, 'deaf' | 'mute' | 'user' | 'joined_at'> &
|
||||
export type GatewayGuildMemberUpdateDispatchData = Nullable<Pick<APIGuildMember, 'joined_at'>> &
|
||||
Omit<APIGuildMember, 'deaf' | 'joined_at' | 'mute' | 'user'> &
|
||||
Partial<Pick<APIGuildMember, 'deaf' | 'mute'>> &
|
||||
Required<Pick<APIGuildMember, 'user'>> &
|
||||
Nullable<Pick<APIGuildMember, 'joined_at'>> & {
|
||||
Required<Pick<APIGuildMember, 'user'>> & {
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
@@ -1362,7 +1369,7 @@ export type GatewayMessageCreateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-create
|
||||
*/
|
||||
export type GatewayMessageCreateDispatchData = Omit<APIMessage, 'mentions'> & GatewayMessageEventExtraFields;
|
||||
export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-update
|
||||
@@ -1375,8 +1382,8 @@ export type GatewayMessageUpdateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-update
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatchData = Omit<Partial<APIMessage>, 'mentions'> &
|
||||
GatewayMessageEventExtraFields & {
|
||||
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields &
|
||||
Omit<Partial<APIMessage>, 'mentions'> & {
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
@@ -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
|
||||
@@ -1979,8 +2025,8 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG
|
||||
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
|
||||
*/
|
||||
export type GatewayRequestGuildMembersData =
|
||||
| GatewayRequestGuildMembersDataWithUserIds
|
||||
| GatewayRequestGuildMembersDataWithQuery;
|
||||
| GatewayRequestGuildMembersDataWithQuery
|
||||
| GatewayRequestGuildMembersDataWithUserIds;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
|
||||
@@ -2073,7 +2119,7 @@ interface BasePayload {
|
||||
t?: string;
|
||||
}
|
||||
|
||||
type NonDispatchPayload = Omit<BasePayload, 't' | 's'> & {
|
||||
type NonDispatchPayload = Omit<BasePayload, 's' | 't'> & {
|
||||
t: null;
|
||||
s: null;
|
||||
};
|
||||
@@ -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
|
||||
>
|
||||
|
||||
@@ -184,56 +184,56 @@ export enum GatewayDispatchEvents {
|
||||
export type GatewaySendPayload =
|
||||
| GatewayHeartbeat
|
||||
| GatewayIdentify
|
||||
| GatewayUpdatePresence
|
||||
| GatewayVoiceStateUpdate
|
||||
| GatewayRequestGuildMembers
|
||||
| GatewayResume
|
||||
| GatewayRequestGuildMembers;
|
||||
| GatewayUpdatePresence
|
||||
| GatewayVoiceStateUpdate;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayReceivePayload =
|
||||
| GatewayHello
|
||||
| GatewayHeartbeatRequest
|
||||
| GatewayDispatchPayload
|
||||
| GatewayHeartbeatAck
|
||||
| GatewayHeartbeatRequest
|
||||
| GatewayHello
|
||||
| GatewayInvalidSession
|
||||
| GatewayReconnect
|
||||
| GatewayDispatchPayload;
|
||||
| GatewayReconnect;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayDispatchPayload =
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayChannelModifyDispatch
|
||||
| GatewayChannelPinsUpdateDispatch
|
||||
| GatewayGuildModifyDispatch
|
||||
| GatewayGuildDeleteDispatch
|
||||
| GatewayGuildBanModifyDispatch
|
||||
| GatewayGuildDeleteDispatch
|
||||
| GatewayGuildEmojisUpdateDispatch
|
||||
| GatewayGuildIntegrationsUpdateDispatch
|
||||
| GatewayGuildMemberAddDispatch
|
||||
| GatewayGuildMemberRemoveDispatch
|
||||
| GatewayGuildMemberUpdateDispatch
|
||||
| GatewayGuildMembersChunkDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayGuildMemberUpdateDispatch
|
||||
| GatewayGuildModifyDispatch
|
||||
| GatewayGuildRoleDeleteDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayInviteCreateDispatch
|
||||
| GatewayInviteDeleteDispatch
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageUpdateDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
| GatewayMessageReactionRemoveEmojiDispatch
|
||||
| GatewayMessageUpdateDispatch
|
||||
| GatewayPresenceUpdateDispatch
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayTypingStartDispatch
|
||||
| GatewayUserUpdateDispatch
|
||||
| GatewayVoiceStateUpdateDispatch
|
||||
| GatewayVoiceServerUpdateDispatch
|
||||
| GatewayVoiceStateUpdateDispatch
|
||||
| GatewayWebhooksUpdateDispatch;
|
||||
|
||||
// #region Dispatch Payloads
|
||||
@@ -571,7 +571,7 @@ export type GatewayMessageCreateDispatch = DataPayload<GatewayDispatchEvents.Mes
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageUpdate,
|
||||
{ id: string; channel_id: string } & Partial<APIMessage>
|
||||
Partial<APIMessage> & { id: string; channel_id: string }
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -768,11 +768,11 @@ export interface GatewayResume {
|
||||
export interface GatewayRequestGuildMembers {
|
||||
op: GatewayOPCodes.RequestGuildMembers;
|
||||
d: {
|
||||
guild_id: string | string[];
|
||||
guild_id: string[] | string;
|
||||
query?: string;
|
||||
limit: number;
|
||||
presences?: boolean;
|
||||
user_ids?: string | string[];
|
||||
user_ids?: string[] | string;
|
||||
nonce?: string;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -258,21 +258,21 @@ export enum GatewayDispatchEvents {
|
||||
export type GatewaySendPayload =
|
||||
| GatewayHeartbeat
|
||||
| GatewayIdentify
|
||||
| GatewayUpdatePresence
|
||||
| GatewayVoiceStateUpdate
|
||||
| GatewayRequestGuildMembers
|
||||
| GatewayResume
|
||||
| GatewayRequestGuildMembers;
|
||||
| GatewayUpdatePresence
|
||||
| GatewayVoiceStateUpdate;
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type GatewayReceivePayload =
|
||||
| GatewayHello
|
||||
| GatewayHeartbeatRequest
|
||||
| GatewayDispatchPayload
|
||||
| GatewayHeartbeatAck
|
||||
| GatewayHeartbeatRequest
|
||||
| GatewayHello
|
||||
| GatewayInvalidSession
|
||||
| GatewayReconnect
|
||||
| GatewayDispatchPayload;
|
||||
| GatewayReconnect;
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
@@ -292,8 +292,8 @@ export type GatewayDispatchPayload =
|
||||
| GatewayGuildRoleDeleteDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayGuildScheduledEventCreateDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventDeleteDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventUserAddDispatch
|
||||
| GatewayGuildScheduledEventUserRemoveDispatch
|
||||
| GatewayGuildStickersUpdateDispatch
|
||||
@@ -312,11 +312,11 @@ export type GatewayDispatchPayload =
|
||||
| GatewayMessageReactionRemoveEmojiDispatch
|
||||
| GatewayMessageUpdateDispatch
|
||||
| GatewayPresenceUpdateDispatch
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayStageInstanceCreateDispatch
|
||||
| GatewayStageInstanceDeleteDispatch
|
||||
| GatewayStageInstanceUpdateDispatch
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayTypingStartDispatch
|
||||
| GatewayUserUpdateDispatch
|
||||
| GatewayVoiceServerUpdateDispatch
|
||||
@@ -440,7 +440,7 @@ export interface GatewayReadyDispatchData {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/application#application-object
|
||||
*/
|
||||
application: Pick<APIApplication, 'id' | 'flags'>;
|
||||
application: Pick<APIApplication, 'flags' | 'id'>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -805,10 +805,10 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
|
||||
*
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatchData = Omit<APIGuildMember, 'deaf' | 'mute' | 'user' | 'joined_at'> &
|
||||
export type GatewayGuildMemberUpdateDispatchData = Nullable<Pick<APIGuildMember, 'joined_at'>> &
|
||||
Omit<APIGuildMember, 'deaf' | 'joined_at' | 'mute' | 'user'> &
|
||||
Partial<Pick<APIGuildMember, 'deaf' | 'mute'>> &
|
||||
Required<Pick<APIGuildMember, 'user'>> &
|
||||
Nullable<Pick<APIGuildMember, 'joined_at'>> & {
|
||||
Required<Pick<APIGuildMember, 'user'>> & {
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
@@ -1243,10 +1243,10 @@ export type GatewayMessageUpdateDispatch = DataPayload<
|
||||
*
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatchData = {
|
||||
export type GatewayMessageUpdateDispatchData = Partial<APIMessage> & {
|
||||
id: Snowflake;
|
||||
channel_id: Snowflake;
|
||||
} & Partial<APIMessage>;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete
|
||||
@@ -1849,7 +1849,7 @@ interface BasePayload {
|
||||
t?: string;
|
||||
}
|
||||
|
||||
type NonDispatchPayload = Omit<BasePayload, 't' | 's'> & {
|
||||
type NonDispatchPayload = Omit<BasePayload, 's' | 't'> & {
|
||||
t: null;
|
||||
s: null;
|
||||
};
|
||||
|
||||
@@ -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',
|
||||
@@ -277,27 +282,29 @@ export enum GatewayDispatchEvents {
|
||||
export type GatewaySendPayload =
|
||||
| GatewayHeartbeat
|
||||
| GatewayIdentify
|
||||
| GatewayUpdatePresence
|
||||
| GatewayVoiceStateUpdate
|
||||
| GatewayRequestGuildMembers
|
||||
| GatewayResume
|
||||
| GatewayRequestGuildMembers;
|
||||
| GatewayUpdatePresence
|
||||
| GatewayVoiceStateUpdate;
|
||||
|
||||
export type GatewayReceivePayload =
|
||||
| GatewayHello
|
||||
| GatewayHeartbeatRequest
|
||||
| GatewayDispatchPayload
|
||||
| GatewayHeartbeatAck
|
||||
| GatewayHeartbeatRequest
|
||||
| GatewayHello
|
||||
| GatewayInvalidSession
|
||||
| GatewayReconnect
|
||||
| GatewayDispatchPayload;
|
||||
| GatewayReconnect;
|
||||
|
||||
export type GatewayDispatchPayload =
|
||||
| GatewayApplicationCommandPermissionsUpdateDispatch
|
||||
| GatewayAutoModerationRuleModifyDispatch
|
||||
| GatewayAutoModerationActionExecutionDispatch
|
||||
| GatewayAutoModerationRuleCreateDispatch
|
||||
| GatewayAutoModerationRuleDeleteDispatch
|
||||
| GatewayAutoModerationActionExecutionDispatch
|
||||
| GatewayAutoModerationRuleModifyDispatch
|
||||
| GatewayChannelModifyDispatch
|
||||
| GatewayChannelPinsUpdateDispatch
|
||||
| GatewayEntitlementModifyDispatch
|
||||
| GatewayGuildAuditLogEntryCreateDispatch
|
||||
| GatewayGuildBanModifyDispatch
|
||||
| GatewayGuildCreateDispatch
|
||||
| GatewayGuildDeleteDispatch
|
||||
@@ -311,8 +318,8 @@ export type GatewayDispatchPayload =
|
||||
| GatewayGuildRoleDeleteDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayGuildScheduledEventCreateDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventDeleteDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventUserAddDispatch
|
||||
| GatewayGuildScheduledEventUserRemoveDispatch
|
||||
| GatewayGuildStickersUpdateDispatch
|
||||
@@ -325,30 +332,30 @@ export type GatewayDispatchPayload =
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessagePollVoteAddDispatch
|
||||
| GatewayMessagePollVoteRemoveDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
| GatewayMessageReactionRemoveEmojiDispatch
|
||||
| GatewayMessageUpdateDispatch
|
||||
| GatewayPresenceUpdateDispatch
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayStageInstanceCreateDispatch
|
||||
| GatewayStageInstanceDeleteDispatch
|
||||
| GatewayStageInstanceUpdateDispatch
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayThreadCreateDispatch
|
||||
| GatewayThreadDeleteDispatch
|
||||
| GatewayThreadListSyncDispatch
|
||||
| GatewayThreadMembersUpdateDispatch
|
||||
| GatewayThreadMemberUpdateDispatch
|
||||
| GatewayThreadCreateDispatch
|
||||
| GatewayThreadUpdateDispatch
|
||||
| GatewayThreadDeleteDispatch
|
||||
| GatewayTypingStartDispatch
|
||||
| GatewayUserUpdateDispatch
|
||||
| GatewayVoiceServerUpdateDispatch
|
||||
| GatewayVoiceStateUpdateDispatch
|
||||
| GatewayWebhooksUpdateDispatch
|
||||
| GatewayGuildAuditLogEntryCreateDispatch
|
||||
| GatewayEntitlementModifyDispatch;
|
||||
| GatewayWebhooksUpdateDispatch;
|
||||
|
||||
// #region Dispatch Payloads
|
||||
|
||||
@@ -453,7 +460,7 @@ export interface GatewayReadyDispatchData {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/application#application-object
|
||||
*/
|
||||
application: Pick<APIApplication, 'id' | 'flags'>;
|
||||
application: Pick<APIApplication, 'flags' | 'id'>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -468,8 +475,8 @@ export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed,
|
||||
*/
|
||||
export type GatewayAutoModerationRuleModifyDispatch = DataPayload<
|
||||
| GatewayDispatchEvents.AutoModerationRuleCreate
|
||||
| GatewayDispatchEvents.AutoModerationRuleUpdate
|
||||
| GatewayDispatchEvents.AutoModerationRuleDelete,
|
||||
| GatewayDispatchEvents.AutoModerationRuleDelete
|
||||
| GatewayDispatchEvents.AutoModerationRuleUpdate,
|
||||
GatewayAutoModerationRuleModifyDispatchData
|
||||
>;
|
||||
|
||||
@@ -693,8 +700,8 @@ export type GatewayEntitlementModifyDispatchData = APIEntitlement;
|
||||
*/
|
||||
export type GatewayEntitlementModifyDispatch = DataPayload<
|
||||
| GatewayDispatchEvents.EntitlementCreate
|
||||
| GatewayDispatchEvents.EntitlementUpdate
|
||||
| GatewayDispatchEvents.EntitlementDelete,
|
||||
| GatewayDispatchEvents.EntitlementDelete
|
||||
| GatewayDispatchEvents.EntitlementUpdate,
|
||||
GatewayEntitlementModifyDispatchData
|
||||
>;
|
||||
|
||||
@@ -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
|
||||
*
|
||||
@@ -1013,10 +1020,10 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#guild-member-update
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatchData = Omit<APIGuildMember, 'deaf' | 'mute' | 'user' | 'joined_at'> &
|
||||
export type GatewayGuildMemberUpdateDispatchData = Nullable<Pick<APIGuildMember, 'joined_at'>> &
|
||||
Omit<APIGuildMember, 'deaf' | 'joined_at' | 'mute' | 'user'> &
|
||||
Partial<Pick<APIGuildMember, 'deaf' | 'mute'>> &
|
||||
Required<Pick<APIGuildMember, 'user'>> &
|
||||
Nullable<Pick<APIGuildMember, 'joined_at'>> & {
|
||||
Required<Pick<APIGuildMember, 'user'>> & {
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
@@ -1361,7 +1368,7 @@ export type GatewayMessageCreateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-create
|
||||
*/
|
||||
export type GatewayMessageCreateDispatchData = Omit<APIMessage, 'mentions'> & GatewayMessageEventExtraFields;
|
||||
export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-update
|
||||
@@ -1374,8 +1381,8 @@ export type GatewayMessageUpdateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#message-update
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatchData = Omit<Partial<APIMessage>, 'mentions'> &
|
||||
GatewayMessageEventExtraFields & {
|
||||
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields &
|
||||
Omit<Partial<APIMessage>, 'mentions'> & {
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
@@ -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
|
||||
@@ -1978,8 +2024,8 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG
|
||||
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
|
||||
*/
|
||||
export type GatewayRequestGuildMembersData =
|
||||
| GatewayRequestGuildMembersDataWithUserIds
|
||||
| GatewayRequestGuildMembersDataWithQuery;
|
||||
| GatewayRequestGuildMembersDataWithQuery
|
||||
| GatewayRequestGuildMembersDataWithUserIds;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
|
||||
@@ -2072,7 +2118,7 @@ interface BasePayload {
|
||||
t?: string;
|
||||
}
|
||||
|
||||
type NonDispatchPayload = Omit<BasePayload, 't' | 's'> & {
|
||||
type NonDispatchPayload = Omit<BasePayload, 's' | 't'> & {
|
||||
t: null;
|
||||
s: null;
|
||||
};
|
||||
@@ -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;
|
||||
|
||||
/**
|
||||
@@ -305,7 +317,7 @@ export interface RESTErrorGroupWrapper {
|
||||
_errors: RESTErrorData[];
|
||||
}
|
||||
|
||||
export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation | { [k: string]: RESTErrorData } | string;
|
||||
export type RESTErrorData = RESTErrorFieldInformation | RESTErrorGroupWrapper | string | { [k: string]: RESTErrorData };
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
|
||||
|
||||
@@ -20,7 +20,7 @@ export enum ApplicationCommandOptionType {
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure
|
||||
*/
|
||||
export interface APIApplicationCommandOptionChoice<ValueType = string | number> {
|
||||
export interface APIApplicationCommandOptionChoice<ValueType = number | string> {
|
||||
name: string;
|
||||
name_localizations?: LocalizationMap | null;
|
||||
value: ValueType;
|
||||
|
||||
@@ -65,42 +65,42 @@ export * from './_chatInput/user.ts';
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
|
||||
*/
|
||||
export type APIApplicationCommandBasicOption =
|
||||
| APIApplicationCommandStringOption
|
||||
| APIApplicationCommandIntegerOption
|
||||
| APIApplicationCommandAttachmentOption
|
||||
| APIApplicationCommandBooleanOption
|
||||
| APIApplicationCommandUserOption
|
||||
| APIApplicationCommandChannelOption
|
||||
| APIApplicationCommandRoleOption
|
||||
| APIApplicationCommandIntegerOption
|
||||
| APIApplicationCommandMentionableOption
|
||||
| APIApplicationCommandNumberOption
|
||||
| APIApplicationCommandAttachmentOption;
|
||||
| APIApplicationCommandRoleOption
|
||||
| APIApplicationCommandStringOption
|
||||
| APIApplicationCommandUserOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
|
||||
*/
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandSubcommandOption
|
||||
| APIApplicationCommandBasicOption
|
||||
| APIApplicationCommandSubcommandGroupOption
|
||||
| APIApplicationCommandBasicOption;
|
||||
| APIApplicationCommandSubcommandOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure
|
||||
*/
|
||||
export type APIApplicationCommandInteractionDataOption =
|
||||
| APIApplicationCommandInteractionDataSubcommandOption
|
||||
| APIApplicationCommandInteractionDataBasicOption
|
||||
| APIApplicationCommandInteractionDataSubcommandGroupOption
|
||||
| APIApplicationCommandInteractionDataBasicOption;
|
||||
| APIApplicationCommandInteractionDataSubcommandOption;
|
||||
|
||||
export type APIApplicationCommandInteractionDataBasicOption =
|
||||
| APIApplicationCommandInteractionDataStringOption
|
||||
| APIApplicationCommandInteractionDataIntegerOption
|
||||
| APIApplicationCommandInteractionDataAttachmentOption
|
||||
| APIApplicationCommandInteractionDataBooleanOption
|
||||
| APIApplicationCommandInteractionDataUserOption
|
||||
| APIApplicationCommandInteractionDataChannelOption
|
||||
| APIApplicationCommandInteractionDataRoleOption
|
||||
| APIApplicationCommandInteractionDataIntegerOption
|
||||
| APIApplicationCommandInteractionDataMentionableOption
|
||||
| APIApplicationCommandInteractionDataNumberOption
|
||||
| APIApplicationCommandInteractionDataAttachmentOption;
|
||||
| APIApplicationCommandInteractionDataRoleOption
|
||||
| APIApplicationCommandInteractionDataStringOption
|
||||
| APIApplicationCommandInteractionDataUserOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
|
||||
@@ -33,8 +33,8 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export type APIContextMenuInteractionData =
|
||||
| APIUserApplicationCommandInteractionData
|
||||
| APIMessageApplicationCommandInteractionData;
|
||||
| APIMessageApplicationCommandInteractionData
|
||||
| APIUserApplicationCommandInteractionData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
@@ -74,18 +74,18 @@ export type APIMessageApplicationCommandGuildInteraction =
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIContextMenuInteraction = APIUserApplicationCommandInteraction | APIMessageApplicationCommandInteraction;
|
||||
export type APIContextMenuInteraction = APIMessageApplicationCommandInteraction | APIUserApplicationCommandInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIContextMenuDMInteraction =
|
||||
| APIUserApplicationCommandDMInteraction
|
||||
| APIMessageApplicationCommandDMInteraction;
|
||||
| APIMessageApplicationCommandDMInteraction
|
||||
| APIUserApplicationCommandDMInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIContextMenuGuildInteraction =
|
||||
| APIUserApplicationCommandGuildInteraction
|
||||
| APIMessageApplicationCommandGuildInteraction;
|
||||
| APIMessageApplicationCommandGuildInteraction
|
||||
| APIUserApplicationCommandGuildInteraction;
|
||||
|
||||
@@ -54,6 +54,6 @@ export enum ApplicationCommandPermissionType {
|
||||
*/
|
||||
export const APIApplicationCommandPermissionsConstant = {
|
||||
// eslint-disable-next-line unicorn/prefer-native-coercion-functions
|
||||
Everyone: (guildId: string | bigint): Snowflake => String(guildId),
|
||||
AllChannels: (guildId: string | bigint): Snowflake => String(BigInt(guildId) - 1n),
|
||||
Everyone: (guildId: bigint | string): Snowflake => String(guildId),
|
||||
AllChannels: (guildId: bigint | string): Snowflake => String(BigInt(guildId) - 1n),
|
||||
};
|
||||
|
||||
@@ -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,14 @@ 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])`
|
||||
*/
|
||||
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]`.
|
||||
*/
|
||||
contexts?: InteractionContextType[] | null;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
@@ -103,6 +113,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,
|
||||
/**
|
||||
* App is installable to users
|
||||
*/
|
||||
UserInstall,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types
|
||||
*/
|
||||
export enum InteractionContextType {
|
||||
/**
|
||||
* Interaction can be used within servers
|
||||
*/
|
||||
Guild,
|
||||
/**
|
||||
* Interaction can be used within DMs with the app's bot user
|
||||
*/
|
||||
BotDM,
|
||||
/**
|
||||
* Interaction can be used within Group DMs and DMs other than the app's bot user
|
||||
*/
|
||||
PrivateChannel,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
@@ -118,7 +160,7 @@ export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationC
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.ApplicationCommand, Data>,
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions'
|
||||
'app_permissions' | 'channel_id' | 'channel' | '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,17 +14,51 @@ 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,
|
||||
| 'roles'
|
||||
| 'premium_since'
|
||||
| 'pending'
|
||||
| 'nick'
|
||||
| 'mute'
|
||||
| 'joined_at'
|
||||
| 'deaf'
|
||||
| 'communication_disabled_until'
|
||||
| 'avatar'
|
||||
| 'communication_disabled_until'
|
||||
| 'deaf'
|
||||
| 'joined_at'
|
||||
| 'mute'
|
||||
| 'nick'
|
||||
| 'pending'
|
||||
| 'premium_since'
|
||||
| 'roles'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -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,11 +169,23 @@ 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,
|
||||
'member' | 'guild_id'
|
||||
'guild_id' | 'member'
|
||||
> &
|
||||
Required<Pick<Original, 'user'>>;
|
||||
|
||||
@@ -147,7 +193,7 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
|
||||
Original,
|
||||
'user'
|
||||
> &
|
||||
Required<Pick<Original, 'member' | 'guild_id'>>;
|
||||
Required<Pick<Original, 'guild_id' | 'member'>>;
|
||||
|
||||
export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> extends Required<APIPartialChannel> {
|
||||
type: T;
|
||||
@@ -160,12 +206,12 @@ export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> ex
|
||||
export type APIInteractionDataResolvedChannel =
|
||||
| APIInteractionDataResolvedChannelBase<Exclude<ChannelType, ThreadChannelType>>
|
||||
| (APIInteractionDataResolvedChannelBase<ThreadChannelType> &
|
||||
Pick<APIThreadChannel, 'thread_metadata' | 'parent_id'>);
|
||||
Pick<APIThreadChannel, 'parent_id' | 'thread_metadata'>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'deaf' | 'mute' | 'user'> {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
@@ -188,8 +234,8 @@ export type APIChatInputApplicationCommandInteractionDataResolved = APIInteracti
|
||||
/**
|
||||
* `users` and optional `members` from APIInteractionDataResolved, for user commands and user selects
|
||||
*/
|
||||
export type APIUserInteractionDataResolved = Required<Pick<APIInteractionDataResolved, 'users'>> &
|
||||
Pick<APIInteractionDataResolved, 'members'>;
|
||||
export type APIUserInteractionDataResolved = Pick<APIInteractionDataResolved, 'members'> &
|
||||
Required<Pick<APIInteractionDataResolved, 'users'>>;
|
||||
|
||||
/**
|
||||
* @deprecated Renamed to `APIUserInteractionDataResolved`
|
||||
|
||||
@@ -15,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -26,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -37,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -76,7 +76,7 @@ export interface APIMessageRoleSelectInteractionData
|
||||
export interface APIMessageMentionableSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.MentionableSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: Pick<APIInteractionDataResolved, 'users' | 'members' | 'roles'>;
|
||||
resolved: Pick<APIInteractionDataResolved, 'members' | 'roles' | 'users'>;
|
||||
}
|
||||
|
||||
export interface APIMessageChannelSelectInteractionData
|
||||
@@ -86,11 +86,11 @@ export interface APIMessageChannelSelectInteractionData
|
||||
}
|
||||
|
||||
export type APIMessageSelectMenuInteractionData =
|
||||
| APIMessageStringSelectInteractionData
|
||||
| APIMessageUserSelectInteractionData
|
||||
| APIMessageRoleSelectInteractionData
|
||||
| APIMessageChannelSelectInteractionData
|
||||
| APIMessageMentionableSelectInteractionData
|
||||
| APIMessageChannelSelectInteractionData;
|
||||
| APIMessageRoleSelectInteractionData
|
||||
| APIMessageStringSelectInteractionData
|
||||
| APIMessageUserSelectInteractionData;
|
||||
|
||||
export type APIMessageComponentDMInteraction = APIDMInteractionWrapper<APIMessageComponentInteraction>;
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ export enum InteractionType {
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object
|
||||
*/
|
||||
export type APIInteractionResponse =
|
||||
| APIInteractionResponsePong
|
||||
| APIApplicationCommandAutocompleteResponse
|
||||
| APIInteractionResponseChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredMessageUpdate
|
||||
| APIInteractionResponsePong
|
||||
| APIInteractionResponseUpdateMessage
|
||||
| APIApplicationCommandAutocompleteResponse
|
||||
| APIModalInteractionResponse
|
||||
| APIPremiumRequiredInteractionResponse;
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
@@ -107,7 +109,7 @@ export enum InteractionResponseType {
|
||||
*/
|
||||
export type APIInteractionResponseCallbackData = Omit<
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
'username' | 'avatar_url'
|
||||
'avatar_url' | 'username'
|
||||
> & { flags?: MessageFlags };
|
||||
|
||||
export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
|
||||
@@ -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';
|
||||
@@ -63,6 +64,7 @@ export interface APIApplication {
|
||||
* An empty string
|
||||
*
|
||||
* @deprecated This field will be removed in v11
|
||||
* @unstable This field is no longer documented by Discord and will be removed in v11
|
||||
*/
|
||||
summary: '';
|
||||
/**
|
||||
@@ -107,6 +109,10 @@ export interface APIApplication {
|
||||
* Approximate count of guilds the application has been added to
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* Approximate count of users that have installed the app
|
||||
*/
|
||||
approximate_user_install_count?: number;
|
||||
/**
|
||||
* Array of redirect URIs for the application
|
||||
*/
|
||||
@@ -128,6 +134,10 @@ 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
|
||||
*/
|
||||
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
@@ -139,6 +149,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,13 +10,14 @@ 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,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildMFALevel,
|
||||
GuildSystemChannelFlags,
|
||||
GuildVerificationLevel,
|
||||
IntegrationExpireBehavior,
|
||||
} from './guild.ts';
|
||||
@@ -204,6 +205,15 @@ export enum AuditLogEvent {
|
||||
|
||||
CreatorMonetizationRequestCreated = 150,
|
||||
CreatorMonetizationTermsAccepted,
|
||||
|
||||
OnboardingPromptCreate = 163,
|
||||
OnboardingPromptUpdate,
|
||||
OnboardingPromptDelete,
|
||||
OnboardingCreate,
|
||||
OnboardingUpdate,
|
||||
|
||||
HomeSettingsCreate = 190,
|
||||
HomeSettingsUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -335,82 +345,87 @@ export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
|
||||
*/
|
||||
export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeyImageHash
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyOwnerId
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyPreferredLocale
|
||||
| APIAuditLogChangeKeyAFKChannelId
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyRulesChannelId
|
||||
| APIAuditLogChangeKeyPublicUpdatesChannelId
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyVerificationLevel
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyVanityURLCode
|
||||
| APIAuditLogChangeKey$Add
|
||||
| APIAuditLogChangeKey$Remove
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyWidgetEnabled
|
||||
| APIAuditLogChangeKeyWidgetChannelId
|
||||
| APIAuditLogChangeKeySystemChannelId
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyTopic
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyApplicationId
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyActions
|
||||
| APIAuditLogChangeKeyAFKChannelId
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyAllow
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyChannelId
|
||||
| APIAuditLogChangeKeyInviterId
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyApplicationId
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyAvailableTags
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyId
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyChannelId
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDefaultReactionEmoji
|
||||
| APIAuditLogChangeKeyDefaultThreadRateLimitPerUser
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
| APIAuditLogChangeKeyEnabled
|
||||
| APIAuditLogChangeKeyEnableEmoticons
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyEventType
|
||||
| APIAuditLogChangeKeyExemptChannels
|
||||
| APIAuditLogChangeKeyExemptRoles
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyUserLimit
|
||||
| APIAuditLogChangeKeyPrivacyLevel
|
||||
| APIAuditLogChangeKeyTags
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFlags
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeyId
|
||||
| APIAuditLogChangeKeyImageHash
|
||||
| APIAuditLogChangeKeyInviterId
|
||||
| APIAuditLogChangeKeyLocation
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil
|
||||
| APIAuditLogChangeKeyTriggerType
|
||||
| APIAuditLogChangeKeyEventType
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyOwnerId
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyPreferredLocale
|
||||
| APIAuditLogChangeKeyPrivacyLevel
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyPublicUpdatesChannelId
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyRulesChannelId
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeySystemChannelFlags
|
||||
| APIAuditLogChangeKeySystemChannelId
|
||||
| APIAuditLogChangeKeyTags
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyTopic
|
||||
| APIAuditLogChangeKeyTriggerMetadata
|
||||
| APIAuditLogChangeKeyActions
|
||||
| APIAuditLogChangeKeyEnabled
|
||||
| APIAuditLogChangeKeyExemptRoles
|
||||
| APIAuditLogChangeKeyExemptChannels;
|
||||
| APIAuditLogChangeKeyTriggerType
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyUserLimit
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyVanityURLCode
|
||||
| APIAuditLogChangeKeyVerificationLevel
|
||||
| APIAuditLogChangeKeyWidgetChannelId
|
||||
| APIAuditLogChangeKeyWidgetEnabled;
|
||||
|
||||
/**
|
||||
* Returned when an entity's name is changed
|
||||
@@ -521,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
|
||||
@@ -543,6 +558,14 @@ export type APIAuditLogChangeKeyWidgetEnabled = AuditLogChangeData<'widget_enabl
|
||||
*/
|
||||
export type APIAuditLogChangeKeyWidgetChannelId = AuditLogChangeData<'widget_channel_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's system_channel_flags is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeySystemChannelFlags = AuditLogChangeData<
|
||||
'system_channel_flags',
|
||||
GuildSystemChannelFlags
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's system_channel_id is changed
|
||||
*/
|
||||
@@ -816,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';
|
||||
|
||||
@@ -41,15 +42,15 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
|
||||
}
|
||||
|
||||
export type TextChannelType =
|
||||
| ChannelType.AnnouncementThread
|
||||
| ChannelType.DM
|
||||
| ChannelType.GroupDM
|
||||
| ChannelType.GuildAnnouncement
|
||||
| ChannelType.PublicThread
|
||||
| ChannelType.PrivateThread
|
||||
| ChannelType.AnnouncementThread
|
||||
| ChannelType.GuildStageVoice
|
||||
| ChannelType.GuildText
|
||||
| ChannelType.GuildVoice
|
||||
| ChannelType.GuildStageVoice;
|
||||
| ChannelType.PrivateThread
|
||||
| ChannelType.PublicThread;
|
||||
|
||||
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
@@ -110,7 +111,7 @@ export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelB
|
||||
|
||||
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APIGuildTextChannel<T extends GuildTextChannelType | ChannelType.GuildForum | ChannelType.GuildMedia>
|
||||
export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType>
|
||||
extends Omit<APITextBasedChannel<T>, 'name'>,
|
||||
APIGuildChannel<T> {
|
||||
/**
|
||||
@@ -134,7 +135,7 @@ export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>
|
||||
|
||||
export interface APIVoiceChannelBase<T extends ChannelType>
|
||||
extends APIGuildChannel<T>,
|
||||
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
|
||||
Omit<APITextBasedChannel<T>, 'last_pin_timestamp' | 'name'> {
|
||||
/**
|
||||
* The bitrate (in bits) of the voice or stage channel
|
||||
*/
|
||||
@@ -204,7 +205,7 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
|
||||
managed?: boolean;
|
||||
}
|
||||
|
||||
export type ThreadChannelType = ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread;
|
||||
export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
|
||||
|
||||
export interface APIThreadChannel
|
||||
extends Omit<APITextBasedChannel<ThreadChannelType>, 'name'>,
|
||||
@@ -373,16 +374,16 @@ export type APIGuildMediaChannel = APIThreadOnlyChannel<ChannelType.GuildMedia>;
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
|
||||
*/
|
||||
export type APIChannel =
|
||||
| APIGroupDMChannel
|
||||
| APIDMChannel
|
||||
| APITextChannel
|
||||
| APINewsChannel
|
||||
| APIGuildVoiceChannel
|
||||
| APIGuildStageVoiceChannel
|
||||
| APIGroupDMChannel
|
||||
| APIGuildCategoryChannel
|
||||
| APIThreadChannel
|
||||
| APIGuildForumChannel
|
||||
| APIGuildMediaChannel;
|
||||
| APIGuildMediaChannel
|
||||
| APIGuildStageVoiceChannel
|
||||
| APIGuildVoiceChannel
|
||||
| APINewsChannel
|
||||
| APITextChannel
|
||||
| APIThreadChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
@@ -572,7 +573,7 @@ export interface APIMessage {
|
||||
/**
|
||||
* Any attached files
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
@@ -607,7 +608,7 @@ export interface APIMessage {
|
||||
* **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE`
|
||||
* event to ensure it got sent**
|
||||
*/
|
||||
nonce?: string | number;
|
||||
nonce?: number | string;
|
||||
/**
|
||||
* Whether this message is pinned
|
||||
*/
|
||||
@@ -666,8 +667,14 @@ 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
|
||||
*/
|
||||
interaction_metadata?: APIMessageInteractionMetadata;
|
||||
/**
|
||||
* Sent if the message is a response to an Interaction
|
||||
*
|
||||
* @deprecated In favor of `interaction_metadata`
|
||||
*/
|
||||
interaction?: APIMessageInteraction;
|
||||
/**
|
||||
@@ -715,6 +722,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 +783,11 @@ export enum MessageType {
|
||||
StageRaiseHand,
|
||||
StageTopic,
|
||||
GuildApplicationPremiumSubscription,
|
||||
|
||||
GuildIncidentAlertModeEnabled = 36,
|
||||
GuildIncidentAlertModeDisabled,
|
||||
GuildIncidentReportRaid,
|
||||
GuildIncidentReportFalseAlarm,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -781,6 +812,10 @@ export interface APIMessageActivity {
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
/**
|
||||
* Type of reference
|
||||
*/
|
||||
type?: MessageReferenceType;
|
||||
/**
|
||||
* ID of the originating message
|
||||
*/
|
||||
@@ -805,6 +840,20 @@ export enum MessageActivityType {
|
||||
JoinRequest = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-types
|
||||
*/
|
||||
export enum MessageReferenceType {
|
||||
/**
|
||||
* A standard reference used by replies
|
||||
*/
|
||||
Default,
|
||||
/**
|
||||
* Reference used to point to a message at a point in time
|
||||
*/
|
||||
Forward,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
@@ -859,6 +908,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
|
||||
*/
|
||||
@@ -900,19 +963,45 @@ export interface APIFollowedChannel {
|
||||
*/
|
||||
export interface APIReaction {
|
||||
/**
|
||||
* Times this emoji has been used to react
|
||||
* Total number of times this emoji has been used to react (including super reacts)
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* An object detailing the individual reaction counts for different types of reactions
|
||||
*/
|
||||
count_details: APIReactionCountDetails;
|
||||
/**
|
||||
* Whether the current user reacted using this emoji
|
||||
*/
|
||||
me: boolean;
|
||||
/**
|
||||
* Whether the current user super-reacted using this emoji
|
||||
*/
|
||||
me_burst: boolean;
|
||||
/**
|
||||
* Emoji information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/emoji#emoji-object
|
||||
*/
|
||||
emoji: APIPartialEmoji;
|
||||
/**
|
||||
* Hexadecimal colors used for this super reaction
|
||||
*/
|
||||
burst_colors: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#reaction-count-details-object-reaction-count-details-structure
|
||||
*/
|
||||
export interface APIReactionCountDetails {
|
||||
/**
|
||||
* Count of super reactions
|
||||
*/
|
||||
burst: number;
|
||||
/**
|
||||
* Count of normal reactions
|
||||
*/
|
||||
normal: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1324,7 +1413,7 @@ export interface APIEmbedField {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
|
||||
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
|
||||
*/
|
||||
export interface APIAttachment {
|
||||
/**
|
||||
@@ -1335,6 +1424,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* The title of the file
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
@@ -1568,7 +1661,7 @@ export interface APIMessageComponentEmoji {
|
||||
|
||||
export interface APIButtonComponentWithCustomId
|
||||
extends APIButtonComponentBase<
|
||||
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
|
||||
ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success
|
||||
> {
|
||||
/**
|
||||
* The custom_id to be sent in the interaction when clicked
|
||||
@@ -1583,7 +1676,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
url: string;
|
||||
}
|
||||
|
||||
export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
export type APIButtonComponent =
|
||||
| APIButtonComponentWithCustomId
|
||||
| APIButtonComponentWithSKUId
|
||||
| APIButtonComponentWithURL;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
|
||||
@@ -1594,6 +1698,7 @@ export enum ButtonStyle {
|
||||
Success,
|
||||
Danger,
|
||||
Link,
|
||||
Premium,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1609,11 +1714,11 @@ export enum TextInputStyle {
|
||||
*/
|
||||
export interface APIBaseSelectMenuComponent<
|
||||
T extends
|
||||
| ComponentType.StringSelect
|
||||
| ComponentType.UserSelect
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.ChannelSelect
|
||||
| ComponentType.MentionableSelect
|
||||
| ComponentType.ChannelSelect,
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.StringSelect
|
||||
| ComponentType.UserSelect,
|
||||
> extends APIBaseComponent<T> {
|
||||
/**
|
||||
* A developer-defined identifier for the select menu, max 100 characters
|
||||
@@ -1645,10 +1750,10 @@ export interface APIBaseSelectMenuComponent<
|
||||
|
||||
export interface APIBaseAutoPopulatedSelectMenuComponent<
|
||||
T extends
|
||||
| ComponentType.UserSelect
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.ChannelSelect
|
||||
| ComponentType.MentionableSelect
|
||||
| ComponentType.ChannelSelect,
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.UserSelect,
|
||||
D extends SelectMenuDefaultValueType,
|
||||
> extends APIBaseSelectMenuComponent<T> {
|
||||
/**
|
||||
@@ -1688,7 +1793,7 @@ export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
|
||||
*/
|
||||
export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
|
||||
ComponentType.MentionableSelect,
|
||||
SelectMenuDefaultValueType.User | SelectMenuDefaultValueType.Role
|
||||
SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -1729,18 +1834,18 @@ export type APIAutoPopulatedSelectMenuComponent =
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APISelectMenuComponent =
|
||||
| APIStringSelectComponent
|
||||
| APIUserSelectComponent
|
||||
| APIRoleSelectComponent
|
||||
| APIChannelSelectComponent
|
||||
| APIMentionableSelectComponent
|
||||
| APIChannelSelectComponent;
|
||||
| APIRoleSelectComponent
|
||||
| APIStringSelectComponent
|
||||
| APIUserSelectComponent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
|
||||
*/
|
||||
export interface APISelectMenuOption {
|
||||
/**
|
||||
* The user-facing name of the option (max 25 chars)
|
||||
* The user-facing name of the option (max 100 chars)
|
||||
*/
|
||||
label: string;
|
||||
/**
|
||||
@@ -1748,7 +1853,7 @@ export interface APISelectMenuOption {
|
||||
*/
|
||||
value: string;
|
||||
/**
|
||||
* An additional description of the option (max 50 chars)
|
||||
* An additional description of the option (max 100 chars)
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
@@ -1799,6 +1904,20 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-snapshot-object
|
||||
*/
|
||||
export interface APIMessageSnapshot {
|
||||
/**
|
||||
* Subset of the message object fields
|
||||
*/
|
||||
message: APIMessageSnapshotFields;
|
||||
/**
|
||||
* Id of the origin message's guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
@@ -1845,8 +1964,8 @@ export enum ChannelFlags {
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#message-components
|
||||
*/
|
||||
export type APIMessageComponent = APIMessageActionRowComponent | APIActionRowComponent<APIMessageActionRowComponent>;
|
||||
export type APIModalComponent = APIModalActionRowComponent | APIActionRowComponent<APIModalActionRowComponent>;
|
||||
export type APIMessageComponent = APIActionRowComponent<APIMessageActionRowComponent> | APIMessageActionRowComponent;
|
||||
export type APIModalComponent = APIActionRowComponent<APIModalActionRowComponent> | APIModalActionRowComponent;
|
||||
|
||||
export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent;
|
||||
|
||||
@@ -1857,3 +1976,16 @@ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuCom
|
||||
|
||||
// Modal components
|
||||
export type APIModalActionRowComponent = APITextInputComponent;
|
||||
|
||||
export type APIMessageSnapshotFields = Pick<
|
||||
APIMessage,
|
||||
| 'attachments'
|
||||
| 'content'
|
||||
| 'edited_timestamp'
|
||||
| 'embeds'
|
||||
| 'flags'
|
||||
| 'mention_roles'
|
||||
| 'mentions'
|
||||
| 'timestamp'
|
||||
| 'type'
|
||||
>;
|
||||
|
||||
@@ -227,7 +227,7 @@ export interface GatewayActivity {
|
||||
/**
|
||||
* The custom buttons shown in the Rich Presence (max 2)
|
||||
*/
|
||||
buttons?: string[] | GatewayActivityButton[];
|
||||
buttons?: GatewayActivityButton[] | string[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -292,7 +292,7 @@ export interface GatewayActivityTimestamps {
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji
|
||||
*/
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'id' | 'animated'>> & Pick<APIEmoji, 'name'>;
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'animated' | 'id'>> & Pick<APIEmoji, 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
|
||||
@@ -318,7 +318,7 @@ export type GatewayActivityAssets = Partial<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets
|
||||
*/
|
||||
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
|
||||
export type GatewayActivitySecrets = Partial<Record<'join' | 'match' | 'spectate', string>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags
|
||||
|
||||
@@ -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
|
||||
@@ -121,7 +121,7 @@ export interface APIGuild extends APIPartialGuild {
|
||||
/**
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout: 60 | 300 | 900 | 1_800 | 3_600;
|
||||
afk_timeout: 1_800 | 3_600 | 60 | 300 | 900;
|
||||
/**
|
||||
* `true` if the guild widget is enabled
|
||||
*/
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -683,7 +689,7 @@ export enum GuildMemberFlags {
|
||||
*/
|
||||
CompletedOnboarding = 1 << 1,
|
||||
/**
|
||||
* Member bypasses guild verification requirements
|
||||
* Member is exempt from guild verification requirements
|
||||
*/
|
||||
BypassesVerification = 1 << 2,
|
||||
/**
|
||||
@@ -691,21 +697,29 @@ export enum GuildMemberFlags {
|
||||
*/
|
||||
StartedOnboarding = 1 << 3,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
* Member is a guest and can only access the voice channel they were invited to
|
||||
*/
|
||||
IsGuest = 1 << 4,
|
||||
/**
|
||||
* Member has started Server Guide new member actions
|
||||
*/
|
||||
StartedHomeActions = 1 << 5,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
* Member has completed Server Guide new member actions
|
||||
*/
|
||||
CompletedHomeActions = 1 << 6,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
* Member's username, display name, or nickname is blocked by AutoMod
|
||||
*/
|
||||
AutomodQuarantinedUsernameOrGuildNickname = 1 << 7,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
* @deprecated
|
||||
*/
|
||||
AutomodQuarantinedBio = 1 << 8,
|
||||
/**
|
||||
* Member has dismissed the DM settings upsell
|
||||
*/
|
||||
DmSettingsUpsellAcknowledged = 1 << 9,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -806,7 +820,7 @@ export interface APIGuildIntegration {
|
||||
scopes?: OAuth2Scopes[];
|
||||
}
|
||||
|
||||
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription';
|
||||
export type APIGuildIntegrationType = 'discord' | 'guild_subscription' | 'twitch' | 'youtube';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
|
||||
|
||||
@@ -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,9 +197,9 @@ export interface APIExternalGuildScheduledEvent
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
|
||||
*/
|
||||
export type APIGuildScheduledEvent =
|
||||
| APIExternalGuildScheduledEvent
|
||||
| APIStageInstanceGuildScheduledEvent
|
||||
| APIVoiceGuildScheduledEvent
|
||||
| APIExternalGuildScheduledEvent;
|
||||
| APIVoiceGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
|
||||
|
||||
@@ -32,26 +32,26 @@ export * from './_interactions/responses.ts';
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIInteraction =
|
||||
| APIPingInteraction
|
||||
| APIApplicationCommandAutocompleteInteraction
|
||||
| APIApplicationCommandInteraction
|
||||
| APIMessageComponentInteraction
|
||||
| APIApplicationCommandAutocompleteInteraction
|
||||
| APIModalSubmitInteraction;
|
||||
| APIModalSubmitInteraction
|
||||
| APIPingInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIDMInteraction =
|
||||
| APIApplicationCommandAutocompleteDMInteraction
|
||||
| APIApplicationCommandDMInteraction
|
||||
| APIMessageComponentDMInteraction
|
||||
| APIApplicationCommandAutocompleteDMInteraction
|
||||
| APIModalSubmitDMInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIGuildInteraction =
|
||||
| APIApplicationCommandAutocompleteGuildInteraction
|
||||
| APIApplicationCommandGuildInteraction
|
||||
| APIMessageComponentGuildInteraction
|
||||
| APIApplicationCommandAutocompleteGuildInteraction
|
||||
| APIModalSubmitGuildInteraction;
|
||||
|
||||
@@ -11,17 +11,17 @@ import type { APIUser } from './user.ts';
|
||||
|
||||
export type APIInviteGuild = Pick<
|
||||
APIGuild,
|
||||
| 'id'
|
||||
| 'name'
|
||||
| 'splash'
|
||||
| 'banner'
|
||||
| 'icon'
|
||||
| 'vanity_url_code'
|
||||
| 'description'
|
||||
| 'features'
|
||||
| 'verification_level'
|
||||
| 'icon'
|
||||
| 'id'
|
||||
| 'name'
|
||||
| 'nsfw_level'
|
||||
| 'premium_subscription_count'
|
||||
| 'splash'
|
||||
| 'vanity_url_code'
|
||||
| 'verification_level'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -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;
|
||||
}
|
||||
@@ -45,6 +45,8 @@ export interface APIStageInstance {
|
||||
export enum StageInstancePrivacyLevel {
|
||||
/**
|
||||
* The stage instance is visible publicly, such as on stage discovery
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
Public = 1,
|
||||
/**
|
||||
|
||||
@@ -33,6 +33,7 @@ export interface APISticker {
|
||||
* Previously the sticker asset hash, now an empty string
|
||||
*
|
||||
* @deprecated
|
||||
* @unstable This field is no longer documented by Discord and will be removed in v11
|
||||
*/
|
||||
asset?: '';
|
||||
/**
|
||||
@@ -92,7 +93,7 @@ export enum StickerFormatType {
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#sticker-item-object
|
||||
*/
|
||||
export type APIStickerItem = Pick<APISticker, 'id' | 'name' | 'format_type'>;
|
||||
export type APIStickerItem = Pick<APISticker, 'format_type' | 'id' | 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#sticker-pack-object
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,6 +274,8 @@ export interface APIConnection {
|
||||
|
||||
export enum ConnectionService {
|
||||
BattleNet = 'battlenet',
|
||||
BungieNet = 'bungie',
|
||||
Domain = 'domain',
|
||||
eBay = 'ebay',
|
||||
EpicGames = 'epicgames',
|
||||
Facebook = 'facebook',
|
||||
@@ -276,6 +286,7 @@ export enum ConnectionService {
|
||||
PlayStationNetwork = 'playstation',
|
||||
Reddit = 'reddit',
|
||||
RiotGames = 'riotgames',
|
||||
Roblox = 'roblox',
|
||||
Spotify = 'spotify',
|
||||
Skype = 'skype',
|
||||
Steam = 'steam',
|
||||
@@ -316,5 +327,21 @@ export interface APIApplicationRoleConnection {
|
||||
/**
|
||||
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
|
||||
*/
|
||||
metadata: Record<string, string | number>;
|
||||
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
|
||||
*/
|
||||
|
||||
@@ -176,56 +176,56 @@ export enum AuditLogOptionsType {
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyOwnerID
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyAFKChannelID
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyVerificationLevel
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyVanityURLCode
|
||||
| APIAuditLogChangeKey$Add
|
||||
| APIAuditLogChangeKey$Remove
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyWidgetEnabled
|
||||
| APIAuditLogChangeKeyWidgetChannelID
|
||||
| APIAuditLogChangeKeySystemChannelID
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyTopic
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyApplicationID
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyPermissionsNew
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyAFKChannelID
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyAllow
|
||||
| APIAuditLogChangeKeyAllowNew
|
||||
| APIAuditLogChangeKeyApplicationID
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyChannelID
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDenyNew
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyChannelID
|
||||
| APIAuditLogChangeKeyInviterID
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyID
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyEnableEmoticons
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod;
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeyID
|
||||
| APIAuditLogChangeKeyInviterID
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyOwnerID
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyPermissionsNew
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeySystemChannelID
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyTopic
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyVanityURLCode
|
||||
| APIAuditLogChangeKeyVerificationLevel
|
||||
| APIAuditLogChangeKeyWidgetChannelID
|
||||
| APIAuditLogChangeKeyWidgetEnabled;
|
||||
|
||||
/**
|
||||
* Returned when a guild's name is changed
|
||||
|
||||
@@ -78,7 +78,7 @@ export interface APIMessage {
|
||||
attachments: APIAttachment[];
|
||||
embeds: APIEmbed[];
|
||||
reactions?: APIReaction[];
|
||||
nonce?: string | number;
|
||||
nonce?: number | string;
|
||||
pinned: boolean;
|
||||
webhook_id?: string;
|
||||
type: MessageType;
|
||||
|
||||
@@ -123,7 +123,7 @@ export interface GatewayActivityTimestamps {
|
||||
*
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'name' | 'animated'>> & Pick<APIEmoji, 'id'>;
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'animated' | 'name'>> & Pick<APIEmoji, 'id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
|
||||
@@ -149,7 +149,7 @@ export type GatewayActivityAssets = Partial<
|
||||
*
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
|
||||
export type GatewayActivitySecrets = Partial<Record<'join' | 'match' | 'spectate', string>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
|
||||
|
||||
@@ -22,7 +22,7 @@ export enum ApplicationCommandOptionType {
|
||||
*
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export interface APIApplicationCommandOptionChoice<ValueType = string | number> {
|
||||
export interface APIApplicationCommandOptionChoice<ValueType = number | string> {
|
||||
name: string;
|
||||
value: ValueType;
|
||||
}
|
||||
|
||||
@@ -72,15 +72,15 @@ export * from './_chatInput/user.ts';
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIApplicationCommandBasicOption =
|
||||
| APIApplicationCommandStringOption
|
||||
| APIApplicationCommandIntegerOption
|
||||
| APIApplicationCommandAttachmentOption
|
||||
| APIApplicationCommandBooleanOption
|
||||
| APIApplicationCommandUserOption
|
||||
| APIApplicationCommandChannelOption
|
||||
| APIApplicationCommandRoleOption
|
||||
| APIApplicationCommandIntegerOption
|
||||
| APIApplicationCommandMentionableOption
|
||||
| APIApplicationCommandNumberOption
|
||||
| APIApplicationCommandAttachmentOption;
|
||||
| APIApplicationCommandRoleOption
|
||||
| APIApplicationCommandStringOption
|
||||
| APIApplicationCommandUserOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
|
||||
@@ -88,9 +88,9 @@ export type APIApplicationCommandBasicOption =
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandSubcommandOption
|
||||
| APIApplicationCommandBasicOption
|
||||
| APIApplicationCommandSubcommandGroupOption
|
||||
| APIApplicationCommandBasicOption;
|
||||
| APIApplicationCommandSubcommandOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure
|
||||
@@ -98,23 +98,23 @@ export type APIApplicationCommandOption =
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIApplicationCommandInteractionDataOption =
|
||||
| APIApplicationCommandInteractionDataSubcommandOption
|
||||
| APIApplicationCommandInteractionDataBasicOption
|
||||
| APIApplicationCommandInteractionDataSubcommandGroupOption
|
||||
| APIApplicationCommandInteractionDataBasicOption;
|
||||
| APIApplicationCommandInteractionDataSubcommandOption;
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIApplicationCommandInteractionDataBasicOption =
|
||||
| APIApplicationCommandInteractionDataStringOption
|
||||
| APIApplicationCommandInteractionDataIntegerOption
|
||||
| APIApplicationCommandInteractionDataAttachmentOption
|
||||
| APIApplicationCommandInteractionDataBooleanOption
|
||||
| APIApplicationCommandInteractionDataUserOption
|
||||
| APIApplicationCommandInteractionDataChannelOption
|
||||
| APIApplicationCommandInteractionDataRoleOption
|
||||
| APIApplicationCommandInteractionDataIntegerOption
|
||||
| APIApplicationCommandInteractionDataMentionableOption
|
||||
| APIApplicationCommandInteractionDataNumberOption
|
||||
| APIApplicationCommandInteractionDataAttachmentOption;
|
||||
| APIApplicationCommandInteractionDataRoleOption
|
||||
| APIApplicationCommandInteractionDataStringOption
|
||||
| APIApplicationCommandInteractionDataUserOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
|
||||
@@ -56,8 +56,8 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIContextMenuInteractionData =
|
||||
| APIUserApplicationCommandInteractionData
|
||||
| APIMessageApplicationCommandInteractionData;
|
||||
| APIMessageApplicationCommandInteractionData
|
||||
| APIUserApplicationCommandInteractionData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
@@ -111,7 +111,7 @@ export type APIMessageApplicationCommandGuildInteraction =
|
||||
*
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIContextMenuInteraction = APIUserApplicationCommandInteraction | APIMessageApplicationCommandInteraction;
|
||||
export type APIContextMenuInteraction = APIMessageApplicationCommandInteraction | APIUserApplicationCommandInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
@@ -119,8 +119,8 @@ export type APIContextMenuInteraction = APIUserApplicationCommandInteraction | A
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIContextMenuDMInteraction =
|
||||
| APIUserApplicationCommandDMInteraction
|
||||
| APIMessageApplicationCommandDMInteraction;
|
||||
| APIMessageApplicationCommandDMInteraction
|
||||
| APIUserApplicationCommandDMInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
@@ -128,5 +128,5 @@ export type APIContextMenuDMInteraction =
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIContextMenuGuildInteraction =
|
||||
| APIUserApplicationCommandGuildInteraction
|
||||
| APIMessageApplicationCommandGuildInteraction;
|
||||
| APIMessageApplicationCommandGuildInteraction
|
||||
| APIUserApplicationCommandGuildInteraction;
|
||||
|
||||
@@ -101,7 +101,7 @@ export interface APIInteractionDataResolvedChannel extends Required<APIPartialCh
|
||||
*
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'deaf' | 'mute' | 'user'> {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
|
||||
@@ -10,15 +10,15 @@ import type { InteractionType } from './responses.ts';
|
||||
*/
|
||||
export type PartialAPIMessageInteractionGuildMember = Pick<
|
||||
APIGuildMember,
|
||||
| 'roles'
|
||||
| 'premium_since'
|
||||
| 'pending'
|
||||
| 'nick'
|
||||
| 'mute'
|
||||
| 'joined_at'
|
||||
| 'deaf'
|
||||
| 'communication_disabled_until'
|
||||
| 'avatar'
|
||||
| 'communication_disabled_until'
|
||||
| 'deaf'
|
||||
| 'joined_at'
|
||||
| 'mute'
|
||||
| 'nick'
|
||||
| 'pending'
|
||||
| 'premium_since'
|
||||
| 'roles'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -128,7 +128,7 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
*/
|
||||
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'member' | 'guild_id'
|
||||
'guild_id' | 'member'
|
||||
> &
|
||||
Required<Pick<Original, 'user'>>;
|
||||
|
||||
@@ -139,4 +139,4 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
|
||||
Original,
|
||||
'user'
|
||||
> &
|
||||
Required<Pick<Original, 'member' | 'guild_id'>>;
|
||||
Required<Pick<Original, 'guild_id' | 'member'>>;
|
||||
|
||||
@@ -22,12 +22,12 @@ export enum InteractionType {
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIInteractionResponse =
|
||||
| APIInteractionResponsePong
|
||||
| APIApplicationCommandAutocompleteResponse
|
||||
| APIInteractionResponseChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredMessageUpdate
|
||||
| APIInteractionResponsePong
|
||||
| APIInteractionResponseUpdateMessage
|
||||
| APIApplicationCommandAutocompleteResponse
|
||||
| APIModalInteractionResponse;
|
||||
|
||||
/**
|
||||
@@ -127,7 +127,7 @@ export enum InteractionResponseType {
|
||||
*/
|
||||
export type APIInteractionResponseCallbackData = Omit<
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
'username' | 'avatar_url'
|
||||
'avatar_url' | 'username'
|
||||
> & { flags?: MessageFlags };
|
||||
|
||||
/**
|
||||
|
||||
@@ -271,70 +271,70 @@ export enum AuditLogOptionsType {
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyOwnerId
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyPreferredLocale
|
||||
| APIAuditLogChangeKeyAFKChannelId
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyRulesChannelId
|
||||
| APIAuditLogChangeKeyPublicUpdatesChannelId
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyVerificationLevel
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyVanityURLCode
|
||||
| APIAuditLogChangeKey$Add
|
||||
| APIAuditLogChangeKey$Remove
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyWidgetEnabled
|
||||
| APIAuditLogChangeKeyWidgetChannelId
|
||||
| APIAuditLogChangeKeySystemChannelId
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyTopic
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyApplicationId
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyAFKChannelId
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyAllow
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyChannelId
|
||||
| APIAuditLogChangeKeyInviterId
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyId
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyEnableEmoticons
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyUserLimit
|
||||
| APIAuditLogChangeKeyPrivacyLevel
|
||||
| APIAuditLogChangeKeyTags
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyApplicationId
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyChannelId
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
| APIAuditLogChangeKeyEnableEmoticons
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeyId
|
||||
| APIAuditLogChangeKeyInviterId
|
||||
| APIAuditLogChangeKeyLocation
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil;
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyOwnerId
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyPreferredLocale
|
||||
| APIAuditLogChangeKeyPrivacyLevel
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyPublicUpdatesChannelId
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyRulesChannelId
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeySystemChannelId
|
||||
| APIAuditLogChangeKeyTags
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyTopic
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyUserLimit
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyVanityURLCode
|
||||
| APIAuditLogChangeKeyVerificationLevel
|
||||
| APIAuditLogChangeKeyWidgetChannelId
|
||||
| APIAuditLogChangeKeyWidgetEnabled;
|
||||
|
||||
/**
|
||||
* Returned when an entity's name is changed
|
||||
|
||||
@@ -53,11 +53,11 @@ export type TextChannelType = ChannelType.DM | ChannelType.GroupDM | ChannelType
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type GuildChannelType = Exclude<
|
||||
| TextChannelType
|
||||
| ChannelType.GuildVoice
|
||||
| ChannelType.GuildStageVoice
|
||||
| ChannelType.GuildNews
|
||||
| ChannelType.GuildStore,
|
||||
| ChannelType.GuildStageVoice
|
||||
| ChannelType.GuildStore
|
||||
| ChannelType.GuildVoice
|
||||
| TextChannelType,
|
||||
ChannelType.DM | ChannelType.GroupDM
|
||||
>;
|
||||
|
||||
@@ -218,14 +218,14 @@ export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM>
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIChannel =
|
||||
| APIGroupDMChannel
|
||||
| APIDMChannel
|
||||
| APITextChannel
|
||||
| APINewsChannel
|
||||
| APIGuildStoreChannel
|
||||
| APIVoiceChannel
|
||||
| APIGroupDMChannel
|
||||
| APIGuildCategoryChannel
|
||||
| APINewsChannel;
|
||||
| APIGuildStoreChannel
|
||||
| APINewsChannel
|
||||
| APINewsChannel
|
||||
| APITextChannel
|
||||
| APIVoiceChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
@@ -397,7 +397,7 @@ export interface APIMessage {
|
||||
* **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE`
|
||||
* event to ensure it got sent**
|
||||
*/
|
||||
nonce?: string | number;
|
||||
nonce?: number | string;
|
||||
/**
|
||||
* Whether this message is pinned
|
||||
*/
|
||||
@@ -1170,7 +1170,7 @@ export interface APIMessageComponentEmoji {
|
||||
*/
|
||||
export interface APIButtonComponentWithCustomId
|
||||
extends APIButtonComponentBase<
|
||||
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
|
||||
ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success
|
||||
> {
|
||||
/**
|
||||
* The custom_id to be sent in the interaction when clicked
|
||||
@@ -1327,11 +1327,11 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
*
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIMessageComponent = APIMessageActionRowComponent | APIActionRowComponent<APIMessageActionRowComponent>;
|
||||
export type APIMessageComponent = APIActionRowComponent<APIMessageActionRowComponent> | APIMessageActionRowComponent;
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIModalComponent = APIModalActionRowComponent | APIActionRowComponent<APIModalActionRowComponent>;
|
||||
export type APIModalComponent = APIActionRowComponent<APIModalActionRowComponent> | APIModalActionRowComponent;
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
|
||||
@@ -219,7 +219,7 @@ export interface GatewayActivity {
|
||||
/**
|
||||
* The custom buttons shown in the Rich Presence (max 2)
|
||||
*/
|
||||
buttons?: string[] | GatewayActivityButton[];
|
||||
buttons?: GatewayActivityButton[] | string[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -284,7 +284,7 @@ export interface GatewayActivityTimestamps {
|
||||
*
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'id' | 'animated'>> & Pick<APIEmoji, 'name'>;
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'animated' | 'id'>> & Pick<APIEmoji, 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
|
||||
@@ -316,7 +316,7 @@ export type GatewayActivityAssets = Partial<
|
||||
*
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
|
||||
export type GatewayActivitySecrets = Partial<Record<'join' | 'match' | 'spectate', string>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
|
||||
|
||||
@@ -790,7 +790,7 @@ export interface APIGuildIntegration {
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIGuildInteractionType = 'twitch' | 'youtube' | 'discord';
|
||||
export type APIGuildInteractionType = 'discord' | 'twitch' | 'youtube';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
|
||||
|
||||
@@ -104,9 +104,9 @@ export interface APIExternalGuildScheduledEvent
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIGuildScheduledEvent =
|
||||
| APIExternalGuildScheduledEvent
|
||||
| APIStageInstanceGuildScheduledEvent
|
||||
| APIVoiceGuildScheduledEvent
|
||||
| APIExternalGuildScheduledEvent;
|
||||
| APIVoiceGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
|
||||
|
||||
@@ -34,11 +34,11 @@ export * from './_interactions/responses.ts';
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIInteraction =
|
||||
| APIPingInteraction
|
||||
| APIApplicationCommandAutocompleteInteraction
|
||||
| APIApplicationCommandInteraction
|
||||
| APIMessageComponentInteraction
|
||||
| APIApplicationCommandAutocompleteInteraction
|
||||
| APIModalSubmitInteraction;
|
||||
| APIModalSubmitInteraction
|
||||
| APIPingInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
@@ -46,9 +46,9 @@ export type APIInteraction =
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIDMInteraction =
|
||||
| APIApplicationCommandAutocompleteDMInteraction
|
||||
| APIApplicationCommandDMInteraction
|
||||
| APIMessageComponentDMInteraction
|
||||
| APIApplicationCommandAutocompleteDMInteraction
|
||||
| APIModalSubmitDMInteraction;
|
||||
|
||||
/**
|
||||
@@ -57,7 +57,7 @@ export type APIDMInteraction =
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIGuildInteraction =
|
||||
| APIApplicationCommandAutocompleteGuildInteraction
|
||||
| APIApplicationCommandGuildInteraction
|
||||
| APIMessageComponentGuildInteraction
|
||||
| APIApplicationCommandAutocompleteGuildInteraction
|
||||
| APIModalSubmitGuildInteraction;
|
||||
|
||||
@@ -11,17 +11,17 @@ import type { APIUser } from './user.ts';
|
||||
|
||||
export type APIInviteGuild = Pick<
|
||||
APIGuild,
|
||||
| 'id'
|
||||
| 'name'
|
||||
| 'splash'
|
||||
| 'banner'
|
||||
| 'icon'
|
||||
| 'vanity_url_code'
|
||||
| 'description'
|
||||
| 'features'
|
||||
| 'verification_level'
|
||||
| 'icon'
|
||||
| 'id'
|
||||
| 'name'
|
||||
| 'nsfw_level'
|
||||
| 'premium_subscription_count'
|
||||
| 'splash'
|
||||
| 'vanity_url_code'
|
||||
| 'verification_level'
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -99,7 +99,7 @@ export enum StickerFormatType {
|
||||
*
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type APIStickerItem = Pick<APISticker, 'id' | 'name' | 'format_type'>;
|
||||
export type APIStickerItem = Pick<APISticker, 'format_type' | 'id' | 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#sticker-pack-object
|
||||
|
||||
@@ -20,7 +20,7 @@ export enum ApplicationCommandOptionType {
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure
|
||||
*/
|
||||
export interface APIApplicationCommandOptionChoice<ValueType = string | number> {
|
||||
export interface APIApplicationCommandOptionChoice<ValueType = number | string> {
|
||||
name: string;
|
||||
name_localizations?: LocalizationMap | null;
|
||||
value: ValueType;
|
||||
|
||||
@@ -65,42 +65,42 @@ export * from './_chatInput/user.ts';
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
|
||||
*/
|
||||
export type APIApplicationCommandBasicOption =
|
||||
| APIApplicationCommandStringOption
|
||||
| APIApplicationCommandIntegerOption
|
||||
| APIApplicationCommandAttachmentOption
|
||||
| APIApplicationCommandBooleanOption
|
||||
| APIApplicationCommandUserOption
|
||||
| APIApplicationCommandChannelOption
|
||||
| APIApplicationCommandRoleOption
|
||||
| APIApplicationCommandIntegerOption
|
||||
| APIApplicationCommandMentionableOption
|
||||
| APIApplicationCommandNumberOption
|
||||
| APIApplicationCommandAttachmentOption;
|
||||
| APIApplicationCommandRoleOption
|
||||
| APIApplicationCommandStringOption
|
||||
| APIApplicationCommandUserOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
|
||||
*/
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandSubcommandOption
|
||||
| APIApplicationCommandBasicOption
|
||||
| APIApplicationCommandSubcommandGroupOption
|
||||
| APIApplicationCommandBasicOption;
|
||||
| APIApplicationCommandSubcommandOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure
|
||||
*/
|
||||
export type APIApplicationCommandInteractionDataOption =
|
||||
| APIApplicationCommandInteractionDataSubcommandOption
|
||||
| APIApplicationCommandInteractionDataBasicOption
|
||||
| APIApplicationCommandInteractionDataSubcommandGroupOption
|
||||
| APIApplicationCommandInteractionDataBasicOption;
|
||||
| APIApplicationCommandInteractionDataSubcommandOption;
|
||||
|
||||
export type APIApplicationCommandInteractionDataBasicOption =
|
||||
| APIApplicationCommandInteractionDataStringOption
|
||||
| APIApplicationCommandInteractionDataIntegerOption
|
||||
| APIApplicationCommandInteractionDataAttachmentOption
|
||||
| APIApplicationCommandInteractionDataBooleanOption
|
||||
| APIApplicationCommandInteractionDataUserOption
|
||||
| APIApplicationCommandInteractionDataChannelOption
|
||||
| APIApplicationCommandInteractionDataRoleOption
|
||||
| APIApplicationCommandInteractionDataIntegerOption
|
||||
| APIApplicationCommandInteractionDataMentionableOption
|
||||
| APIApplicationCommandInteractionDataNumberOption
|
||||
| APIApplicationCommandInteractionDataAttachmentOption;
|
||||
| APIApplicationCommandInteractionDataRoleOption
|
||||
| APIApplicationCommandInteractionDataStringOption
|
||||
| APIApplicationCommandInteractionDataUserOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
|
||||
@@ -33,8 +33,8 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export type APIContextMenuInteractionData =
|
||||
| APIUserApplicationCommandInteractionData
|
||||
| APIMessageApplicationCommandInteractionData;
|
||||
| APIMessageApplicationCommandInteractionData
|
||||
| APIUserApplicationCommandInteractionData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
@@ -74,18 +74,18 @@ export type APIMessageApplicationCommandGuildInteraction =
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIContextMenuInteraction = APIUserApplicationCommandInteraction | APIMessageApplicationCommandInteraction;
|
||||
export type APIContextMenuInteraction = APIMessageApplicationCommandInteraction | APIUserApplicationCommandInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIContextMenuDMInteraction =
|
||||
| APIUserApplicationCommandDMInteraction
|
||||
| APIMessageApplicationCommandDMInteraction;
|
||||
| APIMessageApplicationCommandDMInteraction
|
||||
| APIUserApplicationCommandDMInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIContextMenuGuildInteraction =
|
||||
| APIUserApplicationCommandGuildInteraction
|
||||
| APIMessageApplicationCommandGuildInteraction;
|
||||
| APIMessageApplicationCommandGuildInteraction
|
||||
| APIUserApplicationCommandGuildInteraction;
|
||||
|
||||
@@ -54,6 +54,6 @@ export enum ApplicationCommandPermissionType {
|
||||
*/
|
||||
export const APIApplicationCommandPermissionsConstant = {
|
||||
// eslint-disable-next-line unicorn/prefer-native-coercion-functions
|
||||
Everyone: (guildId: string | bigint): Snowflake => String(guildId),
|
||||
AllChannels: (guildId: string | bigint): Snowflake => String(BigInt(guildId) - 1n),
|
||||
Everyone: (guildId: bigint | string): Snowflake => String(guildId),
|
||||
AllChannels: (guildId: bigint | string): Snowflake => String(BigInt(guildId) - 1n),
|
||||
};
|
||||
|
||||
@@ -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,14 @@ 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])`
|
||||
*/
|
||||
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]`.
|
||||
*/
|
||||
contexts?: InteractionContextType[] | null;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
@@ -103,6 +113,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,
|
||||
/**
|
||||
* App is installable to users
|
||||
*/
|
||||
UserInstall,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types
|
||||
*/
|
||||
export enum InteractionContextType {
|
||||
/**
|
||||
* Interaction can be used within servers
|
||||
*/
|
||||
Guild,
|
||||
/**
|
||||
* Interaction can be used within DMs with the app's bot user
|
||||
*/
|
||||
BotDM,
|
||||
/**
|
||||
* Interaction can be used within Group DMs and DMs other than the app's bot user
|
||||
*/
|
||||
PrivateChannel,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
@@ -118,7 +160,7 @@ export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationC
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.ApplicationCommand, Data>,
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions'
|
||||
'app_permissions' | 'channel_id' | 'channel' | '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,17 +14,51 @@ 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,
|
||||
| 'roles'
|
||||
| 'premium_since'
|
||||
| 'pending'
|
||||
| 'nick'
|
||||
| 'mute'
|
||||
| 'joined_at'
|
||||
| 'deaf'
|
||||
| 'communication_disabled_until'
|
||||
| 'avatar'
|
||||
| 'communication_disabled_until'
|
||||
| 'deaf'
|
||||
| 'joined_at'
|
||||
| 'mute'
|
||||
| 'nick'
|
||||
| 'pending'
|
||||
| 'premium_since'
|
||||
| 'roles'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -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,11 +169,23 @@ 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,
|
||||
'member' | 'guild_id'
|
||||
'guild_id' | 'member'
|
||||
> &
|
||||
Required<Pick<Original, 'user'>>;
|
||||
|
||||
@@ -147,7 +193,7 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
|
||||
Original,
|
||||
'user'
|
||||
> &
|
||||
Required<Pick<Original, 'member' | 'guild_id'>>;
|
||||
Required<Pick<Original, 'guild_id' | 'member'>>;
|
||||
|
||||
export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> extends Required<APIPartialChannel> {
|
||||
type: T;
|
||||
@@ -160,12 +206,12 @@ export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> ex
|
||||
export type APIInteractionDataResolvedChannel =
|
||||
| APIInteractionDataResolvedChannelBase<Exclude<ChannelType, ThreadChannelType>>
|
||||
| (APIInteractionDataResolvedChannelBase<ThreadChannelType> &
|
||||
Pick<APIThreadChannel, 'thread_metadata' | 'parent_id'>);
|
||||
Pick<APIThreadChannel, 'parent_id' | 'thread_metadata'>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'deaf' | 'mute' | 'user'> {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
@@ -188,8 +234,8 @@ export type APIChatInputApplicationCommandInteractionDataResolved = APIInteracti
|
||||
/**
|
||||
* `users` and optional `members` from APIInteractionDataResolved, for user commands and user selects
|
||||
*/
|
||||
export type APIUserInteractionDataResolved = Required<Pick<APIInteractionDataResolved, 'users'>> &
|
||||
Pick<APIInteractionDataResolved, 'members'>;
|
||||
export type APIUserInteractionDataResolved = Pick<APIInteractionDataResolved, 'members'> &
|
||||
Required<Pick<APIInteractionDataResolved, 'users'>>;
|
||||
|
||||
/**
|
||||
* @deprecated Renamed to `APIUserInteractionDataResolved`
|
||||
|
||||
@@ -15,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -26,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -37,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
|
||||
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -76,7 +76,7 @@ export interface APIMessageRoleSelectInteractionData
|
||||
export interface APIMessageMentionableSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.MentionableSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: Pick<APIInteractionDataResolved, 'users' | 'members' | 'roles'>;
|
||||
resolved: Pick<APIInteractionDataResolved, 'members' | 'roles' | 'users'>;
|
||||
}
|
||||
|
||||
export interface APIMessageChannelSelectInteractionData
|
||||
@@ -86,11 +86,11 @@ export interface APIMessageChannelSelectInteractionData
|
||||
}
|
||||
|
||||
export type APIMessageSelectMenuInteractionData =
|
||||
| APIMessageStringSelectInteractionData
|
||||
| APIMessageUserSelectInteractionData
|
||||
| APIMessageRoleSelectInteractionData
|
||||
| APIMessageChannelSelectInteractionData
|
||||
| APIMessageMentionableSelectInteractionData
|
||||
| APIMessageChannelSelectInteractionData;
|
||||
| APIMessageRoleSelectInteractionData
|
||||
| APIMessageStringSelectInteractionData
|
||||
| APIMessageUserSelectInteractionData;
|
||||
|
||||
export type APIMessageComponentDMInteraction = APIDMInteractionWrapper<APIMessageComponentInteraction>;
|
||||
|
||||
|
||||
@@ -18,12 +18,12 @@ export enum InteractionType {
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object
|
||||
*/
|
||||
export type APIInteractionResponse =
|
||||
| APIInteractionResponsePong
|
||||
| APIApplicationCommandAutocompleteResponse
|
||||
| APIInteractionResponseChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredMessageUpdate
|
||||
| APIInteractionResponsePong
|
||||
| APIInteractionResponseUpdateMessage
|
||||
| APIApplicationCommandAutocompleteResponse
|
||||
| APIModalInteractionResponse
|
||||
| APIPremiumRequiredInteractionResponse;
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
@@ -107,7 +109,7 @@ export enum InteractionResponseType {
|
||||
*/
|
||||
export type APIInteractionResponseCallbackData = Omit<
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
'username' | 'avatar_url'
|
||||
'avatar_url' | 'username'
|
||||
> & { flags?: MessageFlags };
|
||||
|
||||
export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
|
||||
@@ -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';
|
||||
@@ -63,6 +64,7 @@ export interface APIApplication {
|
||||
* An empty string
|
||||
*
|
||||
* @deprecated This field will be removed in v11
|
||||
* @unstable This field is no longer documented by Discord and will be removed in v11
|
||||
*/
|
||||
summary: '';
|
||||
/**
|
||||
@@ -107,6 +109,10 @@ export interface APIApplication {
|
||||
* Approximate count of guilds the application has been added to
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* Approximate count of users that have installed the app
|
||||
*/
|
||||
approximate_user_install_count?: number;
|
||||
/**
|
||||
* Array of redirect URIs for the application
|
||||
*/
|
||||
@@ -128,6 +134,10 @@ 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
|
||||
*/
|
||||
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
@@ -139,6 +149,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,13 +10,14 @@ 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,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildMFALevel,
|
||||
GuildSystemChannelFlags,
|
||||
GuildVerificationLevel,
|
||||
IntegrationExpireBehavior,
|
||||
} from './guild.ts';
|
||||
@@ -204,6 +205,15 @@ export enum AuditLogEvent {
|
||||
|
||||
CreatorMonetizationRequestCreated = 150,
|
||||
CreatorMonetizationTermsAccepted,
|
||||
|
||||
OnboardingPromptCreate = 163,
|
||||
OnboardingPromptUpdate,
|
||||
OnboardingPromptDelete,
|
||||
OnboardingCreate,
|
||||
OnboardingUpdate,
|
||||
|
||||
HomeSettingsCreate = 190,
|
||||
HomeSettingsUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -335,82 +345,87 @@ export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
|
||||
*/
|
||||
export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeyImageHash
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyOwnerId
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyPreferredLocale
|
||||
| APIAuditLogChangeKeyAFKChannelId
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyRulesChannelId
|
||||
| APIAuditLogChangeKeyPublicUpdatesChannelId
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyVerificationLevel
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyVanityURLCode
|
||||
| APIAuditLogChangeKey$Add
|
||||
| APIAuditLogChangeKey$Remove
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyWidgetEnabled
|
||||
| APIAuditLogChangeKeyWidgetChannelId
|
||||
| APIAuditLogChangeKeySystemChannelId
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyTopic
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyApplicationId
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyActions
|
||||
| APIAuditLogChangeKeyAFKChannelId
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyAllow
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyChannelId
|
||||
| APIAuditLogChangeKeyInviterId
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyApplicationId
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyAvailableTags
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyId
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyChannelId
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDefaultReactionEmoji
|
||||
| APIAuditLogChangeKeyDefaultThreadRateLimitPerUser
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
| APIAuditLogChangeKeyEnabled
|
||||
| APIAuditLogChangeKeyEnableEmoticons
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyEventType
|
||||
| APIAuditLogChangeKeyExemptChannels
|
||||
| APIAuditLogChangeKeyExemptRoles
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyUserLimit
|
||||
| APIAuditLogChangeKeyPrivacyLevel
|
||||
| APIAuditLogChangeKeyTags
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFlags
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeyId
|
||||
| APIAuditLogChangeKeyImageHash
|
||||
| APIAuditLogChangeKeyInviterId
|
||||
| APIAuditLogChangeKeyLocation
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil
|
||||
| APIAuditLogChangeKeyTriggerType
|
||||
| APIAuditLogChangeKeyEventType
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyOwnerId
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyPreferredLocale
|
||||
| APIAuditLogChangeKeyPrivacyLevel
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyPublicUpdatesChannelId
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyRulesChannelId
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeySystemChannelFlags
|
||||
| APIAuditLogChangeKeySystemChannelId
|
||||
| APIAuditLogChangeKeyTags
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyTopic
|
||||
| APIAuditLogChangeKeyTriggerMetadata
|
||||
| APIAuditLogChangeKeyActions
|
||||
| APIAuditLogChangeKeyEnabled
|
||||
| APIAuditLogChangeKeyExemptRoles
|
||||
| APIAuditLogChangeKeyExemptChannels;
|
||||
| APIAuditLogChangeKeyTriggerType
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyUserLimit
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyVanityURLCode
|
||||
| APIAuditLogChangeKeyVerificationLevel
|
||||
| APIAuditLogChangeKeyWidgetChannelId
|
||||
| APIAuditLogChangeKeyWidgetEnabled;
|
||||
|
||||
/**
|
||||
* Returned when an entity's name is changed
|
||||
@@ -521,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
|
||||
@@ -543,6 +558,14 @@ export type APIAuditLogChangeKeyWidgetEnabled = AuditLogChangeData<'widget_enabl
|
||||
*/
|
||||
export type APIAuditLogChangeKeyWidgetChannelId = AuditLogChangeData<'widget_channel_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's system_channel_flags is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeySystemChannelFlags = AuditLogChangeData<
|
||||
'system_channel_flags',
|
||||
GuildSystemChannelFlags
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's system_channel_id is changed
|
||||
*/
|
||||
@@ -816,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';
|
||||
|
||||
@@ -41,15 +42,15 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
|
||||
}
|
||||
|
||||
export type TextChannelType =
|
||||
| ChannelType.AnnouncementThread
|
||||
| ChannelType.DM
|
||||
| ChannelType.GroupDM
|
||||
| ChannelType.GuildAnnouncement
|
||||
| ChannelType.PublicThread
|
||||
| ChannelType.PrivateThread
|
||||
| ChannelType.AnnouncementThread
|
||||
| ChannelType.GuildStageVoice
|
||||
| ChannelType.GuildText
|
||||
| ChannelType.GuildVoice
|
||||
| ChannelType.GuildStageVoice;
|
||||
| ChannelType.PrivateThread
|
||||
| ChannelType.PublicThread;
|
||||
|
||||
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
@@ -110,7 +111,7 @@ export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelB
|
||||
|
||||
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APIGuildTextChannel<T extends GuildTextChannelType | ChannelType.GuildForum | ChannelType.GuildMedia>
|
||||
export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType>
|
||||
extends Omit<APITextBasedChannel<T>, 'name'>,
|
||||
APIGuildChannel<T> {
|
||||
/**
|
||||
@@ -134,7 +135,7 @@ export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>
|
||||
|
||||
export interface APIVoiceChannelBase<T extends ChannelType>
|
||||
extends APIGuildChannel<T>,
|
||||
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
|
||||
Omit<APITextBasedChannel<T>, 'last_pin_timestamp' | 'name'> {
|
||||
/**
|
||||
* The bitrate (in bits) of the voice or stage channel
|
||||
*/
|
||||
@@ -200,7 +201,7 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
|
||||
managed?: boolean;
|
||||
}
|
||||
|
||||
export type ThreadChannelType = ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread;
|
||||
export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
|
||||
|
||||
export interface APIThreadChannel
|
||||
extends Omit<APITextBasedChannel<ThreadChannelType>, 'name'>,
|
||||
@@ -369,16 +370,16 @@ export type APIGuildMediaChannel = APIThreadOnlyChannel<ChannelType.GuildMedia>;
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
|
||||
*/
|
||||
export type APIChannel =
|
||||
| APIGroupDMChannel
|
||||
| APIDMChannel
|
||||
| APITextChannel
|
||||
| APINewsChannel
|
||||
| APIGuildVoiceChannel
|
||||
| APIGuildStageVoiceChannel
|
||||
| APIGroupDMChannel
|
||||
| APIGuildCategoryChannel
|
||||
| APIThreadChannel
|
||||
| APIGuildForumChannel
|
||||
| APIGuildMediaChannel;
|
||||
| APIGuildMediaChannel
|
||||
| APIGuildStageVoiceChannel
|
||||
| APIGuildVoiceChannel
|
||||
| APINewsChannel
|
||||
| APITextChannel
|
||||
| APIThreadChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
@@ -566,7 +567,7 @@ export interface APIMessage {
|
||||
/**
|
||||
* Any attached files
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
@@ -599,7 +600,7 @@ export interface APIMessage {
|
||||
* **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE`
|
||||
* event to ensure it got sent**
|
||||
*/
|
||||
nonce?: string | number;
|
||||
nonce?: number | string;
|
||||
/**
|
||||
* Whether this message is pinned
|
||||
*/
|
||||
@@ -658,6 +659,10 @@ 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
|
||||
*/
|
||||
interaction_metadata?: APIMessageInteractionMetadata;
|
||||
/**
|
||||
* Sent if the message is a response to an Interaction
|
||||
*/
|
||||
@@ -702,6 +707,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 +768,11 @@ export enum MessageType {
|
||||
StageRaiseHand,
|
||||
StageTopic,
|
||||
GuildApplicationPremiumSubscription,
|
||||
|
||||
GuildIncidentAlertModeEnabled = 36,
|
||||
GuildIncidentAlertModeDisabled,
|
||||
GuildIncidentReportRaid,
|
||||
GuildIncidentReportFalseAlarm,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -768,6 +797,10 @@ export interface APIMessageActivity {
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
/**
|
||||
* Type of reference
|
||||
*/
|
||||
type?: MessageReferenceType;
|
||||
/**
|
||||
* ID of the originating message
|
||||
*/
|
||||
@@ -792,6 +825,20 @@ export enum MessageActivityType {
|
||||
JoinRequest = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-types
|
||||
*/
|
||||
export enum MessageReferenceType {
|
||||
/**
|
||||
* A standard reference used by replies
|
||||
*/
|
||||
Default,
|
||||
/**
|
||||
* Reference used to point to a message at a point in time
|
||||
*/
|
||||
Forward,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
@@ -846,6 +893,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
|
||||
*/
|
||||
@@ -865,19 +926,45 @@ export interface APIFollowedChannel {
|
||||
*/
|
||||
export interface APIReaction {
|
||||
/**
|
||||
* Times this emoji has been used to react
|
||||
* Total number of times this emoji has been used to react (including super reacts)
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* An object detailing the individual reaction counts for different types of reactions
|
||||
*/
|
||||
count_details: APIReactionCountDetails;
|
||||
/**
|
||||
* Whether the current user reacted using this emoji
|
||||
*/
|
||||
me: boolean;
|
||||
/**
|
||||
* Whether the current user super-reacted using this emoji
|
||||
*/
|
||||
me_burst: boolean;
|
||||
/**
|
||||
* Emoji information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/emoji#emoji-object
|
||||
*/
|
||||
emoji: APIPartialEmoji;
|
||||
/**
|
||||
* Hexadecimal colors used for this super reaction
|
||||
*/
|
||||
burst_colors: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#reaction-count-details-object-reaction-count-details-structure
|
||||
*/
|
||||
export interface APIReactionCountDetails {
|
||||
/**
|
||||
* Count of super reactions
|
||||
*/
|
||||
burst: number;
|
||||
/**
|
||||
* Count of normal reactions
|
||||
*/
|
||||
normal: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1293,7 +1380,7 @@ export interface APIEmbedField {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
|
||||
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
|
||||
*/
|
||||
export interface APIAttachment {
|
||||
/**
|
||||
@@ -1304,6 +1391,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* The title of the file
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
@@ -1537,7 +1628,7 @@ export interface APIMessageComponentEmoji {
|
||||
|
||||
export interface APIButtonComponentWithCustomId
|
||||
extends APIButtonComponentBase<
|
||||
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
|
||||
ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success
|
||||
> {
|
||||
/**
|
||||
* The custom_id to be sent in the interaction when clicked
|
||||
@@ -1552,7 +1643,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
|
||||
url: string;
|
||||
}
|
||||
|
||||
export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
|
||||
export interface APIButtonComponentWithSKUId
|
||||
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
|
||||
/**
|
||||
* The id for a purchasable SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
}
|
||||
|
||||
export type APIButtonComponent =
|
||||
| APIButtonComponentWithCustomId
|
||||
| APIButtonComponentWithSKUId
|
||||
| APIButtonComponentWithURL;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
|
||||
@@ -1563,6 +1665,7 @@ export enum ButtonStyle {
|
||||
Success,
|
||||
Danger,
|
||||
Link,
|
||||
Premium,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1578,11 +1681,11 @@ export enum TextInputStyle {
|
||||
*/
|
||||
export interface APIBaseSelectMenuComponent<
|
||||
T extends
|
||||
| ComponentType.StringSelect
|
||||
| ComponentType.UserSelect
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.ChannelSelect
|
||||
| ComponentType.MentionableSelect
|
||||
| ComponentType.ChannelSelect,
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.StringSelect
|
||||
| ComponentType.UserSelect,
|
||||
> extends APIBaseComponent<T> {
|
||||
/**
|
||||
* A developer-defined identifier for the select menu, max 100 characters
|
||||
@@ -1614,10 +1717,10 @@ export interface APIBaseSelectMenuComponent<
|
||||
|
||||
export interface APIBaseAutoPopulatedSelectMenuComponent<
|
||||
T extends
|
||||
| ComponentType.UserSelect
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.ChannelSelect
|
||||
| ComponentType.MentionableSelect
|
||||
| ComponentType.ChannelSelect,
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.UserSelect,
|
||||
D extends SelectMenuDefaultValueType,
|
||||
> extends APIBaseSelectMenuComponent<T> {
|
||||
/**
|
||||
@@ -1657,7 +1760,7 @@ export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
|
||||
*/
|
||||
export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
|
||||
ComponentType.MentionableSelect,
|
||||
SelectMenuDefaultValueType.User | SelectMenuDefaultValueType.Role
|
||||
SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -1698,18 +1801,18 @@ export type APIAutoPopulatedSelectMenuComponent =
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APISelectMenuComponent =
|
||||
| APIStringSelectComponent
|
||||
| APIUserSelectComponent
|
||||
| APIRoleSelectComponent
|
||||
| APIChannelSelectComponent
|
||||
| APIMentionableSelectComponent
|
||||
| APIChannelSelectComponent;
|
||||
| APIRoleSelectComponent
|
||||
| APIStringSelectComponent
|
||||
| APIUserSelectComponent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
|
||||
*/
|
||||
export interface APISelectMenuOption {
|
||||
/**
|
||||
* The user-facing name of the option (max 25 chars)
|
||||
* The user-facing name of the option (max 100 chars)
|
||||
*/
|
||||
label: string;
|
||||
/**
|
||||
@@ -1717,7 +1820,7 @@ export interface APISelectMenuOption {
|
||||
*/
|
||||
value: string;
|
||||
/**
|
||||
* An additional description of the option (max 50 chars)
|
||||
* An additional description of the option (max 100 chars)
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
@@ -1768,6 +1871,20 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-snapshot-object
|
||||
*/
|
||||
export interface APIMessageSnapshot {
|
||||
/**
|
||||
* Subset of the message object fields
|
||||
*/
|
||||
message: APIMessageSnapshotFields;
|
||||
/**
|
||||
* Id of the origin message's guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
@@ -1814,8 +1931,8 @@ export enum ChannelFlags {
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#message-components
|
||||
*/
|
||||
export type APIMessageComponent = APIMessageActionRowComponent | APIActionRowComponent<APIMessageActionRowComponent>;
|
||||
export type APIModalComponent = APIModalActionRowComponent | APIActionRowComponent<APIModalActionRowComponent>;
|
||||
export type APIMessageComponent = APIActionRowComponent<APIMessageActionRowComponent> | APIMessageActionRowComponent;
|
||||
export type APIModalComponent = APIActionRowComponent<APIModalActionRowComponent> | APIModalActionRowComponent;
|
||||
|
||||
export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent;
|
||||
|
||||
@@ -1826,3 +1943,16 @@ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuCom
|
||||
|
||||
// Modal components
|
||||
export type APIModalActionRowComponent = APITextInputComponent;
|
||||
|
||||
export type APIMessageSnapshotFields = Pick<
|
||||
APIMessage,
|
||||
| 'attachments'
|
||||
| 'content'
|
||||
| 'edited_timestamp'
|
||||
| 'embeds'
|
||||
| 'flags'
|
||||
| 'mention_roles'
|
||||
| 'mentions'
|
||||
| 'timestamp'
|
||||
| 'type'
|
||||
>;
|
||||
|
||||
@@ -215,7 +215,7 @@ export interface GatewayActivity {
|
||||
/**
|
||||
* The custom buttons shown in the Rich Presence (max 2)
|
||||
*/
|
||||
buttons?: string[] | GatewayActivityButton[];
|
||||
buttons?: GatewayActivityButton[] | string[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -280,7 +280,7 @@ export interface GatewayActivityTimestamps {
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji
|
||||
*/
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'id' | 'animated'>> & Pick<APIEmoji, 'name'>;
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'animated' | 'id'>> & Pick<APIEmoji, 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
|
||||
@@ -306,7 +306,7 @@ export type GatewayActivityAssets = Partial<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets
|
||||
*/
|
||||
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
|
||||
export type GatewayActivitySecrets = Partial<Record<'join' | 'match' | 'spectate', string>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags
|
||||
|
||||
@@ -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
|
||||
@@ -121,7 +121,7 @@ export interface APIGuild extends APIPartialGuild {
|
||||
/**
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout: 60 | 300 | 900 | 1_800 | 3_600;
|
||||
afk_timeout: 1_800 | 3_600 | 60 | 300 | 900;
|
||||
/**
|
||||
* `true` if the guild widget is enabled
|
||||
*/
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -675,7 +681,7 @@ export enum GuildMemberFlags {
|
||||
*/
|
||||
CompletedOnboarding = 1 << 1,
|
||||
/**
|
||||
* Member bypasses guild verification requirements
|
||||
* Member is exempt from guild verification requirements
|
||||
*/
|
||||
BypassesVerification = 1 << 2,
|
||||
/**
|
||||
@@ -683,21 +689,29 @@ export enum GuildMemberFlags {
|
||||
*/
|
||||
StartedOnboarding = 1 << 3,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
* Member is a guest and can only access the voice channel they were invited to
|
||||
*/
|
||||
IsGuest = 1 << 4,
|
||||
/**
|
||||
* Member has started Server Guide new member actions
|
||||
*/
|
||||
StartedHomeActions = 1 << 5,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
* Member has completed Server Guide new member actions
|
||||
*/
|
||||
CompletedHomeActions = 1 << 6,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
* Member's username, display name, or nickname is blocked by AutoMod
|
||||
*/
|
||||
AutomodQuarantinedUsernameOrGuildNickname = 1 << 7,
|
||||
/**
|
||||
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
* @deprecated
|
||||
*/
|
||||
AutomodQuarantinedBio = 1 << 8,
|
||||
/**
|
||||
* Member has dismissed the DM settings upsell
|
||||
*/
|
||||
DmSettingsUpsellAcknowledged = 1 << 9,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -798,7 +812,7 @@ export interface APIGuildIntegration {
|
||||
scopes?: OAuth2Scopes[];
|
||||
}
|
||||
|
||||
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription';
|
||||
export type APIGuildIntegrationType = 'discord' | 'guild_subscription' | 'twitch' | 'youtube';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
|
||||
|
||||
@@ -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,9 +197,9 @@ export interface APIExternalGuildScheduledEvent
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
|
||||
*/
|
||||
export type APIGuildScheduledEvent =
|
||||
| APIExternalGuildScheduledEvent
|
||||
| APIStageInstanceGuildScheduledEvent
|
||||
| APIVoiceGuildScheduledEvent
|
||||
| APIExternalGuildScheduledEvent;
|
||||
| APIVoiceGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
|
||||
|
||||
@@ -32,26 +32,26 @@ export * from './_interactions/responses.ts';
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIInteraction =
|
||||
| APIPingInteraction
|
||||
| APIApplicationCommandAutocompleteInteraction
|
||||
| APIApplicationCommandInteraction
|
||||
| APIMessageComponentInteraction
|
||||
| APIApplicationCommandAutocompleteInteraction
|
||||
| APIModalSubmitInteraction;
|
||||
| APIModalSubmitInteraction
|
||||
| APIPingInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIDMInteraction =
|
||||
| APIApplicationCommandAutocompleteDMInteraction
|
||||
| APIApplicationCommandDMInteraction
|
||||
| APIMessageComponentDMInteraction
|
||||
| APIApplicationCommandAutocompleteDMInteraction
|
||||
| APIModalSubmitDMInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIGuildInteraction =
|
||||
| APIApplicationCommandAutocompleteGuildInteraction
|
||||
| APIApplicationCommandGuildInteraction
|
||||
| APIMessageComponentGuildInteraction
|
||||
| APIApplicationCommandAutocompleteGuildInteraction
|
||||
| APIModalSubmitGuildInteraction;
|
||||
|
||||
@@ -11,17 +11,17 @@ import type { APIUser } from './user.ts';
|
||||
|
||||
export type APIInviteGuild = Pick<
|
||||
APIGuild,
|
||||
| 'id'
|
||||
| 'name'
|
||||
| 'splash'
|
||||
| 'banner'
|
||||
| 'icon'
|
||||
| 'vanity_url_code'
|
||||
| 'description'
|
||||
| 'features'
|
||||
| 'verification_level'
|
||||
| 'icon'
|
||||
| 'id'
|
||||
| 'name'
|
||||
| 'nsfw_level'
|
||||
| 'premium_subscription_count'
|
||||
| 'splash'
|
||||
| 'vanity_url_code'
|
||||
| 'verification_level'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -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;
|
||||
}
|
||||
@@ -33,6 +33,7 @@ export interface APISticker {
|
||||
* Previously the sticker asset hash, now an empty string
|
||||
*
|
||||
* @deprecated
|
||||
* @unstable This field is no longer documented by Discord and will be removed in v11
|
||||
*/
|
||||
asset?: '';
|
||||
/**
|
||||
@@ -92,7 +93,7 @@ export enum StickerFormatType {
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#sticker-item-object
|
||||
*/
|
||||
export type APIStickerItem = Pick<APISticker, 'id' | 'name' | 'format_type'>;
|
||||
export type APIStickerItem = Pick<APISticker, 'format_type' | 'id' | 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#sticker-pack-object
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -266,6 +274,8 @@ export interface APIConnection {
|
||||
|
||||
export enum ConnectionService {
|
||||
BattleNet = 'battlenet',
|
||||
BungieNet = 'bungie',
|
||||
Domain = 'domain',
|
||||
eBay = 'ebay',
|
||||
EpicGames = 'epicgames',
|
||||
Facebook = 'facebook',
|
||||
@@ -275,6 +285,7 @@ export enum ConnectionService {
|
||||
PlayStationNetwork = 'playstation',
|
||||
Reddit = 'reddit',
|
||||
RiotGames = 'riotgames',
|
||||
Roblox = 'roblox',
|
||||
PayPal = 'paypal',
|
||||
Spotify = 'spotify',
|
||||
Skype = 'skype',
|
||||
@@ -316,5 +327,21 @@ export interface APIApplicationRoleConnection {
|
||||
/**
|
||||
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
|
||||
*/
|
||||
metadata: Record<string, string | number>;
|
||||
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,
|
||||
@@ -254,6 +256,7 @@ export enum RESTJSONErrorCodes {
|
||||
NoUsersWithDiscordTagExist = 80_004,
|
||||
|
||||
ReactionWasBlocked = 90_001,
|
||||
UserCannotUseBurstReactions,
|
||||
|
||||
ApplicationNotYetAvailable = 110_001,
|
||||
|
||||
@@ -292,6 +295,16 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
CannotEnableOnboardingRequirementsAreNotMet = 350_000,
|
||||
CannotUpdateOnboardingWhileBelowRequirements,
|
||||
|
||||
FailedToBanUsers = 500_000,
|
||||
|
||||
PollVotingBlocked = 520_000,
|
||||
PollExpired,
|
||||
InvalidChannelTypeForPollCreation,
|
||||
CannotEditAPollMessage,
|
||||
CannotUseAnEmojiIncludedWithThePoll,
|
||||
|
||||
CannotExpireANonPollMessage = 520_006,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,17 +25,18 @@ export type RESTGetCurrentApplicationResult = APIApplication;
|
||||
* https://discord.com/developers/docs/resources/application#edit-current-application
|
||||
*/
|
||||
export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
|
||||
Pick<
|
||||
APIApplication,
|
||||
| 'custom_install_url'
|
||||
| 'description'
|
||||
| 'flags'
|
||||
| 'role_connections_verification_url'
|
||||
| 'install_params'
|
||||
| 'interactions_endpoint_url'
|
||||
| 'tags'
|
||||
> &
|
||||
Nullable<Pick<APIApplication, 'icon' | 'cover_image'>>
|
||||
Nullable<Pick<APIApplication, 'cover_image' | 'icon'>> &
|
||||
Pick<
|
||||
APIApplication,
|
||||
| 'custom_install_url'
|
||||
| 'description'
|
||||
| 'flags'
|
||||
| 'install_params'
|
||||
| 'integration_types_config'
|
||||
| 'interactions_endpoint_url'
|
||||
| 'role_connections_verification_url'
|
||||
| 'tags'
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,13 +24,20 @@ import type {
|
||||
SortOrderType,
|
||||
ForumLayoutType,
|
||||
ChannelFlags,
|
||||
APIAttachment,
|
||||
} 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 +104,7 @@ export interface RESTPatchAPIChannelJSONBody {
|
||||
*
|
||||
* Channel types: all excluding newsThread, publicThread, privateThread
|
||||
*/
|
||||
permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined;
|
||||
permission_overwrites?: RESTAPIChannelPatchOverwrite[] | null | undefined;
|
||||
/**
|
||||
* ID of the new parent category for a channel
|
||||
*
|
||||
@@ -236,8 +243,10 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Required<Pick<APIMessageReference, 'message_id'>>> & {
|
||||
export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Required<Pick<APIMessageReference, 'message_id'>>
|
||||
> &
|
||||
StrictPartial<APIMessageReference> & {
|
||||
/**
|
||||
* Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message
|
||||
*
|
||||
@@ -247,22 +256,21 @@ export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
* @deprecated Use {@link RESTAPIMessageReference} instead
|
||||
*/
|
||||
export interface RESTAPIAttachment {
|
||||
export type APIMessageReferenceSend = RESTAPIMessageReference;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
|
||||
*/
|
||||
export type RESTAPIAttachment = Partial<
|
||||
Pick<APIAttachment, 'description' | 'duration_secs' | 'filename' | 'title' | 'waveform'>
|
||||
> & {
|
||||
/**
|
||||
* Attachment id or a number that matches `n` in `files[n]`
|
||||
*/
|
||||
id: Snowflake | number;
|
||||
/**
|
||||
* Name of the file
|
||||
*/
|
||||
filename?: string | undefined;
|
||||
/**
|
||||
* Description of the file
|
||||
*/
|
||||
description?: string | undefined;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
@@ -297,7 +305,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend | undefined;
|
||||
message_reference?: RESTAPIMessageReference | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
@@ -309,7 +317,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined;
|
||||
sticker_ids?: [Snowflake, Snowflake, Snowflake] | [Snowflake, Snowflake] | [Snowflake] | undefined;
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
@@ -318,19 +326,28 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
* Message flags combined as a bitfield
|
||||
*/
|
||||
flags?: MessageFlags | undefined;
|
||||
/**
|
||||
* If `true` and nonce is present, it will be checked for uniqueness in the past few minutes.
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageFormDataBody =
|
||||
| ({
|
||||
| (Record<`files[${bigint}]`, unknown> & {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
})
|
||||
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIChannelMessageJSONBody);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
@@ -350,7 +367,12 @@ export type RESTPutAPIChannelMessageReactionResult = never;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-own-reaction
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = never;
|
||||
export type RESTDeleteAPIChannelMessageOwnReactionResult = never;
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link RESTDeleteAPIChannelMessageOwnReactionResult} instead
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = RESTDeleteAPIChannelMessageOwnReactionResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-user-reaction
|
||||
@@ -361,6 +383,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
|
||||
*/
|
||||
@@ -373,6 +399,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
|
||||
*/
|
||||
@@ -422,7 +456,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
|
||||
*/
|
||||
attachments?: RESTAPIAttachment[] | undefined;
|
||||
/**
|
||||
@@ -437,13 +471,13 @@ export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageFormDataBody =
|
||||
| ({
|
||||
| (Record<`files[${bigint}]`, unknown> & {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
})
|
||||
| (Record<`files[${bigint}]`, unknown> & RESTPatchAPIChannelMessageJSONBody);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
|
||||
@@ -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;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user