Compare commits

...

81 Commits

Author SHA1 Message Date
github-actions[bot]
3644b70e2e chore(release): 0.36.2 🎉 (#528)
Build ran for 4af2ea9141

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-07-14 15:32:42 +03:00
Vitor
4af2ea9141 feat(RESTPutAPIApplicationGuildCommandsJSONBody): add missing id (#522) 2022-07-13 23:42:14 +03:00
Almeida
f2c3451c2a feat(RESTJSONErrorCodes): add error 30032 (#521) 2022-07-13 20:52:11 +03:00
Parbez
d503c71252 docs: mark the maximum allowed length for string option types (#514) 2022-07-07 19:31:20 +03:00
Superchupu
e253a4ac87 chore: resolve ci error (#518) 2022-07-05 22:33:13 +03:00
Superchupu
84226e402a docs: update discord channel name (#517) 2022-07-05 18:16:44 +03:00
github-actions[bot]
2e84efb9b8 chore(release): 0.36.1 🎉 (#516)
Build ran for df1527c4bb

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-07-04 16:15:13 +03:00
MateoDeveloper
df1527c4bb docs(APIApplicationCommandOption): number and integer typos in max_value field description (#515) 2022-07-03 22:16:10 +00:00
MateoDeveloper
2cade98ed0 feat(APIApplicationCommandStringOption): add min_length and max_length (#513) 2022-07-02 13:54:15 +03:00
Vitor
d3535d6db1 docs(APIMessageInteraction): name now includes more info (#511) 2022-07-02 02:40:00 +03:00
github-actions[bot]
2f2d4ae3fa chore(release): 0.36.0 🎉 (#510)
Build ran for 0c65d40af0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-30 15:26:23 +03:00
Vitor
0c65d40af0 feat(APIBaseInteraction): add app_permissions (#509) 2022-06-29 21:17:57 +03:00
advaith
12072b70a0 feat(MessageType): update names (#498)
BREAKING CHANGE: The following message types have been renamed:
- `GuildMemberJoin` -> `UserJoin`
- `UserPremiumGuildSubscription` -> `GuildBoost`
- `UserPremiumGuildSubscriptionTier1` -> `GuildBoostTier1`
- `UserPremiumGuildSubscriptionTier2` -> `GuildBoostTier2`
- `UserPremiumGuildSubscriptionTier3` -> `GuildBoostTier3`
2022-06-27 23:55:04 +03:00
Suneet Tipirneni
34908aa4ce feat(RESTJSONErrorCodes): add error 20024 (#480) 2022-06-27 23:36:00 +03:00
github-actions[bot]
b2eeb3f27b chore(release): 0.35.0 🎉 (#503)
Build ran for fc3aa1c911

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-23 21:16:21 +03:00
MateoDeveloper
fc3aa1c911 feat(UserFlags): add Quarantined flag (#495)
* feat(UserFlags): add Quarantined flag

* fix: change to Math.pow()

* chore: add @unstable

* fix: improvements to @unstable

* fix: description errors
2022-06-21 13:33:33 +03:00
Vitor
06098869d5 feat(REST): add CDNRoutes (#502) 2022-06-21 01:48:46 +03:00
MateoDeveloper
a2d76fc7ca chore(UserFlags): add @unstable to Spammer flag (#500) 2022-06-21 01:46:38 +03:00
n1ck_pro
56d491fa68 feat(APIEmbedVideo): add missing proxy_url property (#496) 2022-06-18 21:46:11 +03:00
Almeida
3b10c60faa refactor(GatewayIdentifyProperties): remove $ prefix from keys (#493)
BREAKING CHANGE: The fields for identify no longer use the `$` prefix for the values.
2022-06-17 22:41:12 +03:00
github-actions[bot]
c6e320bd22 chore(release): 0.34.0 🎉 (#492)
Build ran for f49546c780

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-13 16:15:34 +02:00
Vlad Frangu
f49546c780 chore: more website fixes (#490) 2022-06-13 10:16:01 +03:00
Vlad Frangu
63959ef2aa chore: fix ci for publishing new versions (#488) 2022-06-12 15:07:15 +03:00
Vlad Frangu
f72fbc93f6 docs: lazy load JetBrains mono font (#486) 2022-06-10 21:43:17 +03:00
Vlad Frangu
d83dadca17 docs: fix some grammar mistakes (#485) 2022-06-10 21:43:05 +03:00
Vitor
0bb2204b5d refactor: separate MESSAGE_CREATE fields from APIMessage object (#434)
BREAKING CHANGE: Certain fields that come only through the gateway are now correctly typed as such
2022-06-08 22:24:24 +03:00
Almeida
292c6b58ee feat: add guild mfa endpoint and error 50017 (#476) 2022-06-08 22:18:18 +03:00
Vitor
63ca86afbd docs(RESTPatchAPIChannelJSONBody): voice channels can be set as nsfw (#474) 2022-06-08 21:54:54 +03:00
Vitor
20653b3481 feat(RESTJSONErrorCodes): add 220003 error (#466) 2022-06-08 21:44:07 +03:00
Vlad Frangu
7bef64df76 chore: update vercel links (#484) 2022-06-08 20:36:09 +02:00
Vlad Frangu
6477c1e5d8 chore: showcase website in package.json (#482) 2022-06-08 01:44:23 +03:00
github-actions[bot]
e957695400 chore(release): 0.33.5 🎉 (#481)
Build ran for d8543177cd

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-07 12:42:27 +02:00
Almeida
d8543177cd feat(RESTJSONErrorCodes): add error 30052 (#469) 2022-06-07 01:55:57 +03:00
Vlad Frangu
cb663096a5 chore: make website build again -.- (#478)
Thanks Docusaurus!!
2022-06-06 18:57:02 +03:00
A. Román
eff8892b03 fix(RESTPostAPIWebhookWithTokenJSONBody): thread_name should be optional (#479) 2022-06-06 18:56:48 +03:00
DD
d268e0bff7 fix(GatewayGuildCreateDispatch): add missing GatewayGuildCreateDispatch (#477) 2022-06-06 17:04:20 +03:00
github-actions[bot]
7b1e5a70e5 chore(release): 0.33.4 🎉 (#475)
Build ran for 8e5f07e2ee

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-06 14:38:21 +02:00
Vitor
8e5f07e2ee feat(RESTPostAPIWebhookWithTokenJSONBody): add thread_name (#463)
* feat(RESTPostAPIWebhookWithTokenJSONBody): add `thread_name`

* docs: update from upstream

* docs: make it clear
2022-06-04 17:52:22 +03:00
github-actions[bot]
1c6ea86110 chore(release): 0.33.3 🎉 (#472)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-04 15:22:11 +02:00
DD
43c372d817 fix(AddUndefinedToPossiblyUndefinedProperties): recurse down objects (#471) 2022-06-04 16:14:01 +03:00
Vlad Frangu
9f386cb874 docs: fix typo (#468) 2022-06-03 12:30:37 +03:00
Vlad Frangu
019b9de1e8 docs: fix line highlighting for contributing guide (#467) 2022-06-03 11:54:19 +03:00
github-actions[bot]
6340f64fbc chore(release): 0.33.2 🎉 (#465)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2022-06-02 02:41:01 +03:00
Vlad Frangu
895083b8ab chore(Changelog): show who created the pull request that was merged (#329)
* feat: say who submitted the PR that was merged

* fix: actually make the changelog generation work

* chore: cleanup

* chore: safety

* fix: fetch PRs in a better way, and replace usernames with diff casings correctly

* fix: only fetch PRs if GITHUB_TOKEN is in the env

* fix: add github token to branch creation

* fix: actually patch the module on install

* chore: cleanup some more of the PR

* chore: make the script more agnostic

* chore: cleanup package-lock

* chore: use split instead for more readable code
2022-06-02 02:33:55 +03:00
Vlad Frangu
93eb3d3af6 chore(docs): write contributing guide (#464) 2022-06-02 02:14:48 +03:00
Vlad Frangu
7da033bc5b chore(docs): cleanup patches, update typedoc (#462) 2022-05-31 16:35:50 +03:00
Suneet Tipirneni
6a813be833 fix(RestPostAPIBaseApplicationJSONBody): make default_member_permissions optional (#460) 2022-05-31 02:25:01 +03:00
Vlad Frangu
b3736d8012 chore(docs): minify api-typedoc generated json (#461) 2022-05-31 02:16:29 +03:00
Suneet Tipirneni
15fcd1b2a8 fix(GatewayGuildCreateDispatch): add extra fields that were missing (#458) 2022-05-30 09:33:15 +03:00
Suneet Tipirneni
51e664d8e8 fix(docs-site): website link colors (#457) 2022-05-30 02:18:39 +03:00
Suneet Tipirneni
db99388267 chore: make navbar consistent with djs site (#452)
Co-authored-by: advaith <advaithj1@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2022-05-27 13:46:45 +03:00
Almeida
85802f1703 fix(APIApplicationCommand): dm_permission is not nullable and default_member_permissions is required (#454) 2022-05-27 12:36:34 +02:00
github-actions[bot]
4083a32340 chore(release): 0.33.1 🎉 (#451)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-05-26 14:26:26 +02:00
Vlad Frangu
5108d3dcca chore: some requested/suggested changes (#450) 2022-05-26 05:21:57 +02:00
Superchupu
6da0503a9f chore: use correct npm capitalization (#449) 2022-05-25 22:11:58 +03:00
Vitor
8a5fb2cdf2 docs: clarify that permissions can apply on application-level (#448) 2022-05-25 20:21:45 +03:00
Almeida
5ef49f41ce feat(RESTJSONErrorCodes): add error 50600 (#444) 2022-05-25 20:08:30 +03:00
Vlad Frangu
6d85ad6b1d fix(RESTPostAPIApplicationGuildCommands): correct types due to unions (#447) 2022-05-25 12:43:09 +03:00
Vlad Frangu
ca1110a1ae chore: website fixes (#446) 2022-05-25 09:58:30 +02:00
Suneet Tipirneni
748db34e30 feat(RESTPostAPIGuildChannels): update post body fields (#419)
* chore(guildChannel): update post body fields

* chore: add missing field
2022-05-25 09:22:51 +03:00
Superchupu
dc1c887821 chore: fix docs typo (#445) 2022-05-25 02:13:59 +03:00
dependabot[bot]
a088bb4f77 chore(deps): bump ejs from 3.1.6 to 3.1.8 in /website (#443)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Vlad <kingdgrizzle@gmail.com>
2022-05-25 00:30:42 +03:00
dependabot[bot]
f1cc0ab163 chore(deps): bump ansi-regex from 3.0.0 to 3.0.1 in /website (#442)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-25 00:29:11 +03:00
Vlad Frangu
c8ba0c9319 chore: docs site (#405) 2022-05-25 00:23:55 +03:00
github-actions[bot]
927c738162 chore(release): 0.33.0 🎉 (#439)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-05-16 14:29:43 +02:00
Splatterxl
1afce87fbe feat(rest): add missing guild routes results (#438) 2022-05-14 01:36:46 +03:00
Vitor Lopes
a0ff4f3905 refactor: add support for API v10 (#437) 2022-05-13 16:57:03 +03:00
Vitor Lopes
17f5caa671 refactor: separate GUILD_CREATE fields from APIGuild object (#423)
BREAKING CHANGE: 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
2022-05-13 16:27:00 +03:00
Suneet Tipirneni
d3163ca22e feat: add support for application command permissions v2 (#415) 2022-05-13 02:38:59 +03:00
Vitor Lopes
1737adea1f refactor(GuildFeature): thread archive durations are no longer boost locked (#412)
BREAKING CHANGE: `SevenDayThreadArchive` and `ThreeDayThreadArchive` have been removed as they are no longer valid
2022-05-13 00:43:04 +03:00
Vitor Lopes
8f16f452ac feat(OAuth2Scopes): add new OAuth2 scopes (#435)
* feat(OAuth2Scopes): add new OAuth2 scopes

* docs: scopes require Discord approval
2022-05-11 01:04:45 +03:00
github-actions[bot]
c9c733d1c2 chore(release): 0.32.1 🎉 (#422)
Build ran for d331e0dff3

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-05-05 14:29:00 +02:00
advaith
d331e0dff3 chore(ActivityPlatform): update platform enum and mark it as unstable (#404)
* chore(ActivityPlatform): update platform enum

* chore: descs and @unstable
2022-04-30 00:20:00 +03:00
Vitor Lopes
a28c824f82 feat(RESTPostAPIGuildForumThreads): add message field (#416)
* refactor(GuildFeature): remove seven & three day thread archive

* refactor(RESTPostAPIGuildForumThreadsJSONBody): add `message` field

* chore: branch issues fix

* fix: unnecessary type & correct `message` type

* fix: use json body instead of form data

* feat: update also form data

* fix: revert order & `message` type
2022-04-29 23:37:22 +03:00
Vitor Lopes
43cfbcba28 feat(RESTJSONErrorCodes): add error 50080 (#408) 2022-04-29 23:30:09 +03:00
github-actions[bot]
b0a4f12391 chore(release): 0.32.0 🎉 (#410)
Build ran for 3fe53ced9f

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-25 16:20:00 +02:00
Khafra
3fe53ced9f fix: add position property to create channel options (#409) 2022-04-24 17:10:25 +03:00
Vitor Lopes
1212eb933e refactor(APIGuildIntegration): make enabled optional (#406)
BREAKING CHANGE: `enabled` is now properly marked as optional
2022-04-20 18:50:08 +03:00
github-actions[bot]
1cd9b53ea8 chore(release): 0.31.2 🎉 (#403)
Build ran for 4cbb5fa894

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-18 15:47:08 +02:00
Vitor Lopes
4cbb5fa894 docs: fix links from DDevs portal (#402) 2022-04-17 15:54:28 +03:00
Suneet Tipirneni
6a192b132c feat(RESTPostAPIGuildChannelJSONBody): add default_auto_archive prop (#400) 2022-04-15 22:26:06 +03:00
249 changed files with 41600 additions and 1298 deletions

2
.github/labeler.yml vendored
View File

@@ -20,6 +20,8 @@ ci:
dependencies:
- package.json
- package-lock.json
- website/package.json
- website/package-lock.json
'topic:deno':
- scripts/deno.mjs

22
.github/problemMatchers/eslint.json vendored Normal file
View 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
View 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
}
]
}
]
}

View File

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

View File

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

View File

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

View File

@@ -5,5 +5,6 @@
"source.organizeImports": false,
"source.fixAll": true,
"source.fixAll.eslint": true
}
},
"cSpell.enableFiletypes": ["mdx"]
}

View File

@@ -1,3 +1,152 @@
## [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

View File

@@ -1,11 +1,14 @@
# Discord API Types
[![discord-api-types](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/svgs/logo_long_blurple.svg)](https://github.com/discordjs/discord-api-types)
[![GitHub](https://img.shields.io/github/license/discordjs/discord-api-types)](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
[![npm](https://img.shields.io/npm/v/discord-api-types?color=crimson&logo=npm)](https://www.npmjs.com/package/discord-api-types)
[![deno](https://img.shields.io/npm/v/discord-api-types?color=blue&label=deno&logo=deno)](https://deno.land/x/discord_api_types)
[![Patreon Donate](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Donate%20with%20Patreon&logo=patreon&colorB=F96854&link=https://www.patreon.com/vladfrangu)](https://www.patreon.com/vladfrangu)
[![Ko-fi Donate](https://img.shields.io/badge/kofi-donate-brightgreen.svg?label=Donate%20with%20Ko-fi&logo=ko-fi&colorB=F16061&link=https://ko-fi.com/wolfgalvlad&logoColor=FFFFFF)](https://ko-fi.com/wolfgalvlad)
[![GitHub Sponsors](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Sponsor%20through%20GitHub&logo=github&colorB=F96854&link=https://github.com/sponsors/vladfrangu)](https://github.com/sponsors/vladfrangu)
[![Powered by Vercel](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/powered-by-vercel.svg)](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.

View File

@@ -1,3 +1,152 @@
## [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

View File

@@ -1,11 +1,14 @@
# Discord API Types
[![discord-api-types](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/svgs/logo_long_blurple.svg)](https://github.com/discordjs/discord-api-types)
[![GitHub](https://img.shields.io/github/license/discordjs/discord-api-types)](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
[![npm](https://img.shields.io/npm/v/discord-api-types?color=crimson&logo=npm)](https://www.npmjs.com/package/discord-api-types)
[![deno](https://img.shields.io/npm/v/discord-api-types?color=blue&label=deno&logo=deno)](https://deno.land/x/discord_api_types)
[![Patreon Donate](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Donate%20with%20Patreon&logo=patreon&colorB=F96854&link=https://www.patreon.com/vladfrangu)](https://www.patreon.com/vladfrangu)
[![Ko-fi Donate](https://img.shields.io/badge/kofi-donate-brightgreen.svg?label=Donate%20with%20Ko-fi&logo=ko-fi&colorB=F16061&link=https://ko-fi.com/wolfgalvlad&logoColor=FFFFFF)](https://ko-fi.com/wolfgalvlad)
[![GitHub Sponsors](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Sponsor%20through%20GitHub&logo=github&colorB=F96854&link=https://github.com/sponsors/vladfrangu)](https://github.com/sponsors/vladfrangu)
[![Powered by Vercel](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/powered-by-vercel.svg)](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.

View File

@@ -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
@@ -500,15 +503,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 +514,88 @@ 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;
/**
* 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
@@ -1051,7 +1125,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 +1138,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 +1602,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;
}
/**

View File

@@ -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
@@ -498,16 +501,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 +513,88 @@ 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;
/**
* 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
@@ -1050,7 +1124,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 +1137,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 +1601,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;
}
/**

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -70,10 +70,19 @@ export interface APIApplicationCommand {
* 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;
/**

View File

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

View File

@@ -53,6 +53,12 @@ export interface APIApplication {
* See https://discord.com/developers/docs/resources/user#user-object
*/
owner?: APIUser;
/**
* An empty string
*
* @deprecated This field will be removed in v11
*/
summary: string;
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*

View File

@@ -16,6 +16,7 @@ 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';
@@ -27,6 +28,12 @@ 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,
}
/**
@@ -517,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
*/

View File

@@ -4,7 +4,6 @@
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';
@@ -326,10 +325,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)
*
@@ -339,15 +334,6 @@ 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
*/
@@ -377,7 +363,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
*
@@ -454,7 +440,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;
/**
@@ -517,11 +503,11 @@ export enum MessageType {
ChannelNameChange,
ChannelIconChange,
ChannelPinnedMessage,
GuildMemberJoin,
UserPremiumGuildSubscription,
UserPremiumGuildSubscriptionTier1,
UserPremiumGuildSubscriptionTier2,
UserPremiumGuildSubscriptionTier3,
UserJoin,
GuildBoost,
GuildBoostTier1,
GuildBoostTier2,
GuildBoostTier3,
ChannelFollowAdd,
GuildDiscoveryDisqualified = 14,
GuildDiscoveryRequalified,
@@ -554,7 +540,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 {
/**
@@ -770,10 +756,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;
}
/**
@@ -921,6 +903,10 @@ export interface APIEmbedVideo {
* Source url of video
*/
url?: string;
/**
* A proxied url of the video
*/
proxy_url?: string;
/**
* Height of video
*/

View File

@@ -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',
}
/**

View File

@@ -2,15 +2,11 @@
* Types extracted from https://discord.com/developers/docs/resources/guild
*/
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';
/**
@@ -196,64 +192,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)
*/
@@ -320,14 +258,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
*
@@ -338,14 +268,6 @@ export interface APIGuild extends APIPartialGuild {
* Whether the guild has the boost progress bar enabled.
*/
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
*/
guild_scheduled_events?: APIGuildScheduledEvent[];
/**
* The type of Student Hub the guild is
*/
@@ -536,14 +458,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
*/
@@ -715,7 +629,7 @@ export interface APIGuildIntegration {
/**
* Is this integration enabled
*/
enabled: boolean;
enabled?: boolean;
/**
* Is this integration syncing
*

View File

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

View File

@@ -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),
}
/**

View File

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

View File

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

View File

@@ -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),
}
/**

View File

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

View File

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

View File

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

View File

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

View File

@@ -70,10 +70,19 @@ export interface APIApplicationCommand {
* 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;
/**

View File

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

View File

@@ -53,6 +53,12 @@ export interface APIApplication {
* See https://discord.com/developers/docs/resources/user#user-object
*/
owner?: APIUser;
/**
* An empty string
*
* @deprecated This field will be removed in v11
*/
summary: string;
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*

View File

@@ -16,6 +16,7 @@ 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';
@@ -27,6 +28,12 @@ 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,
}
/**
@@ -517,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
*/

View File

@@ -4,7 +4,6 @@
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';
@@ -326,10 +325,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)
*
@@ -339,15 +334,6 @@ 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
*/
@@ -377,7 +363,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
*
@@ -454,7 +440,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;
/**
@@ -517,11 +503,11 @@ export enum MessageType {
ChannelNameChange,
ChannelIconChange,
ChannelPinnedMessage,
GuildMemberJoin,
UserPremiumGuildSubscription,
UserPremiumGuildSubscriptionTier1,
UserPremiumGuildSubscriptionTier2,
UserPremiumGuildSubscriptionTier3,
UserJoin,
GuildBoost,
GuildBoostTier1,
GuildBoostTier2,
GuildBoostTier3,
ChannelFollowAdd,
GuildDiscoveryDisqualified = 14,
GuildDiscoveryRequalified,
@@ -554,7 +540,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 {
/**
@@ -921,6 +907,10 @@ export interface APIEmbedVideo {
* Source url of video
*/
url?: string;
/**
* A proxied url of the video
*/
proxy_url?: string;
/**
* Height of video
*/

View File

@@ -152,7 +152,10 @@ export interface GatewayActivity {
*/
timestamps?: GatewayActivityTimestamps;
sync_id?: string;
platform?: ActivityPlatform;
/**
* {@link ActivityPlatform}
*/
platform?: string;
/**
* Application id for the game
*/
@@ -208,10 +211,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',
}
/**

View File

@@ -2,15 +2,11 @@
* Types extracted from https://discord.com/developers/docs/resources/guild
*/
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';
/**
@@ -196,64 +192,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)
*/
@@ -320,14 +258,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
*
@@ -338,14 +268,6 @@ export interface APIGuild extends APIPartialGuild {
* Whether the guild has the boost progress bar enabled.
*/
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
*/
guild_scheduled_events?: APIGuildScheduledEvent[];
/**
* The type of Student Hub the guild is
*/
@@ -536,14 +458,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
*/
@@ -715,7 +629,7 @@ export interface APIGuildIntegration {
/**
* Is this integration enabled
*/
enabled: boolean;
enabled?: boolean;
/**
* Is this integration syncing
*

View File

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

View File

@@ -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),
}
/**

View File

@@ -70,6 +70,8 @@ export enum RESTJSONErrorCodes {
AnnouncementEditLimitExceeded = 20022,
UnderMinimumAge = 20024,
ChannelSendRateLimit = 20028,
ServerSendRateLimit,
@@ -99,8 +101,8 @@ export enum RESTJSONErrorCodes {
MaximumNumberOfServerCategoriesReached = 30030,
GuildAlreadyHasTemplate = 30031,
MaximumThreadParticipants = 30033,
MaximumNumberOfApplicationCommandsReached,
MaximumThreadParticipants,
MaximumNumberOfNonGuildMemberBansHasBeenExceeded = 30035,
@@ -116,6 +118,8 @@ export enum RESTJSONErrorCodes {
MaximumNumberOfPinnedThreadsInForumHasBeenReached,
MaximumNumberOfTagsInForumHasBeenReached,
BitrateIsTooHighForChannelOfThisType = 30052,
Unauthorized = 40001,
VerifyYourAccount,
OpeningDirectMessagesTooFast,
@@ -148,6 +152,7 @@ export enum RESTJSONErrorCodes {
InvalidToken,
NoteWasTooLong,
ProvidedTooFewOrTooManyMessagesToDelete,
InvalidMFALevel,
MessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019,
InviteCodeInvalidOrTaken,
@@ -179,7 +184,8 @@ export enum RESTJSONErrorCodes {
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
InvalidStickerSent = 50081,
CannotEditStickersWithinMessage = 50080,
InvalidStickerSent,
InvalidActionOnArchivedThread = 50083,
InvalidThreadNotificationSettings,
@@ -194,6 +200,8 @@ export enum RESTJSONErrorCodes {
RequestBodyContainsInvalidJSON = 50109,
YouDoNotHavePermissionToSendThisSticker = 50600,
TwoFactorAuthenticationIsRequired = 60003,
NoUsersWithDiscordTagExist = 80004,
@@ -222,8 +230,13 @@ export enum RESTJSONErrorCodes {
CannotUpdateAFinishedEvent = 180000,
FailedToCreateStageNeededForStageEvent = 180002,
WebhooksCanOnlyCreateThreadsInForumChannels = 220003,
}
/**
* https://discord.com/developers/docs/reference#locales
*/
export enum Locale {
EnglishUS = 'en-US',
EnglishGB = 'en-GB',

View File

@@ -64,7 +64,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
/**
* Whether the channel is nsfw
*
* Channel types: text, news
* Channel types: text, voice, news
*/
nsfw?: boolean | null;
/**
@@ -96,7 +96,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
/**
* ID of the new parent category for a channel
*
* Channel types: text, news, voice
* Channel types: text, voice, news
*/
parent_id?: Snowflake | null;
/**
@@ -188,7 +188,7 @@ export type RESTGetAPIChannelMessagesResult = APIMessage[];
export type RESTGetAPIChannelMessageResult = APIMessage;
/**
* 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 type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
Required<Pick<APIMessageReference, 'message_id'>> &
@@ -232,7 +232,7 @@ export type RESTPostAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedP
/**
* Include to make your message a reply
*
* 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?: APIMessageReferenceSend;
/**
@@ -528,12 +528,12 @@ export type RESTPostAPIChannelTypingResult = never;
export type RESTGetAPIChannelPinsResult = APIMessage[];
/**
* https://discord.com/developers/docs/resources/channel#add-pinned-channel-message
* https://discord.com/developers/docs/resources/channel#pin-message
*/
export type RESTPutAPIChannelPinResult = never;
/**
* https://discord.com/developers/docs/resources/channel#delete-pinned-channel-message
* https://discord.com/developers/docs/resources/channel#unpin-message
*/
export type RESTDeleteAPIChannelPinResult = never;
@@ -562,7 +562,7 @@ export type RESTPutAPIChannelRecipientResult = unknown;
export type RESTDeleteAPIChannelRecipientResult = unknown;
/**
* https://discord.com/developers/docs/resources/channel#start-thread-with-message
* https://discord.com/developers/docs/resources/channel#start-thread-from-message
*/
export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
@@ -584,16 +584,25 @@ export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUn
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
*/
export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody &
RESTPostAPIChannelMessageJSONBody;
export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & {
/**
* First message in the forum thread
*/
message: RESTPostAPIChannelMessageJSONBody;
};
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
*/
export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessageFormDataBody;
export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & {
/**
* First message in the forum thread
*/
message: string;
};
/**
* https://discord.com/developers/docs/resources/channel#start-thread-with-message
* https://discord.com/developers/docs/resources/channel#start-thread-from-message
*/
export type RESTPostAPIChannelMessagesThreadsResult = APIChannel;

View File

@@ -20,16 +20,18 @@ import type {
GuildDefaultMessageNotifications,
GuildExplicitContentFilter,
GuildFeature,
GuildMFALevel,
GuildSystemChannelFlags,
GuildVerificationLevel,
GuildWidgetStyle,
} from '../../payloads/v10/mod.ts';
import type {
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
DistributiveOmit,
DistributivePick,
Nullable,
StrictPartial,
StrictRequired,
UnionToIntersection,
} from '../../utils/internals.ts';
export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
@@ -38,9 +40,19 @@ export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSON
export type APIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
export type APIGuildCreatePartialChannel = StrictPartial<
Pick<
UnionToIntersection<APIGuildChannelResolvable>,
'type' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user'
DistributivePick<
APIGuildChannelResolvable,
| 'type'
| 'topic'
| 'nsfw'
| 'bitrate'
| 'user_limit'
| 'rate_limit_per_user'
| 'default_auto_archive_duration'
| 'position'
| 'rtc_region'
| 'video_quality_mode'
| 'flags'
>
> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
@@ -147,6 +159,23 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*/
export type RESTPostAPIGuildsResult = APIGuild;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level
*/
export interface RESTPostAPIGuildsMFAJSONBody {
/**
* MFA level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-mfa-level
*/
level: GuildMFALevel;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level
*/
export type RESTPostAPIGuildsMFAResult = RESTPostAPIGuildsMFAJSONBody;
/**
* https://discord.com/developers/docs/resources/guild#get-guild
*/
@@ -291,7 +320,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[];
/**
* https://discord.com/developers/docs/resources/guild#create-guild-channel
*/
export type RESTPostAPIGuildChannelJSONBody = Omit<APIGuildCreatePartialChannel, 'id'>;
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<APIGuildCreatePartialChannel, 'id'>;
/**
* https://discord.com/developers/docs/resources/guild#create-guild-channel
@@ -330,7 +359,7 @@ export type RESTPatchAPIGuildChannelPositionsResult = never;
/**
* https://discord.com/developers/docs/resources/guild#list-active-threads
*/
export type RESTGetAPIGuildThreadsResult = Omit<APIThreadList, 'has_more'>;
export type RESTGetAPIGuildThreadsResult = APIThreadList;
/**
* https://discord.com/developers/docs/resources/guild#get-guild-member
@@ -819,6 +848,9 @@ export type RESTPatchAPIGuildMemberVerificationJSONBody = AddUndefinedToPossibly
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* The id of the channel the user is currently in
@@ -834,6 +866,14 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
request_to_speak_timestamp?: string | null;
}>;
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
/**
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* The id of the channel the user is currently in
@@ -860,3 +900,8 @@ export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIG
*/
enabled?: boolean | null;
}>;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
*/
export type RESTPatchAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;

View File

@@ -37,7 +37,9 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
| 'guild_id'
| 'name_localized'
| 'description_localized'
>
| 'default_member_permissions'
> &
Partial<Pick<APIApplicationCommand, 'default_member_permissions'>>
>;
/**
@@ -91,42 +93,52 @@ export type RESTPutAPIApplicationCommandsResult = APIApplicationCommand[];
/**
* https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
*/
export type RESTGetAPIApplicationGuildCommandsResult = APIApplicationCommand[];
export type RESTGetAPIApplicationGuildCommandsResult = Omit<APIApplicationCommand, 'dm_permission'>[];
/**
* https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
*/
export type RESTGetAPIApplicationGuildCommandResult = APIApplicationCommand;
export type RESTGetAPIApplicationGuildCommandResult = Omit<APIApplicationCommand, 'dm_permission'>;
/**
* https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command
*/
export type RESTPostAPIApplicationGuildCommandsJSONBody = RESTPostAPIApplicationCommandsJSONBody;
export type RESTPostAPIApplicationGuildCommandsJSONBody =
| Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'>
| Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'>;
/**
* https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command
*/
export type RESTPostAPIApplicationGuildCommandsResult = APIApplicationCommand;
export type RESTPostAPIApplicationGuildCommandsResult = Omit<APIApplicationCommand, 'dm_permission'>;
/**
* https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command
*/
export type RESTPatchAPIApplicationGuildCommandJSONBody = StrictPartial<RESTPostAPIApplicationCommandsJSONBody>;
export type RESTPatchAPIApplicationGuildCommandJSONBody = StrictPartial<
| Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'>
| Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'>
>;
/**
* https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command
*/
export type RESTPatchAPIApplicationGuildCommandResult = APIApplicationCommand;
export type RESTPatchAPIApplicationGuildCommandResult = Omit<APIApplicationCommand, 'dm_permission'>;
/**
* https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
*/
export type RESTPutAPIApplicationGuildCommandsJSONBody = RESTPostAPIApplicationCommandsJSONBody[];
export type RESTPutAPIApplicationGuildCommandsJSONBody = (
| (Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'> &
Pick<Partial<APIApplicationCommand>, 'id'>)
| (Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'> &
Pick<Partial<APIApplicationCommand>, 'id'>)
)[];
/**
* https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
*/
export type RESTPutAPIApplicationGuildCommandsResult = APIApplicationCommand[];
export type RESTPutAPIApplicationGuildCommandsResult = Omit<APIApplicationCommand, 'dm_permission'>[];
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response

View File

@@ -274,6 +274,14 @@ export const Routes = {
return `/guilds/${guildId}/members/${memberId}/roles/${roleId}` as const;
},
/**
* Route for:
* - POST `/guilds/{guild.id}/mfa`
*/
guildMFA(guildId: Snowflake) {
return `/guilds/${guildId}/mfa` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/bans`
@@ -836,6 +844,262 @@ export const Routes = {
},
};
export const StickerPackApplicationId = '710982414301790216';
export const CDNRoutes = {
/**
* Route for:
* - GET `/emojis/{emoji.id}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
emoji(emojiId: Snowflake, format: EmojiFormat) {
return `/emojis/${emojiId}.${format}` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/icons/{guild.id}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
guildIcon(guildId: Snowflake, guildIcon: string, format: GuildIconFormat) {
return `icons/${guildId}/${guildIcon}.${format}` as const;
},
/**
* Route for:
* - GET `/splashes/{guild.id}/{guild.splash}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
guildSplash(guildId: Snowflake, guildSplash: string, format: GuildSplashFormat) {
return `/splashes/${guildId}/${guildSplash}.${format}` as const;
},
/**
* Route for:
* - GET `/discovery-splashes/{guild.id}/{guild.discovery_splash}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
guildDiscoverySplash(guildId: Snowflake, guildDiscoverySplash: string, format: GuildDiscoverySplashFormat) {
return `/discovery-splashes/${guildId}/${guildDiscoverySplash}.${format}` as const;
},
/**
* Route for:
* - GET `/banners/{guild.id}/{guild.banner}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
guildBanner(guildId: Snowflake, guildBanner: string, format: GuildBannerFormat) {
return `/banners/${guildId}/${guildBanner}.${format}` as const;
},
/**
* Route for:
* - GET `/banners/{user.id}/{user.banner}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
userBanner(userId: Snowflake, userBanner: string, format: UserBannerFormat) {
return `/banners/${userId}/${userBanner}.${format}` as const;
},
/**
* Route for:
* - GET `/embed/avatars/{user.discriminator % 5}.png`
*
* The `userDiscriminator` parameter should be the user discriminator modulo 5 (e.g. 1337 % 5 = 2)
*
* This route supports the extension: PNG
*/
defaultUserAvatar(userDiscriminator: DefaultUserAvatarAssets) {
return `/embed/avatars/${userDiscriminator}.png` as const;
},
/**
* Route for:
* - GET `/avatars/{user.id}/{user.avatar}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
userAvatar(userId: Snowflake, userAvatar: string, format: UserAvatarFormat) {
return `/avatars/${userId}/${userAvatar}.${format}` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/users/{user.id}/{guild_member.avatar}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
guildMemberAvatar(guildId: Snowflake, userId: Snowflake, memberAvatar: string, format: GuildMemberAvatarFormat) {
return `/guilds/${guildId}/users/${userId}/avatars/${memberAvatar}.${format}` as const;
},
/**
* Route for:
* - GET `/app-icons/{application.id}/{application.icon}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
applicationIcon(applicationId: Snowflake, applicationIcon: string, format: ApplicationIconFormat) {
return `/app-icons/${applicationId}/${applicationIcon}.${format}` as const;
},
/**
* Route for:
* - GET `/app-icons/{application.id}/{application.cover_image}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
applicationCover(applicationId: Snowflake, applicationCoverImage: string, format: ApplicationCoverFormat) {
return `/app-icons/${applicationId}/${applicationCoverImage}.${format}` as const;
},
/**
* Route for:
* - GET `/app-icons/{application.id}/{application.asset_id}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
applicationAsset(applicationId: Snowflake, applicationAssetId: string, format: ApplicationAssetFormat) {
return `/app-icons/${applicationId}/${applicationAssetId}.${format}` as const;
},
/**
* Route for:
* - GET `/app-assets/{application.id}/achievements/{achievement.id}/icons/{achievement.icon}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
achievementIcon(
applicationId: Snowflake,
achievementId: Snowflake,
achievementIconHash: string,
format: AchievementIconFormat,
) {
return `/app-assets/${applicationId}/achievements/${achievementId}/icons/${achievementIconHash}.${format}` as const;
},
/**
* Route for:
* - GET `/app-assets/710982414301790216/store/{sticker_pack.banner.asset_id}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
stickerPackBanner(stickerPackBannerAssetId: Snowflake, format: StickerPackBannerFormat) {
return `/app-assets/${StickerPackApplicationId}/store/${stickerPackBannerAssetId}.${format}` as const;
},
/**
* Route for:
* - GET `team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
teamIcon(teamId: Snowflake, teamIcon: string, format: TeamIconFormat) {
return `/team-icons/${teamId}/${teamIcon}.${format}` as const;
},
/**
* Route for:
* - GET `/stickers/{sticker.id}.{png|json}`
*
* This route supports the extensions: PNG, Lottie
*/
sticker(stickerId: Snowflake, format: StickerFormat) {
return `/stickers/${stickerId}.${format}` as const;
},
/**
* Route for:
* - GET `/role-icons/{role.id}/{role.icon}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
roleIcon(roleId: Snowflake, roleIcon: string, format: RoleIconFormat) {
return `/role-icons/${roleId}/${roleIcon}.${format}` as const;
},
/**
* Route for:
* - GET `/guild-events/{guild_scheduled_event.id}/{guild_scheduled_event.image}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
guildScheduledEventCover(
guildScheduledEventId: Snowflake,
guildScheduledEventCoverImage: string,
format: GuildScheduledEventCoverFormat,
) {
return `/guild-events/${guildScheduledEventId}/${guildScheduledEventCoverImage}.${format}` as const;
},
/**
* Route for:
* - GET `/guilds/${guild.id}/users/${user.id}/banners/${guild_member.banner}.{png|jpeg|webp|gif}`
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
guildMemberBanner(guildId: Snowflake, userId: Snowflake, guildMemberBanner: string, format: GuildMemberBannerFormat) {
return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const;
},
};
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;
export type EmojiFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildIconFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildSplashFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type GuildDiscoverySplashFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type GuildBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type UserBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type DefaultUserAvatar = Extract<ImageFormat, ImageFormat.PNG>;
export type UserAvatarFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildMemberAvatarFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type ApplicationIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type ApplicationCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type ApplicationAssetFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type AchievementIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type StickerPackBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type TeamIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type StickerFormat = Extract<ImageFormat, ImageFormat.PNG | ImageFormat.Lottie>;
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export enum ImageFormat {
JPEG = 'jpeg',
PNG = 'png',
WebP = 'webp',
GIF = 'gif',
Lottie = 'json',
}
export interface CDNQuery {
/**
* The returned image can have the size changed by using this query parameter
*
* Image size can be any power of two between 16 and 4096
*/
size?: number;
}
export const RouteBases = {
api: `https://discord.com/api/v${APIVersion}`,
cdn: 'https://cdn.discordapp.com',

View File

@@ -2,7 +2,7 @@ import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../../payloads/v10/mod.ts';
/**
* https://discord.com/developers/docs/topics/oauth2#get-current-application-information
* https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information
*/
export type RESTGetAPIOAuth2CurrentApplicationResult = Omit<APIApplication, 'flags'>;

View File

@@ -37,7 +37,7 @@ export type RESTPostAPIStageInstanceResult = APIStageInstance;
export type RESTGetAPIStageInstanceResult = APIStageInstance;
/**
* https://discord.com/developers/docs/resources/stage-instance#update-stage-instance
* https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
*/
export type RESTPatchAPIStageInstanceJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
@@ -51,7 +51,7 @@ export type RESTPatchAPIStageInstanceJSONBody = AddUndefinedToPossiblyUndefinedP
}>;
/**
* https://discord.com/developers/docs/resources/stage-instance#update-stage-instance
* https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
*/
export type RESTPatchAPIStageInstanceResult = APIStageInstance;

View File

@@ -1,16 +1,31 @@
import type { APISticker, APIStickerPack } from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/sticker#get-sticker
*/
export type RESTGetAPIStickerResult = APISticker;
/**
* https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs
*/
export interface RESTGetNitroStickerPacksResult {
sticker_packs: APIStickerPack[];
}
/**
* https://discord.com/developers/docs/resources/sticker#list-guild-stickers
*/
export type RESTGetAPIGuildStickersResult = APISticker[];
/**
* https://discord.com/developers/docs/resources/sticker#get-guild-sticker
*/
export type RESTGetAPIGuildStickerResult = APISticker;
/**
* https://discord.com/developers/docs/resources/sticker#create-guild-sticker
*/
export interface RESTPostAPIGuildStickerFormDataBody {
/**
* Name of the sticker (2-30 characters)
@@ -30,8 +45,14 @@ export interface RESTPostAPIGuildStickerFormDataBody {
file: unknown;
}
/**
* https://discord.com/developers/docs/resources/sticker#create-guild-sticker
*/
export type RESTPostAPIGuildStickerResult = APISticker;
/**
* https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
*/
export type RESTPatchAPIGuildStickerJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Name of the sticker (2-30 characters)
@@ -47,6 +68,12 @@ export type RESTPatchAPIGuildStickerJSONBody = AddUndefinedToPossiblyUndefinedPr
tags?: string;
}>;
/**
* https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
*/
export type RESTPatchAPIGuildStickerResult = APISticker;
/**
* https://discord.com/developers/docs/resources/sticker#delete-guild-sticker
*/
export type RESTDeleteAPIGuildStickerResult = never;

View File

@@ -2,12 +2,12 @@ import type { APIGuild, APITemplate } from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/template#get-template
* https://discord.com/developers/docs/resources/guild-template#get-guild-template
*/
export type RESTGetAPITemplateResult = APITemplate;
/**
* https://discord.com/developers/docs/resources/template#create-guild-from-template
* https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
*/
export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
@@ -23,17 +23,17 @@ export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndef
}>;
/**
* https://discord.com/developers/docs/resources/template#create-guild-from-template
* https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
*/
export type RESTPostAPITemplateCreateGuildResult = APIGuild;
/**
* https://discord.com/developers/docs/resources/template#get-guild-templates
* https://discord.com/developers/docs/resources/guild-template#get-guild-templates
*/
export type RESTGetAPIGuildTemplatesResult = APITemplate[];
/**
* https://discord.com/developers/docs/resources/template#create-guild-template
* https://discord.com/developers/docs/resources/guild-template#create-guild-template
*/
export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
@@ -47,26 +47,26 @@ export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedP
}>;
/**
* https://discord.com/developers/docs/resources/template#create-guild-template
* https://discord.com/developers/docs/resources/guild-template#create-guild-template
*/
export type RESTPostAPIGuildTemplatesResult = APITemplate;
/**
* https://discord.com/developers/docs/resources/template#sync-guild-template
* https://discord.com/developers/docs/resources/guild-template#sync-guild-template
*/
export type RESTPutAPIGuildTemplateSyncResult = APITemplate;
/**
* https://discord.com/developers/docs/resources/template#modify-guild-template
* https://discord.com/developers/docs/resources/guild-template#modify-guild-template
*/
export type RESTPatchAPIGuildTemplateJSONBody = StrictPartial<RESTPostAPIGuildTemplatesJSONBody>;
/**
* https://discord.com/developers/docs/resources/template#modify-guild-template
* https://discord.com/developers/docs/resources/guild-template#modify-guild-template
*/
export type RESTPatchAPIGuildTemplateResult = APITemplate;
/**
* https://discord.com/developers/docs/resources/template#delete-guild-template
* https://discord.com/developers/docs/resources/guild-template#delete-guild-template
*/
export type RESTDeleteAPIGuildTemplateResult = APITemplate;

View File

@@ -13,7 +13,7 @@ export type RESTGetAPICurrentUserResult = APIUser;
export type RESTGetAPIUserResult = APIUser;
/**
* https://discord.com/developers/docs/resources/guild#get-current-user-guild-member
* https://discord.com/developers/docs/resources/user#get-current-user-guild-member
*/
export type RESTGetCurrentUserGuildMemberResult = APIGuildMember;

View File

@@ -144,6 +144,12 @@ export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefine
* Message flags combined as a bitfield
*/
flags?: MessageFlags;
/**
* Name of thread to create
*
* Available only if the webhook is in a forum channel and a thread is not specified in {@link RESTPostAPIWebhookWithTokenQuery.thread_id} query parameter
*/
thread_name?: string;
}>;
/**
@@ -159,7 +165,7 @@ export type RESTPostAPIWebhookWithTokenFormDataBody =
| (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>);
/**
* https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
* https://discord.com/developers/docs/resources/webhook#execute-webhook-query-string-params
*/
export interface RESTPostAPIWebhookWithTokenQuery {
/**
@@ -171,6 +177,8 @@ export interface RESTPostAPIWebhookWithTokenQuery {
wait?: boolean;
/**
* Send a message to the specified thread within a webhook's channel. The thread will automatically be unarchived.
*
* Available only if the {@link RESTPostAPIWebhookWithTokenJSONBody.thread_name} JSON body property is not specified
*/
thread_id?: Snowflake;
}
@@ -184,12 +192,12 @@ export type RESTPostAPIWebhookWithTokenResult = never;
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
* the `wait` query parameter set to `true`
*
* See https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
* See https://discord.com/developers/docs/resources/webhook#execute-webhook-query-string-params
*/
export type RESTPostAPIWebhookWithTokenWaitResult = APIMessage;
/**
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-querystring-params
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-query-string-params
*/
export type RESTPostAPIWebhookWithTokenSlackQuery = RESTPostAPIWebhookWithTokenQuery;
@@ -202,12 +210,12 @@ export type RESTPostAPIWebhookWithTokenSlackResult = never;
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
* the `wait` query parameter set to `true`
*
* See https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-querystring-params
* See https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-query-string-params
*/
export type RESTPostAPIWebhookWithTokenSlackWaitResult = APIMessage;
/**
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-querystring-params
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-query-string-params
*/
export type RESTPostAPIWebhookWithTokenGitHubQuery = RESTPostAPIWebhookWithTokenQuery;
@@ -220,7 +228,7 @@ export type RESTPostAPIWebhookWithTokenGitHubResult = never;
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
* the `wait` query parameter set to `true`
*
* See https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-querystring-params
* See https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-query-string-params
*/
export type RESTPostAPIWebhookWithTokenGitHubWaitResult = APIMessage;

View File

@@ -64,7 +64,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
/**
* Whether the channel is nsfw
*
* Channel types: text, news
* Channel types: text, voice, news
*/
nsfw?: boolean | null;
/**
@@ -96,7 +96,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
/**
* ID of the new parent category for a channel
*
* Channel types: text, news, voice
* Channel types: text, voice, news
*/
parent_id?: Snowflake | null;
/**
@@ -188,7 +188,7 @@ export type RESTGetAPIChannelMessagesResult = APIMessage[];
export type RESTGetAPIChannelMessageResult = APIMessage;
/**
* 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 type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
Required<Pick<APIMessageReference, 'message_id'>> &
@@ -239,7 +239,7 @@ export type RESTPostAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedP
/**
* Include to make your message a reply
*
* 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?: APIMessageReferenceSend;
/**
@@ -542,12 +542,12 @@ export type RESTPostAPIChannelTypingResult = never;
export type RESTGetAPIChannelPinsResult = APIMessage[];
/**
* https://discord.com/developers/docs/resources/channel#add-pinned-channel-message
* https://discord.com/developers/docs/resources/channel#pin-message
*/
export type RESTPutAPIChannelPinResult = never;
/**
* https://discord.com/developers/docs/resources/channel#delete-pinned-channel-message
* https://discord.com/developers/docs/resources/channel#unpin-message
*/
export type RESTDeleteAPIChannelPinResult = never;
@@ -576,7 +576,7 @@ export type RESTPutAPIChannelRecipientResult = unknown;
export type RESTDeleteAPIChannelRecipientResult = unknown;
/**
* https://discord.com/developers/docs/resources/channel#start-thread-with-message
* https://discord.com/developers/docs/resources/channel#start-thread-from-message
*/
export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
@@ -598,16 +598,25 @@ export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUn
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
*/
export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody &
RESTPostAPIChannelMessageJSONBody;
export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & {
/**
* First message in the forum thread
*/
message: RESTPostAPIChannelMessageJSONBody;
};
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
*/
export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessageFormDataBody;
export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & {
/**
* First message in the forum thread
*/
message: string;
};
/**
* https://discord.com/developers/docs/resources/channel#start-thread-with-message
* https://discord.com/developers/docs/resources/channel#start-thread-from-message
*/
export type RESTPostAPIChannelMessagesThreadsResult = APIChannel;

View File

@@ -18,6 +18,7 @@ import type {
GuildDefaultMessageNotifications,
GuildExplicitContentFilter,
GuildFeature,
GuildMFALevel,
GuildSystemChannelFlags,
GuildVerificationLevel,
GuildWidgetStyle,
@@ -26,10 +27,11 @@ import type {
} from '../../payloads/v9/mod.ts';
import type {
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
DistributiveOmit,
DistributivePick,
Nullable,
StrictPartial,
StrictRequired,
UnionToIntersection,
} from '../../utils/internals.ts';
export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
@@ -38,9 +40,19 @@ export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSON
export type APIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
export type APIGuildCreatePartialChannel = StrictPartial<
Pick<
UnionToIntersection<APIGuildChannelResolvable>,
'type' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user'
DistributivePick<
APIGuildChannelResolvable,
| 'type'
| 'topic'
| 'nsfw'
| 'bitrate'
| 'user_limit'
| 'rate_limit_per_user'
| 'default_auto_archive_duration'
| 'position'
| 'rtc_region'
| 'video_quality_mode'
| 'flags'
>
> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
@@ -147,6 +159,23 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*/
export type RESTPostAPIGuildsResult = APIGuild;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level
*/
export interface RESTPostAPIGuildsMFAJSONBody {
/**
* MFA level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-mfa-level
*/
level: GuildMFALevel;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-mfa-level
*/
export type RESTPostAPIGuildsMFAResult = RESTPostAPIGuildsMFAJSONBody;
/**
* https://discord.com/developers/docs/resources/guild#get-guild
*/
@@ -291,7 +320,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[];
/**
* https://discord.com/developers/docs/resources/guild#create-guild-channel
*/
export type RESTPostAPIGuildChannelJSONBody = Omit<APIGuildCreatePartialChannel, 'id'>;
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<APIGuildCreatePartialChannel, 'id'>;
/**
* https://discord.com/developers/docs/resources/guild#create-guild-channel
@@ -825,6 +854,9 @@ export type RESTPatchAPIGuildMemberVerificationJSONBody = AddUndefinedToPossibly
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* The id of the channel the user is currently in
@@ -840,6 +872,14 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
request_to_speak_timestamp?: string | null;
}>;
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
/**
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* The id of the channel the user is currently in
@@ -866,3 +906,8 @@ export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIG
*/
enabled?: boolean | null;
}>;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
*/
export type RESTPatchAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;

View File

@@ -37,7 +37,9 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
| 'guild_id'
| 'name_localized'
| 'description_localized'
>
| 'default_member_permissions'
> &
Partial<Pick<APIApplicationCommand, 'default_member_permissions'>>
>;
/**
@@ -91,42 +93,52 @@ export type RESTPutAPIApplicationCommandsResult = APIApplicationCommand[];
/**
* https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
*/
export type RESTGetAPIApplicationGuildCommandsResult = APIApplicationCommand[];
export type RESTGetAPIApplicationGuildCommandsResult = Omit<APIApplicationCommand, 'dm_permission'>[];
/**
* https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
*/
export type RESTGetAPIApplicationGuildCommandResult = APIApplicationCommand;
export type RESTGetAPIApplicationGuildCommandResult = Omit<APIApplicationCommand, 'dm_permission'>;
/**
* https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command
*/
export type RESTPostAPIApplicationGuildCommandsJSONBody = RESTPostAPIApplicationCommandsJSONBody;
export type RESTPostAPIApplicationGuildCommandsJSONBody =
| Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'>
| Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'>;
/**
* https://discord.com/developers/docs/interactions/application-commands#create-guild-application-command
*/
export type RESTPostAPIApplicationGuildCommandsResult = APIApplicationCommand;
export type RESTPostAPIApplicationGuildCommandsResult = Omit<APIApplicationCommand, 'dm_permission'>;
/**
* https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command
*/
export type RESTPatchAPIApplicationGuildCommandJSONBody = StrictPartial<RESTPostAPIApplicationCommandsJSONBody>;
export type RESTPatchAPIApplicationGuildCommandJSONBody = StrictPartial<
| Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'>
| Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'>
>;
/**
* https://discord.com/developers/docs/interactions/application-commands#edit-guild-application-command
*/
export type RESTPatchAPIApplicationGuildCommandResult = APIApplicationCommand;
export type RESTPatchAPIApplicationGuildCommandResult = Omit<APIApplicationCommand, 'dm_permission'>;
/**
* https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
*/
export type RESTPutAPIApplicationGuildCommandsJSONBody = RESTPostAPIApplicationCommandsJSONBody[];
export type RESTPutAPIApplicationGuildCommandsJSONBody = (
| (Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'> &
Pick<Partial<APIApplicationCommand>, 'id'>)
| (Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'> &
Pick<Partial<APIApplicationCommand>, 'id'>)
)[];
/**
* https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
*/
export type RESTPutAPIApplicationGuildCommandsResult = APIApplicationCommand[];
export type RESTPutAPIApplicationGuildCommandsResult = Omit<APIApplicationCommand, 'dm_permission'>[];
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response

View File

@@ -274,6 +274,14 @@ export const Routes = {
return `/guilds/${guildId}/members/${memberId}/roles/${roleId}` as const;
},
/**
* Route for:
* - POST `/guilds/{guild.id}/mfa`
*/
guildMFA(guildId: Snowflake) {
return `/guilds/${guildId}/mfa` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/bans`
@@ -845,6 +853,262 @@ export const Routes = {
},
};
export const StickerPackApplicationId = '710982414301790216';
export const CDNRoutes = {
/**
* Route for:
* - GET `/emojis/{emoji.id}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
emoji(emojiId: Snowflake, format: EmojiFormat) {
return `/emojis/${emojiId}.${format}` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/icons/{guild.id}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
guildIcon(guildId: Snowflake, guildIcon: string, format: GuildIconFormat) {
return `icons/${guildId}/${guildIcon}.${format}` as const;
},
/**
* Route for:
* - GET `/splashes/{guild.id}/{guild.splash}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
guildSplash(guildId: Snowflake, guildSplash: string, format: GuildSplashFormat) {
return `/splashes/${guildId}/${guildSplash}.${format}` as const;
},
/**
* Route for:
* - GET `/discovery-splashes/{guild.id}/{guild.discovery_splash}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
guildDiscoverySplash(guildId: Snowflake, guildDiscoverySplash: string, format: GuildDiscoverySplashFormat) {
return `/discovery-splashes/${guildId}/${guildDiscoverySplash}.${format}` as const;
},
/**
* Route for:
* - GET `/banners/{guild.id}/{guild.banner}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
guildBanner(guildId: Snowflake, guildBanner: string, format: GuildBannerFormat) {
return `/banners/${guildId}/${guildBanner}.${format}` as const;
},
/**
* Route for:
* - GET `/banners/{user.id}/{user.banner}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
userBanner(userId: Snowflake, userBanner: string, format: UserBannerFormat) {
return `/banners/${userId}/${userBanner}.${format}` as const;
},
/**
* Route for:
* - GET `/embed/avatars/{user.discriminator % 5}.png`
*
* The `userDiscriminator` parameter should be the user discriminator modulo 5 (e.g. 1337 % 5 = 2)
*
* This route supports the extension: PNG
*/
defaultUserAvatar(userDiscriminator: DefaultUserAvatarAssets) {
return `/embed/avatars/${userDiscriminator}.png` as const;
},
/**
* Route for:
* - GET `/avatars/{user.id}/{user.avatar}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
userAvatar(userId: Snowflake, userAvatar: string, format: UserAvatarFormat) {
return `/avatars/${userId}/${userAvatar}.${format}` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/users/{user.id}/{guild_member.avatar}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
guildMemberAvatar(guildId: Snowflake, userId: Snowflake, memberAvatar: string, format: GuildMemberAvatarFormat) {
return `/guilds/${guildId}/users/${userId}/avatars/${memberAvatar}.${format}` as const;
},
/**
* Route for:
* - GET `/app-icons/{application.id}/{application.icon}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
applicationIcon(applicationId: Snowflake, applicationIcon: string, format: ApplicationIconFormat) {
return `/app-icons/${applicationId}/${applicationIcon}.${format}` as const;
},
/**
* Route for:
* - GET `/app-icons/{application.id}/{application.cover_image}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
applicationCover(applicationId: Snowflake, applicationCoverImage: string, format: ApplicationCoverFormat) {
return `/app-icons/${applicationId}/${applicationCoverImage}.${format}` as const;
},
/**
* Route for:
* - GET `/app-icons/{application.id}/{application.asset_id}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
applicationAsset(applicationId: Snowflake, applicationAssetId: string, format: ApplicationAssetFormat) {
return `/app-icons/${applicationId}/${applicationAssetId}.${format}` as const;
},
/**
* Route for:
* - GET `/app-assets/{application.id}/achievements/{achievement.id}/icons/{achievement.icon}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
achievementIcon(
applicationId: Snowflake,
achievementId: Snowflake,
achievementIconHash: string,
format: AchievementIconFormat,
) {
return `/app-assets/${applicationId}/achievements/${achievementId}/icons/${achievementIconHash}.${format}` as const;
},
/**
* Route for:
* - GET `/app-assets/710982414301790216/store/{sticker_pack.banner.asset_id}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
stickerPackBanner(stickerPackBannerAssetId: Snowflake, format: StickerPackBannerFormat) {
return `/app-assets/${StickerPackApplicationId}/store/${stickerPackBannerAssetId}.${format}` as const;
},
/**
* Route for:
* - GET `team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
teamIcon(teamId: Snowflake, teamIcon: string, format: TeamIconFormat) {
return `/team-icons/${teamId}/${teamIcon}.${format}` as const;
},
/**
* Route for:
* - GET `/stickers/{sticker.id}.{png|json}`
*
* This route supports the extensions: PNG, Lottie
*/
sticker(stickerId: Snowflake, format: StickerFormat) {
return `/stickers/${stickerId}.${format}` as const;
},
/**
* Route for:
* - GET `/role-icons/{role.id}/{role.icon}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
roleIcon(roleId: Snowflake, roleIcon: string, format: RoleIconFormat) {
return `/role-icons/${roleId}/${roleIcon}.${format}` as const;
},
/**
* Route for:
* - GET `/guild-events/{guild_scheduled_event.id}/{guild_scheduled_event.image}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
guildScheduledEventCover(
guildScheduledEventId: Snowflake,
guildScheduledEventCoverImage: string,
format: GuildScheduledEventCoverFormat,
) {
return `/guild-events/${guildScheduledEventId}/${guildScheduledEventCoverImage}.${format}` as const;
},
/**
* Route for:
* - GET `/guilds/${guild.id}/users/${user.id}/banners/${guild_member.banner}.{png|jpeg|webp|gif}`
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
guildMemberBanner(guildId: Snowflake, userId: Snowflake, guildMemberBanner: string, format: GuildMemberBannerFormat) {
return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const;
},
};
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;
export type EmojiFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildIconFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildSplashFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type GuildDiscoverySplashFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type GuildBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type UserBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type DefaultUserAvatar = Extract<ImageFormat, ImageFormat.PNG>;
export type UserAvatarFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildMemberAvatarFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type ApplicationIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type ApplicationCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type ApplicationAssetFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type AchievementIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type StickerPackBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type TeamIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type StickerFormat = Extract<ImageFormat, ImageFormat.PNG | ImageFormat.Lottie>;
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export enum ImageFormat {
JPEG = 'jpeg',
PNG = 'png',
WebP = 'webp',
GIF = 'gif',
Lottie = 'json',
}
export interface CDNQuery {
/**
* The returned image can have the size changed by using this query parameter
*
* Image size can be any power of two between 16 and 4096
*/
size?: number;
}
export const RouteBases = {
api: `https://discord.com/api/v${APIVersion}`,
cdn: 'https://cdn.discordapp.com',

View File

@@ -2,7 +2,7 @@ import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../../payloads/v9/mod.ts';
/**
* https://discord.com/developers/docs/topics/oauth2#get-current-application-information
* https://discord.com/developers/docs/topics/oauth2#get-current-bot-application-information
*/
export type RESTGetAPIOAuth2CurrentApplicationResult = Omit<APIApplication, 'flags'>;

View File

@@ -37,7 +37,7 @@ export type RESTPostAPIStageInstanceResult = APIStageInstance;
export type RESTGetAPIStageInstanceResult = APIStageInstance;
/**
* https://discord.com/developers/docs/resources/stage-instance#update-stage-instance
* https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
*/
export type RESTPatchAPIStageInstanceJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
@@ -51,7 +51,7 @@ export type RESTPatchAPIStageInstanceJSONBody = AddUndefinedToPossiblyUndefinedP
}>;
/**
* https://discord.com/developers/docs/resources/stage-instance#update-stage-instance
* https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
*/
export type RESTPatchAPIStageInstanceResult = APIStageInstance;

View File

@@ -1,16 +1,31 @@
import type { APISticker, APIStickerPack } from '../../payloads/v9/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/sticker#get-sticker
*/
export type RESTGetAPIStickerResult = APISticker;
/**
* https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs
*/
export interface RESTGetNitroStickerPacksResult {
sticker_packs: APIStickerPack[];
}
/**
* https://discord.com/developers/docs/resources/sticker#list-guild-stickers
*/
export type RESTGetAPIGuildStickersResult = APISticker[];
/**
* https://discord.com/developers/docs/resources/sticker#get-guild-sticker
*/
export type RESTGetAPIGuildStickerResult = APISticker;
/**
* https://discord.com/developers/docs/resources/sticker#create-guild-sticker
*/
export interface RESTPostAPIGuildStickerFormDataBody {
/**
* Name of the sticker (2-30 characters)
@@ -30,8 +45,14 @@ export interface RESTPostAPIGuildStickerFormDataBody {
file: unknown;
}
/**
* https://discord.com/developers/docs/resources/sticker#create-guild-sticker
*/
export type RESTPostAPIGuildStickerResult = APISticker;
/**
* https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
*/
export type RESTPatchAPIGuildStickerJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Name of the sticker (2-30 characters)
@@ -47,6 +68,12 @@ export type RESTPatchAPIGuildStickerJSONBody = AddUndefinedToPossiblyUndefinedPr
tags?: string;
}>;
/**
* https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
*/
export type RESTPatchAPIGuildStickerResult = APISticker;
/**
* https://discord.com/developers/docs/resources/sticker#delete-guild-sticker
*/
export type RESTDeleteAPIGuildStickerResult = never;

View File

@@ -2,12 +2,12 @@ import type { APIGuild, APITemplate } from '../../payloads/v9/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/template#get-template
* https://discord.com/developers/docs/resources/guild-template#get-guild-template
*/
export type RESTGetAPITemplateResult = APITemplate;
/**
* https://discord.com/developers/docs/resources/template#create-guild-from-template
* https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
*/
export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
@@ -23,17 +23,17 @@ export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndef
}>;
/**
* https://discord.com/developers/docs/resources/template#create-guild-from-template
* https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
*/
export type RESTPostAPITemplateCreateGuildResult = APIGuild;
/**
* https://discord.com/developers/docs/resources/template#get-guild-templates
* https://discord.com/developers/docs/resources/guild-template#get-guild-templates
*/
export type RESTGetAPIGuildTemplatesResult = APITemplate[];
/**
* https://discord.com/developers/docs/resources/template#create-guild-template
* https://discord.com/developers/docs/resources/guild-template#create-guild-template
*/
export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
@@ -47,26 +47,26 @@ export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedP
}>;
/**
* https://discord.com/developers/docs/resources/template#create-guild-template
* https://discord.com/developers/docs/resources/guild-template#create-guild-template
*/
export type RESTPostAPIGuildTemplatesResult = APITemplate;
/**
* https://discord.com/developers/docs/resources/template#sync-guild-template
* https://discord.com/developers/docs/resources/guild-template#sync-guild-template
*/
export type RESTPutAPIGuildTemplateSyncResult = APITemplate;
/**
* https://discord.com/developers/docs/resources/template#modify-guild-template
* https://discord.com/developers/docs/resources/guild-template#modify-guild-template
*/
export type RESTPatchAPIGuildTemplateJSONBody = StrictPartial<RESTPostAPIGuildTemplatesJSONBody>;
/**
* https://discord.com/developers/docs/resources/template#modify-guild-template
* https://discord.com/developers/docs/resources/guild-template#modify-guild-template
*/
export type RESTPatchAPIGuildTemplateResult = APITemplate;
/**
* https://discord.com/developers/docs/resources/template#delete-guild-template
* https://discord.com/developers/docs/resources/guild-template#delete-guild-template
*/
export type RESTDeleteAPIGuildTemplateResult = APITemplate;

View File

@@ -13,7 +13,7 @@ export type RESTGetAPICurrentUserResult = APIUser;
export type RESTGetAPIUserResult = APIUser;
/**
* https://discord.com/developers/docs/resources/guild#get-current-user-guild-member
* https://discord.com/developers/docs/resources/user#get-current-user-guild-member
*/
export type RESTGetCurrentUserGuildMemberResult = APIGuildMember;

View File

@@ -144,6 +144,12 @@ export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefine
* Message flags combined as a bitfield
*/
flags?: MessageFlags;
/**
* Name of thread to create
*
* Available only if the webhook is in a forum channel and a thread is not specified in {@link RESTPostAPIWebhookWithTokenQuery.thread_id} query parameter
*/
thread_name?: string;
}>;
/**
@@ -171,6 +177,8 @@ export interface RESTPostAPIWebhookWithTokenQuery {
wait?: boolean;
/**
* Send a message to the specified thread within a webhook's channel. The thread will automatically be unarchived.
*
* Available only if the {@link RESTPostAPIWebhookWithTokenJSONBody.thread_name} JSON body property is not specified
*/
thread_id?: Snowflake;
}

View File

@@ -7,11 +7,35 @@ export type Nullable<T> = {
* (since JSON.stringify ignores undefined properties)
*/
export type AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base> = {
[K in keyof Base]: Base[K] extends Exclude<Base[K], undefined> ? Base[K] : Base[K] | undefined;
[K in keyof Base]: Base[K] extends Exclude<Base[K], undefined>
? AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]>
: AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]> | undefined;
};
export type StrictPartial<Base> = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Partial<Base>>;
export type StrictRequired<Base> = Required<{ [K in keyof Base]: Exclude<Base[K], undefined> }>;
export type UnionToIntersection<T> = (T extends any ? (x: T) => any : never) extends (x: infer R) => any ? R : never;
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends (k: infer I) => void ? I : never;
type Keys<T> = keyof T;
type DistributiveKeys<T> = T extends unknown ? Keys<T> : never;
/**
* Allows picking of keys from unions that are disjoint
*/
export type DistributivePick<T, K extends DistributiveKeys<T>> = T extends unknown
? keyof Pick_<T, K> extends never
? never
: { [P in keyof Pick_<T, K>]: Pick_<T, K>[P] }
: never;
type Pick_<T, K> = Pick<T, Extract<keyof T, K>>;
/**
* Allows omitting of keys from unions that are disjoint
*/
export type DistributiveOmit<T, K extends DistributiveKeys<T>> = T extends unknown
? { [P in keyof Omit_<T, K>]: Omit_<T, K>[P] }
: never;
type Omit_<T, K> = Omit<T, Extract<keyof T, K>>;

View File

@@ -3,6 +3,7 @@
*/
import type { Snowflake } from '../globals';
import type { GatewayPresenceUpdate } from '../payloads/v10/gateway';
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
@@ -500,15 +503,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 +514,88 @@ 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;
/**
* 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
@@ -1051,7 +1125,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 +1138,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 +1602,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;
}
/**

View File

@@ -3,6 +3,7 @@
*/
import type { Snowflake } from '../globals';
import type { GatewayPresenceUpdate } from '../payloads/v9/gateway';
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
@@ -498,16 +501,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 +513,88 @@ 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;
/**
* 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
@@ -1050,7 +1124,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 +1137,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 +1601,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;
}
/**

1836
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,8 @@
{
"name": "discord-api-types",
"version": "0.31.1",
"version": "0.36.2",
"description": "Discord API typings that are kept up to date for use in bot library creation.",
"homepage": "https://discord-api-types.dev",
"exports": {
"./globals": {
"require": "./globals.js",
@@ -94,7 +95,7 @@
"build:deno": "node ./scripts/deno.mjs",
"build:node": "tsc && run-p esm:*",
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
"ci:pr": "run-s changelog lint build:deno",
"ci:pr": "run-s changelog lint build:deno && node ./scripts/bump-website-version.mjs",
"clean:deno": "rimraf deno/",
"clean:node": "rimraf {gateway,payloads,rest,rpc,voice,utils}/**/*.{js,mjs,d.ts,*map} {globals,v*}.{js,mjs,d.ts,*map}",
"clean": "run-p clean:*",
@@ -106,11 +107,11 @@
"esm:utils": "gen-esm-wrapper ./utils/index.js ./utils/index.mjs",
"esm:versions": "node ./scripts/versions.mjs",
"esm:voice": "gen-esm-wrapper ./voice/index.js ./voice/index.mjs",
"lint": "prettier --write . && eslint --fix --ext mjs,ts {gateway,payloads,rest,rpc,voice,utils}/**/*.ts {globals,v*}.ts scripts/**/*.{mjs,ts}",
"lint": "prettier --write . && eslint --fix --ext mjs,ts {gateway,payloads,rest,rpc,voice,utils}/**/*.ts {globals,v*}.ts scripts/**/*.mjs",
"postpublish": "run-s clean:node build:deno",
"prepare": "is-ci || husky install",
"prepublishOnly": "run-s clean test:lint build:node",
"test:lint": "prettier --check . && eslint --ext mjs,ts {gateway,payloads,rest,rpc,voice,utils}/**/*.ts {globals,v*}.ts scripts/**/*.{mjs,ts}",
"test:lint": "prettier --check . && eslint --ext mjs,ts {gateway,payloads,rest,rpc,voice,utils}/**/*.ts {globals,v*}.ts scripts/**/*.mjs",
"pretest:types": "tsc",
"test:types": "node ./scripts/run-tsd.mjs",
"posttest:types": "npm run clean:node"
@@ -128,32 +129,37 @@
"{globals,v*}.{js,js.map,d.ts,d.ts.map,mjs}"
],
"devDependencies": {
"@commitlint/cli": "^16.2.3",
"@commitlint/config-angular": "^16.2.3",
"@babel/runtime-corejs3": "^7.18.0",
"@commitlint/cli": "^17.0.0",
"@commitlint/config-angular": "^17.0.0",
"@favware/npm-deprecate": "^1.0.4",
"@octokit/action": "^3.18.0",
"@octokit/webhooks-types": "^5.5.1",
"@octokit/action": "^3.18.1",
"@octokit/webhooks-types": "^5.6.0",
"@sapphire/prettier-config": "^1.4.3",
"@types/conventional-recommended-bump": "^6.1.0",
"@types/node": "^17.0.23",
"@typescript-eslint/eslint-plugin": "^5.18.0",
"@typescript-eslint/parser": "^5.18.0",
"@types/node": "^17.0.35",
"@typescript-eslint/eslint-plugin": "^5.26.0",
"@typescript-eslint/parser": "^5.26.0",
"conventional-changelog-cli": "^2.2.2",
"conventional-recommended-bump": "^6.1.0",
"eslint": "^8.12.0",
"eslint": "^8.16.0",
"eslint-config-marine": "^9.4.1",
"eslint-config-prettier": "^8.5.0",
"eslint-import-resolver-typescript": "^2.7.1",
"eslint-plugin-import": "^2.25.4",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsx-a11y": "^6.5.1",
"eslint-plugin-react": "^7.30.0",
"eslint-plugin-react-hooks": "^4.5.0",
"gen-esm-wrapper": "^1.1.3",
"husky": "^7.0.4",
"husky": "^8.0.1",
"is-ci": "^3.0.1",
"lint-staged": "^12.3.7",
"lint-staged": "^12.4.1",
"npm-run-all": "^4.1.5",
"prettier": "^2.6.2",
"pretty-quick": "^3.1.3",
"rimraf": "^3.0.2",
"tsd": "^0.20.0",
"typescript": "^4.6.3"
"typescript": "^4.6.4"
},
"repository": {
"type": "git",

View File

@@ -1,4 +1,4 @@
import type { LocaleString } from '../v10';
import type { LocaleString } from '../rest/common';
/**
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags

View File

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

View File

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

View File

@@ -5,8 +5,20 @@ import type {
} from './base';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared';
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>
>;

View File

@@ -5,7 +5,7 @@ import type { Snowflake } from '../../../../globals';
*/
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),
};

View File

@@ -70,10 +70,19 @@ export interface APIApplicationCommand {
* 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;
/**

View File

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

View File

@@ -53,6 +53,12 @@ export interface APIApplication {
* See https://discord.com/developers/docs/resources/user#user-object
*/
owner?: APIUser;
/**
* An empty string
*
* @deprecated This field will be removed in v11
*/
summary: string;
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*

View File

@@ -16,6 +16,7 @@ import type {
GuildScheduledEventEntityType,
GuildScheduledEventStatus,
} from './guildScheduledEvent';
import type { APIApplicationCommand } from './interactions';
import type { APIRole } from './permissions';
import type { StageInstancePrivacyLevel } from './stageInstance';
import type { StickerFormatType } from './sticker';
@@ -27,6 +28,12 @@ import type { Snowflake } from '../../globals';
* 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,
}
/**
@@ -517,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
*/

View File

@@ -4,7 +4,6 @@
import type { APIApplication } from './application';
import type { APIPartialEmoji } from './emoji';
import type { APIGuildMember } from './guild';
import type { APIMessageInteraction } from './interactions';
import type { APIRole } from './permissions';
import type { APISticker, APIStickerItem } from './sticker';
@@ -326,10 +325,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)
*
@@ -339,15 +334,6 @@ 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
*/
@@ -377,7 +363,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
*
@@ -454,7 +440,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;
/**
@@ -517,11 +503,11 @@ export enum MessageType {
ChannelNameChange,
ChannelIconChange,
ChannelPinnedMessage,
GuildMemberJoin,
UserPremiumGuildSubscription,
UserPremiumGuildSubscriptionTier1,
UserPremiumGuildSubscriptionTier2,
UserPremiumGuildSubscriptionTier3,
UserJoin,
GuildBoost,
GuildBoostTier1,
GuildBoostTier2,
GuildBoostTier3,
ChannelFollowAdd,
GuildDiscoveryDisqualified = 14,
GuildDiscoveryRequalified,
@@ -554,7 +540,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 {
/**
@@ -770,10 +756,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;
}
/**
@@ -921,6 +903,10 @@ export interface APIEmbedVideo {
* Source url of video
*/
url?: string;
/**
* A proxied url of the video
*/
proxy_url?: string;
/**
* Height of video
*/

View File

@@ -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',
}
/**

View File

@@ -2,15 +2,11 @@
* Types extracted from https://discord.com/developers/docs/resources/guild
*/
import type { APIChannel } from './channel';
import type { APIEmoji } from './emoji';
import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway';
import type { APIGuildScheduledEvent } from './guildScheduledEvent';
import type { PresenceUpdateStatus } from './gateway';
import type { APIRole } from './permissions';
import type { APIStageInstance } from './stageInstance';
import type { APISticker } from './sticker';
import type { APIUser } from './user';
import type { GatewayVoiceState } from './voice';
import type { Permissions, Snowflake } from '../../globals';
/**
@@ -196,64 +192,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)
*/
@@ -320,14 +258,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
*
@@ -338,14 +268,6 @@ export interface APIGuild extends APIPartialGuild {
* Whether the guild has the boost progress bar enabled.
*/
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
*/
guild_scheduled_events?: APIGuildScheduledEvent[];
/**
* The type of Student Hub the guild is
*/
@@ -536,14 +458,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
*/
@@ -715,7 +629,7 @@ export interface APIGuildIntegration {
/**
* Is this integration enabled
*/
enabled: boolean;
enabled?: boolean;
/**
* Is this integration syncing
*

View File

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

View File

@@ -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),
}
/**

View File

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

View File

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

View File

@@ -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),
}
/**

View File

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

View File

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

View File

@@ -5,8 +5,20 @@ import type {
} from './base';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared';
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>
>;

View File

@@ -5,7 +5,7 @@ import type { Snowflake } from '../../../../globals';
*/
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),
};

View File

@@ -70,10 +70,19 @@ export interface APIApplicationCommand {
* 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;
/**

View File

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

View File

@@ -53,6 +53,12 @@ export interface APIApplication {
* See https://discord.com/developers/docs/resources/user#user-object
*/
owner?: APIUser;
/**
* An empty string
*
* @deprecated This field will be removed in v11
*/
summary: string;
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*

View File

@@ -16,6 +16,7 @@ import type {
GuildScheduledEventEntityType,
GuildScheduledEventStatus,
} from './guildScheduledEvent';
import type { APIApplicationCommand } from './interactions';
import type { APIRole } from './permissions';
import type { StageInstancePrivacyLevel } from './stageInstance';
import type { StickerFormatType } from './sticker';
@@ -27,6 +28,12 @@ import type { Snowflake } from '../../globals';
* 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,
}
/**
@@ -517,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
*/

View File

@@ -4,7 +4,6 @@
import type { APIApplication } from './application';
import type { APIPartialEmoji } from './emoji';
import type { APIGuildMember } from './guild';
import type { APIMessageInteraction } from './interactions';
import type { APIRole } from './permissions';
import type { APISticker, APIStickerItem } from './sticker';
@@ -326,10 +325,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)
*
@@ -339,15 +334,6 @@ 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
*/
@@ -377,7 +363,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
*
@@ -454,7 +440,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;
/**
@@ -517,11 +503,11 @@ export enum MessageType {
ChannelNameChange,
ChannelIconChange,
ChannelPinnedMessage,
GuildMemberJoin,
UserPremiumGuildSubscription,
UserPremiumGuildSubscriptionTier1,
UserPremiumGuildSubscriptionTier2,
UserPremiumGuildSubscriptionTier3,
UserJoin,
GuildBoost,
GuildBoostTier1,
GuildBoostTier2,
GuildBoostTier3,
ChannelFollowAdd,
GuildDiscoveryDisqualified = 14,
GuildDiscoveryRequalified,
@@ -554,7 +540,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 {
/**
@@ -921,6 +907,10 @@ export interface APIEmbedVideo {
* Source url of video
*/
url?: string;
/**
* A proxied url of the video
*/
proxy_url?: string;
/**
* Height of video
*/

View File

@@ -152,7 +152,10 @@ export interface GatewayActivity {
*/
timestamps?: GatewayActivityTimestamps;
sync_id?: string;
platform?: ActivityPlatform;
/**
* {@link ActivityPlatform}
*/
platform?: string;
/**
* Application id for the game
*/
@@ -208,10 +211,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',
}
/**

View File

@@ -2,15 +2,11 @@
* Types extracted from https://discord.com/developers/docs/resources/guild
*/
import type { APIChannel } from './channel';
import type { APIEmoji } from './emoji';
import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway';
import type { APIGuildScheduledEvent } from './guildScheduledEvent';
import type { PresenceUpdateStatus } from './gateway';
import type { APIRole } from './permissions';
import type { APIStageInstance } from './stageInstance';
import type { APISticker } from './sticker';
import type { APIUser } from './user';
import type { GatewayVoiceState } from './voice';
import type { Permissions, Snowflake } from '../../globals';
/**
@@ -196,64 +192,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)
*/
@@ -320,14 +258,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
*
@@ -338,14 +268,6 @@ export interface APIGuild extends APIPartialGuild {
* Whether the guild has the boost progress bar enabled.
*/
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
*/
guild_scheduled_events?: APIGuildScheduledEvent[];
/**
* The type of Student Hub the guild is
*/
@@ -536,14 +458,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
*/
@@ -715,7 +629,7 @@ export interface APIGuildIntegration {
/**
* Is this integration enabled
*/
enabled: boolean;
enabled?: boolean;
/**
* Is this integration syncing
*

View File

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

View File

@@ -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),
}
/**

View File

@@ -70,6 +70,8 @@ export enum RESTJSONErrorCodes {
AnnouncementEditLimitExceeded = 20022,
UnderMinimumAge = 20024,
ChannelSendRateLimit = 20028,
ServerSendRateLimit,
@@ -99,8 +101,8 @@ export enum RESTJSONErrorCodes {
MaximumNumberOfServerCategoriesReached = 30030,
GuildAlreadyHasTemplate = 30031,
MaximumThreadParticipants = 30033,
MaximumNumberOfApplicationCommandsReached,
MaximumThreadParticipants,
MaximumNumberOfNonGuildMemberBansHasBeenExceeded = 30035,
@@ -116,6 +118,8 @@ export enum RESTJSONErrorCodes {
MaximumNumberOfPinnedThreadsInForumHasBeenReached,
MaximumNumberOfTagsInForumHasBeenReached,
BitrateIsTooHighForChannelOfThisType = 30052,
Unauthorized = 40001,
VerifyYourAccount,
OpeningDirectMessagesTooFast,
@@ -148,6 +152,7 @@ export enum RESTJSONErrorCodes {
InvalidToken,
NoteWasTooLong,
ProvidedTooFewOrTooManyMessagesToDelete,
InvalidMFALevel,
MessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019,
InviteCodeInvalidOrTaken,
@@ -179,7 +184,8 @@ export enum RESTJSONErrorCodes {
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
InvalidStickerSent = 50081,
CannotEditStickersWithinMessage = 50080,
InvalidStickerSent,
InvalidActionOnArchivedThread = 50083,
InvalidThreadNotificationSettings,
@@ -194,6 +200,8 @@ export enum RESTJSONErrorCodes {
RequestBodyContainsInvalidJSON = 50109,
YouDoNotHavePermissionToSendThisSticker = 50600,
TwoFactorAuthenticationIsRequired = 60003,
NoUsersWithDiscordTagExist = 80004,
@@ -222,8 +230,13 @@ export enum RESTJSONErrorCodes {
CannotUpdateAFinishedEvent = 180000,
FailedToCreateStageNeededForStageEvent = 180002,
WebhooksCanOnlyCreateThreadsInForumChannels = 220003,
}
/**
* https://discord.com/developers/docs/reference#locales
*/
export enum Locale {
EnglishUS = 'en-US',
EnglishGB = 'en-GB',

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