mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-21 10:50:08 +00:00
Compare commits
136 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bd8765d666 | ||
|
|
96b4bc504d | ||
|
|
35b17dcbf8 | ||
|
|
956f289e88 | ||
|
|
ef8241fe88 | ||
|
|
248484e556 | ||
|
|
1fe707c00e | ||
|
|
5bb50ae7ea | ||
|
|
0fab79feda | ||
|
|
4732f1abbe | ||
|
|
796f6d8a3b | ||
|
|
4488d8fd26 | ||
|
|
9a50367dad | ||
|
|
dc3d5df0a2 | ||
|
|
0e03e39aa2 | ||
|
|
f8a9c8b5c6 | ||
|
|
3eb239ce0c | ||
|
|
48016e5115 | ||
|
|
a08e82f097 | ||
|
|
1def1010ca | ||
|
|
af8e7c7a5b | ||
|
|
cecf17b415 | ||
|
|
cb6d4bacc4 | ||
|
|
0a2e7787c6 | ||
|
|
65b672e2af | ||
|
|
2b53b20b84 | ||
|
|
907d88ada9 | ||
|
|
8465c5866c | ||
|
|
09a114133c | ||
|
|
4577ac2609 | ||
|
|
59e247729f | ||
|
|
e78de0c83b | ||
|
|
3644b70e2e | ||
|
|
4af2ea9141 | ||
|
|
f2c3451c2a | ||
|
|
d503c71252 | ||
|
|
e253a4ac87 | ||
|
|
84226e402a | ||
|
|
2e84efb9b8 | ||
|
|
df1527c4bb | ||
|
|
2cade98ed0 | ||
|
|
d3535d6db1 | ||
|
|
2f2d4ae3fa | ||
|
|
0c65d40af0 | ||
|
|
12072b70a0 | ||
|
|
34908aa4ce | ||
|
|
b2eeb3f27b | ||
|
|
fc3aa1c911 | ||
|
|
06098869d5 | ||
|
|
a2d76fc7ca | ||
|
|
56d491fa68 | ||
|
|
3b10c60faa | ||
|
|
c6e320bd22 | ||
|
|
f49546c780 | ||
|
|
63959ef2aa | ||
|
|
f72fbc93f6 | ||
|
|
d83dadca17 | ||
|
|
0bb2204b5d | ||
|
|
292c6b58ee | ||
|
|
63ca86afbd | ||
|
|
20653b3481 | ||
|
|
7bef64df76 | ||
|
|
6477c1e5d8 | ||
|
|
e957695400 | ||
|
|
d8543177cd | ||
|
|
cb663096a5 | ||
|
|
eff8892b03 | ||
|
|
d268e0bff7 | ||
|
|
7b1e5a70e5 | ||
|
|
8e5f07e2ee | ||
|
|
1c6ea86110 | ||
|
|
43c372d817 | ||
|
|
9f386cb874 | ||
|
|
019b9de1e8 | ||
|
|
6340f64fbc | ||
|
|
895083b8ab | ||
|
|
93eb3d3af6 | ||
|
|
7da033bc5b | ||
|
|
6a813be833 | ||
|
|
b3736d8012 | ||
|
|
15fcd1b2a8 | ||
|
|
51e664d8e8 | ||
|
|
db99388267 | ||
|
|
85802f1703 | ||
|
|
4083a32340 | ||
|
|
5108d3dcca | ||
|
|
6da0503a9f | ||
|
|
8a5fb2cdf2 | ||
|
|
5ef49f41ce | ||
|
|
6d85ad6b1d | ||
|
|
ca1110a1ae | ||
|
|
748db34e30 | ||
|
|
dc1c887821 | ||
|
|
a088bb4f77 | ||
|
|
f1cc0ab163 | ||
|
|
c8ba0c9319 | ||
|
|
927c738162 | ||
|
|
1afce87fbe | ||
|
|
a0ff4f3905 | ||
|
|
17f5caa671 | ||
|
|
d3163ca22e | ||
|
|
1737adea1f | ||
|
|
8f16f452ac | ||
|
|
c9c733d1c2 | ||
|
|
d331e0dff3 | ||
|
|
a28c824f82 | ||
|
|
43cfbcba28 | ||
|
|
b0a4f12391 | ||
|
|
3fe53ced9f | ||
|
|
1212eb933e | ||
|
|
1cd9b53ea8 | ||
|
|
4cbb5fa894 | ||
|
|
6a192b132c | ||
|
|
e4280853ae | ||
|
|
bf08484988 | ||
|
|
69079ee132 | ||
|
|
bc6e97f309 | ||
|
|
279bf67aa8 | ||
|
|
d703a6645a | ||
|
|
b1bf7bf0f9 | ||
|
|
fffd9f9088 | ||
|
|
6900b74865 | ||
|
|
f0ab4e8c48 | ||
|
|
9c12718163 | ||
|
|
25677fff43 | ||
|
|
6b0f662f0e | ||
|
|
b764e8dc1a | ||
|
|
93eab113cd | ||
|
|
c23f2accf9 | ||
|
|
feba5b743b | ||
|
|
ed0049b78f | ||
|
|
16a996d77d | ||
|
|
f173b18312 | ||
|
|
c9838220ce | ||
|
|
f532002574 | ||
|
|
f75c632565 |
7
.github/auto_assign.yml
vendored
Normal file
7
.github/auto_assign.yml
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
addReviewers: true
|
||||
reviewers:
|
||||
- iCrawl
|
||||
- SpaceEEC
|
||||
- kyranet
|
||||
- vladfrangu
|
||||
numberOfReviewers: 0
|
||||
58
.github/labeler.yml
vendored
Normal file
58
.github/labeler.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
chore:
|
||||
- any: ['*']
|
||||
all:
|
||||
[
|
||||
'!deno/**/*',
|
||||
'!gateway/**/*',
|
||||
'!payloads/**/*',
|
||||
'!rest/**/*',
|
||||
'!rpc/**/*',
|
||||
'!tests/**/*',
|
||||
'!utils/**/*',
|
||||
'!voice/**/*',
|
||||
]
|
||||
|
||||
ci:
|
||||
- .github/**/*
|
||||
- .husky/**/*
|
||||
- scripts/actions/**/*
|
||||
|
||||
dependencies:
|
||||
- package.json
|
||||
- package-lock.json
|
||||
- website/package.json
|
||||
- website/package-lock.json
|
||||
|
||||
'topic:deno':
|
||||
- scripts/deno.mjs
|
||||
- scripts/actions/report-deno-not-ran.mjs
|
||||
|
||||
'topic:gateway':
|
||||
- gateway/**/*
|
||||
|
||||
'topic:payloads':
|
||||
- payloads/**/*
|
||||
|
||||
'topic:rest':
|
||||
- rest/**/*
|
||||
|
||||
'topic:rpc':
|
||||
- rpc/**/*
|
||||
|
||||
'topic:scripts':
|
||||
- scripts/**/*
|
||||
|
||||
'topic:tests':
|
||||
- tests/**/*
|
||||
|
||||
'topic:utils':
|
||||
- utils/**/*
|
||||
|
||||
'topic:voice':
|
||||
- voice/**/*
|
||||
|
||||
'topic:globals':
|
||||
- globals.ts
|
||||
|
||||
'topic:website':
|
||||
- website/**/*
|
||||
4
.github/labels.yml
vendored
4
.github/labels.yml
vendored
@@ -51,3 +51,7 @@
|
||||
color: 'aed5fc'
|
||||
- name: 'topic:voice'
|
||||
color: 'aed5fc'
|
||||
- name: 'topic:globals'
|
||||
color: 'aed5fc'
|
||||
- name: 'topic:website'
|
||||
color: 'aed5fc'
|
||||
|
||||
22
.github/problemMatchers/eslint.json
vendored
Normal file
22
.github/problemMatchers/eslint.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "eslint-stylish",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^([^\\s].*)$",
|
||||
"file": 1
|
||||
},
|
||||
{
|
||||
"regexp": "^\\s+(\\d+):(\\d+)\\s+(error|warning|info)\\s+(.*)\\s\\s+(.*)$",
|
||||
"line": 1,
|
||||
"column": 2,
|
||||
"severity": 3,
|
||||
"message": 4,
|
||||
"code": 5,
|
||||
"loop": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
17
.github/problemMatchers/tsc.json
vendored
Normal file
17
.github/problemMatchers/tsc.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "tsc",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
|
||||
"file": 1,
|
||||
"location": 2,
|
||||
"severity": 3,
|
||||
"code": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
9
.github/workflows/cicd.yml
vendored
9
.github/workflows/cicd.yml
vendored
@@ -14,15 +14,20 @@ jobs:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- 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
|
||||
with:
|
||||
node-version: 16
|
||||
cache: npm
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- name: Install Dependencies
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run ESLint
|
||||
- name: Check lint on discord-api-types
|
||||
run: npm run test:lint
|
||||
|
||||
- name: Run TSC
|
||||
|
||||
@@ -30,6 +30,9 @@ jobs:
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
- name: Install website dependencies
|
||||
run: pushd website && npm ci --ignore-scripts && popd
|
||||
|
||||
- name: Set Git User and Email
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
@@ -44,13 +47,15 @@ jobs:
|
||||
run: |
|
||||
git checkout -b "chore/release/$(jq --raw-output '.version' package.json)"
|
||||
|
||||
# Run changelog generation and deno scripts
|
||||
# Run changelog generation, deno script, website version bump
|
||||
npm run ci:pr
|
||||
|
||||
# Add all changes, commit and push
|
||||
git add --all .
|
||||
git commit -m "chore(release): $(jq --raw-output '.version' package.json) 🎉" -m "Build ran for ${GITHUB_SHA}"
|
||||
git push -u origin "chore/release/$(jq --raw-output '.version' package.json)"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Create Pull Request
|
||||
run: node ./scripts/actions/create-pr.mjs
|
||||
|
||||
18
.github/workflows/pr-automation.yml
vendored
Normal file
18
.github/workflows/pr-automation.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
name: 'PR Automation'
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Automatically label PR
|
||||
uses: actions/labeler@v3
|
||||
with:
|
||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
sync-labels: true
|
||||
|
||||
- name: Automatically assign reviewers
|
||||
if: ${{ github.event.action == 'opened' }}
|
||||
uses: kentaro-m/auto-assign-action@v1.1.2
|
||||
@@ -1 +1,13 @@
|
||||
|
||||
# Node modules
|
||||
node_modules/
|
||||
|
||||
# Generated data
|
||||
deno/
|
||||
|
||||
# Versioned json
|
||||
website/versioned_sidebars/
|
||||
website/versioned_docs/
|
||||
website/versions.json
|
||||
website/.docusaurus/
|
||||
website/build
|
||||
|
||||
8
.vscode/settings.json
vendored
8
.vscode/settings.json
vendored
@@ -1,4 +1,10 @@
|
||||
{
|
||||
"files.eol": "\n",
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.organizeImports": false,
|
||||
"source.fixAll": true,
|
||||
"source.fixAll.eslint": true
|
||||
},
|
||||
"cSpell.enableFiletypes": ["mdx"]
|
||||
}
|
||||
|
||||
232
CHANGELOG.md
232
CHANGELOG.md
@@ -1,3 +1,235 @@
|
||||
## [0.37.4](https://github.com/discordjs/discord-api-types/compare/0.37.3...0.37.4) (2022-08-22)
|
||||
|
||||
### Features
|
||||
|
||||
- add common JSON error types ([#568](https://github.com/discordjs/discord-api-types/issues/568)) ([956f289](https://github.com/discordjs/discord-api-types/commit/956f289e885763a620cb67a36e7e42683b5c08bf))
|
||||
- **ApplicationCommand:** export base chat input types ([#569](https://github.com/discordjs/discord-api-types/issues/569)) ([248484e](https://github.com/discordjs/discord-api-types/commit/248484e55613e2da3f1d659395e1f4c010cb51b5))
|
||||
|
||||
## [0.37.3](https://github.com/discordjs/discord-api-types/compare/0.37.2...0.37.3) (2022-08-18)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add 240000 ([#565](https://github.com/discordjs/discord-api-types/issues/565)) ([5bb50ae](https://github.com/discordjs/discord-api-types/commit/5bb50ae7ea6859845c9d9996f02ac42c61413df0))
|
||||
|
||||
## [0.37.2](https://github.com/discordjs/discord-api-types/compare/0.37.1...0.37.2) (2022-08-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **GatewayGuildMembersChunkDispatchData:** make chunk pagination properties mandatory ([#558](https://github.com/discordjs/discord-api-types/issues/558)) ([0e03e39](https://github.com/discordjs/discord-api-types/commit/0e03e39aa2bf8f1b9a58113a3242c4722e64922b))
|
||||
- **GatewayRequestGuildMembersData:** limit being required with user_ids ([#559](https://github.com/discordjs/discord-api-types/issues/559)) ([dc3d5df](https://github.com/discordjs/discord-api-types/commit/dc3d5df0a2931eff63991987166634661d5bd1d8))
|
||||
- **RESTGetAPIChannelUsersThreadsArchivedResult:** add `has_more` missing field ([#543](https://github.com/discordjs/discord-api-types/issues/543)) ([796f6d8](https://github.com/discordjs/discord-api-types/commit/796f6d8a3b2f55d2a120137801e0450ddf30576e))
|
||||
|
||||
### Features
|
||||
|
||||
- add search that might or might not work ([f8a9c8b](https://github.com/discordjs/discord-api-types/commit/f8a9c8b5c6bdd73bcbf9dd6fff66fafac2594ba4))
|
||||
- **APIVoiceChannel:** support text in voice, properties `last_message_id` and `rate_limit_per_user` ([#544](https://github.com/discordjs/discord-api-types/issues/544)) ([4488d8f](https://github.com/discordjs/discord-api-types/commit/4488d8fd2611a6547fc6149ba1cec5682340a119))
|
||||
- **GatewayReadyDispatchData:** add `resume_gateway_url` ([#552](https://github.com/discordjs/discord-api-types/issues/552)) ([9a50367](https://github.com/discordjs/discord-api-types/commit/9a50367dad3a06fbca6e8d1fdd98fbf144595d4e))
|
||||
|
||||
## [0.37.1](https://github.com/discordjs/discord-api-types/compare/0.37.0...0.37.1) (2022-08-04)
|
||||
|
||||
# [0.37.0](https://github.com/discordjs/discord-api-types/compare/0.36.3...0.37.0) (2022-07-28)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **RESTJSONErrorCodes:** use `MaximumThreadParticipantsReached` instead in error code 30033 ([#540](https://github.com/discordjs/discord-api-types/issues/540)) ([cecf17b](https://github.com/discordjs/discord-api-types/commit/cecf17b4158fbebb3ee508518a9e9a7b1297356f))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **RESTJSONErrorCodes:** `MaximumThreadParticipants` was renamed to `MaximumThreadParticipantsReached` for consistency with the rest of the codes
|
||||
|
||||
## [0.36.3](https://github.com/discordjs/discord-api-types/compare/0.36.2...0.36.3) (2022-07-21)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIConnection:** add `ConnectionService` to `type` ([#491](https://github.com/discordjs/discord-api-types/issues/491)) ([4577ac2](https://github.com/discordjs/discord-api-types/commit/4577ac2609f4a861505bc41f4293f482db251cdc))
|
||||
- **APIThreadChannel:** add fields about new message counter capability ([#532](https://github.com/discordjs/discord-api-types/issues/532)) ([2b53b20](https://github.com/discordjs/discord-api-types/commit/2b53b20b84b7434b9a35b715d8ebdeb040835dca))
|
||||
- **GatewayGuildCreateDispatchData:** add missing `unavailable` ([#504](https://github.com/discordjs/discord-api-types/issues/504)) ([59e2477](https://github.com/discordjs/discord-api-types/commit/59e247729fcd27be839c88516939ec22843781ce))
|
||||
- **RESTJSONErrorCodes:** add `ApplicationNotYetAvailable` ([#507](https://github.com/discordjs/discord-api-types/issues/507)) ([09a1141](https://github.com/discordjs/discord-api-types/commit/09a114133c7599cc14d4a0eb61425162091c45ee))
|
||||
- **RESTJSONErrorCodes:** add error `30034` ([#530](https://github.com/discordjs/discord-api-types/issues/530)) ([0a2e778](https://github.com/discordjs/discord-api-types/commit/0a2e7787c672ffb4af83e055df632aae36811445))
|
||||
- **RESTJSONErrorCodes:** add error `50132` ([#505](https://github.com/discordjs/discord-api-types/issues/505)) ([907d88a](https://github.com/discordjs/discord-api-types/commit/907d88ada93221802a4aefe7dc0ca3b2b73f94f0))
|
||||
- **RESTJSONErrorCodes:** add error `50146` ([#527](https://github.com/discordjs/discord-api-types/issues/527)) ([e78de0c](https://github.com/discordjs/discord-api-types/commit/e78de0c83ba93145a2302ddea2e55b5050291c52))
|
||||
- **RESTJSONErrorCodes:** add new errors ([#506](https://github.com/discordjs/discord-api-types/issues/506)) ([65b672e](https://github.com/discordjs/discord-api-types/commit/65b672e2afd2135333272d4e7b771eba237a21b6))
|
||||
|
||||
## [0.36.2](https://github.com/discordjs/discord-api-types/compare/0.36.1...0.36.2) (2022-07-14)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add error `30032` ([#521](https://github.com/discordjs/discord-api-types/issues/521)) ([f2c3451](https://github.com/discordjs/discord-api-types/commit/f2c3451c2a8bc91bcca65372d2944a07a3c34a9a))
|
||||
- **RESTPutAPIApplicationGuildCommandsJSONBody:** add missing `id` ([#522](https://github.com/discordjs/discord-api-types/issues/522)) ([4af2ea9](https://github.com/discordjs/discord-api-types/commit/4af2ea91415a5662171d342379c4bd33bfa5a6d5))
|
||||
|
||||
## [0.36.1](https://github.com/discordjs/discord-api-types/compare/0.36.0...0.36.1) (2022-07-04)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIApplicationCommandStringOption:** add `min_length` and `max_length` ([#513](https://github.com/discordjs/discord-api-types/issues/513)) ([2cade98](https://github.com/discordjs/discord-api-types/commit/2cade98ed0a0a074254fbc1580fc56d0e0b3dc9c))
|
||||
|
||||
# [0.36.0](https://github.com/discordjs/discord-api-types/compare/0.35.0...0.36.0) (2022-06-30)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIBaseInteraction:** add `app_permissions` ([#509](https://github.com/discordjs/discord-api-types/issues/509)) ([0c65d40](https://github.com/discordjs/discord-api-types/commit/0c65d40af00499233830ce272a2a274bcd5b9e8c))
|
||||
- **MessageType:** update names ([#498](https://github.com/discordjs/discord-api-types/issues/498)) ([12072b7](https://github.com/discordjs/discord-api-types/commit/12072b70a0c70e1e1f9de920789e26829268de12))
|
||||
- **RESTJSONErrorCodes:** add error 20024 ([#480](https://github.com/discordjs/discord-api-types/issues/480)) ([34908aa](https://github.com/discordjs/discord-api-types/commit/34908aa4ceeca4b58276cc207f5bdb77cef04296))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **MessageType:** The following message types have been renamed:
|
||||
|
||||
* `GuildMemberJoin` -> `UserJoin`
|
||||
* `UserPremiumGuildSubscription` -> `GuildBoost`
|
||||
* `UserPremiumGuildSubscriptionTier1` -> `GuildBoostTier1`
|
||||
* `UserPremiumGuildSubscriptionTier2` -> `GuildBoostTier2`
|
||||
* `UserPremiumGuildSubscriptionTier3` -> `GuildBoostTier3`
|
||||
|
||||
# [0.35.0](https://github.com/discordjs/discord-api-types/compare/0.34.0...0.35.0) (2022-06-23)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **GatewayIdentifyProperties:** remove `$` prefix from keys ([#493](https://github.com/discordjs/discord-api-types/issues/493)) ([3b10c60](https://github.com/discordjs/discord-api-types/commit/3b10c60faa5943501ab1f7cfa0d5f3c5317cdbbd))
|
||||
|
||||
### Features
|
||||
|
||||
- **APIEmbedVideo:** add missing `proxy_url` property ([#496](https://github.com/discordjs/discord-api-types/issues/496)) ([56d491f](https://github.com/discordjs/discord-api-types/commit/56d491fa6808d9a8762bff606ca8feb5e11f13a4))
|
||||
- **REST:** add `CDNRoutes` ([#502](https://github.com/discordjs/discord-api-types/issues/502)) ([0609886](https://github.com/discordjs/discord-api-types/commit/06098869d552139fadcc204b5ce4e1a7e5352b68))
|
||||
- **UserFlags:** add `Quarantined` flag ([#495](https://github.com/discordjs/discord-api-types/issues/495)) ([fc3aa1c](https://github.com/discordjs/discord-api-types/commit/fc3aa1c9110e4730c6b8ba3e36815ecd2da66c68))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **GatewayIdentifyProperties:** The fields for identify no longer use the `$` prefix for the values.
|
||||
|
||||
# [0.34.0](https://github.com/discordjs/discord-api-types/compare/0.33.5...0.34.0) (2022-06-13)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- separate `MESSAGE_CREATE` fields from `APIMessage` object ([#434](https://github.com/discordjs/discord-api-types/issues/434)) ([0bb2204](https://github.com/discordjs/discord-api-types/commit/0bb2204b5ddd32b791641a33d52669bc739bc208))
|
||||
|
||||
### Features
|
||||
|
||||
- add guild mfa endpoint and error `50017` ([#476](https://github.com/discordjs/discord-api-types/issues/476)) ([292c6b5](https://github.com/discordjs/discord-api-types/commit/292c6b58ee9384db2ce06addb80d2ea2bcd32de2))
|
||||
- **RESTJSONErrorCodes:** add 220003 error ([#466](https://github.com/discordjs/discord-api-types/issues/466)) ([20653b3](https://github.com/discordjs/discord-api-types/commit/20653b34819f6adf8116bef2a1e5edc3233c4117))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- Certain fields that come only through the gateway are now correctly typed as such
|
||||
|
||||
## [0.33.5](https://github.com/discordjs/discord-api-types/compare/0.33.4...0.33.5) (2022-06-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **GatewayGuildCreateDispatch:** add missing `GatewayGuildCreateDispatch` ([#477](https://github.com/discordjs/discord-api-types/issues/477)) ([d268e0b](https://github.com/discordjs/discord-api-types/commit/d268e0bff7429e1cde43174fdf6d2342569860d5))
|
||||
- **RESTPostAPIWebhookWithTokenJSONBody:** `thread_name` should be optional ([#479](https://github.com/discordjs/discord-api-types/issues/479)) ([eff8892](https://github.com/discordjs/discord-api-types/commit/eff8892b03656cfc2b709c6c30edb98e38bf2a1e))
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add error `30052` ([#469](https://github.com/discordjs/discord-api-types/issues/469)) ([d854317](https://github.com/discordjs/discord-api-types/commit/d8543177cd978a19daa32fbb183892b6f8c24772))
|
||||
|
||||
## [0.33.4](https://github.com/discordjs/discord-api-types/compare/0.33.3...0.33.4) (2022-06-06)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTPostAPIWebhookWithTokenJSONBody:** add `thread_name` ([#463](https://github.com/discordjs/discord-api-types/issues/463)) ([8e5f07e](https://github.com/discordjs/discord-api-types/commit/8e5f07e2eebc14e5777dbfb932ef54f252165524))
|
||||
|
||||
## [0.33.3](https://github.com/discordjs/discord-api-types/compare/0.33.2...0.33.3) (2022-06-04)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **AddUndefinedToPossiblyUndefinedProperties:** recurse down objects ([#471](https://github.com/discordjs/discord-api-types/issues/471)) ([43c372d](https://github.com/discordjs/discord-api-types/commit/43c372d81722e48b105d5121a2cfdf614f1e7704))
|
||||
|
||||
## [0.33.2](https://github.com/discordjs/discord-api-types/compare/0.33.1...0.33.2) (2022-06-01)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **docs-site:** website link colors ([#457](https://github.com/discordjs/discord-api-types/issues/457)) ([51e664d](https://github.com/discordjs/discord-api-types/commit/51e664d8e826e7f0aa467c000f3a1707fc283a36))
|
||||
- **GatewayGuildCreateDispatch:** add extra fields that were missing ([#458](https://github.com/discordjs/discord-api-types/issues/458)) ([15fcd1b](https://github.com/discordjs/discord-api-types/commit/15fcd1b2a85e8d1e136416a66326a4aadcc301fb))
|
||||
- **RestPostAPIBaseApplicationJSONBody:** make `default_member_permissions` optional ([#460](https://github.com/discordjs/discord-api-types/issues/460)) ([6a813be](https://github.com/discordjs/discord-api-types/commit/6a813be83382e1606f1921cf00179fe1ce75c04f))
|
||||
|
||||
## [0.33.1](https://github.com/discordjs/discord-api-types/compare/0.33.0...0.33.1) (2022-05-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **RESTPostAPIApplicationGuildCommands:** correct types due to unions ([#447](https://github.com/discordjs/discord-api-types/issues/447)) ([6d85ad6](https://github.com/discordjs/discord-api-types/commit/6d85ad6b1d707b980f9897ea68dd4b7573b3a770))
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add error `50600` ([#444](https://github.com/discordjs/discord-api-types/issues/444)) ([5ef49f4](https://github.com/discordjs/discord-api-types/commit/5ef49f41cecaa1d5937428a5c58f1d88bfc61266))
|
||||
- **RESTPostAPIGuildChannels:** update post body fields ([#419](https://github.com/discordjs/discord-api-types/issues/419)) ([748db34](https://github.com/discordjs/discord-api-types/commit/748db34e30338cf4a9fd8ce7b86d1d5c7dde63b1))
|
||||
|
||||
# [0.33.0](https://github.com/discordjs/discord-api-types/compare/0.32.1...0.33.0) (2022-05-16)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **GuildFeature:** thread archive durations are no longer boost locked ([#412](https://github.com/discordjs/discord-api-types/issues/412)) ([1737ade](https://github.com/discordjs/discord-api-types/commit/1737adea1fc3d5050db30266e49c63277b7a77fc))
|
||||
- separate `GUILD_CREATE` fields from `APIGuild` object ([#423](https://github.com/discordjs/discord-api-types/issues/423)) ([17f5caa](https://github.com/discordjs/discord-api-types/commit/17f5caa671da50a79d61393f5a970ce59c5d875e))
|
||||
|
||||
### Features
|
||||
|
||||
- add support for application command permissions v2 ([#415](https://github.com/discordjs/discord-api-types/issues/415)) ([d3163ca](https://github.com/discordjs/discord-api-types/commit/d3163ca22e5b7d8292f9f6ccd444aa5c93771d92))
|
||||
- **OAuth2Scopes:** add new OAuth2 scopes ([#435](https://github.com/discordjs/discord-api-types/issues/435)) ([8f16f45](https://github.com/discordjs/discord-api-types/commit/8f16f452ac7dc8988617d1211fc6a9547d254795))
|
||||
- **rest:** add missing guild routes results ([#438](https://github.com/discordjs/discord-api-types/issues/438)) ([1afce87](https://github.com/discordjs/discord-api-types/commit/1afce87fbef8e43ee040010e36019a4ebc6fecfe))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- APIGuild now correctly shows just the properties that are obtainable through rest/GUILD_UPDATE, while the extra fields have been moved to GatewayGuildCreateDispatchData to correctly represent the data received
|
||||
- **GuildFeature:** `SevenDayThreadArchive` and `ThreeDayThreadArchive` have been removed as they are no longer valid
|
||||
|
||||
## [0.32.1](https://github.com/discordjs/discord-api-types/compare/0.32.0...0.32.1) (2022-05-05)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add error `50080` ([#408](https://github.com/discordjs/discord-api-types/issues/408)) ([43cfbcb](https://github.com/discordjs/discord-api-types/commit/43cfbcba284a96de6bde101b866ad9ac306992b5))
|
||||
- **RESTPostAPIGuildForumThreads:** add `message` field ([#416](https://github.com/discordjs/discord-api-types/issues/416)) ([a28c824](https://github.com/discordjs/discord-api-types/commit/a28c824f82014b15a715b51b4426356428bb4ba2))
|
||||
|
||||
# [0.32.0](https://github.com/discordjs/discord-api-types/compare/0.31.2...0.32.0) (2022-04-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- add `position` property to create channel options ([#409](https://github.com/discordjs/discord-api-types/issues/409)) ([3fe53ce](https://github.com/discordjs/discord-api-types/commit/3fe53ced9f0e61473a8b92d0503c51084e6a58f3))
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **APIGuildIntegration:** make `enabled` optional ([#406](https://github.com/discordjs/discord-api-types/issues/406)) ([1212eb9](https://github.com/discordjs/discord-api-types/commit/1212eb933e6bf1d82b1b41164030bd317e9c59eb))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **APIGuildIntegration:** `enabled` is now properly marked as optional
|
||||
|
||||
## [0.31.2](https://github.com/discordjs/discord-api-types/compare/0.31.1...0.31.2) (2022-04-18)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTPostAPIGuildChannelJSONBody:** add `default_auto_archive` prop ([#400](https://github.com/discordjs/discord-api-types/issues/400)) ([6a192b1](https://github.com/discordjs/discord-api-types/commit/6a192b132c11f13d95ea3e7ed1eb556600f2f415))
|
||||
|
||||
## [0.31.1](https://github.com/discordjs/discord-api-types/compare/0.31.0...0.31.1) (2022-04-11)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIApplicationCommandInteractionData:** add `guild_id` ([#396](https://github.com/discordjs/discord-api-types/issues/396)) ([bc6e97f](https://github.com/discordjs/discord-api-types/commit/bc6e97f309b1f5e0bc0063ada3aed77f34214e9f))
|
||||
- **APIGuildForum:** add support for forums, part 1 ([#398](https://github.com/discordjs/discord-api-types/issues/398)) ([bf08484](https://github.com/discordjs/discord-api-types/commit/bf084849885dd15b19f4f46aa260815037131600))
|
||||
- student hubs ([#215](https://github.com/discordjs/discord-api-types/issues/215)) ([69079ee](https://github.com/discordjs/discord-api-types/commit/69079ee132777977e9a9e163696ffdc8db82fe38))
|
||||
|
||||
# [0.31.0](https://github.com/discordjs/discord-api-types/compare/0.30.0...0.31.0) (2022-04-04)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **APIGroupDMChannel:** make `name` nullable ([#347](https://github.com/discordjs/discord-api-types/issues/347)) ([ed0049b](https://github.com/discordjs/discord-api-types/commit/ed0049b78f4008460b0c7a2ec68eb38f018be3bd))
|
||||
- remove `summary` from applications ([#386](https://github.com/discordjs/discord-api-types/issues/386)) ([f0ab4e8](https://github.com/discordjs/discord-api-types/commit/f0ab4e8c48895f8daee7fa296b8319a98fb7d4e1))
|
||||
- remove store channels ([#364](https://github.com/discordjs/discord-api-types/issues/364)) ([25677ff](https://github.com/discordjs/discord-api-types/commit/25677fff43533b3b11b88f01efe98f0875014cb5))
|
||||
|
||||
### Features
|
||||
|
||||
- add `RESTGetAPIGuildBansQuery` ([#391](https://github.com/discordjs/discord-api-types/issues/391)) ([b1bf7bf](https://github.com/discordjs/discord-api-types/commit/b1bf7bf0f9a37fa391a67e4b5b1dd288821d0ebb))
|
||||
- **APIApplication:** app authorization links and tags ([#239](https://github.com/discordjs/discord-api-types/issues/239)) ([93eab11](https://github.com/discordjs/discord-api-types/commit/93eab113cdcfd3bdd868f1d86bb4bc2a5247d844))
|
||||
- **APIApplicationCommand:** add missing localization props ([#383](https://github.com/discordjs/discord-api-types/issues/383)) ([9c12718](https://github.com/discordjs/discord-api-types/commit/9c1271816312382be3471cb2fdbb6260e973b4f6))
|
||||
- **APIAuditLogChange:** add `APIAuditLogChangeKeyImageHash` ([#379](https://github.com/discordjs/discord-api-types/issues/379)) ([f532002](https://github.com/discordjs/discord-api-types/commit/f532002574b655d87151c325be6c02fe6f65bbe0))
|
||||
- **GuildFeatures:** add animated banners ([#219](https://github.com/discordjs/discord-api-types/issues/219)) ([c23f2ac](https://github.com/discordjs/discord-api-types/commit/c23f2accf998ffa0c068d222fd9f34228a86a699))
|
||||
- **RESTPostAPIStageInstanceJSONBody:** add `send_start_notification` ([#378](https://github.com/discordjs/discord-api-types/issues/378)) ([b764e8d](https://github.com/discordjs/discord-api-types/commit/b764e8dc1a92e254161f3a443e17148a81240b66))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- The deprecated `summary` field has been removed
|
||||
- Store channels have been removed, alongside their types
|
||||
- **APIGroupDMChannel:** The `name` field is now also nullable for Group DM Channels
|
||||
|
||||
# [0.30.0](https://github.com/discordjs/discord-api-types/compare/0.29.0...0.30.0) (2022-03-24)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
12
README.md
12
README.md
@@ -1,11 +1,14 @@
|
||||
# Discord API Types
|
||||
|
||||
[](https://github.com/discordjs/discord-api-types)
|
||||
|
||||
[](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
|
||||
[](https://www.npmjs.com/package/discord-api-types)
|
||||
[](https://deno.land/x/discord_api_types)
|
||||
[](https://www.patreon.com/vladfrangu)
|
||||
[](https://ko-fi.com/wolfgalvlad)
|
||||
[](https://github.com/sponsors/vladfrangu)
|
||||
[](https://vercel.com?utm_source=discordjs&utm_campaign=oss)
|
||||
|
||||
Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro).
|
||||
|
||||
@@ -43,7 +46,7 @@ const { GatewayVersion } = require('discord-api-types/gateway/v10');
|
||||
import { GatewayVersion } from 'discord-api-types/gateway/v10';
|
||||
```
|
||||
|
||||
> _**Note:** The `v*` exports (`discord-api-type/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
|
||||
> _**Note:** The `v*` exports (`discord-api-types/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
|
||||
|
||||
### Deno
|
||||
|
||||
@@ -94,4 +97,9 @@ The exports of each API version is split into three main parts:
|
||||
|
||||
- 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.
|
||||
|
||||
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means _and have received the green light to be used_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will **NOT** be included.
|
||||
**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_.
|
||||
Anything else will not be documented (for example client only types).
|
||||
|
||||
With that aside, we may allow certain types that are not documented in the [API Documentation repository](https://github.com/discord/discord-api-docs) on a case by case basis.
|
||||
They will be documented with an `@unstable` tag and are not subject with the same versioning rules.
|
||||
|
||||
@@ -1,3 +1,235 @@
|
||||
## [0.37.4](https://github.com/discordjs/discord-api-types/compare/0.37.3...0.37.4) (2022-08-22)
|
||||
|
||||
### Features
|
||||
|
||||
- add common JSON error types ([#568](https://github.com/discordjs/discord-api-types/issues/568)) ([956f289](https://github.com/discordjs/discord-api-types/commit/956f289e885763a620cb67a36e7e42683b5c08bf))
|
||||
- **ApplicationCommand:** export base chat input types ([#569](https://github.com/discordjs/discord-api-types/issues/569)) ([248484e](https://github.com/discordjs/discord-api-types/commit/248484e55613e2da3f1d659395e1f4c010cb51b5))
|
||||
|
||||
## [0.37.3](https://github.com/discordjs/discord-api-types/compare/0.37.2...0.37.3) (2022-08-18)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add 240000 ([#565](https://github.com/discordjs/discord-api-types/issues/565)) ([5bb50ae](https://github.com/discordjs/discord-api-types/commit/5bb50ae7ea6859845c9d9996f02ac42c61413df0))
|
||||
|
||||
## [0.37.2](https://github.com/discordjs/discord-api-types/compare/0.37.1...0.37.2) (2022-08-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **GatewayGuildMembersChunkDispatchData:** make chunk pagination properties mandatory ([#558](https://github.com/discordjs/discord-api-types/issues/558)) ([0e03e39](https://github.com/discordjs/discord-api-types/commit/0e03e39aa2bf8f1b9a58113a3242c4722e64922b))
|
||||
- **GatewayRequestGuildMembersData:** limit being required with user_ids ([#559](https://github.com/discordjs/discord-api-types/issues/559)) ([dc3d5df](https://github.com/discordjs/discord-api-types/commit/dc3d5df0a2931eff63991987166634661d5bd1d8))
|
||||
- **RESTGetAPIChannelUsersThreadsArchivedResult:** add `has_more` missing field ([#543](https://github.com/discordjs/discord-api-types/issues/543)) ([796f6d8](https://github.com/discordjs/discord-api-types/commit/796f6d8a3b2f55d2a120137801e0450ddf30576e))
|
||||
|
||||
### Features
|
||||
|
||||
- add search that might or might not work ([f8a9c8b](https://github.com/discordjs/discord-api-types/commit/f8a9c8b5c6bdd73bcbf9dd6fff66fafac2594ba4))
|
||||
- **APIVoiceChannel:** support text in voice, properties `last_message_id` and `rate_limit_per_user` ([#544](https://github.com/discordjs/discord-api-types/issues/544)) ([4488d8f](https://github.com/discordjs/discord-api-types/commit/4488d8fd2611a6547fc6149ba1cec5682340a119))
|
||||
- **GatewayReadyDispatchData:** add `resume_gateway_url` ([#552](https://github.com/discordjs/discord-api-types/issues/552)) ([9a50367](https://github.com/discordjs/discord-api-types/commit/9a50367dad3a06fbca6e8d1fdd98fbf144595d4e))
|
||||
|
||||
## [0.37.1](https://github.com/discordjs/discord-api-types/compare/0.37.0...0.37.1) (2022-08-04)
|
||||
|
||||
# [0.37.0](https://github.com/discordjs/discord-api-types/compare/0.36.3...0.37.0) (2022-07-28)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **RESTJSONErrorCodes:** use `MaximumThreadParticipantsReached` instead in error code 30033 ([#540](https://github.com/discordjs/discord-api-types/issues/540)) ([cecf17b](https://github.com/discordjs/discord-api-types/commit/cecf17b4158fbebb3ee508518a9e9a7b1297356f))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **RESTJSONErrorCodes:** `MaximumThreadParticipants` was renamed to `MaximumThreadParticipantsReached` for consistency with the rest of the codes
|
||||
|
||||
## [0.36.3](https://github.com/discordjs/discord-api-types/compare/0.36.2...0.36.3) (2022-07-21)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIConnection:** add `ConnectionService` to `type` ([#491](https://github.com/discordjs/discord-api-types/issues/491)) ([4577ac2](https://github.com/discordjs/discord-api-types/commit/4577ac2609f4a861505bc41f4293f482db251cdc))
|
||||
- **APIThreadChannel:** add fields about new message counter capability ([#532](https://github.com/discordjs/discord-api-types/issues/532)) ([2b53b20](https://github.com/discordjs/discord-api-types/commit/2b53b20b84b7434b9a35b715d8ebdeb040835dca))
|
||||
- **GatewayGuildCreateDispatchData:** add missing `unavailable` ([#504](https://github.com/discordjs/discord-api-types/issues/504)) ([59e2477](https://github.com/discordjs/discord-api-types/commit/59e247729fcd27be839c88516939ec22843781ce))
|
||||
- **RESTJSONErrorCodes:** add `ApplicationNotYetAvailable` ([#507](https://github.com/discordjs/discord-api-types/issues/507)) ([09a1141](https://github.com/discordjs/discord-api-types/commit/09a114133c7599cc14d4a0eb61425162091c45ee))
|
||||
- **RESTJSONErrorCodes:** add error `30034` ([#530](https://github.com/discordjs/discord-api-types/issues/530)) ([0a2e778](https://github.com/discordjs/discord-api-types/commit/0a2e7787c672ffb4af83e055df632aae36811445))
|
||||
- **RESTJSONErrorCodes:** add error `50132` ([#505](https://github.com/discordjs/discord-api-types/issues/505)) ([907d88a](https://github.com/discordjs/discord-api-types/commit/907d88ada93221802a4aefe7dc0ca3b2b73f94f0))
|
||||
- **RESTJSONErrorCodes:** add error `50146` ([#527](https://github.com/discordjs/discord-api-types/issues/527)) ([e78de0c](https://github.com/discordjs/discord-api-types/commit/e78de0c83ba93145a2302ddea2e55b5050291c52))
|
||||
- **RESTJSONErrorCodes:** add new errors ([#506](https://github.com/discordjs/discord-api-types/issues/506)) ([65b672e](https://github.com/discordjs/discord-api-types/commit/65b672e2afd2135333272d4e7b771eba237a21b6))
|
||||
|
||||
## [0.36.2](https://github.com/discordjs/discord-api-types/compare/0.36.1...0.36.2) (2022-07-14)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add error `30032` ([#521](https://github.com/discordjs/discord-api-types/issues/521)) ([f2c3451](https://github.com/discordjs/discord-api-types/commit/f2c3451c2a8bc91bcca65372d2944a07a3c34a9a))
|
||||
- **RESTPutAPIApplicationGuildCommandsJSONBody:** add missing `id` ([#522](https://github.com/discordjs/discord-api-types/issues/522)) ([4af2ea9](https://github.com/discordjs/discord-api-types/commit/4af2ea91415a5662171d342379c4bd33bfa5a6d5))
|
||||
|
||||
## [0.36.1](https://github.com/discordjs/discord-api-types/compare/0.36.0...0.36.1) (2022-07-04)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIApplicationCommandStringOption:** add `min_length` and `max_length` ([#513](https://github.com/discordjs/discord-api-types/issues/513)) ([2cade98](https://github.com/discordjs/discord-api-types/commit/2cade98ed0a0a074254fbc1580fc56d0e0b3dc9c))
|
||||
|
||||
# [0.36.0](https://github.com/discordjs/discord-api-types/compare/0.35.0...0.36.0) (2022-06-30)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIBaseInteraction:** add `app_permissions` ([#509](https://github.com/discordjs/discord-api-types/issues/509)) ([0c65d40](https://github.com/discordjs/discord-api-types/commit/0c65d40af00499233830ce272a2a274bcd5b9e8c))
|
||||
- **MessageType:** update names ([#498](https://github.com/discordjs/discord-api-types/issues/498)) ([12072b7](https://github.com/discordjs/discord-api-types/commit/12072b70a0c70e1e1f9de920789e26829268de12))
|
||||
- **RESTJSONErrorCodes:** add error 20024 ([#480](https://github.com/discordjs/discord-api-types/issues/480)) ([34908aa](https://github.com/discordjs/discord-api-types/commit/34908aa4ceeca4b58276cc207f5bdb77cef04296))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **MessageType:** The following message types have been renamed:
|
||||
|
||||
* `GuildMemberJoin` -> `UserJoin`
|
||||
* `UserPremiumGuildSubscription` -> `GuildBoost`
|
||||
* `UserPremiumGuildSubscriptionTier1` -> `GuildBoostTier1`
|
||||
* `UserPremiumGuildSubscriptionTier2` -> `GuildBoostTier2`
|
||||
* `UserPremiumGuildSubscriptionTier3` -> `GuildBoostTier3`
|
||||
|
||||
# [0.35.0](https://github.com/discordjs/discord-api-types/compare/0.34.0...0.35.0) (2022-06-23)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **GatewayIdentifyProperties:** remove `$` prefix from keys ([#493](https://github.com/discordjs/discord-api-types/issues/493)) ([3b10c60](https://github.com/discordjs/discord-api-types/commit/3b10c60faa5943501ab1f7cfa0d5f3c5317cdbbd))
|
||||
|
||||
### Features
|
||||
|
||||
- **APIEmbedVideo:** add missing `proxy_url` property ([#496](https://github.com/discordjs/discord-api-types/issues/496)) ([56d491f](https://github.com/discordjs/discord-api-types/commit/56d491fa6808d9a8762bff606ca8feb5e11f13a4))
|
||||
- **REST:** add `CDNRoutes` ([#502](https://github.com/discordjs/discord-api-types/issues/502)) ([0609886](https://github.com/discordjs/discord-api-types/commit/06098869d552139fadcc204b5ce4e1a7e5352b68))
|
||||
- **UserFlags:** add `Quarantined` flag ([#495](https://github.com/discordjs/discord-api-types/issues/495)) ([fc3aa1c](https://github.com/discordjs/discord-api-types/commit/fc3aa1c9110e4730c6b8ba3e36815ecd2da66c68))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **GatewayIdentifyProperties:** The fields for identify no longer use the `$` prefix for the values.
|
||||
|
||||
# [0.34.0](https://github.com/discordjs/discord-api-types/compare/0.33.5...0.34.0) (2022-06-13)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- separate `MESSAGE_CREATE` fields from `APIMessage` object ([#434](https://github.com/discordjs/discord-api-types/issues/434)) ([0bb2204](https://github.com/discordjs/discord-api-types/commit/0bb2204b5ddd32b791641a33d52669bc739bc208))
|
||||
|
||||
### Features
|
||||
|
||||
- add guild mfa endpoint and error `50017` ([#476](https://github.com/discordjs/discord-api-types/issues/476)) ([292c6b5](https://github.com/discordjs/discord-api-types/commit/292c6b58ee9384db2ce06addb80d2ea2bcd32de2))
|
||||
- **RESTJSONErrorCodes:** add 220003 error ([#466](https://github.com/discordjs/discord-api-types/issues/466)) ([20653b3](https://github.com/discordjs/discord-api-types/commit/20653b34819f6adf8116bef2a1e5edc3233c4117))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- Certain fields that come only through the gateway are now correctly typed as such
|
||||
|
||||
## [0.33.5](https://github.com/discordjs/discord-api-types/compare/0.33.4...0.33.5) (2022-06-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **GatewayGuildCreateDispatch:** add missing `GatewayGuildCreateDispatch` ([#477](https://github.com/discordjs/discord-api-types/issues/477)) ([d268e0b](https://github.com/discordjs/discord-api-types/commit/d268e0bff7429e1cde43174fdf6d2342569860d5))
|
||||
- **RESTPostAPIWebhookWithTokenJSONBody:** `thread_name` should be optional ([#479](https://github.com/discordjs/discord-api-types/issues/479)) ([eff8892](https://github.com/discordjs/discord-api-types/commit/eff8892b03656cfc2b709c6c30edb98e38bf2a1e))
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add error `30052` ([#469](https://github.com/discordjs/discord-api-types/issues/469)) ([d854317](https://github.com/discordjs/discord-api-types/commit/d8543177cd978a19daa32fbb183892b6f8c24772))
|
||||
|
||||
## [0.33.4](https://github.com/discordjs/discord-api-types/compare/0.33.3...0.33.4) (2022-06-06)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTPostAPIWebhookWithTokenJSONBody:** add `thread_name` ([#463](https://github.com/discordjs/discord-api-types/issues/463)) ([8e5f07e](https://github.com/discordjs/discord-api-types/commit/8e5f07e2eebc14e5777dbfb932ef54f252165524))
|
||||
|
||||
## [0.33.3](https://github.com/discordjs/discord-api-types/compare/0.33.2...0.33.3) (2022-06-04)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **AddUndefinedToPossiblyUndefinedProperties:** recurse down objects ([#471](https://github.com/discordjs/discord-api-types/issues/471)) ([43c372d](https://github.com/discordjs/discord-api-types/commit/43c372d81722e48b105d5121a2cfdf614f1e7704))
|
||||
|
||||
## [0.33.2](https://github.com/discordjs/discord-api-types/compare/0.33.1...0.33.2) (2022-06-01)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **docs-site:** website link colors ([#457](https://github.com/discordjs/discord-api-types/issues/457)) ([51e664d](https://github.com/discordjs/discord-api-types/commit/51e664d8e826e7f0aa467c000f3a1707fc283a36))
|
||||
- **GatewayGuildCreateDispatch:** add extra fields that were missing ([#458](https://github.com/discordjs/discord-api-types/issues/458)) ([15fcd1b](https://github.com/discordjs/discord-api-types/commit/15fcd1b2a85e8d1e136416a66326a4aadcc301fb))
|
||||
- **RestPostAPIBaseApplicationJSONBody:** make `default_member_permissions` optional ([#460](https://github.com/discordjs/discord-api-types/issues/460)) ([6a813be](https://github.com/discordjs/discord-api-types/commit/6a813be83382e1606f1921cf00179fe1ce75c04f))
|
||||
|
||||
## [0.33.1](https://github.com/discordjs/discord-api-types/compare/0.33.0...0.33.1) (2022-05-26)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **RESTPostAPIApplicationGuildCommands:** correct types due to unions ([#447](https://github.com/discordjs/discord-api-types/issues/447)) ([6d85ad6](https://github.com/discordjs/discord-api-types/commit/6d85ad6b1d707b980f9897ea68dd4b7573b3a770))
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add error `50600` ([#444](https://github.com/discordjs/discord-api-types/issues/444)) ([5ef49f4](https://github.com/discordjs/discord-api-types/commit/5ef49f41cecaa1d5937428a5c58f1d88bfc61266))
|
||||
- **RESTPostAPIGuildChannels:** update post body fields ([#419](https://github.com/discordjs/discord-api-types/issues/419)) ([748db34](https://github.com/discordjs/discord-api-types/commit/748db34e30338cf4a9fd8ce7b86d1d5c7dde63b1))
|
||||
|
||||
# [0.33.0](https://github.com/discordjs/discord-api-types/compare/0.32.1...0.33.0) (2022-05-16)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **GuildFeature:** thread archive durations are no longer boost locked ([#412](https://github.com/discordjs/discord-api-types/issues/412)) ([1737ade](https://github.com/discordjs/discord-api-types/commit/1737adea1fc3d5050db30266e49c63277b7a77fc))
|
||||
- separate `GUILD_CREATE` fields from `APIGuild` object ([#423](https://github.com/discordjs/discord-api-types/issues/423)) ([17f5caa](https://github.com/discordjs/discord-api-types/commit/17f5caa671da50a79d61393f5a970ce59c5d875e))
|
||||
|
||||
### Features
|
||||
|
||||
- add support for application command permissions v2 ([#415](https://github.com/discordjs/discord-api-types/issues/415)) ([d3163ca](https://github.com/discordjs/discord-api-types/commit/d3163ca22e5b7d8292f9f6ccd444aa5c93771d92))
|
||||
- **OAuth2Scopes:** add new OAuth2 scopes ([#435](https://github.com/discordjs/discord-api-types/issues/435)) ([8f16f45](https://github.com/discordjs/discord-api-types/commit/8f16f452ac7dc8988617d1211fc6a9547d254795))
|
||||
- **rest:** add missing guild routes results ([#438](https://github.com/discordjs/discord-api-types/issues/438)) ([1afce87](https://github.com/discordjs/discord-api-types/commit/1afce87fbef8e43ee040010e36019a4ebc6fecfe))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- APIGuild now correctly shows just the properties that are obtainable through rest/GUILD_UPDATE, while the extra fields have been moved to GatewayGuildCreateDispatchData to correctly represent the data received
|
||||
- **GuildFeature:** `SevenDayThreadArchive` and `ThreeDayThreadArchive` have been removed as they are no longer valid
|
||||
|
||||
## [0.32.1](https://github.com/discordjs/discord-api-types/compare/0.32.0...0.32.1) (2022-05-05)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add error `50080` ([#408](https://github.com/discordjs/discord-api-types/issues/408)) ([43cfbcb](https://github.com/discordjs/discord-api-types/commit/43cfbcba284a96de6bde101b866ad9ac306992b5))
|
||||
- **RESTPostAPIGuildForumThreads:** add `message` field ([#416](https://github.com/discordjs/discord-api-types/issues/416)) ([a28c824](https://github.com/discordjs/discord-api-types/commit/a28c824f82014b15a715b51b4426356428bb4ba2))
|
||||
|
||||
# [0.32.0](https://github.com/discordjs/discord-api-types/compare/0.31.2...0.32.0) (2022-04-25)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- add `position` property to create channel options ([#409](https://github.com/discordjs/discord-api-types/issues/409)) ([3fe53ce](https://github.com/discordjs/discord-api-types/commit/3fe53ced9f0e61473a8b92d0503c51084e6a58f3))
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **APIGuildIntegration:** make `enabled` optional ([#406](https://github.com/discordjs/discord-api-types/issues/406)) ([1212eb9](https://github.com/discordjs/discord-api-types/commit/1212eb933e6bf1d82b1b41164030bd317e9c59eb))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **APIGuildIntegration:** `enabled` is now properly marked as optional
|
||||
|
||||
## [0.31.2](https://github.com/discordjs/discord-api-types/compare/0.31.1...0.31.2) (2022-04-18)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTPostAPIGuildChannelJSONBody:** add `default_auto_archive` prop ([#400](https://github.com/discordjs/discord-api-types/issues/400)) ([6a192b1](https://github.com/discordjs/discord-api-types/commit/6a192b132c11f13d95ea3e7ed1eb556600f2f415))
|
||||
|
||||
## [0.31.1](https://github.com/discordjs/discord-api-types/compare/0.31.0...0.31.1) (2022-04-11)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIApplicationCommandInteractionData:** add `guild_id` ([#396](https://github.com/discordjs/discord-api-types/issues/396)) ([bc6e97f](https://github.com/discordjs/discord-api-types/commit/bc6e97f309b1f5e0bc0063ada3aed77f34214e9f))
|
||||
- **APIGuildForum:** add support for forums, part 1 ([#398](https://github.com/discordjs/discord-api-types/issues/398)) ([bf08484](https://github.com/discordjs/discord-api-types/commit/bf084849885dd15b19f4f46aa260815037131600))
|
||||
- student hubs ([#215](https://github.com/discordjs/discord-api-types/issues/215)) ([69079ee](https://github.com/discordjs/discord-api-types/commit/69079ee132777977e9a9e163696ffdc8db82fe38))
|
||||
|
||||
# [0.31.0](https://github.com/discordjs/discord-api-types/compare/0.30.0...0.31.0) (2022-04-04)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **APIGroupDMChannel:** make `name` nullable ([#347](https://github.com/discordjs/discord-api-types/issues/347)) ([ed0049b](https://github.com/discordjs/discord-api-types/commit/ed0049b78f4008460b0c7a2ec68eb38f018be3bd))
|
||||
- remove `summary` from applications ([#386](https://github.com/discordjs/discord-api-types/issues/386)) ([f0ab4e8](https://github.com/discordjs/discord-api-types/commit/f0ab4e8c48895f8daee7fa296b8319a98fb7d4e1))
|
||||
- remove store channels ([#364](https://github.com/discordjs/discord-api-types/issues/364)) ([25677ff](https://github.com/discordjs/discord-api-types/commit/25677fff43533b3b11b88f01efe98f0875014cb5))
|
||||
|
||||
### Features
|
||||
|
||||
- add `RESTGetAPIGuildBansQuery` ([#391](https://github.com/discordjs/discord-api-types/issues/391)) ([b1bf7bf](https://github.com/discordjs/discord-api-types/commit/b1bf7bf0f9a37fa391a67e4b5b1dd288821d0ebb))
|
||||
- **APIApplication:** app authorization links and tags ([#239](https://github.com/discordjs/discord-api-types/issues/239)) ([93eab11](https://github.com/discordjs/discord-api-types/commit/93eab113cdcfd3bdd868f1d86bb4bc2a5247d844))
|
||||
- **APIApplicationCommand:** add missing localization props ([#383](https://github.com/discordjs/discord-api-types/issues/383)) ([9c12718](https://github.com/discordjs/discord-api-types/commit/9c1271816312382be3471cb2fdbb6260e973b4f6))
|
||||
- **APIAuditLogChange:** add `APIAuditLogChangeKeyImageHash` ([#379](https://github.com/discordjs/discord-api-types/issues/379)) ([f532002](https://github.com/discordjs/discord-api-types/commit/f532002574b655d87151c325be6c02fe6f65bbe0))
|
||||
- **GuildFeatures:** add animated banners ([#219](https://github.com/discordjs/discord-api-types/issues/219)) ([c23f2ac](https://github.com/discordjs/discord-api-types/commit/c23f2accf998ffa0c068d222fd9f34228a86a699))
|
||||
- **RESTPostAPIStageInstanceJSONBody:** add `send_start_notification` ([#378](https://github.com/discordjs/discord-api-types/issues/378)) ([b764e8d](https://github.com/discordjs/discord-api-types/commit/b764e8dc1a92e254161f3a443e17148a81240b66))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- The deprecated `summary` field has been removed
|
||||
- Store channels have been removed, alongside their types
|
||||
- **APIGroupDMChannel:** The `name` field is now also nullable for Group DM Channels
|
||||
|
||||
# [0.30.0](https://github.com/discordjs/discord-api-types/compare/0.29.0...0.30.0) (2022-03-24)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
# Discord API Types
|
||||
|
||||
[](https://github.com/discordjs/discord-api-types)
|
||||
|
||||
[](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
|
||||
[](https://www.npmjs.com/package/discord-api-types)
|
||||
[](https://deno.land/x/discord_api_types)
|
||||
[](https://www.patreon.com/vladfrangu)
|
||||
[](https://ko-fi.com/wolfgalvlad)
|
||||
[](https://github.com/sponsors/vladfrangu)
|
||||
[](https://vercel.com?utm_source=discordjs&utm_campaign=oss)
|
||||
|
||||
Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro).
|
||||
|
||||
@@ -43,7 +46,7 @@ const { GatewayVersion } = require('discord-api-types/gateway/v10');
|
||||
import { GatewayVersion } from 'discord-api-types/gateway/v10';
|
||||
```
|
||||
|
||||
> _**Note:** The `v*` exports (`discord-api-type/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
|
||||
> _**Note:** The `v*` exports (`discord-api-types/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
|
||||
|
||||
### Deno
|
||||
|
||||
@@ -94,4 +97,9 @@ The exports of each API version is split into three main parts:
|
||||
|
||||
- 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.
|
||||
|
||||
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means _and have received the green light to be used_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will **NOT** be included.
|
||||
**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_.
|
||||
Anything else will not be documented (for example client only types).
|
||||
|
||||
With that aside, we may allow certain types that are not documented in the [API Documentation repository](https://github.com/discord/discord-api-docs) on a case by case basis.
|
||||
They will be documented with an `@unstable` tag and are not subject with the same versioning rules.
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../globals.ts';
|
||||
import type { GatewayPresenceUpdate } from '../payloads/v10/gateway.ts';
|
||||
import type {
|
||||
APIApplication,
|
||||
APIChannel,
|
||||
@@ -195,6 +196,7 @@ export enum GatewayIntentBits {
|
||||
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
|
||||
*/
|
||||
export enum GatewayDispatchEvents {
|
||||
ApplicationCommandPermissionsUpdate = 'APPLICATION_COMMAND_PERMISSIONS_UPDATE',
|
||||
ChannelCreate = 'CHANNEL_CREATE',
|
||||
ChannelDelete = 'CHANNEL_DELETE',
|
||||
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
|
||||
@@ -272,6 +274,7 @@ export type GatewayDispatchPayload =
|
||||
| GatewayChannelModifyDispatch
|
||||
| GatewayChannelPinsUpdateDispatch
|
||||
| GatewayGuildBanModifyDispatch
|
||||
| GatewayGuildCreateDispatch
|
||||
| GatewayGuildDeleteDispatch
|
||||
| GatewayGuildEmojisUpdateDispatch
|
||||
| GatewayGuildIntegrationsUpdateDispatch
|
||||
@@ -406,6 +409,10 @@ export interface GatewayReadyDispatchData {
|
||||
* Used for resuming connections
|
||||
*/
|
||||
session_id: string;
|
||||
/**
|
||||
* Gateway url for resuming connections
|
||||
*/
|
||||
resume_gateway_url: string;
|
||||
/**
|
||||
* The shard information associated with this session, if sent when identifying
|
||||
*
|
||||
@@ -500,15 +507,10 @@ export interface GatewayChannelPinsUpdateDispatchData {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-update
|
||||
*/
|
||||
export type GatewayGuildModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildCreate | GatewayDispatchEvents.GuildUpdate,
|
||||
GatewayGuildModifyDispatchData
|
||||
>;
|
||||
export type GatewayGuildModifyDispatch = DataPayload<GatewayDispatchEvents.GuildUpdate, GatewayGuildModifyDispatchData>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-update
|
||||
*/
|
||||
export type GatewayGuildModifyDispatchData = APIGuild;
|
||||
@@ -516,12 +518,92 @@ export type GatewayGuildModifyDispatchData = APIGuild;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
*/
|
||||
export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch;
|
||||
export type GatewayGuildCreateDispatch = DataPayload<GatewayDispatchEvents.GuildCreate, GatewayGuildCreateDispatchData>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create-guild-create-extra-fields
|
||||
*/
|
||||
export type GatewayGuildCreateDispatchData = GatewayGuildModifyDispatchData;
|
||||
export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
/**
|
||||
* When this guild was joined at
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*/
|
||||
joined_at: string;
|
||||
/**
|
||||
* `true` if this is considered a large guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*/
|
||||
large: boolean;
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*/
|
||||
unavailable?: boolean;
|
||||
/**
|
||||
* Total number of members in this guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*/
|
||||
member_count: number;
|
||||
/**
|
||||
* States of members currently in voice channels; lacks the `guild_id` key
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
voice_states: Omit<GatewayVoiceState, 'guild_id'>[];
|
||||
/**
|
||||
* Users in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
members: APIGuildMember[];
|
||||
/**
|
||||
* Channels in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels: APIChannel[];
|
||||
/**
|
||||
* Threads in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
threads: APIChannel[];
|
||||
/**
|
||||
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#presence-update
|
||||
*/
|
||||
presences: GatewayPresenceUpdate[];
|
||||
/**
|
||||
* The stage instances in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure
|
||||
*/
|
||||
stage_instances: APIStageInstance[];
|
||||
/**
|
||||
* The scheduled events in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
|
||||
*/
|
||||
guild_scheduled_events: APIGuildScheduledEvent[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-update
|
||||
@@ -743,11 +825,11 @@ export interface GatewayGuildMembersChunkDispatchData {
|
||||
/**
|
||||
* The chunk index in the expected chunks for this response (`0 <= chunk_index < chunk_count`)
|
||||
*/
|
||||
chunk_index?: number;
|
||||
chunk_index: number;
|
||||
/**
|
||||
* The total number of expected chunks for this response
|
||||
*/
|
||||
chunk_count?: number;
|
||||
chunk_count: number;
|
||||
/**
|
||||
* If passing an invalid id to `REQUEST_GUILD_MEMBERS`, it will be returned here
|
||||
*/
|
||||
@@ -1051,7 +1133,7 @@ export type GatewayMessageCreateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-create
|
||||
*/
|
||||
export type GatewayMessageCreateDispatchData = APIMessage;
|
||||
export type GatewayMessageCreateDispatchData = Omit<APIMessage, 'mentions'> & GatewayMessageEventExtraFields;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-update
|
||||
@@ -1064,10 +1146,43 @@ export type GatewayMessageUpdateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-update
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatchData = {
|
||||
id: Snowflake;
|
||||
channel_id: Snowflake;
|
||||
} & Partial<APIMessage>;
|
||||
export type GatewayMessageUpdateDispatchData = Omit<Partial<APIMessage>, 'mentions'> &
|
||||
GatewayMessageEventExtraFields & {
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* ID of the channel the message was sent in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
};
|
||||
|
||||
export interface GatewayMessageEventExtraFields {
|
||||
/**
|
||||
* ID of the guild the message was sent in
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* Member properties for this message's author
|
||||
*
|
||||
* The member object exists in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete
|
||||
@@ -1495,15 +1610,15 @@ export interface GatewayIdentifyProperties {
|
||||
/**
|
||||
* Your operating system
|
||||
*/
|
||||
$os: string;
|
||||
os: string;
|
||||
/**
|
||||
* Your library name
|
||||
*/
|
||||
$browser: string;
|
||||
browser: string;
|
||||
/**
|
||||
* Your library name
|
||||
*/
|
||||
$device: string;
|
||||
device: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1540,31 +1655,15 @@ export interface GatewayRequestGuildMembers {
|
||||
d: GatewayRequestGuildMembersData;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#request-guild-members
|
||||
*/
|
||||
export interface GatewayRequestGuildMembersData {
|
||||
export interface GatewayRequestGuildMembersDataBase {
|
||||
/**
|
||||
* ID of the guild to get members for
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* String that username starts with, or an empty string to return all members
|
||||
*/
|
||||
query?: string;
|
||||
/**
|
||||
* Maximum number of members to send matching the `query`;
|
||||
* a limit of `0` can be used with an empty string `query` to return all members
|
||||
*/
|
||||
limit: number;
|
||||
/**
|
||||
* Used to specify if we want the presences of the matched members
|
||||
*/
|
||||
presences?: boolean;
|
||||
/**
|
||||
* Used to specify which users you wish to fetch
|
||||
*/
|
||||
user_ids?: Snowflake | Snowflake[];
|
||||
/**
|
||||
* Nonce to identify the Guild Members Chunk response
|
||||
*
|
||||
@@ -1575,6 +1674,32 @@ export interface GatewayRequestGuildMembersData {
|
||||
nonce?: string;
|
||||
}
|
||||
|
||||
export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayRequestGuildMembersDataBase {
|
||||
/**
|
||||
* Used to specify which users you wish to fetch
|
||||
*/
|
||||
user_ids: Snowflake | Snowflake[];
|
||||
}
|
||||
|
||||
export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestGuildMembersDataBase {
|
||||
/**
|
||||
* String that username starts with, or an empty string to return all members
|
||||
*/
|
||||
query: string;
|
||||
/**
|
||||
* Maximum number of members to send matching the `query`;
|
||||
* a limit of `0` can be used with an empty string `query` to return all members
|
||||
*/
|
||||
limit: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#request-guild-members
|
||||
*/
|
||||
export type GatewayRequestGuildMembersData =
|
||||
| GatewayRequestGuildMembersDataWithUserIds
|
||||
| GatewayRequestGuildMembersDataWithQuery;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-voice-state
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../globals.ts';
|
||||
import type { GatewayPresenceUpdate } from '../payloads/v9/gateway.ts';
|
||||
import type {
|
||||
APIApplication,
|
||||
APIChannel,
|
||||
@@ -194,6 +195,7 @@ export enum GatewayIntentBits {
|
||||
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
|
||||
*/
|
||||
export enum GatewayDispatchEvents {
|
||||
ApplicationCommandPermissionsUpdate = 'APPLICATION_COMMAND_PERMISSIONS_UPDATE',
|
||||
ChannelCreate = 'CHANNEL_CREATE',
|
||||
ChannelDelete = 'CHANNEL_DELETE',
|
||||
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
|
||||
@@ -271,6 +273,7 @@ export type GatewayDispatchPayload =
|
||||
| GatewayChannelModifyDispatch
|
||||
| GatewayChannelPinsUpdateDispatch
|
||||
| GatewayGuildBanModifyDispatch
|
||||
| GatewayGuildCreateDispatch
|
||||
| GatewayGuildDeleteDispatch
|
||||
| GatewayGuildEmojisUpdateDispatch
|
||||
| GatewayGuildIntegrationsUpdateDispatch
|
||||
@@ -405,6 +408,10 @@ export interface GatewayReadyDispatchData {
|
||||
* Used for resuming connections
|
||||
*/
|
||||
session_id: string;
|
||||
/**
|
||||
* Gateway url for resuming connections
|
||||
*/
|
||||
resume_gateway_url: string;
|
||||
/**
|
||||
* The shard information associated with this session, if sent when identifying
|
||||
*
|
||||
@@ -498,16 +505,11 @@ export interface GatewayChannelPinsUpdateDispatchData {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-update
|
||||
*/
|
||||
export type GatewayGuildModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildCreate | GatewayDispatchEvents.GuildUpdate,
|
||||
GatewayGuildModifyDispatchData
|
||||
>;
|
||||
export type GatewayGuildModifyDispatch = DataPayload<GatewayDispatchEvents.GuildUpdate, GatewayGuildModifyDispatchData>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-update
|
||||
*/
|
||||
export type GatewayGuildModifyDispatchData = APIGuild;
|
||||
@@ -515,12 +517,92 @@ export type GatewayGuildModifyDispatchData = APIGuild;
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
*/
|
||||
export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch;
|
||||
export type GatewayGuildCreateDispatch = DataPayload<GatewayDispatchEvents.GuildCreate, GatewayGuildCreateDispatchData>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create-guild-create-extra-fields
|
||||
*/
|
||||
export type GatewayGuildCreateDispatchData = GatewayGuildModifyDispatchData;
|
||||
export interface GatewayGuildCreateDispatchData extends APIGuild {
|
||||
/**
|
||||
* When this guild was joined at
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*/
|
||||
joined_at: string;
|
||||
/**
|
||||
* `true` if this is considered a large guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*/
|
||||
large: boolean;
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*/
|
||||
unavailable?: boolean;
|
||||
/**
|
||||
* Total number of members in this guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*/
|
||||
member_count: number;
|
||||
/**
|
||||
* States of members currently in voice channels; lacks the `guild_id` key
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
voice_states: Omit<GatewayVoiceState, 'guild_id'>[];
|
||||
/**
|
||||
* Users in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
members: APIGuildMember[];
|
||||
/**
|
||||
* Channels in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels: APIChannel[];
|
||||
/**
|
||||
* Threads in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
threads: APIChannel[];
|
||||
/**
|
||||
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#presence-update
|
||||
*/
|
||||
presences: GatewayPresenceUpdate[];
|
||||
/**
|
||||
* The stage instances in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure
|
||||
*/
|
||||
stage_instances: APIStageInstance[];
|
||||
/**
|
||||
* The scheduled events in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
|
||||
*/
|
||||
guild_scheduled_events: APIGuildScheduledEvent[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-update
|
||||
@@ -742,11 +824,11 @@ export interface GatewayGuildMembersChunkDispatchData {
|
||||
/**
|
||||
* The chunk index in the expected chunks for this response (`0 <= chunk_index < chunk_count`)
|
||||
*/
|
||||
chunk_index?: number;
|
||||
chunk_index: number;
|
||||
/**
|
||||
* The total number of expected chunks for this response
|
||||
*/
|
||||
chunk_count?: number;
|
||||
chunk_count: number;
|
||||
/**
|
||||
* If passing an invalid id to `REQUEST_GUILD_MEMBERS`, it will be returned here
|
||||
*/
|
||||
@@ -1050,7 +1132,7 @@ export type GatewayMessageCreateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-create
|
||||
*/
|
||||
export type GatewayMessageCreateDispatchData = APIMessage;
|
||||
export type GatewayMessageCreateDispatchData = Omit<APIMessage, 'mentions'> & GatewayMessageEventExtraFields;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-update
|
||||
@@ -1063,10 +1145,43 @@ export type GatewayMessageUpdateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-update
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatchData = {
|
||||
id: Snowflake;
|
||||
channel_id: Snowflake;
|
||||
} & Partial<APIMessage>;
|
||||
export type GatewayMessageUpdateDispatchData = Omit<Partial<APIMessage>, 'mentions'> &
|
||||
GatewayMessageEventExtraFields & {
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* ID of the channel the message was sent in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
};
|
||||
|
||||
export interface GatewayMessageEventExtraFields {
|
||||
/**
|
||||
* ID of the guild the message was sent in
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* Member properties for this message's author
|
||||
*
|
||||
* The member object exists in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete
|
||||
@@ -1494,15 +1609,15 @@ export interface GatewayIdentifyProperties {
|
||||
/**
|
||||
* Your operating system
|
||||
*/
|
||||
$os: string;
|
||||
os: string;
|
||||
/**
|
||||
* Your library name
|
||||
*/
|
||||
$browser: string;
|
||||
browser: string;
|
||||
/**
|
||||
* Your library name
|
||||
*/
|
||||
$device: string;
|
||||
device: string;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1539,31 +1654,15 @@ export interface GatewayRequestGuildMembers {
|
||||
d: GatewayRequestGuildMembersData;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#request-guild-members
|
||||
*/
|
||||
export interface GatewayRequestGuildMembersData {
|
||||
export interface GatewayRequestGuildMembersDataBase {
|
||||
/**
|
||||
* ID of the guild to get members for
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* String that username starts with, or an empty string to return all members
|
||||
*/
|
||||
query?: string;
|
||||
/**
|
||||
* Maximum number of members to send matching the `query`;
|
||||
* a limit of `0` can be used with an empty string `query` to return all members
|
||||
*/
|
||||
limit: number;
|
||||
/**
|
||||
* Used to specify if we want the presences of the matched members
|
||||
*/
|
||||
presences?: boolean;
|
||||
/**
|
||||
* Used to specify which users you wish to fetch
|
||||
*/
|
||||
user_ids?: Snowflake | Snowflake[];
|
||||
/**
|
||||
* Nonce to identify the Guild Members Chunk response
|
||||
*
|
||||
@@ -1574,6 +1673,32 @@ export interface GatewayRequestGuildMembersData {
|
||||
nonce?: string;
|
||||
}
|
||||
|
||||
export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayRequestGuildMembersDataBase {
|
||||
/**
|
||||
* Used to specify which users you wish to fetch
|
||||
*/
|
||||
user_ids: Snowflake | Snowflake[];
|
||||
}
|
||||
|
||||
export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestGuildMembersDataBase {
|
||||
/**
|
||||
* String that username starts with, or an empty string to return all members
|
||||
*/
|
||||
query: string;
|
||||
/**
|
||||
* Maximum number of members to send matching the `query`;
|
||||
* a limit of `0` can be used with an empty string `query` to return all members
|
||||
*/
|
||||
limit: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#request-guild-members
|
||||
*/
|
||||
export type GatewayRequestGuildMembersData =
|
||||
| GatewayRequestGuildMembersDataWithUserIds
|
||||
| GatewayRequestGuildMembersDataWithQuery;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-voice-state
|
||||
*/
|
||||
|
||||
@@ -23,12 +23,14 @@ export const FormattingPatterns = {
|
||||
* Regular expression for matching a user mention, strictly with a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
|
||||
*/
|
||||
UserWithNickname: /<@!(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a user mention, with or without a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
|
||||
*/
|
||||
UserWithOptionalNickname: /<@!?(?<id>\d{17,20})>/,
|
||||
/**
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { LocaleString } from '../v10.ts';
|
||||
import type { LocaleString } from '../rest/common.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
|
||||
@@ -57,4 +57,24 @@ export const PermissionFlagsBits = {
|
||||
*/
|
||||
Object.freeze(PermissionFlagsBits);
|
||||
|
||||
export type LocalizationMap = Partial<Record<LocaleString, string>>;
|
||||
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json
|
||||
*/
|
||||
export interface RESTError {
|
||||
code: number;
|
||||
message: string;
|
||||
errors?: RESTErrorData;
|
||||
}
|
||||
|
||||
export interface RESTErrorFieldInformation {
|
||||
code: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface RESTErrorGroupWrapper {
|
||||
_errors: RESTErrorData[];
|
||||
}
|
||||
|
||||
export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation | { [k: string]: RESTErrorData } | string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
export type APIApplicationCommandAttachmentOption =
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import type { LocalizationMap } from '../../../../../v10.ts';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { LocalizationMap } from '../../../../../v10.ts';
|
||||
|
||||
export interface APIApplicationCommandOptionBase<Type extends ApplicationCommandOptionType> {
|
||||
type: Type;
|
||||
name: string;
|
||||
name_localizations?: LocalizationMap;
|
||||
name_localizations?: LocalizationMap | null;
|
||||
description: string;
|
||||
description_localizations?: LocalizationMap;
|
||||
description_localizations?: LocalizationMap | null;
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { ChannelType } from '../../../channel.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { ChannelType } from '../../../channel.ts';
|
||||
|
||||
export interface APIApplicationCommandChannelOption
|
||||
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {
|
||||
|
||||
@@ -12,7 +12,7 @@ interface APIApplicationCommandIntegerOptionBase
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
export type APIApplicationCommandMentionableOption =
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Mentionable>;
|
||||
|
||||
@@ -12,7 +12,7 @@ interface APIApplicationCommandNumberOptionBase
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
export type APIApplicationCommandRoleOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Role>;
|
||||
|
||||
|
||||
@@ -22,6 +22,6 @@ export enum ApplicationCommandOptionType {
|
||||
*/
|
||||
export interface APIApplicationCommandOptionChoice<ValueType = string | number> {
|
||||
name: string;
|
||||
name_localizations?: LocalizationMap;
|
||||
name_localizations?: LocalizationMap | null;
|
||||
value: ValueType;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,20 @@ import type {
|
||||
} from './base.ts';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
interface APIApplicationCommandStringOptionBase
|
||||
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.String> {
|
||||
/**
|
||||
* For option type `STRING`, the minimum allowed length (minimum of `0`, maximum of `6000`).
|
||||
*/
|
||||
min_length?: number;
|
||||
/**
|
||||
* For option type `STRING`, the maximum allowed length (minimum of `1`, maximum of `6000`).
|
||||
*/
|
||||
max_length?: number;
|
||||
}
|
||||
|
||||
export type APIApplicationCommandStringOption = APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.String>,
|
||||
APIApplicationCommandStringOptionBase,
|
||||
APIApplicationCommandOptionChoice<string>
|
||||
>;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
|
||||
import type { APIApplicationCommandOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
|
||||
|
||||
export interface APIApplicationCommandSubcommandOption
|
||||
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Subcommand> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
export type APIApplicationCommandUserOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.User>;
|
||||
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionWrapper,
|
||||
APIInteractionDataResolvedChannel,
|
||||
APIInteractionDataResolvedGuildMember,
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type {
|
||||
APIApplicationCommandAttachmentOption,
|
||||
APIApplicationCommandInteractionDataAttachmentOption,
|
||||
@@ -52,8 +42,19 @@ import type {
|
||||
APIApplicationCommandInteractionDataUserOption,
|
||||
APIApplicationCommandUserOption,
|
||||
} from './_chatInput/user.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionWrapper,
|
||||
APIInteractionDataResolvedChannel,
|
||||
APIInteractionDataResolvedGuildMember,
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
|
||||
export * from './_chatInput/attachment.ts';
|
||||
export * from './_chatInput/base.ts';
|
||||
export * from './_chatInput/boolean.ts';
|
||||
export * from './_chatInput/channel.ts';
|
||||
export * from './_chatInput/integer.ts';
|
||||
@@ -108,7 +109,7 @@ export type APIApplicationCommandInteractionDataBasicOption =
|
||||
| APIApplicationCommandInteractionDataAttachmentOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIChatInputApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIMessage } from '../../channel.ts';
|
||||
import type { APIUser } from '../../user.ts';
|
||||
@@ -7,10 +8,9 @@ import type {
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIUserApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.User> {
|
||||
@@ -27,7 +27,7 @@ export interface APIUserApplicationCommandInteractionDataResolved {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIMessageApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.Message> {
|
||||
@@ -43,7 +43,7 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export type APIContextMenuInteractionData =
|
||||
| APIUserApplicationCommandInteractionData
|
||||
|
||||
@@ -5,4 +5,5 @@ export interface APIBaseApplicationCommandInteractionData<Type extends Applicati
|
||||
id: Snowflake;
|
||||
type: Type;
|
||||
name: string;
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { Snowflake } from '../../../../globals.ts';
|
||||
*/
|
||||
export interface APIGuildApplicationCommandPermissions {
|
||||
/**
|
||||
* The id of the command
|
||||
* The id of the command or the application id if that permission applies to all commands
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
@@ -27,11 +27,11 @@ export interface APIGuildApplicationCommandPermissions {
|
||||
*/
|
||||
export interface APIApplicationCommandPermission {
|
||||
/**
|
||||
* The id of the role or user
|
||||
* The id of the role, user or channel. Can also be a permission constant
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Role or user
|
||||
* Role, user or channel
|
||||
*/
|
||||
type: ApplicationCommandPermissionType;
|
||||
/**
|
||||
@@ -46,4 +46,13 @@ export interface APIApplicationCommandPermission {
|
||||
export enum ApplicationCommandPermissionType {
|
||||
Role = 1,
|
||||
User,
|
||||
Channel,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-constants
|
||||
*/
|
||||
export const APIApplicationCommandPermissionsConstant = {
|
||||
Everyone: (guildId: string | bigint): Snowflake => String(guildId),
|
||||
AllChannels: (guildId: string | bigint): Snowflake => String(BigInt(guildId) - 1n),
|
||||
};
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { LocalizationMap } from '../../../v10.ts';
|
||||
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIBaseInteraction } from './base.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type {
|
||||
APIApplicationCommandOption,
|
||||
APIChatInputApplicationCommandDMInteraction,
|
||||
@@ -17,6 +11,12 @@ import type {
|
||||
APIContextMenuInteraction,
|
||||
APIContextMenuInteractionData,
|
||||
} from './_applicationCommands/contextMenu.ts';
|
||||
import type { APIBaseInteraction } from './base.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { LocalizationMap } from '../../../v10.ts';
|
||||
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
|
||||
export * from './_applicationCommands/chatInput.ts';
|
||||
export * from './_applicationCommands/contextMenu.ts';
|
||||
@@ -43,13 +43,17 @@ export interface APIApplicationCommand {
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* 1-32 character name; `CHAT_INPUT` command names must be all lowercase matching `^[\w-]{1,32}$`
|
||||
* 1-32 character name; `CHAT_INPUT` command names must be all lowercase matching `^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$`
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Localization dictionary for the name field. Values follow the same restrictions as name
|
||||
*/
|
||||
name_localizations?: LocalizationMap;
|
||||
name_localizations?: LocalizationMap | null;
|
||||
/**
|
||||
* The localized name
|
||||
*/
|
||||
name_localized?: string;
|
||||
/**
|
||||
* 1-100 character description for `CHAT_INPUT` commands, empty string for `USER` and `MESSAGE` commands
|
||||
*/
|
||||
@@ -57,15 +61,28 @@ export interface APIApplicationCommand {
|
||||
/**
|
||||
* Localization dictionary for the description field. Values follow the same restrictions as description
|
||||
*/
|
||||
description_localizations?: LocalizationMap;
|
||||
description_localizations?: LocalizationMap | null;
|
||||
/**
|
||||
* The localized description
|
||||
*/
|
||||
description_localized?: string;
|
||||
/**
|
||||
* The parameters for the `CHAT_INPUT` command, max 25
|
||||
*/
|
||||
options?: APIApplicationCommandOption[];
|
||||
/**
|
||||
* Set of permissions represented as a bitset
|
||||
*/
|
||||
default_member_permissions: Permissions | null;
|
||||
/**
|
||||
* Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible
|
||||
*/
|
||||
dm_permission?: boolean;
|
||||
/**
|
||||
* Whether the command is enabled by default when the app is added to a guild
|
||||
*
|
||||
* If missing, this property should be assumed as `true`
|
||||
* @deprecated Use `dm_permission` and/or `default_member_permissions` instead
|
||||
*/
|
||||
default_permission?: boolean;
|
||||
/**
|
||||
@@ -84,7 +101,7 @@ export enum ApplicationCommandType {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export type APIApplicationCommandInteractionData =
|
||||
| APIChatInputApplicationCommandInteractionData
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { LocaleString } from '../../../v10.ts';
|
||||
import type { APIMessage } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
|
||||
export type PartialAPIMessageInteractionGuildMember = Pick<
|
||||
APIGuildMember,
|
||||
@@ -31,7 +31,7 @@ export interface APIMessageInteraction {
|
||||
*/
|
||||
type: InteractionType;
|
||||
/**
|
||||
* The name of the ApplicationCommand
|
||||
* The name of the application command, including subcommands and subcommand groups
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
@@ -104,6 +104,10 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
* For components, the message they were attached to
|
||||
*/
|
||||
message?: APIMessage;
|
||||
/**
|
||||
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
|
||||
*/
|
||||
app_permissions?: Permissions;
|
||||
/**
|
||||
* The selected language of the invoking user
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
|
||||
import type { ComponentType } from '../channel.ts';
|
||||
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
|
||||
|
||||
export type APIMessageComponentInteraction = APIBaseInteraction<
|
||||
InteractionType.MessageComponent,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v10.ts';
|
||||
import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts';
|
||||
import type { MessageFlags } from '../mod.ts';
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/application
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APITeam } from './teams.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object
|
||||
@@ -53,16 +54,15 @@ export interface APIApplication {
|
||||
*/
|
||||
owner?: APIUser;
|
||||
/**
|
||||
* If this application is a game sold on Discord, this field will be the summary field for the store page
|
||||
* of its primary sku
|
||||
* An empty string
|
||||
*
|
||||
* @deprecated Always an empty string, will be removed in v11
|
||||
* @deprecated This field will be removed in v11
|
||||
*/
|
||||
summary: '';
|
||||
summary: string;
|
||||
/**
|
||||
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
|
||||
*
|
||||
* See https://discord.com/developers/docs/game-sdk/applications#get-ticket
|
||||
* See https://discord.com/developers/docs/game-sdk/applications#getticket
|
||||
*/
|
||||
verify_key: string;
|
||||
/**
|
||||
@@ -93,6 +93,23 @@ export interface APIApplication {
|
||||
* See https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
flags: ApplicationFlags;
|
||||
/**
|
||||
* Up to 5 tags describing the content and functionality of the application
|
||||
*/
|
||||
tags?: [string, string?, string?, string?, string?];
|
||||
/**
|
||||
* Settings for the application's default in-app authorization link, if enabled
|
||||
*/
|
||||
install_params?: APIApplicationInstallParams;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
custom_install_url?: string;
|
||||
}
|
||||
|
||||
export interface APIApplicationInstallParams {
|
||||
scopes: OAuth2Scopes[];
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/audit-log
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIChannel, APIOverwrite } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
@@ -17,16 +16,24 @@ import type {
|
||||
GuildScheduledEventEntityType,
|
||||
GuildScheduledEventStatus,
|
||||
} from './guildScheduledEvent.ts';
|
||||
import type { APIApplicationCommand } from './interactions.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { StageInstancePrivacyLevel } from './stageInstance.ts';
|
||||
import type { StickerFormatType } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIWebhook } from './webhook.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
|
||||
*/
|
||||
export interface APIAuditLog {
|
||||
/**
|
||||
* List of application commands found in the audit log
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/application-commands#application-command-object
|
||||
*/
|
||||
application_commands: APIApplicationCommand[];
|
||||
/**
|
||||
* Webhooks found in the audit log
|
||||
*
|
||||
@@ -171,6 +178,8 @@ export enum AuditLogEvent {
|
||||
ThreadCreate = 110,
|
||||
ThreadUpdate,
|
||||
ThreadDelete,
|
||||
|
||||
ApplicationCommandPermissionUpdate = 121,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -273,6 +282,7 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeyImageHash
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
@@ -354,6 +364,11 @@ export type APIAuditLogChangeKeyDescription = AuditLogChangeData<'description',
|
||||
*/
|
||||
export type APIAuditLogChangeKeyIconHash = AuditLogChangeData<'icon_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's scheduled event's cover image is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyImageHash = AuditLogChangeData<'image_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's splash is changed
|
||||
*/
|
||||
@@ -511,6 +526,12 @@ export type APIAuditLogChangeKeyPermissions = AuditLogChangeData<'permissions',
|
||||
*/
|
||||
export type APIAuditLogChangeKeyColor = AuditLogChangeData<'color', number>;
|
||||
|
||||
/**
|
||||
* Represents a change where the key is a snowflake.
|
||||
* Currently, the only known instance of this is returned when permissions for a command were updated (<insert name of object here>)
|
||||
*/
|
||||
export type APIAuditLogChangeKeySnowflake = AuditLogChangeData<Snowflake, unknown>;
|
||||
|
||||
/**
|
||||
* Returned when a role's hoist status is changed
|
||||
*/
|
||||
|
||||
@@ -2,14 +2,13 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/channel
|
||||
*/
|
||||
|
||||
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 { APIRole } from './permissions.ts';
|
||||
import type { APISticker, APIStickerItem } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
@@ -37,9 +36,9 @@ export interface APIPartialChannel {
|
||||
*/
|
||||
export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel {
|
||||
type: T;
|
||||
flags?: ChannelFlags;
|
||||
}
|
||||
|
||||
// TODO: update when text in voice is released
|
||||
export type TextChannelType =
|
||||
| ChannelType.DM
|
||||
| ChannelType.GroupDM
|
||||
@@ -47,14 +46,12 @@ export type TextChannelType =
|
||||
| ChannelType.GuildPublicThread
|
||||
| ChannelType.GuildPrivateThread
|
||||
| ChannelType.GuildNewsThread
|
||||
| ChannelType.GuildText;
|
||||
| ChannelType.GuildText
|
||||
| ChannelType.GuildForum
|
||||
| ChannelType.GuildVoice;
|
||||
|
||||
export type GuildChannelType = Exclude<
|
||||
| TextChannelType
|
||||
| ChannelType.GuildVoice
|
||||
| ChannelType.GuildStageVoice
|
||||
| ChannelType.GuildNews
|
||||
| ChannelType.GuildStore,
|
||||
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
|
||||
ChannelType.DM | ChannelType.GroupDM
|
||||
>;
|
||||
|
||||
@@ -63,6 +60,16 @@ export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBa
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*
|
||||
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
|
||||
*
|
||||
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
|
||||
* 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;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
@@ -114,24 +121,11 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
export interface APITextChannel extends APIGuildTextChannel<ChannelType.GuildText> {
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*
|
||||
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
|
||||
*
|
||||
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
|
||||
* 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;
|
||||
}
|
||||
|
||||
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
|
||||
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
|
||||
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
|
||||
export type APIGuildStoreChannel = APIGuildChannel<ChannelType.GuildStore>;
|
||||
|
||||
export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageVoice | ChannelType.GuildVoice> {
|
||||
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
|
||||
/**
|
||||
* The bitrate (in bits) of the voice channel
|
||||
*/
|
||||
@@ -146,6 +140,11 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
rtc_region?: string | null;
|
||||
}
|
||||
|
||||
export interface APIGuildVoiceChannel
|
||||
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
|
||||
APITextBasedChannel<ChannelType.GuildVoice> {
|
||||
/**
|
||||
* The camera video quality mode of the voice channel, `1` when not present
|
||||
*
|
||||
@@ -154,7 +153,9 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
|
||||
video_quality_mode?: VideoQualityMode;
|
||||
}
|
||||
|
||||
interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T> {
|
||||
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
|
||||
|
||||
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
|
||||
/**
|
||||
* The recipients of the DM
|
||||
*
|
||||
@@ -165,7 +166,7 @@ interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>
|
||||
|
||||
export type APIDMChannel = APIDMChannelBase<ChannelType.DM>;
|
||||
|
||||
export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
|
||||
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
|
||||
/**
|
||||
* Application id of the group DM creator if it is bot-created
|
||||
*/
|
||||
@@ -174,6 +175,10 @@ export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM>
|
||||
* Icon hash
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The name of the channel (2-100 characters)
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* ID of the DM creator
|
||||
*/
|
||||
@@ -197,7 +202,9 @@ export interface APIThreadChannel
|
||||
*/
|
||||
thread_metadata?: APIThreadMetadata;
|
||||
/**
|
||||
* The approximate message count of the thread, does not count above 50 even if there are more messages
|
||||
* Number of messages (not including the initial message or deleted messages) in a thread
|
||||
*
|
||||
* If the thread was created before July 1, 2022, it stops counting at 50 messages
|
||||
*/
|
||||
message_count?: number;
|
||||
/**
|
||||
@@ -222,8 +229,16 @@ export interface APIThreadChannel
|
||||
* The id of the last message sent in this thread (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
/**
|
||||
* Number of messages ever sent in a thread
|
||||
*
|
||||
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
|
||||
*/
|
||||
total_message_sent?: number;
|
||||
}
|
||||
|
||||
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
|
||||
*/
|
||||
@@ -232,11 +247,12 @@ export type APIChannel =
|
||||
| APIDMChannel
|
||||
| APITextChannel
|
||||
| APINewsChannel
|
||||
| APIGuildStoreChannel
|
||||
| APIVoiceChannel
|
||||
| APIGuildVoiceChannel
|
||||
| APIGuildStageVoiceChannel
|
||||
| APIGuildCategoryChannel
|
||||
| APIThreadChannel
|
||||
| APINewsChannel;
|
||||
| APINewsChannel
|
||||
| APIGuildForumChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
@@ -270,12 +286,6 @@ export enum ChannelType {
|
||||
* See https://support.discord.com/hc/en-us/articles/360032008192
|
||||
*/
|
||||
GuildNews,
|
||||
/**
|
||||
* A channel in which game developers can sell their game on Discord
|
||||
*
|
||||
* See https://discord.com/developers/docs/game-and-server-management/special-channels
|
||||
*/
|
||||
GuildStore,
|
||||
/**
|
||||
* A thread channel (public) within a Guild News channel
|
||||
*/
|
||||
@@ -294,6 +304,16 @@ export enum ChannelType {
|
||||
* See https://support.discord.com/hc/en-us/articles/1500005513722
|
||||
*/
|
||||
GuildStageVoice,
|
||||
/**
|
||||
* The channel in a Student Hub containing the listed servers
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
|
||||
*/
|
||||
GuildDirectory,
|
||||
/**
|
||||
* A channel that can only contain threads
|
||||
*/
|
||||
GuildForum,
|
||||
}
|
||||
|
||||
export enum VideoQualityMode {
|
||||
@@ -319,10 +339,6 @@ export interface APIMessage {
|
||||
* ID of the channel the message was sent in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* ID of the guild the message was sent in
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The author of this message (only a valid user in the case where the message is generated by a user or bot user)
|
||||
*
|
||||
@@ -332,17 +348,15 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
author: APIUser;
|
||||
/**
|
||||
* Member properties for this message's author
|
||||
*
|
||||
* The member object exists in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* Contents of the message
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
|
||||
*/
|
||||
content: string;
|
||||
/**
|
||||
@@ -370,7 +384,7 @@ export interface APIMessage {
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
|
||||
mentions: APIUser[];
|
||||
/**
|
||||
* Roles specifically mentioned in this message
|
||||
*
|
||||
@@ -393,12 +407,26 @@ export interface APIMessage {
|
||||
* Any attached files
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
|
||||
*/
|
||||
attachments: APIAttachment[];
|
||||
/**
|
||||
* Any embedded content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
|
||||
*/
|
||||
embeds: APIEmbed[];
|
||||
/**
|
||||
@@ -437,7 +465,7 @@ export interface APIMessage {
|
||||
/**
|
||||
* Sent with Rich Presence-related chat embeds
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
|
||||
* See https://discord.com/developers/docs/resources/application#application-object
|
||||
*/
|
||||
application?: Partial<APIApplication>;
|
||||
/**
|
||||
@@ -447,7 +475,7 @@ export interface APIMessage {
|
||||
/**
|
||||
* Reference data sent with crossposted messages, replies, pins, and thread starter messages
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReference;
|
||||
/**
|
||||
@@ -482,6 +510,13 @@ export interface APIMessage {
|
||||
thread?: APIChannel;
|
||||
/**
|
||||
* Sent if the message contains components like buttons, action rows, or other interactive components
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
|
||||
/**
|
||||
@@ -497,6 +532,12 @@ export interface APIMessage {
|
||||
* @deprecated Use `sticker_items` instead
|
||||
*/
|
||||
stickers?: APISticker[];
|
||||
/**
|
||||
* A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread
|
||||
*
|
||||
* 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;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -510,11 +551,11 @@ export enum MessageType {
|
||||
ChannelNameChange,
|
||||
ChannelIconChange,
|
||||
ChannelPinnedMessage,
|
||||
GuildMemberJoin,
|
||||
UserPremiumGuildSubscription,
|
||||
UserPremiumGuildSubscriptionTier1,
|
||||
UserPremiumGuildSubscriptionTier2,
|
||||
UserPremiumGuildSubscriptionTier3,
|
||||
UserJoin,
|
||||
GuildBoost,
|
||||
GuildBoostTier1,
|
||||
GuildBoostTier2,
|
||||
GuildBoostTier3,
|
||||
ChannelFollowAdd,
|
||||
GuildDiscoveryDisqualified = 14,
|
||||
GuildDiscoveryRequalified,
|
||||
@@ -547,7 +588,7 @@ export interface APIMessageActivity {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
/**
|
||||
@@ -763,10 +804,6 @@ export interface APIThreadList {
|
||||
* The members for the client user in each of the fetched threads
|
||||
*/
|
||||
members: APIThreadMember[];
|
||||
/**
|
||||
* Whether there are potentially additional threads
|
||||
*/
|
||||
has_more?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -914,6 +951,10 @@ export interface APIEmbedVideo {
|
||||
* Source url of video
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* A proxied url of the video
|
||||
*/
|
||||
proxy_url?: string;
|
||||
/**
|
||||
* Height of video
|
||||
*/
|
||||
@@ -1153,7 +1194,7 @@ export interface APIBaseComponent<T extends ComponentType> {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#component-types
|
||||
* https://discord.com/developers/docs/interactions/message-components#component-object-component-types
|
||||
*/
|
||||
export enum ComponentType {
|
||||
/**
|
||||
@@ -1360,6 +1401,13 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
export enum ChannelFlags {
|
||||
Pinned = 1 << 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#message-components
|
||||
*/
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/emoji
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* Not documented but mentioned
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIChannel, APIThreadMember } from './channel.ts';
|
||||
import type { APIEmoji } from './emoji.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway
|
||||
@@ -127,6 +127,7 @@ export interface GatewayPresenceClientStatus {
|
||||
export interface GatewayActivity {
|
||||
/**
|
||||
* The activity's id
|
||||
* @unstable
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
@@ -151,8 +152,16 @@ export interface GatewayActivity {
|
||||
* Unix timestamps for start and/or end of the game
|
||||
*/
|
||||
timestamps?: GatewayActivityTimestamps;
|
||||
/**
|
||||
* The Spotify song id
|
||||
* @unstable
|
||||
*/
|
||||
sync_id?: string;
|
||||
platform?: ActivityPlatform;
|
||||
/**
|
||||
* The platform this activity is being done on
|
||||
* @unstable You can use {@link ActivityPlatform} as a stepping stone, but this might be inaccurate
|
||||
*/
|
||||
platform?: string;
|
||||
/**
|
||||
* Application id for the game
|
||||
*/
|
||||
@@ -171,6 +180,9 @@ export interface GatewayActivity {
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
|
||||
*/
|
||||
emoji?: GatewayActivityEmoji;
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
session_id?: string;
|
||||
/**
|
||||
* Information for the current party of the player
|
||||
@@ -208,10 +220,19 @@ export interface GatewayActivity {
|
||||
buttons?: string[] | GatewayActivityButton[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @unstable This enum is currently not documented by Discord but has known values which we will try to keep up to date.
|
||||
* Values might be added or removed without a major version bump.
|
||||
*/
|
||||
export enum ActivityPlatform {
|
||||
Desktop = 'desktop',
|
||||
Samsung = 'samsung',
|
||||
Xbox = 'xbox',
|
||||
Samsung = 'samsung',
|
||||
IOS = 'ios',
|
||||
Android = 'android',
|
||||
Embedded = 'embedded',
|
||||
PS4 = 'ps4',
|
||||
PS5 = 'ps5',
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,16 +2,12 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/guild
|
||||
*/
|
||||
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { APIChannel } from './channel.ts';
|
||||
import type { APIEmoji } from './emoji.ts';
|
||||
import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway.ts';
|
||||
import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts';
|
||||
import type { PresenceUpdateStatus } from './gateway.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIStageInstance } from './stageInstance.ts';
|
||||
import type { APISticker } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { GatewayVoiceState } from './voice.ts';
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -54,7 +50,7 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
|
||||
*/
|
||||
banner?: string | null;
|
||||
/**
|
||||
* The description for the guild, if the guild is discoverable
|
||||
* The description for the guild
|
||||
*/
|
||||
description?: string | null;
|
||||
/**
|
||||
@@ -73,10 +69,6 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
|
||||
* The vanity url code for the guild
|
||||
*/
|
||||
vanity_url_code?: string | null;
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*/
|
||||
unavailable?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -196,64 +188,6 @@ export interface APIGuild extends APIPartialGuild {
|
||||
* The id of the channel where Community guilds can display rules and/or guidelines
|
||||
*/
|
||||
rules_channel_id: Snowflake | null;
|
||||
/**
|
||||
* When this guild was joined at
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*/
|
||||
joined_at?: string;
|
||||
/**
|
||||
* `true` if this is considered a large guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*/
|
||||
large?: boolean;
|
||||
/**
|
||||
* Total number of members in this guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*/
|
||||
member_count?: number;
|
||||
/**
|
||||
* States of members currently in voice channels; lacks the `guild_id` key
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
voice_states?: Omit<GatewayVoiceState, 'guild_id'>[];
|
||||
/**
|
||||
* Users in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
members?: APIGuildMember[];
|
||||
/**
|
||||
* Channels in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels?: APIChannel[];
|
||||
/**
|
||||
* Threads in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
threads?: APIChannel[];
|
||||
/**
|
||||
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#presence-update
|
||||
*/
|
||||
presences?: GatewayPresenceUpdate[];
|
||||
/**
|
||||
* The maximum number of presences for the guild (`null` is always returned, apart from the largest of guilds)
|
||||
*/
|
||||
@@ -267,7 +201,7 @@ export interface APIGuild extends APIPartialGuild {
|
||||
*/
|
||||
vanity_url_code: string | null;
|
||||
/**
|
||||
* The description for the guild, if the guild is discoverable
|
||||
* The description for the guild
|
||||
*/
|
||||
description: string | null;
|
||||
/**
|
||||
@@ -320,14 +254,6 @@ export interface APIGuild extends APIPartialGuild {
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level
|
||||
*/
|
||||
nsfw_level: GuildNSFWLevel;
|
||||
/**
|
||||
* The stage instances in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure
|
||||
*/
|
||||
stage_instances?: APIStageInstance[];
|
||||
/**
|
||||
* Custom guild stickers
|
||||
*
|
||||
@@ -339,13 +265,9 @@ export interface APIGuild extends APIPartialGuild {
|
||||
*/
|
||||
premium_progress_bar_enabled: boolean;
|
||||
/**
|
||||
* The scheduled events in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
|
||||
* The type of Student Hub the guild is
|
||||
*/
|
||||
guild_scheduled_events?: APIGuildScheduledEvent[];
|
||||
hub_type: GuildHubType | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -419,6 +341,12 @@ export enum GuildPremiumTier {
|
||||
Tier3,
|
||||
}
|
||||
|
||||
export enum GuildHubType {
|
||||
Default,
|
||||
HighSchool,
|
||||
College,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
@@ -445,6 +373,10 @@ export enum GuildSystemChannelFlags {
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
*/
|
||||
export enum GuildFeature {
|
||||
/**
|
||||
* Guild has access to set an animated guild banner image
|
||||
*/
|
||||
AnimatedBanner = 'ANIMATED_BANNER',
|
||||
/**
|
||||
* Guild has access to set an animated guild icon
|
||||
*/
|
||||
@@ -453,10 +385,6 @@ export enum GuildFeature {
|
||||
* Guild has access to set a guild banner image
|
||||
*/
|
||||
Banner = 'BANNER',
|
||||
/**
|
||||
* Guild has access to use commerce features (i.e. create store channels)
|
||||
*/
|
||||
Commerce = 'COMMERCE',
|
||||
/**
|
||||
* Guild can enable welcome screen, Membership Screening and discovery, and receives community updates
|
||||
*/
|
||||
@@ -469,10 +397,30 @@ export enum GuildFeature {
|
||||
* Guild is able to be featured in the directory
|
||||
*/
|
||||
Featurable = 'FEATURABLE',
|
||||
/**
|
||||
* Guild is listed in a directory channel
|
||||
*/
|
||||
HasDirectoryEntry = 'HAS_DIRECTORY_ENTRY',
|
||||
/**
|
||||
* Guild is a Student Hub
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
|
||||
*
|
||||
* @unstable This feature is currently not documented by Discord, but has known value
|
||||
*/
|
||||
Hub = 'HUB',
|
||||
/**
|
||||
* Guild has access to set an invite splash background
|
||||
*/
|
||||
InviteSplash = 'INVITE_SPLASH',
|
||||
/**
|
||||
* Guild is in a Student Hub
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
|
||||
*
|
||||
* @unstable This feature is currently not documented by Discord, but has known value
|
||||
*/
|
||||
LinkedToHub = 'LINKED_TO_HUB',
|
||||
/**
|
||||
* Guild has enabled Membership Screening
|
||||
*/
|
||||
@@ -506,14 +454,6 @@ export enum GuildFeature {
|
||||
* Guild is able to set role icons
|
||||
*/
|
||||
RoleIcons = 'ROLE_ICONS',
|
||||
/**
|
||||
* Guild has access to the seven day archive time for threads
|
||||
*/
|
||||
SevenDayThreadArchive = 'SEVEN_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has access to the three day archive time for threads
|
||||
*/
|
||||
ThreeDayThreadArchive = 'THREE_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has enabled ticketed events
|
||||
*/
|
||||
@@ -685,7 +625,7 @@ export interface APIGuildIntegration {
|
||||
/**
|
||||
* Is this integration enabled
|
||||
*/
|
||||
enabled: boolean;
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* Is this integration syncing
|
||||
*
|
||||
@@ -806,12 +746,6 @@ export interface APIGuildIntegrationApplication {
|
||||
* The description of the app
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* The summary of the app
|
||||
*
|
||||
* @deprecated Always an empty string, will be removed in v11
|
||||
*/
|
||||
summary: '';
|
||||
/**
|
||||
* The bot associated with this application
|
||||
*
|
||||
@@ -835,7 +769,7 @@ export interface APIBan {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object
|
||||
*/
|
||||
export interface APIGuildWidget {
|
||||
id: Snowflake;
|
||||
@@ -847,7 +781,7 @@ export interface APIGuildWidget {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
|
||||
*/
|
||||
export interface APIGuildWidgetChannel {
|
||||
id: Snowflake;
|
||||
@@ -856,7 +790,7 @@ export interface APIGuildWidgetChannel {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
|
||||
*/
|
||||
export interface APIGuildWidgetMember {
|
||||
id: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType> {
|
||||
/**
|
||||
|
||||
@@ -53,7 +53,7 @@ export interface APIInvite {
|
||||
/**
|
||||
* The type of target for this voice channel invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
|
||||
*/
|
||||
target_type?: InviteTargetType;
|
||||
/**
|
||||
@@ -65,7 +65,7 @@ export interface APIInvite {
|
||||
/**
|
||||
* The embedded application to open for this voice channel embedded application invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/oauth2#application
|
||||
* See https://discord.com/developers/docs/resources/application#application-object
|
||||
*/
|
||||
target_application?: Partial<APIApplication>;
|
||||
/**
|
||||
|
||||
@@ -14,6 +14,10 @@ export enum OAuth2Scopes {
|
||||
* See https://discord.com/developers/docs/resources/user#get-user-connections
|
||||
*/
|
||||
Connections = 'connections',
|
||||
/**
|
||||
* Allows your app to see information about the user's DMs and group DMs - requires Discord approval
|
||||
*/
|
||||
DMChannelsRead = 'dm_channels.read',
|
||||
/**
|
||||
* Enables [/users/@me](https://discord.com/developers/docs/resources/user#get-current-user) to return an `email`
|
||||
*
|
||||
@@ -43,7 +47,7 @@ export enum OAuth2Scopes {
|
||||
/**
|
||||
* Allows /users/@me/guilds/{guild.id}/member to return a user's member information in a guild
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#get-current-user-guild-member
|
||||
* See https://discord.com/developers/docs/resources/user#get-current-user-guild-member
|
||||
*/
|
||||
GuildsMembersRead = 'guilds.members.read',
|
||||
/**
|
||||
@@ -69,6 +73,10 @@ export enum OAuth2Scopes {
|
||||
* This generates a webhook that is returned in the oauth token response for authorization code grants
|
||||
*/
|
||||
WebhookIncoming = 'webhook.incoming',
|
||||
/**
|
||||
* Allows your app to connect to voice on user's behalf and see all the voice members - requires Discord approval
|
||||
*/
|
||||
Voice = 'voice',
|
||||
/**
|
||||
* Allows your app to upload/update builds for a user's applications - requires Discord approval
|
||||
*/
|
||||
@@ -111,4 +119,10 @@ export enum OAuth2Scopes {
|
||||
* See https://discord.com/developers/docs/interactions/application-commands
|
||||
*/
|
||||
ApplicationsCommandsUpdate = 'applications.commands.update',
|
||||
/**
|
||||
* Allows your app to update permissions for its commands using a Bearer token - client credentials grant only
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/application-commands
|
||||
*/
|
||||
ApplicationCommandsPermissionsUpdate = 'applications.commands.permissions.update',
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#stage-instance-object
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/sticker
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Types extracted from https://discord.com/developers/docs/topics/teams
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-object
|
||||
@@ -32,7 +32,7 @@ export interface APITeam {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-members-object
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-member-object
|
||||
*/
|
||||
export interface APITeamMember {
|
||||
/**
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/template
|
||||
* Types extracted from https://discord.com/developers/docs/resources/guild-template
|
||||
*/
|
||||
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v10/mod.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#template-object
|
||||
* https://discord.com/developers/docs/resources/guild-template#guild-template-object
|
||||
*/
|
||||
export interface APITemplate {
|
||||
/**
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/user
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIGuildIntegration } from './guild.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object
|
||||
@@ -94,7 +94,7 @@ export enum UserFlags {
|
||||
*/
|
||||
Partner = 1 << 1,
|
||||
/**
|
||||
* HypeSquad Events Coordinator
|
||||
* HypeSquad Events Member
|
||||
*/
|
||||
Hypesquad = 1 << 2,
|
||||
/**
|
||||
@@ -143,8 +143,16 @@ export enum UserFlags {
|
||||
BotHTTPInteractions = 1 << 19,
|
||||
/**
|
||||
* User has been identified as spammer
|
||||
*
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
Spammer = 1 << 20,
|
||||
/**
|
||||
* User's account has been quarantined based on recent activity
|
||||
*
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
Quarantined = Math.pow(2, 44),
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,8 +178,10 @@ export interface APIConnection {
|
||||
name: string;
|
||||
/**
|
||||
* The service of the connection
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#connection-object-services
|
||||
*/
|
||||
type: string;
|
||||
type: ConnectionService;
|
||||
/**
|
||||
* Whether the connection is revoked
|
||||
*/
|
||||
@@ -202,6 +212,24 @@ export interface APIConnection {
|
||||
visibility: ConnectionVisibility;
|
||||
}
|
||||
|
||||
export enum ConnectionService {
|
||||
BattleNet = 'battlenet',
|
||||
EpicGames = 'epicgames',
|
||||
Facebook = 'facebook',
|
||||
GitHub = 'github',
|
||||
LeagueOfLegends = 'leagueoflegends',
|
||||
PlayStationNetwork = 'playstation',
|
||||
Reddit = 'reddit',
|
||||
SamsungGalaxy = 'samsunggalaxy',
|
||||
Spotify = 'spotify',
|
||||
Skype = 'skype',
|
||||
Steam = 'steam',
|
||||
Twitch = 'twitch',
|
||||
Twitter = 'twitter',
|
||||
Xbox = 'xbox',
|
||||
YouTube = 'youtube',
|
||||
}
|
||||
|
||||
export enum ConnectionVisibility {
|
||||
/**
|
||||
* Invisible to everyone except the user themselves
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/voice
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/webhook
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIPartialChannel, APIPartialGuild, APIUser } from './mod.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#webhook-object
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { ChannelType } from '../../../channel.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { ChannelType } from '../../../channel.ts';
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
|
||||
@@ -15,7 +15,7 @@ interface APIApplicationCommandIntegerOptionBase
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
|
||||
@@ -15,7 +15,7 @@ interface APIApplicationCommandNumberOptionBase
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
|
||||
import type { APIApplicationCommandOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionWrapper,
|
||||
APIInteractionDataResolvedChannel,
|
||||
APIInteractionDataResolvedGuildMember,
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type {
|
||||
APIApplicationCommandAttachmentOption,
|
||||
APIApplicationCommandInteractionDataAttachmentOption,
|
||||
@@ -52,6 +42,16 @@ import type {
|
||||
APIApplicationCommandInteractionDataUserOption,
|
||||
APIApplicationCommandUserOption,
|
||||
} from './_chatInput/user.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionWrapper,
|
||||
APIInteractionDataResolvedChannel,
|
||||
APIInteractionDataResolvedGuildMember,
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
|
||||
export * from './_chatInput/attachment.ts';
|
||||
export * from './_chatInput/boolean.ts';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIMessage } from '../../channel.ts';
|
||||
import type { APIUser } from '../../user.ts';
|
||||
@@ -7,7 +8,6 @@ import type {
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
|
||||
@@ -1,8 +1,3 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { APIPartialChannel } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIBaseInteraction } from './base.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type {
|
||||
APIApplicationCommandOption,
|
||||
APIChatInputApplicationCommandDMInteraction,
|
||||
@@ -16,6 +11,11 @@ import type {
|
||||
APIContextMenuInteraction,
|
||||
APIContextMenuInteractionData,
|
||||
} from './_applicationCommands/contextMenu.ts';
|
||||
import type { APIBaseInteraction } from './base.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { APIPartialChannel } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
|
||||
export * from './_applicationCommands/chatInput.ts';
|
||||
export * from './_applicationCommands/contextMenu.ts';
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { LocaleString } from '../../../v8.ts';
|
||||
import type { APIMessage } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
|
||||
import type { ComponentType } from '../channel.ts';
|
||||
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v8.ts';
|
||||
import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts';
|
||||
import type { MessageFlags } from '../mod.ts';
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
|
||||
|
||||
@@ -2,9 +2,10 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/application
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APITeam } from './teams.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object
|
||||
@@ -94,6 +95,23 @@ export interface APIApplication {
|
||||
* See https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
flags: ApplicationFlags;
|
||||
/**
|
||||
* Up to 5 tags describing the content and functionality of the application
|
||||
*/
|
||||
tags?: [string, string?, string?, string?, string?];
|
||||
/**
|
||||
* Settings for the application's default in-app authorization link, if enabled
|
||||
*/
|
||||
install_params?: APIApplicationInstallParams;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
custom_install_url?: string;
|
||||
}
|
||||
|
||||
export interface APIApplicationInstallParams {
|
||||
scopes: OAuth2Scopes[];
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/audit-log
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIOverwrite } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
@@ -22,6 +21,7 @@ import type { StageInstancePrivacyLevel } from './stageInstance.ts';
|
||||
import type { StickerFormatType } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIWebhook } from './webhook.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/channel
|
||||
*/
|
||||
|
||||
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';
|
||||
@@ -10,6 +9,7 @@ import type { APIMessageInteraction } from './interactions.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APISticker, APIStickerItem } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/emoji
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* Not documented but mentioned
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIEmoji } from './emoji.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/guild
|
||||
*/
|
||||
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { APIChannel } from './channel.ts';
|
||||
import type { APIEmoji } from './emoji.ts';
|
||||
import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway.ts';
|
||||
@@ -12,6 +11,7 @@ import type { APIStageInstance } from './stageInstance.ts';
|
||||
import type { APISticker } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { GatewayVoiceState } from './voice.ts';
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -448,6 +448,10 @@ export enum GuildSystemChannelFlags {
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export enum GuildFeature {
|
||||
/**
|
||||
* Guild has access to set an animated guild banner image
|
||||
*/
|
||||
AnimatedBanner = 'ANIMATED_BANNER',
|
||||
/**
|
||||
* Guild has access to set an animated guild icon
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#stage-instance-object
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/sticker
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Types extracted from https://discord.com/developers/docs/topics/teams
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-object
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/template
|
||||
*/
|
||||
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v8/mod.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#template-object
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/user
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIGuildIntegration } from './guild.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object
|
||||
@@ -145,8 +145,16 @@ export enum UserFlags {
|
||||
BotHTTPInteractions = 1 << 19,
|
||||
/**
|
||||
* User has been identified as spammer
|
||||
*
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
Spammer = 1 << 20,
|
||||
/**
|
||||
* User's account has been quarantined based on recent activity
|
||||
*
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
Quarantined = Math.pow(2, 44),
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/voice
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/webhook
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIPartialChannel, APIPartialGuild, APIUser } from './mod.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#webhook-object
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
export type APIApplicationCommandAttachmentOption =
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import type { LocalizationMap } from '../../../../../v9.ts';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { LocalizationMap } from '../../../../../v9.ts';
|
||||
|
||||
export interface APIApplicationCommandOptionBase<Type extends ApplicationCommandOptionType> {
|
||||
type: Type;
|
||||
name: string;
|
||||
name_localizations?: LocalizationMap;
|
||||
name_localizations?: LocalizationMap | null;
|
||||
description: string;
|
||||
description_localizations?: LocalizationMap;
|
||||
description_localizations?: LocalizationMap | null;
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { ChannelType } from '../../../channel.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { ChannelType } from '../../../channel.ts';
|
||||
|
||||
export interface APIApplicationCommandChannelOption
|
||||
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {
|
||||
|
||||
@@ -12,7 +12,7 @@ interface APIApplicationCommandIntegerOptionBase
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
export type APIApplicationCommandMentionableOption =
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Mentionable>;
|
||||
|
||||
@@ -12,7 +12,7 @@ interface APIApplicationCommandNumberOptionBase
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
export type APIApplicationCommandRoleOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Role>;
|
||||
|
||||
|
||||
@@ -22,6 +22,6 @@ export enum ApplicationCommandOptionType {
|
||||
*/
|
||||
export interface APIApplicationCommandOptionChoice<ValueType = string | number> {
|
||||
name: string;
|
||||
name_localizations?: LocalizationMap;
|
||||
name_localizations?: LocalizationMap | null;
|
||||
value: ValueType;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,20 @@ import type {
|
||||
} from './base.ts';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
interface APIApplicationCommandStringOptionBase
|
||||
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.String> {
|
||||
/**
|
||||
* For option type `STRING`, the minimum allowed length (minimum of `0`, maximum of `6000`).
|
||||
*/
|
||||
min_length?: number;
|
||||
/**
|
||||
* For option type `STRING`, the maximum allowed length (minimum of `1`, maximum of `6000`).
|
||||
*/
|
||||
max_length?: number;
|
||||
}
|
||||
|
||||
export type APIApplicationCommandStringOption = APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.String>,
|
||||
APIApplicationCommandStringOptionBase,
|
||||
APIApplicationCommandOptionChoice<string>
|
||||
>;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
|
||||
import type { APIApplicationCommandOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
|
||||
|
||||
export interface APIApplicationCommandSubcommandOption
|
||||
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Subcommand> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
export type APIApplicationCommandUserOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.User>;
|
||||
|
||||
|
||||
@@ -1,13 +1,3 @@
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionWrapper,
|
||||
APIInteractionDataResolvedChannel,
|
||||
APIInteractionDataResolvedGuildMember,
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type {
|
||||
APIApplicationCommandAttachmentOption,
|
||||
APIApplicationCommandInteractionDataAttachmentOption,
|
||||
@@ -52,8 +42,19 @@ import type {
|
||||
APIApplicationCommandInteractionDataUserOption,
|
||||
APIApplicationCommandUserOption,
|
||||
} from './_chatInput/user.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionWrapper,
|
||||
APIInteractionDataResolvedChannel,
|
||||
APIInteractionDataResolvedGuildMember,
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
|
||||
export * from './_chatInput/attachment.ts';
|
||||
export * from './_chatInput/base.ts';
|
||||
export * from './_chatInput/boolean.ts';
|
||||
export * from './_chatInput/channel.ts';
|
||||
export * from './_chatInput/integer.ts';
|
||||
@@ -108,7 +109,7 @@ export type APIApplicationCommandInteractionDataBasicOption =
|
||||
| APIApplicationCommandInteractionDataAttachmentOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIChatInputApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIMessage } from '../../channel.ts';
|
||||
import type { APIUser } from '../../user.ts';
|
||||
@@ -7,10 +8,9 @@ import type {
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIUserApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.User> {
|
||||
@@ -27,7 +27,7 @@ export interface APIUserApplicationCommandInteractionDataResolved {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIMessageApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.Message> {
|
||||
@@ -43,7 +43,7 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export type APIContextMenuInteractionData =
|
||||
| APIUserApplicationCommandInteractionData
|
||||
|
||||
@@ -5,4 +5,5 @@ export interface APIBaseApplicationCommandInteractionData<Type extends Applicati
|
||||
id: Snowflake;
|
||||
type: Type;
|
||||
name: string;
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { Snowflake } from '../../../../globals.ts';
|
||||
*/
|
||||
export interface APIGuildApplicationCommandPermissions {
|
||||
/**
|
||||
* The id of the command
|
||||
* The id of the command or the application id if that permission applies to all commands
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
@@ -27,11 +27,11 @@ export interface APIGuildApplicationCommandPermissions {
|
||||
*/
|
||||
export interface APIApplicationCommandPermission {
|
||||
/**
|
||||
* The id of the role or user
|
||||
* The id of the role, user or channel. Can also be a permission constant
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Role or user
|
||||
* Role, user or channel
|
||||
*/
|
||||
type: ApplicationCommandPermissionType;
|
||||
/**
|
||||
@@ -46,4 +46,13 @@ export interface APIApplicationCommandPermission {
|
||||
export enum ApplicationCommandPermissionType {
|
||||
Role = 1,
|
||||
User,
|
||||
Channel,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-constants
|
||||
*/
|
||||
export const APIApplicationCommandPermissionsConstant = {
|
||||
Everyone: (guildId: string | bigint): Snowflake => String(guildId),
|
||||
AllChannels: (guildId: string | bigint): Snowflake => String(BigInt(guildId) - 1n),
|
||||
};
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { LocalizationMap } from '../../../v9.ts';
|
||||
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIBaseInteraction } from './base.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type {
|
||||
APIApplicationCommandOption,
|
||||
APIChatInputApplicationCommandDMInteraction,
|
||||
@@ -17,6 +11,12 @@ import type {
|
||||
APIContextMenuInteraction,
|
||||
APIContextMenuInteractionData,
|
||||
} from './_applicationCommands/contextMenu.ts';
|
||||
import type { APIBaseInteraction } from './base.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { LocalizationMap } from '../../../v9.ts';
|
||||
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
|
||||
export * from './_applicationCommands/chatInput.ts';
|
||||
export * from './_applicationCommands/contextMenu.ts';
|
||||
@@ -43,13 +43,17 @@ export interface APIApplicationCommand {
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* 1-32 character name; `CHAT_INPUT` command names must be all lowercase matching `^[\w-]{1,32}$`
|
||||
* 1-32 character name; `CHAT_INPUT` command names must be all lowercase matching `^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$`
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Localization dictionary for the name field. Values follow the same restrictions as name
|
||||
*/
|
||||
name_localizations?: LocalizationMap;
|
||||
name_localizations?: LocalizationMap | null;
|
||||
/**
|
||||
* The localized name
|
||||
*/
|
||||
name_localized?: string;
|
||||
/**
|
||||
* 1-100 character description for `CHAT_INPUT` commands, empty string for `USER` and `MESSAGE` commands
|
||||
*/
|
||||
@@ -57,15 +61,28 @@ export interface APIApplicationCommand {
|
||||
/**
|
||||
* Localization dictionary for the description field. Values follow the same restrictions as description
|
||||
*/
|
||||
description_localizations?: LocalizationMap;
|
||||
description_localizations?: LocalizationMap | null;
|
||||
/**
|
||||
* The localized description
|
||||
*/
|
||||
description_localized?: string;
|
||||
/**
|
||||
* The parameters for the `CHAT_INPUT` command, max 25
|
||||
*/
|
||||
options?: APIApplicationCommandOption[];
|
||||
/**
|
||||
* Set of permissions represented as a bitset
|
||||
*/
|
||||
default_member_permissions: Permissions | null;
|
||||
/**
|
||||
* Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible
|
||||
*/
|
||||
dm_permission?: boolean;
|
||||
/**
|
||||
* Whether the command is enabled by default when the app is added to a guild
|
||||
*
|
||||
* If missing, this property should be assumed as `true`
|
||||
* @deprecated Use `dm_permission` and/or `default_member_permissions` instead
|
||||
*/
|
||||
default_permission?: boolean;
|
||||
/**
|
||||
@@ -84,7 +101,7 @@ export enum ApplicationCommandType {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export type APIApplicationCommandInteractionData =
|
||||
| APIChatInputApplicationCommandInteractionData
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { LocaleString } from '../../../v9.ts';
|
||||
import type { APIMessage } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
|
||||
export type PartialAPIMessageInteractionGuildMember = Pick<
|
||||
APIGuildMember,
|
||||
@@ -31,7 +31,7 @@ export interface APIMessageInteraction {
|
||||
*/
|
||||
type: InteractionType;
|
||||
/**
|
||||
* The name of the ApplicationCommand
|
||||
* The name of the application command, including subcommands and subcommand groups
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
@@ -104,6 +104,10 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
* For components, the message they were attached to
|
||||
*/
|
||||
message?: APIMessage;
|
||||
/**
|
||||
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
|
||||
*/
|
||||
app_permissions?: Permissions;
|
||||
/**
|
||||
* The selected language of the invoking user
|
||||
*/
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
|
||||
import type { ComponentType } from '../channel.ts';
|
||||
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
|
||||
|
||||
export type APIMessageComponentInteraction = APIBaseInteraction<
|
||||
InteractionType.MessageComponent,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v9.ts';
|
||||
import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts';
|
||||
import type { MessageFlags } from '../mod.ts';
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user