mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-22 19:30:09 +00:00
Compare commits
111 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 | ||
|
|
f329a80a6b | ||
|
|
0cfe05dad8 | ||
|
|
4473293b0e | ||
|
|
a28b2d749e | ||
|
|
55efcca4f8 | ||
|
|
6f541d58d2 | ||
|
|
71caf7cfc6 | ||
|
|
819d85207a | ||
|
|
7f797b2b4b | ||
|
|
470fe189ae | ||
|
|
b4226bb708 | ||
|
|
72a78a4f6f | ||
|
|
957488134e | ||
|
|
5327f3f38c | ||
|
|
ca05ee5eb2 | ||
|
|
1d8399d925 | ||
|
|
a8efb1949a | ||
|
|
c0f68e9509 | ||
|
|
28ed3701e6 | ||
|
|
4640f80274 | ||
|
|
ba08061917 | ||
|
|
f51c2d95ae | ||
|
|
984eacdef6 | ||
|
|
0a914acd11 | ||
|
|
3f1d9b47aa | ||
|
|
8541201a96 | ||
|
|
17f42e0b38 | ||
|
|
5515e2914a | ||
|
|
ecef5b492b | ||
|
|
c71258ceb4 | ||
|
|
a4cdbbfdf8 | ||
|
|
06fb47c51d | ||
|
|
cc47220e87 | ||
|
|
4defa9ea12 | ||
|
|
1290c942ab | ||
|
|
4309463634 | ||
|
|
1b8f62fc98 | ||
|
|
32ba5ce36c | ||
|
|
1598baf0c3 | ||
|
|
ceb2f033f7 | ||
|
|
36e3d156c6 | ||
|
|
a26629c0e8 | ||
|
|
018d889d9a | ||
|
|
1eb01618a3 | ||
|
|
31c8549fe3 |
@@ -35,7 +35,7 @@ const schema = [
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
] as const;
|
||||
|
||||
export = {
|
||||
rules: {
|
||||
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,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,7 @@
|
||||
"tsdoc/syntax": "off",
|
||||
"typescript-sort-keys/interface": "off",
|
||||
"typescript-sort-keys/string-enum": "off",
|
||||
"unicorn/prefer-math-trunc": "off"
|
||||
"unicorn/prefer-math-trunc": "off",
|
||||
"jsdoc/no-undefined-types": "off"
|
||||
}
|
||||
}
|
||||
|
||||
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/**/*
|
||||
|
||||
8
.github/workflows/check-deno.yml
vendored
8
.github/workflows/check-deno.yml
vendored
@@ -12,12 +12,12 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
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,9 @@ website/build
|
||||
|
||||
# Miscellaneous
|
||||
CODEOWNERS
|
||||
renovate.json
|
||||
CHANGELOG.md
|
||||
|
||||
# Format all of scripts
|
||||
!scripts/**/*
|
||||
!.prettierrc.mjs
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
6
.vscode/settings.json
vendored
6
.vscode/settings.json
vendored
@@ -2,9 +2,9 @@
|
||||
"files.eol": "\n",
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.organizeImports": false,
|
||||
"source.fixAll": true,
|
||||
"source.fixAll.eslint": true
|
||||
"source.organizeImports": "never",
|
||||
"source.fixAll": "explicit",
|
||||
"source.fixAll.eslint": "explicit"
|
||||
},
|
||||
"cSpell.enableFiletypes": ["mdx"]
|
||||
}
|
||||
|
||||
148
CHANGELOG.md
148
CHANGELOG.md
@@ -1,3 +1,151 @@
|
||||
## [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
|
||||
|
||||
- **Locale:** add `SpanishLATAM` ([#859](https://github.com/discordjs/discord-api-types/issues/859)) ([0cfe05d](https://github.com/discordjs/discord-api-types/commit/0cfe05dad8271513a2ef58e4f183c530555c7c2d))
|
||||
|
||||
## [0.37.68](https://github.com/discordjs/discord-api-types/compare/0.37.67...0.37.68) (2024-02-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **CDNRoutes:** fix store page wrong extension ([#867](https://github.com/discordjs/discord-api-types/issues/867)) ([6f541d5](https://github.com/discordjs/discord-api-types/commit/6f541d58d278f1e610916250c003c1344831e3ad))
|
||||
- **CDNRoutes:** make format optional and default to png ([#869](https://github.com/discordjs/discord-api-types/issues/869)) ([55efcca](https://github.com/discordjs/discord-api-types/commit/55efcca4f8480f96243d9d802ce632833ac8e3ff))
|
||||
|
||||
## [0.37.67](https://github.com/discordjs/discord-api-types/compare/0.37.66...0.37.67) (2023-12-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **GatewayThreadDispatch:** properly type thread create/update/delete dispatches ([#861](https://github.com/discordjs/discord-api-types/issues/861)) ([819d852](https://github.com/discordjs/discord-api-types/commit/819d85207ae7e07322e404a5ef9e3eb283b4aa03))
|
||||
|
||||
## [0.37.66](https://github.com/discordjs/discord-api-types/compare/0.37.65...0.37.66) (2023-12-07)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTPostAPIWebhookWithTokenJSONBody:** add `applied_tags` ([#855](https://github.com/discordjs/discord-api-types/issues/855)) ([b4226bb](https://github.com/discordjs/discord-api-types/commit/b4226bb708763ebe04d9f7abcafa148bb5588ba4))
|
||||
|
||||
## [0.37.65](https://github.com/discordjs/discord-api-types/compare/0.37.64...0.37.65) (2023-11-23)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **TextChannelType:** Remove forum and media channels ([#849](https://github.com/discordjs/discord-api-types/issues/849)) ([9574881](https://github.com/discordjs/discord-api-types/commit/957488134e48c482324e9678dd53c11bf946b6cd))
|
||||
|
||||
## [0.37.64](https://github.com/discordjs/discord-api-types/compare/0.37.63...0.37.64) (2023-11-20)
|
||||
|
||||
### Features
|
||||
|
||||
- **PermissionFlagsBits:** split up expressions and events perms ([#790](https://github.com/discordjs/discord-api-types/issues/790)) ([ca05ee5](https://github.com/discordjs/discord-api-types/commit/ca05ee5eb21acdba866de7997cbf980d598e3ee1))
|
||||
|
||||
## [0.37.63](https://github.com/discordjs/discord-api-types/compare/0.37.62...0.37.63) (2023-11-09)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **RESTPutAPIGuildOnboardingJSONBody:** optional keys and flattened emoji ([#839](https://github.com/discordjs/discord-api-types/issues/839)) ([a8efb19](https://github.com/discordjs/discord-api-types/commit/a8efb1949ad4b554d5c59f7b55a251ee12abc93d))
|
||||
|
||||
## [0.37.62](https://github.com/discordjs/discord-api-types/compare/0.37.61...0.37.62) (2023-10-30)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add `40074` and `50057` ([#844](https://github.com/discordjs/discord-api-types/issues/844)) ([28ed370](https://github.com/discordjs/discord-api-types/commit/28ed3701e6105d0d15fb988194c13079a27e4369))
|
||||
|
||||
## [0.37.61](https://github.com/discordjs/discord-api-types/compare/0.37.60...0.37.61) (2023-10-23)
|
||||
|
||||
### Features
|
||||
|
||||
- premium app subscriptions ([#833](https://github.com/discordjs/discord-api-types/issues/833)) ([ba08061](https://github.com/discordjs/discord-api-types/commit/ba080619170b484f671011abe3b0a61c0e69cca9))
|
||||
|
||||
## [0.37.60](https://github.com/discordjs/discord-api-types/compare/0.37.59...0.37.60) (2023-10-05)
|
||||
|
||||
### Features
|
||||
|
||||
- Application patch and new properties ([#810](https://github.com/discordjs/discord-api-types/issues/810)) ([17f42e0](https://github.com/discordjs/discord-api-types/commit/17f42e0b38d431505ee56cdeb0bb85bff94e97c6))
|
||||
|
||||
## [0.37.59](https://github.com/discordjs/discord-api-types/compare/0.37.58...0.37.59) (2023-10-02)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTPostAPIStageInstanceJSONBody:** add `guild_scheduled_event_id` ([#656](https://github.com/discordjs/discord-api-types/issues/656)) ([ecef5b4](https://github.com/discordjs/discord-api-types/commit/ecef5b492bd54b3c61c04a6784fd39c29e282780))
|
||||
|
||||
## [0.37.58](https://github.com/discordjs/discord-api-types/compare/0.37.57...0.37.58) (2023-09-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **RESTPatchAPIChannelJSONBody:** add missing `applied_tags` field ([#828](https://github.com/discordjs/discord-api-types/issues/828)) ([a4cdbbf](https://github.com/discordjs/discord-api-types/commit/a4cdbbfdf87f32e6108140260f163afeca3e0788))
|
||||
|
||||
### Features
|
||||
|
||||
- default select menu values ([#824](https://github.com/discordjs/discord-api-types/issues/824)) ([1290c94](https://github.com/discordjs/discord-api-types/commit/1290c942abdd8c2d9bf97aa2807f45073970f823))
|
||||
|
||||
## [0.37.57](https://github.com/discordjs/discord-api-types/compare/0.37.56...0.37.57) (2023-09-21)
|
||||
|
||||
### Features
|
||||
|
||||
- **ConnectionService:** support twitter rebrand update ([#819](https://github.com/discordjs/discord-api-types/issues/819)) ([32ba5ce](https://github.com/discordjs/discord-api-types/commit/32ba5ce36ce3b89293d540b06b74c2643ced7119))
|
||||
|
||||
## [0.37.56](https://github.com/discordjs/discord-api-types/compare/0.37.55...0.37.56) (2023-08-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **RESTPostAPIChannelMessageJSONBody:** `number` for attachment ids ([#811](https://github.com/discordjs/discord-api-types/issues/811)) ([1eb0161](https://github.com/discordjs/discord-api-types/commit/1eb01618a3d7421012b0423aea7a8bde032c08fc))
|
||||
- standard stickers are now free ([#789](https://github.com/discordjs/discord-api-types/issues/789)) ([018d889](https://github.com/discordjs/discord-api-types/commit/018d889d9aeb35b64dd914ade9ac93e8b98390ac))
|
||||
|
||||
### Features
|
||||
|
||||
- add support for teams update ([#813](https://github.com/discordjs/discord-api-types/issues/813)) ([a26629c](https://github.com/discordjs/discord-api-types/commit/a26629c0e83504299af4bc5eb85e101c63b9ced8))
|
||||
- **APIAuditLogOptions:** add `integration_type` ([#809](https://github.com/discordjs/discord-api-types/issues/809)) ([31c8549](https://github.com/discordjs/discord-api-types/commit/31c8549fe3e461ad120a3af434e27c61091bbb9c))
|
||||
|
||||
## [0.37.55](https://github.com/discordjs/discord-api-types/compare/0.37.54...0.37.55) (2023-08-24)
|
||||
|
||||
## [0.37.54](https://github.com/discordjs/discord-api-types/compare/0.37.53...0.37.54) (2023-08-17)
|
||||
|
||||
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,151 @@
|
||||
## [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
|
||||
|
||||
- **Locale:** add `SpanishLATAM` ([#859](https://github.com/discordjs/discord-api-types/issues/859)) ([0cfe05d](https://github.com/discordjs/discord-api-types/commit/0cfe05dad8271513a2ef58e4f183c530555c7c2d))
|
||||
|
||||
## [0.37.68](https://github.com/discordjs/discord-api-types/compare/0.37.67...0.37.68) (2024-02-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **CDNRoutes:** fix store page wrong extension ([#867](https://github.com/discordjs/discord-api-types/issues/867)) ([6f541d5](https://github.com/discordjs/discord-api-types/commit/6f541d58d278f1e610916250c003c1344831e3ad))
|
||||
- **CDNRoutes:** make format optional and default to png ([#869](https://github.com/discordjs/discord-api-types/issues/869)) ([55efcca](https://github.com/discordjs/discord-api-types/commit/55efcca4f8480f96243d9d802ce632833ac8e3ff))
|
||||
|
||||
## [0.37.67](https://github.com/discordjs/discord-api-types/compare/0.37.66...0.37.67) (2023-12-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **GatewayThreadDispatch:** properly type thread create/update/delete dispatches ([#861](https://github.com/discordjs/discord-api-types/issues/861)) ([819d852](https://github.com/discordjs/discord-api-types/commit/819d85207ae7e07322e404a5ef9e3eb283b4aa03))
|
||||
|
||||
## [0.37.66](https://github.com/discordjs/discord-api-types/compare/0.37.65...0.37.66) (2023-12-07)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTPostAPIWebhookWithTokenJSONBody:** add `applied_tags` ([#855](https://github.com/discordjs/discord-api-types/issues/855)) ([b4226bb](https://github.com/discordjs/discord-api-types/commit/b4226bb708763ebe04d9f7abcafa148bb5588ba4))
|
||||
|
||||
## [0.37.65](https://github.com/discordjs/discord-api-types/compare/0.37.64...0.37.65) (2023-11-23)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **TextChannelType:** Remove forum and media channels ([#849](https://github.com/discordjs/discord-api-types/issues/849)) ([9574881](https://github.com/discordjs/discord-api-types/commit/957488134e48c482324e9678dd53c11bf946b6cd))
|
||||
|
||||
## [0.37.64](https://github.com/discordjs/discord-api-types/compare/0.37.63...0.37.64) (2023-11-20)
|
||||
|
||||
### Features
|
||||
|
||||
- **PermissionFlagsBits:** split up expressions and events perms ([#790](https://github.com/discordjs/discord-api-types/issues/790)) ([ca05ee5](https://github.com/discordjs/discord-api-types/commit/ca05ee5eb21acdba866de7997cbf980d598e3ee1))
|
||||
|
||||
## [0.37.63](https://github.com/discordjs/discord-api-types/compare/0.37.62...0.37.63) (2023-11-09)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **RESTPutAPIGuildOnboardingJSONBody:** optional keys and flattened emoji ([#839](https://github.com/discordjs/discord-api-types/issues/839)) ([a8efb19](https://github.com/discordjs/discord-api-types/commit/a8efb1949ad4b554d5c59f7b55a251ee12abc93d))
|
||||
|
||||
## [0.37.62](https://github.com/discordjs/discord-api-types/compare/0.37.61...0.37.62) (2023-10-30)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add `40074` and `50057` ([#844](https://github.com/discordjs/discord-api-types/issues/844)) ([28ed370](https://github.com/discordjs/discord-api-types/commit/28ed3701e6105d0d15fb988194c13079a27e4369))
|
||||
|
||||
## [0.37.61](https://github.com/discordjs/discord-api-types/compare/0.37.60...0.37.61) (2023-10-23)
|
||||
|
||||
### Features
|
||||
|
||||
- premium app subscriptions ([#833](https://github.com/discordjs/discord-api-types/issues/833)) ([ba08061](https://github.com/discordjs/discord-api-types/commit/ba080619170b484f671011abe3b0a61c0e69cca9))
|
||||
|
||||
## [0.37.60](https://github.com/discordjs/discord-api-types/compare/0.37.59...0.37.60) (2023-10-05)
|
||||
|
||||
### Features
|
||||
|
||||
- Application patch and new properties ([#810](https://github.com/discordjs/discord-api-types/issues/810)) ([17f42e0](https://github.com/discordjs/discord-api-types/commit/17f42e0b38d431505ee56cdeb0bb85bff94e97c6))
|
||||
|
||||
## [0.37.59](https://github.com/discordjs/discord-api-types/compare/0.37.58...0.37.59) (2023-10-02)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTPostAPIStageInstanceJSONBody:** add `guild_scheduled_event_id` ([#656](https://github.com/discordjs/discord-api-types/issues/656)) ([ecef5b4](https://github.com/discordjs/discord-api-types/commit/ecef5b492bd54b3c61c04a6784fd39c29e282780))
|
||||
|
||||
## [0.37.58](https://github.com/discordjs/discord-api-types/compare/0.37.57...0.37.58) (2023-09-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **RESTPatchAPIChannelJSONBody:** add missing `applied_tags` field ([#828](https://github.com/discordjs/discord-api-types/issues/828)) ([a4cdbbf](https://github.com/discordjs/discord-api-types/commit/a4cdbbfdf87f32e6108140260f163afeca3e0788))
|
||||
|
||||
### Features
|
||||
|
||||
- default select menu values ([#824](https://github.com/discordjs/discord-api-types/issues/824)) ([1290c94](https://github.com/discordjs/discord-api-types/commit/1290c942abdd8c2d9bf97aa2807f45073970f823))
|
||||
|
||||
## [0.37.57](https://github.com/discordjs/discord-api-types/compare/0.37.56...0.37.57) (2023-09-21)
|
||||
|
||||
### Features
|
||||
|
||||
- **ConnectionService:** support twitter rebrand update ([#819](https://github.com/discordjs/discord-api-types/issues/819)) ([32ba5ce](https://github.com/discordjs/discord-api-types/commit/32ba5ce36ce3b89293d540b06b74c2643ced7119))
|
||||
|
||||
## [0.37.56](https://github.com/discordjs/discord-api-types/compare/0.37.55...0.37.56) (2023-08-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **RESTPostAPIChannelMessageJSONBody:** `number` for attachment ids ([#811](https://github.com/discordjs/discord-api-types/issues/811)) ([1eb0161](https://github.com/discordjs/discord-api-types/commit/1eb01618a3d7421012b0423aea7a8bde032c08fc))
|
||||
- standard stickers are now free ([#789](https://github.com/discordjs/discord-api-types/issues/789)) ([018d889](https://github.com/discordjs/discord-api-types/commit/018d889d9aeb35b64dd914ade9ac93e8b98390ac))
|
||||
|
||||
### Features
|
||||
|
||||
- add support for teams update ([#813](https://github.com/discordjs/discord-api-types/issues/813)) ([a26629c](https://github.com/discordjs/discord-api-types/commit/a26629c0e83504299af4bc5eb85e101c63b9ced8))
|
||||
- **APIAuditLogOptions:** add `integration_type` ([#809](https://github.com/discordjs/discord-api-types/issues/809)) ([31c8549](https://github.com/discordjs/discord-api-types/commit/31c8549fe3e461ad120a3af434e27c61091bbb9c))
|
||||
|
||||
## [0.37.55](https://github.com/discordjs/discord-api-types/compare/0.37.54...0.37.55) (2023-08-24)
|
||||
|
||||
## [0.37.54](https://github.com/discordjs/discord-api-types/compare/0.37.53...0.37.54) (2023-08-17)
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ import type {
|
||||
PresenceUpdateStatus,
|
||||
AutoModerationRuleTriggerType,
|
||||
APIAuditLogEntry,
|
||||
APIEntitlement,
|
||||
ChannelType,
|
||||
} from '../payloads/v10/mod.ts';
|
||||
import type { Nullable } from '../utils/internals.ts';
|
||||
|
||||
@@ -268,32 +270,37 @@ export enum GatewayDispatchEvents {
|
||||
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
|
||||
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
|
||||
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
|
||||
EntitlementCreate = 'ENTITLEMENT_CREATE',
|
||||
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
|
||||
EntitlementDelete = 'ENTITLEMENT_DELETE',
|
||||
}
|
||||
|
||||
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
|
||||
@@ -307,8 +314,8 @@ export type GatewayDispatchPayload =
|
||||
| GatewayGuildRoleDeleteDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayGuildScheduledEventCreateDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventDeleteDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventUserAddDispatch
|
||||
| GatewayGuildScheduledEventUserRemoveDispatch
|
||||
| GatewayGuildStickersUpdateDispatch
|
||||
@@ -327,21 +334,22 @@ export type GatewayDispatchPayload =
|
||||
| GatewayMessageReactionRemoveEmojiDispatch
|
||||
| GatewayMessageUpdateDispatch
|
||||
| GatewayPresenceUpdateDispatch
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayStageInstanceCreateDispatch
|
||||
| GatewayStageInstanceDeleteDispatch
|
||||
| GatewayStageInstanceUpdateDispatch
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayThreadCreateDispatch
|
||||
| GatewayThreadDeleteDispatch
|
||||
| GatewayThreadListSyncDispatch
|
||||
| GatewayThreadMembersUpdateDispatch
|
||||
| GatewayThreadMemberUpdateDispatch
|
||||
| GatewayThreadModifyDispatch
|
||||
| GatewayThreadUpdateDispatch
|
||||
| GatewayTypingStartDispatch
|
||||
| GatewayUserUpdateDispatch
|
||||
| GatewayVoiceServerUpdateDispatch
|
||||
| GatewayVoiceStateUpdateDispatch
|
||||
| GatewayWebhooksUpdateDispatch
|
||||
| GatewayGuildAuditLogEntryCreateDispatch;
|
||||
| GatewayWebhooksUpdateDispatch;
|
||||
|
||||
// #region Dispatch Payloads
|
||||
|
||||
@@ -446,7 +454,7 @@ export interface GatewayReadyDispatchData {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/application#application-object
|
||||
*/
|
||||
application: Pick<APIApplication, 'id' | 'flags'>;
|
||||
application: Pick<APIApplication, 'flags' | 'id'>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -461,8 +469,8 @@ export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed,
|
||||
*/
|
||||
export type GatewayAutoModerationRuleModifyDispatch = DataPayload<
|
||||
| GatewayDispatchEvents.AutoModerationRuleCreate
|
||||
| GatewayDispatchEvents.AutoModerationRuleUpdate
|
||||
| GatewayDispatchEvents.AutoModerationRuleDelete,
|
||||
| GatewayDispatchEvents.AutoModerationRuleDelete
|
||||
| GatewayDispatchEvents.AutoModerationRuleUpdate,
|
||||
GatewayAutoModerationRuleModifyDispatchData
|
||||
>;
|
||||
|
||||
@@ -672,6 +680,55 @@ export interface GatewayChannelPinsUpdateDispatchData {
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
|
||||
*/
|
||||
export type GatewayEntitlementModifyDispatchData = APIEntitlement;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
|
||||
*/
|
||||
export type GatewayEntitlementModifyDispatch = DataPayload<
|
||||
| GatewayDispatchEvents.EntitlementCreate
|
||||
| GatewayDispatchEvents.EntitlementDelete
|
||||
| GatewayDispatchEvents.EntitlementUpdate,
|
||||
GatewayEntitlementModifyDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
|
||||
*/
|
||||
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
|
||||
*/
|
||||
export type GatewayEntitlementCreateDispatch = GatewayEntitlementModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
|
||||
*/
|
||||
export type GatewayEntitlementUpdateDispatchData = GatewayEntitlementModifyDispatchData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
|
||||
*/
|
||||
export type GatewayEntitlementUpdateDispatch = GatewayEntitlementModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
|
||||
*/
|
||||
export type GatewayEntitlementDeleteDispatchData = GatewayEntitlementModifyDispatchData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
|
||||
*/
|
||||
export type GatewayEntitlementDeleteDispatch = GatewayEntitlementModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#guild-create
|
||||
*/
|
||||
@@ -957,10 +1014,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
|
||||
*/
|
||||
@@ -1305,7 +1362,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
|
||||
@@ -1318,8 +1375,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
|
||||
*/
|
||||
@@ -1554,6 +1611,10 @@ export type GatewayThreadMemberUpdateDispatch = DataPayload<
|
||||
export type GatewayThreadMemberUpdateDispatchData = APIThreadMember & { guild_id: Snowflake };
|
||||
|
||||
/**
|
||||
* @deprecated This type doesn't accurately reflect the Discord API.
|
||||
* Use {@apilink GatewayThreadCreateDispatch},
|
||||
* {@apilink GatewayThreadUpdateDispatch}, or
|
||||
* {@apilink GatewayThreadDeleteDispatch} instead.
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-create
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-update
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-delete
|
||||
@@ -1566,7 +1627,10 @@ export type GatewayThreadModifyDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-create
|
||||
*/
|
||||
export type GatewayThreadCreateDispatch = GatewayChannelModifyDispatch;
|
||||
export type GatewayThreadCreateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ThreadCreate,
|
||||
GatewayThreadCreateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-create
|
||||
@@ -1581,22 +1645,47 @@ export interface GatewayThreadCreateDispatchData extends APIThreadChannel {
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-update
|
||||
*/
|
||||
export type GatewayThreadUpdateDispatch = GatewayChannelModifyDispatch;
|
||||
export type GatewayThreadUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ThreadUpdate,
|
||||
GatewayThreadUpdateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-update
|
||||
*/
|
||||
export type GatewayThreadUpdateDispatchData = GatewayChannelModifyDispatchData;
|
||||
export type GatewayThreadUpdateDispatchData = APIThreadChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-delete
|
||||
*/
|
||||
export type GatewayThreadDeleteDispatch = GatewayChannelModifyDispatch;
|
||||
export type GatewayThreadDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ThreadDelete,
|
||||
GatewayThreadDeleteDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-delete
|
||||
*/
|
||||
export type GatewayThreadDeleteDispatchData = GatewayChannelModifyDispatchData;
|
||||
export interface GatewayThreadDeleteDispatchData {
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The id of the parent channel of the thread
|
||||
*/
|
||||
parent_id: Snowflake;
|
||||
/**
|
||||
* The type of the channel
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*/
|
||||
type: ChannelType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#typing-start
|
||||
@@ -1890,8 +1979,8 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG
|
||||
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
|
||||
*/
|
||||
export type GatewayRequestGuildMembersData =
|
||||
| GatewayRequestGuildMembersDataWithUserIds
|
||||
| GatewayRequestGuildMembersDataWithQuery;
|
||||
| GatewayRequestGuildMembersDataWithQuery
|
||||
| GatewayRequestGuildMembersDataWithUserIds;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
|
||||
@@ -1984,7 +2073,7 @@ interface BasePayload {
|
||||
t?: string;
|
||||
}
|
||||
|
||||
type NonDispatchPayload = Omit<BasePayload, 't' | 's'> & {
|
||||
type NonDispatchPayload = Omit<BasePayload, 's' | 't'> & {
|
||||
t: null;
|
||||
s: null;
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -33,8 +33,10 @@ import type {
|
||||
PresenceUpdateStatus,
|
||||
AutoModerationRuleTriggerType,
|
||||
APIAuditLogEntry,
|
||||
ChannelType,
|
||||
} from '../payloads/v9/mod.ts';
|
||||
import type { Nullable } from '../utils/internals.ts';
|
||||
import type { APIEntitlement } from '../v10.ts';
|
||||
|
||||
export * from './common.ts';
|
||||
|
||||
@@ -267,32 +269,37 @@ export enum GatewayDispatchEvents {
|
||||
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
|
||||
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
|
||||
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
|
||||
EntitlementCreate = 'ENTITLEMENT_CREATE',
|
||||
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
|
||||
EntitlementDelete = 'ENTITLEMENT_DELETE',
|
||||
}
|
||||
|
||||
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
|
||||
@@ -306,8 +313,8 @@ export type GatewayDispatchPayload =
|
||||
| GatewayGuildRoleDeleteDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayGuildScheduledEventCreateDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventDeleteDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventUserAddDispatch
|
||||
| GatewayGuildScheduledEventUserRemoveDispatch
|
||||
| GatewayGuildStickersUpdateDispatch
|
||||
@@ -326,21 +333,22 @@ export type GatewayDispatchPayload =
|
||||
| GatewayMessageReactionRemoveEmojiDispatch
|
||||
| GatewayMessageUpdateDispatch
|
||||
| GatewayPresenceUpdateDispatch
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayStageInstanceCreateDispatch
|
||||
| GatewayStageInstanceDeleteDispatch
|
||||
| GatewayStageInstanceUpdateDispatch
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayThreadCreateDispatch
|
||||
| GatewayThreadDeleteDispatch
|
||||
| GatewayThreadListSyncDispatch
|
||||
| GatewayThreadMembersUpdateDispatch
|
||||
| GatewayThreadMemberUpdateDispatch
|
||||
| GatewayThreadModifyDispatch
|
||||
| GatewayThreadUpdateDispatch
|
||||
| GatewayTypingStartDispatch
|
||||
| GatewayUserUpdateDispatch
|
||||
| GatewayVoiceServerUpdateDispatch
|
||||
| GatewayVoiceStateUpdateDispatch
|
||||
| GatewayWebhooksUpdateDispatch
|
||||
| GatewayGuildAuditLogEntryCreateDispatch;
|
||||
| GatewayWebhooksUpdateDispatch;
|
||||
|
||||
// #region Dispatch Payloads
|
||||
|
||||
@@ -445,7 +453,7 @@ export interface GatewayReadyDispatchData {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/application#application-object
|
||||
*/
|
||||
application: Pick<APIApplication, 'id' | 'flags'>;
|
||||
application: Pick<APIApplication, 'flags' | 'id'>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -460,8 +468,8 @@ export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed,
|
||||
*/
|
||||
export type GatewayAutoModerationRuleModifyDispatch = DataPayload<
|
||||
| GatewayDispatchEvents.AutoModerationRuleCreate
|
||||
| GatewayDispatchEvents.AutoModerationRuleUpdate
|
||||
| GatewayDispatchEvents.AutoModerationRuleDelete,
|
||||
| GatewayDispatchEvents.AutoModerationRuleDelete
|
||||
| GatewayDispatchEvents.AutoModerationRuleUpdate,
|
||||
GatewayAutoModerationRuleModifyDispatchData
|
||||
>;
|
||||
|
||||
@@ -671,6 +679,55 @@ export interface GatewayChannelPinsUpdateDispatchData {
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
|
||||
*/
|
||||
export type GatewayEntitlementModifyDispatchData = APIEntitlement;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
|
||||
*/
|
||||
export type GatewayEntitlementModifyDispatch = DataPayload<
|
||||
| GatewayDispatchEvents.EntitlementCreate
|
||||
| GatewayDispatchEvents.EntitlementDelete
|
||||
| GatewayDispatchEvents.EntitlementUpdate,
|
||||
GatewayEntitlementModifyDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
|
||||
*/
|
||||
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
|
||||
*/
|
||||
export type GatewayEntitlementCreateDispatch = GatewayEntitlementModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
|
||||
*/
|
||||
export type GatewayEntitlementUpdateDispatchData = GatewayEntitlementModifyDispatchData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
|
||||
*/
|
||||
export type GatewayEntitlementUpdateDispatch = GatewayEntitlementModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
|
||||
*/
|
||||
export type GatewayEntitlementDeleteDispatchData = GatewayEntitlementModifyDispatchData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
|
||||
*/
|
||||
export type GatewayEntitlementDeleteDispatch = GatewayEntitlementModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#guild-update
|
||||
*/
|
||||
@@ -956,10 +1013,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
|
||||
*/
|
||||
@@ -1304,7 +1361,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
|
||||
@@ -1317,8 +1374,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
|
||||
*/
|
||||
@@ -1553,6 +1610,10 @@ export type GatewayThreadMemberUpdateDispatch = DataPayload<
|
||||
export type GatewayThreadMemberUpdateDispatchData = APIThreadMember & { guild_id: Snowflake };
|
||||
|
||||
/**
|
||||
* @deprecated This type doesn't accurately reflect the Discord API.
|
||||
* Use {@apilink GatewayThreadCreateDispatch},
|
||||
* {@apilink GatewayThreadUpdateDispatch}, or
|
||||
* {@apilink GatewayThreadDeleteDispatch} instead.
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-create
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-update
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-delete
|
||||
@@ -1565,7 +1626,10 @@ export type GatewayThreadModifyDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-create
|
||||
*/
|
||||
export type GatewayThreadCreateDispatch = GatewayChannelModifyDispatch;
|
||||
export type GatewayThreadCreateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ThreadCreate,
|
||||
GatewayThreadCreateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-create
|
||||
@@ -1580,22 +1644,47 @@ export interface GatewayThreadCreateDispatchData extends APIThreadChannel {
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-update
|
||||
*/
|
||||
export type GatewayThreadUpdateDispatch = GatewayChannelModifyDispatch;
|
||||
export type GatewayThreadUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ThreadUpdate,
|
||||
GatewayThreadUpdateDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-update
|
||||
*/
|
||||
export type GatewayThreadUpdateDispatchData = GatewayChannelModifyDispatchData;
|
||||
export type GatewayThreadUpdateDispatchData = APIThreadChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-delete
|
||||
*/
|
||||
export type GatewayThreadDeleteDispatch = GatewayChannelModifyDispatch;
|
||||
export type GatewayThreadDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ThreadDelete,
|
||||
GatewayThreadDeleteDispatchData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-delete
|
||||
*/
|
||||
export type GatewayThreadDeleteDispatchData = GatewayChannelModifyDispatchData;
|
||||
export interface GatewayThreadDeleteDispatchData {
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The id of the parent channel of the thread
|
||||
*/
|
||||
parent_id: Snowflake;
|
||||
/**
|
||||
* The type of the channel
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*/
|
||||
type: ChannelType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#typing-start
|
||||
@@ -1889,8 +1978,8 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG
|
||||
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
|
||||
*/
|
||||
export type GatewayRequestGuildMembersData =
|
||||
| GatewayRequestGuildMembersDataWithUserIds
|
||||
| GatewayRequestGuildMembersDataWithQuery;
|
||||
| GatewayRequestGuildMembersDataWithQuery
|
||||
| GatewayRequestGuildMembersDataWithUserIds;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
|
||||
@@ -1983,7 +2072,7 @@ interface BasePayload {
|
||||
t?: string;
|
||||
}
|
||||
|
||||
type NonDispatchPayload = Omit<BasePayload, 't' | 's'> & {
|
||||
type NonDispatchPayload = Omit<BasePayload, 's' | 't'> & {
|
||||
t: null;
|
||||
s: null;
|
||||
};
|
||||
|
||||
@@ -182,7 +182,7 @@ export const PermissionFlagsBits = {
|
||||
*/
|
||||
ManageEmojisAndStickers: 1n << 30n,
|
||||
/**
|
||||
* Allows management and editing of emojis, stickers, and soundboard sounds
|
||||
* Allows for editing and deleting emojis, stickers, and soundboard sounds created by all users
|
||||
*/
|
||||
ManageGuildExpressions: 1n << 30n,
|
||||
/**
|
||||
@@ -198,7 +198,7 @@ export const PermissionFlagsBits = {
|
||||
*/
|
||||
RequestToSpeak: 1n << 32n,
|
||||
/**
|
||||
* Allows for creating, editing, and deleting scheduled events
|
||||
* Allows for editing and deleting scheduled events created by all users
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
@@ -254,6 +254,16 @@ export const PermissionFlagsBits = {
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
UseSoundboard: 1n << 42n,
|
||||
/**
|
||||
* Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those created by the current user
|
||||
*/
|
||||
CreateGuildExpressions: 1n << 43n,
|
||||
/**
|
||||
* Allows for creating scheduled events, and editing and deleting those created by the current user
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
CreateEvents: 1n << 44n,
|
||||
/**
|
||||
* Allows the usage of custom soundboard sounds from other servers
|
||||
*
|
||||
@@ -295,7 +305,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),
|
||||
};
|
||||
|
||||
@@ -118,7 +118,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,21 +1,30 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { APIRole, LocaleString } from '../../../v10.ts';
|
||||
import type { APIAttachment, APIChannel, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type {
|
||||
APIAttachment,
|
||||
APIChannel,
|
||||
APIMessage,
|
||||
APIPartialChannel,
|
||||
APIThreadChannel,
|
||||
ChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIEntitlement } from '../monetization.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
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'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -122,11 +131,15 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
* The guild's preferred locale, if invoked in a guild
|
||||
*/
|
||||
guild_locale?: LocaleString;
|
||||
/**
|
||||
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
|
||||
*/
|
||||
entitlements: APIEntitlement[];
|
||||
}
|
||||
|
||||
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'member' | 'guild_id'
|
||||
'guild_id' | 'member'
|
||||
> &
|
||||
Required<Pick<Original, 'user'>>;
|
||||
|
||||
@@ -134,21 +147,25 @@ 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;
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
|
||||
thread_metadata?: APIThreadMetadata | null;
|
||||
permissions: Permissions;
|
||||
parent_id?: string | null;
|
||||
}
|
||||
export type APIInteractionDataResolvedChannel =
|
||||
| APIInteractionDataResolvedChannelBase<Exclude<ChannelType, ThreadChannelType>>
|
||||
| (APIInteractionDataResolvedChannelBase<ThreadChannelType> &
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -171,8 +188,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,13 +18,14 @@ 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;
|
||||
| APIModalInteractionResponse
|
||||
| APIPremiumRequiredInteractionResponse;
|
||||
|
||||
export interface APIInteractionResponsePong {
|
||||
type: InteractionResponseType.Pong;
|
||||
@@ -40,6 +41,10 @@ export interface APIModalInteractionResponse {
|
||||
data: APIModalInteractionResponseCallbackData;
|
||||
}
|
||||
|
||||
export interface APIPremiumRequiredInteractionResponse {
|
||||
type: InteractionResponseType.PremiumRequired;
|
||||
}
|
||||
|
||||
export interface APIInteractionResponseChannelMessageWithSource {
|
||||
type: InteractionResponseType.ChannelMessageWithSource;
|
||||
data: APIInteractionResponseCallbackData;
|
||||
@@ -91,6 +96,10 @@ export enum InteractionResponseType {
|
||||
* Respond to an interaction with an modal for a user to fill-out
|
||||
*/
|
||||
Modal,
|
||||
/**
|
||||
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
|
||||
*/
|
||||
PremiumRequired,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +107,7 @@ export enum InteractionResponseType {
|
||||
*/
|
||||
export type APIInteractionResponseCallbackData = Omit<
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
'username' | 'avatar_url'
|
||||
'avatar_url' | 'username'
|
||||
> & { flags?: MessageFlags };
|
||||
|
||||
export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
|
||||
@@ -41,6 +41,10 @@ export interface APIApplication {
|
||||
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
|
||||
*/
|
||||
bot_require_code_grant: boolean;
|
||||
/**
|
||||
* Partial user object for the bot user associated with the application
|
||||
*/
|
||||
bot?: APIUser;
|
||||
/**
|
||||
* The url of the application's terms of service
|
||||
*/
|
||||
@@ -60,7 +64,7 @@ export interface APIApplication {
|
||||
*
|
||||
* @deprecated This field will be removed in v11
|
||||
*/
|
||||
summary: string;
|
||||
summary: '';
|
||||
/**
|
||||
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
|
||||
*
|
||||
@@ -77,6 +81,10 @@ export interface APIApplication {
|
||||
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* A partial object of the associated guild
|
||||
*/
|
||||
guild?: APIPartialGuild;
|
||||
/**
|
||||
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
|
||||
*/
|
||||
@@ -96,7 +104,24 @@ export interface APIApplication {
|
||||
*/
|
||||
flags: ApplicationFlags;
|
||||
/**
|
||||
* Up to 5 tags describing the content and functionality of the application
|
||||
* Approximate count of guilds the application has been added to
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* Array of redirect URIs for the application
|
||||
*/
|
||||
redirect_uris?: string[];
|
||||
/**
|
||||
* The interactions endpoint URL for the application
|
||||
*/
|
||||
interactions_endpoint_url?: string;
|
||||
/**
|
||||
* The application's role connection verification entry point,
|
||||
* which when configured will render the app as a verification method in the guild role verification configuration
|
||||
*/
|
||||
role_connections_verification_url?: string;
|
||||
/**
|
||||
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
|
||||
*/
|
||||
tags?: [string, string?, string?, string?, string?];
|
||||
/**
|
||||
@@ -107,19 +132,6 @@ export interface APIApplication {
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
custom_install_url?: string;
|
||||
/**
|
||||
* The application's role connection verification entry point,
|
||||
* which when configured will render the app as a verification method in the guild role verification configuration
|
||||
*/
|
||||
role_connections_verification_url?: string;
|
||||
/**
|
||||
* An approximate count of the app's guild membership
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* A partial object of the associated guild
|
||||
*/
|
||||
guild?: APIPartialGuild;
|
||||
}
|
||||
|
||||
export interface APIApplicationInstallParams {
|
||||
|
||||
@@ -13,9 +13,11 @@ import type {
|
||||
import type { APIChannel, APIOverwrite } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
APIGuildIntegrationType,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildMFALevel,
|
||||
GuildSystemChannelFlags,
|
||||
GuildVerificationLevel,
|
||||
IntegrationExpireBehavior,
|
||||
} from './guild.ts';
|
||||
@@ -312,6 +314,15 @@ export interface APIAuditLogOptions {
|
||||
* **Present only if the {@link APIAuditLogOptions#type entry type} is "0"**
|
||||
*/
|
||||
role_name?: string;
|
||||
|
||||
/**
|
||||
* Type of integration which performed the action
|
||||
*
|
||||
* Present from:
|
||||
* - MEMBER_KICK
|
||||
* - MEMBER_ROLE_UPDATE
|
||||
*/
|
||||
integration_type?: APIGuildIntegrationType;
|
||||
}
|
||||
|
||||
export enum AuditLogOptionsType {
|
||||
@@ -325,82 +336,83 @@ export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
|
||||
*/
|
||||
export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeyImageHash
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyOwnerId
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyPreferredLocale
|
||||
| APIAuditLogChangeKeyAFKChannelId
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyRulesChannelId
|
||||
| APIAuditLogChangeKeyPublicUpdatesChannelId
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyVerificationLevel
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyVanityURLCode
|
||||
| APIAuditLogChangeKey$Add
|
||||
| APIAuditLogChangeKey$Remove
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyWidgetEnabled
|
||||
| APIAuditLogChangeKeyWidgetChannelId
|
||||
| APIAuditLogChangeKeySystemChannelId
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyTopic
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyApplicationId
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyActions
|
||||
| APIAuditLogChangeKeyAFKChannelId
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyAllow
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyChannelId
|
||||
| APIAuditLogChangeKeyInviterId
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyApplicationId
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyId
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyChannelId
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
| APIAuditLogChangeKeyEnabled
|
||||
| APIAuditLogChangeKeyEnableEmoticons
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyEventType
|
||||
| APIAuditLogChangeKeyExemptChannels
|
||||
| APIAuditLogChangeKeyExemptRoles
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyUserLimit
|
||||
| APIAuditLogChangeKeyPrivacyLevel
|
||||
| APIAuditLogChangeKeyTags
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeyId
|
||||
| APIAuditLogChangeKeyImageHash
|
||||
| APIAuditLogChangeKeyInviterId
|
||||
| APIAuditLogChangeKeyLocation
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil
|
||||
| APIAuditLogChangeKeyTriggerType
|
||||
| APIAuditLogChangeKeyEventType
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyOwnerId
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyPreferredLocale
|
||||
| APIAuditLogChangeKeyPrivacyLevel
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyPublicUpdatesChannelId
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyRulesChannelId
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| 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
|
||||
@@ -533,6 +545,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
|
||||
*/
|
||||
@@ -725,22 +745,22 @@ export type APIAuditLogChangeKeyAvailable = AuditLogChangeData<'available', bool
|
||||
*/
|
||||
export type APIAuditLogChangeKeyGuildId = AuditLogChangeData<'guild_id', Snowflake>;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returned when a thread's archive status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyArchived = AuditLogChangeData<'archived', boolean>;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returned when a thread's lock status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyLocked = AuditLogChangeData<'locked', boolean>;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returned when a thread's auto archive duration is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAutoArchiveDuration = AuditLogChangeData<'auto_archive_duration', number>;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returned when a channel's default auto archive duration for newly created threads is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultAutoArchiveDuration = AuditLogChangeData<
|
||||
|
||||
@@ -6,7 +6,7 @@ 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 { APIMessageInteraction } from './interactions.ts';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APISticker, APIStickerItem } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
@@ -41,17 +41,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.GuildText
|
||||
| ChannelType.GuildForum
|
||||
| ChannelType.GuildVoice
|
||||
| ChannelType.GuildStageVoice
|
||||
| ChannelType.GuildMedia;
|
||||
| ChannelType.GuildText
|
||||
| ChannelType.GuildVoice
|
||||
| ChannelType.PrivateThread
|
||||
| ChannelType.PublicThread;
|
||||
|
||||
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
@@ -112,7 +110,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>
|
||||
export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType>
|
||||
extends Omit<APITextBasedChannel<T>, 'name'>,
|
||||
APIGuildChannel<T> {
|
||||
/**
|
||||
@@ -125,7 +123,7 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
|
||||
*/
|
||||
default_thread_rate_limit_per_user?: number;
|
||||
/**
|
||||
* The channel topic (0-4096 characters for thread-only channels, 0-1024 characters for all others)
|
||||
* The channel topic (0-1024 characters)
|
||||
*/
|
||||
topic?: string | null;
|
||||
}
|
||||
@@ -136,7 +134,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
|
||||
*/
|
||||
@@ -206,12 +204,11 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
|
||||
managed?: boolean;
|
||||
}
|
||||
|
||||
export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
|
||||
|
||||
export interface APIThreadChannel
|
||||
extends Omit<
|
||||
APITextBasedChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread>,
|
||||
'name'
|
||||
>,
|
||||
APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
|
||||
extends Omit<APITextBasedChannel<ThreadChannelType>, 'name'>,
|
||||
APIGuildChannel<ThreadChannelType> {
|
||||
/**
|
||||
* The client users member for the thread, only included in select endpoints
|
||||
*/
|
||||
@@ -319,11 +316,40 @@ export enum ForumLayoutType {
|
||||
}
|
||||
|
||||
export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia>
|
||||
extends APIGuildTextChannel<T> {
|
||||
extends APIGuildChannel<T> {
|
||||
/**
|
||||
* The channel topic (0-4096 characters)
|
||||
*/
|
||||
topic?: string | null;
|
||||
/**
|
||||
* The id of the last thread created in this channel (may not point to an existing or valid thread)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before creating another thread (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*
|
||||
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
/**
|
||||
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
|
||||
*/
|
||||
default_auto_archive_duration?: ThreadAutoArchiveDuration;
|
||||
/**
|
||||
* The set of tags that can be used in a thread-only channel
|
||||
*/
|
||||
available_tags: APIGuildForumTag[];
|
||||
/**
|
||||
* The initial `rate_limit_per_user` to set on newly created threads.
|
||||
* This field is copied to the thread at creation time and does not live update
|
||||
*/
|
||||
default_thread_rate_limit_per_user?: number;
|
||||
/**
|
||||
* The emoji to show in the add reaction button on a thread in a thread-only channel
|
||||
*/
|
||||
@@ -347,16 +373,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
|
||||
@@ -581,7 +607,7 @@ export interface APIMessage {
|
||||
* **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE`
|
||||
* event to ensure it got sent**
|
||||
*/
|
||||
nonce?: string | number;
|
||||
nonce?: number | string;
|
||||
/**
|
||||
* Whether this message is pinned
|
||||
*/
|
||||
@@ -679,11 +705,16 @@ export interface APIMessage {
|
||||
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
|
||||
*/
|
||||
position?: number;
|
||||
|
||||
/**
|
||||
* Data of the role subscription purchase or renewal that prompted this `ROLE_SUBSCRIPTION_PURCHASE` message
|
||||
*/
|
||||
role_subscription_data?: APIMessageRoleSubscriptionData;
|
||||
/**
|
||||
* Data for users, members, channels, and roles in the message's auto-populated select menus
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -869,19 +900,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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1537,7 +1594,7 @@ export interface APIMessageComponentEmoji {
|
||||
|
||||
export interface APIButtonComponentWithCustomId
|
||||
extends APIButtonComponentBase<
|
||||
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
|
||||
ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success
|
||||
> {
|
||||
/**
|
||||
* The custom_id to be sent in the interaction when clicked
|
||||
@@ -1578,11 +1635,11 @@ export enum TextInputStyle {
|
||||
*/
|
||||
export interface APIBaseSelectMenuComponent<
|
||||
T extends
|
||||
| ComponentType.StringSelect
|
||||
| ComponentType.UserSelect
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.ChannelSelect
|
||||
| ComponentType.MentionableSelect
|
||||
| ComponentType.ChannelSelect,
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.StringSelect
|
||||
| ComponentType.UserSelect,
|
||||
> extends APIBaseComponent<T> {
|
||||
/**
|
||||
* A developer-defined identifier for the select menu, max 100 characters
|
||||
@@ -1612,6 +1669,20 @@ export interface APIBaseSelectMenuComponent<
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export interface APIBaseAutoPopulatedSelectMenuComponent<
|
||||
T extends
|
||||
| ComponentType.ChannelSelect
|
||||
| ComponentType.MentionableSelect
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.UserSelect,
|
||||
D extends SelectMenuDefaultValueType,
|
||||
> extends APIBaseSelectMenuComponent<T> {
|
||||
/**
|
||||
* List of default values for auto-populated select menu components
|
||||
*/
|
||||
default_values?: APISelectMenuDefaultValue<D>[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
@@ -1625,44 +1696,77 @@ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<Com
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APIUserSelectComponent = APIBaseSelectMenuComponent<ComponentType.UserSelect>;
|
||||
export type APIUserSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
|
||||
ComponentType.UserSelect,
|
||||
SelectMenuDefaultValueType.User
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APIRoleSelectComponent = APIBaseSelectMenuComponent<ComponentType.RoleSelect>;
|
||||
export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
|
||||
ComponentType.RoleSelect,
|
||||
SelectMenuDefaultValueType.Role
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APIMentionableSelectComponent = APIBaseSelectMenuComponent<ComponentType.MentionableSelect>;
|
||||
export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
|
||||
ComponentType.MentionableSelect,
|
||||
SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export interface APIChannelSelectComponent extends APIBaseSelectMenuComponent<ComponentType.ChannelSelect> {
|
||||
export interface APIChannelSelectComponent
|
||||
extends APIBaseAutoPopulatedSelectMenuComponent<ComponentType.ChannelSelect, SelectMenuDefaultValueType.Channel> {
|
||||
/**
|
||||
* List of channel types to include in the ChannelSelect component
|
||||
*/
|
||||
channel_types?: ChannelType[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
|
||||
*/
|
||||
export enum SelectMenuDefaultValueType {
|
||||
Channel = 'channel',
|
||||
Role = 'role',
|
||||
User = 'user',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
|
||||
*/
|
||||
export interface APISelectMenuDefaultValue<T extends SelectMenuDefaultValueType> {
|
||||
type: T;
|
||||
id: Snowflake;
|
||||
}
|
||||
|
||||
export type APIAutoPopulatedSelectMenuComponent =
|
||||
| APIChannelSelectComponent
|
||||
| APIMentionableSelectComponent
|
||||
| APIRoleSelectComponent
|
||||
| APIUserSelectComponent;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
@@ -1670,7 +1774,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;
|
||||
/**
|
||||
@@ -1767,8 +1871,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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
@@ -427,7 +427,7 @@ export enum GuildFeature {
|
||||
* Guild has enabled the role subscription promo page
|
||||
*/
|
||||
CreatorStorePage = 'CREATOR_STORE_PAGE',
|
||||
/*
|
||||
/**
|
||||
* Guild has been set as a support server on the App Directory
|
||||
*/
|
||||
DeveloperSupportServer = 'DEVELOPER_SUPPORT_SERVER',
|
||||
@@ -806,7 +806,7 @@ export interface APIGuildIntegration {
|
||||
scopes?: OAuth2Scopes[];
|
||||
}
|
||||
|
||||
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription';
|
||||
export type APIGuildIntegrationType = 'discord' | 'guild_subscription' | 'twitch' | 'youtube';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
|
||||
|
||||
@@ -90,9 +90,9 @@ export interface APIExternalGuildScheduledEvent
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
|
||||
*/
|
||||
export type APIGuildScheduledEvent =
|
||||
| APIExternalGuildScheduledEvent
|
||||
| APIStageInstanceGuildScheduledEvent
|
||||
| APIVoiceGuildScheduledEvent
|
||||
| APIExternalGuildScheduledEvent;
|
||||
| APIVoiceGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
|
||||
|
||||
@@ -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'
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,3 +18,4 @@ export * from './template.ts';
|
||||
export * from './user.ts';
|
||||
export * from './voice.ts';
|
||||
export * from './webhook.ts';
|
||||
export * from './monetization.ts';
|
||||
|
||||
115
deno/payloads/v10/monetization.ts
Normal file
115
deno/payloads/v10/monetization.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-structure
|
||||
*/
|
||||
export interface APIEntitlement {
|
||||
/**
|
||||
* ID of the entitlement
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* ID of the SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
/**
|
||||
* ID of the user that is granted access to the entitlement's sku
|
||||
*/
|
||||
user_id?: Snowflake;
|
||||
/**
|
||||
* ID of the guild that is granted access to the entitlement's sku
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* ID of the parent application
|
||||
*/
|
||||
application_id: Snowflake;
|
||||
/**
|
||||
* Type of entitlement
|
||||
*/
|
||||
type: EntitlementType;
|
||||
/**
|
||||
* Whether the entitlement was deleted
|
||||
*/
|
||||
deleted: boolean;
|
||||
/**
|
||||
* Start date at which the entitlement is valid. Not present when using test entitlements.
|
||||
*/
|
||||
starts_at?: string;
|
||||
/**
|
||||
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
|
||||
*/
|
||||
ends_at?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
|
||||
*/
|
||||
export enum EntitlementType {
|
||||
/**
|
||||
* Entitlement was purchased as an app subscription
|
||||
*/
|
||||
ApplicationSubscription = 8,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/skus#sku-object-sku-structure
|
||||
*/
|
||||
export interface APISKU {
|
||||
/**
|
||||
* ID of SKU
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Type of SKU
|
||||
*/
|
||||
type: SKUType;
|
||||
/**
|
||||
* ID of the parent application
|
||||
*/
|
||||
application_id: Snowflake;
|
||||
/**
|
||||
* Customer-facing name of your premium offering
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* System-generated URL slug based on the SKU's name
|
||||
*/
|
||||
slug: string;
|
||||
/**
|
||||
* SKU flags combined as a bitfield
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
flags: SKUFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/skus#sku-object-sku-flags
|
||||
*/
|
||||
export enum SKUFlags {
|
||||
/**
|
||||
* SKU is available for purchase
|
||||
*/
|
||||
Available = 1 << 2,
|
||||
/**
|
||||
* Recurring SKU that can be purchased by a user and applied to a single server.
|
||||
* Grants access to every user in that server.
|
||||
*/
|
||||
GuildSubscription = 1 << 7,
|
||||
/**
|
||||
* Recurring SKU purchased by a user for themselves. Grants access to the purchasing user in every server.
|
||||
*/
|
||||
UserSubscription = 1 << 8,
|
||||
}
|
||||
|
||||
export enum SKUType {
|
||||
/**
|
||||
* Represents a recurring subscription
|
||||
*/
|
||||
Subscription = 5,
|
||||
/**
|
||||
* System-generated group for each Subscription SKU created
|
||||
*/
|
||||
SubscriptionGroup = 6,
|
||||
}
|
||||
@@ -70,7 +70,7 @@ export interface APISticker {
|
||||
*/
|
||||
export enum StickerType {
|
||||
/**
|
||||
* An official sticker in a pack, part of Nitro or in a removed purchasable pack
|
||||
* An official sticker in a pack
|
||||
*/
|
||||
Standard = 1,
|
||||
/**
|
||||
@@ -92,7 +92,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
|
||||
|
||||
@@ -43,6 +43,8 @@ export interface APITeamMember {
|
||||
membership_state: TeamMemberMembershipState;
|
||||
/**
|
||||
* Will always be `["*"]`
|
||||
*
|
||||
* @deprecated Use `role` instead
|
||||
*/
|
||||
permissions: ['*'];
|
||||
/**
|
||||
@@ -55,6 +57,12 @@ export interface APITeamMember {
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* The user's role in the team.
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/teams#team-member-roles
|
||||
*/
|
||||
role: TeamMemberRole;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,3 +72,12 @@ export enum TeamMemberMembershipState {
|
||||
Invited = 1,
|
||||
Accepted,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#team-member-roles-team-member-role-types
|
||||
*/
|
||||
export enum TeamMemberRole {
|
||||
Admin = 'admin',
|
||||
Developer = 'developer',
|
||||
ReadOnly = 'read_only',
|
||||
}
|
||||
|
||||
@@ -281,7 +281,11 @@ export enum ConnectionService {
|
||||
Steam = 'steam',
|
||||
TikTok = 'tiktok',
|
||||
Twitch = 'twitch',
|
||||
Twitter = 'twitter',
|
||||
X = 'twitter',
|
||||
/**
|
||||
* @deprecated This is the old name for {@apilink ConnectionService#X}
|
||||
*/
|
||||
Twitter = X,
|
||||
Xbox = 'xbox',
|
||||
YouTube = 'youtube',
|
||||
}
|
||||
@@ -312,5 +316,5 @@ export interface APIApplicationRoleConnection {
|
||||
/**
|
||||
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
|
||||
*/
|
||||
metadata: Record<string, string | number>;
|
||||
metadata: Record<string, number | string>;
|
||||
}
|
||||
|
||||
@@ -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),
|
||||
};
|
||||
|
||||
@@ -118,7 +118,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,21 +1,30 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { APIRole, LocaleString } from '../../../v9.ts';
|
||||
import type { APIAttachment, APIChannel, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type {
|
||||
APIAttachment,
|
||||
APIChannel,
|
||||
APIMessage,
|
||||
APIPartialChannel,
|
||||
APIThreadChannel,
|
||||
ChannelType,
|
||||
ThreadChannelType,
|
||||
} from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIEntitlement } from '../monetization.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
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'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -122,11 +131,15 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
* The guild's preferred locale, if invoked in a guild
|
||||
*/
|
||||
guild_locale?: LocaleString;
|
||||
/**
|
||||
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
|
||||
*/
|
||||
entitlements: APIEntitlement[];
|
||||
}
|
||||
|
||||
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'member' | 'guild_id'
|
||||
'guild_id' | 'member'
|
||||
> &
|
||||
Required<Pick<Original, 'user'>>;
|
||||
|
||||
@@ -134,21 +147,25 @@ 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;
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
|
||||
thread_metadata?: APIThreadMetadata | null;
|
||||
permissions: Permissions;
|
||||
parent_id?: string | null;
|
||||
}
|
||||
export type APIInteractionDataResolvedChannel =
|
||||
| APIInteractionDataResolvedChannelBase<Exclude<ChannelType, ThreadChannelType>>
|
||||
| (APIInteractionDataResolvedChannelBase<ThreadChannelType> &
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -171,8 +188,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,13 +18,14 @@ 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;
|
||||
| APIModalInteractionResponse
|
||||
| APIPremiumRequiredInteractionResponse;
|
||||
|
||||
export interface APIInteractionResponsePong {
|
||||
type: InteractionResponseType.Pong;
|
||||
@@ -40,6 +41,10 @@ export interface APIModalInteractionResponse {
|
||||
data: APIModalInteractionResponseCallbackData;
|
||||
}
|
||||
|
||||
export interface APIPremiumRequiredInteractionResponse {
|
||||
type: InteractionResponseType.PremiumRequired;
|
||||
}
|
||||
|
||||
export interface APIInteractionResponseChannelMessageWithSource {
|
||||
type: InteractionResponseType.ChannelMessageWithSource;
|
||||
data: APIInteractionResponseCallbackData;
|
||||
@@ -91,6 +96,10 @@ export enum InteractionResponseType {
|
||||
* Respond to an interaction with an modal for a user to fill-out
|
||||
*/
|
||||
Modal,
|
||||
/**
|
||||
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
|
||||
*/
|
||||
PremiumRequired,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -98,7 +107,7 @@ export enum InteractionResponseType {
|
||||
*/
|
||||
export type APIInteractionResponseCallbackData = Omit<
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
'username' | 'avatar_url'
|
||||
'avatar_url' | 'username'
|
||||
> & { flags?: MessageFlags };
|
||||
|
||||
export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
|
||||
@@ -41,6 +41,10 @@ export interface APIApplication {
|
||||
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
|
||||
*/
|
||||
bot_require_code_grant: boolean;
|
||||
/**
|
||||
* Partial user object for the bot user associated with the application
|
||||
*/
|
||||
bot?: APIUser;
|
||||
/**
|
||||
* The url of the application's terms of service
|
||||
*/
|
||||
@@ -60,7 +64,7 @@ export interface APIApplication {
|
||||
*
|
||||
* @deprecated This field will be removed in v11
|
||||
*/
|
||||
summary: string;
|
||||
summary: '';
|
||||
/**
|
||||
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
|
||||
*
|
||||
@@ -77,6 +81,10 @@ export interface APIApplication {
|
||||
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* A partial object of the associated guild
|
||||
*/
|
||||
guild?: APIPartialGuild;
|
||||
/**
|
||||
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
|
||||
*/
|
||||
@@ -96,7 +104,24 @@ export interface APIApplication {
|
||||
*/
|
||||
flags: ApplicationFlags;
|
||||
/**
|
||||
* Up to 5 tags describing the content and functionality of the application
|
||||
* Approximate count of guilds the application has been added to
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* Array of redirect URIs for the application
|
||||
*/
|
||||
redirect_uris?: string[];
|
||||
/**
|
||||
* The interactions endpoint URL for the application
|
||||
*/
|
||||
interactions_endpoint_url?: string;
|
||||
/**
|
||||
* The application's role connection verification entry point,
|
||||
* which when configured will render the app as a verification method in the guild role verification configuration
|
||||
*/
|
||||
role_connections_verification_url?: string;
|
||||
/**
|
||||
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
|
||||
*/
|
||||
tags?: [string, string?, string?, string?, string?];
|
||||
/**
|
||||
@@ -107,20 +132,6 @@ export interface APIApplication {
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
custom_install_url?: string;
|
||||
/**
|
||||
* The application's role connection verification entry point,
|
||||
* which when configured will render the app as a verification method in the guild role verification configuration
|
||||
*/
|
||||
role_connections_verification_url?: string;
|
||||
/**
|
||||
* An approximate count of the app's guild membership
|
||||
* s
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* A partial object of the associated guild
|
||||
*/
|
||||
guild?: APIPartialGuild;
|
||||
}
|
||||
|
||||
export interface APIApplicationInstallParams {
|
||||
|
||||
@@ -13,9 +13,11 @@ import type {
|
||||
import type { APIChannel, APIOverwrite } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
APIGuildIntegrationType,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildMFALevel,
|
||||
GuildSystemChannelFlags,
|
||||
GuildVerificationLevel,
|
||||
IntegrationExpireBehavior,
|
||||
} from './guild.ts';
|
||||
@@ -312,6 +314,15 @@ export interface APIAuditLogOptions {
|
||||
* **Present only if the {@link APIAuditLogOptions#type entry type} is "0"**
|
||||
*/
|
||||
role_name?: string;
|
||||
|
||||
/**
|
||||
* Type of integration which performed the action
|
||||
*
|
||||
* Present from:
|
||||
* - MEMBER_KICK
|
||||
* - MEMBER_ROLE_UPDATE
|
||||
*/
|
||||
integration_type?: APIGuildIntegrationType;
|
||||
}
|
||||
|
||||
export enum AuditLogOptionsType {
|
||||
@@ -325,82 +336,83 @@ export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
|
||||
*/
|
||||
export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeyImageHash
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyOwnerId
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyPreferredLocale
|
||||
| APIAuditLogChangeKeyAFKChannelId
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyRulesChannelId
|
||||
| APIAuditLogChangeKeyPublicUpdatesChannelId
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyVerificationLevel
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyVanityURLCode
|
||||
| APIAuditLogChangeKey$Add
|
||||
| APIAuditLogChangeKey$Remove
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyWidgetEnabled
|
||||
| APIAuditLogChangeKeyWidgetChannelId
|
||||
| APIAuditLogChangeKeySystemChannelId
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyTopic
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyApplicationId
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyActions
|
||||
| APIAuditLogChangeKeyAFKChannelId
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyAllow
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyChannelId
|
||||
| APIAuditLogChangeKeyInviterId
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyApplicationId
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyId
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyChannelId
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
| APIAuditLogChangeKeyEnabled
|
||||
| APIAuditLogChangeKeyEnableEmoticons
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyEventType
|
||||
| APIAuditLogChangeKeyExemptChannels
|
||||
| APIAuditLogChangeKeyExemptRoles
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyUserLimit
|
||||
| APIAuditLogChangeKeyPrivacyLevel
|
||||
| APIAuditLogChangeKeyTags
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeyId
|
||||
| APIAuditLogChangeKeyImageHash
|
||||
| APIAuditLogChangeKeyInviterId
|
||||
| APIAuditLogChangeKeyLocation
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil
|
||||
| APIAuditLogChangeKeyTriggerType
|
||||
| APIAuditLogChangeKeyEventType
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyOwnerId
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyPreferredLocale
|
||||
| APIAuditLogChangeKeyPrivacyLevel
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyPublicUpdatesChannelId
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyRulesChannelId
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| 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
|
||||
@@ -533,6 +545,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
|
||||
*/
|
||||
@@ -725,22 +745,22 @@ export type APIAuditLogChangeKeyAvailable = AuditLogChangeData<'available', bool
|
||||
*/
|
||||
export type APIAuditLogChangeKeyGuildId = AuditLogChangeData<'guild_id', Snowflake>;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returned when a thread's archive status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyArchived = AuditLogChangeData<'archived', boolean>;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returned when a thread's lock status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyLocked = AuditLogChangeData<'locked', boolean>;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returned when a thread's auto archive duration is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAutoArchiveDuration = AuditLogChangeData<'auto_archive_duration', number>;
|
||||
|
||||
/*
|
||||
/**
|
||||
* Returned when a channel's default auto archive duration for newly created threads is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultAutoArchiveDuration = AuditLogChangeData<
|
||||
|
||||
@@ -6,7 +6,7 @@ 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 { APIMessageInteraction } from './interactions.ts';
|
||||
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APISticker, APIStickerItem } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
@@ -41,17 +41,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.GuildText
|
||||
| ChannelType.GuildForum
|
||||
| ChannelType.GuildVoice
|
||||
| ChannelType.GuildStageVoice
|
||||
| ChannelType.GuildMedia;
|
||||
| ChannelType.GuildText
|
||||
| ChannelType.GuildVoice
|
||||
| ChannelType.PrivateThread
|
||||
| ChannelType.PublicThread;
|
||||
|
||||
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
@@ -112,7 +110,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>
|
||||
export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType>
|
||||
extends Omit<APITextBasedChannel<T>, 'name'>,
|
||||
APIGuildChannel<T> {
|
||||
/**
|
||||
@@ -125,7 +123,7 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
|
||||
*/
|
||||
default_thread_rate_limit_per_user?: number;
|
||||
/**
|
||||
* The channel topic (0-4096 characters for thread-only channels, 0-1024 characters for all others)
|
||||
* The channel topic (0-1024 characters)
|
||||
*/
|
||||
topic?: string | null;
|
||||
}
|
||||
@@ -136,7 +134,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
|
||||
*/
|
||||
@@ -202,12 +200,11 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
|
||||
managed?: boolean;
|
||||
}
|
||||
|
||||
export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
|
||||
|
||||
export interface APIThreadChannel
|
||||
extends Omit<
|
||||
APITextBasedChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread>,
|
||||
'name'
|
||||
>,
|
||||
APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
|
||||
extends Omit<APITextBasedChannel<ThreadChannelType>, 'name'>,
|
||||
APIGuildChannel<ThreadChannelType> {
|
||||
/**
|
||||
* The client users member for the thread, only included in select endpoints
|
||||
*/
|
||||
@@ -315,11 +312,40 @@ export enum ForumLayoutType {
|
||||
}
|
||||
|
||||
export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia>
|
||||
extends APIGuildTextChannel<T> {
|
||||
extends APIGuildChannel<T> {
|
||||
/**
|
||||
* The channel topic (0-4096 characters)
|
||||
*/
|
||||
topic?: string | null;
|
||||
/**
|
||||
* The id of the last thread created in this channel (may not point to an existing or valid thread)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before creating another thread (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*
|
||||
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
/**
|
||||
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
|
||||
*/
|
||||
default_auto_archive_duration?: ThreadAutoArchiveDuration;
|
||||
/**
|
||||
* The set of tags that can be used in a thread-only channel
|
||||
*/
|
||||
available_tags: APIGuildForumTag[];
|
||||
/**
|
||||
* The initial `rate_limit_per_user` to set on newly created threads.
|
||||
* This field is copied to the thread at creation time and does not live update
|
||||
*/
|
||||
default_thread_rate_limit_per_user?: number;
|
||||
/**
|
||||
* The emoji to show in the add reaction button on a thread in a thread-only channel
|
||||
*/
|
||||
@@ -343,16 +369,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
|
||||
@@ -573,7 +599,7 @@ export interface APIMessage {
|
||||
* **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE`
|
||||
* event to ensure it got sent**
|
||||
*/
|
||||
nonce?: string | number;
|
||||
nonce?: number | string;
|
||||
/**
|
||||
* Whether this message is pinned
|
||||
*/
|
||||
@@ -670,6 +696,12 @@ export interface APIMessage {
|
||||
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
|
||||
*/
|
||||
position?: number;
|
||||
/**
|
||||
* Data for users, members, channels, and roles in the message's auto-populated select menus
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -833,19 +865,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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1505,7 +1563,7 @@ export interface APIMessageComponentEmoji {
|
||||
|
||||
export interface APIButtonComponentWithCustomId
|
||||
extends APIButtonComponentBase<
|
||||
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
|
||||
ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success
|
||||
> {
|
||||
/**
|
||||
* The custom_id to be sent in the interaction when clicked
|
||||
@@ -1546,11 +1604,11 @@ export enum TextInputStyle {
|
||||
*/
|
||||
export interface APIBaseSelectMenuComponent<
|
||||
T extends
|
||||
| ComponentType.StringSelect
|
||||
| ComponentType.UserSelect
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.ChannelSelect
|
||||
| ComponentType.MentionableSelect
|
||||
| ComponentType.ChannelSelect,
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.StringSelect
|
||||
| ComponentType.UserSelect,
|
||||
> extends APIBaseComponent<T> {
|
||||
/**
|
||||
* A developer-defined identifier for the select menu, max 100 characters
|
||||
@@ -1580,6 +1638,20 @@ export interface APIBaseSelectMenuComponent<
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export interface APIBaseAutoPopulatedSelectMenuComponent<
|
||||
T extends
|
||||
| ComponentType.ChannelSelect
|
||||
| ComponentType.MentionableSelect
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.UserSelect,
|
||||
D extends SelectMenuDefaultValueType,
|
||||
> extends APIBaseSelectMenuComponent<T> {
|
||||
/**
|
||||
* List of default values for auto-populated select menu components
|
||||
*/
|
||||
default_values?: APISelectMenuDefaultValue<D>[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
@@ -1593,44 +1665,77 @@ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<Com
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APIUserSelectComponent = APIBaseSelectMenuComponent<ComponentType.UserSelect>;
|
||||
export type APIUserSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
|
||||
ComponentType.UserSelect,
|
||||
SelectMenuDefaultValueType.User
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APIRoleSelectComponent = APIBaseSelectMenuComponent<ComponentType.RoleSelect>;
|
||||
export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
|
||||
ComponentType.RoleSelect,
|
||||
SelectMenuDefaultValueType.Role
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APIMentionableSelectComponent = APIBaseSelectMenuComponent<ComponentType.MentionableSelect>;
|
||||
export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
|
||||
ComponentType.MentionableSelect,
|
||||
SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export interface APIChannelSelectComponent extends APIBaseSelectMenuComponent<ComponentType.ChannelSelect> {
|
||||
export interface APIChannelSelectComponent
|
||||
extends APIBaseAutoPopulatedSelectMenuComponent<ComponentType.ChannelSelect, SelectMenuDefaultValueType.Channel> {
|
||||
/**
|
||||
* List of channel types to include in the ChannelSelect component
|
||||
*/
|
||||
channel_types?: ChannelType[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
|
||||
*/
|
||||
export enum SelectMenuDefaultValueType {
|
||||
Channel = 'channel',
|
||||
Role = 'role',
|
||||
User = 'user',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
|
||||
*/
|
||||
export interface APISelectMenuDefaultValue<T extends SelectMenuDefaultValueType> {
|
||||
type: T;
|
||||
id: Snowflake;
|
||||
}
|
||||
|
||||
export type APIAutoPopulatedSelectMenuComponent =
|
||||
| APIChannelSelectComponent
|
||||
| APIMentionableSelectComponent
|
||||
| APIRoleSelectComponent
|
||||
| APIUserSelectComponent;
|
||||
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
@@ -1638,7 +1743,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;
|
||||
/**
|
||||
@@ -1735,8 +1840,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;
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
@@ -419,7 +419,7 @@ export enum GuildFeature {
|
||||
* Guild has enabled the role subscription promo page
|
||||
*/
|
||||
CreatorStorePage = 'CREATOR_STORE_PAGE',
|
||||
/*
|
||||
/**
|
||||
* Guild has been set as a support server on the App Directory
|
||||
*/
|
||||
DeveloperSupportServer = 'DEVELOPER_SUPPORT_SERVER',
|
||||
@@ -798,7 +798,7 @@ export interface APIGuildIntegration {
|
||||
scopes?: OAuth2Scopes[];
|
||||
}
|
||||
|
||||
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription';
|
||||
export type APIGuildIntegrationType = 'discord' | 'guild_subscription' | 'twitch' | 'youtube';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
|
||||
|
||||
@@ -90,9 +90,9 @@ export interface APIExternalGuildScheduledEvent
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
|
||||
*/
|
||||
export type APIGuildScheduledEvent =
|
||||
| APIExternalGuildScheduledEvent
|
||||
| APIStageInstanceGuildScheduledEvent
|
||||
| APIVoiceGuildScheduledEvent
|
||||
| APIExternalGuildScheduledEvent;
|
||||
| APIVoiceGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
|
||||
|
||||
@@ -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'
|
||||
>;
|
||||
|
||||
/**
|
||||
|
||||
@@ -18,3 +18,4 @@ export * from './template.ts';
|
||||
export * from './user.ts';
|
||||
export * from './voice.ts';
|
||||
export * from './webhook.ts';
|
||||
export * from './monetization.ts';
|
||||
|
||||
115
deno/payloads/v9/monetization.ts
Normal file
115
deno/payloads/v9/monetization.ts
Normal file
@@ -0,0 +1,115 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-structure
|
||||
*/
|
||||
export interface APIEntitlement {
|
||||
/**
|
||||
* ID of the entitlement
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* ID of the SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
/**
|
||||
* ID of the user that is granted access to the entitlement's sku
|
||||
*/
|
||||
user_id?: Snowflake;
|
||||
/**
|
||||
* ID of the guild that is granted access to the entitlement's sku
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* ID of the parent application
|
||||
*/
|
||||
application_id: Snowflake;
|
||||
/**
|
||||
* Type of entitlement
|
||||
*/
|
||||
type: EntitlementType;
|
||||
/**
|
||||
* Whether the entitlement was deleted
|
||||
*/
|
||||
deleted: boolean;
|
||||
/**
|
||||
* Start date at which the entitlement is valid. Not present when using test entitlements.
|
||||
*/
|
||||
starts_at?: string;
|
||||
/**
|
||||
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
|
||||
*/
|
||||
ends_at?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
|
||||
*/
|
||||
export enum EntitlementType {
|
||||
/**
|
||||
* Entitlement was purchased as an app subscription
|
||||
*/
|
||||
ApplicationSubscription = 8,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/skus#sku-object-sku-structure
|
||||
*/
|
||||
export interface APISKU {
|
||||
/**
|
||||
* ID of SKU
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Type of SKU
|
||||
*/
|
||||
type: SKUType;
|
||||
/**
|
||||
* ID of the parent application
|
||||
*/
|
||||
application_id: Snowflake;
|
||||
/**
|
||||
* Customer-facing name of your premium offering
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* System-generated URL slug based on the SKU's name
|
||||
*/
|
||||
slug: string;
|
||||
/**
|
||||
* SKU flags combined as a bitfield
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
flags: SKUFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/skus#sku-object-sku-flags
|
||||
*/
|
||||
export enum SKUFlags {
|
||||
/**
|
||||
* SKU is available for purchase
|
||||
*/
|
||||
Available = 1 << 2,
|
||||
/**
|
||||
* Recurring SKU that can be purchased by a user and applied to a single server.
|
||||
* Grants access to every user in that server.
|
||||
*/
|
||||
GuildSubscription = 1 << 7,
|
||||
/**
|
||||
* Recurring SKU purchased by a user for themselves. Grants access to the purchasing user in every server.
|
||||
*/
|
||||
UserSubscription = 1 << 8,
|
||||
}
|
||||
|
||||
export enum SKUType {
|
||||
/**
|
||||
* Represents a recurring subscription
|
||||
*/
|
||||
Subscription = 5,
|
||||
/**
|
||||
* System-generated group for each Subscription SKU created
|
||||
*/
|
||||
SubscriptionGroup = 6,
|
||||
}
|
||||
@@ -70,7 +70,7 @@ export interface APISticker {
|
||||
*/
|
||||
export enum StickerType {
|
||||
/**
|
||||
* An official sticker in a pack, part of Nitro or in a removed purchasable pack
|
||||
* An official sticker in a pack
|
||||
*/
|
||||
Standard = 1,
|
||||
/**
|
||||
@@ -92,7 +92,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
|
||||
|
||||
@@ -43,6 +43,8 @@ export interface APITeamMember {
|
||||
membership_state: TeamMemberMembershipState;
|
||||
/**
|
||||
* Will always be `["*"]`
|
||||
*
|
||||
* @deprecated Use `role` instead
|
||||
*/
|
||||
permissions: ['*'];
|
||||
/**
|
||||
@@ -55,6 +57,12 @@ export interface APITeamMember {
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* The user's role in the team.
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/teams#team-member-roles
|
||||
*/
|
||||
role: TeamMemberRole;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,3 +72,12 @@ export enum TeamMemberMembershipState {
|
||||
Invited = 1,
|
||||
Accepted,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#team-member-roles-team-member-role-types
|
||||
*/
|
||||
export enum TeamMemberRole {
|
||||
Admin = 'admin',
|
||||
Developer = 'developer',
|
||||
ReadOnly = 'read_only',
|
||||
}
|
||||
|
||||
@@ -281,7 +281,11 @@ export enum ConnectionService {
|
||||
Steam = 'steam',
|
||||
TikTok = 'tiktok',
|
||||
Twitch = 'twitch',
|
||||
Twitter = 'twitter',
|
||||
X = 'twitter',
|
||||
/**
|
||||
* @deprecated This is the old name for {@apilink ConnectionService#X}
|
||||
*/
|
||||
Twitter = X,
|
||||
Xbox = 'xbox',
|
||||
YouTube = 'youtube',
|
||||
}
|
||||
@@ -312,5 +316,5 @@ export interface APIApplicationRoleConnection {
|
||||
/**
|
||||
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
|
||||
*/
|
||||
metadata: Record<string, string | number>;
|
||||
metadata: Record<string, number | string>;
|
||||
}
|
||||
|
||||
@@ -154,6 +154,8 @@ export enum RESTJSONErrorCodes {
|
||||
ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40_066,
|
||||
TagRequiredToCreateAForumPostInThisChannel,
|
||||
|
||||
AnEntitlementHasAlreadyBeenGrantedForThisResource = 40_074,
|
||||
|
||||
MissingAccess = 50_001,
|
||||
InvalidAccountType,
|
||||
CannotExecuteActionOnDMChannel,
|
||||
@@ -198,6 +200,8 @@ export enum RESTJSONErrorCodes {
|
||||
CannotSelfRedeemThisGift = 50_054,
|
||||
InvalidGuild,
|
||||
|
||||
InvalidSKU = 50_057,
|
||||
|
||||
InvalidRequestOrigin = 50_067,
|
||||
InvalidMessageType,
|
||||
|
||||
@@ -250,6 +254,7 @@ export enum RESTJSONErrorCodes {
|
||||
NoUsersWithDiscordTagExist = 80_004,
|
||||
|
||||
ReactionWasBlocked = 90_001,
|
||||
UserCannotUseBurstReactions,
|
||||
|
||||
ApplicationNotYetAvailable = 110_001,
|
||||
|
||||
@@ -288,6 +293,8 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
CannotEnableOnboardingRequirementsAreNotMet = 350_000,
|
||||
CannotUpdateOnboardingWhileBelowRequirements,
|
||||
|
||||
FailedToBanUsers = 500_000,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -320,6 +327,7 @@ export enum Locale {
|
||||
Romanian = 'ro',
|
||||
Russian = 'ru',
|
||||
SpanishES = 'es-ES',
|
||||
SpanishLATAM = 'es-419',
|
||||
Swedish = 'sv-SE',
|
||||
Thai = 'th',
|
||||
Turkish = 'tr',
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { APIApplication, APIApplicationRoleConnectionMetadata } from '../../payloads/v10/application.ts';
|
||||
import type { Nullable, StrictPartial } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
|
||||
@@ -19,3 +20,25 @@ export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRo
|
||||
* https://discord.com/developers/docs/resources/application#get-current-application
|
||||
*/
|
||||
export type RESTGetCurrentApplicationResult = APIApplication;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#edit-current-application
|
||||
*/
|
||||
export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
|
||||
Nullable<Pick<APIApplication, 'cover_image' | 'icon'>> &
|
||||
Pick<
|
||||
APIApplication,
|
||||
| 'custom_install_url'
|
||||
| 'description'
|
||||
| 'flags'
|
||||
| 'install_params'
|
||||
| 'interactions_endpoint_url'
|
||||
| 'role_connections_verification_url'
|
||||
| 'tags'
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#edit-current-application
|
||||
*/
|
||||
export type RESTPatchCurrentApplicationResult = APIApplication;
|
||||
|
||||
@@ -2,7 +2,6 @@ import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
APIAllowedMentions,
|
||||
APIAttachment,
|
||||
APIChannel,
|
||||
APIEmbed,
|
||||
APIExtendedInvite,
|
||||
@@ -18,6 +17,7 @@ import type {
|
||||
MessageFlags,
|
||||
OverwriteType,
|
||||
ThreadAutoArchiveDuration,
|
||||
ThreadChannelType,
|
||||
VideoQualityMode,
|
||||
APIGuildForumTag,
|
||||
APIGuildForumDefaultReactionEmoji,
|
||||
@@ -181,6 +181,12 @@ export interface RESTPatchAPIChannelJSONBody {
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_forum_layout?: ForumLayoutType | undefined;
|
||||
/**
|
||||
* The ids of the set of tags that have been applied to a thread-only channel; limited to 5
|
||||
*
|
||||
* Channel types: forum, media
|
||||
*/
|
||||
applied_tags?: Snowflake[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -230,8 +236,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 APIMessageReferenceSend = 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
|
||||
*
|
||||
@@ -240,6 +248,24 @@ export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
|
||||
fail_if_not_exists?: boolean | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
export interface RESTAPIAttachment {
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
@@ -285,28 +311,33 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined;
|
||||
sticker_ids?: [Snowflake, Snowflake, Snowflake] | [Snowflake, Snowflake] | [Snowflake] | undefined;
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
|
||||
attachments?: RESTAPIAttachment[] | undefined;
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
@@ -333,7 +364,7 @@ export type RESTDeleteAPIChannelMessageOwnReaction = never;
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageUserReactionResult = never;
|
||||
|
||||
/*
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
@@ -400,7 +431,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
|
||||
attachments?: RESTAPIAttachment[] | undefined;
|
||||
/**
|
||||
* The components to include with the message
|
||||
*
|
||||
@@ -413,13 +444,13 @@ export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageFormDataBody =
|
||||
| ({
|
||||
| (Record<`files[${bigint}]`, unknown> & {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
})
|
||||
| (Record<`files[${bigint}]`, unknown> & RESTPatchAPIChannelMessageJSONBody);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
@@ -619,7 +650,7 @@ export interface RESTPostAPIChannelMessagesThreadsJSONBody {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-media-channel
|
||||
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel
|
||||
*/
|
||||
export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & {
|
||||
/**
|
||||
@@ -661,7 +692,7 @@ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMes
|
||||
*
|
||||
* @default ChannelType.PrivateThread
|
||||
*/
|
||||
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread | undefined;
|
||||
type?: ThreadChannelType | undefined;
|
||||
/**
|
||||
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
|
||||
*/
|
||||
@@ -721,7 +752,7 @@ export interface RESTGetAPIChannelThreadMembersQuery {
|
||||
*/
|
||||
export type RESTGetAPIChannelThreadMembersResult = APIThreadMember[];
|
||||
|
||||
/*
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#list-public-archived-threads
|
||||
*/
|
||||
export interface RESTGetAPIChannelThreadsArchivedQuery {
|
||||
|
||||
@@ -24,8 +24,11 @@ import type {
|
||||
GuildSystemChannelFlags,
|
||||
GuildVerificationLevel,
|
||||
GuildWidgetStyle,
|
||||
APIGuildOnboardingPrompt,
|
||||
APIGuildOnboardingPromptOption,
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type {
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
|
||||
DistributiveOmit,
|
||||
DistributivePick,
|
||||
Nullable,
|
||||
@@ -42,22 +45,22 @@ export type APIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGr
|
||||
export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
DistributivePick<
|
||||
APIGuildChannelResolvable,
|
||||
| 'type'
|
||||
| 'topic'
|
||||
| 'nsfw'
|
||||
| 'bitrate'
|
||||
| 'user_limit'
|
||||
| 'rate_limit_per_user'
|
||||
| 'default_auto_archive_duration'
|
||||
| 'position'
|
||||
| 'rtc_region'
|
||||
| 'video_quality_mode'
|
||||
| 'flags'
|
||||
| 'default_reaction_emoji'
|
||||
| 'available_tags'
|
||||
| 'default_sort_order'
|
||||
| 'bitrate'
|
||||
| 'default_auto_archive_duration'
|
||||
| 'default_forum_layout'
|
||||
| 'default_reaction_emoji'
|
||||
| 'default_sort_order'
|
||||
| 'default_thread_rate_limit_per_user'
|
||||
| 'flags'
|
||||
| 'nsfw'
|
||||
| 'position'
|
||||
| 'rate_limit_per_user'
|
||||
| 'rtc_region'
|
||||
| 'topic'
|
||||
| 'type'
|
||||
| 'user_limit'
|
||||
| 'video_quality_mode'
|
||||
>
|
||||
> & {
|
||||
name: string;
|
||||
@@ -139,15 +142,15 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
afk_channel_id?: number | Snowflake | null | undefined;
|
||||
afk_channel_id?: Snowflake | number | null | undefined;
|
||||
/**
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout?: 60 | 300 | 900 | 1_800 | 3_600 | undefined;
|
||||
afk_timeout?: 1_800 | 3_600 | 60 | 300 | 900 | undefined;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
system_channel_id?: number | Snowflake | null | undefined;
|
||||
system_channel_id?: Snowflake | number | null | undefined;
|
||||
/**
|
||||
* System channel flags
|
||||
*
|
||||
@@ -243,7 +246,7 @@ export interface RESTPatchAPIGuildJSONBody {
|
||||
/**
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout?: 60 | 300 | 900 | 1_800 | 3_600 | undefined;
|
||||
afk_timeout?: 1_800 | 3_600 | 60 | 300 | 900 | undefined;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature)
|
||||
*
|
||||
@@ -601,6 +604,34 @@ export type RESTPutAPIGuildBanResult = never;
|
||||
*/
|
||||
export type RESTDeleteAPIGuildBanResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#bulk-guild-ban
|
||||
*/
|
||||
export interface RESTPostAPIGuildBulkBanJSONBody {
|
||||
/**
|
||||
* List of user ids to ban (max 200)
|
||||
*/
|
||||
user_ids: Snowflake[];
|
||||
/**
|
||||
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
|
||||
*/
|
||||
delete_message_seconds?: number | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#bulk-guild-ban
|
||||
*/
|
||||
export interface RESTPostAPIGuildBulkBanResult {
|
||||
/**
|
||||
* List of user ids, that were successfully banned
|
||||
*/
|
||||
banned_users: Snowflake[];
|
||||
/**
|
||||
* List of user ids, that were not banned
|
||||
*/
|
||||
failed_users: Snowflake[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-roles
|
||||
*/
|
||||
@@ -930,10 +961,42 @@ export type RESTGetAPIGuildOnboardingResult = APIGuildOnboarding;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
|
||||
*/
|
||||
export type RESTPutAPIGuildOnboardingJSONBody = Pick<
|
||||
APIGuildOnboarding,
|
||||
'default_channel_ids' | 'enabled' | 'mode' | 'prompts'
|
||||
>;
|
||||
export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Pick<APIGuildOnboarding, 'default_channel_ids' | 'enabled' | 'mode'>>
|
||||
> & {
|
||||
/**
|
||||
* Prompts shown during onboarding and in customize community
|
||||
*/
|
||||
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
|
||||
/**
|
||||
* Options available within the prompt
|
||||
*/
|
||||
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
|
||||
};
|
||||
|
||||
export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
|
||||
> &
|
||||
Pick<APIGuildOnboardingPromptOption, 'title'> & {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
emoji_id?: Snowflake | null | undefined;
|
||||
/**
|
||||
* Emoji name
|
||||
*/
|
||||
emoji_name?: string | null | undefined;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
emoji_animated?: boolean | null | undefined;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
|
||||
|
||||
@@ -42,15 +42,15 @@ export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
|
||||
type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
|
||||
Omit<
|
||||
APIApplicationCommand,
|
||||
| 'id'
|
||||
| 'application_id'
|
||||
| 'default_member_permissions'
|
||||
| 'description_localized'
|
||||
| 'description'
|
||||
| 'guild_id'
|
||||
| 'id'
|
||||
| 'name_localized'
|
||||
| 'type'
|
||||
| 'version'
|
||||
| 'guild_id'
|
||||
| 'name_localized'
|
||||
| 'description_localized'
|
||||
| 'default_member_permissions'
|
||||
> &
|
||||
Partial<Pick<APIApplicationCommand, 'default_member_permissions'>>
|
||||
>;
|
||||
@@ -67,7 +67,7 @@ export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPos
|
||||
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
|
||||
*/
|
||||
export interface RESTPostAPIContextMenuApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody {
|
||||
type: ApplicationCommandType.User | ApplicationCommandType.Message;
|
||||
type: ApplicationCommandType.Message | ApplicationCommandType.User;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -166,13 +166,13 @@ export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse;
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
|
||||
*/
|
||||
export type RESTPostAPIInteractionCallbackFormDataBody =
|
||||
| ({
|
||||
| (Record<`files[${bigint}]`, unknown> & {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
})
|
||||
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionCallbackJSONBody);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response
|
||||
@@ -208,13 +208,13 @@ export type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallb
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
|
||||
*/
|
||||
export type RESTPostAPIInteractionFollowupFormDataBody =
|
||||
| ({
|
||||
| (Record<`files[${bigint}]`, unknown> & {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string | undefined;
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
})
|
||||
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionFollowupJSONBody);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
|
||||
|
||||
@@ -18,6 +18,7 @@ export * from './template.ts';
|
||||
export * from './user.ts';
|
||||
export * from './voice.ts';
|
||||
export * from './webhook.ts';
|
||||
export * from './monetization.ts';
|
||||
|
||||
export const APIVersion = '10';
|
||||
|
||||
@@ -472,7 +473,9 @@ export const Routes = {
|
||||
|
||||
parts.push('threads');
|
||||
|
||||
return parts.join('/') as `/channels/${Snowflake}/threads` | `/channels/${Snowflake}/messages/${Snowflake}/threads`;
|
||||
return parts.join('/') as
|
||||
| `/channels/${Snowflake}/messages/${Snowflake}/threads`
|
||||
| `/channels/${Snowflake}/threads`;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -488,7 +491,7 @@ export const Routes = {
|
||||
* - GET `/channels/{channel.id}/threads/archived/public`
|
||||
* - GET `/channels/{channel.id}/threads/archived/private`
|
||||
*/
|
||||
channelThreads(channelId: Snowflake, archivedStatus: 'public' | 'private') {
|
||||
channelThreads(channelId: Snowflake, archivedStatus: 'private' | 'public') {
|
||||
return `/channels/${channelId}/threads/archived/${archivedStatus}` as const;
|
||||
},
|
||||
|
||||
@@ -515,8 +518,8 @@ export const Routes = {
|
||||
if (userId) parts.push(userId);
|
||||
|
||||
return parts.join('/') as
|
||||
| `/channels/${Snowflake}/thread-members`
|
||||
| `/channels/${Snowflake}/thread-members/${Snowflake | '@me'}`;
|
||||
| `/channels/${Snowflake}/thread-members/${Snowflake | '@me'}`
|
||||
| `/channels/${Snowflake}/thread-members`;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -622,7 +625,7 @@ export const Routes = {
|
||||
|
||||
if (webhookToken) parts.push(webhookToken);
|
||||
|
||||
return parts.join('/') as `/webhooks/${Snowflake}` | `/webhooks/${Snowflake}/${string}`;
|
||||
return parts.join('/') as `/webhooks/${Snowflake}/${string}` | `/webhooks/${Snowflake}`;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -830,6 +833,16 @@ export const Routes = {
|
||||
* Route for:
|
||||
* - GET `/sticker-packs`
|
||||
*/
|
||||
stickerPacks() {
|
||||
return '/sticker-packs' as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/sticker-packs`
|
||||
*
|
||||
* @deprecated Use {@link Routes.stickerPacks} instead.
|
||||
*/
|
||||
nitroStickerPacks() {
|
||||
return '/sticker-packs' as const;
|
||||
},
|
||||
@@ -892,14 +905,56 @@ export const Routes = {
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/@me`
|
||||
* - PATCH `/applications/@me`
|
||||
*/
|
||||
currentApplication() {
|
||||
return '/applications/@me' as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/entitlements`
|
||||
* - POST `/applications/{application.id}/entitlements`
|
||||
*/
|
||||
entitlements(applicationId: Snowflake) {
|
||||
return `/applications/${applicationId}/entitlements` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/applications/{application.id}/entitlements/{entitlement.id}`
|
||||
*/
|
||||
entitlement(applicationId: Snowflake, entitlementId: Snowflake) {
|
||||
return `/applications/${applicationId}/entitlements/${entitlementId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/skus`
|
||||
*/
|
||||
skus(applicationId: Snowflake) {
|
||||
return `/applications/${applicationId}/skus` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/guilds/{guild.id}/bulk-ban`
|
||||
*/
|
||||
guildBulkBan(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/bulk-ban` as const;
|
||||
},
|
||||
};
|
||||
|
||||
export const StickerPackApplicationId = '710982414301790216';
|
||||
|
||||
export enum ImageFormat {
|
||||
JPEG = 'jpeg',
|
||||
PNG = 'png',
|
||||
WebP = 'webp',
|
||||
GIF = 'gif',
|
||||
Lottie = 'json',
|
||||
}
|
||||
|
||||
export const CDNRoutes = {
|
||||
/**
|
||||
* Route for:
|
||||
@@ -909,7 +964,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP, GIF
|
||||
*/
|
||||
emoji(emojiId: Snowflake, format: EmojiFormat) {
|
||||
emoji<Format extends EmojiFormat>(emojiId: Snowflake, format: Format) {
|
||||
return `/emojis/${emojiId}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -921,7 +976,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP, GIF
|
||||
*/
|
||||
guildIcon(guildId: Snowflake, guildIcon: string, format: GuildIconFormat) {
|
||||
guildIcon<Format extends GuildIconFormat>(guildId: Snowflake, guildIcon: string, format: Format) {
|
||||
return `icons/${guildId}/${guildIcon}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -931,7 +986,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
guildSplash(guildId: Snowflake, guildSplash: string, format: GuildSplashFormat) {
|
||||
guildSplash<Format extends GuildSplashFormat>(guildId: Snowflake, guildSplash: string, format: Format) {
|
||||
return `/splashes/${guildId}/${guildSplash}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -941,7 +996,11 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
guildDiscoverySplash(guildId: Snowflake, guildDiscoverySplash: string, format: GuildDiscoverySplashFormat) {
|
||||
guildDiscoverySplash<Format extends GuildDiscoverySplashFormat>(
|
||||
guildId: Snowflake,
|
||||
guildDiscoverySplash: string,
|
||||
format: Format,
|
||||
) {
|
||||
return `/discovery-splashes/${guildId}/${guildDiscoverySplash}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -953,7 +1012,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP, GIF
|
||||
*/
|
||||
guildBanner(guildId: Snowflake, guildBanner: string, format: GuildBannerFormat) {
|
||||
guildBanner<Format extends GuildBannerFormat>(guildId: Snowflake, guildBanner: string, format: Format) {
|
||||
return `/banners/${guildId}/${guildBanner}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -965,7 +1024,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP, GIF
|
||||
*/
|
||||
userBanner(userId: Snowflake, userBanner: string, format: UserBannerFormat) {
|
||||
userBanner<Format extends UserBannerFormat>(userId: Snowflake, userBanner: string, format: Format) {
|
||||
return `/banners/${userId}/${userBanner}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -979,7 +1038,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extension: PNG
|
||||
*/
|
||||
defaultUserAvatar(index: DefaultUserAvatarAssets) {
|
||||
defaultUserAvatar<Index extends DefaultUserAvatarAssets>(index: Index) {
|
||||
return `/embed/avatars/${index}.png` as const;
|
||||
},
|
||||
|
||||
@@ -991,7 +1050,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP, GIF
|
||||
*/
|
||||
userAvatar(userId: Snowflake, userAvatar: string, format: UserAvatarFormat) {
|
||||
userAvatar<Format extends UserAvatarFormat>(userId: Snowflake, userAvatar: string, format: Format) {
|
||||
return `/avatars/${userId}/${userAvatar}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -1003,7 +1062,12 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP, GIF
|
||||
*/
|
||||
guildMemberAvatar(guildId: Snowflake, userId: Snowflake, memberAvatar: string, format: GuildMemberAvatarFormat) {
|
||||
guildMemberAvatar<Format extends GuildMemberAvatarFormat>(
|
||||
guildId: Snowflake,
|
||||
userId: Snowflake,
|
||||
memberAvatar: string,
|
||||
format: Format,
|
||||
) {
|
||||
return `/guilds/${guildId}/users/${userId}/avatars/${memberAvatar}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -1023,7 +1087,11 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
applicationIcon(applicationId: Snowflake, applicationIcon: string, format: ApplicationIconFormat) {
|
||||
applicationIcon<Format extends ApplicationIconFormat>(
|
||||
applicationId: Snowflake,
|
||||
applicationIcon: string,
|
||||
format: Format,
|
||||
) {
|
||||
return `/app-icons/${applicationId}/${applicationIcon}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -1033,7 +1101,11 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
applicationCover(applicationId: Snowflake, applicationCoverImage: string, format: ApplicationCoverFormat) {
|
||||
applicationCover<Format extends ApplicationCoverFormat>(
|
||||
applicationId: Snowflake,
|
||||
applicationCoverImage: string,
|
||||
format: Format,
|
||||
) {
|
||||
return `/app-icons/${applicationId}/${applicationCoverImage}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -1043,7 +1115,11 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
applicationAsset(applicationId: Snowflake, applicationAssetId: string, format: ApplicationAssetFormat) {
|
||||
applicationAsset<Format extends ApplicationAssetFormat>(
|
||||
applicationId: Snowflake,
|
||||
applicationAssetId: string,
|
||||
format: Format,
|
||||
) {
|
||||
return `/app-assets/${applicationId}/${applicationAssetId}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -1053,11 +1129,11 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
achievementIcon(
|
||||
achievementIcon<Format extends AchievementIconFormat>(
|
||||
applicationId: Snowflake,
|
||||
achievementId: Snowflake,
|
||||
achievementIconHash: string,
|
||||
format: AchievementIconFormat,
|
||||
format: Format,
|
||||
) {
|
||||
return `/app-assets/${applicationId}/achievements/${achievementId}/icons/${achievementIconHash}.${format}` as const;
|
||||
},
|
||||
@@ -1068,7 +1144,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
stickerPackBanner(stickerPackBannerAssetId: Snowflake, format: StickerPackBannerFormat) {
|
||||
stickerPackBanner<Format extends StickerPackBannerFormat>(stickerPackBannerAssetId: Snowflake, format: Format) {
|
||||
return `/app-assets/${StickerPackApplicationId}/store/${stickerPackBannerAssetId}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -1078,8 +1154,12 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
storePageAsset(applicationId: Snowflake, assetId: string) {
|
||||
return `/app-assets/${applicationId}/store/${assetId}.png` as const;
|
||||
storePageAsset<Format extends StorePageAssetFormat = ImageFormat.PNG>(
|
||||
applicationId: Snowflake,
|
||||
assetId: string,
|
||||
format: Format = ImageFormat.PNG as Format,
|
||||
) {
|
||||
return `/app-assets/${applicationId}/store/${assetId}.${format}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1088,7 +1168,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
teamIcon(teamId: Snowflake, teamIcon: string, format: TeamIconFormat) {
|
||||
teamIcon<Format extends TeamIconFormat>(teamId: Snowflake, teamIcon: string, format: Format) {
|
||||
return `/team-icons/${teamId}/${teamIcon}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -1098,7 +1178,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, Lottie, GIF
|
||||
*/
|
||||
sticker(stickerId: Snowflake, format: StickerFormat) {
|
||||
sticker<Format extends StickerFormat>(stickerId: Snowflake, format: Format) {
|
||||
return `/stickers/${stickerId}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -1108,7 +1188,7 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
roleIcon(roleId: Snowflake, roleIcon: string, format: RoleIconFormat) {
|
||||
roleIcon<Format extends RoleIconFormat>(roleId: Snowflake, roleIcon: string, format: Format) {
|
||||
return `/role-icons/${roleId}/${roleIcon}.${format}` as const;
|
||||
},
|
||||
|
||||
@@ -1118,10 +1198,10 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP
|
||||
*/
|
||||
guildScheduledEventCover(
|
||||
guildScheduledEventCover<Format extends GuildScheduledEventCoverFormat>(
|
||||
guildScheduledEventId: Snowflake,
|
||||
guildScheduledEventCoverImage: string,
|
||||
format: GuildScheduledEventCoverFormat,
|
||||
format: Format,
|
||||
) {
|
||||
return `/guild-events/${guildScheduledEventId}/${guildScheduledEventCoverImage}.${format}` as const;
|
||||
},
|
||||
@@ -1132,7 +1212,12 @@ export const CDNRoutes = {
|
||||
*
|
||||
* This route supports the extensions: PNG, JPEG, WebP, GIF
|
||||
*/
|
||||
guildMemberBanner(guildId: Snowflake, userId: Snowflake, guildMemberBanner: string, format: GuildMemberBannerFormat) {
|
||||
guildMemberBanner<Format extends GuildMemberBannerFormat>(
|
||||
guildId: Snowflake,
|
||||
userId: Snowflake,
|
||||
guildMemberBanner: string,
|
||||
format: Format,
|
||||
) {
|
||||
return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const;
|
||||
},
|
||||
};
|
||||
@@ -1141,32 +1226,25 @@ export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;
|
||||
|
||||
export type EmojiFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
|
||||
export type GuildIconFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
|
||||
export type GuildSplashFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type GuildDiscoverySplashFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type GuildSplashFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
|
||||
export type GuildDiscoverySplashFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
|
||||
export type GuildBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
|
||||
export type UserBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
|
||||
export type DefaultUserAvatar = Extract<ImageFormat, ImageFormat.PNG>;
|
||||
export type UserAvatarFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
|
||||
export type GuildMemberAvatarFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
|
||||
export type ApplicationIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type ApplicationCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type ApplicationAssetFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type AchievementIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type StickerPackBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type TeamIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type StickerFormat = Extract<ImageFormat, ImageFormat.PNG | ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
|
||||
export type ApplicationIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
|
||||
export type ApplicationCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
|
||||
export type ApplicationAssetFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
|
||||
export type AchievementIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
|
||||
export type StickerPackBannerFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
|
||||
export type TeamIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
|
||||
export type StorePageAssetFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
|
||||
export type StickerFormat = Extract<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie | ImageFormat.PNG>;
|
||||
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
|
||||
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
|
||||
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
|
||||
|
||||
export enum ImageFormat {
|
||||
JPEG = 'jpeg',
|
||||
PNG = 'png',
|
||||
WebP = 'webp',
|
||||
GIF = 'gif',
|
||||
Lottie = 'json',
|
||||
}
|
||||
|
||||
export interface CDNQuery {
|
||||
/**
|
||||
* The returned image can have the size changed by using this query parameter
|
||||
|
||||
85
deno/rest/v10/monetization.ts
Normal file
85
deno/rest/v10/monetization.ts
Normal file
@@ -0,0 +1,85 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIEntitlement, APISKU } from '../../v10.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
|
||||
*/
|
||||
export interface RESTGetAPIEntitlementsQuery {
|
||||
/**
|
||||
* User ID to look up entitlements for
|
||||
*/
|
||||
user_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Optional list of SKU IDs to check entitlements for
|
||||
* Comma-delimited set of snowflakes
|
||||
*/
|
||||
sku_ids?: string | undefined;
|
||||
/**
|
||||
* Retrieve entitlements before this entitlement ID
|
||||
*/
|
||||
before?: Snowflake | undefined;
|
||||
/**
|
||||
* Retrieve entitlements after this entitlement ID
|
||||
*/
|
||||
after?: Snowflake | undefined;
|
||||
/**
|
||||
* Number of entitlements to return (1-100)
|
||||
*
|
||||
* @default 100
|
||||
*/
|
||||
limit?: number | undefined;
|
||||
/**
|
||||
* Guild ID to look up entitlements for
|
||||
*/
|
||||
guild_id?: Snowflake | undefined;
|
||||
/**
|
||||
* Whether ended entitlements should be omitted
|
||||
*/
|
||||
exclude_ended?: boolean | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
|
||||
*/
|
||||
export type RESTGetAPIEntitlementsResult = APIEntitlement[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
|
||||
*/
|
||||
export interface RESTPostAPIEntitlementBody {
|
||||
/**
|
||||
* ID of the SKU to grant the entitlement to
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
/**
|
||||
* ID of the guild or user to grant the entitlement to
|
||||
*/
|
||||
owner_id: Snowflake;
|
||||
/**
|
||||
* The type of entitlement owner
|
||||
*/
|
||||
owner_type: EntitlementOwnerType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
|
||||
*/
|
||||
export type RESTPostAPIEntitlementResult = Partial<Omit<APIEntitlement, 'ends_at' | 'starts_at'>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
|
||||
*/
|
||||
export enum EntitlementOwnerType {
|
||||
Guild = 1,
|
||||
User,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement
|
||||
*/
|
||||
export type RESTDeleteAPIEntitlementResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/monetization/skus#list-skus
|
||||
*/
|
||||
export type RESTGetAPISKUsResult = APISKU[];
|
||||
@@ -122,8 +122,8 @@ export interface RESTOAuth2BotAuthorizationQuery {
|
||||
*/
|
||||
scope:
|
||||
| OAuth2Scopes.Bot
|
||||
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
|
||||
| `${OAuth2Scopes.Bot}${' ' | '%20'}${string}`
|
||||
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
|
||||
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`;
|
||||
/**
|
||||
* The permissions you're requesting
|
||||
@@ -151,8 +151,8 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery {
|
||||
*/
|
||||
scope:
|
||||
| OAuth2Scopes.Bot
|
||||
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
|
||||
| `${OAuth2Scopes.Bot}${' ' | '%20'}${string}`
|
||||
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
|
||||
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`;
|
||||
/**
|
||||
* The required permissions bitfield, stringified
|
||||
@@ -196,4 +196,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult {
|
||||
}
|
||||
|
||||
export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult =
|
||||
RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;
|
||||
RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult &
|
||||
RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;
|
||||
|
||||
@@ -23,6 +23,10 @@ export interface RESTPostAPIStageInstanceJSONBody {
|
||||
* Notify @everyone that a stage instance has started
|
||||
*/
|
||||
send_start_notification?: boolean | undefined;
|
||||
/**
|
||||
* The guild scheduled event associated with this stage instance
|
||||
*/
|
||||
guild_scheduled_event_id?: Snowflake | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user