Compare commits

...

55 Commits

Author SHA1 Message Date
github-actions[bot]
1d8399d925 chore(release): 0.37.63 🎉 (#846)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-09 14:29:41 +02:00
Almeida
a8efb1949a fix(RESTPutAPIGuildOnboardingJSONBody): optional keys and flattened emoji (#839)
* fix(RESTPutAPIGuildOnboardingJSONBody): optional keys and flattened emoji

* fix: requested changes
2023-11-07 21:37:36 +02:00
github-actions[bot]
c0f68e9509 chore(release): 0.37.62 🎉 (#845)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-30 14:20:23 +02:00
Almeida
28ed3701e6 feat(RESTJSONErrorCodes): add 40074 and 50057 (#844) 2023-10-28 12:24:36 +03:00
github-actions[bot]
4640f80274 chore(release): 0.37.61 🎉 (#842)
Build ran for ba08061917

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-23 15:20:36 +03:00
Jaw0r3k
ba08061917 feat: premium app subscriptions (#833)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
Co-authored-by: Almeida <almeidx@pm.me>
2023-10-22 22:02:01 +03:00
dependabot[bot]
f51c2d95ae chore(deps-dev): bump postcss from 8.4.23 to 8.4.31 (#837)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-21 20:45:31 +03:00
dependabot[bot]
984eacdef6 chore(deps): bump postcss from 8.4.14 to 8.4.31 in /website (#838)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-21 20:45:15 +03:00
dependabot[bot]
0a914acd11 chore(deps): bump @babel/traverse from 7.18.2 to 7.23.2 in /website (#840)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-21 20:22:02 +03:00
dependabot[bot]
3f1d9b47aa chore(deps-dev): bump @babel/traverse from 7.21.5 to 7.23.2 (#841)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-10-21 20:21:17 +03:00
github-actions[bot]
8541201a96 chore(release): 0.37.60 🎉 (#836)
Build ran for 17f42e0b38

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-05 15:21:55 +03:00
Jiralite
17f42e0b38 feat: Application patch and new properties (#810)
* feat: application patch and properties

* docs(APIApplication): update tag documentation

* fix(RESTPatchCurrentApplicationJSONBody): add `flags`

* docs(APIApplication): update `approximate_guild_count`
2023-10-03 20:34:06 +02:00
github-actions[bot]
5515e2914a chore(release): 0.37.59 🎉 (#835)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-10-02 15:20:05 +03:00
Suneet Tipirneni
ecef5b492b feat(RESTPostAPIStageInstanceJSONBody): add guild_scheduled_event_id (#656) 2023-09-28 22:01:27 +03:00
github-actions[bot]
c71258ceb4 chore(release): 0.37.58 🎉 (#832)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-09-25 16:04:11 +03:00
Suneet Tipirneni
a4cdbbfdf8 fix(RESTPatchAPIChannelJSONBody): add missing applied_tags field (#828) 2023-09-25 13:23:01 +02:00
Almeida
06fb47c51d chore: change docusaurus branch name (#830) 2023-09-24 01:23:22 +03:00
Jiralite
cc47220e87 docs(RESTPostAPIGuildForumThreadsJSONBody): Fix reference link (#827) 2023-09-24 00:36:57 +03:00
Renegade334
4defa9ea12 refactor(APIInteractionDataResolvedChannel): thread channels (#825)
- bring APIInteractionDataResolvedChannel into line with API specification
  (thread_metadata, parent_id only exist on thread channel partials)
- also adds a ThreadChannelType utility export
2023-09-23 22:23:15 +01:00
Jaw0r3k
1290c942ab feat: default select menu values (#824)
Co-authored-by: Renegade334 <contact.9a5d6388@renegade334.me.uk>
2023-09-23 20:14:35 +02:00
github-actions[bot]
4309463634 chore(release): 0.37.57 🎉 (#823)
Build ran for 1b8f62fc98

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-09-21 15:20:17 +03:00
Danial Raza
1b8f62fc98 docs: fix TypeDoc typos (#821) 2023-09-19 21:32:06 +01:00
Danial Raza
32ba5ce36c feat(ConnectionService): support twitter rebrand update (#819) 2023-09-19 20:25:11 +02:00
github-actions[bot]
1598baf0c3 chore(release): 0.37.56 🎉 (#817)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-31 15:19:18 +03:00
Danial Raza
ceb2f033f7 docs(APITeamMember): update deprecation message (#816) 2023-08-29 01:52:48 +03:00
Danial Raza
36e3d156c6 refactor(TeamMemberRole): remove owner role (#814) 2023-08-26 00:26:26 +03:00
Danial Raza
a26629c0e8 feat: add support for teams update (#813) 2023-08-25 14:59:12 +03:00
Almeida
018d889d9a fix: standard stickers are now free (#789) 2023-08-25 02:54:47 +03:00
Jiralite
1eb01618a3 fix(RESTPostAPIChannelMessageJSONBody): number for attachment ids (#811) 2023-08-25 02:52:43 +03:00
Almeida
31c8549fe3 feat(APIAuditLogOptions): add integration_type (#809) 2023-08-25 02:50:54 +03:00
github-actions[bot]
729d4bf719 chore(release): 0.37.55 🎉 (#812)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-24 15:38:36 +03:00
Jiralite
19beae59e0 chore: use code owners (#808) 2023-08-22 16:58:45 +03:00
github-actions[bot]
d24e928051 chore(release): 0.37.54 🎉 (#807)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-17 15:55:29 +03:00
dependabot[bot]
27bebd978b chore(deps): bump vm2 from 3.9.16 to 3.9.19 (#769)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-14 15:26:27 +03:00
MARCROCK22
b919e721bc fix(Guild): union with never type (#797)
Co-authored-by: Marcos Susaña <marcosjgs03@gmail.com>
2023-08-14 15:25:23 +03:00
Jiralite
138b9f2bf2 feat: Add Media channels (#777) 2023-08-14 15:24:40 +03:00
github-actions[bot]
382fb0317c chore(release): 0.37.53 🎉 (#806)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-14 15:20:49 +03:00
advaith
e095e09b0b feat(GatewayActivityUpdateData): allow sending state (#801)
* feat(GatewayActivityUpdateData): allow sending state

* docs: edit description of state

* fix: custom activity type description
2023-08-13 11:55:19 +03:00
Jaw0r3k
9212ab8b99 chore(RoleFlags): add link to api docs (#804) 2023-08-12 13:25:52 +00:00
github-actions[bot]
460b72c518 chore(release): 0.37.52 🎉 (#803)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-08-07 15:19:50 +03:00
Jiralite
52611242fb fix(RESTPatchAPIChannelJSONBody): available_tags requires name only (#802) 2023-08-07 11:31:50 +03:00
github-actions[bot]
d2bb76574b chore(release): 0.37.51 🎉 (#800)
Build ran for 1071d24362

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-31 16:21:44 +04:00
advaith
1071d24362 fix(Presence): cannot receive invisible status (#799) 2023-07-28 13:48:07 +04:00
github-actions[bot]
ae8503f0e7 chore(release): 0.37.50 🎉 (#796)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-20 15:42:31 +03:00
Almeida
773556aa32 feat: onboarding updates, mode field, and error codes (#773) 2023-07-19 17:55:48 +03:00
dependabot[bot]
06ee56475c chore(deps): bump word-wrap from 1.2.3 to 1.2.4 in /website (#794)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 02:38:07 +03:00
dependabot[bot]
a1c26c2372 chore(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 (#793)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-19 02:36:48 +03:00
github-actions[bot]
387f37f1d5 chore(release): 0.37.49 🎉 (#792)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-17 15:29:28 +03:00
Almeida
874f13573b feat(APIApplication): approx guild count and get self application endpoint (#728)
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
2023-07-17 15:26:47 +03:00
dependabot[bot]
289c53ab31 chore(deps): bump semver from 5.7.1 to 5.7.2 in /website (#786)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-17 02:06:58 +03:00
advaith
f556455ba6 feat(APIUser): add avatar decorations (#664) 2023-07-17 02:05:50 +03:00
Almeida
7f9a7e5b94 feat(APIAttachment): add flags (#783) 2023-07-17 02:04:42 +03:00
Jiralite
47f78bcc69 feat(AuditLogEvent): Add creator monetisation events (#787) 2023-07-17 02:03:55 +03:00
advaith
488b5adf04 feat(APIRole): role flags (#782) 2023-07-17 02:03:09 +03:00
Almeida
82d7024dfd feat(GatewayMessageReactionAddDispatch): add message_author_id (#754) 2023-07-14 00:37:27 +03:00
118 changed files with 3755 additions and 734 deletions

10
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,10 @@
* @vladfrangu
/*.ts @discordjs/discord-api-types @discordjs/core
gateway/ @discordjs/discord-api-types @discordjs/core
payloads/ @discordjs/discord-api-types @discordjs/core
rest/ @discordjs/discord-api-types @discordjs/core
rpc/ @discordjs/discord-api-types @discordjs/core
tests/ @discordjs/discord-api-types @discordjs/core
utils/ @discordjs/discord-api-types @discordjs/core
voice/ @discordjs/discord-api-types @discordjs/core

View File

@@ -1,8 +0,0 @@
addReviewers: true
reviewers:
- iCrawl
- SpaceEEC
- kyranet
- vladfrangu
numberOfReviewers: 0
runOnDraft: true

View File

@@ -12,7 +12,3 @@ jobs:
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
sync-labels: true
- name: Automatically assign reviewers
if: github.event.action == 'opened'
uses: kentaro-m/auto-assign-action@v1.2.4

View File

@@ -15,3 +15,6 @@ website/build
*.js
*.d.ts
*.mjs
# Miscellaneous
CODEOWNERS

View File

@@ -1,3 +1,108 @@
## [0.37.63](https://github.com/discordjs/discord-api-types/compare/0.37.62...0.37.63) (2023-11-09)
### Bug Fixes
- **RESTPutAPIGuildOnboardingJSONBody:** optional keys and flattened emoji ([#839](https://github.com/discordjs/discord-api-types/issues/839)) ([a8efb19](https://github.com/discordjs/discord-api-types/commit/a8efb1949ad4b554d5c59f7b55a251ee12abc93d))
## [0.37.62](https://github.com/discordjs/discord-api-types/compare/0.37.61...0.37.62) (2023-10-30)
### Features
- **RESTJSONErrorCodes:** add `40074` and `50057` ([#844](https://github.com/discordjs/discord-api-types/issues/844)) ([28ed370](https://github.com/discordjs/discord-api-types/commit/28ed3701e6105d0d15fb988194c13079a27e4369))
## [0.37.61](https://github.com/discordjs/discord-api-types/compare/0.37.60...0.37.61) (2023-10-23)
### Features
- premium app subscriptions ([#833](https://github.com/discordjs/discord-api-types/issues/833)) ([ba08061](https://github.com/discordjs/discord-api-types/commit/ba080619170b484f671011abe3b0a61c0e69cca9))
## [0.37.60](https://github.com/discordjs/discord-api-types/compare/0.37.59...0.37.60) (2023-10-05)
### Features
- Application patch and new properties ([#810](https://github.com/discordjs/discord-api-types/issues/810)) ([17f42e0](https://github.com/discordjs/discord-api-types/commit/17f42e0b38d431505ee56cdeb0bb85bff94e97c6))
## [0.37.59](https://github.com/discordjs/discord-api-types/compare/0.37.58...0.37.59) (2023-10-02)
### Features
- **RESTPostAPIStageInstanceJSONBody:** add `guild_scheduled_event_id` ([#656](https://github.com/discordjs/discord-api-types/issues/656)) ([ecef5b4](https://github.com/discordjs/discord-api-types/commit/ecef5b492bd54b3c61c04a6784fd39c29e282780))
## [0.37.58](https://github.com/discordjs/discord-api-types/compare/0.37.57...0.37.58) (2023-09-25)
### Bug Fixes
- **RESTPatchAPIChannelJSONBody:** add missing `applied_tags` field ([#828](https://github.com/discordjs/discord-api-types/issues/828)) ([a4cdbbf](https://github.com/discordjs/discord-api-types/commit/a4cdbbfdf87f32e6108140260f163afeca3e0788))
### Features
- default select menu values ([#824](https://github.com/discordjs/discord-api-types/issues/824)) ([1290c94](https://github.com/discordjs/discord-api-types/commit/1290c942abdd8c2d9bf97aa2807f45073970f823))
## [0.37.57](https://github.com/discordjs/discord-api-types/compare/0.37.56...0.37.57) (2023-09-21)
### Features
- **ConnectionService:** support twitter rebrand update ([#819](https://github.com/discordjs/discord-api-types/issues/819)) ([32ba5ce](https://github.com/discordjs/discord-api-types/commit/32ba5ce36ce3b89293d540b06b74c2643ced7119))
## [0.37.56](https://github.com/discordjs/discord-api-types/compare/0.37.55...0.37.56) (2023-08-31)
### Bug Fixes
- **RESTPostAPIChannelMessageJSONBody:** `number` for attachment ids ([#811](https://github.com/discordjs/discord-api-types/issues/811)) ([1eb0161](https://github.com/discordjs/discord-api-types/commit/1eb01618a3d7421012b0423aea7a8bde032c08fc))
- standard stickers are now free ([#789](https://github.com/discordjs/discord-api-types/issues/789)) ([018d889](https://github.com/discordjs/discord-api-types/commit/018d889d9aeb35b64dd914ade9ac93e8b98390ac))
### Features
- add support for teams update ([#813](https://github.com/discordjs/discord-api-types/issues/813)) ([a26629c](https://github.com/discordjs/discord-api-types/commit/a26629c0e83504299af4bc5eb85e101c63b9ced8))
- **APIAuditLogOptions:** add `integration_type` ([#809](https://github.com/discordjs/discord-api-types/issues/809)) ([31c8549](https://github.com/discordjs/discord-api-types/commit/31c8549fe3e461ad120a3af434e27c61091bbb9c))
## [0.37.55](https://github.com/discordjs/discord-api-types/compare/0.37.54...0.37.55) (2023-08-24)
## [0.37.54](https://github.com/discordjs/discord-api-types/compare/0.37.53...0.37.54) (2023-08-17)
### Bug Fixes
- **Guild:** union with never type ([#797](https://github.com/discordjs/discord-api-types/issues/797)) ([b919e72](https://github.com/discordjs/discord-api-types/commit/b919e721bca4ff19340a40b58f6a20d34641bb05))
### Features
- Add Media channels ([#777](https://github.com/discordjs/discord-api-types/issues/777)) ([138b9f2](https://github.com/discordjs/discord-api-types/commit/138b9f2bf2fa7dcaada81de222543fa8a03bd52f))
## [0.37.53](https://github.com/discordjs/discord-api-types/compare/0.37.52...0.37.53) (2023-08-14)
### Features
- **GatewayActivityUpdateData:** allow sending state ([#801](https://github.com/discordjs/discord-api-types/issues/801)) ([e095e09](https://github.com/discordjs/discord-api-types/commit/e095e09b0b5e3c85107705de124858e1fbb29bf0))
## [0.37.52](https://github.com/discordjs/discord-api-types/compare/0.37.51...0.37.52) (2023-08-07)
### Bug Fixes
- **RESTPatchAPIChannelJSONBody:** `available_tags` requires `name` only ([#802](https://github.com/discordjs/discord-api-types/issues/802)) ([5261124](https://github.com/discordjs/discord-api-types/commit/52611242fb73ac56d8cfedd8953ce558bf6e842e))
## [0.37.51](https://github.com/discordjs/discord-api-types/compare/0.37.50...0.37.51) (2023-07-31)
### Bug Fixes
- **Presence:** cannot receive invisible status ([#799](https://github.com/discordjs/discord-api-types/issues/799)) ([1071d24](https://github.com/discordjs/discord-api-types/commit/1071d24362bbf1d39d528f73c3233f22aee99778))
## [0.37.50](https://github.com/discordjs/discord-api-types/compare/0.37.49...0.37.50) (2023-07-20)
### Features
- onboarding updates, mode field, and error codes ([#773](https://github.com/discordjs/discord-api-types/issues/773)) ([773556a](https://github.com/discordjs/discord-api-types/commit/773556aa329750839262874b4af6c4113d9906d3))
## [0.37.49](https://github.com/discordjs/discord-api-types/compare/0.37.48...0.37.49) (2023-07-17)
### Features
- **APIApplication:** approx guild count and get self application endpoint ([#728](https://github.com/discordjs/discord-api-types/issues/728)) ([874f135](https://github.com/discordjs/discord-api-types/commit/874f13573b35fe1e5e40549d007aebe5ec3bbcc0))
- **APIAttachment:** add `flags` ([#783](https://github.com/discordjs/discord-api-types/issues/783)) ([7f9a7e5](https://github.com/discordjs/discord-api-types/commit/7f9a7e5b94529fbcd254ffdd1fcac1ceff62e890))
- **APIRole:** role flags ([#782](https://github.com/discordjs/discord-api-types/issues/782)) ([488b5ad](https://github.com/discordjs/discord-api-types/commit/488b5adf04d3b2c7f457bea787c2a5d1b0bf8ba6))
- **APIUser:** add avatar decorations ([#664](https://github.com/discordjs/discord-api-types/issues/664)) ([f556455](https://github.com/discordjs/discord-api-types/commit/f556455ba6e396e1b798e85f71d2a58e1aacf043))
- **AuditLogEvent:** Add creator monetisation events ([#787](https://github.com/discordjs/discord-api-types/issues/787)) ([47f78bc](https://github.com/discordjs/discord-api-types/commit/47f78bcc691ee6d551f2eb441e427384a928dd11))
- **GatewayMessageReactionAddDispatch:** add `message_author_id` ([#754](https://github.com/discordjs/discord-api-types/issues/754)) ([82d7024](https://github.com/discordjs/discord-api-types/commit/82d7024dfd0e30178e9e38647bfa882fdddd1681))
## [0.37.48](https://github.com/discordjs/discord-api-types/compare/0.37.47...0.37.48) (2023-07-10)
## [0.37.47](https://github.com/discordjs/discord-api-types/compare/0.37.46...0.37.47) (2023-06-29)

View File

@@ -1,3 +1,108 @@
## [0.37.63](https://github.com/discordjs/discord-api-types/compare/0.37.62...0.37.63) (2023-11-09)
### Bug Fixes
- **RESTPutAPIGuildOnboardingJSONBody:** optional keys and flattened emoji ([#839](https://github.com/discordjs/discord-api-types/issues/839)) ([a8efb19](https://github.com/discordjs/discord-api-types/commit/a8efb1949ad4b554d5c59f7b55a251ee12abc93d))
## [0.37.62](https://github.com/discordjs/discord-api-types/compare/0.37.61...0.37.62) (2023-10-30)
### Features
- **RESTJSONErrorCodes:** add `40074` and `50057` ([#844](https://github.com/discordjs/discord-api-types/issues/844)) ([28ed370](https://github.com/discordjs/discord-api-types/commit/28ed3701e6105d0d15fb988194c13079a27e4369))
## [0.37.61](https://github.com/discordjs/discord-api-types/compare/0.37.60...0.37.61) (2023-10-23)
### Features
- premium app subscriptions ([#833](https://github.com/discordjs/discord-api-types/issues/833)) ([ba08061](https://github.com/discordjs/discord-api-types/commit/ba080619170b484f671011abe3b0a61c0e69cca9))
## [0.37.60](https://github.com/discordjs/discord-api-types/compare/0.37.59...0.37.60) (2023-10-05)
### Features
- Application patch and new properties ([#810](https://github.com/discordjs/discord-api-types/issues/810)) ([17f42e0](https://github.com/discordjs/discord-api-types/commit/17f42e0b38d431505ee56cdeb0bb85bff94e97c6))
## [0.37.59](https://github.com/discordjs/discord-api-types/compare/0.37.58...0.37.59) (2023-10-02)
### Features
- **RESTPostAPIStageInstanceJSONBody:** add `guild_scheduled_event_id` ([#656](https://github.com/discordjs/discord-api-types/issues/656)) ([ecef5b4](https://github.com/discordjs/discord-api-types/commit/ecef5b492bd54b3c61c04a6784fd39c29e282780))
## [0.37.58](https://github.com/discordjs/discord-api-types/compare/0.37.57...0.37.58) (2023-09-25)
### Bug Fixes
- **RESTPatchAPIChannelJSONBody:** add missing `applied_tags` field ([#828](https://github.com/discordjs/discord-api-types/issues/828)) ([a4cdbbf](https://github.com/discordjs/discord-api-types/commit/a4cdbbfdf87f32e6108140260f163afeca3e0788))
### Features
- default select menu values ([#824](https://github.com/discordjs/discord-api-types/issues/824)) ([1290c94](https://github.com/discordjs/discord-api-types/commit/1290c942abdd8c2d9bf97aa2807f45073970f823))
## [0.37.57](https://github.com/discordjs/discord-api-types/compare/0.37.56...0.37.57) (2023-09-21)
### Features
- **ConnectionService:** support twitter rebrand update ([#819](https://github.com/discordjs/discord-api-types/issues/819)) ([32ba5ce](https://github.com/discordjs/discord-api-types/commit/32ba5ce36ce3b89293d540b06b74c2643ced7119))
## [0.37.56](https://github.com/discordjs/discord-api-types/compare/0.37.55...0.37.56) (2023-08-31)
### Bug Fixes
- **RESTPostAPIChannelMessageJSONBody:** `number` for attachment ids ([#811](https://github.com/discordjs/discord-api-types/issues/811)) ([1eb0161](https://github.com/discordjs/discord-api-types/commit/1eb01618a3d7421012b0423aea7a8bde032c08fc))
- standard stickers are now free ([#789](https://github.com/discordjs/discord-api-types/issues/789)) ([018d889](https://github.com/discordjs/discord-api-types/commit/018d889d9aeb35b64dd914ade9ac93e8b98390ac))
### Features
- add support for teams update ([#813](https://github.com/discordjs/discord-api-types/issues/813)) ([a26629c](https://github.com/discordjs/discord-api-types/commit/a26629c0e83504299af4bc5eb85e101c63b9ced8))
- **APIAuditLogOptions:** add `integration_type` ([#809](https://github.com/discordjs/discord-api-types/issues/809)) ([31c8549](https://github.com/discordjs/discord-api-types/commit/31c8549fe3e461ad120a3af434e27c61091bbb9c))
## [0.37.55](https://github.com/discordjs/discord-api-types/compare/0.37.54...0.37.55) (2023-08-24)
## [0.37.54](https://github.com/discordjs/discord-api-types/compare/0.37.53...0.37.54) (2023-08-17)
### Bug Fixes
- **Guild:** union with never type ([#797](https://github.com/discordjs/discord-api-types/issues/797)) ([b919e72](https://github.com/discordjs/discord-api-types/commit/b919e721bca4ff19340a40b58f6a20d34641bb05))
### Features
- Add Media channels ([#777](https://github.com/discordjs/discord-api-types/issues/777)) ([138b9f2](https://github.com/discordjs/discord-api-types/commit/138b9f2bf2fa7dcaada81de222543fa8a03bd52f))
## [0.37.53](https://github.com/discordjs/discord-api-types/compare/0.37.52...0.37.53) (2023-08-14)
### Features
- **GatewayActivityUpdateData:** allow sending state ([#801](https://github.com/discordjs/discord-api-types/issues/801)) ([e095e09](https://github.com/discordjs/discord-api-types/commit/e095e09b0b5e3c85107705de124858e1fbb29bf0))
## [0.37.52](https://github.com/discordjs/discord-api-types/compare/0.37.51...0.37.52) (2023-08-07)
### Bug Fixes
- **RESTPatchAPIChannelJSONBody:** `available_tags` requires `name` only ([#802](https://github.com/discordjs/discord-api-types/issues/802)) ([5261124](https://github.com/discordjs/discord-api-types/commit/52611242fb73ac56d8cfedd8953ce558bf6e842e))
## [0.37.51](https://github.com/discordjs/discord-api-types/compare/0.37.50...0.37.51) (2023-07-31)
### Bug Fixes
- **Presence:** cannot receive invisible status ([#799](https://github.com/discordjs/discord-api-types/issues/799)) ([1071d24](https://github.com/discordjs/discord-api-types/commit/1071d24362bbf1d39d528f73c3233f22aee99778))
## [0.37.50](https://github.com/discordjs/discord-api-types/compare/0.37.49...0.37.50) (2023-07-20)
### Features
- onboarding updates, mode field, and error codes ([#773](https://github.com/discordjs/discord-api-types/issues/773)) ([773556a](https://github.com/discordjs/discord-api-types/commit/773556aa329750839262874b4af6c4113d9906d3))
## [0.37.49](https://github.com/discordjs/discord-api-types/compare/0.37.48...0.37.49) (2023-07-17)
### Features
- **APIApplication:** approx guild count and get self application endpoint ([#728](https://github.com/discordjs/discord-api-types/issues/728)) ([874f135](https://github.com/discordjs/discord-api-types/commit/874f13573b35fe1e5e40549d007aebe5ec3bbcc0))
- **APIAttachment:** add `flags` ([#783](https://github.com/discordjs/discord-api-types/issues/783)) ([7f9a7e5](https://github.com/discordjs/discord-api-types/commit/7f9a7e5b94529fbcd254ffdd1fcac1ceff62e890))
- **APIRole:** role flags ([#782](https://github.com/discordjs/discord-api-types/issues/782)) ([488b5ad](https://github.com/discordjs/discord-api-types/commit/488b5adf04d3b2c7f457bea787c2a5d1b0bf8ba6))
- **APIUser:** add avatar decorations ([#664](https://github.com/discordjs/discord-api-types/issues/664)) ([f556455](https://github.com/discordjs/discord-api-types/commit/f556455ba6e396e1b798e85f71d2a58e1aacf043))
- **AuditLogEvent:** Add creator monetisation events ([#787](https://github.com/discordjs/discord-api-types/issues/787)) ([47f78bc](https://github.com/discordjs/discord-api-types/commit/47f78bcc691ee6d551f2eb441e427384a928dd11))
- **GatewayMessageReactionAddDispatch:** add `message_author_id` ([#754](https://github.com/discordjs/discord-api-types/issues/754)) ([82d7024](https://github.com/discordjs/discord-api-types/commit/82d7024dfd0e30178e9e38647bfa882fdddd1681))
## [0.37.48](https://github.com/discordjs/discord-api-types/compare/0.37.47...0.37.48) (2023-07-10)
## [0.37.47](https://github.com/discordjs/discord-api-types/compare/0.37.46...0.37.47) (2023-06-29)

View File

@@ -33,6 +33,7 @@ import type {
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
APIAuditLogEntry,
APIEntitlement,
} from '../payloads/v10/mod.ts';
import type { Nullable } from '../utils/internals.ts';
@@ -268,6 +269,9 @@ export enum GatewayDispatchEvents {
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
}
export type GatewaySendPayload =
@@ -341,7 +345,8 @@ export type GatewayDispatchPayload =
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch
| GatewayGuildAuditLogEntryCreateDispatch;
| GatewayGuildAuditLogEntryCreateDispatch
| GatewayEntitlementModifyDispatch;
// #region Dispatch Payloads
@@ -672,6 +677,55 @@ export interface GatewayChannelPinsUpdateDispatchData {
last_pin_timestamp?: string | null;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementModifyDispatchData = APIEntitlement;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementModifyDispatch = DataPayload<
| GatewayDispatchEvents.EntitlementCreate
| GatewayDispatchEvents.EntitlementUpdate
| GatewayDispatchEvents.EntitlementDelete,
GatewayEntitlementModifyDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
*/
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
*/
export type GatewayEntitlementCreateDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
*/
export type GatewayEntitlementUpdateDispatchData = GatewayEntitlementModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
*/
export type GatewayEntitlementUpdateDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementDeleteDispatchData = GatewayEntitlementModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementDeleteDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-create
*/
@@ -1421,7 +1475,10 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
/**
* https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove
*/
export type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
export type GatewayMessageReactionRemoveDispatch = ReactionData<
GatewayDispatchEvents.MessageReactionRemove,
'member' | 'message_author_id'
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove
@@ -1957,7 +2014,7 @@ export interface GatewayPresenceUpdateData {
/**
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure
*/
export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'type' | 'url'>;
export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'state' | 'type' | 'url'>;
// #endregion Sendable Payloads
@@ -2024,6 +2081,10 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
* See https://discord.com/developers/docs/resources/emoji#emoji-object
*/
emoji: APIEmoji;
/**
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
},
O
>

View File

@@ -35,6 +35,7 @@ import type {
APIAuditLogEntry,
} from '../payloads/v9/mod.ts';
import type { Nullable } from '../utils/internals.ts';
import type { APIEntitlement } from '../v10.ts';
export * from './common.ts';
@@ -267,6 +268,9 @@ export enum GatewayDispatchEvents {
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
}
export type GatewaySendPayload =
@@ -340,7 +344,8 @@ export type GatewayDispatchPayload =
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch
| GatewayGuildAuditLogEntryCreateDispatch;
| GatewayGuildAuditLogEntryCreateDispatch
| GatewayEntitlementModifyDispatch;
// #region Dispatch Payloads
@@ -671,6 +676,55 @@ export interface GatewayChannelPinsUpdateDispatchData {
last_pin_timestamp?: string | null;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementModifyDispatchData = APIEntitlement;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementModifyDispatch = DataPayload<
| GatewayDispatchEvents.EntitlementCreate
| GatewayDispatchEvents.EntitlementUpdate
| GatewayDispatchEvents.EntitlementDelete,
GatewayEntitlementModifyDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
*/
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
*/
export type GatewayEntitlementCreateDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
*/
export type GatewayEntitlementUpdateDispatchData = GatewayEntitlementModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
*/
export type GatewayEntitlementUpdateDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementDeleteDispatchData = GatewayEntitlementModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementDeleteDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-update
*/
@@ -1420,7 +1474,10 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
/**
* https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove
*/
export type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
export type GatewayMessageReactionRemoveDispatch = ReactionData<
GatewayDispatchEvents.MessageReactionRemove,
'member' | 'message_author_id'
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove
@@ -1956,7 +2013,7 @@ export interface GatewayPresenceUpdateData {
/**
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure
*/
export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'type' | 'url'>;
export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'state' | 'type' | 'url'>;
// #endregion Sendable Payloads
@@ -2023,6 +2080,10 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
* See https://discord.com/developers/docs/resources/emoji#emoji-object
*/
emoji: APIEmoji;
/**
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
},
O
>

View File

@@ -1,7 +1,16 @@
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { APIRole, LocaleString } from '../../../v10.ts';
import type { APIAttachment, APIChannel, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel.ts';
import type {
APIAttachment,
APIChannel,
APIMessage,
APIPartialChannel,
APIThreadChannel,
ChannelType,
ThreadChannelType,
} from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIEntitlement } from '../monetization.ts';
import type { APIUser } from '../user.ts';
import type { InteractionType } from './responses.ts';
@@ -122,6 +131,10 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: LocaleString;
/**
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
*/
entitlements: APIEntitlement[];
}
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
@@ -136,14 +149,18 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
> &
Required<Pick<Original, 'member' | 'guild_id'>>;
export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> extends Required<APIPartialChannel> {
type: T;
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object
*/
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
thread_metadata?: APIThreadMetadata | null;
permissions: Permissions;
parent_id?: string | null;
}
export type APIInteractionDataResolvedChannel =
| APIInteractionDataResolvedChannelBase<Exclude<ChannelType, ThreadChannelType>>
| (APIInteractionDataResolvedChannelBase<ThreadChannelType> &
Pick<APIThreadChannel, 'thread_metadata' | 'parent_id'>);
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object

View File

@@ -24,7 +24,8 @@ export type APIInteractionResponse =
| APIInteractionResponseDeferredMessageUpdate
| APIInteractionResponseUpdateMessage
| APIApplicationCommandAutocompleteResponse
| APIModalInteractionResponse;
| APIModalInteractionResponse
| APIPremiumRequiredInteractionResponse;
export interface APIInteractionResponsePong {
type: InteractionResponseType.Pong;
@@ -40,6 +41,10 @@ export interface APIModalInteractionResponse {
data: APIModalInteractionResponseCallbackData;
}
export interface APIPremiumRequiredInteractionResponse {
type: InteractionResponseType.PremiumRequired;
}
export interface APIInteractionResponseChannelMessageWithSource {
type: InteractionResponseType.ChannelMessageWithSource;
data: APIInteractionResponseCallbackData;
@@ -91,6 +96,10 @@ export enum InteractionResponseType {
* Respond to an interaction with an modal for a user to fill-out
*/
Modal,
/**
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
*/
PremiumRequired,
}
/**

View File

@@ -4,6 +4,7 @@
import type { Permissions, Snowflake } from '../../globals.ts';
import type { LocalizationMap } from '../common.ts';
import type { APIPartialGuild } from './guild.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
@@ -40,6 +41,10 @@ export interface APIApplication {
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
*/
bot_require_code_grant: boolean;
/**
* Partial user object for the bot user associated with the application
*/
bot?: APIUser;
/**
* The url of the application's terms of service
*/
@@ -59,7 +64,7 @@ export interface APIApplication {
*
* @deprecated This field will be removed in v11
*/
summary: string;
summary: '';
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
@@ -76,6 +81,10 @@ export interface APIApplication {
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
*/
guild_id?: Snowflake;
/**
* A partial object of the associated guild
*/
guild?: APIPartialGuild;
/**
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
*/
@@ -95,7 +104,24 @@ export interface APIApplication {
*/
flags: ApplicationFlags;
/**
* Up to 5 tags describing the content and functionality of the application
* Approximate count of guilds the application has been added to
*/
approximate_guild_count?: number;
/**
* Array of redirect URIs for the application
*/
redirect_uris?: string[];
/**
* The interactions endpoint URL for the application
*/
interactions_endpoint_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
/**
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
*/
tags?: [string, string?, string?, string?, string?];
/**
@@ -106,11 +132,6 @@ export interface APIApplication {
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
}
export interface APIApplicationInstallParams {

View File

@@ -13,6 +13,7 @@ import type {
import type { APIChannel, APIOverwrite } from './channel.ts';
import type {
APIGuildIntegration,
APIGuildIntegrationType,
GuildDefaultMessageNotifications,
GuildExplicitContentFilter,
GuildMFALevel,
@@ -200,6 +201,9 @@ export enum AuditLogEvent {
AutoModerationBlockMessage,
AutoModerationFlagToChannel,
AutoModerationUserCommunicationDisabled,
CreatorMonetizationRequestCreated = 150,
CreatorMonetizationTermsAccepted,
}
/**
@@ -309,6 +313,15 @@ export interface APIAuditLogOptions {
* **Present only if the {@link APIAuditLogOptions#type entry type} is "0"**
*/
role_name?: string;
/**
* Type of integration which performed the action
*
* Present from:
* - MEMBER_KICK
* - MEMBER_ROLE_UPDATE
*/
integration_type?: APIGuildIntegrationType;
}
export enum AuditLogOptionsType {
@@ -722,22 +735,22 @@ export type APIAuditLogChangeKeyAvailable = AuditLogChangeData<'available', bool
*/
export type APIAuditLogChangeKeyGuildId = AuditLogChangeData<'guild_id', Snowflake>;
/*
/**
* Returned when a thread's archive status is changed
*/
export type APIAuditLogChangeKeyArchived = AuditLogChangeData<'archived', boolean>;
/*
/**
* Returned when a thread's lock status is changed
*/
export type APIAuditLogChangeKeyLocked = AuditLogChangeData<'locked', boolean>;
/*
/**
* Returned when a thread's auto archive duration is changed
*/
export type APIAuditLogChangeKeyAutoArchiveDuration = AuditLogChangeData<'auto_archive_duration', number>;
/*
/**
* Returned when a channel's default auto archive duration for newly created threads is changed
*/
export type APIAuditLogChangeKeyDefaultAutoArchiveDuration = AuditLogChangeData<

View File

@@ -6,7 +6,7 @@ import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIApplication } from './application.ts';
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
import type { APIMessageInteraction } from './interactions.ts';
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker, APIStickerItem } from './sticker.ts';
import type { APIUser } from './user.ts';
@@ -50,7 +50,8 @@ export type TextChannelType =
| ChannelType.GuildText
| ChannelType.GuildForum
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice;
| ChannelType.GuildStageVoice
| ChannelType.GuildMedia;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
@@ -124,7 +125,7 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
*/
default_thread_rate_limit_per_user?: number;
/**
* The channel topic (0-4096 characters for forum channels, 0-1024 characters for all others)
* The channel topic (0-4096 characters for thread-only channels, 0-1024 characters for all others)
*/
topic?: string | null;
}
@@ -205,12 +206,11 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
managed?: boolean;
}
export type ThreadChannelType = ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread;
export interface APIThreadChannel
extends Omit<
APITextBasedChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread>,
'name'
>,
APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
extends Omit<APITextBasedChannel<ThreadChannelType>, 'name'>,
APIGuildChannel<ThreadChannelType> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -240,7 +240,7 @@ export interface APIThreadChannel
*/
total_message_sent?: number;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel
* The IDs of the set of tags that have been applied to a thread in a thread-only channel
*/
applied_tags: Snowflake[];
}
@@ -317,25 +317,31 @@ export enum ForumLayoutType {
GalleryView,
}
export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia>
extends APIGuildTextChannel<T> {
/**
* The set of tags that can be used in a forum channel
* The set of tags that can be used in a thread-only channel
*/
available_tags: APIGuildForumTag[];
/**
* The emoji to show in the add reaction button on a thread in a forum channel
* The emoji to show in the add reaction button on a thread in a thread-only channel
*/
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
/**
* The default sort order type used to order posts in a forum channel
* The default sort order type used to order posts in a thread-only channel
*/
default_sort_order: SortOrderType | null;
}
export interface APIGuildForumChannel extends APIThreadOnlyChannel<ChannelType.GuildForum> {
/**
* 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;
}
export type APIGuildMediaChannel = APIThreadOnlyChannel<ChannelType.GuildMedia>;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
*/
@@ -348,7 +354,8 @@ export type APIChannel =
| APIGuildStageVoiceChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APIGuildForumChannel;
| APIGuildForumChannel
| APIGuildMediaChannel;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
@@ -410,6 +417,12 @@ export enum ChannelType {
* A channel that can only contain threads
*/
GuildForum,
/**
* A channel like forum channels but contains media for server subscriptions
*
* See https://creator-support.discord.com/hc/articles/14346342766743
*/
GuildMedia,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
@@ -665,11 +678,16 @@ export interface APIMessage {
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
*/
position?: number;
/**
* Data of the role subscription purchase or renewal that prompted this `ROLE_SUBSCRIPTION_PURCHASE` message
*/
role_subscription_data?: APIMessageRoleSubscriptionData;
/**
* Data for users, members, channels, and roles in the message's auto-populated select menus
*
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
resolved?: APIInteractionDataResolved;
}
/**
@@ -1332,6 +1350,20 @@ export interface APIAttachment {
* Base64 encoded bytearray representing a sampled waveform (currently for voice messages)
*/
waveform?: string;
/**
* Attachment flags combined as a bitfield
*/
flags?: AttachmentFlags;
}
/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags
*/
export enum AttachmentFlags {
/**
* This attachment has been edited using the remix feature on mobile
*/
IsRemix = 1 << 2,
}
/**
@@ -1584,6 +1616,20 @@ export interface APIBaseSelectMenuComponent<
disabled?: boolean;
}
export interface APIBaseAutoPopulatedSelectMenuComponent<
T extends
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect,
D extends SelectMenuDefaultValueType,
> extends APIBaseSelectMenuComponent<T> {
/**
* List of default values for auto-populated select menu components
*/
default_values?: APISelectMenuDefaultValue<D>[];
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
@@ -1597,28 +1643,61 @@ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<Com
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIUserSelectComponent = APIBaseSelectMenuComponent<ComponentType.UserSelect>;
export type APIUserSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.UserSelect,
SelectMenuDefaultValueType.User
>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIRoleSelectComponent = APIBaseSelectMenuComponent<ComponentType.RoleSelect>;
export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.RoleSelect,
SelectMenuDefaultValueType.Role
>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIMentionableSelectComponent = APIBaseSelectMenuComponent<ComponentType.MentionableSelect>;
export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.MentionableSelect,
SelectMenuDefaultValueType.User | SelectMenuDefaultValueType.Role
>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APIChannelSelectComponent extends APIBaseSelectMenuComponent<ComponentType.ChannelSelect> {
export interface APIChannelSelectComponent
extends APIBaseAutoPopulatedSelectMenuComponent<ComponentType.ChannelSelect, SelectMenuDefaultValueType.Channel> {
/**
* List of channel types to include in the ChannelSelect component
*/
channel_types?: ChannelType[];
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
*/
export enum SelectMenuDefaultValueType {
Channel = 'channel',
Role = 'role',
User = 'user',
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
*/
export interface APISelectMenuDefaultValue<T extends SelectMenuDefaultValueType> {
type: T;
id: Snowflake;
}
export type APIAutoPopulatedSelectMenuComponent =
| APIChannelSelectComponent
| APIMentionableSelectComponent
| APIRoleSelectComponent
| APIUserSelectComponent;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
@@ -1730,6 +1809,10 @@ export enum ChannelFlags {
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
IsScheduledForDeletion = 1 << 9,
/**
* Whether media download options are hidden.
*/
HideMediaDownloadOptions = 1 << 15,
}
/**

View File

@@ -79,7 +79,7 @@ export interface GatewayPresenceUpdate {
/**
* Either "idle", "dnd", "online", or "offline"
*/
status?: PresenceUpdateStatus;
status?: PresenceUpdateReceiveStatus;
/**
* User's current activities
*
@@ -94,6 +94,9 @@ export interface GatewayPresenceUpdate {
client_status?: GatewayPresenceClientStatus;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types
*/
export enum PresenceUpdateStatus {
Online = 'online',
DoNotDisturb = 'dnd',
@@ -105,6 +108,8 @@ export enum PresenceUpdateStatus {
Offline = 'offline',
}
export type PresenceUpdateReceiveStatus = Exclude<PresenceUpdateStatus, PresenceUpdateStatus.Invisible>;
/**
* https://discord.com/developers/docs/topics/gateway-events#client-status-object
*/
@@ -112,15 +117,15 @@ export interface GatewayPresenceClientStatus {
/**
* The user's status set for an active desktop (Windows, Linux, Mac) application session
*/
desktop?: PresenceUpdateStatus;
desktop?: PresenceUpdateReceiveStatus;
/**
* The user's status set for an active mobile (iOS, Android) application session
*/
mobile?: PresenceUpdateStatus;
mobile?: PresenceUpdateReceiveStatus;
/**
* The user's status set for an active web (browser, bot account) application session
*/
web?: PresenceUpdateStatus;
web?: PresenceUpdateReceiveStatus;
}
/**
@@ -176,7 +181,7 @@ export interface GatewayActivity {
*/
details?: string | null;
/**
* The user's current party status
* The user's current party status, or the text used for a custom status
*/
state?: string | null;
/**
@@ -261,7 +266,7 @@ export enum ActivityType {
*/
Watching,
/**
* {emoji} {details}
* {emoji} {state}
*/
Custom,
/**

View File

@@ -4,7 +4,7 @@
import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIEmoji, APIPartialEmoji } from './emoji.ts';
import type { PresenceUpdateStatus } from './gateway.ts';
import type { PresenceUpdateReceiveStatus } from './gateway.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker } from './sticker.ts';
@@ -427,7 +427,7 @@ export enum GuildFeature {
* Guild has enabled the role subscription promo page
*/
CreatorStorePage = 'CREATOR_STORE_PAGE',
/*
/**
* Guild has been set as a support server on the App Directory
*/
DeveloperSupportServer = 'DEVELOPER_SUPPORT_SERVER',
@@ -903,7 +903,7 @@ export interface APIGuildWidgetMember {
username: string;
discriminator: string;
avatar: string | null;
status: PresenceUpdateStatus;
status: PresenceUpdateReceiveStatus;
activity?: { name: string };
avatar_url: string;
}
@@ -1028,6 +1028,10 @@ export interface APIGuildOnboarding {
* Whether onboarding is enabled in the guild
*/
enabled: boolean;
/**
* Current mode of onboarding
*/
mode: GuildOnboardingMode;
}
/**
@@ -1095,6 +1099,20 @@ export interface APIGuildOnboardingPromptOption {
description: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-onboarding-object-onboarding-mode
*/
export enum GuildOnboardingMode {
/**
* Counts only Default Channels towards constraints
*/
OnboardingDefault,
/**
* Counts Default Channels and Questions towards constraints
*/
OnboardingAdvanced,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-onboarding-object-prompt-types
*/

View File

@@ -18,3 +18,4 @@ export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export * from './monetization.ts';

View File

@@ -0,0 +1,115 @@
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-structure
*/
export interface APIEntitlement {
/**
* ID of the entitlement
*/
id: Snowflake;
/**
* ID of the SKU
*/
sku_id: Snowflake;
/**
* ID of the user that is granted access to the entitlement's sku
*/
user_id?: Snowflake;
/**
* ID of the guild that is granted access to the entitlement's sku
*/
guild_id?: Snowflake;
/**
* ID of the parent application
*/
application_id: Snowflake;
/**
* Type of entitlement
*/
type: EntitlementType;
/**
* Whether the entitlement was deleted
*/
deleted: boolean;
/**
* Start date at which the entitlement is valid. Not present when using test entitlements.
*/
starts_at?: string;
/**
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
*/
ends_at?: string;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
*/
export enum EntitlementType {
/**
* Entitlement was purchased as an app subscription
*/
ApplicationSubscription = 8,
}
/**
* https://discord.com/developers/docs/monetization/skus#sku-object-sku-structure
*/
export interface APISKU {
/**
* ID of SKU
*/
id: Snowflake;
/**
* Type of SKU
*/
type: SKUType;
/**
* ID of the parent application
*/
application_id: Snowflake;
/**
* Customer-facing name of your premium offering
*/
name: string;
/**
* System-generated URL slug based on the SKU's name
*/
slug: string;
/**
* SKU flags combined as a bitfield
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
flags: SKUFlags;
}
/**
* https://discord.com/developers/docs/monetization/skus#sku-object-sku-flags
*/
export enum SKUFlags {
/**
* SKU is available for purchase
*/
Available = 1 << 2,
/**
* Recurring SKU that can be purchased by a user and applied to a single server.
* Grants access to every user in that server.
*/
GuildSubscription = 1 << 7,
/**
* Recurring SKU purchased by a user for themselves. Grants access to the purchasing user in every server.
*/
UserSubscription = 1 << 8,
}
export enum SKUType {
/**
* Represents a recurring subscription
*/
Subscription = 5,
/**
* System-generated group for each Subscription SKU created
*/
SubscriptionGroup = 6,
}

View File

@@ -54,6 +54,10 @@ export interface APIRole {
* The tags this role has
*/
tags?: APIRoleTags;
/**
* Role flags
*/
flags: RoleFlags;
}
/**
@@ -85,3 +89,13 @@ export interface APIRoleTags {
*/
guild_connections?: null;
}
/**
* https://discord.com/developers/docs/topics/permissions#role-object-role-flags
*/
export enum RoleFlags {
/**
* Role can be selected by members in an onboarding prompt
*/
InPrompt = 1 << 0,
}

View File

@@ -70,7 +70,7 @@ export interface APISticker {
*/
export enum StickerType {
/**
* An official sticker in a pack, part of Nitro or in a removed purchasable pack
* An official sticker in a pack
*/
Standard = 1,
/**

View File

@@ -43,6 +43,8 @@ export interface APITeamMember {
membership_state: TeamMemberMembershipState;
/**
* Will always be `["*"]`
*
* @deprecated Use `role` instead
*/
permissions: ['*'];
/**
@@ -55,6 +57,12 @@ export interface APITeamMember {
* See https://discord.com/developers/docs/resources/user#user-object
*/
user: APIUser;
/**
* The user's role in the team.
*
* See https://discord.com/developers/docs/topics/teams#team-member-roles
*/
role: TeamMemberRole;
}
/**
@@ -64,3 +72,12 @@ export enum TeamMemberMembershipState {
Invited = 1,
Accepted,
}
/**
* https://discord.com/developers/docs/topics/teams#team-member-roles-team-member-role-types
*/
export enum TeamMemberRole {
Admin = 'admin',
Developer = 'developer',
ReadOnly = 'read_only',
}

View File

@@ -83,6 +83,12 @@ export interface APIUser {
* See https://discord.com/developers/docs/resources/user#user-object-user-flags
*/
public_flags?: UserFlags;
/**
* The user's avatar decoration hash
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
avatar_decoration?: string | null;
}
/**
@@ -275,7 +281,11 @@ export enum ConnectionService {
Steam = 'steam',
TikTok = 'tiktok',
Twitch = 'twitch',
Twitter = 'twitter',
X = 'twitter',
/**
* @deprecated This is the old name for {@apilink ConnectionService#X}
*/
Twitter = X,
Xbox = 'xbox',
YouTube = 'youtube',
}

View File

@@ -1,7 +1,16 @@
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { APIRole, LocaleString } from '../../../v9.ts';
import type { APIAttachment, APIChannel, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel.ts';
import type {
APIAttachment,
APIChannel,
APIMessage,
APIPartialChannel,
APIThreadChannel,
ChannelType,
ThreadChannelType,
} from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIEntitlement } from '../monetization.ts';
import type { APIUser } from '../user.ts';
import type { InteractionType } from './responses.ts';
@@ -122,6 +131,10 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: LocaleString;
/**
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
*/
entitlements: APIEntitlement[];
}
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
@@ -136,14 +149,18 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
> &
Required<Pick<Original, 'member' | 'guild_id'>>;
export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> extends Required<APIPartialChannel> {
type: T;
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object
*/
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
thread_metadata?: APIThreadMetadata | null;
permissions: Permissions;
parent_id?: string | null;
}
export type APIInteractionDataResolvedChannel =
| APIInteractionDataResolvedChannelBase<Exclude<ChannelType, ThreadChannelType>>
| (APIInteractionDataResolvedChannelBase<ThreadChannelType> &
Pick<APIThreadChannel, 'thread_metadata' | 'parent_id'>);
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object

View File

@@ -24,7 +24,8 @@ export type APIInteractionResponse =
| APIInteractionResponseDeferredMessageUpdate
| APIInteractionResponseUpdateMessage
| APIApplicationCommandAutocompleteResponse
| APIModalInteractionResponse;
| APIModalInteractionResponse
| APIPremiumRequiredInteractionResponse;
export interface APIInteractionResponsePong {
type: InteractionResponseType.Pong;
@@ -40,6 +41,10 @@ export interface APIModalInteractionResponse {
data: APIModalInteractionResponseCallbackData;
}
export interface APIPremiumRequiredInteractionResponse {
type: InteractionResponseType.PremiumRequired;
}
export interface APIInteractionResponseChannelMessageWithSource {
type: InteractionResponseType.ChannelMessageWithSource;
data: APIInteractionResponseCallbackData;
@@ -91,6 +96,10 @@ export enum InteractionResponseType {
* Respond to an interaction with an modal for a user to fill-out
*/
Modal,
/**
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
*/
PremiumRequired,
}
/**

View File

@@ -4,6 +4,7 @@
import type { Permissions, Snowflake } from '../../globals.ts';
import type { LocalizationMap } from '../common.ts';
import type { APIPartialGuild } from './guild.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
@@ -40,6 +41,10 @@ export interface APIApplication {
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
*/
bot_require_code_grant: boolean;
/**
* Partial user object for the bot user associated with the application
*/
bot?: APIUser;
/**
* The url of the application's terms of service
*/
@@ -59,7 +64,7 @@ export interface APIApplication {
*
* @deprecated This field will be removed in v11
*/
summary: string;
summary: '';
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
@@ -76,6 +81,10 @@ export interface APIApplication {
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
*/
guild_id?: Snowflake;
/**
* A partial object of the associated guild
*/
guild?: APIPartialGuild;
/**
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
*/
@@ -95,7 +104,24 @@ export interface APIApplication {
*/
flags: ApplicationFlags;
/**
* Up to 5 tags describing the content and functionality of the application
* Approximate count of guilds the application has been added to
*/
approximate_guild_count?: number;
/**
* Array of redirect URIs for the application
*/
redirect_uris?: string[];
/**
* The interactions endpoint URL for the application
*/
interactions_endpoint_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
/**
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
*/
tags?: [string, string?, string?, string?, string?];
/**
@@ -106,11 +132,6 @@ export interface APIApplication {
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
}
export interface APIApplicationInstallParams {

View File

@@ -13,6 +13,7 @@ import type {
import type { APIChannel, APIOverwrite } from './channel.ts';
import type {
APIGuildIntegration,
APIGuildIntegrationType,
GuildDefaultMessageNotifications,
GuildExplicitContentFilter,
GuildMFALevel,
@@ -200,6 +201,9 @@ export enum AuditLogEvent {
AutoModerationBlockMessage,
AutoModerationFlagToChannel,
AutoModerationUserCommunicationDisabled,
CreatorMonetizationRequestCreated = 150,
CreatorMonetizationTermsAccepted,
}
/**
@@ -309,6 +313,15 @@ export interface APIAuditLogOptions {
* **Present only if the {@link APIAuditLogOptions#type entry type} is "0"**
*/
role_name?: string;
/**
* Type of integration which performed the action
*
* Present from:
* - MEMBER_KICK
* - MEMBER_ROLE_UPDATE
*/
integration_type?: APIGuildIntegrationType;
}
export enum AuditLogOptionsType {
@@ -722,22 +735,22 @@ export type APIAuditLogChangeKeyAvailable = AuditLogChangeData<'available', bool
*/
export type APIAuditLogChangeKeyGuildId = AuditLogChangeData<'guild_id', Snowflake>;
/*
/**
* Returned when a thread's archive status is changed
*/
export type APIAuditLogChangeKeyArchived = AuditLogChangeData<'archived', boolean>;
/*
/**
* Returned when a thread's lock status is changed
*/
export type APIAuditLogChangeKeyLocked = AuditLogChangeData<'locked', boolean>;
/*
/**
* Returned when a thread's auto archive duration is changed
*/
export type APIAuditLogChangeKeyAutoArchiveDuration = AuditLogChangeData<'auto_archive_duration', number>;
/*
/**
* Returned when a channel's default auto archive duration for newly created threads is changed
*/
export type APIAuditLogChangeKeyDefaultAutoArchiveDuration = AuditLogChangeData<

View File

@@ -6,7 +6,7 @@ import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIApplication } from './application.ts';
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
import type { APIMessageInteraction } from './interactions.ts';
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker, APIStickerItem } from './sticker.ts';
import type { APIUser } from './user.ts';
@@ -50,7 +50,8 @@ export type TextChannelType =
| ChannelType.GuildText
| ChannelType.GuildForum
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice;
| ChannelType.GuildStageVoice
| ChannelType.GuildMedia;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
@@ -124,7 +125,7 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
*/
default_thread_rate_limit_per_user?: number;
/**
* The channel topic (0-1024 characters)
* The channel topic (0-4096 characters for thread-only channels, 0-1024 characters for all others)
*/
topic?: string | null;
}
@@ -201,12 +202,11 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
managed?: boolean;
}
export type ThreadChannelType = ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread;
export interface APIThreadChannel
extends Omit<
APITextBasedChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread>,
'name'
>,
APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
extends Omit<APITextBasedChannel<ThreadChannelType>, 'name'>,
APIGuildChannel<ThreadChannelType> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -236,7 +236,7 @@ export interface APIThreadChannel
*/
total_message_sent?: number;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel
* The IDs of the set of tags that have been applied to a thread in a thread-only channel
*/
applied_tags: Snowflake[];
}
@@ -313,25 +313,31 @@ export enum ForumLayoutType {
GalleryView,
}
export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia>
extends APIGuildTextChannel<T> {
/**
* The set of tags that can be used in a forum channel
* The set of tags that can be used in a thread-only channel
*/
available_tags: APIGuildForumTag[];
/**
* The emoji to show in the add reaction button on a thread in a forum channel
* The emoji to show in the add reaction button on a thread in a thread-only channel
*/
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
/**
* The default sort order type used to order posts in a forum channel
* The default sort order type used to order posts in a thread-only channel
*/
default_sort_order: SortOrderType | null;
}
export interface APIGuildForumChannel extends APIThreadOnlyChannel<ChannelType.GuildForum> {
/**
* 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;
}
export type APIGuildMediaChannel = APIThreadOnlyChannel<ChannelType.GuildMedia>;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
*/
@@ -344,7 +350,8 @@ export type APIChannel =
| APIGuildStageVoiceChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APIGuildForumChannel;
| APIGuildForumChannel
| APIGuildMediaChannel;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
@@ -406,6 +413,12 @@ export enum ChannelType {
* A channel that can only contain threads
*/
GuildForum,
/**
* A channel like forum channels but contains media for server subscriptions
*
* See https://creator-support.discord.com/hc/articles/14346342766743
*/
GuildMedia,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS
/**
@@ -656,6 +669,12 @@ export interface APIMessage {
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
*/
position?: number;
/**
* Data for users, members, channels, and roles in the message's auto-populated select menus
*
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
resolved?: APIInteractionDataResolved;
}
/**
@@ -1300,6 +1319,20 @@ export interface APIAttachment {
* Base64 encoded bytearray representing a sampled waveform (currently for voice messages)
*/
waveform?: string;
/**
* Attachment flags combined as a bitfield
*/
flags?: AttachmentFlags;
}
/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags
*/
export enum AttachmentFlags {
/**
* This attachment has been edited using the remix feature on mobile
*/
IsRemix = 1 << 2,
}
/**
@@ -1552,6 +1585,20 @@ export interface APIBaseSelectMenuComponent<
disabled?: boolean;
}
export interface APIBaseAutoPopulatedSelectMenuComponent<
T extends
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect,
D extends SelectMenuDefaultValueType,
> extends APIBaseSelectMenuComponent<T> {
/**
* List of default values for auto-populated select menu components
*/
default_values?: APISelectMenuDefaultValue<D>[];
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
@@ -1565,28 +1612,61 @@ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<Com
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIUserSelectComponent = APIBaseSelectMenuComponent<ComponentType.UserSelect>;
export type APIUserSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.UserSelect,
SelectMenuDefaultValueType.User
>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIRoleSelectComponent = APIBaseSelectMenuComponent<ComponentType.RoleSelect>;
export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.RoleSelect,
SelectMenuDefaultValueType.Role
>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIMentionableSelectComponent = APIBaseSelectMenuComponent<ComponentType.MentionableSelect>;
export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.MentionableSelect,
SelectMenuDefaultValueType.User | SelectMenuDefaultValueType.Role
>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APIChannelSelectComponent extends APIBaseSelectMenuComponent<ComponentType.ChannelSelect> {
export interface APIChannelSelectComponent
extends APIBaseAutoPopulatedSelectMenuComponent<ComponentType.ChannelSelect, SelectMenuDefaultValueType.Channel> {
/**
* List of channel types to include in the ChannelSelect component
*/
channel_types?: ChannelType[];
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
*/
export enum SelectMenuDefaultValueType {
Channel = 'channel',
Role = 'role',
User = 'user',
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
*/
export interface APISelectMenuDefaultValue<T extends SelectMenuDefaultValueType> {
type: T;
id: Snowflake;
}
export type APIAutoPopulatedSelectMenuComponent =
| APIChannelSelectComponent
| APIMentionableSelectComponent
| APIRoleSelectComponent
| APIUserSelectComponent;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
@@ -1698,6 +1778,10 @@ export enum ChannelFlags {
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
IsScheduledForDeletion = 1 << 9,
/**
* Whether media download options are hidden.
*/
HideMediaDownloadOptions = 1 << 15,
}
/**

View File

@@ -79,7 +79,7 @@ export interface GatewayPresenceUpdate {
/**
* Either "idle", "dnd", "online", or "offline"
*/
status?: PresenceUpdateStatus;
status?: PresenceUpdateReceiveStatus;
/**
* User's current activities
*
@@ -94,6 +94,9 @@ export interface GatewayPresenceUpdate {
client_status?: GatewayPresenceClientStatus;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types
*/
export enum PresenceUpdateStatus {
Online = 'online',
DoNotDisturb = 'dnd',
@@ -105,6 +108,8 @@ export enum PresenceUpdateStatus {
Offline = 'offline',
}
export type PresenceUpdateReceiveStatus = Exclude<PresenceUpdateStatus, PresenceUpdateStatus.Invisible>;
/**
* https://discord.com/developers/docs/topics/gateway-events#client-status-object
*/
@@ -112,15 +117,15 @@ export interface GatewayPresenceClientStatus {
/**
* The user's status set for an active desktop (Windows, Linux, Mac) application session
*/
desktop?: PresenceUpdateStatus;
desktop?: PresenceUpdateReceiveStatus;
/**
* The user's status set for an active mobile (iOS, Android) application session
*/
mobile?: PresenceUpdateStatus;
mobile?: PresenceUpdateReceiveStatus;
/**
* The user's status set for an active web (browser, bot account) application session
*/
web?: PresenceUpdateStatus;
web?: PresenceUpdateReceiveStatus;
}
/**
@@ -167,7 +172,7 @@ export interface GatewayActivity {
*/
details?: string | null;
/**
* The user's current party status
* The user's current party status, or the text used for a custom status
*/
state?: string | null;
/**
@@ -249,7 +254,7 @@ export enum ActivityType {
*/
Watching,
/**
* {emoji} {details}
* {emoji} {state}
*/
Custom,
/**

View File

@@ -4,7 +4,7 @@
import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIEmoji, APIPartialEmoji } from './emoji.ts';
import type { PresenceUpdateStatus } from './gateway.ts';
import type { PresenceUpdateReceiveStatus } from './gateway.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker } from './sticker.ts';
@@ -419,7 +419,7 @@ export enum GuildFeature {
* Guild has enabled the role subscription promo page
*/
CreatorStorePage = 'CREATOR_STORE_PAGE',
/*
/**
* Guild has been set as a support server on the App Directory
*/
DeveloperSupportServer = 'DEVELOPER_SUPPORT_SERVER',
@@ -895,7 +895,7 @@ export interface APIGuildWidgetMember {
username: string;
discriminator: string;
avatar: string | null;
status: PresenceUpdateStatus;
status: PresenceUpdateReceiveStatus;
activity?: { name: string };
avatar_url: string;
}
@@ -1020,6 +1020,10 @@ export interface APIGuildOnboarding {
* Whether onboarding is enabled in the guild
*/
enabled: boolean;
/**
* Current mode of onboarding
*/
mode: GuildOnboardingMode;
}
/**
@@ -1087,6 +1091,20 @@ export interface APIGuildOnboardingPromptOption {
description: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-onboarding-object-onboarding-mode
*/
export enum GuildOnboardingMode {
/**
* Counts only Default Channels towards constraints
*/
OnboardingDefault,
/**
* Counts Default Channels and Questions towards constraints
*/
OnboardingAdvanced,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-onboarding-object-prompt-types
*/

View File

@@ -18,3 +18,4 @@ export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export * from './monetization.ts';

View File

@@ -0,0 +1,115 @@
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-structure
*/
export interface APIEntitlement {
/**
* ID of the entitlement
*/
id: Snowflake;
/**
* ID of the SKU
*/
sku_id: Snowflake;
/**
* ID of the user that is granted access to the entitlement's sku
*/
user_id?: Snowflake;
/**
* ID of the guild that is granted access to the entitlement's sku
*/
guild_id?: Snowflake;
/**
* ID of the parent application
*/
application_id: Snowflake;
/**
* Type of entitlement
*/
type: EntitlementType;
/**
* Whether the entitlement was deleted
*/
deleted: boolean;
/**
* Start date at which the entitlement is valid. Not present when using test entitlements.
*/
starts_at?: string;
/**
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
*/
ends_at?: string;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
*/
export enum EntitlementType {
/**
* Entitlement was purchased as an app subscription
*/
ApplicationSubscription = 8,
}
/**
* https://discord.com/developers/docs/monetization/skus#sku-object-sku-structure
*/
export interface APISKU {
/**
* ID of SKU
*/
id: Snowflake;
/**
* Type of SKU
*/
type: SKUType;
/**
* ID of the parent application
*/
application_id: Snowflake;
/**
* Customer-facing name of your premium offering
*/
name: string;
/**
* System-generated URL slug based on the SKU's name
*/
slug: string;
/**
* SKU flags combined as a bitfield
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
flags: SKUFlags;
}
/**
* https://discord.com/developers/docs/monetization/skus#sku-object-sku-flags
*/
export enum SKUFlags {
/**
* SKU is available for purchase
*/
Available = 1 << 2,
/**
* Recurring SKU that can be purchased by a user and applied to a single server.
* Grants access to every user in that server.
*/
GuildSubscription = 1 << 7,
/**
* Recurring SKU purchased by a user for themselves. Grants access to the purchasing user in every server.
*/
UserSubscription = 1 << 8,
}
export enum SKUType {
/**
* Represents a recurring subscription
*/
Subscription = 5,
/**
* System-generated group for each Subscription SKU created
*/
SubscriptionGroup = 6,
}

View File

@@ -54,6 +54,10 @@ export interface APIRole {
* The tags this role has
*/
tags?: APIRoleTags;
/**
* Role flags
*/
flags: RoleFlags;
}
/**
@@ -85,3 +89,13 @@ export interface APIRoleTags {
*/
guild_connections?: null;
}
/**
* https://discord.com/developers/docs/topics/permissions#role-object-role-flags
*/
export enum RoleFlags {
/**
* Role can be selected by members in an onboarding prompt
*/
InPrompt = 1 << 0,
}

View File

@@ -70,7 +70,7 @@ export interface APISticker {
*/
export enum StickerType {
/**
* An official sticker in a pack, part of Nitro or in a removed purchasable pack
* An official sticker in a pack
*/
Standard = 1,
/**

View File

@@ -43,6 +43,8 @@ export interface APITeamMember {
membership_state: TeamMemberMembershipState;
/**
* Will always be `["*"]`
*
* @deprecated Use `role` instead
*/
permissions: ['*'];
/**
@@ -55,6 +57,12 @@ export interface APITeamMember {
* See https://discord.com/developers/docs/resources/user#user-object
*/
user: APIUser;
/**
* The user's role in the team.
*
* See https://discord.com/developers/docs/topics/teams#team-member-roles
*/
role: TeamMemberRole;
}
/**
@@ -64,3 +72,12 @@ export enum TeamMemberMembershipState {
Invited = 1,
Accepted,
}
/**
* https://discord.com/developers/docs/topics/teams#team-member-roles-team-member-role-types
*/
export enum TeamMemberRole {
Admin = 'admin',
Developer = 'developer',
ReadOnly = 'read_only',
}

View File

@@ -83,6 +83,12 @@ export interface APIUser {
* See https://discord.com/developers/docs/resources/user#user-object-user-flags
*/
public_flags?: UserFlags;
/**
* The user's avatar decoration hash
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
avatar_decoration?: string | null;
}
/**
@@ -275,7 +281,11 @@ export enum ConnectionService {
Steam = 'steam',
TikTok = 'tiktok',
Twitch = 'twitch',
Twitter = 'twitter',
X = 'twitter',
/**
* @deprecated This is the old name for {@apilink ConnectionService#X}
*/
Twitter = X,
Xbox = 'xbox',
YouTube = 'youtube',
}

View File

@@ -154,6 +154,8 @@ export enum RESTJSONErrorCodes {
ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40_066,
TagRequiredToCreateAForumPostInThisChannel,
AnEntitlementHasAlreadyBeenGrantedForThisResource = 40_074,
MissingAccess = 50_001,
InvalidAccountType,
CannotExecuteActionOnDMChannel,
@@ -198,6 +200,8 @@ export enum RESTJSONErrorCodes {
CannotSelfRedeemThisGift = 50_054,
InvalidGuild,
InvalidSKU = 50_057,
InvalidRequestOrigin = 50_067,
InvalidMessageType,
@@ -285,6 +289,9 @@ export enum RESTJSONErrorCodes {
WebhookServicesCannotBeUsedInForumChannels,
MessageBlockedByHarmfulLinksFilter = 240_000,
CannotEnableOnboardingRequirementsAreNotMet = 350_000,
CannotUpdateOnboardingWhileBelowRequirements,
}
/**

View File

@@ -1,4 +1,5 @@
import type { APIApplicationRoleConnectionMetadata } from '../../payloads/v10/application.ts';
import type { APIApplication, APIApplicationRoleConnectionMetadata } from '../../payloads/v10/application.ts';
import type { Nullable, StrictPartial } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
@@ -14,3 +15,30 @@ export type RESTPutAPIApplicationRoleConnectionMetadataJSONBody = APIApplication
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
*/
export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];
/**
* https://discord.com/developers/docs/resources/application#get-current-application
*/
export type RESTGetCurrentApplicationResult = APIApplication;
/**
* https://discord.com/developers/docs/resources/application#edit-current-application
*/
export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
Pick<
APIApplication,
| 'custom_install_url'
| 'description'
| 'flags'
| 'role_connections_verification_url'
| 'install_params'
| 'interactions_endpoint_url'
| 'tags'
> &
Nullable<Pick<APIApplication, 'icon' | 'cover_image'>>
>;
/**
* https://discord.com/developers/docs/resources/application#edit-current-application
*/
export type RESTPatchCurrentApplicationResult = APIApplication;

View File

@@ -2,7 +2,6 @@ import type { Permissions, Snowflake } from '../../globals.ts';
import type {
APIActionRowComponent,
APIAllowedMentions,
APIAttachment,
APIChannel,
APIEmbed,
APIExtendedInvite,
@@ -18,11 +17,13 @@ import type {
MessageFlags,
OverwriteType,
ThreadAutoArchiveDuration,
ThreadChannelType,
VideoQualityMode,
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
ForumLayoutType,
ChannelFlags,
} from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
@@ -60,15 +61,15 @@ export interface RESTPatchAPIChannelJSONBody {
*/
position?: number | null | undefined;
/**
* 0-1024 character channel topic (0-4096 characters for forum channels)
* 0-1024 character channel topic (0-4096 characters for thread-only channels)
*
* Channel types: text, news, forum
* Channel types: text, news, forum, media
*/
topic?: string | null | undefined;
/**
* Whether the channel is nsfw
*
* Channel types: text, voice, news, forum
* Channel types: text, voice, news, forum, media
*/
nsfw?: boolean | null | undefined;
/**
@@ -76,7 +77,7 @@ export interface RESTPatchAPIChannelJSONBody {
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
* are unaffected
*
* Channel types: text, newsThread, publicThread, privateThread, forum
* Channel types: text, newsThread, publicThread, privateThread, forum, media
*/
rate_limit_per_user?: number | null | undefined;
/**
@@ -100,7 +101,7 @@ export interface RESTPatchAPIChannelJSONBody {
/**
* ID of the new parent category for a channel
*
* Channel types: text, voice, news
* Channel types: text, voice, news, stage, forum, media
*/
parent_id?: Snowflake | null | undefined;
/**
@@ -136,9 +137,19 @@ export interface RESTPatchAPIChannelJSONBody {
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*
* Channel types: text, news
* Channel types: text, news, forum, media
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
/**
* Channel flags combined as a bit field.
*/
flags?: ChannelFlags | undefined;
/**
* The set of tags that can be used in a thread-only channel; limited to 20
*
* Channel types: forum, media
*/
available_tags?: (Partial<APIGuildForumTag> & Pick<APIGuildForumTag, 'name'>)[] | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread
*
@@ -146,28 +157,22 @@ export interface RESTPatchAPIChannelJSONBody {
*/
invitable?: boolean | undefined;
/**
* The set of tags that can be used in a forum channel; limited to 20
* The emoji to show in the add reaction button on a thread in a thread-only channel
*
* Channel types: forum
*/
available_tags?: APIGuildForumTag[] | undefined;
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*
* Channel types: forum
* Channel types: forum, media
*/
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji | undefined;
/**
* 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
* Channel types: text, forum, media
*/
default_thread_rate_limit_per_user?: number | null | undefined;
/**
* The default sort order type used to order posts in a forum channel
* The default sort order type used to order posts in a thread-only channel
*
* Channel types: forum
* Channel types: forum, media
*/
default_sort_order?: SortOrderType | null | undefined;
/**
@@ -176,6 +181,12 @@ export interface RESTPatchAPIChannelJSONBody {
* Channel types: forum
*/
default_forum_layout?: ForumLayoutType | undefined;
/**
* The ids of the set of tags that have been applied to a thread-only channel; limited to 5
*
* Channel types: forum, media
*/
applied_tags?: Snowflake[] | undefined;
}
/**
@@ -235,6 +246,24 @@ export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
fail_if_not_exists?: boolean | undefined;
};
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
*/
export interface RESTAPIAttachment {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#create-message
*/
@@ -284,7 +313,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
/**
* Message flags combined as a bitfield
*/
@@ -328,7 +357,7 @@ export type RESTDeleteAPIChannelMessageOwnReaction = never;
*/
export type RESTDeleteAPIChannelMessageUserReactionResult = never;
/*
/**
* https://discord.com/developers/docs/resources/channel#get-reactions
*/
export interface RESTGetAPIChannelMessageReactionUsersQuery {
@@ -395,7 +424,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
/**
* The components to include with the message
*
@@ -614,25 +643,25 @@ export interface RESTPostAPIChannelMessagesThreadsJSONBody {
}
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel
*/
export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & {
/**
* First message in the forum thread
* The initial message of the thread
*/
message: RESTPostAPIChannelMessageJSONBody;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel; limited to 5
* The IDs of the set of tags to apply to the thread; limited to 5
*/
applied_tags?: Snowflake[] | undefined;
};
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel
*/
export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & {
/**
* First message in the forum thread
* The initial message of the thread
*/
message: string;
};
@@ -656,7 +685,7 @@ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMes
*
* @default ChannelType.PrivateThread
*/
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread | undefined;
type?: ThreadChannelType | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/
@@ -716,7 +745,7 @@ export interface RESTGetAPIChannelThreadMembersQuery {
*/
export type RESTGetAPIChannelThreadMembersResult = APIThreadMember[];
/*
/**
* https://discord.com/developers/docs/resources/channel#list-public-archived-threads
*/
export interface RESTGetAPIChannelThreadsArchivedQuery {

View File

@@ -24,8 +24,11 @@ import type {
GuildSystemChannelFlags,
GuildVerificationLevel,
GuildWidgetStyle,
APIGuildOnboardingPrompt,
APIGuildOnboardingPromptOption,
} from '../../payloads/v10/mod.ts';
import type {
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
DistributiveOmit,
DistributivePick,
Nullable,
@@ -449,7 +452,7 @@ export interface RESTPutAPIGuildMemberJSONBody {
deaf?: boolean | undefined;
}
export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-member
@@ -926,3 +929,48 @@ export type RESTPatchAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;
* https://discord.com/developers/docs/resources/guild#get-guild-onboarding
*/
export type RESTGetAPIGuildOnboardingResult = APIGuildOnboarding;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
*/
export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Pick<APIGuildOnboarding, 'default_channel_ids' | 'enabled' | 'mode'>>
> & {
/**
* Prompts shown during onboarding and in customize community
*/
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
};
export type RESTAPIModifyGuildOnboardingPromptData = Pick<APIGuildOnboardingPrompt, 'id' | 'title'> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPrompt, 'id' | 'title' | 'options' | 'guild_id'>>
> & {
/**
* Options available within the prompt
*/
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
};
export type RESTAPIModifyGuildOnboardingPromptOptionData = Pick<APIGuildOnboardingPromptOption, 'title'> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPromptOption, 'title' | 'emoji' | 'guild_id'>>
> & {
/**
* Emoji id
*/
emoji_id?: Snowflake | null | undefined;
/**
* Emoji name
*/
emoji_name?: string | null | undefined;
/**
* Whether this emoji is animated
*/
emoji_animated?: boolean | null | undefined;
};
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
*/
export type RESTPutAPIGuildOnboardingResult = APIGuildOnboarding;

View File

@@ -18,6 +18,7 @@ export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export * from './monetization.ts';
export const APIVersion = '10';
@@ -494,7 +495,7 @@ export const Routes = {
/**
* Route for:
* - GET `/channels/{channel.id}/users/@me/threads/archived/prviate`
* - GET `/channels/{channel.id}/users/@me/threads/archived/private`
*/
channelJoinedArchivedThreads(channelId: Snowflake) {
return `/channels/${channelId}/users/@me/threads/archived/private` as const;
@@ -830,6 +831,16 @@ export const Routes = {
* Route for:
* - GET `/sticker-packs`
*/
stickerPacks() {
return '/sticker-packs' as const;
},
/**
* Route for:
* - GET `/sticker-packs`
*
* @deprecated Use {@link Routes.stickerPacks} instead.
*/
nitroStickerPacks() {
return '/sticker-packs' as const;
},
@@ -883,10 +894,42 @@ export const Routes = {
/**
* Route for:
* - GET `/guilds/${guild.id}/onboarding`
* - PUT `/guilds/${guild.id}/onboarding`
*/
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
},
/**
* Route for:
* - GET `/applications/@me`
* - PATCH `/applications/@me`
*/
currentApplication() {
return '/applications/@me' as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/entitlements`
* - POST `/applications/{application.id}/entitlements`
*/
entitlements(applicationId: Snowflake) {
return `/applications/${applicationId}/entitlements` as const;
},
/**
* Route for:
* - DELETE `/applications/{application.id}/entitlements/{entitlement.id}`
*/
entitlement(applicationId: Snowflake, entitlementId: Snowflake) {
return `/applications/${applicationId}/entitlements/${entitlementId}` as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/skus`
*/
skus(applicationId: Snowflake) {
return `/applications/${applicationId}/skus` as const;
},
};
export const StickerPackApplicationId = '710982414301790216';
@@ -998,6 +1041,16 @@ export const CDNRoutes = {
return `/guilds/${guildId}/users/${userId}/avatars/${memberAvatar}.${format}` as const;
},
/**
* Route for:
* - GET `/avatar-decorations/{user.id}/{user.avatar_decoration}.png`
*
* This route supports the extension: PNG
*/
userAvatarDecoration(userId: Snowflake, userAvatarDecoration: string) {
return `/avatar-decorations/${userId}/${userAvatarDecoration}.png` as const;
},
/**
* Route for:
* - GET `/app-icons/{application.id}/{application.icon}.{png|jpeg|webp}`

View File

@@ -0,0 +1,85 @@
import type { Snowflake } from '../../globals.ts';
import type { APIEntitlement, APISKU } from '../../v10.ts';
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
*/
export interface RESTGetAPIEntitlementsQuery {
/**
* User ID to look up entitlements for
*/
user_id?: Snowflake | undefined;
/**
* Optional list of SKU IDs to check entitlements for
* Comma-delimited set of snowflakes
*/
sku_ids?: string | undefined;
/**
* Retrieve entitlements before this entitlement ID
*/
before?: Snowflake | undefined;
/**
* Retrieve entitlements after this entitlement ID
*/
after?: Snowflake | undefined;
/**
* Number of entitlements to return (1-100)
*
* @default 100
*/
limit?: number | undefined;
/**
* Guild ID to look up entitlements for
*/
guild_id?: Snowflake | undefined;
/**
* Whether ended entitlements should be omitted
*/
exclude_ended?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
*/
export type RESTGetAPIEntitlementsResult = APIEntitlement[];
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
*/
export interface RESTPostAPIEntitlementBody {
/**
* ID of the SKU to grant the entitlement to
*/
sku_id: Snowflake;
/**
* ID of the guild or user to grant the entitlement to
*/
owner_id: Snowflake;
/**
* The type of entitlement owner
*/
owner_type: EntitlementOwnerType;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
*/
export type RESTPostAPIEntitlementResult = Partial<Omit<APIEntitlement, 'starts_at' | 'ends_at'>>;
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
*/
export enum EntitlementOwnerType {
Guild = 1,
User,
}
/**
* https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement
*/
export type RESTDeleteAPIEntitlementResult = never;
/**
* https://discord.com/developers/docs/monetization/skus#list-skus
*/
export type RESTGetAPISKUsResult = APISKU[];

View File

@@ -23,6 +23,10 @@ export interface RESTPostAPIStageInstanceJSONBody {
* Notify @everyone that a stage instance has started
*/
send_start_notification?: boolean | undefined;
/**
* The guild scheduled event associated with this stage instance
*/
guild_scheduled_event_id?: Snowflake | undefined;
}
/**

View File

@@ -6,12 +6,19 @@ import type { APISticker, APIStickerPack } from '../../payloads/v10/mod.ts';
export type RESTGetAPIStickerResult = APISticker;
/**
* https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
*/
export interface RESTGetNitroStickerPacksResult {
export interface RESTGetStickerPacksResult {
sticker_packs: APIStickerPack[];
}
/**
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
*
* @deprecated Use `RESTGetStickerPacksResult` instead
*/
export type RESTGetNitroStickerPacksResult = RESTGetStickerPacksResult;
/**
* https://discord.com/developers/docs/resources/sticker#list-guild-stickers
*/

View File

@@ -5,11 +5,11 @@ import type {
APIEmbed,
APIMessage,
APIWebhook,
APIAttachment,
MessageFlags,
APIMessageActionRowComponent,
} from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals.ts';
import type { RESTAPIAttachment } from './channel.ts';
/**
* https://discord.com/developers/docs/resources/webhook#create-webhook
*/
@@ -139,7 +139,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
/**
* Message flags combined as a bitfield
*/
@@ -257,7 +257,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
};
/**

View File

@@ -454,7 +454,7 @@ export interface RESTPutAPIGuildMemberJSONBody {
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-member

View File

@@ -1,4 +1,5 @@
import type { APIApplicationRoleConnectionMetadata } from '../../payloads/v9/application.ts';
import type { APIApplication, APIApplicationRoleConnectionMetadata } from '../../payloads/v9/application.ts';
import type { StrictPartial, Nullable } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
@@ -14,3 +15,30 @@ export type RESTPutAPIApplicationRoleConnectionMetadataJSONBody = APIApplication
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
*/
export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];
/**
* https://discord.com/developers/docs/resources/application#get-current-application
*/
export type RESTGetCurrentApplicationResult = APIApplication;
/**
* https://discord.com/developers/docs/resources/application#edit-current-application
*/
export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
Pick<
APIApplication,
| 'custom_install_url'
| 'description'
| 'flags'
| 'role_connections_verification_url'
| 'install_params'
| 'interactions_endpoint_url'
| 'tags'
> &
Nullable<Pick<APIApplication, 'icon' | 'cover_image'>>
>;
/**
* https://discord.com/developers/docs/resources/application#edit-current-application
*/
export type RESTPatchCurrentApplicationResult = APIApplication;

View File

@@ -2,7 +2,6 @@ import type { Permissions, Snowflake } from '../../globals.ts';
import type {
APIActionRowComponent,
APIAllowedMentions,
APIAttachment,
APIChannel,
APIEmbed,
APIExtendedInvite,
@@ -18,11 +17,13 @@ import type {
MessageFlags,
OverwriteType,
ThreadAutoArchiveDuration,
ThreadChannelType,
VideoQualityMode,
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
ForumLayoutType,
ChannelFlags,
} from '../../payloads/v9/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
@@ -60,15 +61,15 @@ export interface RESTPatchAPIChannelJSONBody {
*/
position?: number | null | undefined;
/**
* 0-1024 character channel topic (0-4096 characters for forum channels)
* 0-1024 character channel topic (0-4096 characters for thread-only channels)
*
* Channel types: text, news, forum
* Channel types: text, news, forum, media
*/
topic?: string | null | undefined;
/**
* Whether the channel is nsfw
*
* Channel types: text, voice, news, forum
* Channel types: text, voice, news, forum, media
*/
nsfw?: boolean | null | undefined;
/**
@@ -76,7 +77,7 @@ export interface RESTPatchAPIChannelJSONBody {
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
* are unaffected
*
* Channel types: text, newsThread, publicThread, privateThread, forum
* Channel types: text, newsThread, publicThread, privateThread, forum, media
*/
rate_limit_per_user?: number | null | undefined;
/**
@@ -100,7 +101,7 @@ export interface RESTPatchAPIChannelJSONBody {
/**
* ID of the new parent category for a channel
*
* Channel types: text, voice, news
* Channel types: text, voice, news, stage, forum, media
*/
parent_id?: Snowflake | null | undefined;
/**
@@ -136,9 +137,19 @@ export interface RESTPatchAPIChannelJSONBody {
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*
* Channel types: text, news
* Channel types: text, news, forum, media
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
/**
* Channel flags combined as a bit field.
*/
flags?: ChannelFlags | undefined;
/**
* The set of tags that can be used in a thread-only channel; limited to 20
*
* Channel types: forum, media
*/
available_tags?: (Partial<APIGuildForumTag> & Pick<APIGuildForumTag, 'name'>)[] | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread
*
@@ -146,28 +157,22 @@ export interface RESTPatchAPIChannelJSONBody {
*/
invitable?: boolean | undefined;
/**
* The set of tags that can be used in a forum channel; limited to 20
* The emoji to show in the add reaction button on a thread in a thread-only channel
*
* Channel types: forum
*/
available_tags?: APIGuildForumTag[] | undefined;
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*
* Channel types: forum
* Channel types: forum, media
*/
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji | undefined;
/**
* 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
* Channel types: text, forum, media
*/
default_thread_rate_limit_per_user?: number | null | undefined;
/**
* The default sort order type used to order posts in a forum channel
* The default sort order type used to order posts in a thread-only channel
*
* Channel types: forum
* Channel types: forum, media
*/
default_sort_order?: SortOrderType | null | undefined;
/**
@@ -176,6 +181,12 @@ export interface RESTPatchAPIChannelJSONBody {
* Channel types: forum
*/
default_forum_layout?: ForumLayoutType | undefined;
/**
* The ids of the set of tags that have been applied to a thread-only channel; limited to 5
*
* Channel types: forum, media
*/
applied_tags?: Snowflake[] | undefined;
}
/**
@@ -235,6 +246,24 @@ export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
fail_if_not_exists?: boolean | undefined;
};
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
*/
export interface RESTAPIAttachment {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#create-message
*/
@@ -292,7 +321,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
/**
* Message flags combined as a bitfield
*/
@@ -336,7 +365,7 @@ export type RESTDeleteAPIChannelMessageOwnReaction = never;
*/
export type RESTDeleteAPIChannelMessageUserReactionResult = never;
/*
/**
* https://discord.com/developers/docs/resources/channel#get-reactions
*/
export interface RESTGetAPIChannelMessageReactionUsersQuery {
@@ -411,7 +440,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
/**
* The components to include with the message
*
@@ -630,25 +659,25 @@ export interface RESTPostAPIChannelMessagesThreadsJSONBody {
}
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel
*/
export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & {
/**
* First message in the forum thread
* The initial message of the thread
*/
message: RESTPostAPIChannelMessageJSONBody;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel; limited to 5
* The IDs of the set of tags to apply to the thread; limited to 5
*/
applied_tags?: Snowflake[] | undefined;
};
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel
*/
export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & {
/**
* First message in the forum thread
* The initial message of the thread
*/
message: string;
};
@@ -672,7 +701,7 @@ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMes
*
* @default ChannelType.PrivateThread
*/
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread | undefined;
type?: ThreadChannelType | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/
@@ -732,7 +761,7 @@ export interface RESTGetAPIChannelThreadMembersQuery {
*/
export type RESTGetAPIChannelThreadMembersResult = APIThreadMember[];
/*
/**
* https://discord.com/developers/docs/resources/channel#list-public-archived-threads
*/
export interface RESTGetAPIChannelThreadsArchivedQuery {

View File

@@ -24,8 +24,11 @@ import type {
GuildWidgetStyle,
APIDMChannel,
APIGroupDMChannel,
APIGuildOnboardingPrompt,
APIGuildOnboardingPromptOption,
} from '../../payloads/v9/mod.ts';
import type {
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
DistributiveOmit,
DistributivePick,
Nullable,
@@ -449,7 +452,7 @@ export interface RESTPutAPIGuildMemberJSONBody {
deaf?: boolean | undefined;
}
export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-member
@@ -932,3 +935,48 @@ export type RESTPatchAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;
* https://discord.com/developers/docs/resources/guild#get-guild-onboarding
*/
export type RESTGetAPIGuildOnboardingResult = APIGuildOnboarding;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
*/
export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Pick<APIGuildOnboarding, 'default_channel_ids' | 'enabled' | 'mode'>>
> & {
/**
* Prompts shown during onboarding and in customize community
*/
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
};
export type RESTAPIModifyGuildOnboardingPromptData = Pick<APIGuildOnboardingPrompt, 'id' | 'title'> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPrompt, 'id' | 'title' | 'options' | 'guild_id'>>
> & {
/**
* Options available within the prompt
*/
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
};
export type RESTAPIModifyGuildOnboardingPromptOptionData = Pick<APIGuildOnboardingPromptOption, 'title'> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPromptOption, 'title' | 'emoji' | 'guild_id'>>
> & {
/**
* Emoji id
*/
emoji_id?: Snowflake | null | undefined;
/**
* Emoji name
*/
emoji_name?: string | null | undefined;
/**
* Whether this emoji is animated
*/
emoji_animated?: boolean | null | undefined;
};
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
*/
export type RESTPutAPIGuildOnboardingResult = APIGuildOnboarding;

View File

@@ -18,6 +18,7 @@ export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export * from './monetization.ts';
export const APIVersion = '9';
@@ -503,7 +504,7 @@ export const Routes = {
/**
* Route for:
* - GET `/channels/{channel.id}/users/@me/threads/archived/prviate`
* - GET `/channels/{channel.id}/users/@me/threads/archived/private`
*/
channelJoinedArchivedThreads(channelId: Snowflake) {
return `/channels/${channelId}/users/@me/threads/archived/private` as const;
@@ -839,6 +840,16 @@ export const Routes = {
* Route for:
* - GET `/sticker-packs`
*/
stickerPacks() {
return '/sticker-packs' as const;
},
/**
* Route for:
* - GET `/sticker-packs`
*
* @deprecated Use {@link Routes.stickerPacks} instead.
*/
nitroStickerPacks() {
return '/sticker-packs' as const;
},
@@ -892,10 +903,42 @@ export const Routes = {
/**
* Route for:
* - GET `/guilds/${guild.id}/onboarding`
* - PUT `/guilds/${guild.id}/onboarding`
*/
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
},
/**
* Route for:
* - GET `/applications/@me`
* - PATCH `/applications/@me`
*/
currentApplication() {
return '/applications/@me' as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/entitlements`
* - POST `/applications/{application.id}/entitlements`
*/
entitlements(applicationId: Snowflake) {
return `/applications/${applicationId}/entitlements` as const;
},
/**
* Route for:
* - DELETE `/applications/{application.id}/entitlements/{entitlement.id}`
*/
entitlement(applicationId: Snowflake, entitlementId: Snowflake) {
return `/applications/${applicationId}/entitlements/${entitlementId}` as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/skus`
*/
skus(applicationId: Snowflake) {
return `/applications/${applicationId}/skus` as const;
},
};
export const StickerPackApplicationId = '710982414301790216';
@@ -1007,6 +1050,16 @@ export const CDNRoutes = {
return `/guilds/${guildId}/users/${userId}/avatars/${memberAvatar}.${format}` as const;
},
/**
* Route for:
* - GET `/avatar-decorations/{user.id}/{user.avatar_decoration}.png`
*
* This route supports the extension: PNG
*/
userAvatarDecoration(userId: Snowflake, userAvatarDecoration: string) {
return `/avatar-decorations/${userId}/${userAvatarDecoration}.png` as const;
},
/**
* Route for:
* - GET `/app-icons/{application.id}/{application.icon}.{png|jpeg|webp}`

View File

@@ -0,0 +1,85 @@
import type { Snowflake } from '../../globals.ts';
import type { APIEntitlement, APISKU } from '../../v10.ts';
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
*/
export interface RESTGetAPIEntitlementsQuery {
/**
* User ID to look up entitlements for
*/
user_id?: Snowflake | undefined;
/**
* Optional list of SKU IDs to check entitlements for
* Comma-delimited set of snowflakes
*/
sku_ids?: string | undefined;
/**
* Retrieve entitlements before this entitlement ID
*/
before?: Snowflake | undefined;
/**
* Retrieve entitlements after this entitlement ID
*/
after?: Snowflake | undefined;
/**
* Number of entitlements to return (1-100)
*
* @default 100
*/
limit?: number | undefined;
/**
* Guild ID to look up entitlements for
*/
guild_id?: Snowflake | undefined;
/**
* Whether ended entitlements should be omitted
*/
exclude_ended?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
*/
export type RESTGetAPIEntitlementsResult = APIEntitlement[];
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
*/
export interface RESTPostAPIEntitlementBody {
/**
* ID of the SKU to grant the entitlement to
*/
sku_id: Snowflake;
/**
* ID of the guild or user to grant the entitlement to
*/
owner_id: Snowflake;
/**
* The type of entitlement owner
*/
owner_type: EntitlementOwnerType;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
*/
export type RESTPostAPIEntitlementResult = Partial<Omit<APIEntitlement, 'starts_at' | 'ends_at'>>;
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
*/
export enum EntitlementOwnerType {
Guild = 1,
User,
}
/**
* https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement
*/
export type RESTDeleteAPIEntitlementResult = never;
/**
* https://discord.com/developers/docs/monetization/skus#list-skus
*/
export type RESTGetAPISKUsResult = APISKU[];

View File

@@ -23,6 +23,10 @@ export interface RESTPostAPIStageInstanceJSONBody {
* Notify @everyone that a stage instance has started
*/
send_start_notification?: boolean | undefined;
/**
* The guild scheduled event associated with this stage instance
*/
guild_scheduled_event_id?: Snowflake | undefined;
}
/**

View File

@@ -6,12 +6,19 @@ import type { APISticker, APIStickerPack } from '../../payloads/v9/mod.ts';
export type RESTGetAPIStickerResult = APISticker;
/**
* https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
*/
export interface RESTGetNitroStickerPacksResult {
export interface RESTGetStickerPacksResult {
sticker_packs: APIStickerPack[];
}
/**
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
*
* @deprecated Use `RESTGetStickerPacksResult` instead
*/
export type RESTGetNitroStickerPacksResult = RESTGetStickerPacksResult;
/**
* https://discord.com/developers/docs/resources/sticker#list-guild-stickers
*/

View File

@@ -5,11 +5,11 @@ import type {
APIEmbed,
APIMessage,
APIWebhook,
APIAttachment,
MessageFlags,
APIMessageActionRowComponent,
} from '../../payloads/v9/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals.ts';
import type { RESTAPIAttachment } from './channel.ts';
/**
* https://discord.com/developers/docs/resources/webhook#create-webhook
*/
@@ -139,7 +139,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
/**
* Message flags combined as a bitfield
*/
@@ -257,7 +257,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
};
/**

View File

@@ -33,6 +33,7 @@ import type {
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
APIAuditLogEntry,
APIEntitlement,
} from '../payloads/v10/index';
import type { Nullable } from '../utils/internals';
@@ -268,6 +269,9 @@ export enum GatewayDispatchEvents {
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
}
export type GatewaySendPayload =
@@ -341,7 +345,8 @@ export type GatewayDispatchPayload =
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch
| GatewayGuildAuditLogEntryCreateDispatch;
| GatewayGuildAuditLogEntryCreateDispatch
| GatewayEntitlementModifyDispatch;
// #region Dispatch Payloads
@@ -672,6 +677,55 @@ export interface GatewayChannelPinsUpdateDispatchData {
last_pin_timestamp?: string | null;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementModifyDispatchData = APIEntitlement;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementModifyDispatch = DataPayload<
| GatewayDispatchEvents.EntitlementCreate
| GatewayDispatchEvents.EntitlementUpdate
| GatewayDispatchEvents.EntitlementDelete,
GatewayEntitlementModifyDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
*/
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
*/
export type GatewayEntitlementCreateDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
*/
export type GatewayEntitlementUpdateDispatchData = GatewayEntitlementModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
*/
export type GatewayEntitlementUpdateDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementDeleteDispatchData = GatewayEntitlementModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementDeleteDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-create
*/
@@ -1421,7 +1475,10 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
/**
* https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove
*/
export type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
export type GatewayMessageReactionRemoveDispatch = ReactionData<
GatewayDispatchEvents.MessageReactionRemove,
'member' | 'message_author_id'
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove
@@ -1957,7 +2014,7 @@ export interface GatewayPresenceUpdateData {
/**
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure
*/
export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'type' | 'url'>;
export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'state' | 'type' | 'url'>;
// #endregion Sendable Payloads
@@ -2024,6 +2081,10 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
* See https://discord.com/developers/docs/resources/emoji#emoji-object
*/
emoji: APIEmoji;
/**
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
},
O
>

View File

@@ -35,6 +35,7 @@ import type {
APIAuditLogEntry,
} from '../payloads/v9/index';
import type { Nullable } from '../utils/internals';
import type { APIEntitlement } from '../v10';
export * from './common';
@@ -267,6 +268,9 @@ export enum GatewayDispatchEvents {
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
}
export type GatewaySendPayload =
@@ -340,7 +344,8 @@ export type GatewayDispatchPayload =
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch
| GatewayGuildAuditLogEntryCreateDispatch;
| GatewayGuildAuditLogEntryCreateDispatch
| GatewayEntitlementModifyDispatch;
// #region Dispatch Payloads
@@ -671,6 +676,55 @@ export interface GatewayChannelPinsUpdateDispatchData {
last_pin_timestamp?: string | null;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementModifyDispatchData = APIEntitlement;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementModifyDispatch = DataPayload<
| GatewayDispatchEvents.EntitlementCreate
| GatewayDispatchEvents.EntitlementUpdate
| GatewayDispatchEvents.EntitlementDelete,
GatewayEntitlementModifyDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
*/
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
*/
export type GatewayEntitlementCreateDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
*/
export type GatewayEntitlementUpdateDispatchData = GatewayEntitlementModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-update
*/
export type GatewayEntitlementUpdateDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementDeleteDispatchData = GatewayEntitlementModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-delete
*/
export type GatewayEntitlementDeleteDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-update
*/
@@ -1420,7 +1474,10 @@ export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDis
/**
* https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove
*/
export type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
export type GatewayMessageReactionRemoveDispatch = ReactionData<
GatewayDispatchEvents.MessageReactionRemove,
'member' | 'message_author_id'
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-reaction-remove
@@ -1956,7 +2013,7 @@ export interface GatewayPresenceUpdateData {
/**
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure
*/
export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'type' | 'url'>;
export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'state' | 'type' | 'url'>;
// #endregion Sendable Payloads
@@ -2023,6 +2080,10 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
* See https://discord.com/developers/docs/resources/emoji#emoji-object
*/
emoji: APIEmoji;
/**
* The id of the user that posted the message that was reacted to
*/
message_author_id?: Snowflake;
},
O
>

231
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "discord-api-types",
"version": "0.37.48",
"version": "0.37.63",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "discord-api-types",
"version": "0.37.48",
"version": "0.37.63",
"license": "MIT",
"devDependencies": {
"@babel/runtime-corejs3": "^7.18.0",
@@ -436,24 +436,96 @@
"dev": true
},
"node_modules/@babel/code-frame": {
"version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz",
"integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==",
"version": "7.22.13",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz",
"integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==",
"dev": true,
"dependencies": {
"@babel/highlight": "^7.18.6"
"@babel/highlight": "^7.22.13",
"chalk": "^2.4.2"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/generator": {
"version": "7.21.5",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.5.tgz",
"integrity": "sha512-SrKK/sRv8GesIW1bDagf9cCG38IOMYZusoe1dfg0D8aiUe3Amvoj1QtjTPAWcfrZFvIwlleLb0gxzQidL9w14w==",
"node_modules/@babel/code-frame/node_modules/ansi-styles": {
"version": "3.2.1",
"resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"dependencies": {
"@babel/types": "^7.21.5",
"color-convert": "^1.9.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/@babel/code-frame/node_modules/chalk": {
"version": "2.4.2",
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"dependencies": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/@babel/code-frame/node_modules/color-convert": {
"version": "1.9.3",
"resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"dependencies": {
"color-name": "1.1.3"
}
},
"node_modules/@babel/code-frame/node_modules/color-name": {
"version": "1.1.3",
"resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==",
"dev": true
},
"node_modules/@babel/code-frame/node_modules/escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==",
"dev": true,
"engines": {
"node": ">=0.8.0"
}
},
"node_modules/@babel/code-frame/node_modules/has-flag": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==",
"dev": true,
"engines": {
"node": ">=4"
}
},
"node_modules/@babel/code-frame/node_modules/supports-color": {
"version": "5.5.0",
"resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"dependencies": {
"has-flag": "^3.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/@babel/generator": {
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz",
"integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==",
"dev": true,
"dependencies": {
"@babel/types": "^7.23.0",
"@jridgewell/gen-mapping": "^0.3.2",
"@jridgewell/trace-mapping": "^0.3.17",
"jsesc": "^2.5.1"
@@ -462,20 +534,14 @@
"node": ">=6.9.0"
}
},
"node_modules/@babel/generator/node_modules/@jridgewell/sourcemap-codec": {
"version": "1.4.14",
"resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz",
"integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==",
"dev": true
},
"node_modules/@babel/generator/node_modules/@jridgewell/trace-mapping": {
"version": "0.3.18",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz",
"integrity": "sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA==",
"version": "0.3.20",
"resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.20.tgz",
"integrity": "sha512-R8LcPeWZol2zR8mmH3JeKQ6QRCFb7XgUhV9ZlGhHLGyg4wpPiPZNQOOWhFZhxKw8u//yTbNGI42Bx/3paXEQ+Q==",
"dev": true,
"dependencies": {
"@jridgewell/resolve-uri": "3.1.0",
"@jridgewell/sourcemap-codec": "1.4.14"
"@jridgewell/resolve-uri": "^3.1.0",
"@jridgewell/sourcemap-codec": "^1.4.14"
}
},
"node_modules/@babel/generator/node_modules/jsesc": {
@@ -491,77 +557,77 @@
}
},
"node_modules/@babel/helper-environment-visitor": {
"version": "7.21.5",
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.21.5.tgz",
"integrity": "sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ==",
"version": "7.22.20",
"resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz",
"integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-function-name": {
"version": "7.21.0",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz",
"integrity": "sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg==",
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz",
"integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==",
"dev": true,
"dependencies": {
"@babel/template": "^7.20.7",
"@babel/types": "^7.21.0"
"@babel/template": "^7.22.15",
"@babel/types": "^7.23.0"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-hoist-variables": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz",
"integrity": "sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q==",
"version": "7.22.5",
"resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz",
"integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==",
"dev": true,
"dependencies": {
"@babel/types": "^7.18.6"
"@babel/types": "^7.22.5"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-split-export-declaration": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz",
"integrity": "sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA==",
"version": "7.22.6",
"resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz",
"integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==",
"dev": true,
"dependencies": {
"@babel/types": "^7.18.6"
"@babel/types": "^7.22.5"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-string-parser": {
"version": "7.21.5",
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz",
"integrity": "sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w==",
"version": "7.22.5",
"resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz",
"integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/helper-validator-identifier": {
"version": "7.19.1",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz",
"integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==",
"version": "7.22.20",
"resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz",
"integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==",
"dev": true,
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/highlight": {
"version": "7.18.6",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz",
"integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==",
"version": "7.22.20",
"resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz",
"integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==",
"dev": true,
"dependencies": {
"@babel/helper-validator-identifier": "^7.18.6",
"chalk": "^2.0.0",
"@babel/helper-validator-identifier": "^7.22.20",
"chalk": "^2.4.2",
"js-tokens": "^4.0.0"
},
"engines": {
@@ -640,9 +706,9 @@
}
},
"node_modules/@babel/parser": {
"version": "7.21.5",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.5.tgz",
"integrity": "sha512-J+IxH2IsxV4HbnTrSWgMAQj0UEo61hDA4Ny8h8PCX0MLXiibqHbqIOVneqdocemSBc22VpBKxt4J6FQzy9HarQ==",
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz",
"integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==",
"dev": true,
"bin": {
"parser": "bin/babel-parser.js"
@@ -676,33 +742,33 @@
}
},
"node_modules/@babel/template": {
"version": "7.20.7",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.20.7.tgz",
"integrity": "sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw==",
"version": "7.22.15",
"resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz",
"integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.18.6",
"@babel/parser": "^7.20.7",
"@babel/types": "^7.20.7"
"@babel/code-frame": "^7.22.13",
"@babel/parser": "^7.22.15",
"@babel/types": "^7.22.15"
},
"engines": {
"node": ">=6.9.0"
}
},
"node_modules/@babel/traverse": {
"version": "7.21.5",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.5.tgz",
"integrity": "sha512-AhQoI3YjWi6u/y/ntv7k48mcrCXmus0t79J9qPNlk/lAsFlCiJ047RmbfMOawySTHtywXhbXgpx/8nXMYd+oFw==",
"version": "7.23.2",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz",
"integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==",
"dev": true,
"dependencies": {
"@babel/code-frame": "^7.21.4",
"@babel/generator": "^7.21.5",
"@babel/helper-environment-visitor": "^7.21.5",
"@babel/helper-function-name": "^7.21.0",
"@babel/helper-hoist-variables": "^7.18.6",
"@babel/helper-split-export-declaration": "^7.18.6",
"@babel/parser": "^7.21.5",
"@babel/types": "^7.21.5",
"@babel/code-frame": "^7.22.13",
"@babel/generator": "^7.23.0",
"@babel/helper-environment-visitor": "^7.22.20",
"@babel/helper-function-name": "^7.23.0",
"@babel/helper-hoist-variables": "^7.22.5",
"@babel/helper-split-export-declaration": "^7.22.6",
"@babel/parser": "^7.23.0",
"@babel/types": "^7.23.0",
"debug": "^4.1.0",
"globals": "^11.1.0"
},
@@ -720,13 +786,13 @@
}
},
"node_modules/@babel/types": {
"version": "7.21.5",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.5.tgz",
"integrity": "sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q==",
"version": "7.23.0",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz",
"integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==",
"dev": true,
"dependencies": {
"@babel/helper-string-parser": "^7.21.5",
"@babel/helper-validator-identifier": "^7.19.1",
"@babel/helper-string-parser": "^7.22.5",
"@babel/helper-validator-identifier": "^7.22.20",
"to-fast-properties": "^2.0.0"
},
"engines": {
@@ -7638,9 +7704,9 @@
}
},
"node_modules/postcss": {
"version": "8.4.23",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.23.tgz",
"integrity": "sha512-bQ3qMcpF6A/YjR55xtoTr0jGOlnPOKAIMdOWiv0EIT6HVPEaJiJB4NLljSbiHoC2RX7DN5Uvjtpbg1NPdwv1oA==",
"version": "8.4.31",
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz",
"integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==",
"dev": true,
"funding": [
{
@@ -9448,9 +9514,9 @@
}
},
"node_modules/vm2": {
"version": "3.9.16",
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.16.tgz",
"integrity": "sha512-3T9LscojNTxdOyG+e8gFeyBXkMlOBYDoF6dqZbj+MPVHi9x10UfiTAJIobuchRCp3QvC+inybTbMJIUrLsig0w==",
"version": "3.9.19",
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.19.tgz",
"integrity": "sha512-J637XF0DHDMV57R6JyVsTak7nIL8gy5KH4r1HiwWLf/4GBbb5MKL5y7LpmF4A8E2nR6XmzpmMFQ7V7ppPTmUQg==",
"dev": true,
"dependencies": {
"acorn": "^8.7.0",
@@ -9591,8 +9657,9 @@
}
},
"node_modules/word-wrap": {
"version": "1.2.3",
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz",
"integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==",
"dev": true,
"engines": {
"node": ">=0.10.0"

View File

@@ -1,6 +1,6 @@
{
"name": "discord-api-types",
"version": "0.37.48",
"version": "0.37.63",
"description": "Discord API typings that are kept up to date for use in bot library creation.",
"homepage": "https://discord-api-types.dev",
"exports": {

View File

@@ -1,7 +1,16 @@
import type { Permissions, Snowflake } from '../../../globals';
import type { APIRole, LocaleString } from '../../../v10';
import type { APIAttachment, APIChannel, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel';
import type {
APIAttachment,
APIChannel,
APIMessage,
APIPartialChannel,
APIThreadChannel,
ChannelType,
ThreadChannelType,
} from '../channel';
import type { APIGuildMember } from '../guild';
import type { APIEntitlement } from '../monetization';
import type { APIUser } from '../user';
import type { InteractionType } from './responses';
@@ -122,6 +131,10 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: LocaleString;
/**
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
*/
entitlements: APIEntitlement[];
}
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
@@ -136,14 +149,18 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
> &
Required<Pick<Original, 'member' | 'guild_id'>>;
export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> extends Required<APIPartialChannel> {
type: T;
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object
*/
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
thread_metadata?: APIThreadMetadata | null;
permissions: Permissions;
parent_id?: string | null;
}
export type APIInteractionDataResolvedChannel =
| APIInteractionDataResolvedChannelBase<Exclude<ChannelType, ThreadChannelType>>
| (APIInteractionDataResolvedChannelBase<ThreadChannelType> &
Pick<APIThreadChannel, 'thread_metadata' | 'parent_id'>);
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object

View File

@@ -24,7 +24,8 @@ export type APIInteractionResponse =
| APIInteractionResponseDeferredMessageUpdate
| APIInteractionResponseUpdateMessage
| APIApplicationCommandAutocompleteResponse
| APIModalInteractionResponse;
| APIModalInteractionResponse
| APIPremiumRequiredInteractionResponse;
export interface APIInteractionResponsePong {
type: InteractionResponseType.Pong;
@@ -40,6 +41,10 @@ export interface APIModalInteractionResponse {
data: APIModalInteractionResponseCallbackData;
}
export interface APIPremiumRequiredInteractionResponse {
type: InteractionResponseType.PremiumRequired;
}
export interface APIInteractionResponseChannelMessageWithSource {
type: InteractionResponseType.ChannelMessageWithSource;
data: APIInteractionResponseCallbackData;
@@ -91,6 +96,10 @@ export enum InteractionResponseType {
* Respond to an interaction with an modal for a user to fill-out
*/
Modal,
/**
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
*/
PremiumRequired,
}
/**

View File

@@ -4,6 +4,7 @@
import type { Permissions, Snowflake } from '../../globals';
import type { LocalizationMap } from '../common';
import type { APIPartialGuild } from './guild';
import type { OAuth2Scopes } from './oauth2';
import type { APITeam } from './teams';
import type { APIUser } from './user';
@@ -40,6 +41,10 @@ export interface APIApplication {
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
*/
bot_require_code_grant: boolean;
/**
* Partial user object for the bot user associated with the application
*/
bot?: APIUser;
/**
* The url of the application's terms of service
*/
@@ -59,7 +64,7 @@ export interface APIApplication {
*
* @deprecated This field will be removed in v11
*/
summary: string;
summary: '';
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
@@ -76,6 +81,10 @@ export interface APIApplication {
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
*/
guild_id?: Snowflake;
/**
* A partial object of the associated guild
*/
guild?: APIPartialGuild;
/**
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
*/
@@ -95,7 +104,24 @@ export interface APIApplication {
*/
flags: ApplicationFlags;
/**
* Up to 5 tags describing the content and functionality of the application
* Approximate count of guilds the application has been added to
*/
approximate_guild_count?: number;
/**
* Array of redirect URIs for the application
*/
redirect_uris?: string[];
/**
* The interactions endpoint URL for the application
*/
interactions_endpoint_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
/**
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
*/
tags?: [string, string?, string?, string?, string?];
/**
@@ -106,11 +132,6 @@ export interface APIApplication {
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
}
export interface APIApplicationInstallParams {

View File

@@ -13,6 +13,7 @@ import type {
import type { APIChannel, APIOverwrite } from './channel';
import type {
APIGuildIntegration,
APIGuildIntegrationType,
GuildDefaultMessageNotifications,
GuildExplicitContentFilter,
GuildMFALevel,
@@ -200,6 +201,9 @@ export enum AuditLogEvent {
AutoModerationBlockMessage,
AutoModerationFlagToChannel,
AutoModerationUserCommunicationDisabled,
CreatorMonetizationRequestCreated = 150,
CreatorMonetizationTermsAccepted,
}
/**
@@ -309,6 +313,15 @@ export interface APIAuditLogOptions {
* **Present only if the {@link APIAuditLogOptions#type entry type} is "0"**
*/
role_name?: string;
/**
* Type of integration which performed the action
*
* Present from:
* - MEMBER_KICK
* - MEMBER_ROLE_UPDATE
*/
integration_type?: APIGuildIntegrationType;
}
export enum AuditLogOptionsType {
@@ -722,22 +735,22 @@ export type APIAuditLogChangeKeyAvailable = AuditLogChangeData<'available', bool
*/
export type APIAuditLogChangeKeyGuildId = AuditLogChangeData<'guild_id', Snowflake>;
/*
/**
* Returned when a thread's archive status is changed
*/
export type APIAuditLogChangeKeyArchived = AuditLogChangeData<'archived', boolean>;
/*
/**
* Returned when a thread's lock status is changed
*/
export type APIAuditLogChangeKeyLocked = AuditLogChangeData<'locked', boolean>;
/*
/**
* Returned when a thread's auto archive duration is changed
*/
export type APIAuditLogChangeKeyAutoArchiveDuration = AuditLogChangeData<'auto_archive_duration', number>;
/*
/**
* Returned when a channel's default auto archive duration for newly created threads is changed
*/
export type APIAuditLogChangeKeyDefaultAutoArchiveDuration = AuditLogChangeData<

View File

@@ -6,7 +6,7 @@ import type { Permissions, Snowflake } from '../../globals';
import type { APIApplication } from './application';
import type { APIPartialEmoji } from './emoji';
import type { APIGuildMember } from './guild';
import type { APIMessageInteraction } from './interactions';
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions';
import type { APIRole } from './permissions';
import type { APISticker, APIStickerItem } from './sticker';
import type { APIUser } from './user';
@@ -50,7 +50,8 @@ export type TextChannelType =
| ChannelType.GuildText
| ChannelType.GuildForum
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice;
| ChannelType.GuildStageVoice
| ChannelType.GuildMedia;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
@@ -124,7 +125,7 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
*/
default_thread_rate_limit_per_user?: number;
/**
* The channel topic (0-4096 characters for forum channels, 0-1024 characters for all others)
* The channel topic (0-4096 characters for thread-only channels, 0-1024 characters for all others)
*/
topic?: string | null;
}
@@ -205,12 +206,11 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
managed?: boolean;
}
export type ThreadChannelType = ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread;
export interface APIThreadChannel
extends Omit<
APITextBasedChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread>,
'name'
>,
APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
extends Omit<APITextBasedChannel<ThreadChannelType>, 'name'>,
APIGuildChannel<ThreadChannelType> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -240,7 +240,7 @@ export interface APIThreadChannel
*/
total_message_sent?: number;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel
* The IDs of the set of tags that have been applied to a thread in a thread-only channel
*/
applied_tags: Snowflake[];
}
@@ -317,25 +317,31 @@ export enum ForumLayoutType {
GalleryView,
}
export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia>
extends APIGuildTextChannel<T> {
/**
* The set of tags that can be used in a forum channel
* The set of tags that can be used in a thread-only channel
*/
available_tags: APIGuildForumTag[];
/**
* The emoji to show in the add reaction button on a thread in a forum channel
* The emoji to show in the add reaction button on a thread in a thread-only channel
*/
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
/**
* The default sort order type used to order posts in a forum channel
* The default sort order type used to order posts in a thread-only channel
*/
default_sort_order: SortOrderType | null;
}
export interface APIGuildForumChannel extends APIThreadOnlyChannel<ChannelType.GuildForum> {
/**
* 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;
}
export type APIGuildMediaChannel = APIThreadOnlyChannel<ChannelType.GuildMedia>;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
*/
@@ -348,7 +354,8 @@ export type APIChannel =
| APIGuildStageVoiceChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APIGuildForumChannel;
| APIGuildForumChannel
| APIGuildMediaChannel;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
@@ -410,6 +417,12 @@ export enum ChannelType {
* A channel that can only contain threads
*/
GuildForum,
/**
* A channel like forum channels but contains media for server subscriptions
*
* See https://creator-support.discord.com/hc/articles/14346342766743
*/
GuildMedia,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
@@ -665,11 +678,16 @@ export interface APIMessage {
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
*/
position?: number;
/**
* Data of the role subscription purchase or renewal that prompted this `ROLE_SUBSCRIPTION_PURCHASE` message
*/
role_subscription_data?: APIMessageRoleSubscriptionData;
/**
* Data for users, members, channels, and roles in the message's auto-populated select menus
*
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
resolved?: APIInteractionDataResolved;
}
/**
@@ -1332,6 +1350,20 @@ export interface APIAttachment {
* Base64 encoded bytearray representing a sampled waveform (currently for voice messages)
*/
waveform?: string;
/**
* Attachment flags combined as a bitfield
*/
flags?: AttachmentFlags;
}
/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags
*/
export enum AttachmentFlags {
/**
* This attachment has been edited using the remix feature on mobile
*/
IsRemix = 1 << 2,
}
/**
@@ -1584,6 +1616,20 @@ export interface APIBaseSelectMenuComponent<
disabled?: boolean;
}
export interface APIBaseAutoPopulatedSelectMenuComponent<
T extends
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect,
D extends SelectMenuDefaultValueType,
> extends APIBaseSelectMenuComponent<T> {
/**
* List of default values for auto-populated select menu components
*/
default_values?: APISelectMenuDefaultValue<D>[];
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
@@ -1597,28 +1643,61 @@ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<Com
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIUserSelectComponent = APIBaseSelectMenuComponent<ComponentType.UserSelect>;
export type APIUserSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.UserSelect,
SelectMenuDefaultValueType.User
>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIRoleSelectComponent = APIBaseSelectMenuComponent<ComponentType.RoleSelect>;
export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.RoleSelect,
SelectMenuDefaultValueType.Role
>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIMentionableSelectComponent = APIBaseSelectMenuComponent<ComponentType.MentionableSelect>;
export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.MentionableSelect,
SelectMenuDefaultValueType.User | SelectMenuDefaultValueType.Role
>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APIChannelSelectComponent extends APIBaseSelectMenuComponent<ComponentType.ChannelSelect> {
export interface APIChannelSelectComponent
extends APIBaseAutoPopulatedSelectMenuComponent<ComponentType.ChannelSelect, SelectMenuDefaultValueType.Channel> {
/**
* List of channel types to include in the ChannelSelect component
*/
channel_types?: ChannelType[];
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
*/
export enum SelectMenuDefaultValueType {
Channel = 'channel',
Role = 'role',
User = 'user',
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
*/
export interface APISelectMenuDefaultValue<T extends SelectMenuDefaultValueType> {
type: T;
id: Snowflake;
}
export type APIAutoPopulatedSelectMenuComponent =
| APIChannelSelectComponent
| APIMentionableSelectComponent
| APIRoleSelectComponent
| APIUserSelectComponent;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
@@ -1730,6 +1809,10 @@ export enum ChannelFlags {
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
IsScheduledForDeletion = 1 << 9,
/**
* Whether media download options are hidden.
*/
HideMediaDownloadOptions = 1 << 15,
}
/**

View File

@@ -79,7 +79,7 @@ export interface GatewayPresenceUpdate {
/**
* Either "idle", "dnd", "online", or "offline"
*/
status?: PresenceUpdateStatus;
status?: PresenceUpdateReceiveStatus;
/**
* User's current activities
*
@@ -94,6 +94,9 @@ export interface GatewayPresenceUpdate {
client_status?: GatewayPresenceClientStatus;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types
*/
export enum PresenceUpdateStatus {
Online = 'online',
DoNotDisturb = 'dnd',
@@ -105,6 +108,8 @@ export enum PresenceUpdateStatus {
Offline = 'offline',
}
export type PresenceUpdateReceiveStatus = Exclude<PresenceUpdateStatus, PresenceUpdateStatus.Invisible>;
/**
* https://discord.com/developers/docs/topics/gateway-events#client-status-object
*/
@@ -112,15 +117,15 @@ export interface GatewayPresenceClientStatus {
/**
* The user's status set for an active desktop (Windows, Linux, Mac) application session
*/
desktop?: PresenceUpdateStatus;
desktop?: PresenceUpdateReceiveStatus;
/**
* The user's status set for an active mobile (iOS, Android) application session
*/
mobile?: PresenceUpdateStatus;
mobile?: PresenceUpdateReceiveStatus;
/**
* The user's status set for an active web (browser, bot account) application session
*/
web?: PresenceUpdateStatus;
web?: PresenceUpdateReceiveStatus;
}
/**
@@ -176,7 +181,7 @@ export interface GatewayActivity {
*/
details?: string | null;
/**
* The user's current party status
* The user's current party status, or the text used for a custom status
*/
state?: string | null;
/**
@@ -261,7 +266,7 @@ export enum ActivityType {
*/
Watching,
/**
* {emoji} {details}
* {emoji} {state}
*/
Custom,
/**

View File

@@ -4,7 +4,7 @@
import type { Permissions, Snowflake } from '../../globals';
import type { APIEmoji, APIPartialEmoji } from './emoji';
import type { PresenceUpdateStatus } from './gateway';
import type { PresenceUpdateReceiveStatus } from './gateway';
import type { OAuth2Scopes } from './oauth2';
import type { APIRole } from './permissions';
import type { APISticker } from './sticker';
@@ -427,7 +427,7 @@ export enum GuildFeature {
* Guild has enabled the role subscription promo page
*/
CreatorStorePage = 'CREATOR_STORE_PAGE',
/*
/**
* Guild has been set as a support server on the App Directory
*/
DeveloperSupportServer = 'DEVELOPER_SUPPORT_SERVER',
@@ -903,7 +903,7 @@ export interface APIGuildWidgetMember {
username: string;
discriminator: string;
avatar: string | null;
status: PresenceUpdateStatus;
status: PresenceUpdateReceiveStatus;
activity?: { name: string };
avatar_url: string;
}
@@ -1028,6 +1028,10 @@ export interface APIGuildOnboarding {
* Whether onboarding is enabled in the guild
*/
enabled: boolean;
/**
* Current mode of onboarding
*/
mode: GuildOnboardingMode;
}
/**
@@ -1095,6 +1099,20 @@ export interface APIGuildOnboardingPromptOption {
description: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-onboarding-object-onboarding-mode
*/
export enum GuildOnboardingMode {
/**
* Counts only Default Channels towards constraints
*/
OnboardingDefault,
/**
* Counts Default Channels and Questions towards constraints
*/
OnboardingAdvanced,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-onboarding-object-prompt-types
*/

View File

@@ -18,3 +18,4 @@ export * from './template';
export * from './user';
export * from './voice';
export * from './webhook';
export * from './monetization';

View File

@@ -0,0 +1,115 @@
import type { Snowflake } from '../../globals';
/**
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-structure
*/
export interface APIEntitlement {
/**
* ID of the entitlement
*/
id: Snowflake;
/**
* ID of the SKU
*/
sku_id: Snowflake;
/**
* ID of the user that is granted access to the entitlement's sku
*/
user_id?: Snowflake;
/**
* ID of the guild that is granted access to the entitlement's sku
*/
guild_id?: Snowflake;
/**
* ID of the parent application
*/
application_id: Snowflake;
/**
* Type of entitlement
*/
type: EntitlementType;
/**
* Whether the entitlement was deleted
*/
deleted: boolean;
/**
* Start date at which the entitlement is valid. Not present when using test entitlements.
*/
starts_at?: string;
/**
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
*/
ends_at?: string;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
*/
export enum EntitlementType {
/**
* Entitlement was purchased as an app subscription
*/
ApplicationSubscription = 8,
}
/**
* https://discord.com/developers/docs/monetization/skus#sku-object-sku-structure
*/
export interface APISKU {
/**
* ID of SKU
*/
id: Snowflake;
/**
* Type of SKU
*/
type: SKUType;
/**
* ID of the parent application
*/
application_id: Snowflake;
/**
* Customer-facing name of your premium offering
*/
name: string;
/**
* System-generated URL slug based on the SKU's name
*/
slug: string;
/**
* SKU flags combined as a bitfield
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
flags: SKUFlags;
}
/**
* https://discord.com/developers/docs/monetization/skus#sku-object-sku-flags
*/
export enum SKUFlags {
/**
* SKU is available for purchase
*/
Available = 1 << 2,
/**
* Recurring SKU that can be purchased by a user and applied to a single server.
* Grants access to every user in that server.
*/
GuildSubscription = 1 << 7,
/**
* Recurring SKU purchased by a user for themselves. Grants access to the purchasing user in every server.
*/
UserSubscription = 1 << 8,
}
export enum SKUType {
/**
* Represents a recurring subscription
*/
Subscription = 5,
/**
* System-generated group for each Subscription SKU created
*/
SubscriptionGroup = 6,
}

View File

@@ -54,6 +54,10 @@ export interface APIRole {
* The tags this role has
*/
tags?: APIRoleTags;
/**
* Role flags
*/
flags: RoleFlags;
}
/**
@@ -85,3 +89,13 @@ export interface APIRoleTags {
*/
guild_connections?: null;
}
/**
* https://discord.com/developers/docs/topics/permissions#role-object-role-flags
*/
export enum RoleFlags {
/**
* Role can be selected by members in an onboarding prompt
*/
InPrompt = 1 << 0,
}

View File

@@ -70,7 +70,7 @@ export interface APISticker {
*/
export enum StickerType {
/**
* An official sticker in a pack, part of Nitro or in a removed purchasable pack
* An official sticker in a pack
*/
Standard = 1,
/**

View File

@@ -43,6 +43,8 @@ export interface APITeamMember {
membership_state: TeamMemberMembershipState;
/**
* Will always be `["*"]`
*
* @deprecated Use `role` instead
*/
permissions: ['*'];
/**
@@ -55,6 +57,12 @@ export interface APITeamMember {
* See https://discord.com/developers/docs/resources/user#user-object
*/
user: APIUser;
/**
* The user's role in the team.
*
* See https://discord.com/developers/docs/topics/teams#team-member-roles
*/
role: TeamMemberRole;
}
/**
@@ -64,3 +72,12 @@ export enum TeamMemberMembershipState {
Invited = 1,
Accepted,
}
/**
* https://discord.com/developers/docs/topics/teams#team-member-roles-team-member-role-types
*/
export enum TeamMemberRole {
Admin = 'admin',
Developer = 'developer',
ReadOnly = 'read_only',
}

View File

@@ -83,6 +83,12 @@ export interface APIUser {
* See https://discord.com/developers/docs/resources/user#user-object-user-flags
*/
public_flags?: UserFlags;
/**
* The user's avatar decoration hash
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
avatar_decoration?: string | null;
}
/**
@@ -275,7 +281,11 @@ export enum ConnectionService {
Steam = 'steam',
TikTok = 'tiktok',
Twitch = 'twitch',
Twitter = 'twitter',
X = 'twitter',
/**
* @deprecated This is the old name for {@apilink ConnectionService#X}
*/
Twitter = X,
Xbox = 'xbox',
YouTube = 'youtube',
}

View File

@@ -1,7 +1,16 @@
import type { Permissions, Snowflake } from '../../../globals';
import type { APIRole, LocaleString } from '../../../v9';
import type { APIAttachment, APIChannel, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel';
import type {
APIAttachment,
APIChannel,
APIMessage,
APIPartialChannel,
APIThreadChannel,
ChannelType,
ThreadChannelType,
} from '../channel';
import type { APIGuildMember } from '../guild';
import type { APIEntitlement } from '../monetization';
import type { APIUser } from '../user';
import type { InteractionType } from './responses';
@@ -122,6 +131,10 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: LocaleString;
/**
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
*/
entitlements: APIEntitlement[];
}
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
@@ -136,14 +149,18 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
> &
Required<Pick<Original, 'member' | 'guild_id'>>;
export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> extends Required<APIPartialChannel> {
type: T;
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object
*/
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
thread_metadata?: APIThreadMetadata | null;
permissions: Permissions;
parent_id?: string | null;
}
export type APIInteractionDataResolvedChannel =
| APIInteractionDataResolvedChannelBase<Exclude<ChannelType, ThreadChannelType>>
| (APIInteractionDataResolvedChannelBase<ThreadChannelType> &
Pick<APIThreadChannel, 'thread_metadata' | 'parent_id'>);
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object

View File

@@ -24,7 +24,8 @@ export type APIInteractionResponse =
| APIInteractionResponseDeferredMessageUpdate
| APIInteractionResponseUpdateMessage
| APIApplicationCommandAutocompleteResponse
| APIModalInteractionResponse;
| APIModalInteractionResponse
| APIPremiumRequiredInteractionResponse;
export interface APIInteractionResponsePong {
type: InteractionResponseType.Pong;
@@ -40,6 +41,10 @@ export interface APIModalInteractionResponse {
data: APIModalInteractionResponseCallbackData;
}
export interface APIPremiumRequiredInteractionResponse {
type: InteractionResponseType.PremiumRequired;
}
export interface APIInteractionResponseChannelMessageWithSource {
type: InteractionResponseType.ChannelMessageWithSource;
data: APIInteractionResponseCallbackData;
@@ -91,6 +96,10 @@ export enum InteractionResponseType {
* Respond to an interaction with an modal for a user to fill-out
*/
Modal,
/**
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
*/
PremiumRequired,
}
/**

View File

@@ -4,6 +4,7 @@
import type { Permissions, Snowflake } from '../../globals';
import type { LocalizationMap } from '../common';
import type { APIPartialGuild } from './guild';
import type { OAuth2Scopes } from './oauth2';
import type { APITeam } from './teams';
import type { APIUser } from './user';
@@ -40,6 +41,10 @@ export interface APIApplication {
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
*/
bot_require_code_grant: boolean;
/**
* Partial user object for the bot user associated with the application
*/
bot?: APIUser;
/**
* The url of the application's terms of service
*/
@@ -59,7 +64,7 @@ export interface APIApplication {
*
* @deprecated This field will be removed in v11
*/
summary: string;
summary: '';
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
@@ -76,6 +81,10 @@ export interface APIApplication {
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
*/
guild_id?: Snowflake;
/**
* A partial object of the associated guild
*/
guild?: APIPartialGuild;
/**
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
*/
@@ -95,7 +104,24 @@ export interface APIApplication {
*/
flags: ApplicationFlags;
/**
* Up to 5 tags describing the content and functionality of the application
* Approximate count of guilds the application has been added to
*/
approximate_guild_count?: number;
/**
* Array of redirect URIs for the application
*/
redirect_uris?: string[];
/**
* The interactions endpoint URL for the application
*/
interactions_endpoint_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
/**
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
*/
tags?: [string, string?, string?, string?, string?];
/**
@@ -106,11 +132,6 @@ export interface APIApplication {
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
}
export interface APIApplicationInstallParams {

View File

@@ -13,6 +13,7 @@ import type {
import type { APIChannel, APIOverwrite } from './channel';
import type {
APIGuildIntegration,
APIGuildIntegrationType,
GuildDefaultMessageNotifications,
GuildExplicitContentFilter,
GuildMFALevel,
@@ -200,6 +201,9 @@ export enum AuditLogEvent {
AutoModerationBlockMessage,
AutoModerationFlagToChannel,
AutoModerationUserCommunicationDisabled,
CreatorMonetizationRequestCreated = 150,
CreatorMonetizationTermsAccepted,
}
/**
@@ -309,6 +313,15 @@ export interface APIAuditLogOptions {
* **Present only if the {@link APIAuditLogOptions#type entry type} is "0"**
*/
role_name?: string;
/**
* Type of integration which performed the action
*
* Present from:
* - MEMBER_KICK
* - MEMBER_ROLE_UPDATE
*/
integration_type?: APIGuildIntegrationType;
}
export enum AuditLogOptionsType {
@@ -722,22 +735,22 @@ export type APIAuditLogChangeKeyAvailable = AuditLogChangeData<'available', bool
*/
export type APIAuditLogChangeKeyGuildId = AuditLogChangeData<'guild_id', Snowflake>;
/*
/**
* Returned when a thread's archive status is changed
*/
export type APIAuditLogChangeKeyArchived = AuditLogChangeData<'archived', boolean>;
/*
/**
* Returned when a thread's lock status is changed
*/
export type APIAuditLogChangeKeyLocked = AuditLogChangeData<'locked', boolean>;
/*
/**
* Returned when a thread's auto archive duration is changed
*/
export type APIAuditLogChangeKeyAutoArchiveDuration = AuditLogChangeData<'auto_archive_duration', number>;
/*
/**
* Returned when a channel's default auto archive duration for newly created threads is changed
*/
export type APIAuditLogChangeKeyDefaultAutoArchiveDuration = AuditLogChangeData<

View File

@@ -6,7 +6,7 @@ import type { Permissions, Snowflake } from '../../globals';
import type { APIApplication } from './application';
import type { APIPartialEmoji } from './emoji';
import type { APIGuildMember } from './guild';
import type { APIMessageInteraction } from './interactions';
import type { APIInteractionDataResolved, APIMessageInteraction } from './interactions';
import type { APIRole } from './permissions';
import type { APISticker, APIStickerItem } from './sticker';
import type { APIUser } from './user';
@@ -50,7 +50,8 @@ export type TextChannelType =
| ChannelType.GuildText
| ChannelType.GuildForum
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice;
| ChannelType.GuildStageVoice
| ChannelType.GuildMedia;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
@@ -124,7 +125,7 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
*/
default_thread_rate_limit_per_user?: number;
/**
* The channel topic (0-1024 characters)
* The channel topic (0-4096 characters for thread-only channels, 0-1024 characters for all others)
*/
topic?: string | null;
}
@@ -201,12 +202,11 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
managed?: boolean;
}
export type ThreadChannelType = ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread;
export interface APIThreadChannel
extends Omit<
APITextBasedChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread>,
'name'
>,
APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
extends Omit<APITextBasedChannel<ThreadChannelType>, 'name'>,
APIGuildChannel<ThreadChannelType> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -236,7 +236,7 @@ export interface APIThreadChannel
*/
total_message_sent?: number;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel
* The IDs of the set of tags that have been applied to a thread in a thread-only channel
*/
applied_tags: Snowflake[];
}
@@ -313,25 +313,31 @@ export enum ForumLayoutType {
GalleryView,
}
export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia>
extends APIGuildTextChannel<T> {
/**
* The set of tags that can be used in a forum channel
* The set of tags that can be used in a thread-only channel
*/
available_tags: APIGuildForumTag[];
/**
* The emoji to show in the add reaction button on a thread in a forum channel
* The emoji to show in the add reaction button on a thread in a thread-only channel
*/
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
/**
* The default sort order type used to order posts in a forum channel
* The default sort order type used to order posts in a thread-only channel
*/
default_sort_order: SortOrderType | null;
}
export interface APIGuildForumChannel extends APIThreadOnlyChannel<ChannelType.GuildForum> {
/**
* 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;
}
export type APIGuildMediaChannel = APIThreadOnlyChannel<ChannelType.GuildMedia>;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
*/
@@ -344,7 +350,8 @@ export type APIChannel =
| APIGuildStageVoiceChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APIGuildForumChannel;
| APIGuildForumChannel
| APIGuildMediaChannel;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
@@ -406,6 +413,12 @@ export enum ChannelType {
* A channel that can only contain threads
*/
GuildForum,
/**
* A channel like forum channels but contains media for server subscriptions
*
* See https://creator-support.discord.com/hc/articles/14346342766743
*/
GuildMedia,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS
/**
@@ -656,6 +669,12 @@ export interface APIMessage {
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
*/
position?: number;
/**
* Data for users, members, channels, and roles in the message's auto-populated select menus
*
* See https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
resolved?: APIInteractionDataResolved;
}
/**
@@ -1300,6 +1319,20 @@ export interface APIAttachment {
* Base64 encoded bytearray representing a sampled waveform (currently for voice messages)
*/
waveform?: string;
/**
* Attachment flags combined as a bitfield
*/
flags?: AttachmentFlags;
}
/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure-attachment-flags
*/
export enum AttachmentFlags {
/**
* This attachment has been edited using the remix feature on mobile
*/
IsRemix = 1 << 2,
}
/**
@@ -1552,6 +1585,20 @@ export interface APIBaseSelectMenuComponent<
disabled?: boolean;
}
export interface APIBaseAutoPopulatedSelectMenuComponent<
T extends
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect,
D extends SelectMenuDefaultValueType,
> extends APIBaseSelectMenuComponent<T> {
/**
* List of default values for auto-populated select menu components
*/
default_values?: APISelectMenuDefaultValue<D>[];
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
@@ -1565,28 +1612,61 @@ export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<Com
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIUserSelectComponent = APIBaseSelectMenuComponent<ComponentType.UserSelect>;
export type APIUserSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.UserSelect,
SelectMenuDefaultValueType.User
>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIRoleSelectComponent = APIBaseSelectMenuComponent<ComponentType.RoleSelect>;
export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.RoleSelect,
SelectMenuDefaultValueType.Role
>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIMentionableSelectComponent = APIBaseSelectMenuComponent<ComponentType.MentionableSelect>;
export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.MentionableSelect,
SelectMenuDefaultValueType.User | SelectMenuDefaultValueType.Role
>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APIChannelSelectComponent extends APIBaseSelectMenuComponent<ComponentType.ChannelSelect> {
export interface APIChannelSelectComponent
extends APIBaseAutoPopulatedSelectMenuComponent<ComponentType.ChannelSelect, SelectMenuDefaultValueType.Channel> {
/**
* List of channel types to include in the ChannelSelect component
*/
channel_types?: ChannelType[];
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
*/
export enum SelectMenuDefaultValueType {
Channel = 'channel',
Role = 'role',
User = 'user',
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-default-value-structure
*/
export interface APISelectMenuDefaultValue<T extends SelectMenuDefaultValueType> {
type: T;
id: Snowflake;
}
export type APIAutoPopulatedSelectMenuComponent =
| APIChannelSelectComponent
| APIMentionableSelectComponent
| APIRoleSelectComponent
| APIUserSelectComponent;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
@@ -1698,6 +1778,10 @@ export enum ChannelFlags {
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
IsScheduledForDeletion = 1 << 9,
/**
* Whether media download options are hidden.
*/
HideMediaDownloadOptions = 1 << 15,
}
/**

View File

@@ -79,7 +79,7 @@ export interface GatewayPresenceUpdate {
/**
* Either "idle", "dnd", "online", or "offline"
*/
status?: PresenceUpdateStatus;
status?: PresenceUpdateReceiveStatus;
/**
* User's current activities
*
@@ -94,6 +94,9 @@ export interface GatewayPresenceUpdate {
client_status?: GatewayPresenceClientStatus;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types
*/
export enum PresenceUpdateStatus {
Online = 'online',
DoNotDisturb = 'dnd',
@@ -105,6 +108,8 @@ export enum PresenceUpdateStatus {
Offline = 'offline',
}
export type PresenceUpdateReceiveStatus = Exclude<PresenceUpdateStatus, PresenceUpdateStatus.Invisible>;
/**
* https://discord.com/developers/docs/topics/gateway-events#client-status-object
*/
@@ -112,15 +117,15 @@ export interface GatewayPresenceClientStatus {
/**
* The user's status set for an active desktop (Windows, Linux, Mac) application session
*/
desktop?: PresenceUpdateStatus;
desktop?: PresenceUpdateReceiveStatus;
/**
* The user's status set for an active mobile (iOS, Android) application session
*/
mobile?: PresenceUpdateStatus;
mobile?: PresenceUpdateReceiveStatus;
/**
* The user's status set for an active web (browser, bot account) application session
*/
web?: PresenceUpdateStatus;
web?: PresenceUpdateReceiveStatus;
}
/**
@@ -167,7 +172,7 @@ export interface GatewayActivity {
*/
details?: string | null;
/**
* The user's current party status
* The user's current party status, or the text used for a custom status
*/
state?: string | null;
/**
@@ -249,7 +254,7 @@ export enum ActivityType {
*/
Watching,
/**
* {emoji} {details}
* {emoji} {state}
*/
Custom,
/**

View File

@@ -4,7 +4,7 @@
import type { Permissions, Snowflake } from '../../globals';
import type { APIEmoji, APIPartialEmoji } from './emoji';
import type { PresenceUpdateStatus } from './gateway';
import type { PresenceUpdateReceiveStatus } from './gateway';
import type { OAuth2Scopes } from './oauth2';
import type { APIRole } from './permissions';
import type { APISticker } from './sticker';
@@ -419,7 +419,7 @@ export enum GuildFeature {
* Guild has enabled the role subscription promo page
*/
CreatorStorePage = 'CREATOR_STORE_PAGE',
/*
/**
* Guild has been set as a support server on the App Directory
*/
DeveloperSupportServer = 'DEVELOPER_SUPPORT_SERVER',
@@ -895,7 +895,7 @@ export interface APIGuildWidgetMember {
username: string;
discriminator: string;
avatar: string | null;
status: PresenceUpdateStatus;
status: PresenceUpdateReceiveStatus;
activity?: { name: string };
avatar_url: string;
}
@@ -1020,6 +1020,10 @@ export interface APIGuildOnboarding {
* Whether onboarding is enabled in the guild
*/
enabled: boolean;
/**
* Current mode of onboarding
*/
mode: GuildOnboardingMode;
}
/**
@@ -1087,6 +1091,20 @@ export interface APIGuildOnboardingPromptOption {
description: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-onboarding-object-onboarding-mode
*/
export enum GuildOnboardingMode {
/**
* Counts only Default Channels towards constraints
*/
OnboardingDefault,
/**
* Counts Default Channels and Questions towards constraints
*/
OnboardingAdvanced,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-onboarding-object-prompt-types
*/

View File

@@ -18,3 +18,4 @@ export * from './template';
export * from './user';
export * from './voice';
export * from './webhook';
export * from './monetization';

115
payloads/v9/monetization.ts Normal file
View File

@@ -0,0 +1,115 @@
import type { Snowflake } from '../../globals';
/**
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-structure
*/
export interface APIEntitlement {
/**
* ID of the entitlement
*/
id: Snowflake;
/**
* ID of the SKU
*/
sku_id: Snowflake;
/**
* ID of the user that is granted access to the entitlement's sku
*/
user_id?: Snowflake;
/**
* ID of the guild that is granted access to the entitlement's sku
*/
guild_id?: Snowflake;
/**
* ID of the parent application
*/
application_id: Snowflake;
/**
* Type of entitlement
*/
type: EntitlementType;
/**
* Whether the entitlement was deleted
*/
deleted: boolean;
/**
* Start date at which the entitlement is valid. Not present when using test entitlements.
*/
starts_at?: string;
/**
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
*/
ends_at?: string;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#entitlement-object-entitlement-types
*/
export enum EntitlementType {
/**
* Entitlement was purchased as an app subscription
*/
ApplicationSubscription = 8,
}
/**
* https://discord.com/developers/docs/monetization/skus#sku-object-sku-structure
*/
export interface APISKU {
/**
* ID of SKU
*/
id: Snowflake;
/**
* Type of SKU
*/
type: SKUType;
/**
* ID of the parent application
*/
application_id: Snowflake;
/**
* Customer-facing name of your premium offering
*/
name: string;
/**
* System-generated URL slug based on the SKU's name
*/
slug: string;
/**
* SKU flags combined as a bitfield
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
flags: SKUFlags;
}
/**
* https://discord.com/developers/docs/monetization/skus#sku-object-sku-flags
*/
export enum SKUFlags {
/**
* SKU is available for purchase
*/
Available = 1 << 2,
/**
* Recurring SKU that can be purchased by a user and applied to a single server.
* Grants access to every user in that server.
*/
GuildSubscription = 1 << 7,
/**
* Recurring SKU purchased by a user for themselves. Grants access to the purchasing user in every server.
*/
UserSubscription = 1 << 8,
}
export enum SKUType {
/**
* Represents a recurring subscription
*/
Subscription = 5,
/**
* System-generated group for each Subscription SKU created
*/
SubscriptionGroup = 6,
}

View File

@@ -54,6 +54,10 @@ export interface APIRole {
* The tags this role has
*/
tags?: APIRoleTags;
/**
* Role flags
*/
flags: RoleFlags;
}
/**
@@ -85,3 +89,13 @@ export interface APIRoleTags {
*/
guild_connections?: null;
}
/**
* https://discord.com/developers/docs/topics/permissions#role-object-role-flags
*/
export enum RoleFlags {
/**
* Role can be selected by members in an onboarding prompt
*/
InPrompt = 1 << 0,
}

View File

@@ -70,7 +70,7 @@ export interface APISticker {
*/
export enum StickerType {
/**
* An official sticker in a pack, part of Nitro or in a removed purchasable pack
* An official sticker in a pack
*/
Standard = 1,
/**

View File

@@ -43,6 +43,8 @@ export interface APITeamMember {
membership_state: TeamMemberMembershipState;
/**
* Will always be `["*"]`
*
* @deprecated Use `role` instead
*/
permissions: ['*'];
/**
@@ -55,6 +57,12 @@ export interface APITeamMember {
* See https://discord.com/developers/docs/resources/user#user-object
*/
user: APIUser;
/**
* The user's role in the team.
*
* See https://discord.com/developers/docs/topics/teams#team-member-roles
*/
role: TeamMemberRole;
}
/**
@@ -64,3 +72,12 @@ export enum TeamMemberMembershipState {
Invited = 1,
Accepted,
}
/**
* https://discord.com/developers/docs/topics/teams#team-member-roles-team-member-role-types
*/
export enum TeamMemberRole {
Admin = 'admin',
Developer = 'developer',
ReadOnly = 'read_only',
}

View File

@@ -83,6 +83,12 @@ export interface APIUser {
* See https://discord.com/developers/docs/resources/user#user-object-user-flags
*/
public_flags?: UserFlags;
/**
* The user's avatar decoration hash
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
avatar_decoration?: string | null;
}
/**
@@ -275,7 +281,11 @@ export enum ConnectionService {
Steam = 'steam',
TikTok = 'tiktok',
Twitch = 'twitch',
Twitter = 'twitter',
X = 'twitter',
/**
* @deprecated This is the old name for {@apilink ConnectionService#X}
*/
Twitter = X,
Xbox = 'xbox',
YouTube = 'youtube',
}

View File

@@ -154,6 +154,8 @@ export enum RESTJSONErrorCodes {
ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40_066,
TagRequiredToCreateAForumPostInThisChannel,
AnEntitlementHasAlreadyBeenGrantedForThisResource = 40_074,
MissingAccess = 50_001,
InvalidAccountType,
CannotExecuteActionOnDMChannel,
@@ -198,6 +200,8 @@ export enum RESTJSONErrorCodes {
CannotSelfRedeemThisGift = 50_054,
InvalidGuild,
InvalidSKU = 50_057,
InvalidRequestOrigin = 50_067,
InvalidMessageType,
@@ -285,6 +289,9 @@ export enum RESTJSONErrorCodes {
WebhookServicesCannotBeUsedInForumChannels,
MessageBlockedByHarmfulLinksFilter = 240_000,
CannotEnableOnboardingRequirementsAreNotMet = 350_000,
CannotUpdateOnboardingWhileBelowRequirements,
}
/**

View File

@@ -1,4 +1,5 @@
import type { APIApplicationRoleConnectionMetadata } from '../../payloads/v10/application';
import type { APIApplication, APIApplicationRoleConnectionMetadata } from '../../payloads/v10/application';
import type { Nullable, StrictPartial } from '../../utils/internals';
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
@@ -14,3 +15,30 @@ export type RESTPutAPIApplicationRoleConnectionMetadataJSONBody = APIApplication
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
*/
export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];
/**
* https://discord.com/developers/docs/resources/application#get-current-application
*/
export type RESTGetCurrentApplicationResult = APIApplication;
/**
* https://discord.com/developers/docs/resources/application#edit-current-application
*/
export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
Pick<
APIApplication,
| 'custom_install_url'
| 'description'
| 'flags'
| 'role_connections_verification_url'
| 'install_params'
| 'interactions_endpoint_url'
| 'tags'
> &
Nullable<Pick<APIApplication, 'icon' | 'cover_image'>>
>;
/**
* https://discord.com/developers/docs/resources/application#edit-current-application
*/
export type RESTPatchCurrentApplicationResult = APIApplication;

View File

@@ -2,7 +2,6 @@ import type { Permissions, Snowflake } from '../../globals';
import type {
APIActionRowComponent,
APIAllowedMentions,
APIAttachment,
APIChannel,
APIEmbed,
APIExtendedInvite,
@@ -18,11 +17,13 @@ import type {
MessageFlags,
OverwriteType,
ThreadAutoArchiveDuration,
ThreadChannelType,
VideoQualityMode,
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
ForumLayoutType,
ChannelFlags,
} from '../../payloads/v10/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
@@ -60,15 +61,15 @@ export interface RESTPatchAPIChannelJSONBody {
*/
position?: number | null | undefined;
/**
* 0-1024 character channel topic (0-4096 characters for forum channels)
* 0-1024 character channel topic (0-4096 characters for thread-only channels)
*
* Channel types: text, news, forum
* Channel types: text, news, forum, media
*/
topic?: string | null | undefined;
/**
* Whether the channel is nsfw
*
* Channel types: text, voice, news, forum
* Channel types: text, voice, news, forum, media
*/
nsfw?: boolean | null | undefined;
/**
@@ -76,7 +77,7 @@ export interface RESTPatchAPIChannelJSONBody {
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
* are unaffected
*
* Channel types: text, newsThread, publicThread, privateThread, forum
* Channel types: text, newsThread, publicThread, privateThread, forum, media
*/
rate_limit_per_user?: number | null | undefined;
/**
@@ -100,7 +101,7 @@ export interface RESTPatchAPIChannelJSONBody {
/**
* ID of the new parent category for a channel
*
* Channel types: text, voice, news
* Channel types: text, voice, news, stage, forum, media
*/
parent_id?: Snowflake | null | undefined;
/**
@@ -136,9 +137,19 @@ export interface RESTPatchAPIChannelJSONBody {
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*
* Channel types: text, news
* Channel types: text, news, forum, media
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
/**
* Channel flags combined as a bit field.
*/
flags?: ChannelFlags | undefined;
/**
* The set of tags that can be used in a thread-only channel; limited to 20
*
* Channel types: forum, media
*/
available_tags?: (Partial<APIGuildForumTag> & Pick<APIGuildForumTag, 'name'>)[] | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread
*
@@ -146,28 +157,22 @@ export interface RESTPatchAPIChannelJSONBody {
*/
invitable?: boolean | undefined;
/**
* The set of tags that can be used in a forum channel; limited to 20
* The emoji to show in the add reaction button on a thread in a thread-only channel
*
* Channel types: forum
*/
available_tags?: APIGuildForumTag[] | undefined;
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*
* Channel types: forum
* Channel types: forum, media
*/
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji | undefined;
/**
* 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
* Channel types: text, forum, media
*/
default_thread_rate_limit_per_user?: number | null | undefined;
/**
* The default sort order type used to order posts in a forum channel
* The default sort order type used to order posts in a thread-only channel
*
* Channel types: forum
* Channel types: forum, media
*/
default_sort_order?: SortOrderType | null | undefined;
/**
@@ -176,6 +181,12 @@ export interface RESTPatchAPIChannelJSONBody {
* Channel types: forum
*/
default_forum_layout?: ForumLayoutType | undefined;
/**
* The ids of the set of tags that have been applied to a thread-only channel; limited to 5
*
* Channel types: forum, media
*/
applied_tags?: Snowflake[] | undefined;
}
/**
@@ -235,6 +246,24 @@ export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
fail_if_not_exists?: boolean | undefined;
};
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
*/
export interface RESTAPIAttachment {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#create-message
*/
@@ -284,7 +313,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
/**
* Message flags combined as a bitfield
*/
@@ -328,7 +357,7 @@ export type RESTDeleteAPIChannelMessageOwnReaction = never;
*/
export type RESTDeleteAPIChannelMessageUserReactionResult = never;
/*
/**
* https://discord.com/developers/docs/resources/channel#get-reactions
*/
export interface RESTGetAPIChannelMessageReactionUsersQuery {
@@ -395,7 +424,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
/**
* The components to include with the message
*
@@ -614,25 +643,25 @@ export interface RESTPostAPIChannelMessagesThreadsJSONBody {
}
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel
*/
export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & {
/**
* First message in the forum thread
* The initial message of the thread
*/
message: RESTPostAPIChannelMessageJSONBody;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel; limited to 5
* The IDs of the set of tags to apply to the thread; limited to 5
*/
applied_tags?: Snowflake[] | undefined;
};
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel
*/
export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & {
/**
* First message in the forum thread
* The initial message of the thread
*/
message: string;
};
@@ -656,7 +685,7 @@ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMes
*
* @default ChannelType.PrivateThread
*/
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread | undefined;
type?: ThreadChannelType | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/
@@ -716,7 +745,7 @@ export interface RESTGetAPIChannelThreadMembersQuery {
*/
export type RESTGetAPIChannelThreadMembersResult = APIThreadMember[];
/*
/**
* https://discord.com/developers/docs/resources/channel#list-public-archived-threads
*/
export interface RESTGetAPIChannelThreadsArchivedQuery {

View File

@@ -24,8 +24,11 @@ import type {
GuildSystemChannelFlags,
GuildVerificationLevel,
GuildWidgetStyle,
APIGuildOnboardingPrompt,
APIGuildOnboardingPromptOption,
} from '../../payloads/v10/index';
import type {
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
DistributiveOmit,
DistributivePick,
Nullable,
@@ -449,7 +452,7 @@ export interface RESTPutAPIGuildMemberJSONBody {
deaf?: boolean | undefined;
}
export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-member
@@ -926,3 +929,48 @@ export type RESTPatchAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;
* https://discord.com/developers/docs/resources/guild#get-guild-onboarding
*/
export type RESTGetAPIGuildOnboardingResult = APIGuildOnboarding;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
*/
export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Pick<APIGuildOnboarding, 'default_channel_ids' | 'enabled' | 'mode'>>
> & {
/**
* Prompts shown during onboarding and in customize community
*/
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
};
export type RESTAPIModifyGuildOnboardingPromptData = Pick<APIGuildOnboardingPrompt, 'id' | 'title'> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPrompt, 'id' | 'title' | 'options' | 'guild_id'>>
> & {
/**
* Options available within the prompt
*/
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
};
export type RESTAPIModifyGuildOnboardingPromptOptionData = Pick<APIGuildOnboardingPromptOption, 'title'> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPromptOption, 'title' | 'emoji' | 'guild_id'>>
> & {
/**
* Emoji id
*/
emoji_id?: Snowflake | null | undefined;
/**
* Emoji name
*/
emoji_name?: string | null | undefined;
/**
* Whether this emoji is animated
*/
emoji_animated?: boolean | null | undefined;
};
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
*/
export type RESTPutAPIGuildOnboardingResult = APIGuildOnboarding;

View File

@@ -18,6 +18,7 @@ export * from './template';
export * from './user';
export * from './voice';
export * from './webhook';
export * from './monetization';
export const APIVersion = '10';
@@ -494,7 +495,7 @@ export const Routes = {
/**
* Route for:
* - GET `/channels/{channel.id}/users/@me/threads/archived/prviate`
* - GET `/channels/{channel.id}/users/@me/threads/archived/private`
*/
channelJoinedArchivedThreads(channelId: Snowflake) {
return `/channels/${channelId}/users/@me/threads/archived/private` as const;
@@ -830,6 +831,16 @@ export const Routes = {
* Route for:
* - GET `/sticker-packs`
*/
stickerPacks() {
return '/sticker-packs' as const;
},
/**
* Route for:
* - GET `/sticker-packs`
*
* @deprecated Use {@link Routes.stickerPacks} instead.
*/
nitroStickerPacks() {
return '/sticker-packs' as const;
},
@@ -883,10 +894,42 @@ export const Routes = {
/**
* Route for:
* - GET `/guilds/${guild.id}/onboarding`
* - PUT `/guilds/${guild.id}/onboarding`
*/
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
},
/**
* Route for:
* - GET `/applications/@me`
* - PATCH `/applications/@me`
*/
currentApplication() {
return '/applications/@me' as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/entitlements`
* - POST `/applications/{application.id}/entitlements`
*/
entitlements(applicationId: Snowflake) {
return `/applications/${applicationId}/entitlements` as const;
},
/**
* Route for:
* - DELETE `/applications/{application.id}/entitlements/{entitlement.id}`
*/
entitlement(applicationId: Snowflake, entitlementId: Snowflake) {
return `/applications/${applicationId}/entitlements/${entitlementId}` as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/skus`
*/
skus(applicationId: Snowflake) {
return `/applications/${applicationId}/skus` as const;
},
};
export const StickerPackApplicationId = '710982414301790216';
@@ -998,6 +1041,16 @@ export const CDNRoutes = {
return `/guilds/${guildId}/users/${userId}/avatars/${memberAvatar}.${format}` as const;
},
/**
* Route for:
* - GET `/avatar-decorations/{user.id}/{user.avatar_decoration}.png`
*
* This route supports the extension: PNG
*/
userAvatarDecoration(userId: Snowflake, userAvatarDecoration: string) {
return `/avatar-decorations/${userId}/${userAvatarDecoration}.png` as const;
},
/**
* Route for:
* - GET `/app-icons/{application.id}/{application.icon}.{png|jpeg|webp}`

85
rest/v10/monetization.ts Normal file
View File

@@ -0,0 +1,85 @@
import type { Snowflake } from '../../globals';
import type { APIEntitlement, APISKU } from '../../v10';
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
*/
export interface RESTGetAPIEntitlementsQuery {
/**
* User ID to look up entitlements for
*/
user_id?: Snowflake | undefined;
/**
* Optional list of SKU IDs to check entitlements for
* Comma-delimited set of snowflakes
*/
sku_ids?: string | undefined;
/**
* Retrieve entitlements before this entitlement ID
*/
before?: Snowflake | undefined;
/**
* Retrieve entitlements after this entitlement ID
*/
after?: Snowflake | undefined;
/**
* Number of entitlements to return (1-100)
*
* @default 100
*/
limit?: number | undefined;
/**
* Guild ID to look up entitlements for
*/
guild_id?: Snowflake | undefined;
/**
* Whether ended entitlements should be omitted
*/
exclude_ended?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
*/
export type RESTGetAPIEntitlementsResult = APIEntitlement[];
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
*/
export interface RESTPostAPIEntitlementBody {
/**
* ID of the SKU to grant the entitlement to
*/
sku_id: Snowflake;
/**
* ID of the guild or user to grant the entitlement to
*/
owner_id: Snowflake;
/**
* The type of entitlement owner
*/
owner_type: EntitlementOwnerType;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
*/
export type RESTPostAPIEntitlementResult = Partial<Omit<APIEntitlement, 'starts_at' | 'ends_at'>>;
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
*/
export enum EntitlementOwnerType {
Guild = 1,
User,
}
/**
* https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement
*/
export type RESTDeleteAPIEntitlementResult = never;
/**
* https://discord.com/developers/docs/monetization/skus#list-skus
*/
export type RESTGetAPISKUsResult = APISKU[];

View File

@@ -23,6 +23,10 @@ export interface RESTPostAPIStageInstanceJSONBody {
* Notify @everyone that a stage instance has started
*/
send_start_notification?: boolean | undefined;
/**
* The guild scheduled event associated with this stage instance
*/
guild_scheduled_event_id?: Snowflake | undefined;
}
/**

View File

@@ -6,12 +6,19 @@ import type { APISticker, APIStickerPack } from '../../payloads/v10/index';
export type RESTGetAPIStickerResult = APISticker;
/**
* https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
*/
export interface RESTGetNitroStickerPacksResult {
export interface RESTGetStickerPacksResult {
sticker_packs: APIStickerPack[];
}
/**
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
*
* @deprecated Use `RESTGetStickerPacksResult` instead
*/
export type RESTGetNitroStickerPacksResult = RESTGetStickerPacksResult;
/**
* https://discord.com/developers/docs/resources/sticker#list-guild-stickers
*/

View File

@@ -5,11 +5,11 @@ import type {
APIEmbed,
APIMessage,
APIWebhook,
APIAttachment,
MessageFlags,
APIMessageActionRowComponent,
} from '../../payloads/v10/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals';
import type { RESTAPIAttachment } from './channel';
/**
* https://discord.com/developers/docs/resources/webhook#create-webhook
*/
@@ -139,7 +139,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
/**
* Message flags combined as a bitfield
*/
@@ -257,7 +257,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
};
/**

View File

@@ -454,7 +454,7 @@ export interface RESTPutAPIGuildMemberJSONBody {
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-member

View File

@@ -1,4 +1,5 @@
import type { APIApplicationRoleConnectionMetadata } from '../../payloads/v9/application';
import type { APIApplication, APIApplicationRoleConnectionMetadata } from '../../payloads/v9/application';
import type { StrictPartial, Nullable } from '../../utils/internals';
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
@@ -14,3 +15,30 @@ export type RESTPutAPIApplicationRoleConnectionMetadataJSONBody = APIApplication
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
*/
export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];
/**
* https://discord.com/developers/docs/resources/application#get-current-application
*/
export type RESTGetCurrentApplicationResult = APIApplication;
/**
* https://discord.com/developers/docs/resources/application#edit-current-application
*/
export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
Pick<
APIApplication,
| 'custom_install_url'
| 'description'
| 'flags'
| 'role_connections_verification_url'
| 'install_params'
| 'interactions_endpoint_url'
| 'tags'
> &
Nullable<Pick<APIApplication, 'icon' | 'cover_image'>>
>;
/**
* https://discord.com/developers/docs/resources/application#edit-current-application
*/
export type RESTPatchCurrentApplicationResult = APIApplication;

View File

@@ -2,7 +2,6 @@ import type { Permissions, Snowflake } from '../../globals';
import type {
APIActionRowComponent,
APIAllowedMentions,
APIAttachment,
APIChannel,
APIEmbed,
APIExtendedInvite,
@@ -18,11 +17,13 @@ import type {
MessageFlags,
OverwriteType,
ThreadAutoArchiveDuration,
ThreadChannelType,
VideoQualityMode,
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
ForumLayoutType,
ChannelFlags,
} from '../../payloads/v9/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
@@ -60,15 +61,15 @@ export interface RESTPatchAPIChannelJSONBody {
*/
position?: number | null | undefined;
/**
* 0-1024 character channel topic (0-4096 characters for forum channels)
* 0-1024 character channel topic (0-4096 characters for thread-only channels)
*
* Channel types: text, news, forum
* Channel types: text, news, forum, media
*/
topic?: string | null | undefined;
/**
* Whether the channel is nsfw
*
* Channel types: text, voice, news, forum
* Channel types: text, voice, news, forum, media
*/
nsfw?: boolean | null | undefined;
/**
@@ -76,7 +77,7 @@ export interface RESTPatchAPIChannelJSONBody {
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
* are unaffected
*
* Channel types: text, newsThread, publicThread, privateThread, forum
* Channel types: text, newsThread, publicThread, privateThread, forum, media
*/
rate_limit_per_user?: number | null | undefined;
/**
@@ -100,7 +101,7 @@ export interface RESTPatchAPIChannelJSONBody {
/**
* ID of the new parent category for a channel
*
* Channel types: text, voice, news
* Channel types: text, voice, news, stage, forum, media
*/
parent_id?: Snowflake | null | undefined;
/**
@@ -136,9 +137,19 @@ export interface RESTPatchAPIChannelJSONBody {
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*
* Channel types: text, news
* Channel types: text, news, forum, media
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
/**
* Channel flags combined as a bit field.
*/
flags?: ChannelFlags | undefined;
/**
* The set of tags that can be used in a thread-only channel; limited to 20
*
* Channel types: forum, media
*/
available_tags?: (Partial<APIGuildForumTag> & Pick<APIGuildForumTag, 'name'>)[] | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread
*
@@ -146,28 +157,22 @@ export interface RESTPatchAPIChannelJSONBody {
*/
invitable?: boolean | undefined;
/**
* The set of tags that can be used in a forum channel; limited to 20
* The emoji to show in the add reaction button on a thread in a thread-only channel
*
* Channel types: forum
*/
available_tags?: APIGuildForumTag[] | undefined;
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*
* Channel types: forum
* Channel types: forum, media
*/
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji | undefined;
/**
* 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
* Channel types: text, forum, media
*/
default_thread_rate_limit_per_user?: number | null | undefined;
/**
* The default sort order type used to order posts in a forum channel
* The default sort order type used to order posts in a thread-only channel
*
* Channel types: forum
* Channel types: forum, media
*/
default_sort_order?: SortOrderType | null | undefined;
/**
@@ -176,6 +181,12 @@ export interface RESTPatchAPIChannelJSONBody {
* Channel types: forum
*/
default_forum_layout?: ForumLayoutType | undefined;
/**
* The ids of the set of tags that have been applied to a thread-only channel; limited to 5
*
* Channel types: forum, media
*/
applied_tags?: Snowflake[] | undefined;
}
/**
@@ -235,6 +246,24 @@ export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
fail_if_not_exists?: boolean | undefined;
};
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
*/
export interface RESTAPIAttachment {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#create-message
*/
@@ -292,7 +321,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
/**
* Message flags combined as a bitfield
*/
@@ -336,7 +365,7 @@ export type RESTDeleteAPIChannelMessageOwnReaction = never;
*/
export type RESTDeleteAPIChannelMessageUserReactionResult = never;
/*
/**
* https://discord.com/developers/docs/resources/channel#get-reactions
*/
export interface RESTGetAPIChannelMessageReactionUsersQuery {
@@ -411,7 +440,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
/**
* The components to include with the message
*
@@ -630,25 +659,25 @@ export interface RESTPostAPIChannelMessagesThreadsJSONBody {
}
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel
*/
export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody & {
/**
* First message in the forum thread
* The initial message of the thread
*/
message: RESTPostAPIChannelMessageJSONBody;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel; limited to 5
* The IDs of the set of tags to apply to the thread; limited to 5
*/
applied_tags?: Snowflake[] | undefined;
};
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-or-media-channel
*/
export type RESTPostAPIGuildForumThreadsFormDataBody = RESTPostAPIChannelMessagesThreadsJSONBody & {
/**
* First message in the forum thread
* The initial message of the thread
*/
message: string;
};
@@ -672,7 +701,7 @@ export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMes
*
* @default ChannelType.PrivateThread
*/
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread | undefined;
type?: ThreadChannelType | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/
@@ -732,7 +761,7 @@ export interface RESTGetAPIChannelThreadMembersQuery {
*/
export type RESTGetAPIChannelThreadMembersResult = APIThreadMember[];
/*
/**
* https://discord.com/developers/docs/resources/channel#list-public-archived-threads
*/
export interface RESTGetAPIChannelThreadsArchivedQuery {

View File

@@ -24,8 +24,11 @@ import type {
GuildWidgetStyle,
APIDMChannel,
APIGroupDMChannel,
APIGuildOnboardingPrompt,
APIGuildOnboardingPromptOption,
} from '../../payloads/v9/index';
import type {
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
DistributiveOmit,
DistributivePick,
Nullable,
@@ -449,7 +452,7 @@ export interface RESTPutAPIGuildMemberJSONBody {
deaf?: boolean | undefined;
}
export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-member
@@ -932,3 +935,48 @@ export type RESTPatchAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;
* https://discord.com/developers/docs/resources/guild#get-guild-onboarding
*/
export type RESTGetAPIGuildOnboardingResult = APIGuildOnboarding;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
*/
export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Pick<APIGuildOnboarding, 'default_channel_ids' | 'enabled' | 'mode'>>
> & {
/**
* Prompts shown during onboarding and in customize community
*/
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
};
export type RESTAPIModifyGuildOnboardingPromptData = Pick<APIGuildOnboardingPrompt, 'id' | 'title'> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPrompt, 'id' | 'title' | 'options' | 'guild_id'>>
> & {
/**
* Options available within the prompt
*/
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
};
export type RESTAPIModifyGuildOnboardingPromptOptionData = Pick<APIGuildOnboardingPromptOption, 'title'> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPromptOption, 'title' | 'emoji' | 'guild_id'>>
> & {
/**
* Emoji id
*/
emoji_id?: Snowflake | null | undefined;
/**
* Emoji name
*/
emoji_name?: string | null | undefined;
/**
* Whether this emoji is animated
*/
emoji_animated?: boolean | null | undefined;
};
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
*/
export type RESTPutAPIGuildOnboardingResult = APIGuildOnboarding;

View File

@@ -18,6 +18,7 @@ export * from './template';
export * from './user';
export * from './voice';
export * from './webhook';
export * from './monetization';
export const APIVersion = '9';
@@ -503,7 +504,7 @@ export const Routes = {
/**
* Route for:
* - GET `/channels/{channel.id}/users/@me/threads/archived/prviate`
* - GET `/channels/{channel.id}/users/@me/threads/archived/private`
*/
channelJoinedArchivedThreads(channelId: Snowflake) {
return `/channels/${channelId}/users/@me/threads/archived/private` as const;
@@ -839,6 +840,16 @@ export const Routes = {
* Route for:
* - GET `/sticker-packs`
*/
stickerPacks() {
return '/sticker-packs' as const;
},
/**
* Route for:
* - GET `/sticker-packs`
*
* @deprecated Use {@link Routes.stickerPacks} instead.
*/
nitroStickerPacks() {
return '/sticker-packs' as const;
},
@@ -892,10 +903,42 @@ export const Routes = {
/**
* Route for:
* - GET `/guilds/${guild.id}/onboarding`
* - PUT `/guilds/${guild.id}/onboarding`
*/
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
},
/**
* Route for:
* - GET `/applications/@me`
* - PATCH `/applications/@me`
*/
currentApplication() {
return '/applications/@me' as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/entitlements`
* - POST `/applications/{application.id}/entitlements`
*/
entitlements(applicationId: Snowflake) {
return `/applications/${applicationId}/entitlements` as const;
},
/**
* Route for:
* - DELETE `/applications/{application.id}/entitlements/{entitlement.id}`
*/
entitlement(applicationId: Snowflake, entitlementId: Snowflake) {
return `/applications/${applicationId}/entitlements/${entitlementId}` as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/skus`
*/
skus(applicationId: Snowflake) {
return `/applications/${applicationId}/skus` as const;
},
};
export const StickerPackApplicationId = '710982414301790216';
@@ -1007,6 +1050,16 @@ export const CDNRoutes = {
return `/guilds/${guildId}/users/${userId}/avatars/${memberAvatar}.${format}` as const;
},
/**
* Route for:
* - GET `/avatar-decorations/{user.id}/{user.avatar_decoration}.png`
*
* This route supports the extension: PNG
*/
userAvatarDecoration(userId: Snowflake, userAvatarDecoration: string) {
return `/avatar-decorations/${userId}/${userAvatarDecoration}.png` as const;
},
/**
* Route for:
* - GET `/app-icons/{application.id}/{application.icon}.{png|jpeg|webp}`

85
rest/v9/monetization.ts Normal file
View File

@@ -0,0 +1,85 @@
import type { Snowflake } from '../../globals';
import type { APIEntitlement, APISKU } from '../../v10';
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
*/
export interface RESTGetAPIEntitlementsQuery {
/**
* User ID to look up entitlements for
*/
user_id?: Snowflake | undefined;
/**
* Optional list of SKU IDs to check entitlements for
* Comma-delimited set of snowflakes
*/
sku_ids?: string | undefined;
/**
* Retrieve entitlements before this entitlement ID
*/
before?: Snowflake | undefined;
/**
* Retrieve entitlements after this entitlement ID
*/
after?: Snowflake | undefined;
/**
* Number of entitlements to return (1-100)
*
* @default 100
*/
limit?: number | undefined;
/**
* Guild ID to look up entitlements for
*/
guild_id?: Snowflake | undefined;
/**
* Whether ended entitlements should be omitted
*/
exclude_ended?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
*/
export type RESTGetAPIEntitlementsResult = APIEntitlement[];
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
*/
export interface RESTPostAPIEntitlementBody {
/**
* ID of the SKU to grant the entitlement to
*/
sku_id: Snowflake;
/**
* ID of the guild or user to grant the entitlement to
*/
owner_id: Snowflake;
/**
* The type of entitlement owner
*/
owner_type: EntitlementOwnerType;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
*/
export type RESTPostAPIEntitlementResult = Partial<Omit<APIEntitlement, 'starts_at' | 'ends_at'>>;
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
*/
export enum EntitlementOwnerType {
Guild = 1,
User,
}
/**
* https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement
*/
export type RESTDeleteAPIEntitlementResult = never;
/**
* https://discord.com/developers/docs/monetization/skus#list-skus
*/
export type RESTGetAPISKUsResult = APISKU[];

View File

@@ -23,6 +23,10 @@ export interface RESTPostAPIStageInstanceJSONBody {
* Notify @everyone that a stage instance has started
*/
send_start_notification?: boolean | undefined;
/**
* The guild scheduled event associated with this stage instance
*/
guild_scheduled_event_id?: Snowflake | undefined;
}
/**

View File

@@ -6,12 +6,19 @@ import type { APISticker, APIStickerPack } from '../../payloads/v9/index';
export type RESTGetAPIStickerResult = APISticker;
/**
* https://discord.com/developers/docs/resources/sticker#list-nitro-sticker-packs
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
*/
export interface RESTGetNitroStickerPacksResult {
export interface RESTGetStickerPacksResult {
sticker_packs: APIStickerPack[];
}
/**
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
*
* @deprecated Use `RESTGetStickerPacksResult` instead
*/
export type RESTGetNitroStickerPacksResult = RESTGetStickerPacksResult;
/**
* https://discord.com/developers/docs/resources/sticker#list-guild-stickers
*/

View File

@@ -5,11 +5,11 @@ import type {
APIEmbed,
APIMessage,
APIWebhook,
APIAttachment,
MessageFlags,
APIMessageActionRowComponent,
} from '../../payloads/v9/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals';
import type { RESTAPIAttachment } from './channel';
/**
* https://discord.com/developers/docs/resources/webhook#create-webhook
*/
@@ -139,7 +139,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
/**
* Message flags combined as a bitfield
*/
@@ -257,7 +257,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
attachments?: RESTAPIAttachment[] | undefined;
};
/**

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