mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-22 11:20:10 +00:00
Compare commits
155 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14a54994b7 | ||
|
|
7798f2642b | ||
|
|
792c60b332 | ||
|
|
3dbe985b6e | ||
|
|
af06df6cae | ||
|
|
8869e92336 | ||
|
|
b10e9bbe5a | ||
|
|
a6bcb3f0fe | ||
|
|
e2fb5ee488 | ||
|
|
0b4058bdd4 | ||
|
|
195156480c | ||
|
|
7d55b33bac | ||
|
|
ba4ee01f79 | ||
|
|
e389a2189a | ||
|
|
77585d1ffa | ||
|
|
4a25caf506 | ||
|
|
6e4a6115ae | ||
|
|
921bffd1b2 | ||
|
|
bb2ef84313 | ||
|
|
5e9bff9d0e | ||
|
|
4c334f6eb8 | ||
|
|
93667b9a9e | ||
|
|
8df9f14a24 | ||
|
|
c2bec62a8e | ||
|
|
190242a59d | ||
|
|
2b75d13b39 | ||
|
|
89bc0f40b6 | ||
|
|
2a5413def4 | ||
|
|
d7b666c739 | ||
|
|
c3fda99637 | ||
|
|
57a69a1301 | ||
|
|
e818213043 | ||
|
|
40ec4363bb | ||
|
|
190223f1f9 | ||
|
|
995126e2cc | ||
|
|
549d1daaa0 | ||
|
|
38aad33ed8 | ||
|
|
390c628ee3 | ||
|
|
c730f1a8d1 | ||
|
|
33e0f3f411 | ||
|
|
3713a553e9 | ||
|
|
b03b1fb0cd | ||
|
|
0aa384ca9a | ||
|
|
2695dade8b | ||
|
|
9d72e82e07 | ||
|
|
f91e10f830 | ||
|
|
a1869a6a6d | ||
|
|
5aa4c28635 | ||
|
|
65da837673 | ||
|
|
5e854245e1 | ||
|
|
67ecd76d3e | ||
|
|
88a60f78ef | ||
|
|
0858b7c70a | ||
|
|
cf80b2fa6b | ||
|
|
7040d9b333 | ||
|
|
5091f6e707 | ||
|
|
69aa717902 | ||
|
|
c15106b424 | ||
|
|
a1ab25db1f | ||
|
|
9448e9befd | ||
|
|
348dd416d1 | ||
|
|
aaa57b4fe9 | ||
|
|
88ce2910fb | ||
|
|
131637fbd2 | ||
|
|
8c1484ebbe | ||
|
|
8d25f233a5 | ||
|
|
df1452dc28 | ||
|
|
5053ac30d9 | ||
|
|
91a7762b5d | ||
|
|
f311574d1f | ||
|
|
e082afb93f | ||
|
|
bce07950fd | ||
|
|
70826ed76e | ||
|
|
9978b77ef2 | ||
|
|
3696ce7805 | ||
|
|
b216f7a8be | ||
|
|
05cfe1bf96 | ||
|
|
5ffb2d3586 | ||
|
|
f62f2506b0 | ||
|
|
2876125975 | ||
|
|
143b003fbe | ||
|
|
0f118d382f | ||
|
|
2dc3fd0a15 | ||
|
|
d452f6346b | ||
|
|
32f5a7b981 | ||
|
|
f4d3f4d5b1 | ||
|
|
5c7e58284e | ||
|
|
afd3b55c08 | ||
|
|
4fbe1180fc | ||
|
|
2708cb9dca | ||
|
|
a59998ad1c | ||
|
|
b08f2e34db | ||
|
|
a1100a1910 | ||
|
|
815c68fe46 | ||
|
|
04b3a7f066 | ||
|
|
b7b855b200 | ||
|
|
4e362d5260 | ||
|
|
48f0f562ba | ||
|
|
817884184b | ||
|
|
73d15ddcbb | ||
|
|
f69b586d01 | ||
|
|
1a6884423c | ||
|
|
0098889499 | ||
|
|
bd8765d666 | ||
|
|
96b4bc504d | ||
|
|
35b17dcbf8 | ||
|
|
956f289e88 | ||
|
|
ef8241fe88 | ||
|
|
248484e556 | ||
|
|
1fe707c00e | ||
|
|
5bb50ae7ea | ||
|
|
0fab79feda | ||
|
|
4732f1abbe | ||
|
|
796f6d8a3b | ||
|
|
4488d8fd26 | ||
|
|
9a50367dad | ||
|
|
dc3d5df0a2 | ||
|
|
0e03e39aa2 | ||
|
|
f8a9c8b5c6 | ||
|
|
3eb239ce0c | ||
|
|
48016e5115 | ||
|
|
a08e82f097 | ||
|
|
1def1010ca | ||
|
|
af8e7c7a5b | ||
|
|
cecf17b415 | ||
|
|
cb6d4bacc4 | ||
|
|
0a2e7787c6 | ||
|
|
65b672e2af | ||
|
|
2b53b20b84 | ||
|
|
907d88ada9 | ||
|
|
8465c5866c | ||
|
|
09a114133c | ||
|
|
4577ac2609 | ||
|
|
59e247729f | ||
|
|
e78de0c83b | ||
|
|
3644b70e2e | ||
|
|
4af2ea9141 | ||
|
|
f2c3451c2a | ||
|
|
d503c71252 | ||
|
|
e253a4ac87 | ||
|
|
84226e402a | ||
|
|
2e84efb9b8 | ||
|
|
df1527c4bb | ||
|
|
2cade98ed0 | ||
|
|
d3535d6db1 | ||
|
|
2f2d4ae3fa | ||
|
|
0c65d40af0 | ||
|
|
12072b70a0 | ||
|
|
34908aa4ce | ||
|
|
b2eeb3f27b | ||
|
|
fc3aa1c911 | ||
|
|
06098869d5 | ||
|
|
a2d76fc7ca | ||
|
|
56d491fa68 | ||
|
|
3b10c60faa |
25
.github/ISSUE_TEMPLATE/bug_report.md
vendored
25
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -1,25 +0,0 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report incorrect or unexpected behavior of discord-api-types
|
||||
title: ''
|
||||
labels: 'bug'
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
<!-- Use Discord for questions: https://discord.gg/djs -->
|
||||
|
||||
**Please describe the problem you are having in as much detail as possible:**
|
||||
|
||||
**Include a reproducible code sample here, if possible:**
|
||||
|
||||
```ts
|
||||
// Place your code here
|
||||
```
|
||||
|
||||
**Further details:**
|
||||
|
||||
- Runtime:
|
||||
<!-- Complete whichever is applicable -->
|
||||
- Node.js version:
|
||||
- deno version:
|
||||
- Priority this issue should have – please be realistic and elaborate if possible:
|
||||
83
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
83
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
name: Bug report
|
||||
description: Report incorrect or unexpected behavior of discord-api-types, or a mistyped type
|
||||
labels: [bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Use Discord for questions: https://discord.gg/djs
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Issue description
|
||||
description: |
|
||||
Please describe the problem you are having in as much detail as possible.
|
||||
|
||||
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files into it.
|
||||
placeholder: |
|
||||
Steps to reproduce with below code sample:
|
||||
1. do thing
|
||||
2. it broke :c
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: codesample
|
||||
attributes:
|
||||
label: Code sample
|
||||
description: Include a reproducible, minimal code sample. This will be automatically formatted into code, so no need for backticks.
|
||||
render: typescript
|
||||
placeholder: |
|
||||
Your code sample should be...
|
||||
... Minimal - Use as little code as possible that still produces the same problem (and is understandable)
|
||||
... Complete - Provide all parts someone else needs to reproduce your problem
|
||||
... Reproducible - Test the code you're about to provide to make sure it reproduces the problem
|
||||
|
||||
- type: input
|
||||
id: types-version
|
||||
attributes:
|
||||
label: Package version
|
||||
description: Which version of the package are you using? Run `npm list discord-api-types` in your project directory and paste the output.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: runtime
|
||||
attributes:
|
||||
label: Runtime
|
||||
description: What runtime are you using?
|
||||
options:
|
||||
- Node.js
|
||||
- Deno
|
||||
- Bun
|
||||
- Other / Browser
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: runtime-version
|
||||
attributes:
|
||||
label: Runtime version
|
||||
description: |
|
||||
Which version of your runtime of choice are you using?
|
||||
If you are using TypeScript, please include its version (`npm list typescript`) as well.
|
||||
For Node.js: Run `node --version` in your project directory and paste the output.
|
||||
For Deno: Run `deno --version` in your project directory and paste the output.
|
||||
For Bun: Run `bun --version` in your project directory and paste the output.
|
||||
For Other / Browser: Find the version in your runtime of choice and paste it here.
|
||||
placeholder: v4.2.0
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: priority
|
||||
attributes:
|
||||
label: Priority this issue should have
|
||||
description: Please be realistic. If you need to elaborate on your reasoning, please use the Issue description field above.
|
||||
options:
|
||||
- Low (slightly annoying)
|
||||
- Medium (should be fixed soon)
|
||||
- High (immediate attention needed)
|
||||
validations:
|
||||
required: true
|
||||
21
.github/ISSUE_TEMPLATE/feature_request.md
vendored
21
.github/ISSUE_TEMPLATE/feature_request.md
vendored
@@ -1,21 +0,0 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Request a feature for the discord-api-types library
|
||||
title: ''
|
||||
labels: 'discussion'
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
<!-- Use Discord for questions: https://discord.gg/djs -->
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Eg. I'm always frustrated when [...]
|
||||
|
||||
**Describe the ideal solution**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
39
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
39
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Feature request
|
||||
description: Request a feature for the discord-api-types library (we accept documented features of the official Discord developer API only!)
|
||||
labels: [discussion]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
We will only only document types that Discord publishes, documents, and merges into the Discord API documentation.
|
||||
We do not implement unreleased types, or types considered client only.
|
||||
Use Discord for questions: https://discord.gg/djs
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Feature
|
||||
description: A clear and concise description of what the problem is, or what feature you want to be implemented.
|
||||
placeholder: I'm always frustrated when..., Discord has recently released..., A good addition would be...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: solution
|
||||
attributes:
|
||||
label: Ideal solution or implementation
|
||||
description: A clear and concise description of what you want to happen.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: alternatives
|
||||
attributes:
|
||||
label: Alternative solutions or implementations
|
||||
description: A clear and concise description of any alternative solutions or features you have considered.
|
||||
|
||||
- type: textarea
|
||||
id: additional-context
|
||||
attributes:
|
||||
label: Other context
|
||||
description: Any other context, screenshots, or file uploads that help us understand your feature request.
|
||||
1
.github/auto_assign.yml
vendored
1
.github/auto_assign.yml
vendored
@@ -5,3 +5,4 @@ reviewers:
|
||||
- kyranet
|
||||
- vladfrangu
|
||||
numberOfReviewers: 0
|
||||
runOnDraft: true
|
||||
|
||||
2
.github/labels.yml
vendored
2
.github/labels.yml
vendored
@@ -5,6 +5,8 @@
|
||||
color: 'e4f486'
|
||||
- name: 'semver:patch'
|
||||
color: 'e8be8b'
|
||||
- name: 'blocked'
|
||||
color: 'fc1423'
|
||||
- name: 'question (please use Discord instead)'
|
||||
color: 'd876e3'
|
||||
- name: 'regression'
|
||||
|
||||
4
.github/workflows/pr-automation.yml
vendored
4
.github/workflows/pr-automation.yml
vendored
@@ -14,5 +14,5 @@ jobs:
|
||||
sync-labels: true
|
||||
|
||||
- name: Automatically assign reviewers
|
||||
if: ${{ github.event.action == 'opened' }}
|
||||
uses: kentaro-m/auto-assign-action@v1.1.2
|
||||
if: github.event.action == 'opened'
|
||||
uses: kentaro-m/auto-assign-action@v1.2.4
|
||||
|
||||
280
CHANGELOG.md
280
CHANGELOG.md
@@ -1,3 +1,283 @@
|
||||
## [0.37.28](https://github.com/discordjs/discord-api-types/compare/0.37.27...0.37.28) (2023-01-12)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **GuildIntegration:** `enabled` and `user` are present on bots ([#660](https://github.com/discordjs/discord-api-types/issues/660)) ([b10e9bb](https://github.com/discordjs/discord-api-types/commit/b10e9bbe5ab450df065fc78da85d49f335db2b82))
|
||||
|
||||
### Features
|
||||
|
||||
- Add role subscription data and system channel flags ([#686](https://github.com/discordjs/discord-api-types/issues/686)) ([792c60b](https://github.com/discordjs/discord-api-types/commit/792c60b3328d8440de79546bf43d6b317400c788))
|
||||
- **APIRoleTags:** add `guild_connections` ([#675](https://github.com/discordjs/discord-api-types/issues/675)) ([3dbe985](https://github.com/discordjs/discord-api-types/commit/3dbe985b6e05e6aa68248e79f45d550e783bc6a7))
|
||||
- **APIThreadMember:** add support for thread member pagination ([#689](https://github.com/discordjs/discord-api-types/issues/689)) ([e2fb5ee](https://github.com/discordjs/discord-api-types/commit/e2fb5ee4886a33bb752a75d5894f726f6f76340f))
|
||||
- **ConnectionService:** add TikTok ([#632](https://github.com/discordjs/discord-api-types/issues/632)) ([af06df6](https://github.com/discordjs/discord-api-types/commit/af06df6cae224a60e7a35e356028677e8736ed89))
|
||||
- **RESTJSONErrorCodes:** add error `50091` ([#671](https://github.com/discordjs/discord-api-types/issues/671)) ([8869e92](https://github.com/discordjs/discord-api-types/commit/8869e923362740e491f267d71073d4266d36cb42))
|
||||
- role subscriptions ([#665](https://github.com/discordjs/discord-api-types/issues/665)) ([0b4058b](https://github.com/discordjs/discord-api-types/commit/0b4058bdd48b74fcd9944dcf4b6f98d5e0bee105))
|
||||
- **StickerFormatType:** add `GIF` ([#688](https://github.com/discordjs/discord-api-types/issues/688)) ([a6bcb3f](https://github.com/discordjs/discord-api-types/commit/a6bcb3f0fe7bc4edceee61b7cdab0e46db9c7109))
|
||||
|
||||
## [0.37.27](https://github.com/discordjs/discord-api-types/compare/0.37.26...0.37.27) (2023-01-09)
|
||||
|
||||
### Features
|
||||
|
||||
- **MessageType:** add missing types ([#681](https://github.com/discordjs/discord-api-types/issues/681)) ([7d55b33](https://github.com/discordjs/discord-api-types/commit/7d55b33bacb96e156f41fb67a1819c07c8fa959f))
|
||||
|
||||
## [0.37.26](https://github.com/discordjs/discord-api-types/compare/0.37.25...0.37.26) (2023-01-05)
|
||||
|
||||
### Features
|
||||
|
||||
- add RESTJSONErrorCode `40062` and RESTRateLimit.code ([#620](https://github.com/discordjs/discord-api-types/issues/620)) ([4a25caf](https://github.com/discordjs/discord-api-types/commit/4a25caf506c685a8e0af630eef3bd3d2735d64ed))
|
||||
- **RESTGetAPIAuditLogQuery:** support `after` ([#682](https://github.com/discordjs/discord-api-types/issues/682)) ([bb2ef84](https://github.com/discordjs/discord-api-types/commit/bb2ef843133b29e3042bdfde20b5adb1c3639e01))
|
||||
- **RESTJSONErrorCodes:** add error `30058` ([#676](https://github.com/discordjs/discord-api-types/issues/676)) ([921bffd](https://github.com/discordjs/discord-api-types/commit/921bffd1b210b6cf2dc6971e451fa0a9e6f6c185))
|
||||
- **RESTJSONErrorCodes:** add error `50067` ([#640](https://github.com/discordjs/discord-api-types/issues/640)) ([6e4a611](https://github.com/discordjs/discord-api-types/commit/6e4a6115ae44aca5c0b61f621ad75829632850f4))
|
||||
|
||||
## [0.37.25](https://github.com/discordjs/discord-api-types/compare/0.37.24...0.37.25) (2022-12-29)
|
||||
|
||||
## [0.37.24](https://github.com/discordjs/discord-api-types/compare/0.37.23...0.37.24) (2022-12-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIApplicationRoleConnection:** `metadata` values can be numbers ([#673](https://github.com/discordjs/discord-api-types/issues/673)) ([8df9f14](https://github.com/discordjs/discord-api-types/commit/8df9f14a24b714d3b009711eec894cad1e199881))
|
||||
|
||||
## [0.37.23](https://github.com/discordjs/discord-api-types/compare/0.37.22...0.37.23) (2022-12-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIChannel:** correctly type present properties based on channel type ([#669](https://github.com/discordjs/discord-api-types/issues/669)) ([2a5413d](https://github.com/discordjs/discord-api-types/commit/2a5413def49dbb413227d9b02be500b9184b731d))
|
||||
- **Interactions:** make app_permissions required ([#652](https://github.com/discordjs/discord-api-types/issues/652)) ([89bc0f4](https://github.com/discordjs/discord-api-types/commit/89bc0f40b60434a768abac95188a2e4e47c2acd9))
|
||||
|
||||
### Features
|
||||
|
||||
- add role connections ([#651](https://github.com/discordjs/discord-api-types/issues/651)) ([d7b666c](https://github.com/discordjs/discord-api-types/commit/d7b666c739bb848ead5a3af09e37e64ed962014b))
|
||||
- **APIApplicationCommand:** add `nsfw` field ([#637](https://github.com/discordjs/discord-api-types/issues/637)) ([c3fda99](https://github.com/discordjs/discord-api-types/commit/c3fda99637b4d7688111180f90d6aa41c008ed17))
|
||||
- **APIGuildForumChannel:** add `default_forum_layout` ([#658](https://github.com/discordjs/discord-api-types/issues/658)) ([190242a](https://github.com/discordjs/discord-api-types/commit/190242a59d5512fdc766217ec9f7c9c54a7b2dcb))
|
||||
- **Locale:** add Indonesian locale ([#643](https://github.com/discordjs/discord-api-types/issues/643)) ([2b75d13](https://github.com/discordjs/discord-api-types/commit/2b75d13b393f8f9011ec68617cb4e9f9d3fa09e7))
|
||||
|
||||
## [0.37.22](https://github.com/discordjs/discord-api-types/compare/0.37.21...0.37.22) (2022-12-12)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIChannel:** correctly type `name` based on channel type ([#666](https://github.com/discordjs/discord-api-types/issues/666)) ([995126e](https://github.com/discordjs/discord-api-types/commit/995126e2cc1494f9fad2ad7c44ecc87898994e44))
|
||||
|
||||
## [0.37.21](https://github.com/discordjs/discord-api-types/compare/0.37.20...0.37.21) (2022-12-05)
|
||||
|
||||
## [0.37.20](https://github.com/discordjs/discord-api-types/compare/0.37.19...0.37.20) (2022-11-24)
|
||||
|
||||
## [0.37.19](https://github.com/discordjs/discord-api-types/compare/0.37.18...0.37.19) (2022-11-21)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIGuildChannel:** make position of guild channel non optional ([#647](https://github.com/discordjs/discord-api-types/issues/647)) ([9d72e82](https://github.com/discordjs/discord-api-types/commit/9d72e82e07e3a3bb9a894081d955bdc5c6b64089))
|
||||
- **channel:** add missing type aliases ([#648](https://github.com/discordjs/discord-api-types/issues/648)) ([2695dad](https://github.com/discordjs/discord-api-types/commit/2695dade8be818cf5bacbe69ec9aca0b50b9f9b0))
|
||||
|
||||
### Features
|
||||
|
||||
- **GuildFeatures:** Add `APPLICATION_COMMAND_PERMISSIONS_V2` ([#646](https://github.com/discordjs/discord-api-types/issues/646)) ([a1869a6](https://github.com/discordjs/discord-api-types/commit/a1869a6a6d4e15adf7a3cf64cade1ed051b330fc))
|
||||
|
||||
## [0.37.18](https://github.com/discordjs/discord-api-types/compare/0.37.17...0.37.18) (2022-11-14)
|
||||
|
||||
### Features
|
||||
|
||||
- **UserFlags:** add `ActiveDeveloper` ([#638](https://github.com/discordjs/discord-api-types/issues/638)) ([65da837](https://github.com/discordjs/discord-api-types/commit/65da837673142267a92aea28ecd65d3c05aa0706))
|
||||
|
||||
## [0.37.17](https://github.com/discordjs/discord-api-types/compare/0.37.16...0.37.17) (2022-11-07)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIAutoMod:** add support for regex matching ([#603](https://github.com/discordjs/discord-api-types/issues/603)) ([88a60f7](https://github.com/discordjs/discord-api-types/commit/88a60f78efb6498d861b33d54c809d9d1b39b3d7))
|
||||
|
||||
## [0.37.16](https://github.com/discordjs/discord-api-types/compare/0.37.15...0.37.16) (2022-10-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **docs:** update gateway documentation links ([#628](https://github.com/discordjs/discord-api-types/issues/628)) ([7040d9b](https://github.com/discordjs/discord-api-types/commit/7040d9b33370a5d1d7d3c3cb10a25c0e5fb7d0b8))
|
||||
- export `RESTGetAPIVoiceRegionsResult` with the correct name ([#627](https://github.com/discordjs/discord-api-types/issues/627)) ([69aa717](https://github.com/discordjs/discord-api-types/commit/69aa7179028e0a011e6ba246cc1faa55f463c619))
|
||||
- **UserFlags:** hardcode the value of `Quarantined` ([#624](https://github.com/discordjs/discord-api-types/issues/624)) ([5091f6e](https://github.com/discordjs/discord-api-types/commit/5091f6e70774fd97ec7dd3ae3f500c3850f81d94))
|
||||
|
||||
## [0.37.15](https://github.com/discordjs/discord-api-types/compare/0.37.14...0.37.15) (2022-10-27)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- `default_thread_rate_limit_per_user` is only for forum channels ([#596](https://github.com/discordjs/discord-api-types/issues/596)) ([88ce291](https://github.com/discordjs/discord-api-types/commit/88ce2910fb3640d9be165ac9f6488cc7e4c32663))
|
||||
- add missing gateway dispatch payloads to gateway event union ([#619](https://github.com/discordjs/discord-api-types/issues/619)) ([348dd41](https://github.com/discordjs/discord-api-types/commit/348dd416d1c94231fdfda88fa0ef03b34a384bb4))
|
||||
- **APIGuild:** change type of `afk_timeout` to allowed values ([#590](https://github.com/discordjs/discord-api-types/issues/590)) ([aaa57b4](https://github.com/discordjs/discord-api-types/commit/aaa57b4fe96b4f045b312c1a6a2ed17f9fcb3552))
|
||||
|
||||
### Features
|
||||
|
||||
- add some missing REST types ([#612](https://github.com/discordjs/discord-api-types/issues/612)) ([8d25f23](https://github.com/discordjs/discord-api-types/commit/8d25f233a5366f1d43de942f465e696c73f26c86))
|
||||
- **Components:** new select menus ([#602](https://github.com/discordjs/discord-api-types/issues/602)) ([df1452d](https://github.com/discordjs/discord-api-types/commit/df1452dc28f2fddb32a20912ca3ca3634556a3da))
|
||||
- **GuildFeature:** add `DeveloperSupportServer` ([#618](https://github.com/discordjs/discord-api-types/issues/618)) ([8c1484e](https://github.com/discordjs/discord-api-types/commit/8c1484ebbe95afbd850b22262d6223b2f3d40017))
|
||||
- **RESTJSONErrorCodes:** add 50039 error ([#607](https://github.com/discordjs/discord-api-types/issues/607)) ([131637f](https://github.com/discordjs/discord-api-types/commit/131637fbd20573750a60df2281f94b339443c82c))
|
||||
- **UserPremiumType:** add `NitroBasic` ([#616](https://github.com/discordjs/discord-api-types/issues/616)) ([9448e9b](https://github.com/discordjs/discord-api-types/commit/9448e9befdfff38ecbf186e5dc9c1fcd88596422))
|
||||
|
||||
## [0.37.14](https://github.com/discordjs/discord-api-types/compare/0.37.13...0.37.14) (2022-10-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIAutoModeration:** export v10 json payloads and correct route types ([#608](https://github.com/discordjs/discord-api-types/issues/608)) ([bce0795](https://github.com/discordjs/discord-api-types/commit/bce07950fdfec7ae5e96ce3158f73cfb5db0a890))
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add error `50073` ([#594](https://github.com/discordjs/discord-api-types/issues/594)) ([70826ed](https://github.com/discordjs/discord-api-types/commit/70826ed76e4b4880fb7425a07d04921823954c95))
|
||||
|
||||
## [0.37.13](https://github.com/discordjs/discord-api-types/compare/0.37.12...0.37.13) (2022-10-14)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIAutoModeration:** add support for auto moderation ([#418](https://github.com/discordjs/discord-api-types/issues/418)) ([b216f7a](https://github.com/discordjs/discord-api-types/commit/b216f7a8bee2c02fe0e75189fe31f95973bfbe2e))
|
||||
|
||||
## [0.37.12](https://github.com/discordjs/discord-api-types/compare/0.37.11...0.37.12) (2022-10-06)
|
||||
|
||||
## [0.37.11](https://github.com/discordjs/discord-api-types/compare/0.37.10...0.37.11) (2022-09-26)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIGuildForumChannel:** add `default_sort_order` ([#589](https://github.com/discordjs/discord-api-types/issues/589)) ([143b003](https://github.com/discordjs/discord-api-types/commit/143b003fbe5a86eda225e9da1d0914d6e48cddfd))
|
||||
- **APIGuildForumChannel:** update and add missing features ([#575](https://github.com/discordjs/discord-api-types/issues/575)) ([0f118d3](https://github.com/discordjs/discord-api-types/commit/0f118d382f94151b1c9be42620520c91b20a05f6))
|
||||
|
||||
## [0.37.10](https://github.com/discordjs/discord-api-types/compare/0.37.9...0.37.10) (2022-09-15)
|
||||
|
||||
### Features
|
||||
|
||||
- add `RESTRateLimit` ([#585](https://github.com/discordjs/discord-api-types/issues/585)) ([f4d3f4d](https://github.com/discordjs/discord-api-types/commit/f4d3f4d5b1c1b6e42c2a8f8184f43d67b586c8c1))
|
||||
- **APIConnection:** add `two_way_link` ([#546](https://github.com/discordjs/discord-api-types/issues/546)) ([d452f63](https://github.com/discordjs/discord-api-types/commit/d452f6346bd4953a8d777f3818797c4285b1b842))
|
||||
- **APIGuild:** document afk timeout values ([#570](https://github.com/discordjs/discord-api-types/issues/570)) ([32f5a7b](https://github.com/discordjs/discord-api-types/commit/32f5a7b9814b69da7fc3772ec1f0307d39cda087))
|
||||
|
||||
## [0.37.9](https://github.com/discordjs/discord-api-types/compare/0.37.8...0.37.9) (2022-09-12)
|
||||
|
||||
### Features
|
||||
|
||||
- **ConnectionService:** add new connections ([#548](https://github.com/discordjs/discord-api-types/issues/548)) ([afd3b55](https://github.com/discordjs/discord-api-types/commit/afd3b55c08b0cf75cc4f5a06d3574b6cf532cb6c))
|
||||
|
||||
## [0.37.8](https://github.com/discordjs/discord-api-types/compare/0.37.7...0.37.8) (2022-09-08)
|
||||
|
||||
### Features
|
||||
|
||||
- **GuildFeature:** add `InvitesDisabled` ([#549](https://github.com/discordjs/discord-api-types/issues/549)) ([2708cb9](https://github.com/discordjs/discord-api-types/commit/2708cb9dcaa07d19ca71e9ca211e78939b9d1ff4))
|
||||
|
||||
## [0.37.7](https://github.com/discordjs/discord-api-types/compare/0.37.6...0.37.7) (2022-09-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **ChannelType:** bring back old names ([b08f2e3](https://github.com/discordjs/discord-api-types/commit/b08f2e34dbe9afccca6f565db6c7b27a21453d85))
|
||||
|
||||
## [0.37.6](https://github.com/discordjs/discord-api-types/compare/0.37.5...0.37.6) (2022-09-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIModalSubmission:** `components` is not optional ([#574](https://github.com/discordjs/discord-api-types/issues/574)) ([f69b586](https://github.com/discordjs/discord-api-types/commit/f69b586d0148afd017e6da70ab8d745b6ba04ba4))
|
||||
- **GuildChannelType:** add missing `GuildCategory` type ([#579](https://github.com/discordjs/discord-api-types/issues/579)) ([815c68f](https://github.com/discordjs/discord-api-types/commit/815c68fe46034029200a8e2903748a3d2e6af7b9))
|
||||
- **RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody:** `channel_id` is optional ([#547](https://github.com/discordjs/discord-api-types/issues/547)) ([b7b855b](https://github.com/discordjs/discord-api-types/commit/b7b855b2005bb3989810850d6e00bec443a15c92))
|
||||
|
||||
### Features
|
||||
|
||||
- **APIGuildIntegration:** add `scopes` ([#563](https://github.com/discordjs/discord-api-types/issues/563)) ([73d15dd](https://github.com/discordjs/discord-api-types/commit/73d15ddcbbc676efac876602a3cd726bfe4c378a))
|
||||
- **ApplicationFlags:** add `ApplicationCommandBadge` ([#537](https://github.com/discordjs/discord-api-types/issues/537)) ([48f0f56](https://github.com/discordjs/discord-api-types/commit/48f0f562bab10d2a1e331474fb963af8631b788b))
|
||||
- **RESTPutAPIGuildBanJSONBody:** add `delete_message_seconds` ([#534](https://github.com/discordjs/discord-api-types/issues/534)) ([4e362d5](https://github.com/discordjs/discord-api-types/commit/4e362d52608e99d466b43cd37ec6b6bb1222b660))
|
||||
|
||||
## [0.37.5](https://github.com/discordjs/discord-api-types/compare/0.37.4...0.37.5) (2022-08-25)
|
||||
|
||||
### Features
|
||||
|
||||
- **FormattingPatterns:** add `ApplicationCommand` ([#525](https://github.com/discordjs/discord-api-types/issues/525)) ([0098889](https://github.com/discordjs/discord-api-types/commit/00988894995f7ac5e8ddc34125704a230329137c))
|
||||
|
||||
## [0.37.4](https://github.com/discordjs/discord-api-types/compare/0.37.3...0.37.4) (2022-08-22)
|
||||
|
||||
### Features
|
||||
|
||||
- add common JSON error types ([#568](https://github.com/discordjs/discord-api-types/issues/568)) ([956f289](https://github.com/discordjs/discord-api-types/commit/956f289e885763a620cb67a36e7e42683b5c08bf))
|
||||
- **ApplicationCommand:** export base chat input types ([#569](https://github.com/discordjs/discord-api-types/issues/569)) ([248484e](https://github.com/discordjs/discord-api-types/commit/248484e55613e2da3f1d659395e1f4c010cb51b5))
|
||||
|
||||
## [0.37.3](https://github.com/discordjs/discord-api-types/compare/0.37.2...0.37.3) (2022-08-18)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add 240000 ([#565](https://github.com/discordjs/discord-api-types/issues/565)) ([5bb50ae](https://github.com/discordjs/discord-api-types/commit/5bb50ae7ea6859845c9d9996f02ac42c61413df0))
|
||||
|
||||
## [0.37.2](https://github.com/discordjs/discord-api-types/compare/0.37.1...0.37.2) (2022-08-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **GatewayGuildMembersChunkDispatchData:** make chunk pagination properties mandatory ([#558](https://github.com/discordjs/discord-api-types/issues/558)) ([0e03e39](https://github.com/discordjs/discord-api-types/commit/0e03e39aa2bf8f1b9a58113a3242c4722e64922b))
|
||||
- **GatewayRequestGuildMembersData:** limit being required with user_ids ([#559](https://github.com/discordjs/discord-api-types/issues/559)) ([dc3d5df](https://github.com/discordjs/discord-api-types/commit/dc3d5df0a2931eff63991987166634661d5bd1d8))
|
||||
- **RESTGetAPIChannelUsersThreadsArchivedResult:** add `has_more` missing field ([#543](https://github.com/discordjs/discord-api-types/issues/543)) ([796f6d8](https://github.com/discordjs/discord-api-types/commit/796f6d8a3b2f55d2a120137801e0450ddf30576e))
|
||||
|
||||
### Features
|
||||
|
||||
- add search that might or might not work ([f8a9c8b](https://github.com/discordjs/discord-api-types/commit/f8a9c8b5c6bdd73bcbf9dd6fff66fafac2594ba4))
|
||||
- **APIVoiceChannel:** support text in voice, properties `last_message_id` and `rate_limit_per_user` ([#544](https://github.com/discordjs/discord-api-types/issues/544)) ([4488d8f](https://github.com/discordjs/discord-api-types/commit/4488d8fd2611a6547fc6149ba1cec5682340a119))
|
||||
- **GatewayReadyDispatchData:** add `resume_gateway_url` ([#552](https://github.com/discordjs/discord-api-types/issues/552)) ([9a50367](https://github.com/discordjs/discord-api-types/commit/9a50367dad3a06fbca6e8d1fdd98fbf144595d4e))
|
||||
|
||||
## [0.37.1](https://github.com/discordjs/discord-api-types/compare/0.37.0...0.37.1) (2022-08-04)
|
||||
|
||||
# [0.37.0](https://github.com/discordjs/discord-api-types/compare/0.36.3...0.37.0) (2022-07-28)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **RESTJSONErrorCodes:** use `MaximumThreadParticipantsReached` instead in error code 30033 ([#540](https://github.com/discordjs/discord-api-types/issues/540)) ([cecf17b](https://github.com/discordjs/discord-api-types/commit/cecf17b4158fbebb3ee508518a9e9a7b1297356f))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **RESTJSONErrorCodes:** `MaximumThreadParticipants` was renamed to `MaximumThreadParticipantsReached` for consistency with the rest of the codes
|
||||
|
||||
## [0.36.3](https://github.com/discordjs/discord-api-types/compare/0.36.2...0.36.3) (2022-07-21)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIConnection:** add `ConnectionService` to `type` ([#491](https://github.com/discordjs/discord-api-types/issues/491)) ([4577ac2](https://github.com/discordjs/discord-api-types/commit/4577ac2609f4a861505bc41f4293f482db251cdc))
|
||||
- **APIThreadChannel:** add fields about new message counter capability ([#532](https://github.com/discordjs/discord-api-types/issues/532)) ([2b53b20](https://github.com/discordjs/discord-api-types/commit/2b53b20b84b7434b9a35b715d8ebdeb040835dca))
|
||||
- **GatewayGuildCreateDispatchData:** add missing `unavailable` ([#504](https://github.com/discordjs/discord-api-types/issues/504)) ([59e2477](https://github.com/discordjs/discord-api-types/commit/59e247729fcd27be839c88516939ec22843781ce))
|
||||
- **RESTJSONErrorCodes:** add `ApplicationNotYetAvailable` ([#507](https://github.com/discordjs/discord-api-types/issues/507)) ([09a1141](https://github.com/discordjs/discord-api-types/commit/09a114133c7599cc14d4a0eb61425162091c45ee))
|
||||
- **RESTJSONErrorCodes:** add error `30034` ([#530](https://github.com/discordjs/discord-api-types/issues/530)) ([0a2e778](https://github.com/discordjs/discord-api-types/commit/0a2e7787c672ffb4af83e055df632aae36811445))
|
||||
- **RESTJSONErrorCodes:** add error `50132` ([#505](https://github.com/discordjs/discord-api-types/issues/505)) ([907d88a](https://github.com/discordjs/discord-api-types/commit/907d88ada93221802a4aefe7dc0ca3b2b73f94f0))
|
||||
- **RESTJSONErrorCodes:** add error `50146` ([#527](https://github.com/discordjs/discord-api-types/issues/527)) ([e78de0c](https://github.com/discordjs/discord-api-types/commit/e78de0c83ba93145a2302ddea2e55b5050291c52))
|
||||
- **RESTJSONErrorCodes:** add new errors ([#506](https://github.com/discordjs/discord-api-types/issues/506)) ([65b672e](https://github.com/discordjs/discord-api-types/commit/65b672e2afd2135333272d4e7b771eba237a21b6))
|
||||
|
||||
## [0.36.2](https://github.com/discordjs/discord-api-types/compare/0.36.1...0.36.2) (2022-07-14)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add error `30032` ([#521](https://github.com/discordjs/discord-api-types/issues/521)) ([f2c3451](https://github.com/discordjs/discord-api-types/commit/f2c3451c2a8bc91bcca65372d2944a07a3c34a9a))
|
||||
- **RESTPutAPIApplicationGuildCommandsJSONBody:** add missing `id` ([#522](https://github.com/discordjs/discord-api-types/issues/522)) ([4af2ea9](https://github.com/discordjs/discord-api-types/commit/4af2ea91415a5662171d342379c4bd33bfa5a6d5))
|
||||
|
||||
## [0.36.1](https://github.com/discordjs/discord-api-types/compare/0.36.0...0.36.1) (2022-07-04)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIApplicationCommandStringOption:** add `min_length` and `max_length` ([#513](https://github.com/discordjs/discord-api-types/issues/513)) ([2cade98](https://github.com/discordjs/discord-api-types/commit/2cade98ed0a0a074254fbc1580fc56d0e0b3dc9c))
|
||||
|
||||
# [0.36.0](https://github.com/discordjs/discord-api-types/compare/0.35.0...0.36.0) (2022-06-30)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIBaseInteraction:** add `app_permissions` ([#509](https://github.com/discordjs/discord-api-types/issues/509)) ([0c65d40](https://github.com/discordjs/discord-api-types/commit/0c65d40af00499233830ce272a2a274bcd5b9e8c))
|
||||
- **MessageType:** update names ([#498](https://github.com/discordjs/discord-api-types/issues/498)) ([12072b7](https://github.com/discordjs/discord-api-types/commit/12072b70a0c70e1e1f9de920789e26829268de12))
|
||||
- **RESTJSONErrorCodes:** add error 20024 ([#480](https://github.com/discordjs/discord-api-types/issues/480)) ([34908aa](https://github.com/discordjs/discord-api-types/commit/34908aa4ceeca4b58276cc207f5bdb77cef04296))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **MessageType:** The following message types have been renamed:
|
||||
|
||||
* `GuildMemberJoin` -> `UserJoin`
|
||||
* `UserPremiumGuildSubscription` -> `GuildBoost`
|
||||
* `UserPremiumGuildSubscriptionTier1` -> `GuildBoostTier1`
|
||||
* `UserPremiumGuildSubscriptionTier2` -> `GuildBoostTier2`
|
||||
* `UserPremiumGuildSubscriptionTier3` -> `GuildBoostTier3`
|
||||
|
||||
# [0.35.0](https://github.com/discordjs/discord-api-types/compare/0.34.0...0.35.0) (2022-06-23)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **GatewayIdentifyProperties:** remove `$` prefix from keys ([#493](https://github.com/discordjs/discord-api-types/issues/493)) ([3b10c60](https://github.com/discordjs/discord-api-types/commit/3b10c60faa5943501ab1f7cfa0d5f3c5317cdbbd))
|
||||
|
||||
### Features
|
||||
|
||||
- **APIEmbedVideo:** add missing `proxy_url` property ([#496](https://github.com/discordjs/discord-api-types/issues/496)) ([56d491f](https://github.com/discordjs/discord-api-types/commit/56d491fa6808d9a8762bff606ca8feb5e11f13a4))
|
||||
- **REST:** add `CDNRoutes` ([#502](https://github.com/discordjs/discord-api-types/issues/502)) ([0609886](https://github.com/discordjs/discord-api-types/commit/06098869d552139fadcc204b5ce4e1a7e5352b68))
|
||||
- **UserFlags:** add `Quarantined` flag ([#495](https://github.com/discordjs/discord-api-types/issues/495)) ([fc3aa1c](https://github.com/discordjs/discord-api-types/commit/fc3aa1c9110e4730c6b8ba3e36815ecd2da66c68))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **GatewayIdentifyProperties:** The fields for identify no longer use the `$` prefix for the values.
|
||||
|
||||
# [0.34.0](https://github.com/discordjs/discord-api-types/compare/0.33.5...0.34.0) (2022-06-13)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
@@ -1,3 +1,283 @@
|
||||
## [0.37.28](https://github.com/discordjs/discord-api-types/compare/0.37.27...0.37.28) (2023-01-12)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **GuildIntegration:** `enabled` and `user` are present on bots ([#660](https://github.com/discordjs/discord-api-types/issues/660)) ([b10e9bb](https://github.com/discordjs/discord-api-types/commit/b10e9bbe5ab450df065fc78da85d49f335db2b82))
|
||||
|
||||
### Features
|
||||
|
||||
- Add role subscription data and system channel flags ([#686](https://github.com/discordjs/discord-api-types/issues/686)) ([792c60b](https://github.com/discordjs/discord-api-types/commit/792c60b3328d8440de79546bf43d6b317400c788))
|
||||
- **APIRoleTags:** add `guild_connections` ([#675](https://github.com/discordjs/discord-api-types/issues/675)) ([3dbe985](https://github.com/discordjs/discord-api-types/commit/3dbe985b6e05e6aa68248e79f45d550e783bc6a7))
|
||||
- **APIThreadMember:** add support for thread member pagination ([#689](https://github.com/discordjs/discord-api-types/issues/689)) ([e2fb5ee](https://github.com/discordjs/discord-api-types/commit/e2fb5ee4886a33bb752a75d5894f726f6f76340f))
|
||||
- **ConnectionService:** add TikTok ([#632](https://github.com/discordjs/discord-api-types/issues/632)) ([af06df6](https://github.com/discordjs/discord-api-types/commit/af06df6cae224a60e7a35e356028677e8736ed89))
|
||||
- **RESTJSONErrorCodes:** add error `50091` ([#671](https://github.com/discordjs/discord-api-types/issues/671)) ([8869e92](https://github.com/discordjs/discord-api-types/commit/8869e923362740e491f267d71073d4266d36cb42))
|
||||
- role subscriptions ([#665](https://github.com/discordjs/discord-api-types/issues/665)) ([0b4058b](https://github.com/discordjs/discord-api-types/commit/0b4058bdd48b74fcd9944dcf4b6f98d5e0bee105))
|
||||
- **StickerFormatType:** add `GIF` ([#688](https://github.com/discordjs/discord-api-types/issues/688)) ([a6bcb3f](https://github.com/discordjs/discord-api-types/commit/a6bcb3f0fe7bc4edceee61b7cdab0e46db9c7109))
|
||||
|
||||
## [0.37.27](https://github.com/discordjs/discord-api-types/compare/0.37.26...0.37.27) (2023-01-09)
|
||||
|
||||
### Features
|
||||
|
||||
- **MessageType:** add missing types ([#681](https://github.com/discordjs/discord-api-types/issues/681)) ([7d55b33](https://github.com/discordjs/discord-api-types/commit/7d55b33bacb96e156f41fb67a1819c07c8fa959f))
|
||||
|
||||
## [0.37.26](https://github.com/discordjs/discord-api-types/compare/0.37.25...0.37.26) (2023-01-05)
|
||||
|
||||
### Features
|
||||
|
||||
- add RESTJSONErrorCode `40062` and RESTRateLimit.code ([#620](https://github.com/discordjs/discord-api-types/issues/620)) ([4a25caf](https://github.com/discordjs/discord-api-types/commit/4a25caf506c685a8e0af630eef3bd3d2735d64ed))
|
||||
- **RESTGetAPIAuditLogQuery:** support `after` ([#682](https://github.com/discordjs/discord-api-types/issues/682)) ([bb2ef84](https://github.com/discordjs/discord-api-types/commit/bb2ef843133b29e3042bdfde20b5adb1c3639e01))
|
||||
- **RESTJSONErrorCodes:** add error `30058` ([#676](https://github.com/discordjs/discord-api-types/issues/676)) ([921bffd](https://github.com/discordjs/discord-api-types/commit/921bffd1b210b6cf2dc6971e451fa0a9e6f6c185))
|
||||
- **RESTJSONErrorCodes:** add error `50067` ([#640](https://github.com/discordjs/discord-api-types/issues/640)) ([6e4a611](https://github.com/discordjs/discord-api-types/commit/6e4a6115ae44aca5c0b61f621ad75829632850f4))
|
||||
|
||||
## [0.37.25](https://github.com/discordjs/discord-api-types/compare/0.37.24...0.37.25) (2022-12-29)
|
||||
|
||||
## [0.37.24](https://github.com/discordjs/discord-api-types/compare/0.37.23...0.37.24) (2022-12-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIApplicationRoleConnection:** `metadata` values can be numbers ([#673](https://github.com/discordjs/discord-api-types/issues/673)) ([8df9f14](https://github.com/discordjs/discord-api-types/commit/8df9f14a24b714d3b009711eec894cad1e199881))
|
||||
|
||||
## [0.37.23](https://github.com/discordjs/discord-api-types/compare/0.37.22...0.37.23) (2022-12-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIChannel:** correctly type present properties based on channel type ([#669](https://github.com/discordjs/discord-api-types/issues/669)) ([2a5413d](https://github.com/discordjs/discord-api-types/commit/2a5413def49dbb413227d9b02be500b9184b731d))
|
||||
- **Interactions:** make app_permissions required ([#652](https://github.com/discordjs/discord-api-types/issues/652)) ([89bc0f4](https://github.com/discordjs/discord-api-types/commit/89bc0f40b60434a768abac95188a2e4e47c2acd9))
|
||||
|
||||
### Features
|
||||
|
||||
- add role connections ([#651](https://github.com/discordjs/discord-api-types/issues/651)) ([d7b666c](https://github.com/discordjs/discord-api-types/commit/d7b666c739bb848ead5a3af09e37e64ed962014b))
|
||||
- **APIApplicationCommand:** add `nsfw` field ([#637](https://github.com/discordjs/discord-api-types/issues/637)) ([c3fda99](https://github.com/discordjs/discord-api-types/commit/c3fda99637b4d7688111180f90d6aa41c008ed17))
|
||||
- **APIGuildForumChannel:** add `default_forum_layout` ([#658](https://github.com/discordjs/discord-api-types/issues/658)) ([190242a](https://github.com/discordjs/discord-api-types/commit/190242a59d5512fdc766217ec9f7c9c54a7b2dcb))
|
||||
- **Locale:** add Indonesian locale ([#643](https://github.com/discordjs/discord-api-types/issues/643)) ([2b75d13](https://github.com/discordjs/discord-api-types/commit/2b75d13b393f8f9011ec68617cb4e9f9d3fa09e7))
|
||||
|
||||
## [0.37.22](https://github.com/discordjs/discord-api-types/compare/0.37.21...0.37.22) (2022-12-12)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIChannel:** correctly type `name` based on channel type ([#666](https://github.com/discordjs/discord-api-types/issues/666)) ([995126e](https://github.com/discordjs/discord-api-types/commit/995126e2cc1494f9fad2ad7c44ecc87898994e44))
|
||||
|
||||
## [0.37.21](https://github.com/discordjs/discord-api-types/compare/0.37.20...0.37.21) (2022-12-05)
|
||||
|
||||
## [0.37.20](https://github.com/discordjs/discord-api-types/compare/0.37.19...0.37.20) (2022-11-24)
|
||||
|
||||
## [0.37.19](https://github.com/discordjs/discord-api-types/compare/0.37.18...0.37.19) (2022-11-21)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIGuildChannel:** make position of guild channel non optional ([#647](https://github.com/discordjs/discord-api-types/issues/647)) ([9d72e82](https://github.com/discordjs/discord-api-types/commit/9d72e82e07e3a3bb9a894081d955bdc5c6b64089))
|
||||
- **channel:** add missing type aliases ([#648](https://github.com/discordjs/discord-api-types/issues/648)) ([2695dad](https://github.com/discordjs/discord-api-types/commit/2695dade8be818cf5bacbe69ec9aca0b50b9f9b0))
|
||||
|
||||
### Features
|
||||
|
||||
- **GuildFeatures:** Add `APPLICATION_COMMAND_PERMISSIONS_V2` ([#646](https://github.com/discordjs/discord-api-types/issues/646)) ([a1869a6](https://github.com/discordjs/discord-api-types/commit/a1869a6a6d4e15adf7a3cf64cade1ed051b330fc))
|
||||
|
||||
## [0.37.18](https://github.com/discordjs/discord-api-types/compare/0.37.17...0.37.18) (2022-11-14)
|
||||
|
||||
### Features
|
||||
|
||||
- **UserFlags:** add `ActiveDeveloper` ([#638](https://github.com/discordjs/discord-api-types/issues/638)) ([65da837](https://github.com/discordjs/discord-api-types/commit/65da837673142267a92aea28ecd65d3c05aa0706))
|
||||
|
||||
## [0.37.17](https://github.com/discordjs/discord-api-types/compare/0.37.16...0.37.17) (2022-11-07)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIAutoMod:** add support for regex matching ([#603](https://github.com/discordjs/discord-api-types/issues/603)) ([88a60f7](https://github.com/discordjs/discord-api-types/commit/88a60f78efb6498d861b33d54c809d9d1b39b3d7))
|
||||
|
||||
## [0.37.16](https://github.com/discordjs/discord-api-types/compare/0.37.15...0.37.16) (2022-10-31)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **docs:** update gateway documentation links ([#628](https://github.com/discordjs/discord-api-types/issues/628)) ([7040d9b](https://github.com/discordjs/discord-api-types/commit/7040d9b33370a5d1d7d3c3cb10a25c0e5fb7d0b8))
|
||||
- export `RESTGetAPIVoiceRegionsResult` with the correct name ([#627](https://github.com/discordjs/discord-api-types/issues/627)) ([69aa717](https://github.com/discordjs/discord-api-types/commit/69aa7179028e0a011e6ba246cc1faa55f463c619))
|
||||
- **UserFlags:** hardcode the value of `Quarantined` ([#624](https://github.com/discordjs/discord-api-types/issues/624)) ([5091f6e](https://github.com/discordjs/discord-api-types/commit/5091f6e70774fd97ec7dd3ae3f500c3850f81d94))
|
||||
|
||||
## [0.37.15](https://github.com/discordjs/discord-api-types/compare/0.37.14...0.37.15) (2022-10-27)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- `default_thread_rate_limit_per_user` is only for forum channels ([#596](https://github.com/discordjs/discord-api-types/issues/596)) ([88ce291](https://github.com/discordjs/discord-api-types/commit/88ce2910fb3640d9be165ac9f6488cc7e4c32663))
|
||||
- add missing gateway dispatch payloads to gateway event union ([#619](https://github.com/discordjs/discord-api-types/issues/619)) ([348dd41](https://github.com/discordjs/discord-api-types/commit/348dd416d1c94231fdfda88fa0ef03b34a384bb4))
|
||||
- **APIGuild:** change type of `afk_timeout` to allowed values ([#590](https://github.com/discordjs/discord-api-types/issues/590)) ([aaa57b4](https://github.com/discordjs/discord-api-types/commit/aaa57b4fe96b4f045b312c1a6a2ed17f9fcb3552))
|
||||
|
||||
### Features
|
||||
|
||||
- add some missing REST types ([#612](https://github.com/discordjs/discord-api-types/issues/612)) ([8d25f23](https://github.com/discordjs/discord-api-types/commit/8d25f233a5366f1d43de942f465e696c73f26c86))
|
||||
- **Components:** new select menus ([#602](https://github.com/discordjs/discord-api-types/issues/602)) ([df1452d](https://github.com/discordjs/discord-api-types/commit/df1452dc28f2fddb32a20912ca3ca3634556a3da))
|
||||
- **GuildFeature:** add `DeveloperSupportServer` ([#618](https://github.com/discordjs/discord-api-types/issues/618)) ([8c1484e](https://github.com/discordjs/discord-api-types/commit/8c1484ebbe95afbd850b22262d6223b2f3d40017))
|
||||
- **RESTJSONErrorCodes:** add 50039 error ([#607](https://github.com/discordjs/discord-api-types/issues/607)) ([131637f](https://github.com/discordjs/discord-api-types/commit/131637fbd20573750a60df2281f94b339443c82c))
|
||||
- **UserPremiumType:** add `NitroBasic` ([#616](https://github.com/discordjs/discord-api-types/issues/616)) ([9448e9b](https://github.com/discordjs/discord-api-types/commit/9448e9befdfff38ecbf186e5dc9c1fcd88596422))
|
||||
|
||||
## [0.37.14](https://github.com/discordjs/discord-api-types/compare/0.37.13...0.37.14) (2022-10-15)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIAutoModeration:** export v10 json payloads and correct route types ([#608](https://github.com/discordjs/discord-api-types/issues/608)) ([bce0795](https://github.com/discordjs/discord-api-types/commit/bce07950fdfec7ae5e96ce3158f73cfb5db0a890))
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add error `50073` ([#594](https://github.com/discordjs/discord-api-types/issues/594)) ([70826ed](https://github.com/discordjs/discord-api-types/commit/70826ed76e4b4880fb7425a07d04921823954c95))
|
||||
|
||||
## [0.37.13](https://github.com/discordjs/discord-api-types/compare/0.37.12...0.37.13) (2022-10-14)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIAutoModeration:** add support for auto moderation ([#418](https://github.com/discordjs/discord-api-types/issues/418)) ([b216f7a](https://github.com/discordjs/discord-api-types/commit/b216f7a8bee2c02fe0e75189fe31f95973bfbe2e))
|
||||
|
||||
## [0.37.12](https://github.com/discordjs/discord-api-types/compare/0.37.11...0.37.12) (2022-10-06)
|
||||
|
||||
## [0.37.11](https://github.com/discordjs/discord-api-types/compare/0.37.10...0.37.11) (2022-09-26)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIGuildForumChannel:** add `default_sort_order` ([#589](https://github.com/discordjs/discord-api-types/issues/589)) ([143b003](https://github.com/discordjs/discord-api-types/commit/143b003fbe5a86eda225e9da1d0914d6e48cddfd))
|
||||
- **APIGuildForumChannel:** update and add missing features ([#575](https://github.com/discordjs/discord-api-types/issues/575)) ([0f118d3](https://github.com/discordjs/discord-api-types/commit/0f118d382f94151b1c9be42620520c91b20a05f6))
|
||||
|
||||
## [0.37.10](https://github.com/discordjs/discord-api-types/compare/0.37.9...0.37.10) (2022-09-15)
|
||||
|
||||
### Features
|
||||
|
||||
- add `RESTRateLimit` ([#585](https://github.com/discordjs/discord-api-types/issues/585)) ([f4d3f4d](https://github.com/discordjs/discord-api-types/commit/f4d3f4d5b1c1b6e42c2a8f8184f43d67b586c8c1))
|
||||
- **APIConnection:** add `two_way_link` ([#546](https://github.com/discordjs/discord-api-types/issues/546)) ([d452f63](https://github.com/discordjs/discord-api-types/commit/d452f6346bd4953a8d777f3818797c4285b1b842))
|
||||
- **APIGuild:** document afk timeout values ([#570](https://github.com/discordjs/discord-api-types/issues/570)) ([32f5a7b](https://github.com/discordjs/discord-api-types/commit/32f5a7b9814b69da7fc3772ec1f0307d39cda087))
|
||||
|
||||
## [0.37.9](https://github.com/discordjs/discord-api-types/compare/0.37.8...0.37.9) (2022-09-12)
|
||||
|
||||
### Features
|
||||
|
||||
- **ConnectionService:** add new connections ([#548](https://github.com/discordjs/discord-api-types/issues/548)) ([afd3b55](https://github.com/discordjs/discord-api-types/commit/afd3b55c08b0cf75cc4f5a06d3574b6cf532cb6c))
|
||||
|
||||
## [0.37.8](https://github.com/discordjs/discord-api-types/compare/0.37.7...0.37.8) (2022-09-08)
|
||||
|
||||
### Features
|
||||
|
||||
- **GuildFeature:** add `InvitesDisabled` ([#549](https://github.com/discordjs/discord-api-types/issues/549)) ([2708cb9](https://github.com/discordjs/discord-api-types/commit/2708cb9dcaa07d19ca71e9ca211e78939b9d1ff4))
|
||||
|
||||
## [0.37.7](https://github.com/discordjs/discord-api-types/compare/0.37.6...0.37.7) (2022-09-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **ChannelType:** bring back old names ([b08f2e3](https://github.com/discordjs/discord-api-types/commit/b08f2e34dbe9afccca6f565db6c7b27a21453d85))
|
||||
|
||||
## [0.37.6](https://github.com/discordjs/discord-api-types/compare/0.37.5...0.37.6) (2022-09-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIModalSubmission:** `components` is not optional ([#574](https://github.com/discordjs/discord-api-types/issues/574)) ([f69b586](https://github.com/discordjs/discord-api-types/commit/f69b586d0148afd017e6da70ab8d745b6ba04ba4))
|
||||
- **GuildChannelType:** add missing `GuildCategory` type ([#579](https://github.com/discordjs/discord-api-types/issues/579)) ([815c68f](https://github.com/discordjs/discord-api-types/commit/815c68fe46034029200a8e2903748a3d2e6af7b9))
|
||||
- **RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody:** `channel_id` is optional ([#547](https://github.com/discordjs/discord-api-types/issues/547)) ([b7b855b](https://github.com/discordjs/discord-api-types/commit/b7b855b2005bb3989810850d6e00bec443a15c92))
|
||||
|
||||
### Features
|
||||
|
||||
- **APIGuildIntegration:** add `scopes` ([#563](https://github.com/discordjs/discord-api-types/issues/563)) ([73d15dd](https://github.com/discordjs/discord-api-types/commit/73d15ddcbbc676efac876602a3cd726bfe4c378a))
|
||||
- **ApplicationFlags:** add `ApplicationCommandBadge` ([#537](https://github.com/discordjs/discord-api-types/issues/537)) ([48f0f56](https://github.com/discordjs/discord-api-types/commit/48f0f562bab10d2a1e331474fb963af8631b788b))
|
||||
- **RESTPutAPIGuildBanJSONBody:** add `delete_message_seconds` ([#534](https://github.com/discordjs/discord-api-types/issues/534)) ([4e362d5](https://github.com/discordjs/discord-api-types/commit/4e362d52608e99d466b43cd37ec6b6bb1222b660))
|
||||
|
||||
## [0.37.5](https://github.com/discordjs/discord-api-types/compare/0.37.4...0.37.5) (2022-08-25)
|
||||
|
||||
### Features
|
||||
|
||||
- **FormattingPatterns:** add `ApplicationCommand` ([#525](https://github.com/discordjs/discord-api-types/issues/525)) ([0098889](https://github.com/discordjs/discord-api-types/commit/00988894995f7ac5e8ddc34125704a230329137c))
|
||||
|
||||
## [0.37.4](https://github.com/discordjs/discord-api-types/compare/0.37.3...0.37.4) (2022-08-22)
|
||||
|
||||
### Features
|
||||
|
||||
- add common JSON error types ([#568](https://github.com/discordjs/discord-api-types/issues/568)) ([956f289](https://github.com/discordjs/discord-api-types/commit/956f289e885763a620cb67a36e7e42683b5c08bf))
|
||||
- **ApplicationCommand:** export base chat input types ([#569](https://github.com/discordjs/discord-api-types/issues/569)) ([248484e](https://github.com/discordjs/discord-api-types/commit/248484e55613e2da3f1d659395e1f4c010cb51b5))
|
||||
|
||||
## [0.37.3](https://github.com/discordjs/discord-api-types/compare/0.37.2...0.37.3) (2022-08-18)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add 240000 ([#565](https://github.com/discordjs/discord-api-types/issues/565)) ([5bb50ae](https://github.com/discordjs/discord-api-types/commit/5bb50ae7ea6859845c9d9996f02ac42c61413df0))
|
||||
|
||||
## [0.37.2](https://github.com/discordjs/discord-api-types/compare/0.37.1...0.37.2) (2022-08-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **GatewayGuildMembersChunkDispatchData:** make chunk pagination properties mandatory ([#558](https://github.com/discordjs/discord-api-types/issues/558)) ([0e03e39](https://github.com/discordjs/discord-api-types/commit/0e03e39aa2bf8f1b9a58113a3242c4722e64922b))
|
||||
- **GatewayRequestGuildMembersData:** limit being required with user_ids ([#559](https://github.com/discordjs/discord-api-types/issues/559)) ([dc3d5df](https://github.com/discordjs/discord-api-types/commit/dc3d5df0a2931eff63991987166634661d5bd1d8))
|
||||
- **RESTGetAPIChannelUsersThreadsArchivedResult:** add `has_more` missing field ([#543](https://github.com/discordjs/discord-api-types/issues/543)) ([796f6d8](https://github.com/discordjs/discord-api-types/commit/796f6d8a3b2f55d2a120137801e0450ddf30576e))
|
||||
|
||||
### Features
|
||||
|
||||
- add search that might or might not work ([f8a9c8b](https://github.com/discordjs/discord-api-types/commit/f8a9c8b5c6bdd73bcbf9dd6fff66fafac2594ba4))
|
||||
- **APIVoiceChannel:** support text in voice, properties `last_message_id` and `rate_limit_per_user` ([#544](https://github.com/discordjs/discord-api-types/issues/544)) ([4488d8f](https://github.com/discordjs/discord-api-types/commit/4488d8fd2611a6547fc6149ba1cec5682340a119))
|
||||
- **GatewayReadyDispatchData:** add `resume_gateway_url` ([#552](https://github.com/discordjs/discord-api-types/issues/552)) ([9a50367](https://github.com/discordjs/discord-api-types/commit/9a50367dad3a06fbca6e8d1fdd98fbf144595d4e))
|
||||
|
||||
## [0.37.1](https://github.com/discordjs/discord-api-types/compare/0.37.0...0.37.1) (2022-08-04)
|
||||
|
||||
# [0.37.0](https://github.com/discordjs/discord-api-types/compare/0.36.3...0.37.0) (2022-07-28)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **RESTJSONErrorCodes:** use `MaximumThreadParticipantsReached` instead in error code 30033 ([#540](https://github.com/discordjs/discord-api-types/issues/540)) ([cecf17b](https://github.com/discordjs/discord-api-types/commit/cecf17b4158fbebb3ee508518a9e9a7b1297356f))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **RESTJSONErrorCodes:** `MaximumThreadParticipants` was renamed to `MaximumThreadParticipantsReached` for consistency with the rest of the codes
|
||||
|
||||
## [0.36.3](https://github.com/discordjs/discord-api-types/compare/0.36.2...0.36.3) (2022-07-21)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIConnection:** add `ConnectionService` to `type` ([#491](https://github.com/discordjs/discord-api-types/issues/491)) ([4577ac2](https://github.com/discordjs/discord-api-types/commit/4577ac2609f4a861505bc41f4293f482db251cdc))
|
||||
- **APIThreadChannel:** add fields about new message counter capability ([#532](https://github.com/discordjs/discord-api-types/issues/532)) ([2b53b20](https://github.com/discordjs/discord-api-types/commit/2b53b20b84b7434b9a35b715d8ebdeb040835dca))
|
||||
- **GatewayGuildCreateDispatchData:** add missing `unavailable` ([#504](https://github.com/discordjs/discord-api-types/issues/504)) ([59e2477](https://github.com/discordjs/discord-api-types/commit/59e247729fcd27be839c88516939ec22843781ce))
|
||||
- **RESTJSONErrorCodes:** add `ApplicationNotYetAvailable` ([#507](https://github.com/discordjs/discord-api-types/issues/507)) ([09a1141](https://github.com/discordjs/discord-api-types/commit/09a114133c7599cc14d4a0eb61425162091c45ee))
|
||||
- **RESTJSONErrorCodes:** add error `30034` ([#530](https://github.com/discordjs/discord-api-types/issues/530)) ([0a2e778](https://github.com/discordjs/discord-api-types/commit/0a2e7787c672ffb4af83e055df632aae36811445))
|
||||
- **RESTJSONErrorCodes:** add error `50132` ([#505](https://github.com/discordjs/discord-api-types/issues/505)) ([907d88a](https://github.com/discordjs/discord-api-types/commit/907d88ada93221802a4aefe7dc0ca3b2b73f94f0))
|
||||
- **RESTJSONErrorCodes:** add error `50146` ([#527](https://github.com/discordjs/discord-api-types/issues/527)) ([e78de0c](https://github.com/discordjs/discord-api-types/commit/e78de0c83ba93145a2302ddea2e55b5050291c52))
|
||||
- **RESTJSONErrorCodes:** add new errors ([#506](https://github.com/discordjs/discord-api-types/issues/506)) ([65b672e](https://github.com/discordjs/discord-api-types/commit/65b672e2afd2135333272d4e7b771eba237a21b6))
|
||||
|
||||
## [0.36.2](https://github.com/discordjs/discord-api-types/compare/0.36.1...0.36.2) (2022-07-14)
|
||||
|
||||
### Features
|
||||
|
||||
- **RESTJSONErrorCodes:** add error `30032` ([#521](https://github.com/discordjs/discord-api-types/issues/521)) ([f2c3451](https://github.com/discordjs/discord-api-types/commit/f2c3451c2a8bc91bcca65372d2944a07a3c34a9a))
|
||||
- **RESTPutAPIApplicationGuildCommandsJSONBody:** add missing `id` ([#522](https://github.com/discordjs/discord-api-types/issues/522)) ([4af2ea9](https://github.com/discordjs/discord-api-types/commit/4af2ea91415a5662171d342379c4bd33bfa5a6d5))
|
||||
|
||||
## [0.36.1](https://github.com/discordjs/discord-api-types/compare/0.36.0...0.36.1) (2022-07-04)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIApplicationCommandStringOption:** add `min_length` and `max_length` ([#513](https://github.com/discordjs/discord-api-types/issues/513)) ([2cade98](https://github.com/discordjs/discord-api-types/commit/2cade98ed0a0a074254fbc1580fc56d0e0b3dc9c))
|
||||
|
||||
# [0.36.0](https://github.com/discordjs/discord-api-types/compare/0.35.0...0.36.0) (2022-06-30)
|
||||
|
||||
### Features
|
||||
|
||||
- **APIBaseInteraction:** add `app_permissions` ([#509](https://github.com/discordjs/discord-api-types/issues/509)) ([0c65d40](https://github.com/discordjs/discord-api-types/commit/0c65d40af00499233830ce272a2a274bcd5b9e8c))
|
||||
- **MessageType:** update names ([#498](https://github.com/discordjs/discord-api-types/issues/498)) ([12072b7](https://github.com/discordjs/discord-api-types/commit/12072b70a0c70e1e1f9de920789e26829268de12))
|
||||
- **RESTJSONErrorCodes:** add error 20024 ([#480](https://github.com/discordjs/discord-api-types/issues/480)) ([34908aa](https://github.com/discordjs/discord-api-types/commit/34908aa4ceeca4b58276cc207f5bdb77cef04296))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **MessageType:** The following message types have been renamed:
|
||||
|
||||
* `GuildMemberJoin` -> `UserJoin`
|
||||
* `UserPremiumGuildSubscription` -> `GuildBoost`
|
||||
* `UserPremiumGuildSubscriptionTier1` -> `GuildBoostTier1`
|
||||
* `UserPremiumGuildSubscriptionTier2` -> `GuildBoostTier2`
|
||||
* `UserPremiumGuildSubscriptionTier3` -> `GuildBoostTier3`
|
||||
|
||||
# [0.35.0](https://github.com/discordjs/discord-api-types/compare/0.34.0...0.35.0) (2022-06-23)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **GatewayIdentifyProperties:** remove `$` prefix from keys ([#493](https://github.com/discordjs/discord-api-types/issues/493)) ([3b10c60](https://github.com/discordjs/discord-api-types/commit/3b10c60faa5943501ab1f7cfa0d5f3c5317cdbbd))
|
||||
|
||||
### Features
|
||||
|
||||
- **APIEmbedVideo:** add missing `proxy_url` property ([#496](https://github.com/discordjs/discord-api-types/issues/496)) ([56d491f](https://github.com/discordjs/discord-api-types/commit/56d491fa6808d9a8762bff606ca8feb5e11f13a4))
|
||||
- **REST:** add `CDNRoutes` ([#502](https://github.com/discordjs/discord-api-types/issues/502)) ([0609886](https://github.com/discordjs/discord-api-types/commit/06098869d552139fadcc204b5ce4e1a7e5352b68))
|
||||
- **UserFlags:** add `Quarantined` flag ([#495](https://github.com/discordjs/discord-api-types/issues/495)) ([fc3aa1c](https://github.com/discordjs/discord-api-types/commit/fc3aa1c9110e4730c6b8ba3e36815ecd2da66c68))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **GatewayIdentifyProperties:** The fields for identify no longer use the `$` prefix for the values.
|
||||
|
||||
# [0.34.0](https://github.com/discordjs/discord-api-types/compare/0.33.5...0.34.0) (2022-06-13)
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params
|
||||
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params
|
||||
*/
|
||||
export interface GatewayURLQuery {
|
||||
v: string;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1686,7 +1686,7 @@ export interface GatewayPresenceUpdateData {
|
||||
/**
|
||||
* The user's activities
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object
|
||||
*/
|
||||
activities: GatewayActivityUpdateData[];
|
||||
/**
|
||||
@@ -1702,7 +1702,7 @@ export interface GatewayPresenceUpdateData {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'type' | 'url'>;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -45,6 +45,13 @@ export const FormattingPatterns = {
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
Role: /<@&(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a application command mention
|
||||
*
|
||||
* The `fullName` (possibly including `name`, `subcommandOrGroup` and `subcommand`) and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
SlashCommand:
|
||||
/<\/(?<fullName>(?<name>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32})(?: (?<subcommandOrGroup>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?(?: (?<subcommand>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?):(?<id>\d{17,20})>/u,
|
||||
/**
|
||||
* Regular expression for matching a custom emoji, either static or animated
|
||||
*
|
||||
|
||||
@@ -58,3 +58,47 @@ export const PermissionFlagsBits = {
|
||||
Object.freeze(PermissionFlagsBits);
|
||||
|
||||
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json
|
||||
*/
|
||||
export interface RESTError {
|
||||
code: number;
|
||||
message: string;
|
||||
errors?: RESTErrorData;
|
||||
}
|
||||
|
||||
export interface RESTErrorFieldInformation {
|
||||
code: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface RESTErrorGroupWrapper {
|
||||
_errors: RESTErrorData[];
|
||||
}
|
||||
|
||||
export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation | { [k: string]: RESTErrorData } | string;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
|
||||
*/
|
||||
export interface RESTRateLimit {
|
||||
/**
|
||||
* An error code for some limits
|
||||
*
|
||||
* {@link RESTJSONErrorCodes}
|
||||
*/
|
||||
code?: number;
|
||||
/**
|
||||
* A value indicating if you are being globally rate limited or not
|
||||
*/
|
||||
global: boolean;
|
||||
/**
|
||||
* A message saying you are being rate limited.
|
||||
*/
|
||||
message: string;
|
||||
/**
|
||||
* The number of seconds to wait before submitting another request.
|
||||
*/
|
||||
retry_after: number;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
>;
|
||||
|
||||
|
||||
@@ -43,17 +43,12 @@ import type {
|
||||
APIApplicationCommandUserOption,
|
||||
} from './_chatInput/user.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionWrapper,
|
||||
APIInteractionDataResolvedChannel,
|
||||
APIInteractionDataResolvedGuildMember,
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands.ts';
|
||||
import type { APIInteractionDataResolved } from '../../mod.ts';
|
||||
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
|
||||
export * from './_chatInput/attachment.ts';
|
||||
export * from './_chatInput/base.ts';
|
||||
export * from './_chatInput/boolean.ts';
|
||||
export * from './_chatInput/channel.ts';
|
||||
export * from './_chatInput/integer.ts';
|
||||
@@ -108,23 +103,12 @@ export type APIApplicationCommandInteractionDataBasicOption =
|
||||
| APIApplicationCommandInteractionDataAttachmentOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIChatInputApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {
|
||||
options?: APIApplicationCommandInteractionDataOption[];
|
||||
resolved?: APIChatInputApplicationCommandInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
export interface APIChatInputApplicationCommandInteractionDataResolved {
|
||||
users?: Record<Snowflake, APIUser>;
|
||||
roles?: Record<Snowflake, APIRole>;
|
||||
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
|
||||
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
|
||||
attachments?: Record<Snowflake, APIAttachment>;
|
||||
resolved?: APIInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,33 +1,20 @@
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIMessage } from '../../channel.ts';
|
||||
import type { APIUser } from '../../user.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionWrapper,
|
||||
APIInteractionDataResolvedGuildMember,
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper, APIUserInteractionDataResolved } from '../base.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIUserApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.User> {
|
||||
target_id: Snowflake;
|
||||
resolved: APIUserApplicationCommandInteractionDataResolved;
|
||||
resolved: APIUserInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
export interface APIUserApplicationCommandInteractionDataResolved {
|
||||
users: Record<Snowflake, APIUser>;
|
||||
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIMessageApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.Message> {
|
||||
@@ -43,7 +30,7 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export type APIContextMenuInteractionData =
|
||||
| APIUserApplicationCommandInteractionData
|
||||
|
||||
@@ -15,8 +15,6 @@ import type { APIBaseInteraction } from './base.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { LocalizationMap } from '../../../v10.ts';
|
||||
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
|
||||
export * from './_applicationCommands/chatInput.ts';
|
||||
export * from './_applicationCommands/contextMenu.ts';
|
||||
@@ -85,6 +83,10 @@ export interface APIApplicationCommand {
|
||||
* @deprecated Use `dm_permission` and/or `default_member_permissions` instead
|
||||
*/
|
||||
default_permission?: boolean;
|
||||
/**
|
||||
* Indicates whether the command is age-restricted, defaults to `false`
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
@@ -101,34 +103,20 @@ export enum ApplicationCommandType {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export type APIApplicationCommandInteractionData =
|
||||
| APIChatInputApplicationCommandInteractionData
|
||||
| APIContextMenuInteractionData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
|
||||
thread_metadata?: APIThreadMetadata | null;
|
||||
permissions: Permissions;
|
||||
parent_id?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
|
||||
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
|
||||
Required<Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data'>>;
|
||||
Required<
|
||||
Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data' | 'app_permissions'>
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { LocaleString } from '../../../v10.ts';
|
||||
import type { APIMessage } from '../channel.ts';
|
||||
import type { APIRole, LocaleString } from '../../../v10.ts';
|
||||
import type { APIAttachment, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
@@ -125,3 +129,46 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
|
||||
'user'
|
||||
> &
|
||||
Required<Pick<Original, 'member' | 'guild_id'>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
|
||||
thread_metadata?: APIThreadMetadata | null;
|
||||
permissions: Permissions;
|
||||
parent_id?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
export interface APIInteractionDataResolved {
|
||||
users?: Record<Snowflake, APIUser>;
|
||||
roles?: Record<Snowflake, APIRole>;
|
||||
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
|
||||
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
|
||||
attachments?: Record<Snowflake, APIAttachment>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Renamed to `APIInteractionDataResolved`
|
||||
*/
|
||||
export type APIChatInputApplicationCommandInteractionDataResolved = APIInteractionDataResolved;
|
||||
|
||||
/**
|
||||
* `users` and optional `members` from APIInteractionDataResolved, for user commands and user selects
|
||||
*/
|
||||
export type APIUserInteractionDataResolved = Required<Pick<APIInteractionDataResolved, 'users'>> &
|
||||
Pick<APIInteractionDataResolved, 'members'>;
|
||||
|
||||
/**
|
||||
* @deprecated Renamed to `APIUserInteractionDataResolved`
|
||||
*/
|
||||
export type APIUserApplicationCommandInteractionDataResolved = APIUserInteractionDataResolved;
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
|
||||
import type {
|
||||
APIDMInteractionWrapper,
|
||||
APIGuildInteractionWrapper,
|
||||
APIInteractionDataResolved,
|
||||
APIUserInteractionDataResolved,
|
||||
} from './base.ts';
|
||||
import type { Snowflake } from '../../../globals.ts';
|
||||
import type { ComponentType } from '../channel.ts';
|
||||
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
|
||||
|
||||
@@ -9,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
|
||||
'channel_id' | 'data' | 'message'
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -20,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
|
||||
'channel_id' | 'data' | 'message'
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -31,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
|
||||
'channel_id' | 'data' | 'message'
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -50,11 +56,42 @@ export interface APIMessageComponentBaseInteractionData<CType extends ComponentT
|
||||
|
||||
export type APIMessageButtonInteractionData = APIMessageComponentBaseInteractionData<ComponentType.Button>;
|
||||
|
||||
export interface APIMessageSelectMenuInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.SelectMenu> {
|
||||
export interface APIMessageStringSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.StringSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIMessageUserSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.UserSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: APIUserInteractionDataResolved;
|
||||
}
|
||||
|
||||
export interface APIMessageRoleSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.RoleSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: Required<Pick<APIInteractionDataResolved, 'roles'>>;
|
||||
}
|
||||
|
||||
export interface APIMessageMentionableSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.MentionableSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: Pick<APIInteractionDataResolved, 'users' | 'members' | 'roles'>;
|
||||
}
|
||||
|
||||
export interface APIMessageChannelSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.ChannelSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: Required<Pick<APIInteractionDataResolved, 'channels'>>;
|
||||
}
|
||||
|
||||
export type APIMessageSelectMenuInteractionData =
|
||||
| APIMessageStringSelectInteractionData
|
||||
| APIMessageUserSelectInteractionData
|
||||
| APIMessageRoleSelectInteractionData
|
||||
| APIMessageMentionableSelectInteractionData
|
||||
| APIMessageChannelSelectInteractionData;
|
||||
|
||||
export type APIMessageComponentDMInteraction = APIDMInteractionWrapper<APIMessageComponentInteraction>;
|
||||
|
||||
export type APIMessageComponentGuildInteraction = APIGuildInteractionWrapper<APIMessageComponentInteraction>;
|
||||
|
||||
@@ -18,6 +18,9 @@ export interface ModalSubmitActionRowComponent
|
||||
components: ModalSubmitComponent[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure
|
||||
*/
|
||||
export interface APIModalSubmission {
|
||||
/**
|
||||
* A developer-defined identifier for the component, max 100 characters
|
||||
@@ -26,7 +29,7 @@ export interface APIModalSubmission {
|
||||
/**
|
||||
* A list of child components
|
||||
*/
|
||||
components?: ModalSubmitActionRowComponent[];
|
||||
components: ModalSubmitActionRowComponent[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@ import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APITeam } from './teams.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { LocalizationMap } from '../common.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object
|
||||
@@ -62,7 +63,7 @@ export interface APIApplication {
|
||||
/**
|
||||
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
|
||||
*
|
||||
* See https://discord.com/developers/docs/game-sdk/applications#get-ticket
|
||||
* See https://discord.com/developers/docs/game-sdk/applications#getticket
|
||||
*/
|
||||
verify_key: string;
|
||||
/**
|
||||
@@ -105,6 +106,11 @@ export interface APIApplication {
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
custom_install_url?: string;
|
||||
/**
|
||||
* The application's role connection verification entry point,
|
||||
* which when configured will render the app as a verification method in the guild role verification configuration
|
||||
*/
|
||||
role_connections_verification_url?: string;
|
||||
}
|
||||
|
||||
export interface APIApplicationInstallParams {
|
||||
@@ -116,17 +122,131 @@ export interface APIApplicationInstallParams {
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
export enum ApplicationFlags {
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
EmbeddedReleased = 1 << 1,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
ManagedEmoji = 1 << 2,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
GroupDMCreate = 1 << 4,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
RPCHasConnected = 1 << 11,
|
||||
/**
|
||||
* Intent required for bots in 100 or more servers to receive `presence_update` events
|
||||
*/
|
||||
GatewayPresence = 1 << 12,
|
||||
/**
|
||||
* Intent required for bots in under 100 servers to receive `presence_update` events, found in Bot Settings
|
||||
*/
|
||||
GatewayPresenceLimited = 1 << 13,
|
||||
/**
|
||||
* Intent required for bots in 100 or more servers to receive member-related events like `guild_member_add`.
|
||||
* See list of member-related events [under `GUILD_MEMBERS`](https://discord.com/developers/docs/topics/gateway#list-of-intents)
|
||||
*/
|
||||
GatewayGuildMembers = 1 << 14,
|
||||
/**
|
||||
* Intent required for bots in under 100 servers to receive member-related events like `guild_member_add`, found in Bot Settings.
|
||||
* See list of member-related events [under `GUILD_MEMBERS`](https://discord.com/developers/docs/topics/gateway#list-of-intents)
|
||||
*/
|
||||
GatewayGuildMembersLimited = 1 << 15,
|
||||
/**
|
||||
* Indicates unusual growth of an app that prevents verification
|
||||
*/
|
||||
VerificationPendingGuildLimit = 1 << 16,
|
||||
/**
|
||||
* Indicates if an app is embedded within the Discord client (currently unavailable publicly)
|
||||
*/
|
||||
Embedded = 1 << 17,
|
||||
/**
|
||||
* Intent required for bots in 100 or more servers to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055)
|
||||
*/
|
||||
GatewayMessageContent = 1 << 18,
|
||||
/**
|
||||
* Intent required for bots in under 100 servers to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055),
|
||||
* found in Bot Settings
|
||||
*/
|
||||
GatewayMessageContentLimited = 1 << 19,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
EmbeddedFirstParty = 1 << 20,
|
||||
/**
|
||||
* Indicates if an app has registered global [application commands](https://discord.com/developers/docs/interactions/application-commands)
|
||||
*/
|
||||
ApplicationCommandBadge = 1 << 23,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure
|
||||
*/
|
||||
export interface APIApplicationRoleConnectionMetadata {
|
||||
/**
|
||||
* Type of metadata value
|
||||
*/
|
||||
type: ApplicationRoleConnectionMetadataType;
|
||||
/**
|
||||
* Dictionary key for the metadata field (must be `a-z`, `0-9`, or `_` characters; max 50 characters)
|
||||
*/
|
||||
key: string;
|
||||
/**
|
||||
* Name of the metadata field (max 100 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Translations of the name
|
||||
*/
|
||||
name_localizations?: LocalizationMap;
|
||||
/**
|
||||
* Description of the metadata field (max 200 characters)
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* Translations of the description
|
||||
*/
|
||||
description_localizations?: LocalizationMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type
|
||||
*/
|
||||
export enum ApplicationRoleConnectionMetadataType {
|
||||
/**
|
||||
* The metadata value (`integer`) is less than or equal to the guild's configured value (`integer`)
|
||||
*/
|
||||
IntegerLessThanOrEqual = 1,
|
||||
/**
|
||||
* The metadata value (`integer`) is greater than or equal to the guild's configured value (`integer`)
|
||||
*/
|
||||
IntegerGreaterThanOrEqual,
|
||||
/**
|
||||
* The metadata value (`integer`) is equal to the guild's configured value (`integer`)
|
||||
*/
|
||||
IntegerEqual,
|
||||
/**
|
||||
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`)
|
||||
*/
|
||||
IntegerNotEqual,
|
||||
/**
|
||||
* The metadata value (`ISO8601 string`) is less than or equal to the guild's configured value (`integer`; days before current date)
|
||||
*/
|
||||
DatetimeLessThanOrEqual,
|
||||
/**
|
||||
* The metadata value (`ISO8601 string`) is greater than or equal to the guild's configured value (`integer`; days before current date)
|
||||
*/
|
||||
DatetimeGreaterThanOrEqual,
|
||||
/**
|
||||
* The metadata value (`integer`) is equal to the guild's configured value (`integer`; `1`)
|
||||
*/
|
||||
BooleanEqual,
|
||||
/**
|
||||
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`; `1`)
|
||||
*/
|
||||
BooleanNotEqual,
|
||||
}
|
||||
|
||||
@@ -2,6 +2,13 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/audit-log
|
||||
*/
|
||||
|
||||
import type {
|
||||
APIAutoModerationAction,
|
||||
APIAutoModerationRule,
|
||||
APIAutoModerationRuleTriggerMetadata,
|
||||
AutoModerationRuleEventType,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from './autoModeration.ts';
|
||||
import type { APIChannel, APIOverwrite } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
@@ -52,6 +59,12 @@ export interface APIAuditLog {
|
||||
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object
|
||||
*/
|
||||
audit_log_entries: APIAuditLogEntry[];
|
||||
/**
|
||||
* List of auto moderation rules referenced in the audit log
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object
|
||||
*/
|
||||
auto_moderation_rules: APIAutoModerationRule[];
|
||||
/**
|
||||
* Partial integration objects
|
||||
*
|
||||
@@ -180,12 +193,37 @@ export enum AuditLogEvent {
|
||||
ThreadDelete,
|
||||
|
||||
ApplicationCommandPermissionUpdate = 121,
|
||||
|
||||
AutoModerationRuleCreate = 140,
|
||||
AutoModerationRuleUpdate,
|
||||
AutoModerationRuleDelete,
|
||||
AutoModerationBlockMessage,
|
||||
AutoModerationFlagToChannel,
|
||||
AutoModerationUserCommunicationDisabled,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
|
||||
*/
|
||||
export interface APIAuditLogOptions {
|
||||
/**
|
||||
* Name of the Auto Moderation rule that was triggered
|
||||
*
|
||||
* Present from:
|
||||
* - AUTO_MODERATION_BLOCK_MESSAGE
|
||||
* - AUTO_MODERATION_FLAG_TO_CHANNEL
|
||||
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
|
||||
*/
|
||||
auto_moderation_rule_name?: string;
|
||||
/**
|
||||
* Trigger type of the Auto Moderation rule that was triggered
|
||||
*
|
||||
* Present from:
|
||||
* - AUTO_MODERATION_BLOCK_MESSAGE
|
||||
* - AUTO_MODERATION_FLAG_TO_CHANNEL
|
||||
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
|
||||
*/
|
||||
auto_moderation_rule_trigger_type?: AuditLogRuleTriggerType;
|
||||
/**
|
||||
* Number of days after which inactive members were kicked
|
||||
*
|
||||
@@ -212,6 +250,9 @@ export interface APIAuditLogOptions {
|
||||
* - STAGE_INSTANCE_CREATE
|
||||
* - STAGE_INSTANCE_UPDATE
|
||||
* - STAGE_INSTANCE_DELETE
|
||||
* - AUTO_MODERATION_BLOCK_MESSAGE
|
||||
* - AUTO_MODERATION_FLAG_TO_CHANNEL
|
||||
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
|
||||
@@ -275,6 +316,8 @@ export enum AuditLogOptionsType {
|
||||
Member = '1',
|
||||
}
|
||||
|
||||
export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
|
||||
*/
|
||||
@@ -347,7 +390,14 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeyLocation
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil;
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil
|
||||
| APIAuditLogChangeKeyTriggerType
|
||||
| APIAuditLogChangeKeyEventType
|
||||
| APIAuditLogChangeKeyTriggerMetadata
|
||||
| APIAuditLogChangeKeyActions
|
||||
| APIAuditLogChangeKeyEnabled
|
||||
| APIAuditLogChangeKeyExemptRoles
|
||||
| APIAuditLogChangeKeyExemptChannels;
|
||||
|
||||
/**
|
||||
* Returned when an entity's name is changed
|
||||
@@ -710,6 +760,44 @@ export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string
|
||||
*/
|
||||
export type APIAuditLogChangeKeyCommunicationDisabledUntil = AuditLogChangeData<'communication_disabled_until', string>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's trigger type is changed (only in rule creation or deletion)
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTriggerType = AuditLogChangeData<'trigger_type', AutoModerationRuleTriggerType>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's event type is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEventType = AuditLogChangeData<'event_type', AutoModerationRuleEventType>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's trigger metadata is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTriggerMetadata = AuditLogChangeData<
|
||||
'trigger_metadata',
|
||||
APIAutoModerationRuleTriggerMetadata
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's actions is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyActions = AuditLogChangeData<'actions', APIAutoModerationAction[]>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's enabled status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEnabled = AuditLogChangeData<'enabled', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's exempt roles is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles', Snowflake[]>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's exempt channels is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
203
deno/payloads/v10/autoModeration.ts
Normal file
203
deno/payloads/v10/autoModeration.ts
Normal file
@@ -0,0 +1,203 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/auto-moderation
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-auto-moderation-rule-structure
|
||||
*/
|
||||
export interface APIAutoModerationRule {
|
||||
/**
|
||||
* The id of this rule
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The guild which this rule belongs to
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The rule name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The user id who created this rule
|
||||
*/
|
||||
creator_id: Snowflake;
|
||||
/**
|
||||
* The rule event type
|
||||
*/
|
||||
event_type: AutoModerationRuleEventType;
|
||||
/**
|
||||
* The rule trigger type
|
||||
*/
|
||||
trigger_type: AutoModerationRuleTriggerType;
|
||||
/**
|
||||
* The rule trigger metadata
|
||||
*/
|
||||
trigger_metadata: APIAutoModerationRuleTriggerMetadata;
|
||||
/**
|
||||
* The actions which will execute when this rule is triggered
|
||||
*/
|
||||
actions: APIAutoModerationAction[];
|
||||
/**
|
||||
* Whether this rule is enabled
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* The role ids that shouldn't be affected by this rule (Maximum of 20)
|
||||
*/
|
||||
exempt_roles: Snowflake[];
|
||||
/**
|
||||
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
|
||||
*/
|
||||
exempt_channels: Snowflake[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types
|
||||
*/
|
||||
export enum AutoModerationRuleTriggerType {
|
||||
/**
|
||||
* Check if content contains words from a user defined list of keywords (Maximum of 3 per guild)
|
||||
*/
|
||||
Keyword = 1,
|
||||
/**
|
||||
* Check if content represents generic spam (Maximum of 1 per guild)
|
||||
*/
|
||||
Spam = 3,
|
||||
/**
|
||||
* Check if content contains words from internal pre-defined wordsets (Maximum of 1 per guild)
|
||||
*/
|
||||
KeywordPreset,
|
||||
/**
|
||||
* Check if content contains more mentions than allowed (Maximum of 1 per guild)
|
||||
*/
|
||||
MentionSpam,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata
|
||||
*/
|
||||
export interface APIAutoModerationRuleTriggerMetadata {
|
||||
/**
|
||||
* Substrings which will be searched for in content (Maximum of 1000)
|
||||
*
|
||||
* A keyword can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 30 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
*/
|
||||
keyword_filter?: string[];
|
||||
/**
|
||||
* The internally pre-defined wordsets which will be searched for in content
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
|
||||
*/
|
||||
presets?: AutoModerationRuleKeywordPresetType[];
|
||||
/**
|
||||
* Substrings which will be exempt from triggering the preset trigger type (Maximum of 1000)
|
||||
*
|
||||
* A allowed-word can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 30 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
|
||||
*/
|
||||
allow_list?: string[];
|
||||
/**
|
||||
* Regular expression patterns which will be matched against content (Maximum of 10)
|
||||
*
|
||||
* Only Rust flavored regex is currently supported (Maximum of 75 characters)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
*/
|
||||
regex_patterns?: string[];
|
||||
/**
|
||||
* Total number of mentions (role & user) allowed per message (Maximum of 50)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
|
||||
*/
|
||||
mention_total_limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-preset-types
|
||||
*/
|
||||
export enum AutoModerationRuleKeywordPresetType {
|
||||
/**
|
||||
* Words that may be considered forms of swearing or cursing
|
||||
*/
|
||||
Profanity = 1,
|
||||
/**
|
||||
* Words that refer to sexually explicit behavior or activity
|
||||
*/
|
||||
SexualContent,
|
||||
/**
|
||||
* Personal insults or words that may be considered hate speech
|
||||
*/
|
||||
Slurs,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types
|
||||
*/
|
||||
export enum AutoModerationRuleEventType {
|
||||
/**
|
||||
* When a member sends or edits a message in the guild
|
||||
*/
|
||||
MessageSend = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-auto-moderation-action-structure
|
||||
*/
|
||||
export interface APIAutoModerationAction {
|
||||
/**
|
||||
* The action type
|
||||
*/
|
||||
type: AutoModerationActionType;
|
||||
/**
|
||||
* Additional metadata needed during execution for this specific action type
|
||||
*
|
||||
* Will only be omitted if the action type is {@link AutoModerationActionType.BlockMessage}
|
||||
*/
|
||||
metadata?: APIAutoModerationActionMetadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types
|
||||
*/
|
||||
export enum AutoModerationActionType {
|
||||
/**
|
||||
* Blocks the content of a message according to the rule
|
||||
*/
|
||||
BlockMessage = 1,
|
||||
/**
|
||||
* Logs user content to a specified channel
|
||||
*/
|
||||
SendAlertMessage,
|
||||
/**
|
||||
* Timeout user for specified duration, this action type can be set if the bot has `MODERATE_MEMBERS` permission
|
||||
*/
|
||||
Timeout,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-metadata
|
||||
*/
|
||||
export interface APIAutoModerationActionMetadata {
|
||||
/**
|
||||
* Channel to which user content should be logged
|
||||
*
|
||||
* Associated action type: {@link AutoModerationActionType.SendAlertMessage}
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* Timeout duration in seconds (Maximum of 4 weeks - 2419200 seconds)
|
||||
*
|
||||
* Only available if using {@link AutoModerationRuleTriggerType.Keyword}
|
||||
*
|
||||
* Associated action type: {@link AutoModerationActionType.Timeout}
|
||||
*/
|
||||
duration_seconds?: number;
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
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';
|
||||
@@ -25,9 +26,9 @@ export interface APIPartialChannel {
|
||||
*/
|
||||
type: ChannelType;
|
||||
/**
|
||||
* The name of the channel (2-100 characters)
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,30 +40,46 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
|
||||
flags?: ChannelFlags;
|
||||
}
|
||||
|
||||
// TODO: update when text in voice is released
|
||||
export type TextChannelType =
|
||||
| ChannelType.DM
|
||||
| ChannelType.GroupDM
|
||||
| ChannelType.GuildNews
|
||||
| ChannelType.GuildPublicThread
|
||||
| ChannelType.GuildPrivateThread
|
||||
| ChannelType.GuildNewsThread
|
||||
| ChannelType.GuildAnnouncement
|
||||
| ChannelType.PublicThread
|
||||
| ChannelType.PrivateThread
|
||||
| ChannelType.AnnouncementThread
|
||||
| ChannelType.GuildText
|
||||
| ChannelType.GuildForum;
|
||||
| ChannelType.GuildForum
|
||||
| ChannelType.GuildVoice;
|
||||
|
||||
export type GuildChannelType = Exclude<
|
||||
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
|
||||
ChannelType.DM | ChannelType.GroupDM
|
||||
>;
|
||||
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*
|
||||
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
|
||||
*
|
||||
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
|
||||
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelBase<T>, 'name'> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The id of the guild (may be missing for some channel objects received over gateway guild dispatches)
|
||||
*/
|
||||
@@ -76,7 +93,7 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position?: number;
|
||||
position: number;
|
||||
/**
|
||||
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
|
||||
*
|
||||
@@ -94,40 +111,28 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
|
||||
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APIGuildTextChannel<T extends GuildTextChannelType>
|
||||
extends APITextBasedChannel<T>,
|
||||
extends Omit<APITextBasedChannel<T>, 'name'>,
|
||||
APIGuildChannel<T> {
|
||||
/**
|
||||
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
|
||||
*/
|
||||
default_auto_archive_duration?: ThreadAutoArchiveDuration;
|
||||
/**
|
||||
* The channel topic (0-1024 characters)
|
||||
* The initial `rate_limit_per_user` to set on newly created threads.
|
||||
* This field is copied to the thread at creation time and does not live update
|
||||
*/
|
||||
default_thread_rate_limit_per_user?: number;
|
||||
/**
|
||||
* The channel topic (0-4096 characters for forum channels, 0-1024 characters for all others)
|
||||
*/
|
||||
topic?: string | null;
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
export interface APITextChannel extends APIGuildTextChannel<ChannelType.GuildText> {
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*
|
||||
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
|
||||
*
|
||||
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
|
||||
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
}
|
||||
|
||||
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
|
||||
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
|
||||
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
|
||||
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
|
||||
|
||||
export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageVoice | ChannelType.GuildVoice> {
|
||||
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
|
||||
/**
|
||||
* The bitrate (in bits) of the voice channel
|
||||
*/
|
||||
@@ -142,6 +147,11 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
rtc_region?: string | null;
|
||||
}
|
||||
|
||||
export interface APIGuildVoiceChannel
|
||||
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
|
||||
Omit<APITextBasedChannel<ChannelType.GuildVoice>, 'name' | 'last_pin_timestamp'> {
|
||||
/**
|
||||
* The camera video quality mode of the voice channel, `1` when not present
|
||||
*
|
||||
@@ -150,7 +160,9 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
|
||||
video_quality_mode?: VideoQualityMode;
|
||||
}
|
||||
|
||||
interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T> {
|
||||
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
|
||||
|
||||
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
|
||||
/**
|
||||
* The recipients of the DM
|
||||
*
|
||||
@@ -159,9 +171,18 @@ interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>
|
||||
recipients?: APIUser[];
|
||||
}
|
||||
|
||||
export type APIDMChannel = APIDMChannelBase<ChannelType.DM>;
|
||||
export interface APIDMChannel extends Omit<APIDMChannelBase<ChannelType.DM>, 'name'> {
|
||||
/**
|
||||
* The name of the channel (always null for DM channels)
|
||||
*/
|
||||
name: null;
|
||||
}
|
||||
|
||||
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
name: string | null;
|
||||
/**
|
||||
* Application id of the group DM creator if it is bot-created
|
||||
*/
|
||||
@@ -170,10 +191,6 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
|
||||
* Icon hash
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The name of the channel (2-100 characters)
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* ID of the DM creator
|
||||
*/
|
||||
@@ -185,9 +202,11 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
|
||||
}
|
||||
|
||||
export interface APIThreadChannel
|
||||
extends APIGuildChannel<
|
||||
ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread | ChannelType.GuildNewsThread
|
||||
> {
|
||||
extends Omit<
|
||||
APITextBasedChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread>,
|
||||
'name'
|
||||
>,
|
||||
APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
|
||||
/**
|
||||
* The client users member for the thread, only included in select endpoints
|
||||
*/
|
||||
@@ -197,34 +216,121 @@ export interface APIThreadChannel
|
||||
*/
|
||||
thread_metadata?: APIThreadMetadata;
|
||||
/**
|
||||
* The approximate message count of the thread, does not count above 50 even if there are more messages
|
||||
* Number of messages (not including the initial message or deleted messages) in a thread
|
||||
*
|
||||
* If the thread was created before July 1, 2022, it stops counting at 50 messages
|
||||
*/
|
||||
message_count?: number;
|
||||
/**
|
||||
* The approximate member count of the thread, does not count above 50 even if there are more members
|
||||
*/
|
||||
member_count?: number;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*
|
||||
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
|
||||
*
|
||||
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
|
||||
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
/**
|
||||
* ID of the thread creator
|
||||
*/
|
||||
owner_id?: Snowflake;
|
||||
/**
|
||||
* The id of the last message sent in this thread (may not point to an existing or valid message)
|
||||
* Number of messages ever sent in a thread
|
||||
*
|
||||
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
total_message_sent?: number;
|
||||
/**
|
||||
* The IDs of the set of tags that have been applied to a thread in a forum channel
|
||||
*/
|
||||
applied_tags: Snowflake[];
|
||||
}
|
||||
|
||||
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure
|
||||
*/
|
||||
export interface APIGuildForumTag {
|
||||
/**
|
||||
* The id of the tag
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The name of the tag (0-20 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Whether this tag can only be added to or removed from threads by a member with the `MANAGE_THREADS` permission
|
||||
*/
|
||||
moderated: boolean;
|
||||
/**
|
||||
* The id of a guild's custom emoji
|
||||
*/
|
||||
emoji_id: Snowflake | null;
|
||||
/**
|
||||
* The unicode character of the emoji
|
||||
*/
|
||||
emoji_name: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#default-reaction-object-default-reaction-structure
|
||||
*/
|
||||
export interface APIGuildForumDefaultReactionEmoji {
|
||||
/**
|
||||
* The id of a guild's custom emoji
|
||||
*/
|
||||
emoji_id: Snowflake | null;
|
||||
/**
|
||||
* The unicode character of the emoji
|
||||
*/
|
||||
emoji_name: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types
|
||||
*/
|
||||
export enum SortOrderType {
|
||||
/**
|
||||
* Sort forum posts by activity
|
||||
*/
|
||||
LatestActivity,
|
||||
/**
|
||||
* Sort forum posts by creation time (from most recent to oldest)
|
||||
*/
|
||||
CreationDate,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel/#channel-object-forum-layout-types
|
||||
*/
|
||||
export enum ForumLayoutType {
|
||||
/**
|
||||
* No default has been set for forum channel
|
||||
*/
|
||||
NotSet,
|
||||
/**
|
||||
* Display posts as a list
|
||||
*/
|
||||
ListView,
|
||||
/**
|
||||
* Display posts as a collection of tiles
|
||||
*/
|
||||
GalleryView,
|
||||
}
|
||||
|
||||
export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
|
||||
/**
|
||||
* The set of tags that can be used in a forum channel
|
||||
*/
|
||||
available_tags: APIGuildForumTag[];
|
||||
/**
|
||||
* The emoji to show in the add reaction button on a thread in a forum channel
|
||||
*/
|
||||
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
|
||||
/**
|
||||
* The default sort order type used to order posts in a forum channel
|
||||
*/
|
||||
default_sort_order: SortOrderType | null;
|
||||
/**
|
||||
* The default layout type used to display posts in a forum channel. Defaults to `0`, which indicates a layout view has not been set by a channel admin
|
||||
*/
|
||||
default_forum_layout: ForumLayoutType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
|
||||
@@ -234,10 +340,10 @@ export type APIChannel =
|
||||
| APIDMChannel
|
||||
| APITextChannel
|
||||
| APINewsChannel
|
||||
| APIVoiceChannel
|
||||
| APIGuildVoiceChannel
|
||||
| APIGuildStageVoiceChannel
|
||||
| APIGuildCategoryChannel
|
||||
| APIThreadChannel
|
||||
| APINewsChannel
|
||||
| APIGuildForumChannel;
|
||||
|
||||
/**
|
||||
@@ -263,43 +369,72 @@ export enum ChannelType {
|
||||
/**
|
||||
* An organizational category that contains up to 50 channels
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/115001580171-Channel-Categories-101
|
||||
* See https://support.discord.com/hc/articles/115001580171
|
||||
*/
|
||||
GuildCategory,
|
||||
/**
|
||||
* A channel that users can follow and crosspost into their own guild
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/360032008192
|
||||
* See https://support.discord.com/hc/articles/360032008192
|
||||
*/
|
||||
GuildNews,
|
||||
GuildAnnouncement,
|
||||
/**
|
||||
* A thread channel (public) within a Guild News channel
|
||||
* A temporary sub-channel within a Guild Announcement channel
|
||||
*/
|
||||
GuildNewsThread = 10,
|
||||
AnnouncementThread = 10,
|
||||
/**
|
||||
* A public thread channel within a Guild Text channel
|
||||
* A temporary sub-channel within a Guild Text or Guild Forum channel
|
||||
*/
|
||||
GuildPublicThread,
|
||||
PublicThread,
|
||||
/**
|
||||
* A private thread channel within a Guild Text channel
|
||||
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
|
||||
*/
|
||||
GuildPrivateThread,
|
||||
PrivateThread,
|
||||
/**
|
||||
* A voice channel for hosting events with an audience
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/1500005513722
|
||||
* See https://support.discord.com/hc/articles/1500005513722
|
||||
*/
|
||||
GuildStageVoice,
|
||||
/**
|
||||
* The channel in a Student Hub containing the listed servers
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
|
||||
* See https://support.discord.com/hc/articles/4406046651927
|
||||
*/
|
||||
GuildDirectory,
|
||||
/**
|
||||
* A channel that can only contain threads
|
||||
*/
|
||||
GuildForum,
|
||||
|
||||
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
|
||||
|
||||
/**
|
||||
* A channel that users can follow and crosspost into their own guild
|
||||
*
|
||||
* @deprecated This is the old name for {@apilink ChannelType#GuildAnnouncement}
|
||||
*
|
||||
* See https://support.discord.com/hc/articles/360032008192
|
||||
*/
|
||||
GuildNews = 5,
|
||||
/**
|
||||
* A temporary sub-channel within a Guild Announcement channel
|
||||
*
|
||||
* @deprecated This is the old name for {@apilink ChannelType#AnnouncementThread}
|
||||
*/
|
||||
GuildNewsThread = 10,
|
||||
/**
|
||||
* A temporary sub-channel within a Guild Text channel
|
||||
*
|
||||
* @deprecated This is the old name for {@apilink ChannelType#PublicThread}
|
||||
*/
|
||||
GuildPublicThread = 11,
|
||||
/**
|
||||
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
|
||||
*
|
||||
* @deprecated This is the old name for {@apilink ChannelType#PrivateThread}
|
||||
*/
|
||||
GuildPrivateThread = 12,
|
||||
}
|
||||
|
||||
export enum VideoQualityMode {
|
||||
@@ -336,6 +471,13 @@ export interface APIMessage {
|
||||
author: APIUser;
|
||||
/**
|
||||
* Contents of the message
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
content: string;
|
||||
/**
|
||||
@@ -386,12 +528,26 @@ export interface APIMessage {
|
||||
* Any attached files
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
attachments: APIAttachment[];
|
||||
/**
|
||||
* Any embedded content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
embeds: APIEmbed[];
|
||||
/**
|
||||
@@ -430,7 +586,7 @@ export interface APIMessage {
|
||||
/**
|
||||
* Sent with Rich Presence-related chat embeds
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
|
||||
* See https://discord.com/developers/docs/resources/application#application-object
|
||||
*/
|
||||
application?: Partial<APIApplication>;
|
||||
/**
|
||||
@@ -475,6 +631,13 @@ export interface APIMessage {
|
||||
thread?: APIChannel;
|
||||
/**
|
||||
* Sent if the message contains components like buttons, action rows, or other interactive components
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
|
||||
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
|
||||
/**
|
||||
@@ -490,6 +653,17 @@ export interface APIMessage {
|
||||
* @deprecated Use `sticker_items` instead
|
||||
*/
|
||||
stickers?: APISticker[];
|
||||
/**
|
||||
* A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread
|
||||
*
|
||||
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
|
||||
*/
|
||||
position?: number;
|
||||
|
||||
/**
|
||||
* Data of the role subscription purchase or renewal that prompted this `ROLE_SUBSCRIPTION_PURCHASE` message
|
||||
*/
|
||||
role_subscription_data?: APIMessageRoleSubscriptionData;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -503,12 +677,13 @@ export enum MessageType {
|
||||
ChannelNameChange,
|
||||
ChannelIconChange,
|
||||
ChannelPinnedMessage,
|
||||
GuildMemberJoin,
|
||||
UserPremiumGuildSubscription,
|
||||
UserPremiumGuildSubscriptionTier1,
|
||||
UserPremiumGuildSubscriptionTier2,
|
||||
UserPremiumGuildSubscriptionTier3,
|
||||
UserJoin,
|
||||
GuildBoost,
|
||||
GuildBoostTier1,
|
||||
GuildBoostTier2,
|
||||
GuildBoostTier3,
|
||||
ChannelFollowAdd,
|
||||
|
||||
GuildDiscoveryDisqualified = 14,
|
||||
GuildDiscoveryRequalified,
|
||||
GuildDiscoveryGracePeriodInitialWarning,
|
||||
@@ -519,6 +694,30 @@ export enum MessageType {
|
||||
ThreadStarterMessage,
|
||||
GuildInviteReminder,
|
||||
ContextMenuCommand,
|
||||
AutoModerationAction,
|
||||
RoleSubscriptionPurchase,
|
||||
InteractionPremiumUpsell,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
StageStart,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
StageEnd,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
StageSpeaker,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
StageRaiseHand,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
StageTopic,
|
||||
GuildApplicationPremiumSubscription,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -609,6 +808,28 @@ export enum MessageFlags {
|
||||
FailedToMentionSomeRolesInThread = 1 << 8,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#role-subscription-data-object-role-subscription-data-object-structure
|
||||
*/
|
||||
export interface APIMessageRoleSubscriptionData {
|
||||
/**
|
||||
* The id of the SKU and listing the user is subscribed to
|
||||
*/
|
||||
role_subscription_listing_id: Snowflake;
|
||||
/**
|
||||
* The name of the tier the user is subscribed to
|
||||
*/
|
||||
tier_name: string;
|
||||
/**
|
||||
* The number of months the user has been subscribed for
|
||||
*/
|
||||
total_months_subscribed: number;
|
||||
/**
|
||||
* Whether this notification is for a renewal
|
||||
*/
|
||||
is_renewal: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#followed-channel-object
|
||||
*/
|
||||
@@ -743,6 +964,14 @@ export interface APIThreadMember {
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
flags: ThreadMemberFlags;
|
||||
/**
|
||||
* Additional information about the user
|
||||
*
|
||||
* **This field is omitted on the member sent within each thread in the `GUILD_CREATE` event**
|
||||
*
|
||||
* **This field is only present when `with_member` is set to true when calling `List Thread Members` or `Get Thread Member`**
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
|
||||
export enum ThreadMemberFlags {}
|
||||
@@ -871,6 +1100,12 @@ export enum EmbedType {
|
||||
* Link embed
|
||||
*/
|
||||
Link = 'link',
|
||||
/**
|
||||
* Auto moderation alert embed
|
||||
*
|
||||
* @unstable This embed type is currently not documented by Discord, but it is returned in the auto moderation system messages.
|
||||
*/
|
||||
AutoModerationMessage = 'auto_moderation_message',
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -903,6 +1138,10 @@ export interface APIEmbedVideo {
|
||||
* Source url of video
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* A proxied url of the video
|
||||
*/
|
||||
proxy_url?: string;
|
||||
/**
|
||||
* Height of video
|
||||
*/
|
||||
@@ -1142,7 +1381,7 @@ export interface APIBaseComponent<T extends ComponentType> {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#component-types
|
||||
* https://discord.com/developers/docs/interactions/message-components#component-object-component-types
|
||||
*/
|
||||
export enum ComponentType {
|
||||
/**
|
||||
@@ -1154,13 +1393,38 @@ export enum ComponentType {
|
||||
*/
|
||||
Button,
|
||||
/**
|
||||
* Select Menu component
|
||||
* Select menu for picking from defined text options
|
||||
*/
|
||||
SelectMenu,
|
||||
StringSelect,
|
||||
/**
|
||||
* Text Input component
|
||||
*/
|
||||
TextInput,
|
||||
/**
|
||||
* Select menu for users
|
||||
*/
|
||||
UserSelect,
|
||||
/**
|
||||
* Select menu for roles
|
||||
*/
|
||||
RoleSelect,
|
||||
/**
|
||||
* Select menu for users and roles
|
||||
*/
|
||||
MentionableSelect,
|
||||
/**
|
||||
* Select menu for channels
|
||||
*/
|
||||
ChannelSelect,
|
||||
|
||||
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
|
||||
|
||||
/**
|
||||
* Select menu for picking from defined text options
|
||||
*
|
||||
* @deprecated This is the old name for {@apilink ComponentType#StringSelect}
|
||||
*/
|
||||
SelectMenu = 3,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1252,15 +1516,18 @@ export enum TextInputStyle {
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.SelectMenu> {
|
||||
export interface APIBaseSelectMenuComponent<
|
||||
T extends
|
||||
| ComponentType.StringSelect
|
||||
| ComponentType.UserSelect
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.MentionableSelect
|
||||
| ComponentType.ChannelSelect,
|
||||
> extends APIBaseComponent<T> {
|
||||
/**
|
||||
* A developer-defined identifier for the select menu, max 100 characters
|
||||
*/
|
||||
custom_id: string;
|
||||
/**
|
||||
* The choices in the select, max 25
|
||||
*/
|
||||
options: APISelectMenuOption[];
|
||||
/**
|
||||
* Custom placeholder text if nothing is selected, max 150 characters
|
||||
*/
|
||||
@@ -1285,6 +1552,51 @@ export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.S
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<ComponentType.StringSelect> {
|
||||
/**
|
||||
* Specified choices in a select menu; max 25
|
||||
*/
|
||||
options: APISelectMenuOption[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APIUserSelectComponent = APIBaseSelectMenuComponent<ComponentType.UserSelect>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APIRoleSelectComponent = APIBaseSelectMenuComponent<ComponentType.RoleSelect>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APIMentionableSelectComponent = APIBaseSelectMenuComponent<ComponentType.MentionableSelect>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export interface APIChannelSelectComponent extends APIBaseSelectMenuComponent<ComponentType.ChannelSelect> {
|
||||
/**
|
||||
* List of channel types to include in the ChannelSelect component
|
||||
*/
|
||||
channel_types?: ChannelType[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APISelectMenuComponent =
|
||||
| APIStringSelectComponent
|
||||
| APIUserSelectComponent
|
||||
| APIRoleSelectComponent
|
||||
| APIMentionableSelectComponent
|
||||
| APIChannelSelectComponent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
|
||||
*/
|
||||
@@ -1353,7 +1665,15 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
export enum ChannelFlags {
|
||||
/**
|
||||
* This thread is pinned to the top of its parent forum channel
|
||||
*/
|
||||
Pinned = 1 << 1,
|
||||
/**
|
||||
* Whether a tag is required to be specified when creating a thread in a forum channel.
|
||||
* Tags are specified in the `applied_tags` field
|
||||
*/
|
||||
RequireTag = 1 << 4,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
* Types extracted from
|
||||
* - https://discord.com/developers/docs/topics/gateway
|
||||
* - https://discord.com/developers/docs/topics/gateway-events
|
||||
*/
|
||||
|
||||
import type { APIChannel, APIThreadMember } from './channel.ts';
|
||||
@@ -58,7 +60,7 @@ export interface APIGatewaySessionStartLimit {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#presence-update-presence-update-event-fields
|
||||
* https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields
|
||||
*/
|
||||
export interface GatewayPresenceUpdate {
|
||||
/**
|
||||
@@ -81,13 +83,13 @@ export interface GatewayPresenceUpdate {
|
||||
/**
|
||||
* User's current activities
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object
|
||||
*/
|
||||
activities?: GatewayActivity[];
|
||||
/**
|
||||
* User's platform-dependent status
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#client-status-object
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#client-status-object
|
||||
*/
|
||||
client_status?: GatewayPresenceClientStatus;
|
||||
}
|
||||
@@ -104,7 +106,7 @@ export enum PresenceUpdateStatus {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#client-status-object
|
||||
* https://discord.com/developers/docs/topics/gateway-events#client-status-object
|
||||
*/
|
||||
export interface GatewayPresenceClientStatus {
|
||||
/**
|
||||
@@ -122,7 +124,7 @@ export interface GatewayPresenceClientStatus {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure
|
||||
*/
|
||||
export interface GatewayActivity {
|
||||
/**
|
||||
@@ -137,7 +139,7 @@ export interface GatewayActivity {
|
||||
/**
|
||||
* Activity type
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types
|
||||
*/
|
||||
type: ActivityType;
|
||||
/**
|
||||
@@ -177,7 +179,7 @@ export interface GatewayActivity {
|
||||
/**
|
||||
* The emoji used for a custom status
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji
|
||||
*/
|
||||
emoji?: GatewayActivityEmoji;
|
||||
/**
|
||||
@@ -187,19 +189,19 @@ export interface GatewayActivity {
|
||||
/**
|
||||
* Information for the current party of the player
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
|
||||
*/
|
||||
party?: GatewayActivityParty;
|
||||
/**
|
||||
* Images for the presence and their hover texts
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets
|
||||
*/
|
||||
assets?: GatewayActivityAssets;
|
||||
/**
|
||||
* Secrets for Rich Presence joining and spectating
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets
|
||||
*/
|
||||
secrets?: GatewayActivitySecrets;
|
||||
/**
|
||||
@@ -209,7 +211,7 @@ export interface GatewayActivity {
|
||||
/**
|
||||
* Activity flags `OR`d together, describes what the payload includes
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
@@ -236,7 +238,7 @@ export enum ActivityPlatform {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types
|
||||
*/
|
||||
export enum ActivityType {
|
||||
/**
|
||||
@@ -266,7 +268,7 @@ export enum ActivityType {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-timestamps
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-timestamps
|
||||
*/
|
||||
export interface GatewayActivityTimestamps {
|
||||
/**
|
||||
@@ -280,12 +282,12 @@ export interface GatewayActivityTimestamps {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji
|
||||
*/
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'id' | 'animated'>> & Pick<APIEmoji, 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
|
||||
*/
|
||||
export interface GatewayActivityParty {
|
||||
/**
|
||||
@@ -299,19 +301,19 @@ export interface GatewayActivityParty {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets
|
||||
*/
|
||||
export type GatewayActivityAssets = Partial<
|
||||
Record<'large_image' | 'large_text' | 'small_image' | 'small_text', string>
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets
|
||||
*/
|
||||
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags
|
||||
*/
|
||||
export enum ActivityFlags {
|
||||
Instance = 1 << 0,
|
||||
@@ -337,7 +339,7 @@ export interface GatewayActivityButton {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#thread-list-sync-thread-list-sync-event-fields
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-list-sync-thread-list-sync-event-fields
|
||||
*/
|
||||
export interface GatewayThreadListSync {
|
||||
/**
|
||||
@@ -359,7 +361,7 @@ export interface GatewayThreadListSync {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#thread-members-update-thread-members-update-event-fields
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-members-update-thread-members-update-event-fields
|
||||
*/
|
||||
export interface GatewayThreadMembersUpdate {
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import type { APIEmoji } from './emoji.ts';
|
||||
import type { PresenceUpdateStatus } from './gateway.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APISticker } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
@@ -69,10 +70,6 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
|
||||
* The vanity url code for the guild
|
||||
*/
|
||||
vanity_url_code?: string | null;
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*/
|
||||
unavailable?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,9 +118,9 @@ export interface APIGuild extends APIPartialGuild {
|
||||
*/
|
||||
afk_channel_id: Snowflake | null;
|
||||
/**
|
||||
* afk timeout in seconds
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout: number;
|
||||
afk_timeout: 60 | 300 | 900 | 1800 | 3600;
|
||||
/**
|
||||
* `true` if the guild widget is enabled
|
||||
*/
|
||||
@@ -371,6 +368,14 @@ export enum GuildSystemChannelFlags {
|
||||
* Hide member join sticker reply buttons
|
||||
*/
|
||||
SuppressJoinNotificationReplies = 1 << 3,
|
||||
/**
|
||||
* Suppress role subscription purchase and renewal notifications
|
||||
*/
|
||||
SupressRoleSubscriptionPurchaseNotifications = 1 << 4,
|
||||
/**
|
||||
* Hide role subscription sticker reply buttons
|
||||
*/
|
||||
SuppressRoleSubscriptionPurchaseNotificationReplies = 1 << 5,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -385,18 +390,36 @@ export enum GuildFeature {
|
||||
* Guild has access to set an animated guild icon
|
||||
*/
|
||||
AnimatedIcon = 'ANIMATED_ICON',
|
||||
/**
|
||||
* Guild is using the old permissions configuration behavior
|
||||
*
|
||||
* See https://discord.com/developers/docs/change-log#upcoming-application-command-permission-changes
|
||||
*/
|
||||
ApplicationCommandPermissionsV2 = 'APPLICATION_COMMAND_PERMISSIONS_V2',
|
||||
/**
|
||||
* Guild has set up auto moderation rules
|
||||
*/
|
||||
AutoModeration = 'AUTO_MODERATION',
|
||||
/**
|
||||
* Guild has access to set a guild banner image
|
||||
*/
|
||||
Banner = 'BANNER',
|
||||
/**
|
||||
* Guild has access to use commerce features (i.e. create store channels)
|
||||
*/
|
||||
Commerce = 'COMMERCE',
|
||||
/**
|
||||
* Guild can enable welcome screen, Membership Screening and discovery, and receives community updates
|
||||
*/
|
||||
Community = 'COMMUNITY',
|
||||
/**
|
||||
* Guild has enabled monetization
|
||||
*/
|
||||
CreatorMonetizableProvisional = 'CREATOR_MONETIZABLE_PROVISIONAL',
|
||||
/**
|
||||
* Guild has enabled the role subscription promo page
|
||||
*/
|
||||
CreatorStorePage = 'CREATOR_STORE_PAGE',
|
||||
/*
|
||||
* Guild has been set as a support server on the App Directory
|
||||
*/
|
||||
DeveloperSupportServer = 'DEVELOPER_SUPPORT_SERVER',
|
||||
/**
|
||||
* Guild is able to be discovered in the directory
|
||||
*/
|
||||
@@ -412,9 +435,15 @@ export enum GuildFeature {
|
||||
/**
|
||||
* Guild is a Student Hub
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
|
||||
* See https://support.discord.com/hc/articles/4406046651927
|
||||
*
|
||||
* @unstable This feature is currently not documented by Discord, but has known value
|
||||
*/
|
||||
Hub = 'HUB',
|
||||
/**
|
||||
* Guild has disabled invite usage, preventing users from joining
|
||||
*/
|
||||
InvitesDisabled = 'INVITES_DISABLED',
|
||||
/**
|
||||
* Guild has access to set an invite splash background
|
||||
*/
|
||||
@@ -422,7 +451,9 @@ export enum GuildFeature {
|
||||
/**
|
||||
* Guild is in a Student Hub
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
|
||||
* See https://support.discord.com/hc/articles/4406046651927
|
||||
*
|
||||
* @unstable This feature is currently not documented by Discord, but has known value
|
||||
*/
|
||||
LinkedToHub = 'LINKED_TO_HUB',
|
||||
/**
|
||||
@@ -431,6 +462,8 @@ export enum GuildFeature {
|
||||
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
|
||||
/**
|
||||
* Guild has enabled monetization
|
||||
*
|
||||
* @unstable This feature is no longer documented by Discord
|
||||
*/
|
||||
MonetizationEnabled = 'MONETIZATION_ENABLED',
|
||||
/**
|
||||
@@ -458,6 +491,14 @@ export enum GuildFeature {
|
||||
* Guild is able to set role icons
|
||||
*/
|
||||
RoleIcons = 'ROLE_ICONS',
|
||||
/**
|
||||
* Guild has role subscriptions that can be purchased
|
||||
*/
|
||||
RoleSubscriptionsAvailableForPurchase = 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE',
|
||||
/**
|
||||
* Guild has enabled role subscriptions
|
||||
*/
|
||||
RoleSubscriptionsEnabled = 'ROLE_SUBSCRIPTIONS_ENABLED',
|
||||
/**
|
||||
* Guild has enabled ticketed events
|
||||
*/
|
||||
@@ -587,7 +628,7 @@ export interface APIGuildMember {
|
||||
/**
|
||||
* When the user started boosting the guild
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/360028038352-Server-Boosting-
|
||||
* See https://support.discord.com/hc/articles/360028038352
|
||||
*/
|
||||
premium_since?: string | null;
|
||||
/**
|
||||
@@ -629,7 +670,7 @@ export interface APIGuildIntegration {
|
||||
/**
|
||||
* Is this integration enabled
|
||||
*/
|
||||
enabled?: boolean;
|
||||
enabled: boolean;
|
||||
/**
|
||||
* Is this integration syncing
|
||||
*
|
||||
@@ -665,7 +706,7 @@ export interface APIGuildIntegration {
|
||||
/**
|
||||
* User for this integration
|
||||
*
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
* **Some older integrations may not have an attached user.**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
@@ -702,9 +743,13 @@ export interface APIGuildIntegration {
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
*/
|
||||
application?: APIGuildIntegrationApplication;
|
||||
/**
|
||||
* The scopes the application has been authorized for
|
||||
*/
|
||||
scopes?: OAuth2Scopes[];
|
||||
}
|
||||
|
||||
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord';
|
||||
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
|
||||
@@ -773,7 +818,7 @@ export interface APIBan {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object
|
||||
*/
|
||||
export interface APIGuildWidget {
|
||||
id: Snowflake;
|
||||
@@ -785,7 +830,7 @@ export interface APIGuildWidget {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
|
||||
*/
|
||||
export interface APIGuildWidgetChannel {
|
||||
id: Snowflake;
|
||||
@@ -794,7 +839,7 @@ export interface APIGuildWidgetChannel {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
|
||||
*/
|
||||
export interface APIGuildWidgetMember {
|
||||
id: string;
|
||||
|
||||
@@ -53,7 +53,7 @@ export interface APIInvite {
|
||||
/**
|
||||
* The type of target for this voice channel invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
|
||||
*/
|
||||
target_type?: InviteTargetType;
|
||||
/**
|
||||
@@ -65,7 +65,7 @@ export interface APIInvite {
|
||||
/**
|
||||
* The embedded application to open for this voice channel embedded application invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/oauth2#application
|
||||
* See https://discord.com/developers/docs/resources/application#application-object
|
||||
*/
|
||||
target_application?: Partial<APIApplication>;
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export * from '../common.ts';
|
||||
export * from './application.ts';
|
||||
export * from './auditLog.ts';
|
||||
export * from './autoModeration.ts';
|
||||
export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
|
||||
@@ -61,6 +61,10 @@ export enum OAuth2Scopes {
|
||||
* (otherwise restricted to channels/guilds your app creates)
|
||||
*/
|
||||
MessagesRead = 'messages.read',
|
||||
/**
|
||||
* Allows your app to update a user's connection and metadata for the app
|
||||
*/
|
||||
RoleConnectionsWrite = 'role_connections.write',
|
||||
/**
|
||||
* For local rpc server access, this allows you to control a user's local Discord client - requires Discord approval
|
||||
*/
|
||||
|
||||
@@ -72,4 +72,16 @@ export interface APIRoleTags {
|
||||
* The id of the integration this role belongs to
|
||||
*/
|
||||
integration_id?: Snowflake;
|
||||
/**
|
||||
* The id of this role's subscription sku and listing
|
||||
*/
|
||||
subscription_listing_id?: Snowflake;
|
||||
/**
|
||||
* Whether this role is available for purchase
|
||||
*/
|
||||
available_for_purchase?: null;
|
||||
/**
|
||||
* Whether this role is a guild's linked role
|
||||
*/
|
||||
guild_connections?: null;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ export enum StickerType {
|
||||
*/
|
||||
Standard = 1,
|
||||
/**
|
||||
* A sticker uploaded to a Boosted guild for the guild's members
|
||||
* A sticker uploaded to a guild for the guild's members
|
||||
*/
|
||||
Guild,
|
||||
}
|
||||
@@ -85,6 +85,7 @@ export enum StickerFormatType {
|
||||
PNG = 1,
|
||||
APNG,
|
||||
Lottie,
|
||||
GIF,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface APITeam {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-members-object
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-member-object
|
||||
*/
|
||||
export interface APITeamMember {
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/template
|
||||
* Types extracted from https://discord.com/developers/docs/resources/guild-template
|
||||
*/
|
||||
|
||||
import type { APIUser } from './user.ts';
|
||||
@@ -7,7 +7,7 @@ import type { Snowflake } from '../../globals.ts';
|
||||
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v10/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#template-object
|
||||
* https://discord.com/developers/docs/resources/guild-template#guild-template-object
|
||||
*/
|
||||
export interface APITemplate {
|
||||
/**
|
||||
|
||||
@@ -134,7 +134,7 @@ export enum UserFlags {
|
||||
*/
|
||||
VerifiedDeveloper = 1 << 17,
|
||||
/**
|
||||
* Discord Certified Moderator
|
||||
* Moderator Programs Alumni
|
||||
*/
|
||||
CertifiedModerator = 1 << 18,
|
||||
/**
|
||||
@@ -143,8 +143,24 @@ 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 is an [Active Developer](https://support-dev.discord.com/hc/articles/10113997751447)
|
||||
*/
|
||||
ActiveDeveloper = 1 << 22,
|
||||
/**
|
||||
* User's account has been [quarantined](https://support.discord.com/hc/articles/6461420677527) 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.
|
||||
*
|
||||
* @privateRemarks
|
||||
*
|
||||
* This value would be 1 << 44, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
Quarantined = 17592186044416,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,6 +170,7 @@ export enum UserPremiumType {
|
||||
None,
|
||||
NitroClassic,
|
||||
Nitro,
|
||||
NitroBasic,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,8 +187,10 @@ export interface APIConnection {
|
||||
name: string;
|
||||
/**
|
||||
* The service of the connection
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#connection-object-services
|
||||
*/
|
||||
type: string;
|
||||
type: ConnectionService;
|
||||
/**
|
||||
* Whether the connection is revoked
|
||||
*/
|
||||
@@ -194,6 +213,10 @@ export interface APIConnection {
|
||||
* Whether activities related to this connection will be shown in presence updates
|
||||
*/
|
||||
show_activity: boolean;
|
||||
/**
|
||||
* Whether this connection supports console voice transfer
|
||||
*/
|
||||
two_way_link: boolean;
|
||||
/**
|
||||
* Visibility of this connection
|
||||
*
|
||||
@@ -202,6 +225,27 @@ export interface APIConnection {
|
||||
visibility: ConnectionVisibility;
|
||||
}
|
||||
|
||||
export enum ConnectionService {
|
||||
BattleNet = 'battlenet',
|
||||
eBay = 'ebay',
|
||||
EpicGames = 'epicgames',
|
||||
Facebook = 'facebook',
|
||||
GitHub = 'github',
|
||||
LeagueOfLegends = 'leagueoflegends',
|
||||
PayPal = 'paypal',
|
||||
PlayStationNetwork = 'playstation',
|
||||
Reddit = 'reddit',
|
||||
RiotGames = 'riotgames',
|
||||
Spotify = 'spotify',
|
||||
Skype = 'skype',
|
||||
Steam = 'steam',
|
||||
TikTok = 'tiktok',
|
||||
Twitch = 'twitch',
|
||||
Twitter = 'twitter',
|
||||
Xbox = 'xbox',
|
||||
YouTube = 'youtube',
|
||||
}
|
||||
|
||||
export enum ConnectionVisibility {
|
||||
/**
|
||||
* Invisible to everyone except the user themselves
|
||||
@@ -212,3 +256,21 @@ export enum ConnectionVisibility {
|
||||
*/
|
||||
Everyone,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#application-role-connection-object-application-role-connection-structure
|
||||
*/
|
||||
export interface APIApplicationRoleConnection {
|
||||
/**
|
||||
* The vanity name of the platform a bot has connected (max 50 characters)
|
||||
*/
|
||||
platform_name: string | null;
|
||||
/**
|
||||
* The username on the platform a bot has connected (max 100 characters)
|
||||
*/
|
||||
platform_username: string | null;
|
||||
/**
|
||||
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
|
||||
*/
|
||||
metadata: Record<string, string | number>;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position?: number;
|
||||
position: number;
|
||||
/**
|
||||
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
|
||||
*/
|
||||
|
||||
@@ -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),
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
>;
|
||||
|
||||
|
||||
@@ -43,17 +43,12 @@ import type {
|
||||
APIApplicationCommandUserOption,
|
||||
} from './_chatInput/user.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionWrapper,
|
||||
APIInteractionDataResolvedChannel,
|
||||
APIInteractionDataResolvedGuildMember,
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands.ts';
|
||||
import type { APIInteractionDataResolved } from '../../mod.ts';
|
||||
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
|
||||
export * from './_chatInput/attachment.ts';
|
||||
export * from './_chatInput/base.ts';
|
||||
export * from './_chatInput/boolean.ts';
|
||||
export * from './_chatInput/channel.ts';
|
||||
export * from './_chatInput/integer.ts';
|
||||
@@ -108,23 +103,12 @@ export type APIApplicationCommandInteractionDataBasicOption =
|
||||
| APIApplicationCommandInteractionDataAttachmentOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIChatInputApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {
|
||||
options?: APIApplicationCommandInteractionDataOption[];
|
||||
resolved?: APIChatInputApplicationCommandInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
export interface APIChatInputApplicationCommandInteractionDataResolved {
|
||||
users?: Record<Snowflake, APIUser>;
|
||||
roles?: Record<Snowflake, APIRole>;
|
||||
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
|
||||
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
|
||||
attachments?: Record<Snowflake, APIAttachment>;
|
||||
resolved?: APIInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,33 +1,20 @@
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIMessage } from '../../channel.ts';
|
||||
import type { APIUser } from '../../user.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionWrapper,
|
||||
APIInteractionDataResolvedGuildMember,
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper, APIUserInteractionDataResolved } from '../base.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIUserApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.User> {
|
||||
target_id: Snowflake;
|
||||
resolved: APIUserApplicationCommandInteractionDataResolved;
|
||||
resolved: APIUserInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
export interface APIUserApplicationCommandInteractionDataResolved {
|
||||
users: Record<Snowflake, APIUser>;
|
||||
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIMessageApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.Message> {
|
||||
@@ -43,7 +30,7 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export type APIContextMenuInteractionData =
|
||||
| APIUserApplicationCommandInteractionData
|
||||
|
||||
@@ -15,8 +15,6 @@ import type { APIBaseInteraction } from './base.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { LocalizationMap } from '../../../v9.ts';
|
||||
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
|
||||
export * from './_applicationCommands/chatInput.ts';
|
||||
export * from './_applicationCommands/contextMenu.ts';
|
||||
@@ -85,6 +83,10 @@ export interface APIApplicationCommand {
|
||||
* @deprecated Use `dm_permission` and/or `default_member_permissions` instead
|
||||
*/
|
||||
default_permission?: boolean;
|
||||
/**
|
||||
* Indicates whether the command is age-restricted, defaults to `false`
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
@@ -101,34 +103,20 @@ export enum ApplicationCommandType {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export type APIApplicationCommandInteractionData =
|
||||
| APIChatInputApplicationCommandInteractionData
|
||||
| APIContextMenuInteractionData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
|
||||
thread_metadata?: APIThreadMetadata | null;
|
||||
permissions: Permissions;
|
||||
parent_id?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
|
||||
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
|
||||
Required<Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data'>>;
|
||||
Required<
|
||||
Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data' | 'app_permissions'>
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { LocaleString } from '../../../v9.ts';
|
||||
import type { APIMessage } from '../channel.ts';
|
||||
import type { APIRole, LocaleString } from '../../../v9.ts';
|
||||
import type { APIAttachment, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
|
||||
@@ -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
|
||||
*/
|
||||
@@ -125,3 +129,46 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
|
||||
'user'
|
||||
> &
|
||||
Required<Pick<Original, 'member' | 'guild_id'>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
|
||||
thread_metadata?: APIThreadMetadata | null;
|
||||
permissions: Permissions;
|
||||
parent_id?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
export interface APIInteractionDataResolved {
|
||||
users?: Record<Snowflake, APIUser>;
|
||||
roles?: Record<Snowflake, APIRole>;
|
||||
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
|
||||
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
|
||||
attachments?: Record<Snowflake, APIAttachment>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Renamed to `APIInteractionDataResolved`
|
||||
*/
|
||||
export type APIChatInputApplicationCommandInteractionDataResolved = APIInteractionDataResolved;
|
||||
|
||||
/**
|
||||
* `users` and optional `members` from APIInteractionDataResolved, for user commands and user selects
|
||||
*/
|
||||
export type APIUserInteractionDataResolved = Required<Pick<APIInteractionDataResolved, 'users'>> &
|
||||
Pick<APIInteractionDataResolved, 'members'>;
|
||||
|
||||
/**
|
||||
* @deprecated Renamed to `APIUserInteractionDataResolved`
|
||||
*/
|
||||
export type APIUserApplicationCommandInteractionDataResolved = APIUserInteractionDataResolved;
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
|
||||
import type {
|
||||
APIDMInteractionWrapper,
|
||||
APIGuildInteractionWrapper,
|
||||
APIInteractionDataResolved,
|
||||
APIUserInteractionDataResolved,
|
||||
} from './base.ts';
|
||||
import type { Snowflake } from '../../../globals.ts';
|
||||
import type { ComponentType } from '../channel.ts';
|
||||
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
|
||||
|
||||
@@ -9,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
|
||||
'channel_id' | 'data' | 'message'
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -20,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
|
||||
'channel_id' | 'data' | 'message'
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -31,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
|
||||
'channel_id' | 'data' | 'message'
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
@@ -50,11 +56,42 @@ export interface APIMessageComponentBaseInteractionData<CType extends ComponentT
|
||||
|
||||
export type APIMessageButtonInteractionData = APIMessageComponentBaseInteractionData<ComponentType.Button>;
|
||||
|
||||
export interface APIMessageSelectMenuInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.SelectMenu> {
|
||||
export interface APIMessageStringSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.StringSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIMessageUserSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.UserSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: APIUserInteractionDataResolved;
|
||||
}
|
||||
|
||||
export interface APIMessageRoleSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.RoleSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: Required<Pick<APIInteractionDataResolved, 'roles'>>;
|
||||
}
|
||||
|
||||
export interface APIMessageMentionableSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.MentionableSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: Pick<APIInteractionDataResolved, 'users' | 'members' | 'roles'>;
|
||||
}
|
||||
|
||||
export interface APIMessageChannelSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.ChannelSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: Required<Pick<APIInteractionDataResolved, 'channels'>>;
|
||||
}
|
||||
|
||||
export type APIMessageSelectMenuInteractionData =
|
||||
| APIMessageStringSelectInteractionData
|
||||
| APIMessageUserSelectInteractionData
|
||||
| APIMessageRoleSelectInteractionData
|
||||
| APIMessageMentionableSelectInteractionData
|
||||
| APIMessageChannelSelectInteractionData;
|
||||
|
||||
export type APIMessageComponentDMInteraction = APIDMInteractionWrapper<APIMessageComponentInteraction>;
|
||||
|
||||
export type APIMessageComponentGuildInteraction = APIGuildInteractionWrapper<APIMessageComponentInteraction>;
|
||||
|
||||
@@ -18,6 +18,9 @@ export interface ModalSubmitActionRowComponent
|
||||
components: ModalSubmitComponent[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure
|
||||
*/
|
||||
export interface APIModalSubmission {
|
||||
/**
|
||||
* A developer-defined identifier for the component, max 100 characters
|
||||
@@ -26,7 +29,7 @@ export interface APIModalSubmission {
|
||||
/**
|
||||
* A list of child components
|
||||
*/
|
||||
components?: ModalSubmitActionRowComponent[];
|
||||
components: ModalSubmitActionRowComponent[];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@ import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APITeam } from './teams.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { LocalizationMap } from '../common.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object
|
||||
@@ -62,7 +63,7 @@ export interface APIApplication {
|
||||
/**
|
||||
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
|
||||
*
|
||||
* See https://discord.com/developers/docs/game-sdk/applications#get-ticket
|
||||
* See https://discord.com/developers/docs/game-sdk/applications#getticket
|
||||
*/
|
||||
verify_key: string;
|
||||
/**
|
||||
@@ -105,6 +106,11 @@ export interface APIApplication {
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
custom_install_url?: string;
|
||||
/**
|
||||
* The application's role connection verification entry point,
|
||||
* which when configured will render the app as a verification method in the guild role verification configuration
|
||||
*/
|
||||
role_connections_verification_url?: string;
|
||||
}
|
||||
|
||||
export interface APIApplicationInstallParams {
|
||||
@@ -116,17 +122,131 @@ export interface APIApplicationInstallParams {
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
export enum ApplicationFlags {
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
EmbeddedReleased = 1 << 1,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
ManagedEmoji = 1 << 2,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
GroupDMCreate = 1 << 4,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
RPCHasConnected = 1 << 11,
|
||||
/**
|
||||
* Intent required for bots in 100 or more servers to receive `presence_update` events
|
||||
*/
|
||||
GatewayPresence = 1 << 12,
|
||||
/**
|
||||
* Intent required for bots in under 100 servers to receive `presence_update` events, found in Bot Settings
|
||||
*/
|
||||
GatewayPresenceLimited = 1 << 13,
|
||||
/**
|
||||
* Intent required for bots in 100 or more servers to receive member-related events like `guild_member_add`.
|
||||
* See list of member-related events [under `GUILD_MEMBERS`](https://discord.com/developers/docs/topics/gateway#list-of-intents)
|
||||
*/
|
||||
GatewayGuildMembers = 1 << 14,
|
||||
/**
|
||||
* Intent required for bots in under 100 servers to receive member-related events like `guild_member_add`, found in Bot Settings.
|
||||
* See list of member-related events [under `GUILD_MEMBERS`](https://discord.com/developers/docs/topics/gateway#list-of-intents)
|
||||
*/
|
||||
GatewayGuildMembersLimited = 1 << 15,
|
||||
/**
|
||||
* Indicates unusual growth of an app that prevents verification
|
||||
*/
|
||||
VerificationPendingGuildLimit = 1 << 16,
|
||||
/**
|
||||
* Indicates if an app is embedded within the Discord client (currently unavailable publicly)
|
||||
*/
|
||||
Embedded = 1 << 17,
|
||||
/**
|
||||
* Intent required for bots in 100 or more servers to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055)
|
||||
*/
|
||||
GatewayMessageContent = 1 << 18,
|
||||
/**
|
||||
* Intent required for bots in under 100 servers to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055),
|
||||
* found in Bot Settings
|
||||
*/
|
||||
GatewayMessageContentLimited = 1 << 19,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
EmbeddedFirstParty = 1 << 20,
|
||||
/**
|
||||
* Indicates if an app has registered global [application commands](https://discord.com/developers/docs/interactions/application-commands)
|
||||
*/
|
||||
ApplicationCommandBadge = 1 << 23,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure
|
||||
*/
|
||||
export interface APIApplicationRoleConnectionMetadata {
|
||||
/**
|
||||
* Type of metadata value
|
||||
*/
|
||||
type: ApplicationRoleConnectionMetadataType;
|
||||
/**
|
||||
* Dictionary key for the metadata field (must be `a-z`, `0-9`, or `_` characters; max 50 characters)
|
||||
*/
|
||||
key: string;
|
||||
/**
|
||||
* Name of the metadata field (max 100 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Translations of the name
|
||||
*/
|
||||
name_localizations?: LocalizationMap;
|
||||
/**
|
||||
* Description of the metadata field (max 200 characters)
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* Translations of the description
|
||||
*/
|
||||
description_localizations?: LocalizationMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type
|
||||
*/
|
||||
export enum ApplicationRoleConnectionMetadataType {
|
||||
/**
|
||||
* The metadata value (`integer`) is less than or equal to the guild's configured value (`integer`)
|
||||
*/
|
||||
IntegerLessThanOrEqual = 1,
|
||||
/**
|
||||
* The metadata value (`integer`) is greater than or equal to the guild's configured value (`integer`)
|
||||
*/
|
||||
IntegerGreaterThanOrEqual,
|
||||
/**
|
||||
* The metadata value (`integer`) is equal to the guild's configured value (`integer`)
|
||||
*/
|
||||
IntegerEqual,
|
||||
/**
|
||||
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`)
|
||||
*/
|
||||
IntegerNotEqual,
|
||||
/**
|
||||
* The metadata value (`ISO8601 string`) is less than or equal to the guild's configured value (`integer`; days before current date)
|
||||
*/
|
||||
DatetimeLessThanOrEqual,
|
||||
/**
|
||||
* The metadata value (`ISO8601 string`) is greater than or equal to the guild's configured value (`integer`; days before current date)
|
||||
*/
|
||||
DatetimeGreaterThanOrEqual,
|
||||
/**
|
||||
* The metadata value (`integer`) is equal to the guild's configured value (`integer`; `1`)
|
||||
*/
|
||||
BooleanEqual,
|
||||
/**
|
||||
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`; `1`)
|
||||
*/
|
||||
BooleanNotEqual,
|
||||
}
|
||||
|
||||
@@ -2,6 +2,13 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/audit-log
|
||||
*/
|
||||
|
||||
import type {
|
||||
APIAutoModerationAction,
|
||||
APIAutoModerationRule,
|
||||
APIAutoModerationRuleTriggerMetadata,
|
||||
AutoModerationRuleEventType,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from './autoModeration.ts';
|
||||
import type { APIChannel, APIOverwrite } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
@@ -52,6 +59,12 @@ export interface APIAuditLog {
|
||||
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object
|
||||
*/
|
||||
audit_log_entries: APIAuditLogEntry[];
|
||||
/**
|
||||
* List of auto moderation rules referenced in the audit log
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object
|
||||
*/
|
||||
auto_moderation_rules: APIAutoModerationRule[];
|
||||
/**
|
||||
* Partial integration objects
|
||||
*
|
||||
@@ -180,12 +193,37 @@ export enum AuditLogEvent {
|
||||
ThreadDelete,
|
||||
|
||||
ApplicationCommandPermissionUpdate = 121,
|
||||
|
||||
AutoModerationRuleCreate = 140,
|
||||
AutoModerationRuleUpdate,
|
||||
AutoModerationRuleDelete,
|
||||
AutoModerationBlockMessage,
|
||||
AutoModerationFlagToChannel,
|
||||
AutoModerationUserCommunicationDisabled,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
|
||||
*/
|
||||
export interface APIAuditLogOptions {
|
||||
/**
|
||||
* Name of the Auto Moderation rule that was triggered
|
||||
*
|
||||
* Present from:
|
||||
* - AUTO_MODERATION_BLOCK_MESSAGE
|
||||
* - AUTO_MODERATION_FLAG_TO_CHANNEL
|
||||
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
|
||||
*/
|
||||
auto_moderation_rule_name?: string;
|
||||
/**
|
||||
* Trigger type of the Auto Moderation rule that was triggered
|
||||
*
|
||||
* Present from:
|
||||
* - AUTO_MODERATION_BLOCK_MESSAGE
|
||||
* - AUTO_MODERATION_FLAG_TO_CHANNEL
|
||||
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
|
||||
*/
|
||||
auto_moderation_rule_trigger_type?: AuditLogRuleTriggerType;
|
||||
/**
|
||||
* Number of days after which inactive members were kicked
|
||||
*
|
||||
@@ -212,6 +250,9 @@ export interface APIAuditLogOptions {
|
||||
* - STAGE_INSTANCE_CREATE
|
||||
* - STAGE_INSTANCE_UPDATE
|
||||
* - STAGE_INSTANCE_DELETE
|
||||
* - AUTO_MODERATION_BLOCK_MESSAGE
|
||||
* - AUTO_MODERATION_FLAG_TO_CHANNEL
|
||||
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
|
||||
@@ -275,6 +316,8 @@ export enum AuditLogOptionsType {
|
||||
Member = '1',
|
||||
}
|
||||
|
||||
export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
|
||||
*/
|
||||
@@ -347,7 +390,14 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeyLocation
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil;
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil
|
||||
| APIAuditLogChangeKeyTriggerType
|
||||
| APIAuditLogChangeKeyEventType
|
||||
| APIAuditLogChangeKeyTriggerMetadata
|
||||
| APIAuditLogChangeKeyActions
|
||||
| APIAuditLogChangeKeyEnabled
|
||||
| APIAuditLogChangeKeyExemptRoles
|
||||
| APIAuditLogChangeKeyExemptChannels;
|
||||
|
||||
/**
|
||||
* Returned when an entity's name is changed
|
||||
@@ -710,6 +760,44 @@ export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string
|
||||
*/
|
||||
export type APIAuditLogChangeKeyCommunicationDisabledUntil = AuditLogChangeData<'communication_disabled_until', string>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's trigger type is changed (only in rule creation or deletion)
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTriggerType = AuditLogChangeData<'trigger_type', AutoModerationRuleTriggerType>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's event type is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEventType = AuditLogChangeData<'event_type', AutoModerationRuleEventType>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's trigger metadata is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTriggerMetadata = AuditLogChangeData<
|
||||
'trigger_metadata',
|
||||
APIAutoModerationRuleTriggerMetadata
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's actions is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyActions = AuditLogChangeData<'actions', APIAutoModerationAction[]>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's enabled status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEnabled = AuditLogChangeData<'enabled', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's exempt roles is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles', Snowflake[]>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's exempt channels is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
203
deno/payloads/v9/autoModeration.ts
Normal file
203
deno/payloads/v9/autoModeration.ts
Normal file
@@ -0,0 +1,203 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/auto-moderation
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-auto-moderation-rule-structure
|
||||
*/
|
||||
export interface APIAutoModerationRule {
|
||||
/**
|
||||
* The id of this rule
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The guild which this rule belongs to
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The rule name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The user id who created this rule
|
||||
*/
|
||||
creator_id: Snowflake;
|
||||
/**
|
||||
* The rule event type
|
||||
*/
|
||||
event_type: AutoModerationRuleEventType;
|
||||
/**
|
||||
* The rule trigger type
|
||||
*/
|
||||
trigger_type: AutoModerationRuleTriggerType;
|
||||
/**
|
||||
* The rule trigger metadata
|
||||
*/
|
||||
trigger_metadata: APIAutoModerationRuleTriggerMetadata;
|
||||
/**
|
||||
* The actions which will execute when this rule is triggered
|
||||
*/
|
||||
actions: APIAutoModerationAction[];
|
||||
/**
|
||||
* Whether this rule is enabled
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* The role ids that shouldn't be affected by this rule (Maximum of 20)
|
||||
*/
|
||||
exempt_roles: Snowflake[];
|
||||
/**
|
||||
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
|
||||
*/
|
||||
exempt_channels: Snowflake[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types
|
||||
*/
|
||||
export enum AutoModerationRuleTriggerType {
|
||||
/**
|
||||
* Check if content contains words from a user defined list of keywords (Maximum of 3 per guild)
|
||||
*/
|
||||
Keyword = 1,
|
||||
/**
|
||||
* Check if content represents generic spam (Maximum of 1 per guild)
|
||||
*/
|
||||
Spam = 3,
|
||||
/**
|
||||
* Check if content contains words from internal pre-defined wordsets (Maximum of 1 per guild)
|
||||
*/
|
||||
KeywordPreset,
|
||||
/**
|
||||
* Check if content contains more mentions than allowed (Maximum of 1 per guild)
|
||||
*/
|
||||
MentionSpam,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata
|
||||
*/
|
||||
export interface APIAutoModerationRuleTriggerMetadata {
|
||||
/**
|
||||
* Substrings which will be searched for in content (Maximum of 1000)
|
||||
*
|
||||
* A keyword can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 30 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
*/
|
||||
keyword_filter?: string[];
|
||||
/**
|
||||
* The internally pre-defined wordsets which will be searched for in content
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
|
||||
*/
|
||||
presets?: AutoModerationRuleKeywordPresetType[];
|
||||
/**
|
||||
* Substrings which will be exempt from triggering the preset trigger type (Maximum of 1000)
|
||||
*
|
||||
* A allowed-word can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 30 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
|
||||
*/
|
||||
allow_list?: string[];
|
||||
/**
|
||||
* Regular expression patterns which will be matched against content (Maximum of 10)
|
||||
*
|
||||
* Only Rust flavored regex is currently supported (Maximum of 75 characters)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
*/
|
||||
regex_patterns?: string[];
|
||||
/**
|
||||
* Total number of mentions (role & user) allowed per message (Maximum of 50)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
|
||||
*/
|
||||
mention_total_limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-preset-types
|
||||
*/
|
||||
export enum AutoModerationRuleKeywordPresetType {
|
||||
/**
|
||||
* Words that may be considered forms of swearing or cursing
|
||||
*/
|
||||
Profanity = 1,
|
||||
/**
|
||||
* Words that refer to sexually explicit behavior or activity
|
||||
*/
|
||||
SexualContent,
|
||||
/**
|
||||
* Personal insults or words that may be considered hate speech
|
||||
*/
|
||||
Slurs,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types
|
||||
*/
|
||||
export enum AutoModerationRuleEventType {
|
||||
/**
|
||||
* When a member sends or edits a message in the guild
|
||||
*/
|
||||
MessageSend = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-auto-moderation-action-structure
|
||||
*/
|
||||
export interface APIAutoModerationAction {
|
||||
/**
|
||||
* The action type
|
||||
*/
|
||||
type: AutoModerationActionType;
|
||||
/**
|
||||
* Additional metadata needed during execution for this specific action type
|
||||
*
|
||||
* Will only be omitted if the action type is {@link AutoModerationActionType.BlockMessage}
|
||||
*/
|
||||
metadata?: APIAutoModerationActionMetadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types
|
||||
*/
|
||||
export enum AutoModerationActionType {
|
||||
/**
|
||||
* Blocks the content of a message according to the rule
|
||||
*/
|
||||
BlockMessage = 1,
|
||||
/**
|
||||
* Logs user content to a specified channel
|
||||
*/
|
||||
SendAlertMessage,
|
||||
/**
|
||||
* Timeout user for specified duration, this action type can be set if the bot has `MODERATE_MEMBERS` permission
|
||||
*/
|
||||
Timeout,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-metadata
|
||||
*/
|
||||
export interface APIAutoModerationActionMetadata {
|
||||
/**
|
||||
* Channel to which user content should be logged
|
||||
*
|
||||
* Associated action type: {@link AutoModerationActionType.SendAlertMessage}
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* Timeout duration in seconds (Maximum of 4 weeks - 2419200 seconds)
|
||||
*
|
||||
* Only available if using {@link AutoModerationRuleTriggerType.Keyword}
|
||||
*
|
||||
* Associated action type: {@link AutoModerationActionType.Timeout}
|
||||
*/
|
||||
duration_seconds?: number;
|
||||
}
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
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';
|
||||
@@ -25,9 +26,9 @@ export interface APIPartialChannel {
|
||||
*/
|
||||
type: ChannelType;
|
||||
/**
|
||||
* The name of the channel (2-100 characters)
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
name?: string;
|
||||
name?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -39,30 +40,46 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
|
||||
flags?: ChannelFlags;
|
||||
}
|
||||
|
||||
// TODO: update when text in voice is released
|
||||
export type TextChannelType =
|
||||
| ChannelType.DM
|
||||
| ChannelType.GroupDM
|
||||
| ChannelType.GuildNews
|
||||
| ChannelType.GuildPublicThread
|
||||
| ChannelType.GuildPrivateThread
|
||||
| ChannelType.GuildNewsThread
|
||||
| ChannelType.GuildAnnouncement
|
||||
| ChannelType.PublicThread
|
||||
| ChannelType.PrivateThread
|
||||
| ChannelType.AnnouncementThread
|
||||
| ChannelType.GuildText
|
||||
| ChannelType.GuildForum;
|
||||
| ChannelType.GuildForum
|
||||
| ChannelType.GuildVoice;
|
||||
|
||||
export type GuildChannelType = Exclude<
|
||||
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
|
||||
ChannelType.DM | ChannelType.GroupDM
|
||||
>;
|
||||
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*
|
||||
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
|
||||
*
|
||||
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
|
||||
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelBase<T>, 'name'> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The id of the guild (may be missing for some channel objects received over gateway guild dispatches)
|
||||
*/
|
||||
@@ -76,7 +93,7 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position?: number;
|
||||
position: number;
|
||||
/**
|
||||
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
|
||||
*
|
||||
@@ -94,40 +111,28 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
|
||||
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APIGuildTextChannel<T extends GuildTextChannelType>
|
||||
extends APITextBasedChannel<T>,
|
||||
extends Omit<APITextBasedChannel<T>, 'name'>,
|
||||
APIGuildChannel<T> {
|
||||
/**
|
||||
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
|
||||
*/
|
||||
default_auto_archive_duration?: ThreadAutoArchiveDuration;
|
||||
/**
|
||||
* The initial `rate_limit_per_user` to set on newly created threads.
|
||||
* This field is copied to the thread at creation time and does not live update
|
||||
*/
|
||||
default_thread_rate_limit_per_user?: number;
|
||||
/**
|
||||
* The channel topic (0-1024 characters)
|
||||
*/
|
||||
topic?: string | null;
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
export interface APITextChannel extends APIGuildTextChannel<ChannelType.GuildText> {
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*
|
||||
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
|
||||
*
|
||||
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
|
||||
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
}
|
||||
|
||||
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
|
||||
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
|
||||
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
|
||||
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
|
||||
|
||||
export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageVoice | ChannelType.GuildVoice> {
|
||||
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
|
||||
/**
|
||||
* The bitrate (in bits) of the voice channel
|
||||
*/
|
||||
@@ -142,6 +147,11 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
rtc_region?: string | null;
|
||||
}
|
||||
|
||||
export interface APIGuildVoiceChannel
|
||||
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
|
||||
Omit<APITextBasedChannel<ChannelType.GuildVoice>, 'name' | 'last_pin_timestamp'> {
|
||||
/**
|
||||
* The camera video quality mode of the voice channel, `1` when not present
|
||||
*
|
||||
@@ -150,7 +160,9 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
|
||||
video_quality_mode?: VideoQualityMode;
|
||||
}
|
||||
|
||||
interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T> {
|
||||
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
|
||||
|
||||
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
|
||||
/**
|
||||
* The recipients of the DM
|
||||
*
|
||||
@@ -159,9 +171,18 @@ interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>
|
||||
recipients?: APIUser[];
|
||||
}
|
||||
|
||||
export type APIDMChannel = APIDMChannelBase<ChannelType.DM>;
|
||||
export interface APIDMChannel extends Omit<APIDMChannelBase<ChannelType.DM>, 'name'> {
|
||||
/**
|
||||
* The name of the channel (always null for DM channels)
|
||||
*/
|
||||
name: null;
|
||||
}
|
||||
|
||||
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
name: string | null;
|
||||
/**
|
||||
* Application id of the group DM creator if it is bot-created
|
||||
*/
|
||||
@@ -170,24 +191,18 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
|
||||
* Icon hash
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The name of the channel (2-100 characters)
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* ID of the DM creator
|
||||
*/
|
||||
owner_id?: Snowflake;
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
}
|
||||
|
||||
export interface APIThreadChannel
|
||||
extends APIGuildChannel<
|
||||
ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread | ChannelType.GuildNewsThread
|
||||
> {
|
||||
extends Omit<
|
||||
APITextBasedChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread>,
|
||||
'name'
|
||||
>,
|
||||
APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
|
||||
/**
|
||||
* The client users member for the thread, only included in select endpoints
|
||||
*/
|
||||
@@ -197,34 +212,121 @@ export interface APIThreadChannel
|
||||
*/
|
||||
thread_metadata?: APIThreadMetadata;
|
||||
/**
|
||||
* The approximate message count of the thread, does not count above 50 even if there are more messages
|
||||
* Number of messages (not including the initial message or deleted messages) in a thread
|
||||
*
|
||||
* If the thread was created before July 1, 2022, it stops counting at 50 messages
|
||||
*/
|
||||
message_count?: number;
|
||||
/**
|
||||
* The approximate member count of the thread, does not count above 50 even if there are more members
|
||||
*/
|
||||
member_count?: number;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*
|
||||
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
|
||||
*
|
||||
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
|
||||
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
/**
|
||||
* ID of the thread creator
|
||||
*/
|
||||
owner_id?: Snowflake;
|
||||
/**
|
||||
* The id of the last message sent in this thread (may not point to an existing or valid message)
|
||||
* Number of messages ever sent in a thread
|
||||
*
|
||||
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
total_message_sent?: number;
|
||||
/**
|
||||
* The IDs of the set of tags that have been applied to a thread in a forum channel
|
||||
*/
|
||||
applied_tags: Snowflake[];
|
||||
}
|
||||
|
||||
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure
|
||||
*/
|
||||
export interface APIGuildForumTag {
|
||||
/**
|
||||
* The id of the tag
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The name of the tag (0-20 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Whether this tag can only be added to or removed from threads by a member with the `MANAGE_THREADS` permission
|
||||
*/
|
||||
moderated: boolean;
|
||||
/**
|
||||
* The id of a guild's custom emoji
|
||||
*/
|
||||
emoji_id: Snowflake | null;
|
||||
/**
|
||||
* The unicode character of the emoji
|
||||
*/
|
||||
emoji_name: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#default-reaction-object-default-reaction-structure
|
||||
*/
|
||||
export interface APIGuildForumDefaultReactionEmoji {
|
||||
/**
|
||||
* The id of a guild's custom emoji
|
||||
*/
|
||||
emoji_id: Snowflake | null;
|
||||
/**
|
||||
* The unicode character of the emoji
|
||||
*/
|
||||
emoji_name: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types
|
||||
*/
|
||||
export enum SortOrderType {
|
||||
/**
|
||||
* Sort forum posts by activity
|
||||
*/
|
||||
LatestActivity,
|
||||
/**
|
||||
* Sort forum posts by creation time (from most recent to oldest)
|
||||
*/
|
||||
CreationDate,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel/#channel-object-forum-layout-types
|
||||
*/
|
||||
export enum ForumLayoutType {
|
||||
/**
|
||||
* No default has been set for forum channel
|
||||
*/
|
||||
NotSet,
|
||||
/**
|
||||
* Display posts as a list
|
||||
*/
|
||||
ListView,
|
||||
/**
|
||||
* Display posts as a collection of tiles
|
||||
*/
|
||||
GalleryView,
|
||||
}
|
||||
|
||||
export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
|
||||
/**
|
||||
* The set of tags that can be used in a forum channel
|
||||
*/
|
||||
available_tags: APIGuildForumTag[];
|
||||
/**
|
||||
* The emoji to show in the add reaction button on a thread in a forum channel
|
||||
*/
|
||||
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
|
||||
/**
|
||||
* The default sort order type used to order posts in a forum channel
|
||||
*/
|
||||
default_sort_order: SortOrderType | null;
|
||||
/**
|
||||
* The default layout type used to display posts in a forum channel. Defaults to `0`, which indicates a layout view has not been set by a channel admin
|
||||
*/
|
||||
default_forum_layout: ForumLayoutType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
|
||||
@@ -234,10 +336,10 @@ export type APIChannel =
|
||||
| APIDMChannel
|
||||
| APITextChannel
|
||||
| APINewsChannel
|
||||
| APIVoiceChannel
|
||||
| APIGuildVoiceChannel
|
||||
| APIGuildStageVoiceChannel
|
||||
| APIGuildCategoryChannel
|
||||
| APIThreadChannel
|
||||
| APINewsChannel
|
||||
| APIGuildForumChannel;
|
||||
|
||||
/**
|
||||
@@ -263,43 +365,71 @@ export enum ChannelType {
|
||||
/**
|
||||
* An organizational category that contains up to 50 channels
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/115001580171-Channel-Categories-101
|
||||
* See https://support.discord.com/hc/articles/115001580171
|
||||
*/
|
||||
GuildCategory,
|
||||
/**
|
||||
* A channel that users can follow and crosspost into their own guild
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/360032008192
|
||||
* See https://support.discord.com/hc/articles/360032008192
|
||||
*/
|
||||
GuildNews,
|
||||
GuildAnnouncement,
|
||||
/**
|
||||
* A thread channel (public) within a Guild News channel
|
||||
* A temporary sub-channel within a Guild Announcement channel
|
||||
*/
|
||||
GuildNewsThread = 10,
|
||||
AnnouncementThread = 10,
|
||||
/**
|
||||
* A public thread channel within a Guild Text channel
|
||||
* A temporary sub-channel within a Guild Text or Guild Forum channel
|
||||
*/
|
||||
GuildPublicThread,
|
||||
PublicThread,
|
||||
/**
|
||||
* A private thread channel within a Guild Text channel
|
||||
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
|
||||
*/
|
||||
GuildPrivateThread,
|
||||
PrivateThread,
|
||||
/**
|
||||
* A voice channel for hosting events with an audience
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/1500005513722
|
||||
* See https://support.discord.com/hc/articles/1500005513722
|
||||
*/
|
||||
GuildStageVoice,
|
||||
/**
|
||||
* The channel in a Student Hub containing the listed servers
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
|
||||
* See https://support.discord.com/hc/articles/4406046651927
|
||||
*/
|
||||
GuildDirectory,
|
||||
/**
|
||||
* A channel that can only contain threads
|
||||
*/
|
||||
GuildForum,
|
||||
|
||||
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS
|
||||
/**
|
||||
* A channel that users can follow and crosspost into their own guild
|
||||
*
|
||||
* @deprecated This is the old name for {@apilink ChannelType#GuildAnnouncement}
|
||||
*
|
||||
* See https://support.discord.com/hc/articles/360032008192
|
||||
*/
|
||||
GuildNews = 5,
|
||||
/**
|
||||
* A temporary sub-channel within a Guild Announcement channel
|
||||
*
|
||||
* @deprecated This is the old name for {@apilink ChannelType#AnnouncementThread}
|
||||
*/
|
||||
GuildNewsThread = 10,
|
||||
/**
|
||||
* A temporary sub-channel within a Guild Text channel
|
||||
*
|
||||
* @deprecated This is the old name for {@apilink ChannelType#PublicThread}
|
||||
*/
|
||||
GuildPublicThread = 11,
|
||||
/**
|
||||
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
|
||||
*
|
||||
* @deprecated This is the old name for {@apilink ChannelType#PrivateThread}
|
||||
*/
|
||||
GuildPrivateThread = 12,
|
||||
}
|
||||
|
||||
export enum VideoQualityMode {
|
||||
@@ -336,6 +466,12 @@ export interface APIMessage {
|
||||
author: APIUser;
|
||||
/**
|
||||
* Contents of the message
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
content: string;
|
||||
/**
|
||||
@@ -386,12 +522,24 @@ export interface APIMessage {
|
||||
* Any attached files
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
attachments: APIAttachment[];
|
||||
/**
|
||||
* Any embedded content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
embeds: APIEmbed[];
|
||||
/**
|
||||
@@ -430,7 +578,7 @@ export interface APIMessage {
|
||||
/**
|
||||
* Sent with Rich Presence-related chat embeds
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
|
||||
* See https://discord.com/developers/docs/resources/application#application-object
|
||||
*/
|
||||
application?: Partial<APIApplication>;
|
||||
/**
|
||||
@@ -475,6 +623,12 @@ export interface APIMessage {
|
||||
thread?: APIChannel;
|
||||
/**
|
||||
* Sent if the message contains components like buttons, action rows, or other interactive components
|
||||
*
|
||||
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
|
||||
*
|
||||
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
|
||||
*
|
||||
* See https://support-dev.discord.com/hc/articles/4404772028055
|
||||
*/
|
||||
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
|
||||
/**
|
||||
@@ -490,6 +644,12 @@ export interface APIMessage {
|
||||
* @deprecated Use `sticker_items` instead
|
||||
*/
|
||||
stickers?: APISticker[];
|
||||
/**
|
||||
* A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread
|
||||
*
|
||||
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
|
||||
*/
|
||||
position?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -503,12 +663,13 @@ export enum MessageType {
|
||||
ChannelNameChange,
|
||||
ChannelIconChange,
|
||||
ChannelPinnedMessage,
|
||||
GuildMemberJoin,
|
||||
UserPremiumGuildSubscription,
|
||||
UserPremiumGuildSubscriptionTier1,
|
||||
UserPremiumGuildSubscriptionTier2,
|
||||
UserPremiumGuildSubscriptionTier3,
|
||||
UserJoin,
|
||||
GuildBoost,
|
||||
GuildBoostTier1,
|
||||
GuildBoostTier2,
|
||||
GuildBoostTier3,
|
||||
ChannelFollowAdd,
|
||||
|
||||
GuildDiscoveryDisqualified = 14,
|
||||
GuildDiscoveryRequalified,
|
||||
GuildDiscoveryGracePeriodInitialWarning,
|
||||
@@ -519,6 +680,30 @@ export enum MessageType {
|
||||
ThreadStarterMessage,
|
||||
GuildInviteReminder,
|
||||
ContextMenuCommand,
|
||||
AutoModerationAction,
|
||||
RoleSubscriptionPurchase,
|
||||
InteractionPremiumUpsell,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
StageStart,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
StageEnd,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
StageSpeaker,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
StageRaiseHand,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
StageTopic,
|
||||
GuildApplicationPremiumSubscription,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -743,6 +928,14 @@ export interface APIThreadMember {
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
flags: ThreadMemberFlags;
|
||||
/**
|
||||
* Additional information about the user
|
||||
*
|
||||
* **This field is omitted on the member sent within each thread in the `GUILD_CREATE` event**
|
||||
*
|
||||
* **This field is only present when `with_member` is set to true when calling `List Thread Members` or `Get Thread Member`**
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
|
||||
export enum ThreadMemberFlags {}
|
||||
@@ -875,6 +1068,12 @@ export enum EmbedType {
|
||||
* Link embed
|
||||
*/
|
||||
Link = 'link',
|
||||
/**
|
||||
* Auto moderation alert embed
|
||||
*
|
||||
* @unstable This embed type is currently not documented by Discord, but it is returned in the auto moderation system messages.
|
||||
*/
|
||||
AutoModerationMessage = 'auto_moderation_message',
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -907,6 +1106,10 @@ export interface APIEmbedVideo {
|
||||
* Source url of video
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* A proxied url of the video
|
||||
*/
|
||||
proxy_url?: string;
|
||||
/**
|
||||
* Height of video
|
||||
*/
|
||||
@@ -1146,7 +1349,7 @@ export interface APIBaseComponent<T extends ComponentType> {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#component-types
|
||||
* https://discord.com/developers/docs/interactions/message-components#component-object-component-types
|
||||
*/
|
||||
export enum ComponentType {
|
||||
/**
|
||||
@@ -1158,13 +1361,38 @@ export enum ComponentType {
|
||||
*/
|
||||
Button,
|
||||
/**
|
||||
* Select Menu component
|
||||
* Select menu for picking from defined text options
|
||||
*/
|
||||
SelectMenu,
|
||||
StringSelect,
|
||||
/**
|
||||
* Text Input component
|
||||
*/
|
||||
TextInput,
|
||||
/**
|
||||
* Select menu for users
|
||||
*/
|
||||
UserSelect,
|
||||
/**
|
||||
* Select menu for roles
|
||||
*/
|
||||
RoleSelect,
|
||||
/**
|
||||
* Select menu for users and roles
|
||||
*/
|
||||
MentionableSelect,
|
||||
/**
|
||||
* Select menu for channels
|
||||
*/
|
||||
ChannelSelect,
|
||||
|
||||
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
|
||||
|
||||
/**
|
||||
* Select menu for picking from defined text options
|
||||
*
|
||||
* @deprecated This is the old name for {@apilink ComponentType#StringSelect}
|
||||
*/
|
||||
SelectMenu = 3,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1256,15 +1484,18 @@ export enum TextInputStyle {
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.SelectMenu> {
|
||||
export interface APIBaseSelectMenuComponent<
|
||||
T extends
|
||||
| ComponentType.StringSelect
|
||||
| ComponentType.UserSelect
|
||||
| ComponentType.RoleSelect
|
||||
| ComponentType.MentionableSelect
|
||||
| ComponentType.ChannelSelect,
|
||||
> extends APIBaseComponent<T> {
|
||||
/**
|
||||
* A developer-defined identifier for the select menu, max 100 characters
|
||||
*/
|
||||
custom_id: string;
|
||||
/**
|
||||
* The choices in the select, max 25
|
||||
*/
|
||||
options: APISelectMenuOption[];
|
||||
/**
|
||||
* Custom placeholder text if nothing is selected, max 150 characters
|
||||
*/
|
||||
@@ -1289,6 +1520,51 @@ export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.S
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<ComponentType.StringSelect> {
|
||||
/**
|
||||
* Specified choices in a select menu; max 25
|
||||
*/
|
||||
options: APISelectMenuOption[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APIUserSelectComponent = APIBaseSelectMenuComponent<ComponentType.UserSelect>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APIRoleSelectComponent = APIBaseSelectMenuComponent<ComponentType.RoleSelect>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APIMentionableSelectComponent = APIBaseSelectMenuComponent<ComponentType.MentionableSelect>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export interface APIChannelSelectComponent extends APIBaseSelectMenuComponent<ComponentType.ChannelSelect> {
|
||||
/**
|
||||
* List of channel types to include in the ChannelSelect component
|
||||
*/
|
||||
channel_types?: ChannelType[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menus
|
||||
*/
|
||||
export type APISelectMenuComponent =
|
||||
| APIStringSelectComponent
|
||||
| APIUserSelectComponent
|
||||
| APIRoleSelectComponent
|
||||
| APIMentionableSelectComponent
|
||||
| APIChannelSelectComponent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
|
||||
*/
|
||||
@@ -1357,7 +1633,15 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
|
||||
*/
|
||||
export enum ChannelFlags {
|
||||
/**
|
||||
* This thread is pinned to the top of its parent forum channel
|
||||
*/
|
||||
Pinned = 1 << 1,
|
||||
/**
|
||||
* Whether a tag is required to be specified when creating a thread in a forum channel.
|
||||
* Tags are specified in the `applied_tags` field
|
||||
*/
|
||||
RequireTag = 1 << 4,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
* Types extracted from
|
||||
* - https://discord.com/developers/docs/topics/gateway
|
||||
* - https://discord.com/developers/docs/topics/gateway-events
|
||||
*/
|
||||
|
||||
import type { APIChannel, APIThreadMember } from './channel.ts';
|
||||
@@ -58,7 +60,7 @@ export interface APIGatewaySessionStartLimit {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#presence-update-presence-update-event-fields
|
||||
* https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields
|
||||
*/
|
||||
export interface GatewayPresenceUpdate {
|
||||
/**
|
||||
@@ -81,13 +83,13 @@ export interface GatewayPresenceUpdate {
|
||||
/**
|
||||
* User's current activities
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object
|
||||
*/
|
||||
activities?: GatewayActivity[];
|
||||
/**
|
||||
* User's platform-dependent status
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#client-status-object
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#client-status-object
|
||||
*/
|
||||
client_status?: GatewayPresenceClientStatus;
|
||||
}
|
||||
@@ -104,7 +106,7 @@ export enum PresenceUpdateStatus {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#client-status-object
|
||||
* https://discord.com/developers/docs/topics/gateway-events#client-status-object
|
||||
*/
|
||||
export interface GatewayPresenceClientStatus {
|
||||
/**
|
||||
@@ -122,7 +124,7 @@ export interface GatewayPresenceClientStatus {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure
|
||||
*/
|
||||
export interface GatewayActivity {
|
||||
/**
|
||||
@@ -136,7 +138,7 @@ export interface GatewayActivity {
|
||||
/**
|
||||
* Activity type
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types
|
||||
*/
|
||||
type: ActivityType;
|
||||
/**
|
||||
@@ -171,26 +173,26 @@ export interface GatewayActivity {
|
||||
/**
|
||||
* The emoji used for a custom status
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji
|
||||
*/
|
||||
emoji?: GatewayActivityEmoji;
|
||||
session_id?: string;
|
||||
/**
|
||||
* Information for the current party of the player
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
|
||||
*/
|
||||
party?: GatewayActivityParty;
|
||||
/**
|
||||
* Images for the presence and their hover texts
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets
|
||||
*/
|
||||
assets?: GatewayActivityAssets;
|
||||
/**
|
||||
* Secrets for Rich Presence joining and spectating
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets
|
||||
*/
|
||||
secrets?: GatewayActivitySecrets;
|
||||
/**
|
||||
@@ -200,7 +202,7 @@ export interface GatewayActivity {
|
||||
/**
|
||||
* Activity flags `OR`d together, describes what the payload includes
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
@@ -227,7 +229,7 @@ export enum ActivityPlatform {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types
|
||||
*/
|
||||
export enum ActivityType {
|
||||
/**
|
||||
@@ -257,7 +259,7 @@ export enum ActivityType {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-timestamps
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-timestamps
|
||||
*/
|
||||
export interface GatewayActivityTimestamps {
|
||||
/**
|
||||
@@ -271,12 +273,12 @@ export interface GatewayActivityTimestamps {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji
|
||||
*/
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'id' | 'animated'>> & Pick<APIEmoji, 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
|
||||
*/
|
||||
export interface GatewayActivityParty {
|
||||
/**
|
||||
@@ -290,19 +292,19 @@ export interface GatewayActivityParty {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets
|
||||
*/
|
||||
export type GatewayActivityAssets = Partial<
|
||||
Record<'large_image' | 'large_text' | 'small_image' | 'small_text', string>
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets
|
||||
*/
|
||||
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags
|
||||
*/
|
||||
export enum ActivityFlags {
|
||||
Instance = 1 << 0,
|
||||
@@ -328,7 +330,7 @@ export interface GatewayActivityButton {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#thread-list-sync-thread-list-sync-event-fields
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-list-sync-thread-list-sync-event-fields
|
||||
*/
|
||||
export interface GatewayThreadListSync {
|
||||
/**
|
||||
@@ -350,7 +352,7 @@ export interface GatewayThreadListSync {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#thread-members-update-thread-members-update-event-fields
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-members-update-thread-members-update-event-fields
|
||||
*/
|
||||
export interface GatewayThreadMembersUpdate {
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
import type { APIEmoji } from './emoji.ts';
|
||||
import type { PresenceUpdateStatus } from './gateway.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APISticker } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
@@ -69,10 +70,6 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
|
||||
* The vanity url code for the guild
|
||||
*/
|
||||
vanity_url_code?: string | null;
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*/
|
||||
unavailable?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -121,9 +118,9 @@ export interface APIGuild extends APIPartialGuild {
|
||||
*/
|
||||
afk_channel_id: Snowflake | null;
|
||||
/**
|
||||
* afk timeout in seconds
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout: number;
|
||||
afk_timeout: 60 | 300 | 900 | 1800 | 3600;
|
||||
/**
|
||||
* `true` if the guild widget is enabled
|
||||
*/
|
||||
@@ -385,18 +382,36 @@ export enum GuildFeature {
|
||||
* Guild has access to set an animated guild icon
|
||||
*/
|
||||
AnimatedIcon = 'ANIMATED_ICON',
|
||||
/**
|
||||
* Guild is using the old permissions configuration behavior
|
||||
*
|
||||
* See https://discord.com/developers/docs/change-log#upcoming-application-command-permission-changes
|
||||
*/
|
||||
ApplicationCommandPermissionsV2 = 'APPLICATION_COMMAND_PERMISSIONS_V2',
|
||||
/**
|
||||
* Guild has set up auto moderation rules
|
||||
*/
|
||||
AutoModeration = 'AUTO_MODERATION',
|
||||
/**
|
||||
* Guild has access to set a guild banner image
|
||||
*/
|
||||
Banner = 'BANNER',
|
||||
/**
|
||||
* Guild has access to use commerce features (i.e. create store channels)
|
||||
*/
|
||||
Commerce = 'COMMERCE',
|
||||
/**
|
||||
* Guild can enable welcome screen, Membership Screening and discovery, and receives community updates
|
||||
*/
|
||||
Community = 'COMMUNITY',
|
||||
/**
|
||||
* Guild has enabled monetization
|
||||
*/
|
||||
CreatorMonetizableProvisional = 'CREATOR_MONETIZABLE_PROVISIONAL',
|
||||
/**
|
||||
* Guild has enabled the role subscription promo page
|
||||
*/
|
||||
CreatorStorePage = 'CREATOR_STORE_PAGE',
|
||||
/*
|
||||
* Guild has been set as a support server on the App Directory
|
||||
*/
|
||||
DeveloperSupportServer = 'DEVELOPER_SUPPORT_SERVER',
|
||||
/**
|
||||
* Guild is able to be discovered in the directory
|
||||
*/
|
||||
@@ -412,9 +427,15 @@ export enum GuildFeature {
|
||||
/**
|
||||
* Guild is a Student Hub
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
|
||||
* See https://support.discord.com/hc/articles/4406046651927
|
||||
*
|
||||
* @unstable This feature is currently not documented by Discord, but has known value
|
||||
*/
|
||||
Hub = 'HUB',
|
||||
/**
|
||||
* Guild has disabled invite usage, preventing users from joining
|
||||
*/
|
||||
InvitesDisabled = 'INVITES_DISABLED',
|
||||
/**
|
||||
* Guild has access to set an invite splash background
|
||||
*/
|
||||
@@ -422,7 +443,9 @@ export enum GuildFeature {
|
||||
/**
|
||||
* Guild is in a Student Hub
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
|
||||
* See https://support.discord.com/hc/articles/4406046651927
|
||||
*
|
||||
* @unstable This feature is currently not documented by Discord, but has known value
|
||||
*/
|
||||
LinkedToHub = 'LINKED_TO_HUB',
|
||||
/**
|
||||
@@ -431,6 +454,8 @@ export enum GuildFeature {
|
||||
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
|
||||
/**
|
||||
* Guild has enabled monetization
|
||||
*
|
||||
* @unstable This feature is no longer documented by Discord
|
||||
*/
|
||||
MonetizationEnabled = 'MONETIZATION_ENABLED',
|
||||
/**
|
||||
@@ -458,6 +483,14 @@ export enum GuildFeature {
|
||||
* Guild is able to set role icons
|
||||
*/
|
||||
RoleIcons = 'ROLE_ICONS',
|
||||
/**
|
||||
* Guild has role subscriptions that can be purchased
|
||||
*/
|
||||
RoleSubscriptionsAvailableForPurchase = 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE',
|
||||
/**
|
||||
* Guild has enabled role subscriptions
|
||||
*/
|
||||
RoleSubscriptionsEnabled = 'ROLE_SUBSCRIPTIONS_ENABLED',
|
||||
/**
|
||||
* Guild has enabled ticketed events
|
||||
*/
|
||||
@@ -587,7 +620,7 @@ export interface APIGuildMember {
|
||||
/**
|
||||
* When the user started boosting the guild
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/360028038352-Server-Boosting-
|
||||
* See https://support.discord.com/hc/articles/360028038352
|
||||
*/
|
||||
premium_since?: string | null;
|
||||
/**
|
||||
@@ -629,7 +662,7 @@ export interface APIGuildIntegration {
|
||||
/**
|
||||
* Is this integration enabled
|
||||
*/
|
||||
enabled?: boolean;
|
||||
enabled: boolean;
|
||||
/**
|
||||
* Is this integration syncing
|
||||
*
|
||||
@@ -665,7 +698,7 @@ export interface APIGuildIntegration {
|
||||
/**
|
||||
* User for this integration
|
||||
*
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
* **Some older integrations may not have an attached user.**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
@@ -702,9 +735,13 @@ export interface APIGuildIntegration {
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
*/
|
||||
application?: APIGuildIntegrationApplication;
|
||||
/**
|
||||
* The scopes the application has been authorized for
|
||||
*/
|
||||
scopes?: OAuth2Scopes[];
|
||||
}
|
||||
|
||||
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord';
|
||||
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
|
||||
@@ -773,7 +810,7 @@ export interface APIBan {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object
|
||||
*/
|
||||
export interface APIGuildWidget {
|
||||
id: Snowflake;
|
||||
@@ -785,7 +822,7 @@ export interface APIGuildWidget {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
|
||||
*/
|
||||
export interface APIGuildWidgetChannel {
|
||||
id: Snowflake;
|
||||
@@ -794,7 +831,7 @@ export interface APIGuildWidgetChannel {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
|
||||
*/
|
||||
export interface APIGuildWidgetMember {
|
||||
id: string;
|
||||
|
||||
@@ -53,7 +53,7 @@ export interface APIInvite {
|
||||
/**
|
||||
* The type of target for this voice channel invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
|
||||
*/
|
||||
target_type?: InviteTargetType;
|
||||
/**
|
||||
@@ -65,7 +65,7 @@ export interface APIInvite {
|
||||
/**
|
||||
* The embedded application to open for this voice channel embedded application invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/oauth2#application
|
||||
* See https://discord.com/developers/docs/resources/application#application-object
|
||||
*/
|
||||
target_application?: Partial<APIApplication>;
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
export * from '../common.ts';
|
||||
export * from './application.ts';
|
||||
export * from './auditLog.ts';
|
||||
export * from './autoModeration.ts';
|
||||
export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
|
||||
@@ -61,6 +61,10 @@ export enum OAuth2Scopes {
|
||||
* (otherwise restricted to channels/guilds your app creates)
|
||||
*/
|
||||
MessagesRead = 'messages.read',
|
||||
/**
|
||||
* Allows your app to update a user's connection and metadata for the app
|
||||
*/
|
||||
RoleConnectionsWrite = 'role_connections.write',
|
||||
/**
|
||||
* For local rpc server access, this allows you to control a user's local Discord client - requires Discord approval
|
||||
*/
|
||||
|
||||
@@ -72,4 +72,16 @@ export interface APIRoleTags {
|
||||
* The id of the integration this role belongs to
|
||||
*/
|
||||
integration_id?: Snowflake;
|
||||
/**
|
||||
* The id of this role's subscription sku and listing
|
||||
*/
|
||||
subscription_listing_id?: Snowflake;
|
||||
/**
|
||||
* Whether this role is available for purchase
|
||||
*/
|
||||
available_for_purchase?: null;
|
||||
/**
|
||||
* Whether this role is a guild's linked role
|
||||
*/
|
||||
guild_connections?: null;
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ export enum StickerType {
|
||||
*/
|
||||
Standard = 1,
|
||||
/**
|
||||
* A sticker uploaded to a Boosted guild for the guild's members
|
||||
* A sticker uploaded to a guild for the guild's members
|
||||
*/
|
||||
Guild,
|
||||
}
|
||||
@@ -85,6 +85,7 @@ export enum StickerFormatType {
|
||||
PNG = 1,
|
||||
APNG,
|
||||
Lottie,
|
||||
GIF,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface APITeam {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-members-object
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-member-object
|
||||
*/
|
||||
export interface APITeamMember {
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/template
|
||||
* Types extracted from https://discord.com/developers/docs/resources/guild-template
|
||||
*/
|
||||
|
||||
import type { APIUser } from './user.ts';
|
||||
@@ -7,7 +7,7 @@ import type { Snowflake } from '../../globals.ts';
|
||||
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v9/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#template-object
|
||||
* https://discord.com/developers/docs/resources/guild-template#template-object
|
||||
*/
|
||||
export interface APITemplate {
|
||||
/**
|
||||
|
||||
@@ -134,7 +134,7 @@ export enum UserFlags {
|
||||
*/
|
||||
VerifiedDeveloper = 1 << 17,
|
||||
/**
|
||||
* Discord Certified Moderator
|
||||
* Moderator Programs Alumni
|
||||
*/
|
||||
CertifiedModerator = 1 << 18,
|
||||
/**
|
||||
@@ -143,8 +143,24 @@ 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 is an [Active Developer](https://support-dev.discord.com/hc/articles/10113997751447)
|
||||
*/
|
||||
ActiveDeveloper = 1 << 22,
|
||||
/**
|
||||
* User's account has been [quarantined](https://support.discord.com/hc/articles/6461420677527) 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.
|
||||
*
|
||||
* @privateRemarks
|
||||
*
|
||||
* This value would be 1 << 44, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
Quarantined = 17592186044416,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -154,6 +170,7 @@ export enum UserPremiumType {
|
||||
None,
|
||||
NitroClassic,
|
||||
Nitro,
|
||||
NitroBasic,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -170,8 +187,10 @@ export interface APIConnection {
|
||||
name: string;
|
||||
/**
|
||||
* The service of the connection
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#connection-object-services
|
||||
*/
|
||||
type: string;
|
||||
type: ConnectionService;
|
||||
/**
|
||||
* Whether the connection is revoked
|
||||
*/
|
||||
@@ -194,6 +213,10 @@ export interface APIConnection {
|
||||
* Whether activities related to this connection will be shown in presence updates
|
||||
*/
|
||||
show_activity: boolean;
|
||||
/**
|
||||
* Whether this connection supports console voice transfer
|
||||
*/
|
||||
two_way_link: boolean;
|
||||
/**
|
||||
* Visibility of this connection
|
||||
*
|
||||
@@ -202,6 +225,27 @@ export interface APIConnection {
|
||||
visibility: ConnectionVisibility;
|
||||
}
|
||||
|
||||
export enum ConnectionService {
|
||||
BattleNet = 'battlenet',
|
||||
eBay = 'ebay',
|
||||
EpicGames = 'epicgames',
|
||||
Facebook = 'facebook',
|
||||
GitHub = 'github',
|
||||
LeagueOfLegends = 'leagueoflegends',
|
||||
PlayStationNetwork = 'playstation',
|
||||
Reddit = 'reddit',
|
||||
RiotGames = 'riotgames',
|
||||
PayPal = 'paypal',
|
||||
Spotify = 'spotify',
|
||||
Skype = 'skype',
|
||||
Steam = 'steam',
|
||||
TikTok = 'tiktok',
|
||||
Twitch = 'twitch',
|
||||
Twitter = 'twitter',
|
||||
Xbox = 'xbox',
|
||||
YouTube = 'youtube',
|
||||
}
|
||||
|
||||
export enum ConnectionVisibility {
|
||||
/**
|
||||
* Invisible to everyone except the user themselves
|
||||
@@ -212,3 +256,21 @@ export enum ConnectionVisibility {
|
||||
*/
|
||||
Everyone,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#application-role-connection-object-application-role-connection-structure
|
||||
*/
|
||||
export interface APIApplicationRoleConnection {
|
||||
/**
|
||||
* The vanity name of the platform a bot has connected (max 50 characters)
|
||||
*/
|
||||
platform_name: string | null;
|
||||
/**
|
||||
* The username on the platform a bot has connected (max 100 characters)
|
||||
*/
|
||||
platform_username: string | null;
|
||||
/**
|
||||
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
|
||||
*/
|
||||
metadata: Record<string, string | number>;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,8 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
AnnouncementEditLimitExceeded = 20022,
|
||||
|
||||
UnderMinimumAge = 20024,
|
||||
|
||||
ChannelSendRateLimit = 20028,
|
||||
ServerSendRateLimit,
|
||||
|
||||
@@ -99,10 +101,10 @@ export enum RESTJSONErrorCodes {
|
||||
MaximumNumberOfServerCategoriesReached = 30030,
|
||||
|
||||
GuildAlreadyHasTemplate = 30031,
|
||||
|
||||
MaximumThreadParticipants = 30033,
|
||||
|
||||
MaximumNumberOfNonGuildMemberBansHasBeenExceeded = 30035,
|
||||
MaximumNumberOfApplicationCommandsReached,
|
||||
MaximumThreadParticipantsReached,
|
||||
MaximumDailyApplicationCommandCreatesReached,
|
||||
MaximumNumberOfNonGuildMemberBansHasBeenExceeded,
|
||||
|
||||
MaximumNumberOfBanFetchesHasBeenReached = 30037,
|
||||
MaximumNumberOfUncompletedGuildScheduledEventsReached,
|
||||
@@ -118,6 +120,10 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
BitrateIsTooHighForChannelOfThisType = 30052,
|
||||
|
||||
MaximumNumberOfPremiumEmojisReached = 30056,
|
||||
|
||||
MaximumNumberOfWebhooksPerGuildReached = 30058,
|
||||
|
||||
Unauthorized = 40001,
|
||||
VerifyYourAccount,
|
||||
OpeningDirectMessagesTooFast,
|
||||
@@ -126,13 +132,23 @@ export enum RESTJSONErrorCodes {
|
||||
FeatureTemporarilyDisabledServerSide,
|
||||
UserBannedFromThisGuild,
|
||||
|
||||
ConnectionHasBeenRevoked = 40012,
|
||||
|
||||
TargetUserIsNotConnectedToVoice = 40032,
|
||||
ThisMessageWasAlreadyCrossposted,
|
||||
|
||||
ApplicationCommandWithThatNameAlreadyExists = 40041,
|
||||
|
||||
ApplicationInteractionFailedToSend = 40043,
|
||||
|
||||
CannotSendAMessageInAForumChannel = 40058,
|
||||
|
||||
InteractionHasAlreadyBeenAcknowledged = 40060,
|
||||
TagNamesMustBeUnique,
|
||||
ServiceResourceIsBeingRateLimited,
|
||||
|
||||
ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40066,
|
||||
TagRequiredToCreateAForumPostInThisChannel,
|
||||
|
||||
MissingAccess = 50001,
|
||||
InvalidAccountType,
|
||||
@@ -168,6 +184,8 @@ export enum RESTJSONErrorCodes {
|
||||
InvalidFormBodyOrContentType,
|
||||
InviteAcceptedToGuildWithoutTheBotBeingIn,
|
||||
|
||||
InvalidActivityAction = 50039,
|
||||
|
||||
InvalidAPIVersion = 50041,
|
||||
|
||||
FileUploadedExceedsMaximumSize = 50045,
|
||||
@@ -176,11 +194,13 @@ export enum RESTJSONErrorCodes {
|
||||
CannotSelfRedeemThisGift = 50054,
|
||||
InvalidGuild,
|
||||
|
||||
InvalidMessageType = 50068,
|
||||
InvalidRequestOrigin = 50067,
|
||||
InvalidMessageType,
|
||||
|
||||
PaymentSourceRequiredToRedeemGift = 50070,
|
||||
|
||||
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
|
||||
CannotModifyASystemWebhook = 50073,
|
||||
CannotDeleteChannelRequiredForCommunityGuilds,
|
||||
|
||||
CannotEditStickersWithinMessage = 50080,
|
||||
InvalidStickerSent,
|
||||
@@ -190,6 +210,8 @@ export enum RESTJSONErrorCodes {
|
||||
ParameterEarlierThanCreation,
|
||||
CommunityServerChannelsMustBeTextChannels,
|
||||
|
||||
TheEntityTypeOfTheEventIsDifferentFromTheEntityYouAreTryingToStartTheEventFor = 50091,
|
||||
|
||||
ServerNotAvailableInYourLocation = 50095,
|
||||
|
||||
ServerNeedsMonetizationEnabledToPerformThisAction = 50097,
|
||||
@@ -198,6 +220,14 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
RequestBodyContainsInvalidJSON = 50109,
|
||||
|
||||
OwnershipCannotBeMovedToABotUser = 50132,
|
||||
|
||||
FailedToResizeAssetBelowTheMinimumSize = 50138,
|
||||
|
||||
CannotMixSubscriptionAndNonSubscriptionRolesForAnEmoji = 50144,
|
||||
CannotConvertBetweenPremiumEmojiAndNormalEmoji,
|
||||
UploadedFileNotFound,
|
||||
|
||||
YouDoNotHavePermissionToSendThisSticker = 50600,
|
||||
|
||||
TwoFactorAuthenticationIsRequired = 60003,
|
||||
@@ -206,6 +236,8 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
ReactionWasBlocked = 90001,
|
||||
|
||||
ApplicationNotYetAvailable = 110001,
|
||||
|
||||
APIResourceOverloaded = 130000,
|
||||
|
||||
TheStageIsAlreadyOpen = 150006,
|
||||
@@ -229,13 +261,22 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
FailedToCreateStageNeededForStageEvent = 180002,
|
||||
|
||||
WebhooksCanOnlyCreateThreadsInForumChannels = 220003,
|
||||
MessageWasBlockedByAutomaticModeration = 200000,
|
||||
TitleWasBlockedByAutomaticModeration,
|
||||
|
||||
WebhooksPostedToForumChannelsMustHaveAThreadNameOrThreadId = 220001,
|
||||
WebhooksPostedToForumChannelsCannotHaveBothAThreadNameAndThreadId,
|
||||
WebhooksCanOnlyCreateThreadsInForumChannels,
|
||||
WebhookServicesCannotBeUsedInForumChannels,
|
||||
|
||||
MessageBlockedByHarmfulLinksFilter = 240000,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#locales
|
||||
*/
|
||||
export enum Locale {
|
||||
Indonesian = 'id',
|
||||
EnglishUS = 'en-US',
|
||||
EnglishGB = 'en-GB',
|
||||
Bulgarian = 'bg',
|
||||
|
||||
16
deno/rest/v10/application.ts
Normal file
16
deno/rest/v10/application.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { APIApplicationRoleConnectionMetadata } from '../../payloads/v10/application.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
|
||||
*/
|
||||
export type RESTGetAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
|
||||
*/
|
||||
export type RESTPutAPIApplicationRoleConnectionMetadataJSONBody = APIApplicationRoleConnectionMetadata[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
|
||||
*/
|
||||
export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];
|
||||
@@ -17,6 +17,10 @@ export interface RESTGetAPIAuditLogQuery {
|
||||
* Filter the log before a certain entry ID
|
||||
*/
|
||||
before?: Snowflake;
|
||||
/**
|
||||
* Filter the log after a certain entry ID
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* How many entries are returned (default 50, minimum 1, maximum 100)
|
||||
*
|
||||
|
||||
84
deno/rest/v10/autoModeration.ts
Normal file
84
deno/rest/v10/autoModeration.ts
Normal file
@@ -0,0 +1,84 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type {
|
||||
APIAutoModerationAction,
|
||||
APIAutoModerationRule,
|
||||
AutoModerationRuleEventType,
|
||||
APIAutoModerationRuleTriggerMetadata,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
|
||||
*/
|
||||
export type RESTGetAPIAutoModerationRulesResult = APIAutoModerationRule[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule
|
||||
*/
|
||||
export type RESTGetAPIAutoModerationRuleResult = APIAutoModerationRule;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
|
||||
*/
|
||||
export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* The rule name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The rule event type
|
||||
*/
|
||||
event_type: AutoModerationRuleEventType;
|
||||
/**
|
||||
* The rule trigger type
|
||||
*/
|
||||
trigger_type: AutoModerationRuleTriggerType;
|
||||
/**
|
||||
* The rule trigger metadata
|
||||
*
|
||||
* Can be omitted if the trigger type is {@link AutoModerationRuleTriggerType.HarmfulLink} or {@link AutoModerationRuleTriggerType.Spam}
|
||||
*/
|
||||
trigger_metadata?: APIAutoModerationRuleTriggerMetadata;
|
||||
/**
|
||||
* The actions which will execute when this rule is triggered
|
||||
*/
|
||||
actions: APIAutoModerationAction[];
|
||||
/**
|
||||
* Whether this rule is enabled
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* The role ids that shouldn't be affected by this rule (Maximum of 20)
|
||||
*/
|
||||
exempt_roles?: Snowflake[];
|
||||
/**
|
||||
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
|
||||
*/
|
||||
exempt_channels?: Snowflake[];
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
|
||||
*/
|
||||
export type RESTPostAPIAutoModerationRuleResult = APIAutoModerationRule;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
|
||||
*/
|
||||
export type RESTPatchAPIAutoModerationRuleJSONBody = Omit<
|
||||
Partial<RESTPostAPIAutoModerationRuleJSONBody>,
|
||||
'trigger_type'
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
|
||||
*/
|
||||
export type RESTPatchAPIAutoModerationRuleResult = APIAutoModerationRule;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule
|
||||
*/
|
||||
export type RESTDeleteAPIAutoModerationRuleResult = never;
|
||||
@@ -19,6 +19,10 @@ import type {
|
||||
OverwriteType,
|
||||
ThreadAutoArchiveDuration,
|
||||
VideoQualityMode,
|
||||
APIGuildForumTag,
|
||||
APIGuildForumDefaultReactionEmoji,
|
||||
SortOrderType,
|
||||
ForumLayoutType,
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
|
||||
@@ -48,7 +52,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
type?: ChannelType.GuildNews | ChannelType.GuildText;
|
||||
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText;
|
||||
/**
|
||||
* The position of the channel in the left-hand listing
|
||||
*
|
||||
@@ -56,15 +60,15 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*/
|
||||
position?: number | null;
|
||||
/**
|
||||
* 0-1024 character channel topic
|
||||
* 0-1024 character channel topic (0-4096 characters for forum channels)
|
||||
*
|
||||
* Channel types: text, news
|
||||
* Channel types: text, news, forum
|
||||
*/
|
||||
topic?: string | null;
|
||||
/**
|
||||
* Whether the channel is nsfw
|
||||
*
|
||||
* Channel types: text, voice, news
|
||||
* Channel types: text, voice, news, forum
|
||||
*/
|
||||
nsfw?: boolean | null;
|
||||
/**
|
||||
@@ -72,7 +76,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
|
||||
* are unaffected
|
||||
*
|
||||
* Channel types: text, newsThread, publicThread, privateThread
|
||||
* Channel types: text, newsThread, publicThread, privateThread, forum
|
||||
*/
|
||||
rate_limit_per_user?: number | null;
|
||||
/**
|
||||
@@ -141,6 +145,37 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
* Channel types: privateThread
|
||||
*/
|
||||
invitable?: boolean;
|
||||
/**
|
||||
* The set of tags that can be used in a forum channel; limited to 20
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
available_tags?: APIGuildForumTag[];
|
||||
/**
|
||||
* The emoji to show in the add reaction button on a thread in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji;
|
||||
/**
|
||||
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
|
||||
* This field is copied to the thread at creation time and does not live update
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_thread_rate_limit_per_user?: number | null;
|
||||
/**
|
||||
* The default sort order type used to order posts in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_sort_order?: SortOrderType | null;
|
||||
/**
|
||||
* The default layout type used to display posts in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_forum_layout?: ForumLayoutType;
|
||||
}>;
|
||||
|
||||
/**
|
||||
@@ -589,6 +624,10 @@ export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThr
|
||||
* First message in the forum thread
|
||||
*/
|
||||
message: RESTPostAPIChannelMessageJSONBody;
|
||||
/**
|
||||
* The IDs of the set of tags that have been applied to a thread in a forum channel; limited to 5
|
||||
*/
|
||||
applied_tags?: Snowflake[];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -619,9 +658,9 @@ export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThread
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*
|
||||
* @default ChannelType.GuildPrivateThread
|
||||
* @default ChannelType.PrivateThread
|
||||
*/
|
||||
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
|
||||
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread;
|
||||
/**
|
||||
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
|
||||
*/
|
||||
@@ -643,6 +682,39 @@ export type RESTPutAPIChannelThreadMembersResult = never;
|
||||
*/
|
||||
export type RESTDeleteAPIChannelThreadMembersResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-thread-member
|
||||
*/
|
||||
export interface RESTGetAPIChannelThreadMemberQuery {
|
||||
/**
|
||||
* Whether to include a guild member object for the thread member
|
||||
*/
|
||||
with_member?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-thread-member
|
||||
*/
|
||||
export type RESTGetAPIChannelThreadMemberResult = APIThreadMember;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#list-thread-members
|
||||
*/
|
||||
export interface RESTGetAPIChannelThreadMembersQuery {
|
||||
/**
|
||||
* Whether to include a guild member object for each thread member
|
||||
*/
|
||||
with_member?: boolean;
|
||||
/**
|
||||
* Get thread members after this user ID
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* Max number of thread members to return (1-100). Defaults to 100
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#list-thread-members
|
||||
*/
|
||||
@@ -662,7 +734,22 @@ export interface RESTGetAPIChannelThreadsArchivedQuery {
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#list-public-archived-threads
|
||||
*/
|
||||
export type RESTGetAPIChannelThreadsArchivedPublicResult = RESTGetAPIChannelUsersThreadsArchivedResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#list-private-archived-threads
|
||||
*/
|
||||
export type RESTGetAPIChannelThreadsArchivedPrivateResult = RESTGetAPIChannelUsersThreadsArchivedResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads
|
||||
*/
|
||||
export type RESTGetAPIChannelUsersThreadsArchivedResult = APIThreadList;
|
||||
export interface RESTGetAPIChannelUsersThreadsArchivedResult extends APIThreadList {
|
||||
/**
|
||||
* Whether there are potentially additional threads
|
||||
*/
|
||||
has_more: boolean;
|
||||
}
|
||||
|
||||
@@ -53,6 +53,10 @@ export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
| 'rtc_region'
|
||||
| 'video_quality_mode'
|
||||
| 'flags'
|
||||
| 'default_reaction_emoji'
|
||||
| 'available_tags'
|
||||
| 'default_sort_order'
|
||||
| 'default_forum_layout'
|
||||
>
|
||||
> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
@@ -135,9 +139,9 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*/
|
||||
afk_channel_id?: number | Snowflake | null;
|
||||
/**
|
||||
* AFK timeout in seconds
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout?: number;
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
@@ -235,9 +239,9 @@ export type RESTPatchAPIGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*/
|
||||
afk_channel_id?: Snowflake | null;
|
||||
/**
|
||||
* AFK timeout in seconds
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout?: number;
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature)
|
||||
*
|
||||
@@ -357,7 +361,7 @@ export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
|
||||
export type RESTPatchAPIGuildChannelPositionsResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#list-active-threads
|
||||
* https://discord.com/developers/docs/resources/guild#list-active-guild-threads
|
||||
*/
|
||||
export type RESTGetAPIGuildThreadsResult = APIThreadList;
|
||||
|
||||
@@ -573,8 +577,14 @@ export type RESTGetAPIGuildBanResult = APIBan;
|
||||
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Number of days to delete messages for (0-7)
|
||||
*
|
||||
* @deprecated use `delete_message_seconds` instead
|
||||
*/
|
||||
delete_message_days?: number;
|
||||
/**
|
||||
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
|
||||
*/
|
||||
delete_message_seconds?: number;
|
||||
}>;
|
||||
|
||||
/**
|
||||
@@ -855,7 +865,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
@@ -885,6 +895,11 @@ export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUnde
|
||||
suppress?: boolean;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,19 @@ import type {
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands
|
||||
*/
|
||||
export interface RESTGetAPIApplicationCommandsQuery {
|
||||
/**
|
||||
* Whether to include full localization dictionaries (name_localizations and description_localizations)
|
||||
* in the returned objects, instead of the name_localized and description_localized fields.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
with_localizations?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands
|
||||
*/
|
||||
@@ -90,6 +103,11 @@ export type RESTPutAPIApplicationCommandsJSONBody = RESTPostAPIApplicationComman
|
||||
*/
|
||||
export type RESTPutAPIApplicationCommandsResult = APIApplicationCommand[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
|
||||
*/
|
||||
export type RESTGetAPIApplicationGuildCommandsQuery = RESTGetAPIApplicationCommandsQuery;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
|
||||
*/
|
||||
@@ -129,8 +147,10 @@ export type RESTPatchAPIApplicationGuildCommandResult = Omit<APIApplicationComma
|
||||
* https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
|
||||
*/
|
||||
export type RESTPutAPIApplicationGuildCommandsJSONBody = (
|
||||
| Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'>
|
||||
| Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'>
|
||||
| (Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'> &
|
||||
Pick<Partial<APIApplicationCommand>, 'id'>)
|
||||
| (Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'> &
|
||||
Pick<Partial<APIApplicationCommand>, 'id'>)
|
||||
)[];
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
export * from '../common.ts';
|
||||
export * from './application.ts';
|
||||
export * from './auditLog.ts';
|
||||
export * from './autoModeration.ts';
|
||||
export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
@@ -20,6 +22,33 @@ export * from './webhook.ts';
|
||||
export const APIVersion = '10';
|
||||
|
||||
export const Routes = {
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/role-connections/metadata`
|
||||
* - PUT `/applications/{application.id}/role-connections/metadata`
|
||||
*/
|
||||
applicationRoleConnectionMetadata(applicationId: Snowflake) {
|
||||
return `/applications/${applicationId}/role-connections/metadata` as const;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/auto-moderation/rules`
|
||||
* - POST `/guilds/{guild.id}/auto-moderation/rules`
|
||||
*/
|
||||
guildAutoModerationRules(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/auto-moderation/rules` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Routes for:
|
||||
* - GET `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
|
||||
* - PATCH `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
|
||||
* - DELETE `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
|
||||
*/
|
||||
guildAutoModerationRule(guildId: Snowflake, ruleId: Snowflake) {
|
||||
return `/guilds/${guildId}/auto-moderation/rules/${ruleId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/audit-logs`
|
||||
@@ -501,6 +530,15 @@ export const Routes = {
|
||||
return `/users/${userId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/applications/{application.id}/role-connection`
|
||||
* - PUT `/users/@me/applications/{application.id}/role-connection`
|
||||
*/
|
||||
userApplicationRoleConnection(applicationId: Snowflake) {
|
||||
return `/users/@me/applications/${applicationId}/role-connection` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/guilds`
|
||||
@@ -844,6 +882,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, GIF
|
||||
*/
|
||||
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 | ImageFormat.GIF>;
|
||||
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',
|
||||
|
||||
@@ -40,7 +40,7 @@ export interface RESTPostAPIGuildStickerFormDataBody {
|
||||
*/
|
||||
tags: string;
|
||||
/**
|
||||
* The sticker file to upload, must be a PNG, APNG, or Lottie JSON file, max 500 KB
|
||||
* The sticker file to upload, must be a PNG, APNG, GIF, or Lottie JSON file, max 500 KB
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { APIChannel, APIConnection, APIGuildMember, APIUser, GuildFeature } from '../../payloads/v10/mod.ts';
|
||||
import type {
|
||||
APIChannel,
|
||||
APIConnection,
|
||||
APIGuildMember,
|
||||
APIUser,
|
||||
APIApplicationRoleConnection,
|
||||
GuildFeature,
|
||||
} from '../../payloads/v10/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
@@ -49,9 +56,9 @@ export interface RESTGetAPICurrentUserGuildsQuery {
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* Max number of guilds to return (1-100)
|
||||
* Max number of guilds to return (1-200)
|
||||
*
|
||||
* @default 100
|
||||
* @default 200
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
@@ -94,3 +101,31 @@ export type RESTPostAPICurrentUserCreateDMChannelResult = APIChannel;
|
||||
* https://discord.com/developers/docs/resources/user#get-user-connections
|
||||
*/
|
||||
export type RESTGetAPICurrentUserConnectionsResult = APIConnection[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-user-application-role-connection
|
||||
*/
|
||||
export type RESTGetAPICurrentUserApplicationRoleConnectionResult = APIApplicationRoleConnection;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#update-user-application-role-connection
|
||||
*/
|
||||
export interface RESTPutAPICurrentUserApplicationRoleConnectionJSONBody {
|
||||
/**
|
||||
* The vanity name of the platform a bot has connected (max 50 characters)
|
||||
*/
|
||||
platform_name?: string;
|
||||
/**
|
||||
* The username on the platform a bot has connected (max 100 characters)
|
||||
*/
|
||||
platform_username?: string;
|
||||
/**
|
||||
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
|
||||
*/
|
||||
metadata?: Record<string, string | number>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#update-user-application-role-connection
|
||||
*/
|
||||
export type RESTPutAPICurrentUserApplicationRoleConnectionResult = APIApplicationRoleConnection;
|
||||
|
||||
@@ -3,4 +3,9 @@ import type { APIVoiceRegion } from '../../payloads/v10/mod.ts';
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#list-voice-regions
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
export type RESTGetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
|
||||
/**
|
||||
* @deprecated This was exported with the wrong name, use `RESTGetAPIVoiceRegionsResult` instead
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = RESTGetAPIVoiceRegionsResult;
|
||||
|
||||
16
deno/rest/v9/application.ts
Normal file
16
deno/rest/v9/application.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
import type { APIApplicationRoleConnectionMetadata } from '../../payloads/v9/application.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
|
||||
*/
|
||||
export type RESTGetAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
|
||||
*/
|
||||
export type RESTPutAPIApplicationRoleConnectionMetadataJSONBody = APIApplicationRoleConnectionMetadata[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
|
||||
*/
|
||||
export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];
|
||||
@@ -17,6 +17,10 @@ export interface RESTGetAPIAuditLogQuery {
|
||||
* Filter the log before a certain entry ID
|
||||
*/
|
||||
before?: Snowflake;
|
||||
/**
|
||||
* Filter the log after a certain entry ID
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* How many entries are returned (default 50, minimum 1, maximum 100)
|
||||
*
|
||||
|
||||
84
deno/rest/v9/autoModeration.ts
Normal file
84
deno/rest/v9/autoModeration.ts
Normal file
@@ -0,0 +1,84 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type {
|
||||
APIAutoModerationAction,
|
||||
APIAutoModerationRule,
|
||||
AutoModerationRuleEventType,
|
||||
APIAutoModerationRuleTriggerMetadata,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
|
||||
*/
|
||||
export type RESTGetAPIAutoModerationRulesResult = APIAutoModerationRule[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule
|
||||
*/
|
||||
export type RESTGetAPIAutoModerationRuleResult = APIAutoModerationRule;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
|
||||
*/
|
||||
export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* The rule name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The rule event type
|
||||
*/
|
||||
event_type: AutoModerationRuleEventType;
|
||||
/**
|
||||
* The rule trigger type
|
||||
*/
|
||||
trigger_type: AutoModerationRuleTriggerType;
|
||||
/**
|
||||
* The rule trigger metadata
|
||||
*
|
||||
* Can be omitted if the trigger type is {@link AutoModerationRuleTriggerType.HarmfulLink} or {@link AutoModerationRuleTriggerType.Spam}
|
||||
*/
|
||||
trigger_metadata?: APIAutoModerationRuleTriggerMetadata;
|
||||
/**
|
||||
* The actions which will execute when this rule is triggered
|
||||
*/
|
||||
actions: APIAutoModerationAction[];
|
||||
/**
|
||||
* Whether this rule is enabled
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* The role ids that shouldn't be affected by this rule (Maximum of 20)
|
||||
*/
|
||||
exempt_roles?: Snowflake[];
|
||||
/**
|
||||
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
|
||||
*/
|
||||
exempt_channels?: Snowflake[];
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
|
||||
*/
|
||||
export type RESTPostAPIAutoModerationRuleResult = APIAutoModerationRule;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
|
||||
*/
|
||||
export type RESTPatchAPIAutoModerationRuleJSONBody = Omit<
|
||||
Partial<RESTPostAPIAutoModerationRuleJSONBody>,
|
||||
'trigger_type'
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
|
||||
*/
|
||||
export type RESTPatchAPIAutoModerationRuleResult = APIAutoModerationRule;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule
|
||||
*/
|
||||
export type RESTDeleteAPIAutoModerationRuleResult = never;
|
||||
@@ -19,6 +19,10 @@ import type {
|
||||
OverwriteType,
|
||||
ThreadAutoArchiveDuration,
|
||||
VideoQualityMode,
|
||||
APIGuildForumTag,
|
||||
APIGuildForumDefaultReactionEmoji,
|
||||
SortOrderType,
|
||||
ForumLayoutType,
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
|
||||
@@ -48,7 +52,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
type?: ChannelType.GuildNews | ChannelType.GuildText;
|
||||
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText;
|
||||
/**
|
||||
* The position of the channel in the left-hand listing
|
||||
*
|
||||
@@ -56,15 +60,15 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
*/
|
||||
position?: number | null;
|
||||
/**
|
||||
* 0-1024 character channel topic
|
||||
* 0-1024 character channel topic (0-4096 characters for forum channels)
|
||||
*
|
||||
* Channel types: text, news
|
||||
* Channel types: text, news, forum
|
||||
*/
|
||||
topic?: string | null;
|
||||
/**
|
||||
* Whether the channel is nsfw
|
||||
*
|
||||
* Channel types: text, voice, news
|
||||
* Channel types: text, voice, news, forum
|
||||
*/
|
||||
nsfw?: boolean | null;
|
||||
/**
|
||||
@@ -72,7 +76,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
|
||||
* are unaffected
|
||||
*
|
||||
* Channel types: text, newsThread, publicThread, privateThread
|
||||
* Channel types: text, newsThread, publicThread, privateThread, forum
|
||||
*/
|
||||
rate_limit_per_user?: number | null;
|
||||
/**
|
||||
@@ -141,6 +145,37 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
|
||||
* Channel types: privateThread
|
||||
*/
|
||||
invitable?: boolean;
|
||||
/**
|
||||
* The set of tags that can be used in a forum channel; limited to 20
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
available_tags?: APIGuildForumTag[];
|
||||
/**
|
||||
* The emoji to show in the add reaction button on a thread in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji;
|
||||
/**
|
||||
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
|
||||
* This field is copied to the thread at creation time and does not live update
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_thread_rate_limit_per_user?: number | null;
|
||||
/**
|
||||
* The default sort order type used to order posts in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_sort_order?: SortOrderType | null;
|
||||
/**
|
||||
* The default layout type used to display posts in a forum channel
|
||||
*
|
||||
* Channel types: forum
|
||||
*/
|
||||
default_forum_layout?: ForumLayoutType;
|
||||
}>;
|
||||
|
||||
/**
|
||||
@@ -603,6 +638,10 @@ export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThr
|
||||
* First message in the forum thread
|
||||
*/
|
||||
message: RESTPostAPIChannelMessageJSONBody;
|
||||
/**
|
||||
* The IDs of the set of tags that have been applied to a thread in a forum channel; limited to 5
|
||||
*/
|
||||
applied_tags?: Snowflake[];
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -633,9 +672,9 @@ export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThread
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*
|
||||
* @default ChannelType.GuildPrivateThread
|
||||
* @default ChannelType.PrivateThread
|
||||
*/
|
||||
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
|
||||
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread;
|
||||
/**
|
||||
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
|
||||
*/
|
||||
@@ -657,6 +696,39 @@ export type RESTPutAPIChannelThreadMembersResult = never;
|
||||
*/
|
||||
export type RESTDeleteAPIChannelThreadMembersResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-thread-member
|
||||
*/
|
||||
export interface RESTGetAPIChannelThreadMemberQuery {
|
||||
/**
|
||||
* Whether to include a guild member object for the thread member
|
||||
*/
|
||||
with_member?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-thread-member
|
||||
*/
|
||||
export type RESTGetAPIChannelThreadMemberResult = APIThreadMember;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#list-thread-members
|
||||
*/
|
||||
export interface RESTGetAPIChannelThreadMembersQuery {
|
||||
/**
|
||||
* Whether to include a guild member object for each thread member
|
||||
*/
|
||||
with_member?: boolean;
|
||||
/**
|
||||
* Get thread members after this user ID
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* Max number of thread members to return (1-100). Defaults to 100
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#list-thread-members
|
||||
*/
|
||||
@@ -676,10 +748,20 @@ export interface RESTGetAPIChannelThreadsArchivedQuery {
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#list-public-archived-threads
|
||||
*/
|
||||
export type RESTGetAPIChannelThreadsArchivedPublicResult = RESTGetAPIChannelUsersThreadsArchivedResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#list-private-archived-threads
|
||||
*/
|
||||
export type RESTGetAPIChannelThreadsArchivedPrivateResult = RESTGetAPIChannelUsersThreadsArchivedResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#list-active-threads
|
||||
*
|
||||
* @deprecated Removed in API v10, use [List Active Guild Threads](https://discord.com/developers/docs/resources/guild#list-active-threads) instead.
|
||||
* @deprecated Removed in API v10, use [List Active Guild Threads](https://discord.com/developers/docs/resources/guild#list-active-guild-threads) instead.
|
||||
*/
|
||||
export type RESTGetAPIChannelThreadsResult = APIThreadList;
|
||||
|
||||
|
||||
@@ -53,6 +53,10 @@ export type APIGuildCreatePartialChannel = StrictPartial<
|
||||
| 'rtc_region'
|
||||
| 'video_quality_mode'
|
||||
| 'flags'
|
||||
| 'default_reaction_emoji'
|
||||
| 'available_tags'
|
||||
| 'default_sort_order'
|
||||
| 'default_forum_layout'
|
||||
>
|
||||
> &
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
@@ -135,9 +139,9 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*/
|
||||
afk_channel_id?: number | Snowflake | null;
|
||||
/**
|
||||
* AFK timeout in seconds
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout?: number;
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
@@ -235,9 +239,9 @@ export type RESTPatchAPIGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertie
|
||||
*/
|
||||
afk_channel_id?: Snowflake | null;
|
||||
/**
|
||||
* AFK timeout in seconds
|
||||
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout?: number;
|
||||
afk_timeout?: 60 | 300 | 900 | 1800 | 3600;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature)
|
||||
*
|
||||
@@ -357,7 +361,7 @@ export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
|
||||
export type RESTPatchAPIGuildChannelPositionsResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#list-active-threads
|
||||
* https://discord.com/developers/docs/resources/guild#list-active-guild-threads
|
||||
*/
|
||||
export type RESTGetAPIGuildThreadsResult = Omit<APIThreadList, 'has_more'>;
|
||||
|
||||
@@ -573,8 +577,14 @@ export type RESTGetAPIGuildBanResult = APIBan;
|
||||
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
|
||||
/**
|
||||
* Number of days to delete messages for (0-7)
|
||||
*
|
||||
* @deprecated use `delete_message_seconds` instead
|
||||
*/
|
||||
delete_message_days?: number;
|
||||
/**
|
||||
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
|
||||
*/
|
||||
delete_message_seconds?: number;
|
||||
/**
|
||||
* Reason for the ban
|
||||
*
|
||||
@@ -861,7 +871,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
@@ -891,6 +901,11 @@ export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUnde
|
||||
suppress?: boolean;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
|
||||
*/
|
||||
export type RESTPatchAPIGuildVoiceStateUserResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
|
||||
*/
|
||||
|
||||
@@ -16,6 +16,19 @@ import type {
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands
|
||||
*/
|
||||
export interface RESTGetAPIApplicationCommandsQuery {
|
||||
/**
|
||||
* Whether to include full localization dictionaries (name_localizations and description_localizations)
|
||||
* in the returned objects, instead of the name_localized and description_localized fields.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
with_localizations?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands
|
||||
*/
|
||||
@@ -90,6 +103,11 @@ export type RESTPutAPIApplicationCommandsJSONBody = RESTPostAPIApplicationComman
|
||||
*/
|
||||
export type RESTPutAPIApplicationCommandsResult = APIApplicationCommand[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
|
||||
*/
|
||||
export type RESTGetAPIApplicationGuildCommandsQuery = RESTGetAPIApplicationCommandsQuery;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
|
||||
*/
|
||||
@@ -129,8 +147,10 @@ export type RESTPatchAPIApplicationGuildCommandResult = Omit<APIApplicationComma
|
||||
* https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
|
||||
*/
|
||||
export type RESTPutAPIApplicationGuildCommandsJSONBody = (
|
||||
| Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'>
|
||||
| Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'>
|
||||
| (Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'> &
|
||||
Pick<Partial<APIApplicationCommand>, 'id'>)
|
||||
| (Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'> &
|
||||
Pick<Partial<APIApplicationCommand>, 'id'>)
|
||||
)[];
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
export * from '../common.ts';
|
||||
export * from './application.ts';
|
||||
export * from './auditLog.ts';
|
||||
export * from './autoModeration.ts';
|
||||
export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
@@ -20,6 +22,33 @@ export * from './webhook.ts';
|
||||
export const APIVersion = '9';
|
||||
|
||||
export const Routes = {
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/role-connections/metadata`
|
||||
* - PUT `/applications/{application.id}/role-connections/metadata`
|
||||
*/
|
||||
applicationRoleConnectionMetadata(applicationId: Snowflake) {
|
||||
return `/applications/${applicationId}/role-connections/metadata` as const;
|
||||
},
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/auto-moderation/rules`
|
||||
* - POST `/guilds/{guild.id}/auto-moderation/rules`
|
||||
*/
|
||||
guildAutoModerationRules(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/auto-moderation/rules` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Routes for:
|
||||
* - GET `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
|
||||
* - PATCH `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
|
||||
* - DELETE `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
|
||||
*/
|
||||
guildAutoModerationRule(guildId: Snowflake, ruleId: Snowflake) {
|
||||
return `/guilds/${guildId}/auto-moderation/rules/${ruleId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/audit-logs`
|
||||
@@ -510,6 +539,15 @@ export const Routes = {
|
||||
return `/users/${userId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/applications/{application.id}/role-connection`
|
||||
* - PUT `/users/@me/applications/{application.id}/role-connection`
|
||||
*/
|
||||
userApplicationRoleConnection(applicationId: Snowflake) {
|
||||
return `/users/@me/applications/${applicationId}/role-connection` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/guilds`
|
||||
@@ -853,6 +891,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, GIF
|
||||
*/
|
||||
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 | ImageFormat.GIF>;
|
||||
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',
|
||||
|
||||
@@ -40,7 +40,7 @@ export interface RESTPostAPIGuildStickerFormDataBody {
|
||||
*/
|
||||
tags: string;
|
||||
/**
|
||||
* The sticker file to upload, must be a PNG, APNG, or Lottie JSON file, max 500 KB
|
||||
* The sticker file to upload, must be a PNG, APNG, GIF, or Lottie JSON file, max 500 KB
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,12 @@
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { APIChannel, APIConnection, APIGuildMember, APIUser, GuildFeature } from '../../payloads/v9/mod.ts';
|
||||
import type {
|
||||
APIChannel,
|
||||
APIConnection,
|
||||
APIGuildMember,
|
||||
APIUser,
|
||||
APIApplicationRoleConnection,
|
||||
GuildFeature,
|
||||
} from '../../payloads/v9/mod.ts';
|
||||
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
|
||||
|
||||
/**
|
||||
@@ -49,9 +56,9 @@ export interface RESTGetAPICurrentUserGuildsQuery {
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* Max number of guilds to return (1-100)
|
||||
* Max number of guilds to return (1-200)
|
||||
*
|
||||
* @default 100
|
||||
* @default 200
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
@@ -94,3 +101,31 @@ export type RESTPostAPICurrentUserCreateDMChannelResult = APIChannel;
|
||||
* https://discord.com/developers/docs/resources/user#get-user-connections
|
||||
*/
|
||||
export type RESTGetAPICurrentUserConnectionsResult = APIConnection[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-user-application-role-connection
|
||||
*/
|
||||
export type RESTGetAPICurrentUserApplicationRoleConnectionResult = APIApplicationRoleConnection;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#update-user-application-role-connection
|
||||
*/
|
||||
export interface RESTPutAPICurrentUserApplicationRoleConnectionJSONBody {
|
||||
/**
|
||||
* The vanity name of the platform a bot has connected (max 50 characters)
|
||||
*/
|
||||
platform_name?: string;
|
||||
/**
|
||||
* The username on the platform a bot has connected (max 100 characters)
|
||||
*/
|
||||
platform_username?: string;
|
||||
/**
|
||||
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
|
||||
*/
|
||||
metadata?: Record<string, string | number>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#update-user-application-role-connection
|
||||
*/
|
||||
export type RESTPutAPICurrentUserApplicationRoleConnectionResult = APIApplicationRoleConnection;
|
||||
|
||||
@@ -3,4 +3,9 @@ import type { APIVoiceRegion } from '../../payloads/v9/mod.ts';
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#list-voice-regions
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
export type RESTGetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
|
||||
/**
|
||||
* @deprecated This was exported with the wrong name, use `RESTGetAPIVoiceRegionsResult` instead
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = RESTGetAPIVoiceRegionsResult;
|
||||
|
||||
@@ -141,7 +141,13 @@ export function isMessageComponentButtonInteraction(
|
||||
export function isMessageComponentSelectMenuInteraction(
|
||||
interaction: APIMessageComponentInteraction,
|
||||
): interaction is APIMessageComponentSelectMenuInteraction {
|
||||
return interaction.data.component_type === ComponentType.SelectMenu;
|
||||
return [
|
||||
ComponentType.StringSelect,
|
||||
ComponentType.UserSelect,
|
||||
ComponentType.RoleSelect,
|
||||
ComponentType.MentionableSelect,
|
||||
ComponentType.ChannelSelect,
|
||||
].includes(interaction.data.component_type);
|
||||
}
|
||||
|
||||
// Application Commands
|
||||
|
||||
@@ -141,7 +141,13 @@ export function isMessageComponentButtonInteraction(
|
||||
export function isMessageComponentSelectMenuInteraction(
|
||||
interaction: APIMessageComponentInteraction,
|
||||
): interaction is APIMessageComponentSelectMenuInteraction {
|
||||
return interaction.data.component_type === ComponentType.SelectMenu;
|
||||
return [
|
||||
ComponentType.StringSelect,
|
||||
ComponentType.UserSelect,
|
||||
ComponentType.RoleSelect,
|
||||
ComponentType.MentionableSelect,
|
||||
ComponentType.ChannelSelect,
|
||||
].includes(interaction.data.component_type);
|
||||
}
|
||||
|
||||
// Application Commands
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params
|
||||
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params
|
||||
*/
|
||||
export interface GatewayURLQuery {
|
||||
v: string;
|
||||
|
||||
550
gateway/v10.ts
550
gateway/v10.ts
File diff suppressed because it is too large
Load Diff
@@ -1686,7 +1686,7 @@ export interface GatewayPresenceUpdateData {
|
||||
/**
|
||||
* The user's activities
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object
|
||||
*/
|
||||
activities: GatewayActivityUpdateData[];
|
||||
/**
|
||||
@@ -1702,7 +1702,7 @@ export interface GatewayPresenceUpdateData {
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure
|
||||
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
|
||||
*/
|
||||
export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'type' | 'url'>;
|
||||
|
||||
550
gateway/v9.ts
550
gateway/v9.ts
File diff suppressed because it is too large
Load Diff
@@ -45,6 +45,13 @@ export const FormattingPatterns = {
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
Role: /<@&(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a application command mention
|
||||
*
|
||||
* The `fullName` (possibly including `name`, `subcommandOrGroup` and `subcommand`) and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
SlashCommand:
|
||||
/<\/(?<fullName>(?<name>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32})(?: (?<subcommandOrGroup>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?(?: (?<subcommand>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?):(?<id>\d{17,20})>/u,
|
||||
/**
|
||||
* Regular expression for matching a custom emoji, either static or animated
|
||||
*
|
||||
|
||||
28
package-lock.json
generated
28
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.34.0",
|
||||
"version": "0.37.28",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "discord-api-types",
|
||||
"version": "0.34.0",
|
||||
"version": "0.37.28",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@babel/runtime-corejs3": "^7.18.0",
|
||||
@@ -4351,9 +4351,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/json5": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
|
||||
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
|
||||
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"minimist": "^1.2.0"
|
||||
@@ -7611,9 +7611,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/vm2": {
|
||||
"version": "3.9.9",
|
||||
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.9.tgz",
|
||||
"integrity": "sha512-xwTm7NLh/uOjARRBs8/95H0e8fT3Ukw5D/JJWhxMbhKzNh1Nu981jQKvkep9iKYNxzlVrdzD0mlBGkDKZWprlw==",
|
||||
"version": "3.9.11",
|
||||
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.11.tgz",
|
||||
"integrity": "sha512-PFG8iJRSjvvBdisowQ7iVF580DXb1uCIiGaXgm7tynMR1uTBlv7UJlB1zdv5KJ+Tmq1f0Upnj3fayoEOPpCBKg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"acorn": "^8.7.0",
|
||||
@@ -11186,9 +11186,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"json5": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
|
||||
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
|
||||
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"minimist": "^1.2.0"
|
||||
@@ -13609,9 +13609,9 @@
|
||||
}
|
||||
},
|
||||
"vm2": {
|
||||
"version": "3.9.9",
|
||||
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.9.tgz",
|
||||
"integrity": "sha512-xwTm7NLh/uOjARRBs8/95H0e8fT3Ukw5D/JJWhxMbhKzNh1Nu981jQKvkep9iKYNxzlVrdzD0mlBGkDKZWprlw==",
|
||||
"version": "3.9.11",
|
||||
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.11.tgz",
|
||||
"integrity": "sha512-PFG8iJRSjvvBdisowQ7iVF580DXb1uCIiGaXgm7tynMR1uTBlv7UJlB1zdv5KJ+Tmq1f0Upnj3fayoEOPpCBKg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"acorn": "^8.7.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.34.0",
|
||||
"version": "0.37.28",
|
||||
"description": "Discord API typings that are kept up to date for use in bot library creation.",
|
||||
"homepage": "https://discord-api-types.dev",
|
||||
"exports": {
|
||||
|
||||
@@ -58,3 +58,47 @@ export const PermissionFlagsBits = {
|
||||
Object.freeze(PermissionFlagsBits);
|
||||
|
||||
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json
|
||||
*/
|
||||
export interface RESTError {
|
||||
code: number;
|
||||
message: string;
|
||||
errors?: RESTErrorData;
|
||||
}
|
||||
|
||||
export interface RESTErrorFieldInformation {
|
||||
code: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface RESTErrorGroupWrapper {
|
||||
_errors: RESTErrorData[];
|
||||
}
|
||||
|
||||
export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation | { [k: string]: RESTErrorData } | string;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
|
||||
*/
|
||||
export interface RESTRateLimit {
|
||||
/**
|
||||
* An error code for some limits
|
||||
*
|
||||
* {@link RESTJSONErrorCodes}
|
||||
*/
|
||||
code?: number;
|
||||
/**
|
||||
* A value indicating if you are being globally rate limited or not
|
||||
*/
|
||||
global: boolean;
|
||||
/**
|
||||
* A message saying you are being rate limited.
|
||||
*/
|
||||
message: string;
|
||||
/**
|
||||
* The number of seconds to wait before submitting another request.
|
||||
*/
|
||||
retry_after: number;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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>
|
||||
>;
|
||||
|
||||
|
||||
@@ -43,17 +43,12 @@ import type {
|
||||
APIApplicationCommandUserOption,
|
||||
} from './_chatInput/user';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals';
|
||||
import type { Snowflake } from '../../../../globals';
|
||||
import type { APIAttachment, APIRole, APIUser } from '../../index';
|
||||
import type {
|
||||
APIApplicationCommandInteractionWrapper,
|
||||
APIInteractionDataResolvedChannel,
|
||||
APIInteractionDataResolvedGuildMember,
|
||||
ApplicationCommandType,
|
||||
} from '../applicationCommands';
|
||||
import type { APIInteractionDataResolved } from '../../index';
|
||||
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base';
|
||||
|
||||
export * from './_chatInput/attachment';
|
||||
export * from './_chatInput/base';
|
||||
export * from './_chatInput/boolean';
|
||||
export * from './_chatInput/channel';
|
||||
export * from './_chatInput/integer';
|
||||
@@ -108,23 +103,12 @@ export type APIApplicationCommandInteractionDataBasicOption =
|
||||
| APIApplicationCommandInteractionDataAttachmentOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIChatInputApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {
|
||||
options?: APIApplicationCommandInteractionDataOption[];
|
||||
resolved?: APIChatInputApplicationCommandInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
export interface APIChatInputApplicationCommandInteractionDataResolved {
|
||||
users?: Record<Snowflake, APIUser>;
|
||||
roles?: Record<Snowflake, APIRole>;
|
||||
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
|
||||
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
|
||||
attachments?: Record<Snowflake, APIAttachment>;
|
||||
resolved?: APIInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user