Compare commits

...

231 Commits

Author SHA1 Message Date
github-actions[bot]
2876125975 chore(release): 0.37.11 🎉 (#591)
Build ran for 143b003fbe

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-26 22:46:32 +03:00
Almeida
143b003fbe feat(APIGuildForumChannel): add default_sort_order (#589) 2022-09-25 20:42:38 +03:00
MateoDeveloper
0f118d382f feat(APIGuildForumChannel): update and add missing features (#575) 2022-09-25 20:21:49 +03:00
github-actions[bot]
2dc3fd0a15 chore(release): 0.37.10 🎉 (#587)
Build ran for d452f6346b

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-15 16:42:15 +04:00
Vitor
d452f6346b feat(APIConnection): add two_way_link (#546) 2022-09-15 01:29:48 +03:00
MateoDeveloper
32f5a7b981 feat(APIGuild): document afk timeout values (#570) 2022-09-15 00:14:27 +03:00
Almeida
f4d3f4d5b1 feat: add RESTRateLimit (#585) 2022-09-14 21:13:32 +03:00
github-actions[bot]
5c7e58284e chore(release): 0.37.9 🎉 (#586)
Build ran for afd3b55c08

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-12 15:37:13 +03:00
Vitor
afd3b55c08 feat(ConnectionService): add new connections (#548) 2022-09-09 21:36:17 +03:00
github-actions[bot]
4fbe1180fc chore(release): 0.37.8 🎉 (#584)
Build ran for 2708cb9dca

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-08 15:44:24 +03:00
advaith
2708cb9dca feat(GuildFeature): add InvitesDisabled (#549) 2022-09-08 01:12:49 +03:00
github-actions[bot]
a59998ad1c chore(release): 0.37.7 🎉 (#582)
Build ran for b08f2e34db

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-05 22:33:50 +03:00
Vlad Frangu
b08f2e34db fix(ChannelType): bring back old names 2022-09-05 22:31:49 +03:00
github-actions[bot]
a1100a1910 chore(release): 0.37.6 🎉 (#581)
Build ran for 815c68fe46

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-09-05 15:24:40 +03:00
MateoDeveloper
815c68fe46 fix(GuildChannelType): add missing GuildCategory type (#579) 2022-09-04 19:07:48 +03:00
Vlad Frangu
04b3a7f066 chore: less versions present to make the website build again
crying in out of memory
2022-08-31 03:15:16 +03:00
Vitor
b7b855b200 fix(RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody): channel_id is optional (#547) 2022-08-29 22:00:47 +03:00
advaith
4e362d5260 feat(RESTPutAPIGuildBanJSONBody): add delete_message_seconds (#534) 2022-08-29 21:56:52 +03:00
Almeida
48f0f562ba feat(ApplicationFlags): add ApplicationCommandBadge (#537) 2022-08-29 15:35:05 +03:00
Almeida
817884184b refactor(ChannelType): rename news & thread types (#564)
Warning: The renames are not considered breaking due to the fact the value is still the same. That said, the following renames were done:
- `GuildNews` -> `GuildAnnouncement`
- `GuildPublicThread`, `GuildPrivateThread` and `GuildNewsThread` lost the Guild prefix
- `GuildNewsThread` ->  `AnnouncementThread`
2022-08-29 15:33:44 +03:00
Vitor
73d15ddcbb feat(APIGuildIntegration): add scopes (#563) 2022-08-29 15:31:30 +03:00
advaith
f69b586d01 fix(APIModalSubmission): components is not optional (#574) 2022-08-29 12:30:50 +00:00
github-actions[bot]
1a6884423c chore(release): 0.37.5 🎉 (#572)
Build ran for 0098889499

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-25 18:24:03 +04:00
Vitor
0098889499 feat(FormattingPatterns): add ApplicationCommand (#525)
Co-authored-by: Almeida <almeidx@pm.me>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
2022-08-24 01:22:44 +03:00
github-actions[bot]
bd8765d666 chore(release): 0.37.4 🎉 (#571)
Build ran for 96b4bc504d

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-22 15:27:57 +03:00
Vlad Frangu
96b4bc504d chore: small navbar fix for dropdown 2022-08-20 19:59:35 +03:00
dependabot[bot]
35b17dcbf8 chore(deps): bump minimist from 1.2.5 to 1.2.6 in /website (#567)
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-20 01:43:03 +03:00
Glenn
956f289e88 feat: add common JSON error types (#568) 2022-08-20 01:42:28 +03:00
Vlad Frangu
ef8241fe88 chore: prettier search and contextual search 2022-08-19 22:39:35 +03:00
Ian Mitchell
248484e556 feat(ApplicationCommand): export base chat input types (#569) 2022-08-19 22:12:35 +03:00
github-actions[bot]
1fe707c00e chore(release): 0.37.3 🎉 (#566)
Build ran for 5bb50ae7ea

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-18 15:32:34 +03:00
Vitor
5bb50ae7ea feat(RESTJSONErrorCodes): add 240000 (#565) 2022-08-17 21:02:08 +03:00
github-actions[bot]
0fab79feda chore(release): 0.37.2 🎉 (#561)
Build ran for 4732f1abbe

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-11 15:27:27 +03:00
MateoDeveloper
4732f1abbe docs: add notes about MESSAGE_CONTENT intent in affected data fields (#556) 2022-08-10 17:37:19 +03:00
MateoDeveloper
796f6d8a3b fix(RESTGetAPIChannelUsersThreadsArchivedResult): add has_more missing field (#543) 2022-08-09 23:40:46 +03:00
MateoDeveloper
4488d8fd26 feat(APIVoiceChannel): support text in voice, properties last_message_id and rate_limit_per_user (#544) 2022-08-09 23:39:54 +03:00
Vitor
9a50367dad feat(GatewayReadyDispatchData): add resume_gateway_url (#552) 2022-08-09 23:37:50 +03:00
aetheryx
dc3d5df0a2 fix(GatewayRequestGuildMembersData): limit being required with user_ids (#559) 2022-08-09 23:37:26 +03:00
aetheryx
0e03e39aa2 fix(GatewayGuildMembersChunkDispatchData): make chunk pagination properties mandatory (#558) 2022-08-09 15:24:46 +00:00
Vlad Frangu
f8a9c8b5c6 feat: add search that might or might not work 2022-08-09 12:55:23 +03:00
github-actions[bot]
3eb239ce0c chore(release): 0.37.1 🎉 (#551)
Build ran for 48016e5115

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-08-04 15:57:24 +03:00
MateoDeveloper
48016e5115 docs: fix wrong reference links (#545) 2022-08-03 19:01:28 +03:00
github-actions[bot]
a08e82f097 chore(release): 0.37.0 🎉 (#542)
Build ran for 1def1010ca

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-07-29 12:34:52 +03:00
Superchupu
1def1010ca docs: update discord channel name again (#541) 2022-07-26 10:38:35 +00:00
dependabot[bot]
af8e7c7a5b chore(deps): bump terser from 5.14.0 to 5.14.2 in /website (#535)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-26 12:14:05 +03:00
MateoDeveloper
cecf17b415 refactor(RESTJSONErrorCodes): use MaximumThreadParticipantsReached instead in error code 30033 (#540)
BREAKING CHANGE: `MaximumThreadParticipants` was renamed to `MaximumThreadParticipantsReached` for consistency with the rest of the codes
2022-07-26 12:13:34 +03:00
github-actions[bot]
cb6d4bacc4 chore(release): 0.36.3 🎉 (#536)
Build ran for 0a2e7787c6

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-07-21 15:30:52 +03:00
MateoDeveloper
0a2e7787c6 feat(RESTJSONErrorCodes): add error 30034 (#530)
Co-authored-by: Vitor <vito7.dev@gmail.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2022-07-20 14:56:14 +00:00
Vitor
65b672e2af feat(RESTJSONErrorCodes): add new errors (#506)
* feat(RESTJSONErrorCodes): add new errors

* feat: add 50138

* feat: add 40043

* chore: up-to-date with upstream PR
2022-07-20 17:48:37 +03:00
Vitor
2b53b20b84 feat(APIThreadChannel): add fields about new message counter capability (#532) 2022-07-20 17:47:27 +03:00
MateoDeveloper
907d88ada9 feat(RESTJSONErrorCodes): add error 50132 (#505)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2022-07-16 11:56:16 +00:00
Vitor
8465c5866c refactor(GuildFeature): remove Commerce (#523)
* refactor(GuildFeature): remove `Commerce`

* docs: add `@unstable` tag to `Hub` & `LinkedToHub`
2022-07-16 14:53:47 +03:00
Vitor
09a114133c feat(RESTJSONErrorCodes): add ApplicationNotYetAvailable (#507) 2022-07-15 23:53:58 +03:00
Vitor
4577ac2609 feat(APIConnection): add ConnectionService to type (#491)
* feat: add `ConnectionService` to `APIConnection#type`

* feat: add `epicgames`

* feat: add old connections

* refactor: capitalization

* feat: add missing `SamsungGalaxy`
2022-07-15 20:47:05 +00:00
Vitor
59e247729f feat(GatewayGuildCreateDispatchData): add missing unavailable (#504) 2022-07-15 22:47:44 +03:00
MateoDeveloper
e78de0c83b feat(RESTJSONErrorCodes): add error 50146 (#527) 2022-07-14 23:53:31 +03:00
github-actions[bot]
3644b70e2e chore(release): 0.36.2 🎉 (#528)
Build ran for 4af2ea9141

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

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

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

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

* fix: change to Math.pow()

* chore: add @unstable

* fix: improvements to @unstable

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

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

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

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

* docs: update from upstream

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

* fix: actually make the changelog generation work

* chore: cleanup

* chore: safety

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

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

* fix: add github token to branch creation

* fix: actually patch the module on install

* chore: cleanup some more of the PR

* chore: make the script more agnostic

* chore: cleanup package-lock

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

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

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

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

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

* refactor(RESTPostAPIGuildForumThreadsJSONBody): add `message` field

* chore: branch issues fix

* fix: unnecessary type & correct `message` type

* fix: use json body instead of form data

* feat: update also form data

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

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-18 15:47:08 +02:00
Vitor Lopes
4cbb5fa894 docs: fix links from DDevs portal (#402) 2022-04-17 15:54:28 +03:00
Suneet Tipirneni
6a192b132c feat(RESTPostAPIGuildChannelJSONBody): add default_auto_archive prop (#400) 2022-04-15 22:26:06 +03:00
github-actions[bot]
e4280853ae chore(release): 0.31.1 🎉 (#401)
Build ran for bf08484988

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-11 19:01:33 +02:00
Suneet Tipirneni
bf08484988 feat(APIGuildForum): add support for forums, part 1 (#398)
Co-authored-by: Vitor <milagre.vitor@gmail.com>
2022-04-10 20:48:13 +03:00
advaith
69079ee132 feat: student hubs (#215)
With extra documentation because sometimes Discord doesn't wanna document crucial things -.-
2022-04-07 14:58:01 +03:00
Vlad Frangu
bc6e97f309 feat(APIApplicationCommandInteractionData): add guild_id (#396) 2022-04-04 20:55:03 +03:00
Vitor
279bf67aa8 docs(FormattingPatterns): mark UserWithNickname and UserWithOptionalNickname as deprecated (#392) 2022-04-04 18:21:39 +03:00
github-actions[bot]
d703a6645a chore(release): 0.31.0 🎉 (#395)
Build ran for b1bf7bf0f9

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-04 15:57:38 +02:00
Almeida
b1bf7bf0f9 feat: add RESTGetAPIGuildBansQuery (#391) 2022-04-01 00:05:23 +03:00
Vitor
fffd9f9088 docs(APIApplicationCommand): use the new regex (#390) 2022-03-31 20:34:12 +03:00
Vlad Frangu
6900b74865 ci: correctly delete the head branch (#388) 2022-03-31 16:17:34 +03:00
Almeida
f0ab4e8c48 refactor: remove summary from applications (#386)
BREAKING CHANGE: The deprecated `summary` field has been removed
2022-03-29 21:48:53 +03:00
Suneet Tipirneni
9c12718163 feat(APIApplicationCommand): add missing localization props (#383) 2022-03-29 21:31:09 +03:00
Almeida
25677fff43 refactor: remove store channels (#364)
BREAKING CHANGE: Store channels have been removed, alongside their types
2022-03-29 21:29:46 +03:00
Vitor
6b0f662f0e refactor(APIApplicationCommand): nullable localization fields (#382) 2022-03-29 21:28:49 +03:00
Vitor
b764e8dc1a feat(RESTPostAPIStageInstanceJSONBody): add send_start_notification (#378) 2022-03-29 21:28:25 +03:00
Suneet Tipirneni
93eab113cd feat(APIApplication): app authorization links and tags (#239)
Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>
2022-03-29 21:27:55 +03:00
Suneet Tipirneni
c23f2accf9 feat(GuildFeatures): add animated banners (#219) 2022-03-29 20:39:53 +03:00
Almeida
feba5b743b docs(UserFlags): update misleading Hypesquad description (#374) 2022-03-29 20:38:37 +03:00
Almeida
ed0049b78f refactor(APIGroupDMChannel): make name nullable (#347)
BREAKING CHANGE: The `name` field is now also nullable for Group DM Channels
2022-03-29 20:38:05 +03:00
Vitor
16a996d77d docs(APIGuild): any guild can have description (#384) 2022-03-29 20:36:16 +03:00
Vlad Frangu
f173b18312 chore(deno): give deno the v10 exports they desire (#380) 2022-03-26 11:52:28 +02:00
Vlad Frangu
c9838220ce ci: automatic PR triage (#381) 2022-03-26 11:52:09 +02:00
Vitor
f532002574 feat(APIAuditLogChange): add APIAuditLogChangeKeyImageHash (#379) 2022-03-26 01:15:58 +02:00
dependabot[bot]
f75c632565 chore(deps): bump minimist from 1.2.5 to 1.2.6 (#377)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-26 01:15:36 +02:00
github-actions[bot]
dad9eea547 chore(release): 0.30.0 🎉 (#376)
Build ran for f702988112

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-24 14:16:36 +01:00
Suneet Tipirneni
f702988112 feat(APIApplicationCommand): add command localization (#370) 2022-03-24 01:04:17 +02:00
Parbez
e822e45b3b revert: fix(GatewayVoiceState): some fields are optional instead of nullable (#367) 2022-03-12 13:53:07 +02:00
Jiralite
fa740eb16c fix(APIGuildIntegrationType): correct name of type (#366)
BREAKING CHANGE: `APIGuildInteractionType` is now correctly named `APIGuildIntegrationType`
2022-03-12 00:53:08 +02:00
KinectTheUnknown
8cb629befe chore(.gitignore): fix capitalization error for DS_Store (#365)
The correct capitalization used by macOS is `.DS_Store`, not `.DS_store`
2022-03-11 01:59:04 +02:00
github-actions[bot]
b0443a02ec chore(release): 0.29.0 🎉 (#363)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-10 13:43:14 +01:00
Suneet Tipirneni
cb92843991 feat(APIInviteGuild): add boost count (#323) 2022-03-09 23:49:07 +02:00
Suneet Tipirneni
d06d2d6a9a feat(APIStageInstance): add guild_scheduled_event_id (#350) 2022-03-09 23:46:13 +02:00
Almeida
854aa3691c fix(RESTJSONErrorCodes): typo in error 30046 (#362)
BREAKING CHANGE: `MaximumNumberOfEditsToMessagesOlderThanOneHourReached` is no longer mistyped as `MaxmimumNumberOfEditsToMessagesOlderThanOneHourReached`
2022-03-09 22:10:05 +02:00
Almeida
e5710d0e42 refactor(APIGuildScheduledEventBase): make description nullable (#359)
BREAKING CHANGE: The type for `description` can also be null, not just optional
2022-03-09 21:12:51 +02:00
Almeida
9a578489ad refactor(RESTJSONErrorCodes): update error 50008 key (#338)
BREAKING CHANGE: The error code `50008` has been renamed from `CannotSendMessagesInVoiceChannel` to `CannotSendMessagesInNonTextChannel`
2022-03-09 21:12:00 +02:00
Almeida
10fdeaa68d refactor: make things optional and nullable where applicable (#361)
BREAKING CHANGE: The deprecated `asset` field for stickers is correctly marked as optional now. The `image` field for Guild Scheduled Events is now correctly typed as optional.
2022-03-09 21:11:08 +02:00
Almeida
fddff2167c fix(GatewayVoiceState): some fields are optional instead of nullable (#345)
BREAKING CHANGE: `channel_id` and `request_to_speak_timestamp` are correctly typed as optional, not nullable now.
2022-03-09 20:45:54 +02:00
Almeida
e8127b89f8 feat(RESTJSONErrorCodes): add error 10065 (#336) 2022-03-09 20:44:24 +02:00
Almeida
ab2598441a docs(APISelectMenuComponent): update placeholder max to 150 (#346) 2022-03-09 20:44:01 +02:00
github-actions[bot]
95f3e175b1 chore(release): 0.28.0 🎉 (#360)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-07 13:19:39 +01:00
Ian Mitchell
a3b1006c87 chore: export APIButtonComponentBase<T> interface (#357) 2022-03-05 20:31:49 +02:00
Ian Mitchell
dec7717bc7 feat(Utils): add more typeguard functions to determine the interaction types (#355) 2022-03-05 20:30:41 +02:00
Vlad Frangu
e9ee6966c3 feat: add support for TS module: NodeNext (#356) 2022-03-05 20:29:37 +02:00
Ian Mitchell
3503a4fd38 feat(MessageComponentInteraction): export specific interaction aliases (#353) 2022-03-03 04:47:50 +02:00
Jeroen Claassens
1eba8a3a34 ci: remove deprecate regular versions (#349)
Because its more annoying than useful so 🧹
2022-02-27 21:21:05 +02:00
Suneet Tipirneni
3e3acb5297 refactor(PermissionFlagsBits): rename StartEmbeddedActivities to UseEmbeddedActivities (#342)
BREAKING CHANGE: The `StartEmbeddedActivities` permission flag has been renamed to `UseEmbeddedActivities`
2022-02-25 23:05:07 +02:00
github-actions[bot]
a6aa5b3907 chore(release): 0.27.3 🎉 (#344)
Build ran for 8d432f2ebe

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-24 13:29:20 +01:00
andre4ik3
8d432f2ebe fix(APIApplicationCommandAutocompleteInteraction): make options field required for v10 (PR #332 redo) (#339) 2022-02-18 19:57:17 +02:00
github-actions[bot]
343359ecfc chore(release): 0.27.2 🎉 (#337)
Build ran for 3b1acdf0ec

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-17 13:22:07 +01:00
Almeida
3b1acdf0ec chore(APIInviteStageInstance, APIStageInstance): deprecate stage discovery (#317)
Reference: 47c47f80ca
2022-02-15 23:51:26 +02:00
Vlad Frangu
d8a5f78f62 ci: run publish workflow every Monday and Thursday (#335) 2022-02-15 21:23:15 +02:00
Vlad Frangu
8e87b3e1ce feat: api v10 (#331)
Co-authored-by: Superchupu <53496941+SuperchupuDev@users.noreply.github.com>
Co-authored-by: Almeida <almeidx@pm.me>
Co-authored-by: advaith <advaithj1@gmail.com>
2022-02-15 21:22:09 +02:00
andre4ik3
5396daf0db fix(APIApplicationCommandAutocompleteInteraction): make options field required (#332) 2022-02-15 15:15:06 +02:00
advaith
a8f19e6a19 fix(APIInteractionResponse): add APIModalInteractionResponse to union (#333) 2022-02-15 03:22:51 +02:00
github-actions[bot]
8ce0a231c7 chore(release): 0.27.1 🎉 (#328)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-14 01:05:10 +01:00
Vlad Frangu
0ad06fc639 fix(CI): skip pull request checks for runs that don't include the token (#327) 2022-02-14 00:59:40 +01:00
Vlad Frangu
9af4b4776b chore: cleanup and improve CI (#319)
Co-authored-by: Jeroen Claassens <jeroen.claassens@live.nl>
2022-02-14 01:53:49 +02:00
Suneet Tipirneni
ed1f717679 refactor(APIComponents): simplify action row types (#325) 2022-02-13 04:12:55 +02:00
andre4ik3
5056da523a fix(APIInteractions): export ApplicationCommandAutocomplete (#309) 2022-02-13 01:50:21 +02:00
Almeida
7abeb2e039 fix: make data required in autocomplete interaction and add separate dm/guild types (#322) 2022-02-11 23:44:28 +02:00
Almeida
f88727bd80 fix(APIInteraction): add modal submit interaction & make data required in APIModalSubmit (#321) 2022-02-11 20:25:27 +02:00
Almeida
72e9617fee feat(RESTJSONErrorCodes): add error 40060 (#320) 2022-02-11 02:04:05 +02:00
Vlad Frangu
d5d228e6c2 chore(release): 0.27.0 🎉 (#316) 2022-02-10 13:42:48 +02:00
Suneet Tipirneni
bf0f66b60a feat(Interactions): add modal and text input interactions (#243)
BREAKING CHANGE: `APIBaseMessageComponent` was renamed to `APIBaseComponent`
2022-02-10 12:33:50 +02:00
Amitoj Singh
71c4e6aecd feat(ApplicationCommand): attachment application command option type (#272) 2022-02-09 02:02:30 +02:00
Almeida
ee2b7cd920 refactor(APIGuildScheduledEventBase): make creator_id optional (#315) 2022-02-08 20:50:26 +02:00
Almeida
269a75ccf7 feat(RESTJSONErrorCodes): add error 40004 (#314) 2022-02-08 20:37:46 +02:00
Suneet Tipirneni
87b9b0885a fix(GatewayThreadCreateDispatchData): newly_created is optional, and true when present (#312) 2022-02-03 01:32:31 +02:00
Suneet Tipirneni
7e542152da feat(GatewayThreadCreateDispatch): Add newly_created field` (#311) 2022-02-01 23:54:33 +02:00
Almeida
c48aab3921 refactor: allow omitting allow and deny in permission_overwrites (#310) 2022-02-01 21:36:23 +02:00
Almeida
8e13cd80c6 refactor(userflags): remove None (#308)
BREAKING CHANGE: The `None` user flag is bye-bye (although I doubt anyone is using it)
2022-01-31 17:24:24 +02:00
Suneet Tipirneni
70bab5d1b2 refactor: change const enums to regular enums (#306) 2022-01-26 21:27:54 +02:00
Suneet Tipirneni
663c4e97fb feat(APIScheduledEvent): add image prop (#303) 2022-01-26 00:15:03 +02:00
Suneet Tipirneni
9c2b185367 feat(RESTJSONErrorCodes): add error 30042 (#305) 2022-01-25 22:28:45 +02:00
Advaith
76588d9d38 feat(MessageFlags): add FailedToMentionSomeRolesInThread (#280)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-01-25 21:06:15 +02:00
Suneet Tipirneni
80ed7ba1c1 feat(APIMessageInteraction): add member field (#299) 2022-01-25 20:56:44 +02:00
Suneet Tipirneni
56d39756c0 feat(RESTJSONErrorCodes): add error 30046 (#304) 2022-01-25 20:48:39 +02:00
Suneet Tipirneni
7655e20248 feat(RESTJSONErrorCodes): add error 50068 (#302) 2022-01-25 20:46:22 +02:00
Suneet Tipirneni
d95d9562dc feat(APIThreadMetadata): add create_timestamp field (#301) 2022-01-20 01:03:44 +02:00
Suneet Tipirneni
4194bd9054 feat(RESTAPIPostChannelMessage, RESTAPIPostWebhookMessage): add flags for creation (#300) 2022-01-20 00:37:02 +02:00
Suneet Tipirneni
51fb37cbba feat(RESTJSONErrorCodes): add error code 50086 (#286)
Co-authored-by: Almeida <almeidx@pm.me>
2022-01-19 21:34:23 +02:00
Suneet Tipirneni
310c68f034 feat(APIGuildPreview): add stickers (#279) 2022-01-19 21:08:19 +02:00
Suneet Tipirneni
2c1fbda621 types: Add tagged type unions for channel types (#200)
BREAKING CHANGE: All of the channel types are now split based on their type. As such, you will need to assert the type (either by checking it with the enum or by casting the data as the correct channel) before accessing data.
*If you encounter any missing properties due to this, please open an issue! This is a big change, and we hope nothing is missing*

Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
2022-01-19 15:58:02 +02:00
Rodry
08a8b28ee1 refactor(ActivityType): change Game to Playing (#298)
BREAKING CHANGE: `Game` was renamed to `Playing`
2022-01-19 01:13:03 +02:00
Suneet Tipirneni
b07d5a0c22 feat(Locales): add locale string enum (#297) 2022-01-19 00:36:49 +02:00
Suneet Tipirneni
03b8d3fee0 feat(APIInteraction): add locale props to interactions (#273)
Reference: https://github.com/discord/discord-api-docs/pull/4265
2022-01-11 02:11:32 +02:00
Suneet Tipirneni
03f12d71ee feat(UserFlags): add Spammer flag (#294) 2022-01-10 00:31:24 +02:00
Jan
83f29b6928 feat(RouteBases): add base for guild scheduled events (#293) 2022-01-09 23:59:15 +02:00
Ben
9a982ff8d9 feat(RESTPatchAPIGuildMember): add modify current member and deprecate nick route (#262)
Co-authored-by: Suneet Tipirneni <77477100+suneettipirneni@users.noreply.github.com>
2022-01-09 20:30:26 +02:00
Blake Leonard
5056b0f2b3 feat(RESTPatchAPIGuildMember): add communication_disabled_until field (#289) 2022-01-07 21:14:03 +02:00
Vlad Frangu
7ecf9b2c16 chore(release): 0.26.1 🎉 (#285) 2022-01-02 03:22:53 +02:00
Vlad Frangu
fe1f5313a8 fix(APIApplicationCommandOption): correct type for integer and number (#284) 2022-01-02 03:19:25 +02:00
Jiralite
0cf51abc26 feat(APIAuditLogChangeData): Add communication_disabled_until (#281) 2021-12-27 18:30:02 +02:00
cherryblossom000
751aee6fa7 feat(APIGuildScheduledEvent): add more precise types for stage instance/voice/external events (#278)
This commit turns `APIGuildScheduledEvent` into a union of
`APIStageInstanceGuildScheduledEvent`, `APIVoiceGuildScheduledEvent`,
and `APIExternalGuildScheduledEvent`, which each has more precise types
according to [the docs][1].

This commit also fixes a bug as previously
`APIGuildScheduledEvent#entity_metadata` was not nullable, even though
it should be.

[1]: https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-field-requirements-by-entity-type
2021-12-26 16:56:43 +02:00
Almeida
9f4f59c8e5 feat(ApplicationFlags): add embedded application flags (#277)
While Discord considers it not relevant, invites for in-app applications use at least one of these flags. Reference PR: https://github.com/discord/discord-api-docs/pull/4248
2021-12-25 14:30:10 +02:00
545 changed files with 74951 additions and 5055 deletions

View File

@@ -1,3 +0,0 @@
{
"plugins": ["@babel/plugin-syntax-top-level-await"]
}

1
.eslintignore Normal file
View File

@@ -0,0 +1 @@
deno/

8
.eslintrc.json Normal file
View File

@@ -0,0 +1,8 @@
{
"extends": "marine/prettier/node",
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.eslint.json",
"extraFileExtensions": [".mjs"]
}
}

View File

@@ -1,3 +1,3 @@
**Please describe the changes this PR makes and why it should be merged:**
**Reference Discord API Docs PRs or commits:**
**If applicable, please reference Discord API Docs PRs or commits that influenced this PR:**

2
.github/SUPPORT.md vendored
View File

@@ -5,4 +5,4 @@ We only use this issue tracker for bug reports and feature request. We are not a
For general questions about discord-api-types installation and use please ask in [GitHub Discussions](https://github.com/discordjs/discord-api-types/discussions),
or in the dedicated support channels in our Discord server: https://discord.gg/djs
Any issues that don't directly involve a bug or a feature request will likely be closed and redirected.
Any issues that don't directly involve a bug or a feature request will likely be redirected or closed.

7
.github/auto_assign.yml vendored Normal file
View File

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

58
.github/labeler.yml vendored Normal file
View File

@@ -0,0 +1,58 @@
chore:
- any: ['*']
all:
[
'!deno/**/*',
'!gateway/**/*',
'!payloads/**/*',
'!rest/**/*',
'!rpc/**/*',
'!tests/**/*',
'!utils/**/*',
'!voice/**/*',
]
ci:
- .github/**/*
- .husky/**/*
- scripts/actions/**/*
dependencies:
- package.json
- package-lock.json
- website/package.json
- website/package-lock.json
'topic:deno':
- scripts/deno.mjs
- scripts/actions/report-deno-not-ran.mjs
'topic:gateway':
- gateway/**/*
'topic:payloads':
- payloads/**/*
'topic:rest':
- rest/**/*
'topic:rpc':
- rpc/**/*
'topic:scripts':
- scripts/**/*
'topic:tests':
- tests/**/*
'topic:utils':
- utils/**/*
'topic:voice':
- voice/**/*
'topic:globals':
- globals.ts
'topic:website':
- website/**/*

57
.github/labels.yml vendored Normal file
View File

@@ -0,0 +1,57 @@
# General labels
- name: 'semver:major'
color: 'c10f47'
- name: 'semver:minor'
color: 'e4f486'
- name: 'semver:patch'
color: 'e8be8b'
- name: 'question (please use Discord instead)'
color: 'd876e3'
- name: 'regression'
color: 'ea8785'
- name: 'wontfix'
color: 'ffffff'
- name: 'chore'
color: 'ffffff'
- name: 'ci'
color: '0075ca'
- name: 'dependencies'
color: '276bd1'
- name: 'duplicate'
color: 'cfd3d7'
- name: 'feature request'
color: 'fcf95a'
- name: 'bug'
color: 'd73a4a'
- name: 'backlog'
color: '7ef7ef'
- name: 'good first issue'
color: '7057ff'
- name: 'has PR'
color: '4b1f8e'
- name: 'help wanted'
color: '008672'
# Topic labels
- name: 'topic:deno'
color: 'aed5fc'
- name: 'topic:gateway'
color: 'aed5fc'
- name: 'topic:payloads'
color: 'aed5fc'
- name: 'topic:rest'
color: 'aed5fc'
- name: 'topic:rpc'
color: 'aed5fc'
- name: 'topic:scripts'
color: 'aed5fc'
- name: 'topic:tests'
color: 'aed5fc'
- name: 'topic:utils'
color: 'aed5fc'
- name: 'topic:voice'
color: 'aed5fc'
- name: 'topic:globals'
color: 'aed5fc'
- name: 'topic:website'
color: 'aed5fc'

22
.github/problemMatchers/eslint.json vendored Normal file
View File

@@ -0,0 +1,22 @@
{
"problemMatcher": [
{
"owner": "eslint-stylish",
"pattern": [
{
"regexp": "^([^\\s].*)$",
"file": 1
},
{
"regexp": "^\\s+(\\d+):(\\d+)\\s+(error|warning|info)\\s+(.*)\\s\\s+(.*)$",
"line": 1,
"column": 2,
"severity": 3,
"message": 4,
"code": 5,
"loop": true
}
]
}
]
}

17
.github/problemMatchers/tsc.json vendored Normal file
View File

@@ -0,0 +1,17 @@
{
"problemMatcher": [
{
"owner": "tsc",
"pattern": [
{
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
"file": 1,
"location": 2,
"severity": 3,
"code": 4,
"message": 5
}
]
}
]
}

28
.github/workflows/check-deno.yml vendored Normal file
View File

@@ -0,0 +1,28 @@
name: Deno
on:
pull_request:
types:
- opened
- synchronize
jobs:
check_deno:
name: Ensure Deno types are in sync with the code
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v2
- name: Use Node.js v16
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install Dependencies
run: npm ci
- name: Run Check Script
run: node ./scripts/actions/report-deno-not-ran.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -14,54 +14,25 @@ jobs:
- name: Checkout Project
uses: actions/checkout@v2
- name: Add problem matcher
run: echo "::add-matcher::.github/problemMatchers/eslint.json" && echo "::add-matcher::.github/problemMatchers/tsc.json"
- name: Use Node.js v16
uses: actions/setup-node@v2
with:
node-version: 16
cache: npm
registry-url: https://registry.npmjs.org/
- name: Install Dependencies
- name: Install dependencies
run: npm ci
- name: Run ESLint
- name: Check lint on discord-api-types
run: npm run test:lint
- name: Run TSC
run: npm run build:ci
deno:
name: Generate Deno compatible code
runs-on: ubuntu-latest
needs: testing
# Run workflow only if testing passes
if: needs.testing.result == 'success'
steps:
- name: Checkout Project
uses: actions/checkout@v2
- name: Use Node.js v16
uses: actions/setup-node@v2
with:
node-version: 16
- name: Install Dependencies
run: npm ci
- name: Build Files
run: npm run build:deno
- name: Set Git User and Email
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Commit and Push New Code
run: |
git add --all .
git commit -m "build: deno build for ${GITHUB_SHA}" || true
git push || true
tsd:
name: TSD checks
runs-on: ubuntu-latest

View File

@@ -0,0 +1,93 @@
name: Create PR for new releases and publish new version
on:
workflow_dispatch:
push:
branches:
- main
schedule:
# Run every Monday and Thursday at 12:00
- cron: '0 12 * * 1,4'
jobs:
create_pr:
name: Create PR for new version
runs-on: ubuntu-latest
if: github.repository_owner == 'discordjs' && github.event_name != 'push'
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Node v16
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Install website dependencies
run: pushd website && npm ci --ignore-scripts && popd
- name: Set Git User and Email
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Bump version
run: node ./scripts/bump-version.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create branch for changes, add all changes and push
run: |
git checkout -b "chore/release/$(jq --raw-output '.version' package.json)"
# Run changelog generation, deno script, website version bump
npm run ci:pr
# Add all changes, commit and push
git add --all .
git commit -m "chore(release): $(jq --raw-output '.version' package.json) 🎉" -m "Build ran for ${GITHUB_SHA}"
git push -u origin "chore/release/$(jq --raw-output '.version' package.json)"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Pull Request
run: node ./scripts/actions/create-pr.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
create_release:
name: Create release and publish
runs-on: ubuntu-latest
if: github.repository_owner == 'discordjs' && github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release)') && !contains(github.event.head_commit.message, '[skip ci]')
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install Node v16
uses: actions/setup-node@v2
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Publish release to npm
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Create GitHub release
run: node ./scripts/actions/create-release.mjs
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

22
.github/workflows/labelsync.yml vendored Normal file
View File

@@ -0,0 +1,22 @@
name: Label Sync
on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
push:
branches:
- main
paths:
- '.github/labels.yml'
jobs:
labelsync:
name: Label sync
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Label sync
uses: crazy-max/ghaction-github-labeler@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

18
.github/workflows/pr-automation.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: 'PR Automation'
on:
pull_request_target:
jobs:
triage:
runs-on: ubuntu-latest
steps:
- name: Automatically label PR
uses: actions/labeler@v3
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
sync-labels: true
- name: Automatically assign reviewers
if: ${{ github.event.action == 'opened' }}
uses: kentaro-m/auto-assign-action@v1.1.2

View File

@@ -2,14 +2,21 @@ name: Publish next
on:
workflow_dispatch:
schedule:
- cron: '0 */12 * * *'
push:
branches:
- main
jobs:
publish:
name: Publish to npm
name: Publish @next release to npm
runs-on: ubuntu-latest
if: github.repository_owner == 'discordjs' && !(github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release)'))
steps:
- name: Cancel previous publish attempts
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
- name: Checkout repository
uses: actions/checkout@v2
with:
@@ -25,18 +32,16 @@ jobs:
run: npm ci --ignore-scripts
- name: Bump version
run: npx standard-version
run: node ./scripts/bump-version.mjs
- name: Deprecate old @next versions
run: npx npm-deprecate --name "*next*" --package discord-api-types --message "No longer supported. Install the latest @next release" || true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Deprecate old versions
run: npm deprecate discord-api-types@"~$(jq --raw-output '.version' package.json)-next" "No longer supported. Install the latest @next release" || true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Publish new version
- name: Publish new @next version
run: |
npm version --git-tag-version=false $(jq --raw-output '.version' package.json)-next.$(git rev-parse --short HEAD).$(date +%s)
npm version $(jq --raw-output '.version' package.json)-next.$(git rev-parse --short HEAD).$(date +%s)
npm publish --tag next || true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

11
.gitignore vendored
View File

@@ -6,10 +6,10 @@ globals.*map
globals.d.ts
globals.mjs
v*.js
v*.*map
v*.d.ts
v*.mjs
./v*.js
./v*.*map
./v*.d.ts
./v*.mjs
gateway/**/*.js
gateway/**/*.map
@@ -45,3 +45,6 @@ voice/**/*.js
voice/**/*.map
voice/**/*.d.ts
voice/**/*.mjs
# macOS files
.DS_Store

1
.npmrc
View File

@@ -2,4 +2,5 @@ audit=false
fund=false
legacy-peer-deps=true
tag-version-prefix=""
git-tag-version=false
message="chore(release): %s 🎉"

13
.prettierignore Normal file
View File

@@ -0,0 +1,13 @@
# Node modules
node_modules/
# Generated data
deno/
# Versioned json
website/versioned_sidebars/
website/versioned_docs/
website/versions.json
website/.docusaurus/
website/build

View File

@@ -1,4 +1,10 @@
{
"files.eol": "\n",
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.organizeImports": false,
"source.fixAll": true,
"source.fixAll.eslint": true
},
"cSpell.enableFiletypes": ["mdx"]
}

View File

@@ -1,3 +1,438 @@
## [0.37.11](https://github.com/discordjs/discord-api-types/compare/0.37.10...0.37.11) (2022-09-26)
### Features
- **APIGuildForumChannel:** add `default_sort_order` ([#589](https://github.com/discordjs/discord-api-types/issues/589)) ([143b003](https://github.com/discordjs/discord-api-types/commit/143b003fbe5a86eda225e9da1d0914d6e48cddfd))
- **APIGuildForumChannel:** update and add missing features ([#575](https://github.com/discordjs/discord-api-types/issues/575)) ([0f118d3](https://github.com/discordjs/discord-api-types/commit/0f118d382f94151b1c9be42620520c91b20a05f6))
## [0.37.10](https://github.com/discordjs/discord-api-types/compare/0.37.9...0.37.10) (2022-09-15)
### Features
- add `RESTRateLimit` ([#585](https://github.com/discordjs/discord-api-types/issues/585)) ([f4d3f4d](https://github.com/discordjs/discord-api-types/commit/f4d3f4d5b1c1b6e42c2a8f8184f43d67b586c8c1))
- **APIConnection:** add `two_way_link` ([#546](https://github.com/discordjs/discord-api-types/issues/546)) ([d452f63](https://github.com/discordjs/discord-api-types/commit/d452f6346bd4953a8d777f3818797c4285b1b842))
- **APIGuild:** document afk timeout values ([#570](https://github.com/discordjs/discord-api-types/issues/570)) ([32f5a7b](https://github.com/discordjs/discord-api-types/commit/32f5a7b9814b69da7fc3772ec1f0307d39cda087))
## [0.37.9](https://github.com/discordjs/discord-api-types/compare/0.37.8...0.37.9) (2022-09-12)
### Features
- **ConnectionService:** add new connections ([#548](https://github.com/discordjs/discord-api-types/issues/548)) ([afd3b55](https://github.com/discordjs/discord-api-types/commit/afd3b55c08b0cf75cc4f5a06d3574b6cf532cb6c))
## [0.37.8](https://github.com/discordjs/discord-api-types/compare/0.37.7...0.37.8) (2022-09-08)
### Features
- **GuildFeature:** add `InvitesDisabled` ([#549](https://github.com/discordjs/discord-api-types/issues/549)) ([2708cb9](https://github.com/discordjs/discord-api-types/commit/2708cb9dcaa07d19ca71e9ca211e78939b9d1ff4))
## [0.37.7](https://github.com/discordjs/discord-api-types/compare/0.37.6...0.37.7) (2022-09-05)
### Bug Fixes
- **ChannelType:** bring back old names ([b08f2e3](https://github.com/discordjs/discord-api-types/commit/b08f2e34dbe9afccca6f565db6c7b27a21453d85))
## [0.37.6](https://github.com/discordjs/discord-api-types/compare/0.37.5...0.37.6) (2022-09-05)
### Bug Fixes
- **APIModalSubmission:** `components` is not optional ([#574](https://github.com/discordjs/discord-api-types/issues/574)) ([f69b586](https://github.com/discordjs/discord-api-types/commit/f69b586d0148afd017e6da70ab8d745b6ba04ba4))
- **GuildChannelType:** add missing `GuildCategory` type ([#579](https://github.com/discordjs/discord-api-types/issues/579)) ([815c68f](https://github.com/discordjs/discord-api-types/commit/815c68fe46034029200a8e2903748a3d2e6af7b9))
- **RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody:** `channel_id` is optional ([#547](https://github.com/discordjs/discord-api-types/issues/547)) ([b7b855b](https://github.com/discordjs/discord-api-types/commit/b7b855b2005bb3989810850d6e00bec443a15c92))
### Features
- **APIGuildIntegration:** add `scopes` ([#563](https://github.com/discordjs/discord-api-types/issues/563)) ([73d15dd](https://github.com/discordjs/discord-api-types/commit/73d15ddcbbc676efac876602a3cd726bfe4c378a))
- **ApplicationFlags:** add `ApplicationCommandBadge` ([#537](https://github.com/discordjs/discord-api-types/issues/537)) ([48f0f56](https://github.com/discordjs/discord-api-types/commit/48f0f562bab10d2a1e331474fb963af8631b788b))
- **RESTPutAPIGuildBanJSONBody:** add `delete_message_seconds` ([#534](https://github.com/discordjs/discord-api-types/issues/534)) ([4e362d5](https://github.com/discordjs/discord-api-types/commit/4e362d52608e99d466b43cd37ec6b6bb1222b660))
## [0.37.5](https://github.com/discordjs/discord-api-types/compare/0.37.4...0.37.5) (2022-08-25)
### Features
- **FormattingPatterns:** add `ApplicationCommand` ([#525](https://github.com/discordjs/discord-api-types/issues/525)) ([0098889](https://github.com/discordjs/discord-api-types/commit/00988894995f7ac5e8ddc34125704a230329137c))
## [0.37.4](https://github.com/discordjs/discord-api-types/compare/0.37.3...0.37.4) (2022-08-22)
### Features
- add common JSON error types ([#568](https://github.com/discordjs/discord-api-types/issues/568)) ([956f289](https://github.com/discordjs/discord-api-types/commit/956f289e885763a620cb67a36e7e42683b5c08bf))
- **ApplicationCommand:** export base chat input types ([#569](https://github.com/discordjs/discord-api-types/issues/569)) ([248484e](https://github.com/discordjs/discord-api-types/commit/248484e55613e2da3f1d659395e1f4c010cb51b5))
## [0.37.3](https://github.com/discordjs/discord-api-types/compare/0.37.2...0.37.3) (2022-08-18)
### Features
- **RESTJSONErrorCodes:** add 240000 ([#565](https://github.com/discordjs/discord-api-types/issues/565)) ([5bb50ae](https://github.com/discordjs/discord-api-types/commit/5bb50ae7ea6859845c9d9996f02ac42c61413df0))
## [0.37.2](https://github.com/discordjs/discord-api-types/compare/0.37.1...0.37.2) (2022-08-11)
### Bug Fixes
- **GatewayGuildMembersChunkDispatchData:** make chunk pagination properties mandatory ([#558](https://github.com/discordjs/discord-api-types/issues/558)) ([0e03e39](https://github.com/discordjs/discord-api-types/commit/0e03e39aa2bf8f1b9a58113a3242c4722e64922b))
- **GatewayRequestGuildMembersData:** limit being required with user_ids ([#559](https://github.com/discordjs/discord-api-types/issues/559)) ([dc3d5df](https://github.com/discordjs/discord-api-types/commit/dc3d5df0a2931eff63991987166634661d5bd1d8))
- **RESTGetAPIChannelUsersThreadsArchivedResult:** add `has_more` missing field ([#543](https://github.com/discordjs/discord-api-types/issues/543)) ([796f6d8](https://github.com/discordjs/discord-api-types/commit/796f6d8a3b2f55d2a120137801e0450ddf30576e))
### Features
- add search that might or might not work ([f8a9c8b](https://github.com/discordjs/discord-api-types/commit/f8a9c8b5c6bdd73bcbf9dd6fff66fafac2594ba4))
- **APIVoiceChannel:** support text in voice, properties `last_message_id` and `rate_limit_per_user` ([#544](https://github.com/discordjs/discord-api-types/issues/544)) ([4488d8f](https://github.com/discordjs/discord-api-types/commit/4488d8fd2611a6547fc6149ba1cec5682340a119))
- **GatewayReadyDispatchData:** add `resume_gateway_url` ([#552](https://github.com/discordjs/discord-api-types/issues/552)) ([9a50367](https://github.com/discordjs/discord-api-types/commit/9a50367dad3a06fbca6e8d1fdd98fbf144595d4e))
## [0.37.1](https://github.com/discordjs/discord-api-types/compare/0.37.0...0.37.1) (2022-08-04)
# [0.37.0](https://github.com/discordjs/discord-api-types/compare/0.36.3...0.37.0) (2022-07-28)
### Code Refactoring
- **RESTJSONErrorCodes:** use `MaximumThreadParticipantsReached` instead in error code 30033 ([#540](https://github.com/discordjs/discord-api-types/issues/540)) ([cecf17b](https://github.com/discordjs/discord-api-types/commit/cecf17b4158fbebb3ee508518a9e9a7b1297356f))
### BREAKING CHANGES
- **RESTJSONErrorCodes:** `MaximumThreadParticipants` was renamed to `MaximumThreadParticipantsReached` for consistency with the rest of the codes
## [0.36.3](https://github.com/discordjs/discord-api-types/compare/0.36.2...0.36.3) (2022-07-21)
### Features
- **APIConnection:** add `ConnectionService` to `type` ([#491](https://github.com/discordjs/discord-api-types/issues/491)) ([4577ac2](https://github.com/discordjs/discord-api-types/commit/4577ac2609f4a861505bc41f4293f482db251cdc))
- **APIThreadChannel:** add fields about new message counter capability ([#532](https://github.com/discordjs/discord-api-types/issues/532)) ([2b53b20](https://github.com/discordjs/discord-api-types/commit/2b53b20b84b7434b9a35b715d8ebdeb040835dca))
- **GatewayGuildCreateDispatchData:** add missing `unavailable` ([#504](https://github.com/discordjs/discord-api-types/issues/504)) ([59e2477](https://github.com/discordjs/discord-api-types/commit/59e247729fcd27be839c88516939ec22843781ce))
- **RESTJSONErrorCodes:** add `ApplicationNotYetAvailable` ([#507](https://github.com/discordjs/discord-api-types/issues/507)) ([09a1141](https://github.com/discordjs/discord-api-types/commit/09a114133c7599cc14d4a0eb61425162091c45ee))
- **RESTJSONErrorCodes:** add error `30034` ([#530](https://github.com/discordjs/discord-api-types/issues/530)) ([0a2e778](https://github.com/discordjs/discord-api-types/commit/0a2e7787c672ffb4af83e055df632aae36811445))
- **RESTJSONErrorCodes:** add error `50132` ([#505](https://github.com/discordjs/discord-api-types/issues/505)) ([907d88a](https://github.com/discordjs/discord-api-types/commit/907d88ada93221802a4aefe7dc0ca3b2b73f94f0))
- **RESTJSONErrorCodes:** add error `50146` ([#527](https://github.com/discordjs/discord-api-types/issues/527)) ([e78de0c](https://github.com/discordjs/discord-api-types/commit/e78de0c83ba93145a2302ddea2e55b5050291c52))
- **RESTJSONErrorCodes:** add new errors ([#506](https://github.com/discordjs/discord-api-types/issues/506)) ([65b672e](https://github.com/discordjs/discord-api-types/commit/65b672e2afd2135333272d4e7b771eba237a21b6))
## [0.36.2](https://github.com/discordjs/discord-api-types/compare/0.36.1...0.36.2) (2022-07-14)
### Features
- **RESTJSONErrorCodes:** add error `30032` ([#521](https://github.com/discordjs/discord-api-types/issues/521)) ([f2c3451](https://github.com/discordjs/discord-api-types/commit/f2c3451c2a8bc91bcca65372d2944a07a3c34a9a))
- **RESTPutAPIApplicationGuildCommandsJSONBody:** add missing `id` ([#522](https://github.com/discordjs/discord-api-types/issues/522)) ([4af2ea9](https://github.com/discordjs/discord-api-types/commit/4af2ea91415a5662171d342379c4bd33bfa5a6d5))
## [0.36.1](https://github.com/discordjs/discord-api-types/compare/0.36.0...0.36.1) (2022-07-04)
### Features
- **APIApplicationCommandStringOption:** add `min_length` and `max_length` ([#513](https://github.com/discordjs/discord-api-types/issues/513)) ([2cade98](https://github.com/discordjs/discord-api-types/commit/2cade98ed0a0a074254fbc1580fc56d0e0b3dc9c))
# [0.36.0](https://github.com/discordjs/discord-api-types/compare/0.35.0...0.36.0) (2022-06-30)
### Features
- **APIBaseInteraction:** add `app_permissions` ([#509](https://github.com/discordjs/discord-api-types/issues/509)) ([0c65d40](https://github.com/discordjs/discord-api-types/commit/0c65d40af00499233830ce272a2a274bcd5b9e8c))
- **MessageType:** update names ([#498](https://github.com/discordjs/discord-api-types/issues/498)) ([12072b7](https://github.com/discordjs/discord-api-types/commit/12072b70a0c70e1e1f9de920789e26829268de12))
- **RESTJSONErrorCodes:** add error 20024 ([#480](https://github.com/discordjs/discord-api-types/issues/480)) ([34908aa](https://github.com/discordjs/discord-api-types/commit/34908aa4ceeca4b58276cc207f5bdb77cef04296))
### BREAKING CHANGES
- **MessageType:** The following message types have been renamed:
* `GuildMemberJoin` -> `UserJoin`
* `UserPremiumGuildSubscription` -> `GuildBoost`
* `UserPremiumGuildSubscriptionTier1` -> `GuildBoostTier1`
* `UserPremiumGuildSubscriptionTier2` -> `GuildBoostTier2`
* `UserPremiumGuildSubscriptionTier3` -> `GuildBoostTier3`
# [0.35.0](https://github.com/discordjs/discord-api-types/compare/0.34.0...0.35.0) (2022-06-23)
### Code Refactoring
- **GatewayIdentifyProperties:** remove `$` prefix from keys ([#493](https://github.com/discordjs/discord-api-types/issues/493)) ([3b10c60](https://github.com/discordjs/discord-api-types/commit/3b10c60faa5943501ab1f7cfa0d5f3c5317cdbbd))
### Features
- **APIEmbedVideo:** add missing `proxy_url` property ([#496](https://github.com/discordjs/discord-api-types/issues/496)) ([56d491f](https://github.com/discordjs/discord-api-types/commit/56d491fa6808d9a8762bff606ca8feb5e11f13a4))
- **REST:** add `CDNRoutes` ([#502](https://github.com/discordjs/discord-api-types/issues/502)) ([0609886](https://github.com/discordjs/discord-api-types/commit/06098869d552139fadcc204b5ce4e1a7e5352b68))
- **UserFlags:** add `Quarantined` flag ([#495](https://github.com/discordjs/discord-api-types/issues/495)) ([fc3aa1c](https://github.com/discordjs/discord-api-types/commit/fc3aa1c9110e4730c6b8ba3e36815ecd2da66c68))
### BREAKING CHANGES
- **GatewayIdentifyProperties:** The fields for identify no longer use the `$` prefix for the values.
# [0.34.0](https://github.com/discordjs/discord-api-types/compare/0.33.5...0.34.0) (2022-06-13)
### Code Refactoring
- separate `MESSAGE_CREATE` fields from `APIMessage` object ([#434](https://github.com/discordjs/discord-api-types/issues/434)) ([0bb2204](https://github.com/discordjs/discord-api-types/commit/0bb2204b5ddd32b791641a33d52669bc739bc208))
### Features
- add guild mfa endpoint and error `50017` ([#476](https://github.com/discordjs/discord-api-types/issues/476)) ([292c6b5](https://github.com/discordjs/discord-api-types/commit/292c6b58ee9384db2ce06addb80d2ea2bcd32de2))
- **RESTJSONErrorCodes:** add 220003 error ([#466](https://github.com/discordjs/discord-api-types/issues/466)) ([20653b3](https://github.com/discordjs/discord-api-types/commit/20653b34819f6adf8116bef2a1e5edc3233c4117))
### BREAKING CHANGES
- Certain fields that come only through the gateway are now correctly typed as such
## [0.33.5](https://github.com/discordjs/discord-api-types/compare/0.33.4...0.33.5) (2022-06-07)
### Bug Fixes
- **GatewayGuildCreateDispatch:** add missing `GatewayGuildCreateDispatch` ([#477](https://github.com/discordjs/discord-api-types/issues/477)) ([d268e0b](https://github.com/discordjs/discord-api-types/commit/d268e0bff7429e1cde43174fdf6d2342569860d5))
- **RESTPostAPIWebhookWithTokenJSONBody:** `thread_name` should be optional ([#479](https://github.com/discordjs/discord-api-types/issues/479)) ([eff8892](https://github.com/discordjs/discord-api-types/commit/eff8892b03656cfc2b709c6c30edb98e38bf2a1e))
### Features
- **RESTJSONErrorCodes:** add error `30052` ([#469](https://github.com/discordjs/discord-api-types/issues/469)) ([d854317](https://github.com/discordjs/discord-api-types/commit/d8543177cd978a19daa32fbb183892b6f8c24772))
## [0.33.4](https://github.com/discordjs/discord-api-types/compare/0.33.3...0.33.4) (2022-06-06)
### Features
- **RESTPostAPIWebhookWithTokenJSONBody:** add `thread_name` ([#463](https://github.com/discordjs/discord-api-types/issues/463)) ([8e5f07e](https://github.com/discordjs/discord-api-types/commit/8e5f07e2eebc14e5777dbfb932ef54f252165524))
## [0.33.3](https://github.com/discordjs/discord-api-types/compare/0.33.2...0.33.3) (2022-06-04)
### Bug Fixes
- **AddUndefinedToPossiblyUndefinedProperties:** recurse down objects ([#471](https://github.com/discordjs/discord-api-types/issues/471)) ([43c372d](https://github.com/discordjs/discord-api-types/commit/43c372d81722e48b105d5121a2cfdf614f1e7704))
## [0.33.2](https://github.com/discordjs/discord-api-types/compare/0.33.1...0.33.2) (2022-06-01)
### Bug Fixes
- **docs-site:** website link colors ([#457](https://github.com/discordjs/discord-api-types/issues/457)) ([51e664d](https://github.com/discordjs/discord-api-types/commit/51e664d8e826e7f0aa467c000f3a1707fc283a36))
- **GatewayGuildCreateDispatch:** add extra fields that were missing ([#458](https://github.com/discordjs/discord-api-types/issues/458)) ([15fcd1b](https://github.com/discordjs/discord-api-types/commit/15fcd1b2a85e8d1e136416a66326a4aadcc301fb))
- **RestPostAPIBaseApplicationJSONBody:** make `default_member_permissions` optional ([#460](https://github.com/discordjs/discord-api-types/issues/460)) ([6a813be](https://github.com/discordjs/discord-api-types/commit/6a813be83382e1606f1921cf00179fe1ce75c04f))
## [0.33.1](https://github.com/discordjs/discord-api-types/compare/0.33.0...0.33.1) (2022-05-26)
### Bug Fixes
- **RESTPostAPIApplicationGuildCommands:** correct types due to unions ([#447](https://github.com/discordjs/discord-api-types/issues/447)) ([6d85ad6](https://github.com/discordjs/discord-api-types/commit/6d85ad6b1d707b980f9897ea68dd4b7573b3a770))
### Features
- **RESTJSONErrorCodes:** add error `50600` ([#444](https://github.com/discordjs/discord-api-types/issues/444)) ([5ef49f4](https://github.com/discordjs/discord-api-types/commit/5ef49f41cecaa1d5937428a5c58f1d88bfc61266))
- **RESTPostAPIGuildChannels:** update post body fields ([#419](https://github.com/discordjs/discord-api-types/issues/419)) ([748db34](https://github.com/discordjs/discord-api-types/commit/748db34e30338cf4a9fd8ce7b86d1d5c7dde63b1))
# [0.33.0](https://github.com/discordjs/discord-api-types/compare/0.32.1...0.33.0) (2022-05-16)
### Code Refactoring
- **GuildFeature:** thread archive durations are no longer boost locked ([#412](https://github.com/discordjs/discord-api-types/issues/412)) ([1737ade](https://github.com/discordjs/discord-api-types/commit/1737adea1fc3d5050db30266e49c63277b7a77fc))
- separate `GUILD_CREATE` fields from `APIGuild` object ([#423](https://github.com/discordjs/discord-api-types/issues/423)) ([17f5caa](https://github.com/discordjs/discord-api-types/commit/17f5caa671da50a79d61393f5a970ce59c5d875e))
### Features
- add support for application command permissions v2 ([#415](https://github.com/discordjs/discord-api-types/issues/415)) ([d3163ca](https://github.com/discordjs/discord-api-types/commit/d3163ca22e5b7d8292f9f6ccd444aa5c93771d92))
- **OAuth2Scopes:** add new OAuth2 scopes ([#435](https://github.com/discordjs/discord-api-types/issues/435)) ([8f16f45](https://github.com/discordjs/discord-api-types/commit/8f16f452ac7dc8988617d1211fc6a9547d254795))
- **rest:** add missing guild routes results ([#438](https://github.com/discordjs/discord-api-types/issues/438)) ([1afce87](https://github.com/discordjs/discord-api-types/commit/1afce87fbef8e43ee040010e36019a4ebc6fecfe))
### BREAKING CHANGES
- APIGuild now correctly shows just the properties that are obtainable through rest/GUILD_UPDATE, while the extra fields have been moved to GatewayGuildCreateDispatchData to correctly represent the data received
- **GuildFeature:** `SevenDayThreadArchive` and `ThreeDayThreadArchive` have been removed as they are no longer valid
## [0.32.1](https://github.com/discordjs/discord-api-types/compare/0.32.0...0.32.1) (2022-05-05)
### Features
- **RESTJSONErrorCodes:** add error `50080` ([#408](https://github.com/discordjs/discord-api-types/issues/408)) ([43cfbcb](https://github.com/discordjs/discord-api-types/commit/43cfbcba284a96de6bde101b866ad9ac306992b5))
- **RESTPostAPIGuildForumThreads:** add `message` field ([#416](https://github.com/discordjs/discord-api-types/issues/416)) ([a28c824](https://github.com/discordjs/discord-api-types/commit/a28c824f82014b15a715b51b4426356428bb4ba2))
# [0.32.0](https://github.com/discordjs/discord-api-types/compare/0.31.2...0.32.0) (2022-04-25)
### Bug Fixes
- add `position` property to create channel options ([#409](https://github.com/discordjs/discord-api-types/issues/409)) ([3fe53ce](https://github.com/discordjs/discord-api-types/commit/3fe53ced9f0e61473a8b92d0503c51084e6a58f3))
### Code Refactoring
- **APIGuildIntegration:** make `enabled` optional ([#406](https://github.com/discordjs/discord-api-types/issues/406)) ([1212eb9](https://github.com/discordjs/discord-api-types/commit/1212eb933e6bf1d82b1b41164030bd317e9c59eb))
### BREAKING CHANGES
- **APIGuildIntegration:** `enabled` is now properly marked as optional
## [0.31.2](https://github.com/discordjs/discord-api-types/compare/0.31.1...0.31.2) (2022-04-18)
### Features
- **RESTPostAPIGuildChannelJSONBody:** add `default_auto_archive` prop ([#400](https://github.com/discordjs/discord-api-types/issues/400)) ([6a192b1](https://github.com/discordjs/discord-api-types/commit/6a192b132c11f13d95ea3e7ed1eb556600f2f415))
## [0.31.1](https://github.com/discordjs/discord-api-types/compare/0.31.0...0.31.1) (2022-04-11)
### Features
- **APIApplicationCommandInteractionData:** add `guild_id` ([#396](https://github.com/discordjs/discord-api-types/issues/396)) ([bc6e97f](https://github.com/discordjs/discord-api-types/commit/bc6e97f309b1f5e0bc0063ada3aed77f34214e9f))
- **APIGuildForum:** add support for forums, part 1 ([#398](https://github.com/discordjs/discord-api-types/issues/398)) ([bf08484](https://github.com/discordjs/discord-api-types/commit/bf084849885dd15b19f4f46aa260815037131600))
- student hubs ([#215](https://github.com/discordjs/discord-api-types/issues/215)) ([69079ee](https://github.com/discordjs/discord-api-types/commit/69079ee132777977e9a9e163696ffdc8db82fe38))
# [0.31.0](https://github.com/discordjs/discord-api-types/compare/0.30.0...0.31.0) (2022-04-04)
### Code Refactoring
- **APIGroupDMChannel:** make `name` nullable ([#347](https://github.com/discordjs/discord-api-types/issues/347)) ([ed0049b](https://github.com/discordjs/discord-api-types/commit/ed0049b78f4008460b0c7a2ec68eb38f018be3bd))
- remove `summary` from applications ([#386](https://github.com/discordjs/discord-api-types/issues/386)) ([f0ab4e8](https://github.com/discordjs/discord-api-types/commit/f0ab4e8c48895f8daee7fa296b8319a98fb7d4e1))
- remove store channels ([#364](https://github.com/discordjs/discord-api-types/issues/364)) ([25677ff](https://github.com/discordjs/discord-api-types/commit/25677fff43533b3b11b88f01efe98f0875014cb5))
### Features
- add `RESTGetAPIGuildBansQuery` ([#391](https://github.com/discordjs/discord-api-types/issues/391)) ([b1bf7bf](https://github.com/discordjs/discord-api-types/commit/b1bf7bf0f9a37fa391a67e4b5b1dd288821d0ebb))
- **APIApplication:** app authorization links and tags ([#239](https://github.com/discordjs/discord-api-types/issues/239)) ([93eab11](https://github.com/discordjs/discord-api-types/commit/93eab113cdcfd3bdd868f1d86bb4bc2a5247d844))
- **APIApplicationCommand:** add missing localization props ([#383](https://github.com/discordjs/discord-api-types/issues/383)) ([9c12718](https://github.com/discordjs/discord-api-types/commit/9c1271816312382be3471cb2fdbb6260e973b4f6))
- **APIAuditLogChange:** add `APIAuditLogChangeKeyImageHash` ([#379](https://github.com/discordjs/discord-api-types/issues/379)) ([f532002](https://github.com/discordjs/discord-api-types/commit/f532002574b655d87151c325be6c02fe6f65bbe0))
- **GuildFeatures:** add animated banners ([#219](https://github.com/discordjs/discord-api-types/issues/219)) ([c23f2ac](https://github.com/discordjs/discord-api-types/commit/c23f2accf998ffa0c068d222fd9f34228a86a699))
- **RESTPostAPIStageInstanceJSONBody:** add `send_start_notification` ([#378](https://github.com/discordjs/discord-api-types/issues/378)) ([b764e8d](https://github.com/discordjs/discord-api-types/commit/b764e8dc1a92e254161f3a443e17148a81240b66))
### BREAKING CHANGES
- The deprecated `summary` field has been removed
- Store channels have been removed, alongside their types
- **APIGroupDMChannel:** The `name` field is now also nullable for Group DM Channels
# [0.30.0](https://github.com/discordjs/discord-api-types/compare/0.29.0...0.30.0) (2022-03-24)
### Bug Fixes
- **APIGuildIntegrationType:** correct name of type ([#366](https://github.com/discordjs/discord-api-types/issues/366)) ([fa740eb](https://github.com/discordjs/discord-api-types/commit/fa740eb16c8bba9d2c9c915d2e0139e5e1211040))
### Features
- **APIApplicationCommand:** add command localization ([#370](https://github.com/discordjs/discord-api-types/issues/370)) ([f702988](https://github.com/discordjs/discord-api-types/commit/f70298811242d946cee01b112c34382f0e54cb78))
### Reverts
- fix(GatewayVoiceState): some fields are optional instead of nullable ([#367](https://github.com/discordjs/discord-api-types/issues/367)) ([e822e45](https://github.com/discordjs/discord-api-types/commit/e822e45b3b6e07eb85a45039975cb33636765f5e))
### BREAKING CHANGES
- **APIGuildIntegrationType:** `APIGuildInteractionType` is now correctly named `APIGuildIntegrationType`
# [0.29.0](https://github.com/discordjs/discord-api-types/compare/0.28.0...0.29.0) (2022-03-10)
### Bug Fixes
- **GatewayVoiceState:** some fields are optional instead of nullable ([#345](https://github.com/discordjs/discord-api-types/issues/345)) ([fddff21](https://github.com/discordjs/discord-api-types/commit/fddff2167c858832d6c61f3efca8d944fd356a85))
- **RESTJSONErrorCodes:** typo in error `30046` ([#362](https://github.com/discordjs/discord-api-types/issues/362)) ([854aa36](https://github.com/discordjs/discord-api-types/commit/854aa3691c4d16a2c7fec7421cf25ea03a030e55))
### Code Refactoring
- **APIGuildScheduledEventBase:** make `description` nullable ([#359](https://github.com/discordjs/discord-api-types/issues/359)) ([e5710d0](https://github.com/discordjs/discord-api-types/commit/e5710d0e42d4f597bc9ed5594619a5032bf59bcb))
- make things optional and nullable where applicable ([#361](https://github.com/discordjs/discord-api-types/issues/361)) ([10fdeaa](https://github.com/discordjs/discord-api-types/commit/10fdeaa68df9b3b61b20b8d90b9587d03d95a450))
- **RESTJSONErrorCodes:** update error `50008` key ([#338](https://github.com/discordjs/discord-api-types/issues/338)) ([9a57848](https://github.com/discordjs/discord-api-types/commit/9a578489ad05b2ba8ed8d496db19cb86fa572ef7))
### Features
- **APIInviteGuild:** add boost count ([#323](https://github.com/discordjs/discord-api-types/issues/323)) ([cb92843](https://github.com/discordjs/discord-api-types/commit/cb92843991307d59c61d017d8ab1adcd469b4512))
- **APIStageInstance:** add `guild_scheduled_event_id` ([#350](https://github.com/discordjs/discord-api-types/issues/350)) ([d06d2d6](https://github.com/discordjs/discord-api-types/commit/d06d2d6a9a8ccc84337b2ce9c59430694ae93e8a))
- **RESTJSONErrorCodes:** add error `10065` ([#336](https://github.com/discordjs/discord-api-types/issues/336)) ([e8127b8](https://github.com/discordjs/discord-api-types/commit/e8127b89f89c4612fab0d3702ce512e41ab75b6e))
### BREAKING CHANGES
- **RESTJSONErrorCodes:** `MaximumNumberOfEditsToMessagesOlderThanOneHourReached` is no longer mistyped as `MaxmimumNumberOfEditsToMessagesOlderThanOneHourReached`
- **APIGuildScheduledEventBase:** The type for `description` can also be null, not just optional
- **RESTJSONErrorCodes:** The error code `50008` has been renamed from `CannotSendMessagesInVoiceChannel` to `CannotSendMessagesInNonTextChannel`
- The deprecated `asset` field for stickers is correctly marked as optional now. The `image` field for Guild Scheduled Events is now correctly typed as optional.
- **GatewayVoiceState:** `channel_id` and `request_to_speak_timestamp` are correctly typed as optional, not nullable now.
# [0.28.0](https://github.com/discordjs/discord-api-types/compare/0.27.3...0.28.0) (2022-03-07)
### Code Refactoring
- **PermissionFlagsBits:** rename `StartEmbeddedActivities` to `UseEmbeddedActivities` ([#342](https://github.com/discordjs/discord-api-types/issues/342)) ([3e3acb5](https://github.com/discordjs/discord-api-types/commit/3e3acb5297e3e546fbb7fc82acddb50170ffc1de))
### Features
- add support for TS module: NodeNext ([#356](https://github.com/discordjs/discord-api-types/issues/356)) ([e9ee696](https://github.com/discordjs/discord-api-types/commit/e9ee6966c38c82544536ece85af0c1b3bd592bfc))
- **MessageComponentInteraction:** export specific interaction aliases ([#353](https://github.com/discordjs/discord-api-types/issues/353)) ([3503a4f](https://github.com/discordjs/discord-api-types/commit/3503a4fd384be8459a1628a6f019a1bc164c0386))
- **Utils:** add more typeguard functions to determine the interaction types ([#355](https://github.com/discordjs/discord-api-types/issues/355)) ([dec7717](https://github.com/discordjs/discord-api-types/commit/dec7717bc76ac86c8b7d45ed4e0b506e532f7cb9))
### BREAKING CHANGES
- **PermissionFlagsBits:** The `StartEmbeddedActivities` permission flag has been renamed to `UseEmbeddedActivities`
## [0.27.3](https://github.com/discordjs/discord-api-types/compare/0.27.2...0.27.3) (2022-02-24)
### Bug Fixes
- **APIApplicationCommandAutocompleteInteraction:** make `options` field required for v10 (PR [#332](https://github.com/discordjs/discord-api-types/issues/332) redo) ([#339](https://github.com/discordjs/discord-api-types/issues/339)) ([8d432f2](https://github.com/discordjs/discord-api-types/commit/8d432f2ebe54904cc0285b1e05706ca105ece7b8))
## [0.27.2](https://github.com/discordjs/discord-api-types/compare/0.27.1...0.27.2) (2022-02-17)
### Bug Fixes
- **APIApplicationCommandAutocompleteInteraction:** make `options` field required ([#332](https://github.com/discordjs/discord-api-types/issues/332)) ([5396daf](https://github.com/discordjs/discord-api-types/commit/5396daf0dbbe7ed54d94c621649b746b1131dee9))
- **APIInteractionResponse:** add `APIModalInteractionResponse` to union ([#333](https://github.com/discordjs/discord-api-types/issues/333)) ([a8f19e6](https://github.com/discordjs/discord-api-types/commit/a8f19e6a19cbefd99c8c8bd35e565ab3584c9eeb))
### Features
- api v10 ([#331](https://github.com/discordjs/discord-api-types/issues/331)) ([8e87b3e](https://github.com/discordjs/discord-api-types/commit/8e87b3e1ce35201503623839602c44fe2a52a27b))
## [0.27.1](https://github.com/discordjs/discord-api-types/compare/0.27.0...0.27.1) (2022-02-14)
### Bug Fixes
- **APIInteraction:** add modal submit interaction & make `data` required in APIModalSubmit ([#321](https://github.com/discordjs/discord-api-types/issues/321)) ([f88727b](https://github.com/discordjs/discord-api-types/commit/f88727bd80d32f3ddf4374b1fd46ce50c36eea4d))
- **APIInteractions:** export ApplicationCommandAutocomplete ([#309](https://github.com/discordjs/discord-api-types/issues/309)) ([5056da5](https://github.com/discordjs/discord-api-types/commit/5056da523af6154fbf2fbcf10e30ce437ec42ce8))
- **CI:** skip pull request checks for runs that don't include the token ([#327](https://github.com/discordjs/discord-api-types/issues/327)) ([0ad06fc](https://github.com/discordjs/discord-api-types/commit/0ad06fc639d7f8bdff135a58d435e6cb15029842))
- make `data` required in autocomplete interaction and add separate dm/guild types ([#322](https://github.com/discordjs/discord-api-types/issues/322)) ([7abeb2e](https://github.com/discordjs/discord-api-types/commit/7abeb2e0391d6e47517edba63342ba9c4adc4fcb))
### Features
- **RESTJSONErrorCodes:** add error 40060 ([#320](https://github.com/discordjs/discord-api-types/issues/320)) ([72e9617](https://github.com/discordjs/discord-api-types/commit/72e9617fee6e05d2eb4b715c0261d316ff0e1f1e))
# [0.27.0](https://github.com/discordjs/discord-api-types/compare/0.26.1...0.27.0) (2022-02-10)
### Bug Fixes
- **GatewayThreadCreateDispatchData:** `newly_created` is optional, and `true` when present ([#312](https://github.com/discordjs/discord-api-types/issues/312)) ([87b9b08](https://github.com/discordjs/discord-api-types/commit/87b9b0885a3734b376e64da51d7667b74558f7e5))
### Code Refactoring
- **ActivityType:** change `Game` to `Playing` ([#298](https://github.com/discordjs/discord-api-types/issues/298)) ([08a8b28](https://github.com/discordjs/discord-api-types/commit/08a8b28ee1ed2041744d922db35dab24f3861469))
- **UserFlags:** remove `None` ([#308](https://github.com/discordjs/discord-api-types/issues/308)) ([8e13cd8](https://github.com/discordjs/discord-api-types/commit/8e13cd80c66d11d93157a053e329ad98ece4a457))
### Features
- **APIGuildPreview:** add `stickers` ([#279](https://github.com/discordjs/discord-api-types/issues/279)) ([310c68f](https://github.com/discordjs/discord-api-types/commit/310c68f034812072ca3cacbeaff1f5b9454e3409))
- **APIInteraction:** add locale props to interactions ([#273](https://github.com/discordjs/discord-api-types/issues/273)) ([03b8d3f](https://github.com/discordjs/discord-api-types/commit/03b8d3fee032fb77213389019baa2b80377dcfdc))
- **APIMessageInteraction:** add `member` field ([#299](https://github.com/discordjs/discord-api-types/issues/299)) ([80ed7ba](https://github.com/discordjs/discord-api-types/commit/80ed7ba1c1ebb2e12d3a04339d4ff0209be9bbef))
- **APIScheduledEvent:** add `image` prop ([#303](https://github.com/discordjs/discord-api-types/issues/303)) ([663c4e9](https://github.com/discordjs/discord-api-types/commit/663c4e97fbe2029ab040388b50d5600bfe281c4f))
- **APIThreadMetadata:** add `create_timestamp` field ([#301](https://github.com/discordjs/discord-api-types/issues/301)) ([d95d956](https://github.com/discordjs/discord-api-types/commit/d95d9562dcc514556f3a4ced3e8f3ee4c5ed1282))
- **ApplicationCommand:** attachment application command option type ([#272](https://github.com/discordjs/discord-api-types/issues/272)) ([71c4e6a](https://github.com/discordjs/discord-api-types/commit/71c4e6aecd044ce5282742c0e47bff7b64b890f7))
- **GatewayThreadCreateDispatch:** Add `newly_created` field ([#311](https://github.com/discordjs/discord-api-types/issues/311)) ([7e54215](https://github.com/discordjs/discord-api-types/commit/7e542152da2e58f44c2314d5bd3b04a518fa979e))
- **Interactions:** add modal and text input interactions ([#243](https://github.com/discordjs/discord-api-types/issues/243)) ([bf0f66b](https://github.com/discordjs/discord-api-types/commit/bf0f66b60a97f79c0e80ace5b408baee343bc82c))
- **Locales:** add locale string enum ([#297](https://github.com/discordjs/discord-api-types/issues/297)) ([b07d5a0](https://github.com/discordjs/discord-api-types/commit/b07d5a0c2273b6b51b44542b638a768c36d0f184))
- **MessageFlags:** add `FailedToMentionSomeRolesInThread` ([#280](https://github.com/discordjs/discord-api-types/issues/280)) ([76588d9](https://github.com/discordjs/discord-api-types/commit/76588d9d384f71ace05d96de17889e4490874462))
- **RESTPostAPIChannelMessage, RESTPostAPIWebhookMessage:** add flags for creation ([#300](https://github.com/discordjs/discord-api-types/issues/300)) ([4194bd9](https://github.com/discordjs/discord-api-types/commit/4194bd9054a7e4b004f9244706f423292a8a0e56))
- **RESTJSONErrorCodes:** add error 30042 ([#305](https://github.com/discordjs/discord-api-types/issues/305)) ([9c2b185](https://github.com/discordjs/discord-api-types/commit/9c2b185367b1ea2e432355d76af8f19e8fca7398))
- **RESTJSONErrorCodes:** add error 30046 ([#304](https://github.com/discordjs/discord-api-types/issues/304)) ([56d3975](https://github.com/discordjs/discord-api-types/commit/56d39756c0d973ec56fe6e1eeb75d827f50aac81))
- **RESTJSONErrorCodes:** add error 40004 ([#314](https://github.com/discordjs/discord-api-types/issues/314)) ([269a75c](https://github.com/discordjs/discord-api-types/commit/269a75ccf7b413bfc031849713e919ebb8d87a1a))
- **RESTJSONErrorCodes:** add error 50068 ([#302](https://github.com/discordjs/discord-api-types/issues/302)) ([7655e20](https://github.com/discordjs/discord-api-types/commit/7655e2024800abc4431011668b83373e0868485e))
- **RESTJSONErrorCodes:** add error code 50086 ([#286](https://github.com/discordjs/discord-api-types/issues/286)) ([51fb37c](https://github.com/discordjs/discord-api-types/commit/51fb37cbba44677870f0f916bd1416bdbd34e052))
- **RESTPatchAPIGuildMember:** add `communication_disabled_until` field ([#289](https://github.com/discordjs/discord-api-types/issues/289)) ([5056b0f](https://github.com/discordjs/discord-api-types/commit/5056b0f2b3798480dbbc193fd80dedfefedff4fc))
- **RESTPatchAPIGuildMember:** add modify current member and deprecate nick route ([#262](https://github.com/discordjs/discord-api-types/issues/262)) ([9a982ff](https://github.com/discordjs/discord-api-types/commit/9a982ff8d9592a02d78f24295efd756dc0c69fa8))
- **RouteBases:** add base for guild scheduled events ([#293](https://github.com/discordjs/discord-api-types/issues/293)) ([83f29b6](https://github.com/discordjs/discord-api-types/commit/83f29b692839cc51869bcafdaf387b68731e0a28))
- **UserFlags:** add `Spammer` flag ([#294](https://github.com/discordjs/discord-api-types/issues/294)) ([03f12d7](https://github.com/discordjs/discord-api-types/commit/03f12d71eef2661ee5290152952ea1adc9a92383))
### types
- Add tagged `type` unions for channel types ([#200](https://github.com/discordjs/discord-api-types/issues/200)) ([2c1fbda](https://github.com/discordjs/discord-api-types/commit/2c1fbda621fc1c1ea227295c578e6d8486dbc4f2))
### BREAKING CHANGES
- **Interactions:** `APIBaseMessageComponent` was renamed to `APIBaseComponent`
- **UserFlags:** The `None` user flag is bye-bye (although I doubt anyone is using it)
- All of the channel types are now split based on their type. As such, you will need to assert the type (either by checking it with the enum or by casting the data as the correct channel) before accessing data.
_If you encounter any missing properties due to this, please open an issue! This is a big change, and we hope nothing is missing_
- **ActivityType:** `Game` was renamed to `Playing`
## [0.26.1](https://github.com/discordjs/discord-api-types/compare/0.26.0...0.26.1) (2022-01-02)
### Bug Fixes
- **APIApplicationCommandOption:** correct type for integer and number ([#284](https://github.com/discordjs/discord-api-types/issues/284)) ([fe1f531](https://github.com/discordjs/discord-api-types/commit/fe1f5313a8fc13d0a2433738cce9be37f5d9eeb5))
### Features
- **APIAuditLogChangeData:** Add `communication_disabled_until` ([#281](https://github.com/discordjs/discord-api-types/issues/281)) ([0cf51ab](https://github.com/discordjs/discord-api-types/commit/0cf51abc267bd6246a7952e7f6a23fa8c5db290a))
- **APIGuildScheduledEvent:** add more precise types for stage instance/voice/external events ([#278](https://github.com/discordjs/discord-api-types/issues/278)) ([751aee6](https://github.com/discordjs/discord-api-types/commit/751aee6fa7d4c542324a30e9b9bc641b0e7a8bf4))
- **ApplicationFlags:** add embedded application flags ([#277](https://github.com/discordjs/discord-api-types/issues/277)) ([9f4f59c](https://github.com/discordjs/discord-api-types/commit/9f4f59c8e55f78caf614e27e28b6bca939665ca5))
# [0.26.0](https://github.com/discordjs/discord-api-types/compare/0.25.2...0.26.0) (2021-12-24)
### Bug Fixes

View File

@@ -1,11 +1,14 @@
# Discord API Types
[![discord-api-types](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/svgs/logo_long_blurple.svg)](https://github.com/discordjs/discord-api-types)
[![GitHub](https://img.shields.io/github/license/discordjs/discord-api-types)](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
[![npm](https://img.shields.io/npm/v/discord-api-types?color=crimson&logo=npm)](https://www.npmjs.com/package/discord-api-types)
[![deno](https://img.shields.io/npm/v/discord-api-types?color=blue&label=deno&logo=deno)](https://deno.land/x/discord_api_types)
[![Patreon Donate](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Donate%20with%20Patreon&logo=patreon&colorB=F96854&link=https://www.patreon.com/vladfrangu)](https://www.patreon.com/vladfrangu)
[![Ko-fi Donate](https://img.shields.io/badge/kofi-donate-brightgreen.svg?label=Donate%20with%20Ko-fi&logo=ko-fi&colorB=F16061&link=https://ko-fi.com/wolfgalvlad&logoColor=FFFFFF)](https://ko-fi.com/wolfgalvlad)
[![GitHub Sponsors](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Sponsor%20through%20GitHub&logo=github&colorB=F96854&link=https://github.com/sponsors/vladfrangu)](https://github.com/sponsors/vladfrangu)
[![Powered by Vercel](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/powered-by-vercel.svg)](https://vercel.com?utm_source=discordjs&utm_campaign=oss)
Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro).
@@ -24,26 +27,26 @@ pnpm add discord-api-types
You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples
```js
const { APIUser } = require('discord-api-types/v9');
const { APIUser } = require('discord-api-types/v10');
```
```ts
// TypeScript/ES Module support
import { APIUser } from 'discord-api-types/v9';
import { APIUser } from 'discord-api-types/v10';
```
You may also import just certain parts of the module that you need. The possible values are: `globals`, `gateway`, `gateway/v*`, `payloads`, `payloads/v*`, `rest`, `rest/v*`, `rpc`, `rpc/v*`, `utils`, `utils/v*`, `voice`, and `voice/v*`. Below are some examples
```js
const { GatewayVersion } = require('discord-api-types/gateway/v9');
const { GatewayVersion } = require('discord-api-types/gateway/v10');
```
```ts
// TypeScript/ES Module support
import { GatewayVersion } from 'discord-api-types/gateway/v9';
import { GatewayVersion } from 'discord-api-types/gateway/v10';
```
> _**Note:** The `v*` exports (`discord-api-type/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
> _**Note:** The `v*` exports (`discord-api-types/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
### Deno
@@ -53,21 +56,21 @@ We also provide typings compatible with the [deno](https://deno.land/) runtime.
```ts
// Importing a specific API version
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v9.ts';
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v10.ts';
```
2. From [deno.land/x](https://deno.land/x)
```ts
// Importing a specific API version
import { APIUser } from 'https://deno.land/x/discord_api_types/v9.ts';
import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts';
```
3. From [skypack.dev](https://www.skypack.dev/)
```ts
// Importing a specific API version
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v9?dts';
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
```
## Project Structure
@@ -94,4 +97,9 @@ The exports of each API version is split into three main parts:
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means _and have received the green light to be used_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will **NOT** be included.
**A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs),
that are mentioned in an open pull request, or known through other means _and have received the green light to be used_.
Anything else will not be documented (for example client only types).
With that aside, we may allow certain types that are not documented in the [API Documentation repository](https://github.com/discord/discord-api-docs) on a case by case basis.
They will be documented with an `@unstable` tag and are not subject with the same versioning rules.

View File

@@ -1,3 +1,438 @@
## [0.37.11](https://github.com/discordjs/discord-api-types/compare/0.37.10...0.37.11) (2022-09-26)
### Features
- **APIGuildForumChannel:** add `default_sort_order` ([#589](https://github.com/discordjs/discord-api-types/issues/589)) ([143b003](https://github.com/discordjs/discord-api-types/commit/143b003fbe5a86eda225e9da1d0914d6e48cddfd))
- **APIGuildForumChannel:** update and add missing features ([#575](https://github.com/discordjs/discord-api-types/issues/575)) ([0f118d3](https://github.com/discordjs/discord-api-types/commit/0f118d382f94151b1c9be42620520c91b20a05f6))
## [0.37.10](https://github.com/discordjs/discord-api-types/compare/0.37.9...0.37.10) (2022-09-15)
### Features
- add `RESTRateLimit` ([#585](https://github.com/discordjs/discord-api-types/issues/585)) ([f4d3f4d](https://github.com/discordjs/discord-api-types/commit/f4d3f4d5b1c1b6e42c2a8f8184f43d67b586c8c1))
- **APIConnection:** add `two_way_link` ([#546](https://github.com/discordjs/discord-api-types/issues/546)) ([d452f63](https://github.com/discordjs/discord-api-types/commit/d452f6346bd4953a8d777f3818797c4285b1b842))
- **APIGuild:** document afk timeout values ([#570](https://github.com/discordjs/discord-api-types/issues/570)) ([32f5a7b](https://github.com/discordjs/discord-api-types/commit/32f5a7b9814b69da7fc3772ec1f0307d39cda087))
## [0.37.9](https://github.com/discordjs/discord-api-types/compare/0.37.8...0.37.9) (2022-09-12)
### Features
- **ConnectionService:** add new connections ([#548](https://github.com/discordjs/discord-api-types/issues/548)) ([afd3b55](https://github.com/discordjs/discord-api-types/commit/afd3b55c08b0cf75cc4f5a06d3574b6cf532cb6c))
## [0.37.8](https://github.com/discordjs/discord-api-types/compare/0.37.7...0.37.8) (2022-09-08)
### Features
- **GuildFeature:** add `InvitesDisabled` ([#549](https://github.com/discordjs/discord-api-types/issues/549)) ([2708cb9](https://github.com/discordjs/discord-api-types/commit/2708cb9dcaa07d19ca71e9ca211e78939b9d1ff4))
## [0.37.7](https://github.com/discordjs/discord-api-types/compare/0.37.6...0.37.7) (2022-09-05)
### Bug Fixes
- **ChannelType:** bring back old names ([b08f2e3](https://github.com/discordjs/discord-api-types/commit/b08f2e34dbe9afccca6f565db6c7b27a21453d85))
## [0.37.6](https://github.com/discordjs/discord-api-types/compare/0.37.5...0.37.6) (2022-09-05)
### Bug Fixes
- **APIModalSubmission:** `components` is not optional ([#574](https://github.com/discordjs/discord-api-types/issues/574)) ([f69b586](https://github.com/discordjs/discord-api-types/commit/f69b586d0148afd017e6da70ab8d745b6ba04ba4))
- **GuildChannelType:** add missing `GuildCategory` type ([#579](https://github.com/discordjs/discord-api-types/issues/579)) ([815c68f](https://github.com/discordjs/discord-api-types/commit/815c68fe46034029200a8e2903748a3d2e6af7b9))
- **RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody:** `channel_id` is optional ([#547](https://github.com/discordjs/discord-api-types/issues/547)) ([b7b855b](https://github.com/discordjs/discord-api-types/commit/b7b855b2005bb3989810850d6e00bec443a15c92))
### Features
- **APIGuildIntegration:** add `scopes` ([#563](https://github.com/discordjs/discord-api-types/issues/563)) ([73d15dd](https://github.com/discordjs/discord-api-types/commit/73d15ddcbbc676efac876602a3cd726bfe4c378a))
- **ApplicationFlags:** add `ApplicationCommandBadge` ([#537](https://github.com/discordjs/discord-api-types/issues/537)) ([48f0f56](https://github.com/discordjs/discord-api-types/commit/48f0f562bab10d2a1e331474fb963af8631b788b))
- **RESTPutAPIGuildBanJSONBody:** add `delete_message_seconds` ([#534](https://github.com/discordjs/discord-api-types/issues/534)) ([4e362d5](https://github.com/discordjs/discord-api-types/commit/4e362d52608e99d466b43cd37ec6b6bb1222b660))
## [0.37.5](https://github.com/discordjs/discord-api-types/compare/0.37.4...0.37.5) (2022-08-25)
### Features
- **FormattingPatterns:** add `ApplicationCommand` ([#525](https://github.com/discordjs/discord-api-types/issues/525)) ([0098889](https://github.com/discordjs/discord-api-types/commit/00988894995f7ac5e8ddc34125704a230329137c))
## [0.37.4](https://github.com/discordjs/discord-api-types/compare/0.37.3...0.37.4) (2022-08-22)
### Features
- add common JSON error types ([#568](https://github.com/discordjs/discord-api-types/issues/568)) ([956f289](https://github.com/discordjs/discord-api-types/commit/956f289e885763a620cb67a36e7e42683b5c08bf))
- **ApplicationCommand:** export base chat input types ([#569](https://github.com/discordjs/discord-api-types/issues/569)) ([248484e](https://github.com/discordjs/discord-api-types/commit/248484e55613e2da3f1d659395e1f4c010cb51b5))
## [0.37.3](https://github.com/discordjs/discord-api-types/compare/0.37.2...0.37.3) (2022-08-18)
### Features
- **RESTJSONErrorCodes:** add 240000 ([#565](https://github.com/discordjs/discord-api-types/issues/565)) ([5bb50ae](https://github.com/discordjs/discord-api-types/commit/5bb50ae7ea6859845c9d9996f02ac42c61413df0))
## [0.37.2](https://github.com/discordjs/discord-api-types/compare/0.37.1...0.37.2) (2022-08-11)
### Bug Fixes
- **GatewayGuildMembersChunkDispatchData:** make chunk pagination properties mandatory ([#558](https://github.com/discordjs/discord-api-types/issues/558)) ([0e03e39](https://github.com/discordjs/discord-api-types/commit/0e03e39aa2bf8f1b9a58113a3242c4722e64922b))
- **GatewayRequestGuildMembersData:** limit being required with user_ids ([#559](https://github.com/discordjs/discord-api-types/issues/559)) ([dc3d5df](https://github.com/discordjs/discord-api-types/commit/dc3d5df0a2931eff63991987166634661d5bd1d8))
- **RESTGetAPIChannelUsersThreadsArchivedResult:** add `has_more` missing field ([#543](https://github.com/discordjs/discord-api-types/issues/543)) ([796f6d8](https://github.com/discordjs/discord-api-types/commit/796f6d8a3b2f55d2a120137801e0450ddf30576e))
### Features
- add search that might or might not work ([f8a9c8b](https://github.com/discordjs/discord-api-types/commit/f8a9c8b5c6bdd73bcbf9dd6fff66fafac2594ba4))
- **APIVoiceChannel:** support text in voice, properties `last_message_id` and `rate_limit_per_user` ([#544](https://github.com/discordjs/discord-api-types/issues/544)) ([4488d8f](https://github.com/discordjs/discord-api-types/commit/4488d8fd2611a6547fc6149ba1cec5682340a119))
- **GatewayReadyDispatchData:** add `resume_gateway_url` ([#552](https://github.com/discordjs/discord-api-types/issues/552)) ([9a50367](https://github.com/discordjs/discord-api-types/commit/9a50367dad3a06fbca6e8d1fdd98fbf144595d4e))
## [0.37.1](https://github.com/discordjs/discord-api-types/compare/0.37.0...0.37.1) (2022-08-04)
# [0.37.0](https://github.com/discordjs/discord-api-types/compare/0.36.3...0.37.0) (2022-07-28)
### Code Refactoring
- **RESTJSONErrorCodes:** use `MaximumThreadParticipantsReached` instead in error code 30033 ([#540](https://github.com/discordjs/discord-api-types/issues/540)) ([cecf17b](https://github.com/discordjs/discord-api-types/commit/cecf17b4158fbebb3ee508518a9e9a7b1297356f))
### BREAKING CHANGES
- **RESTJSONErrorCodes:** `MaximumThreadParticipants` was renamed to `MaximumThreadParticipantsReached` for consistency with the rest of the codes
## [0.36.3](https://github.com/discordjs/discord-api-types/compare/0.36.2...0.36.3) (2022-07-21)
### Features
- **APIConnection:** add `ConnectionService` to `type` ([#491](https://github.com/discordjs/discord-api-types/issues/491)) ([4577ac2](https://github.com/discordjs/discord-api-types/commit/4577ac2609f4a861505bc41f4293f482db251cdc))
- **APIThreadChannel:** add fields about new message counter capability ([#532](https://github.com/discordjs/discord-api-types/issues/532)) ([2b53b20](https://github.com/discordjs/discord-api-types/commit/2b53b20b84b7434b9a35b715d8ebdeb040835dca))
- **GatewayGuildCreateDispatchData:** add missing `unavailable` ([#504](https://github.com/discordjs/discord-api-types/issues/504)) ([59e2477](https://github.com/discordjs/discord-api-types/commit/59e247729fcd27be839c88516939ec22843781ce))
- **RESTJSONErrorCodes:** add `ApplicationNotYetAvailable` ([#507](https://github.com/discordjs/discord-api-types/issues/507)) ([09a1141](https://github.com/discordjs/discord-api-types/commit/09a114133c7599cc14d4a0eb61425162091c45ee))
- **RESTJSONErrorCodes:** add error `30034` ([#530](https://github.com/discordjs/discord-api-types/issues/530)) ([0a2e778](https://github.com/discordjs/discord-api-types/commit/0a2e7787c672ffb4af83e055df632aae36811445))
- **RESTJSONErrorCodes:** add error `50132` ([#505](https://github.com/discordjs/discord-api-types/issues/505)) ([907d88a](https://github.com/discordjs/discord-api-types/commit/907d88ada93221802a4aefe7dc0ca3b2b73f94f0))
- **RESTJSONErrorCodes:** add error `50146` ([#527](https://github.com/discordjs/discord-api-types/issues/527)) ([e78de0c](https://github.com/discordjs/discord-api-types/commit/e78de0c83ba93145a2302ddea2e55b5050291c52))
- **RESTJSONErrorCodes:** add new errors ([#506](https://github.com/discordjs/discord-api-types/issues/506)) ([65b672e](https://github.com/discordjs/discord-api-types/commit/65b672e2afd2135333272d4e7b771eba237a21b6))
## [0.36.2](https://github.com/discordjs/discord-api-types/compare/0.36.1...0.36.2) (2022-07-14)
### Features
- **RESTJSONErrorCodes:** add error `30032` ([#521](https://github.com/discordjs/discord-api-types/issues/521)) ([f2c3451](https://github.com/discordjs/discord-api-types/commit/f2c3451c2a8bc91bcca65372d2944a07a3c34a9a))
- **RESTPutAPIApplicationGuildCommandsJSONBody:** add missing `id` ([#522](https://github.com/discordjs/discord-api-types/issues/522)) ([4af2ea9](https://github.com/discordjs/discord-api-types/commit/4af2ea91415a5662171d342379c4bd33bfa5a6d5))
## [0.36.1](https://github.com/discordjs/discord-api-types/compare/0.36.0...0.36.1) (2022-07-04)
### Features
- **APIApplicationCommandStringOption:** add `min_length` and `max_length` ([#513](https://github.com/discordjs/discord-api-types/issues/513)) ([2cade98](https://github.com/discordjs/discord-api-types/commit/2cade98ed0a0a074254fbc1580fc56d0e0b3dc9c))
# [0.36.0](https://github.com/discordjs/discord-api-types/compare/0.35.0...0.36.0) (2022-06-30)
### Features
- **APIBaseInteraction:** add `app_permissions` ([#509](https://github.com/discordjs/discord-api-types/issues/509)) ([0c65d40](https://github.com/discordjs/discord-api-types/commit/0c65d40af00499233830ce272a2a274bcd5b9e8c))
- **MessageType:** update names ([#498](https://github.com/discordjs/discord-api-types/issues/498)) ([12072b7](https://github.com/discordjs/discord-api-types/commit/12072b70a0c70e1e1f9de920789e26829268de12))
- **RESTJSONErrorCodes:** add error 20024 ([#480](https://github.com/discordjs/discord-api-types/issues/480)) ([34908aa](https://github.com/discordjs/discord-api-types/commit/34908aa4ceeca4b58276cc207f5bdb77cef04296))
### BREAKING CHANGES
- **MessageType:** The following message types have been renamed:
* `GuildMemberJoin` -> `UserJoin`
* `UserPremiumGuildSubscription` -> `GuildBoost`
* `UserPremiumGuildSubscriptionTier1` -> `GuildBoostTier1`
* `UserPremiumGuildSubscriptionTier2` -> `GuildBoostTier2`
* `UserPremiumGuildSubscriptionTier3` -> `GuildBoostTier3`
# [0.35.0](https://github.com/discordjs/discord-api-types/compare/0.34.0...0.35.0) (2022-06-23)
### Code Refactoring
- **GatewayIdentifyProperties:** remove `$` prefix from keys ([#493](https://github.com/discordjs/discord-api-types/issues/493)) ([3b10c60](https://github.com/discordjs/discord-api-types/commit/3b10c60faa5943501ab1f7cfa0d5f3c5317cdbbd))
### Features
- **APIEmbedVideo:** add missing `proxy_url` property ([#496](https://github.com/discordjs/discord-api-types/issues/496)) ([56d491f](https://github.com/discordjs/discord-api-types/commit/56d491fa6808d9a8762bff606ca8feb5e11f13a4))
- **REST:** add `CDNRoutes` ([#502](https://github.com/discordjs/discord-api-types/issues/502)) ([0609886](https://github.com/discordjs/discord-api-types/commit/06098869d552139fadcc204b5ce4e1a7e5352b68))
- **UserFlags:** add `Quarantined` flag ([#495](https://github.com/discordjs/discord-api-types/issues/495)) ([fc3aa1c](https://github.com/discordjs/discord-api-types/commit/fc3aa1c9110e4730c6b8ba3e36815ecd2da66c68))
### BREAKING CHANGES
- **GatewayIdentifyProperties:** The fields for identify no longer use the `$` prefix for the values.
# [0.34.0](https://github.com/discordjs/discord-api-types/compare/0.33.5...0.34.0) (2022-06-13)
### Code Refactoring
- separate `MESSAGE_CREATE` fields from `APIMessage` object ([#434](https://github.com/discordjs/discord-api-types/issues/434)) ([0bb2204](https://github.com/discordjs/discord-api-types/commit/0bb2204b5ddd32b791641a33d52669bc739bc208))
### Features
- add guild mfa endpoint and error `50017` ([#476](https://github.com/discordjs/discord-api-types/issues/476)) ([292c6b5](https://github.com/discordjs/discord-api-types/commit/292c6b58ee9384db2ce06addb80d2ea2bcd32de2))
- **RESTJSONErrorCodes:** add 220003 error ([#466](https://github.com/discordjs/discord-api-types/issues/466)) ([20653b3](https://github.com/discordjs/discord-api-types/commit/20653b34819f6adf8116bef2a1e5edc3233c4117))
### BREAKING CHANGES
- Certain fields that come only through the gateway are now correctly typed as such
## [0.33.5](https://github.com/discordjs/discord-api-types/compare/0.33.4...0.33.5) (2022-06-07)
### Bug Fixes
- **GatewayGuildCreateDispatch:** add missing `GatewayGuildCreateDispatch` ([#477](https://github.com/discordjs/discord-api-types/issues/477)) ([d268e0b](https://github.com/discordjs/discord-api-types/commit/d268e0bff7429e1cde43174fdf6d2342569860d5))
- **RESTPostAPIWebhookWithTokenJSONBody:** `thread_name` should be optional ([#479](https://github.com/discordjs/discord-api-types/issues/479)) ([eff8892](https://github.com/discordjs/discord-api-types/commit/eff8892b03656cfc2b709c6c30edb98e38bf2a1e))
### Features
- **RESTJSONErrorCodes:** add error `30052` ([#469](https://github.com/discordjs/discord-api-types/issues/469)) ([d854317](https://github.com/discordjs/discord-api-types/commit/d8543177cd978a19daa32fbb183892b6f8c24772))
## [0.33.4](https://github.com/discordjs/discord-api-types/compare/0.33.3...0.33.4) (2022-06-06)
### Features
- **RESTPostAPIWebhookWithTokenJSONBody:** add `thread_name` ([#463](https://github.com/discordjs/discord-api-types/issues/463)) ([8e5f07e](https://github.com/discordjs/discord-api-types/commit/8e5f07e2eebc14e5777dbfb932ef54f252165524))
## [0.33.3](https://github.com/discordjs/discord-api-types/compare/0.33.2...0.33.3) (2022-06-04)
### Bug Fixes
- **AddUndefinedToPossiblyUndefinedProperties:** recurse down objects ([#471](https://github.com/discordjs/discord-api-types/issues/471)) ([43c372d](https://github.com/discordjs/discord-api-types/commit/43c372d81722e48b105d5121a2cfdf614f1e7704))
## [0.33.2](https://github.com/discordjs/discord-api-types/compare/0.33.1...0.33.2) (2022-06-01)
### Bug Fixes
- **docs-site:** website link colors ([#457](https://github.com/discordjs/discord-api-types/issues/457)) ([51e664d](https://github.com/discordjs/discord-api-types/commit/51e664d8e826e7f0aa467c000f3a1707fc283a36))
- **GatewayGuildCreateDispatch:** add extra fields that were missing ([#458](https://github.com/discordjs/discord-api-types/issues/458)) ([15fcd1b](https://github.com/discordjs/discord-api-types/commit/15fcd1b2a85e8d1e136416a66326a4aadcc301fb))
- **RestPostAPIBaseApplicationJSONBody:** make `default_member_permissions` optional ([#460](https://github.com/discordjs/discord-api-types/issues/460)) ([6a813be](https://github.com/discordjs/discord-api-types/commit/6a813be83382e1606f1921cf00179fe1ce75c04f))
## [0.33.1](https://github.com/discordjs/discord-api-types/compare/0.33.0...0.33.1) (2022-05-26)
### Bug Fixes
- **RESTPostAPIApplicationGuildCommands:** correct types due to unions ([#447](https://github.com/discordjs/discord-api-types/issues/447)) ([6d85ad6](https://github.com/discordjs/discord-api-types/commit/6d85ad6b1d707b980f9897ea68dd4b7573b3a770))
### Features
- **RESTJSONErrorCodes:** add error `50600` ([#444](https://github.com/discordjs/discord-api-types/issues/444)) ([5ef49f4](https://github.com/discordjs/discord-api-types/commit/5ef49f41cecaa1d5937428a5c58f1d88bfc61266))
- **RESTPostAPIGuildChannels:** update post body fields ([#419](https://github.com/discordjs/discord-api-types/issues/419)) ([748db34](https://github.com/discordjs/discord-api-types/commit/748db34e30338cf4a9fd8ce7b86d1d5c7dde63b1))
# [0.33.0](https://github.com/discordjs/discord-api-types/compare/0.32.1...0.33.0) (2022-05-16)
### Code Refactoring
- **GuildFeature:** thread archive durations are no longer boost locked ([#412](https://github.com/discordjs/discord-api-types/issues/412)) ([1737ade](https://github.com/discordjs/discord-api-types/commit/1737adea1fc3d5050db30266e49c63277b7a77fc))
- separate `GUILD_CREATE` fields from `APIGuild` object ([#423](https://github.com/discordjs/discord-api-types/issues/423)) ([17f5caa](https://github.com/discordjs/discord-api-types/commit/17f5caa671da50a79d61393f5a970ce59c5d875e))
### Features
- add support for application command permissions v2 ([#415](https://github.com/discordjs/discord-api-types/issues/415)) ([d3163ca](https://github.com/discordjs/discord-api-types/commit/d3163ca22e5b7d8292f9f6ccd444aa5c93771d92))
- **OAuth2Scopes:** add new OAuth2 scopes ([#435](https://github.com/discordjs/discord-api-types/issues/435)) ([8f16f45](https://github.com/discordjs/discord-api-types/commit/8f16f452ac7dc8988617d1211fc6a9547d254795))
- **rest:** add missing guild routes results ([#438](https://github.com/discordjs/discord-api-types/issues/438)) ([1afce87](https://github.com/discordjs/discord-api-types/commit/1afce87fbef8e43ee040010e36019a4ebc6fecfe))
### BREAKING CHANGES
- APIGuild now correctly shows just the properties that are obtainable through rest/GUILD_UPDATE, while the extra fields have been moved to GatewayGuildCreateDispatchData to correctly represent the data received
- **GuildFeature:** `SevenDayThreadArchive` and `ThreeDayThreadArchive` have been removed as they are no longer valid
## [0.32.1](https://github.com/discordjs/discord-api-types/compare/0.32.0...0.32.1) (2022-05-05)
### Features
- **RESTJSONErrorCodes:** add error `50080` ([#408](https://github.com/discordjs/discord-api-types/issues/408)) ([43cfbcb](https://github.com/discordjs/discord-api-types/commit/43cfbcba284a96de6bde101b866ad9ac306992b5))
- **RESTPostAPIGuildForumThreads:** add `message` field ([#416](https://github.com/discordjs/discord-api-types/issues/416)) ([a28c824](https://github.com/discordjs/discord-api-types/commit/a28c824f82014b15a715b51b4426356428bb4ba2))
# [0.32.0](https://github.com/discordjs/discord-api-types/compare/0.31.2...0.32.0) (2022-04-25)
### Bug Fixes
- add `position` property to create channel options ([#409](https://github.com/discordjs/discord-api-types/issues/409)) ([3fe53ce](https://github.com/discordjs/discord-api-types/commit/3fe53ced9f0e61473a8b92d0503c51084e6a58f3))
### Code Refactoring
- **APIGuildIntegration:** make `enabled` optional ([#406](https://github.com/discordjs/discord-api-types/issues/406)) ([1212eb9](https://github.com/discordjs/discord-api-types/commit/1212eb933e6bf1d82b1b41164030bd317e9c59eb))
### BREAKING CHANGES
- **APIGuildIntegration:** `enabled` is now properly marked as optional
## [0.31.2](https://github.com/discordjs/discord-api-types/compare/0.31.1...0.31.2) (2022-04-18)
### Features
- **RESTPostAPIGuildChannelJSONBody:** add `default_auto_archive` prop ([#400](https://github.com/discordjs/discord-api-types/issues/400)) ([6a192b1](https://github.com/discordjs/discord-api-types/commit/6a192b132c11f13d95ea3e7ed1eb556600f2f415))
## [0.31.1](https://github.com/discordjs/discord-api-types/compare/0.31.0...0.31.1) (2022-04-11)
### Features
- **APIApplicationCommandInteractionData:** add `guild_id` ([#396](https://github.com/discordjs/discord-api-types/issues/396)) ([bc6e97f](https://github.com/discordjs/discord-api-types/commit/bc6e97f309b1f5e0bc0063ada3aed77f34214e9f))
- **APIGuildForum:** add support for forums, part 1 ([#398](https://github.com/discordjs/discord-api-types/issues/398)) ([bf08484](https://github.com/discordjs/discord-api-types/commit/bf084849885dd15b19f4f46aa260815037131600))
- student hubs ([#215](https://github.com/discordjs/discord-api-types/issues/215)) ([69079ee](https://github.com/discordjs/discord-api-types/commit/69079ee132777977e9a9e163696ffdc8db82fe38))
# [0.31.0](https://github.com/discordjs/discord-api-types/compare/0.30.0...0.31.0) (2022-04-04)
### Code Refactoring
- **APIGroupDMChannel:** make `name` nullable ([#347](https://github.com/discordjs/discord-api-types/issues/347)) ([ed0049b](https://github.com/discordjs/discord-api-types/commit/ed0049b78f4008460b0c7a2ec68eb38f018be3bd))
- remove `summary` from applications ([#386](https://github.com/discordjs/discord-api-types/issues/386)) ([f0ab4e8](https://github.com/discordjs/discord-api-types/commit/f0ab4e8c48895f8daee7fa296b8319a98fb7d4e1))
- remove store channels ([#364](https://github.com/discordjs/discord-api-types/issues/364)) ([25677ff](https://github.com/discordjs/discord-api-types/commit/25677fff43533b3b11b88f01efe98f0875014cb5))
### Features
- add `RESTGetAPIGuildBansQuery` ([#391](https://github.com/discordjs/discord-api-types/issues/391)) ([b1bf7bf](https://github.com/discordjs/discord-api-types/commit/b1bf7bf0f9a37fa391a67e4b5b1dd288821d0ebb))
- **APIApplication:** app authorization links and tags ([#239](https://github.com/discordjs/discord-api-types/issues/239)) ([93eab11](https://github.com/discordjs/discord-api-types/commit/93eab113cdcfd3bdd868f1d86bb4bc2a5247d844))
- **APIApplicationCommand:** add missing localization props ([#383](https://github.com/discordjs/discord-api-types/issues/383)) ([9c12718](https://github.com/discordjs/discord-api-types/commit/9c1271816312382be3471cb2fdbb6260e973b4f6))
- **APIAuditLogChange:** add `APIAuditLogChangeKeyImageHash` ([#379](https://github.com/discordjs/discord-api-types/issues/379)) ([f532002](https://github.com/discordjs/discord-api-types/commit/f532002574b655d87151c325be6c02fe6f65bbe0))
- **GuildFeatures:** add animated banners ([#219](https://github.com/discordjs/discord-api-types/issues/219)) ([c23f2ac](https://github.com/discordjs/discord-api-types/commit/c23f2accf998ffa0c068d222fd9f34228a86a699))
- **RESTPostAPIStageInstanceJSONBody:** add `send_start_notification` ([#378](https://github.com/discordjs/discord-api-types/issues/378)) ([b764e8d](https://github.com/discordjs/discord-api-types/commit/b764e8dc1a92e254161f3a443e17148a81240b66))
### BREAKING CHANGES
- The deprecated `summary` field has been removed
- Store channels have been removed, alongside their types
- **APIGroupDMChannel:** The `name` field is now also nullable for Group DM Channels
# [0.30.0](https://github.com/discordjs/discord-api-types/compare/0.29.0...0.30.0) (2022-03-24)
### Bug Fixes
- **APIGuildIntegrationType:** correct name of type ([#366](https://github.com/discordjs/discord-api-types/issues/366)) ([fa740eb](https://github.com/discordjs/discord-api-types/commit/fa740eb16c8bba9d2c9c915d2e0139e5e1211040))
### Features
- **APIApplicationCommand:** add command localization ([#370](https://github.com/discordjs/discord-api-types/issues/370)) ([f702988](https://github.com/discordjs/discord-api-types/commit/f70298811242d946cee01b112c34382f0e54cb78))
### Reverts
- fix(GatewayVoiceState): some fields are optional instead of nullable ([#367](https://github.com/discordjs/discord-api-types/issues/367)) ([e822e45](https://github.com/discordjs/discord-api-types/commit/e822e45b3b6e07eb85a45039975cb33636765f5e))
### BREAKING CHANGES
- **APIGuildIntegrationType:** `APIGuildInteractionType` is now correctly named `APIGuildIntegrationType`
# [0.29.0](https://github.com/discordjs/discord-api-types/compare/0.28.0...0.29.0) (2022-03-10)
### Bug Fixes
- **GatewayVoiceState:** some fields are optional instead of nullable ([#345](https://github.com/discordjs/discord-api-types/issues/345)) ([fddff21](https://github.com/discordjs/discord-api-types/commit/fddff2167c858832d6c61f3efca8d944fd356a85))
- **RESTJSONErrorCodes:** typo in error `30046` ([#362](https://github.com/discordjs/discord-api-types/issues/362)) ([854aa36](https://github.com/discordjs/discord-api-types/commit/854aa3691c4d16a2c7fec7421cf25ea03a030e55))
### Code Refactoring
- **APIGuildScheduledEventBase:** make `description` nullable ([#359](https://github.com/discordjs/discord-api-types/issues/359)) ([e5710d0](https://github.com/discordjs/discord-api-types/commit/e5710d0e42d4f597bc9ed5594619a5032bf59bcb))
- make things optional and nullable where applicable ([#361](https://github.com/discordjs/discord-api-types/issues/361)) ([10fdeaa](https://github.com/discordjs/discord-api-types/commit/10fdeaa68df9b3b61b20b8d90b9587d03d95a450))
- **RESTJSONErrorCodes:** update error `50008` key ([#338](https://github.com/discordjs/discord-api-types/issues/338)) ([9a57848](https://github.com/discordjs/discord-api-types/commit/9a578489ad05b2ba8ed8d496db19cb86fa572ef7))
### Features
- **APIInviteGuild:** add boost count ([#323](https://github.com/discordjs/discord-api-types/issues/323)) ([cb92843](https://github.com/discordjs/discord-api-types/commit/cb92843991307d59c61d017d8ab1adcd469b4512))
- **APIStageInstance:** add `guild_scheduled_event_id` ([#350](https://github.com/discordjs/discord-api-types/issues/350)) ([d06d2d6](https://github.com/discordjs/discord-api-types/commit/d06d2d6a9a8ccc84337b2ce9c59430694ae93e8a))
- **RESTJSONErrorCodes:** add error `10065` ([#336](https://github.com/discordjs/discord-api-types/issues/336)) ([e8127b8](https://github.com/discordjs/discord-api-types/commit/e8127b89f89c4612fab0d3702ce512e41ab75b6e))
### BREAKING CHANGES
- **RESTJSONErrorCodes:** `MaximumNumberOfEditsToMessagesOlderThanOneHourReached` is no longer mistyped as `MaxmimumNumberOfEditsToMessagesOlderThanOneHourReached`
- **APIGuildScheduledEventBase:** The type for `description` can also be null, not just optional
- **RESTJSONErrorCodes:** The error code `50008` has been renamed from `CannotSendMessagesInVoiceChannel` to `CannotSendMessagesInNonTextChannel`
- The deprecated `asset` field for stickers is correctly marked as optional now. The `image` field for Guild Scheduled Events is now correctly typed as optional.
- **GatewayVoiceState:** `channel_id` and `request_to_speak_timestamp` are correctly typed as optional, not nullable now.
# [0.28.0](https://github.com/discordjs/discord-api-types/compare/0.27.3...0.28.0) (2022-03-07)
### Code Refactoring
- **PermissionFlagsBits:** rename `StartEmbeddedActivities` to `UseEmbeddedActivities` ([#342](https://github.com/discordjs/discord-api-types/issues/342)) ([3e3acb5](https://github.com/discordjs/discord-api-types/commit/3e3acb5297e3e546fbb7fc82acddb50170ffc1de))
### Features
- add support for TS module: NodeNext ([#356](https://github.com/discordjs/discord-api-types/issues/356)) ([e9ee696](https://github.com/discordjs/discord-api-types/commit/e9ee6966c38c82544536ece85af0c1b3bd592bfc))
- **MessageComponentInteraction:** export specific interaction aliases ([#353](https://github.com/discordjs/discord-api-types/issues/353)) ([3503a4f](https://github.com/discordjs/discord-api-types/commit/3503a4fd384be8459a1628a6f019a1bc164c0386))
- **Utils:** add more typeguard functions to determine the interaction types ([#355](https://github.com/discordjs/discord-api-types/issues/355)) ([dec7717](https://github.com/discordjs/discord-api-types/commit/dec7717bc76ac86c8b7d45ed4e0b506e532f7cb9))
### BREAKING CHANGES
- **PermissionFlagsBits:** The `StartEmbeddedActivities` permission flag has been renamed to `UseEmbeddedActivities`
## [0.27.3](https://github.com/discordjs/discord-api-types/compare/0.27.2...0.27.3) (2022-02-24)
### Bug Fixes
- **APIApplicationCommandAutocompleteInteraction:** make `options` field required for v10 (PR [#332](https://github.com/discordjs/discord-api-types/issues/332) redo) ([#339](https://github.com/discordjs/discord-api-types/issues/339)) ([8d432f2](https://github.com/discordjs/discord-api-types/commit/8d432f2ebe54904cc0285b1e05706ca105ece7b8))
## [0.27.2](https://github.com/discordjs/discord-api-types/compare/0.27.1...0.27.2) (2022-02-17)
### Bug Fixes
- **APIApplicationCommandAutocompleteInteraction:** make `options` field required ([#332](https://github.com/discordjs/discord-api-types/issues/332)) ([5396daf](https://github.com/discordjs/discord-api-types/commit/5396daf0dbbe7ed54d94c621649b746b1131dee9))
- **APIInteractionResponse:** add `APIModalInteractionResponse` to union ([#333](https://github.com/discordjs/discord-api-types/issues/333)) ([a8f19e6](https://github.com/discordjs/discord-api-types/commit/a8f19e6a19cbefd99c8c8bd35e565ab3584c9eeb))
### Features
- api v10 ([#331](https://github.com/discordjs/discord-api-types/issues/331)) ([8e87b3e](https://github.com/discordjs/discord-api-types/commit/8e87b3e1ce35201503623839602c44fe2a52a27b))
## [0.27.1](https://github.com/discordjs/discord-api-types/compare/0.27.0...0.27.1) (2022-02-14)
### Bug Fixes
- **APIInteraction:** add modal submit interaction & make `data` required in APIModalSubmit ([#321](https://github.com/discordjs/discord-api-types/issues/321)) ([f88727b](https://github.com/discordjs/discord-api-types/commit/f88727bd80d32f3ddf4374b1fd46ce50c36eea4d))
- **APIInteractions:** export ApplicationCommandAutocomplete ([#309](https://github.com/discordjs/discord-api-types/issues/309)) ([5056da5](https://github.com/discordjs/discord-api-types/commit/5056da523af6154fbf2fbcf10e30ce437ec42ce8))
- **CI:** skip pull request checks for runs that don't include the token ([#327](https://github.com/discordjs/discord-api-types/issues/327)) ([0ad06fc](https://github.com/discordjs/discord-api-types/commit/0ad06fc639d7f8bdff135a58d435e6cb15029842))
- make `data` required in autocomplete interaction and add separate dm/guild types ([#322](https://github.com/discordjs/discord-api-types/issues/322)) ([7abeb2e](https://github.com/discordjs/discord-api-types/commit/7abeb2e0391d6e47517edba63342ba9c4adc4fcb))
### Features
- **RESTJSONErrorCodes:** add error 40060 ([#320](https://github.com/discordjs/discord-api-types/issues/320)) ([72e9617](https://github.com/discordjs/discord-api-types/commit/72e9617fee6e05d2eb4b715c0261d316ff0e1f1e))
# [0.27.0](https://github.com/discordjs/discord-api-types/compare/0.26.1...0.27.0) (2022-02-10)
### Bug Fixes
- **GatewayThreadCreateDispatchData:** `newly_created` is optional, and `true` when present ([#312](https://github.com/discordjs/discord-api-types/issues/312)) ([87b9b08](https://github.com/discordjs/discord-api-types/commit/87b9b0885a3734b376e64da51d7667b74558f7e5))
### Code Refactoring
- **ActivityType:** change `Game` to `Playing` ([#298](https://github.com/discordjs/discord-api-types/issues/298)) ([08a8b28](https://github.com/discordjs/discord-api-types/commit/08a8b28ee1ed2041744d922db35dab24f3861469))
- **UserFlags:** remove `None` ([#308](https://github.com/discordjs/discord-api-types/issues/308)) ([8e13cd8](https://github.com/discordjs/discord-api-types/commit/8e13cd80c66d11d93157a053e329ad98ece4a457))
### Features
- **APIGuildPreview:** add `stickers` ([#279](https://github.com/discordjs/discord-api-types/issues/279)) ([310c68f](https://github.com/discordjs/discord-api-types/commit/310c68f034812072ca3cacbeaff1f5b9454e3409))
- **APIInteraction:** add locale props to interactions ([#273](https://github.com/discordjs/discord-api-types/issues/273)) ([03b8d3f](https://github.com/discordjs/discord-api-types/commit/03b8d3fee032fb77213389019baa2b80377dcfdc))
- **APIMessageInteraction:** add `member` field ([#299](https://github.com/discordjs/discord-api-types/issues/299)) ([80ed7ba](https://github.com/discordjs/discord-api-types/commit/80ed7ba1c1ebb2e12d3a04339d4ff0209be9bbef))
- **APIScheduledEvent:** add `image` prop ([#303](https://github.com/discordjs/discord-api-types/issues/303)) ([663c4e9](https://github.com/discordjs/discord-api-types/commit/663c4e97fbe2029ab040388b50d5600bfe281c4f))
- **APIThreadMetadata:** add `create_timestamp` field ([#301](https://github.com/discordjs/discord-api-types/issues/301)) ([d95d956](https://github.com/discordjs/discord-api-types/commit/d95d9562dcc514556f3a4ced3e8f3ee4c5ed1282))
- **ApplicationCommand:** attachment application command option type ([#272](https://github.com/discordjs/discord-api-types/issues/272)) ([71c4e6a](https://github.com/discordjs/discord-api-types/commit/71c4e6aecd044ce5282742c0e47bff7b64b890f7))
- **GatewayThreadCreateDispatch:** Add `newly_created` field ([#311](https://github.com/discordjs/discord-api-types/issues/311)) ([7e54215](https://github.com/discordjs/discord-api-types/commit/7e542152da2e58f44c2314d5bd3b04a518fa979e))
- **Interactions:** add modal and text input interactions ([#243](https://github.com/discordjs/discord-api-types/issues/243)) ([bf0f66b](https://github.com/discordjs/discord-api-types/commit/bf0f66b60a97f79c0e80ace5b408baee343bc82c))
- **Locales:** add locale string enum ([#297](https://github.com/discordjs/discord-api-types/issues/297)) ([b07d5a0](https://github.com/discordjs/discord-api-types/commit/b07d5a0c2273b6b51b44542b638a768c36d0f184))
- **MessageFlags:** add `FailedToMentionSomeRolesInThread` ([#280](https://github.com/discordjs/discord-api-types/issues/280)) ([76588d9](https://github.com/discordjs/discord-api-types/commit/76588d9d384f71ace05d96de17889e4490874462))
- **RESTPostAPIChannelMessage, RESTPostAPIWebhookMessage:** add flags for creation ([#300](https://github.com/discordjs/discord-api-types/issues/300)) ([4194bd9](https://github.com/discordjs/discord-api-types/commit/4194bd9054a7e4b004f9244706f423292a8a0e56))
- **RESTJSONErrorCodes:** add error 30042 ([#305](https://github.com/discordjs/discord-api-types/issues/305)) ([9c2b185](https://github.com/discordjs/discord-api-types/commit/9c2b185367b1ea2e432355d76af8f19e8fca7398))
- **RESTJSONErrorCodes:** add error 30046 ([#304](https://github.com/discordjs/discord-api-types/issues/304)) ([56d3975](https://github.com/discordjs/discord-api-types/commit/56d39756c0d973ec56fe6e1eeb75d827f50aac81))
- **RESTJSONErrorCodes:** add error 40004 ([#314](https://github.com/discordjs/discord-api-types/issues/314)) ([269a75c](https://github.com/discordjs/discord-api-types/commit/269a75ccf7b413bfc031849713e919ebb8d87a1a))
- **RESTJSONErrorCodes:** add error 50068 ([#302](https://github.com/discordjs/discord-api-types/issues/302)) ([7655e20](https://github.com/discordjs/discord-api-types/commit/7655e2024800abc4431011668b83373e0868485e))
- **RESTJSONErrorCodes:** add error code 50086 ([#286](https://github.com/discordjs/discord-api-types/issues/286)) ([51fb37c](https://github.com/discordjs/discord-api-types/commit/51fb37cbba44677870f0f916bd1416bdbd34e052))
- **RESTPatchAPIGuildMember:** add `communication_disabled_until` field ([#289](https://github.com/discordjs/discord-api-types/issues/289)) ([5056b0f](https://github.com/discordjs/discord-api-types/commit/5056b0f2b3798480dbbc193fd80dedfefedff4fc))
- **RESTPatchAPIGuildMember:** add modify current member and deprecate nick route ([#262](https://github.com/discordjs/discord-api-types/issues/262)) ([9a982ff](https://github.com/discordjs/discord-api-types/commit/9a982ff8d9592a02d78f24295efd756dc0c69fa8))
- **RouteBases:** add base for guild scheduled events ([#293](https://github.com/discordjs/discord-api-types/issues/293)) ([83f29b6](https://github.com/discordjs/discord-api-types/commit/83f29b692839cc51869bcafdaf387b68731e0a28))
- **UserFlags:** add `Spammer` flag ([#294](https://github.com/discordjs/discord-api-types/issues/294)) ([03f12d7](https://github.com/discordjs/discord-api-types/commit/03f12d71eef2661ee5290152952ea1adc9a92383))
### types
- Add tagged `type` unions for channel types ([#200](https://github.com/discordjs/discord-api-types/issues/200)) ([2c1fbda](https://github.com/discordjs/discord-api-types/commit/2c1fbda621fc1c1ea227295c578e6d8486dbc4f2))
### BREAKING CHANGES
- **Interactions:** `APIBaseMessageComponent` was renamed to `APIBaseComponent`
- **UserFlags:** The `None` user flag is bye-bye (although I doubt anyone is using it)
- All of the channel types are now split based on their type. As such, you will need to assert the type (either by checking it with the enum or by casting the data as the correct channel) before accessing data.
_If you encounter any missing properties due to this, please open an issue! This is a big change, and we hope nothing is missing_
- **ActivityType:** `Game` was renamed to `Playing`
## [0.26.1](https://github.com/discordjs/discord-api-types/compare/0.26.0...0.26.1) (2022-01-02)
### Bug Fixes
- **APIApplicationCommandOption:** correct type for integer and number ([#284](https://github.com/discordjs/discord-api-types/issues/284)) ([fe1f531](https://github.com/discordjs/discord-api-types/commit/fe1f5313a8fc13d0a2433738cce9be37f5d9eeb5))
### Features
- **APIAuditLogChangeData:** Add `communication_disabled_until` ([#281](https://github.com/discordjs/discord-api-types/issues/281)) ([0cf51ab](https://github.com/discordjs/discord-api-types/commit/0cf51abc267bd6246a7952e7f6a23fa8c5db290a))
- **APIGuildScheduledEvent:** add more precise types for stage instance/voice/external events ([#278](https://github.com/discordjs/discord-api-types/issues/278)) ([751aee6](https://github.com/discordjs/discord-api-types/commit/751aee6fa7d4c542324a30e9b9bc641b0e7a8bf4))
- **ApplicationFlags:** add embedded application flags ([#277](https://github.com/discordjs/discord-api-types/issues/277)) ([9f4f59c](https://github.com/discordjs/discord-api-types/commit/9f4f59c8e55f78caf614e27e28b6bca939665ca5))
# [0.26.0](https://github.com/discordjs/discord-api-types/compare/0.25.2...0.26.0) (2021-12-24)
### Bug Fixes

View File

@@ -1,11 +1,14 @@
# Discord API Types
[![discord-api-types](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/svgs/logo_long_blurple.svg)](https://github.com/discordjs/discord-api-types)
[![GitHub](https://img.shields.io/github/license/discordjs/discord-api-types)](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
[![npm](https://img.shields.io/npm/v/discord-api-types?color=crimson&logo=npm)](https://www.npmjs.com/package/discord-api-types)
[![deno](https://img.shields.io/npm/v/discord-api-types?color=blue&label=deno&logo=deno)](https://deno.land/x/discord_api_types)
[![Patreon Donate](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Donate%20with%20Patreon&logo=patreon&colorB=F96854&link=https://www.patreon.com/vladfrangu)](https://www.patreon.com/vladfrangu)
[![Ko-fi Donate](https://img.shields.io/badge/kofi-donate-brightgreen.svg?label=Donate%20with%20Ko-fi&logo=ko-fi&colorB=F16061&link=https://ko-fi.com/wolfgalvlad&logoColor=FFFFFF)](https://ko-fi.com/wolfgalvlad)
[![GitHub Sponsors](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Sponsor%20through%20GitHub&logo=github&colorB=F96854&link=https://github.com/sponsors/vladfrangu)](https://github.com/sponsors/vladfrangu)
[![Powered by Vercel](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/powered-by-vercel.svg)](https://vercel.com?utm_source=discordjs&utm_campaign=oss)
Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro).
@@ -24,26 +27,26 @@ pnpm add discord-api-types
You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples
```js
const { APIUser } = require('discord-api-types/v9');
const { APIUser } = require('discord-api-types/v10');
```
```ts
// TypeScript/ES Module support
import { APIUser } from 'discord-api-types/v9';
import { APIUser } from 'discord-api-types/v10';
```
You may also import just certain parts of the module that you need. The possible values are: `globals`, `gateway`, `gateway/v*`, `payloads`, `payloads/v*`, `rest`, `rest/v*`, `rpc`, `rpc/v*`, `utils`, `utils/v*`, `voice`, and `voice/v*`. Below are some examples
```js
const { GatewayVersion } = require('discord-api-types/gateway/v9');
const { GatewayVersion } = require('discord-api-types/gateway/v10');
```
```ts
// TypeScript/ES Module support
import { GatewayVersion } from 'discord-api-types/gateway/v9';
import { GatewayVersion } from 'discord-api-types/gateway/v10';
```
> _**Note:** The `v*` exports (`discord-api-type/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
> _**Note:** The `v*` exports (`discord-api-types/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
### Deno
@@ -53,21 +56,21 @@ We also provide typings compatible with the [deno](https://deno.land/) runtime.
```ts
// Importing a specific API version
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v9.ts';
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v10.ts';
```
2. From [deno.land/x](https://deno.land/x)
```ts
// Importing a specific API version
import { APIUser } from 'https://deno.land/x/discord_api_types/v9.ts';
import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts';
```
3. From [skypack.dev](https://www.skypack.dev/)
```ts
// Importing a specific API version
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v9?dts';
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
```
## Project Structure
@@ -94,4 +97,9 @@ The exports of each API version is split into three main parts:
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means _and have received the green light to be used_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will **NOT** be included.
**A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs),
that are mentioned in an open pull request, or known through other means _and have received the green light to be used_.
Anything else will not be documented (for example client only types).
With that aside, we may allow certain types that are not documented in the [API Documentation repository](https://github.com/discord/discord-api-docs) on a case by case basis.
They will be documented with an `@unstable` tag and are not subject with the same versioning rules.

View File

@@ -1,4 +1,4 @@
// This file exports all the types available in the recommended gateway version
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
export * from './v9.ts';
export * from './v10.ts';

1856
deno/gateway/v10.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -694,7 +694,6 @@ export interface GatewayIdentify {
properties: GatewayIdentifyProperties;
compress?: boolean;
large_threshold?: number;
// eslint-disable-next-line prettier/prettier
shard?: [shard_id: number, shard_count: number];
presence?: RawGatewayPresenceUpdate;
guild_subscriptions?: boolean;

View File

@@ -5,15 +5,14 @@
import type { Snowflake } from '../globals.ts';
import type {
APIApplication,
APIApplicationCommandInteraction,
APIChannel,
APIEmoji,
APIGuild,
APIGuildScheduledEvent,
APIGuildIntegration,
APIGuildMember,
APIGuildScheduledEvent,
APIInteraction,
APIMessage,
APIMessageComponentInteraction,
APIRole,
APIStageInstance,
APISticker,
@@ -29,10 +28,14 @@ import type { Nullable } from '../utils/internals.ts';
export * from './common.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export const GatewayVersion = '8';
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum GatewayOpcodes {
/**
@@ -84,6 +87,7 @@ export enum GatewayOpcodes {
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum GatewayCloseCodes {
/**
@@ -167,6 +171,7 @@ export enum GatewayCloseCodes {
/**
* https://discord.com/developers/docs/topics/gateway#list-of-intents
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum GatewayIntentBits {
Guilds = 1 << 0,
@@ -189,6 +194,7 @@ export enum GatewayIntentBits {
/**
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum GatewayDispatchEvents {
ChannelCreate = 'CHANNEL_CREATE',
@@ -242,6 +248,9 @@ export enum GatewayDispatchEvents {
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
@@ -250,6 +259,9 @@ export type GatewaySendPayload =
| GatewayResume
| GatewayRequestGuildMembers;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayReceivePayload =
| GatewayHello
| GatewayHeartbeatRequest
@@ -258,6 +270,9 @@ export type GatewayReceivePayload =
| GatewayReconnect
| GatewayDispatchPayload;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayDispatchPayload =
| GatewayChannelModifyDispatch
| GatewayChannelPinsUpdateDispatch
@@ -308,6 +323,7 @@ export type GatewayDispatchPayload =
/**
* https://discord.com/developers/docs/topics/gateway#hello
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayHello extends NonDispatchPayload {
op: GatewayOpcodes.Hello;
@@ -316,6 +332,7 @@ export interface GatewayHello extends NonDispatchPayload {
/**
* https://discord.com/developers/docs/topics/gateway#hello
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayHelloData {
/**
@@ -326,6 +343,7 @@ export interface GatewayHelloData {
/**
* https://discord.com/developers/docs/topics/gateway#heartbeating
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayHeartbeatRequest extends NonDispatchPayload {
op: GatewayOpcodes.Heartbeat;
@@ -334,6 +352,7 @@ export interface GatewayHeartbeatRequest extends NonDispatchPayload {
/**
* https://discord.com/developers/docs/topics/gateway#heartbeating-example-gateway-heartbeat-ack
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayHeartbeatAck extends NonDispatchPayload {
op: GatewayOpcodes.HeartbeatAck;
@@ -342,6 +361,7 @@ export interface GatewayHeartbeatAck extends NonDispatchPayload {
/**
* https://discord.com/developers/docs/topics/gateway#invalid-session
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayInvalidSession extends NonDispatchPayload {
op: GatewayOpcodes.InvalidSession;
@@ -350,11 +370,13 @@ export interface GatewayInvalidSession extends NonDispatchPayload {
/**
* https://discord.com/developers/docs/topics/gateway#invalid-session
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayInvalidSessionData = boolean;
/**
* https://discord.com/developers/docs/topics/gateway#reconnect
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayReconnect extends NonDispatchPayload {
op: GatewayOpcodes.Reconnect;
@@ -363,11 +385,13 @@ export interface GatewayReconnect extends NonDispatchPayload {
/**
* https://discord.com/developers/docs/topics/gateway#ready
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayReadyDispatch = DataPayload<GatewayDispatchEvents.Ready, GatewayReadyDispatchData>;
/**
* https://discord.com/developers/docs/topics/gateway#ready
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayReadyDispatchData {
/**
@@ -408,6 +432,7 @@ export interface GatewayReadyDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#resumed
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
@@ -415,6 +440,7 @@ export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed,
* https://discord.com/developers/docs/topics/gateway#channel-create
* https://discord.com/developers/docs/topics/gateway#channel-update
* https://discord.com/developers/docs/topics/gateway#channel-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayChannelModifyDispatch = DataPayload<
GatewayDispatchEvents.ChannelCreate | GatewayDispatchEvents.ChannelDelete | GatewayDispatchEvents.ChannelUpdate,
@@ -425,41 +451,49 @@ export type GatewayChannelModifyDispatch = DataPayload<
* https://discord.com/developers/docs/topics/gateway#channel-create
* https://discord.com/developers/docs/topics/gateway#channel-update
* https://discord.com/developers/docs/topics/gateway#channel-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayChannelModifyDispatchData = APIChannel;
/**
* https://discord.com/developers/docs/topics/gateway#channel-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#channel-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayChannelCreateDispatchData = GatewayChannelModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#channel-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#channel-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayChannelUpdateDispatchData = GatewayChannelModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#channel-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#channel-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayChannelDeleteDispatchData = GatewayChannelModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#channel-pins-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayChannelPinsUpdateDispatch = DataPayload<
GatewayDispatchEvents.ChannelPinsUpdate,
@@ -468,6 +502,7 @@ export type GatewayChannelPinsUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#channel-pins-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayChannelPinsUpdateDispatchData {
/**
@@ -487,6 +522,7 @@ export interface GatewayChannelPinsUpdateDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#guild-create
* https://discord.com/developers/docs/topics/gateway#guild-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildModifyDispatch = DataPayload<
GatewayDispatchEvents.GuildCreate | GatewayDispatchEvents.GuildUpdate,
@@ -496,42 +532,50 @@ export type GatewayGuildModifyDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-create
* https://discord.com/developers/docs/topics/gateway#guild-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildModifyDispatchData = APIGuild;
/**
* https://discord.com/developers/docs/topics/gateway#guild-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildCreateDispatchData = GatewayGuildModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#guild-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildUpdateDispatchData = GatewayGuildModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#guild-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildDelete, GatewayGuildDeleteDispatchData>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildDeleteDispatchData = APIUnavailableGuild;
/**
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
* https://discord.com/developers/docs/topics/gateway#guild-ban-remove
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildBanModifyDispatch = DataPayload<
GatewayDispatchEvents.GuildBanAdd | GatewayDispatchEvents.GuildBanRemove,
@@ -541,6 +585,7 @@ export type GatewayGuildBanModifyDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
* https://discord.com/developers/docs/topics/gateway#guild-ban-remove
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayGuildBanModifyDispatchData {
/**
@@ -557,26 +602,31 @@ export interface GatewayGuildBanModifyDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildBanAddDispatchData = GatewayGuildBanModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#guild-ban-remove
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-ban-remove
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildBanRemoveDispatchData = GatewayGuildBanModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#guild-emojis-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildEmojisUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildEmojisUpdate,
@@ -585,6 +635,7 @@ export type GatewayGuildEmojisUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-emojis-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayGuildEmojisUpdateDispatchData {
/**
@@ -601,6 +652,7 @@ export interface GatewayGuildEmojisUpdateDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#guild-stickers-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildStickersUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildStickersUpdate,
@@ -609,6 +661,7 @@ export type GatewayGuildStickersUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-stickers-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayGuildStickersUpdateDispatchData {
/**
@@ -625,6 +678,7 @@ export interface GatewayGuildStickersUpdateDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#guild-integrations-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildIntegrationsUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildIntegrationsUpdate,
@@ -633,6 +687,7 @@ export type GatewayGuildIntegrationsUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-integrations-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayGuildIntegrationsUpdateDispatchData {
/**
@@ -643,6 +698,7 @@ export interface GatewayGuildIntegrationsUpdateDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-add
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildMemberAddDispatch = DataPayload<
GatewayDispatchEvents.GuildMemberAdd,
@@ -651,6 +707,7 @@ export type GatewayGuildMemberAddDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-add
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayGuildMemberAddDispatchData extends APIGuildMember {
/**
@@ -661,6 +718,7 @@ export interface GatewayGuildMemberAddDispatchData extends APIGuildMember {
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-remove
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildMemberRemoveDispatch = DataPayload<
GatewayDispatchEvents.GuildMemberRemove,
@@ -669,6 +727,7 @@ export type GatewayGuildMemberRemoveDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-remove
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayGuildMemberRemoveDispatchData {
/**
@@ -685,6 +744,7 @@ export interface GatewayGuildMemberRemoveDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildMemberUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildMemberUpdate,
@@ -693,6 +753,7 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildMemberUpdateDispatchData = Omit<APIGuildMember, 'deaf' | 'mute' | 'user' | 'joined_at'> &
Partial<Pick<APIGuildMember, 'deaf' | 'mute'>> &
@@ -706,6 +767,7 @@ export type GatewayGuildMemberUpdateDispatchData = Omit<APIGuildMember, 'deaf' |
/**
* https://discord.com/developers/docs/topics/gateway#guild-members-chunk
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildMembersChunkDispatch = DataPayload<
GatewayDispatchEvents.GuildMembersChunk,
@@ -714,6 +776,7 @@ export type GatewayGuildMembersChunkDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-members-chunk
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayGuildMembersChunkDispatchData {
/**
@@ -755,6 +818,7 @@ export interface GatewayGuildMembersChunkDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-create
* https://discord.com/developers/docs/topics/gateway#guild-role-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildRoleModifyDispatch = DataPayload<
GatewayDispatchEvents.GuildRoleCreate | GatewayDispatchEvents.GuildRoleUpdate,
@@ -764,6 +828,7 @@ export type GatewayGuildRoleModifyDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-create
* https://discord.com/developers/docs/topics/gateway#guild-role-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayGuildRoleModifyDispatchData {
/**
@@ -780,26 +845,31 @@ export interface GatewayGuildRoleModifyDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildRoleCreateDispatchData = GatewayGuildRoleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildRoleUpdateDispatchData = GatewayGuildRoleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildRoleDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildRoleDelete,
@@ -808,6 +878,7 @@ export type GatewayGuildRoleDeleteDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayGuildRoleDeleteDispatchData {
/**
@@ -820,43 +891,73 @@ export interface GatewayGuildRoleDeleteDispatchData {
role_id: Snowflake;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildScheduledEventCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventCreate,
GatewayGuildScheduledEventCreateDispatchData
>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildScheduledEventCreateDispatchData = APIGuildScheduledEvent;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildScheduledEventUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUpdate,
GatewayGuildScheduledEventUpdateDispatchData
>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildScheduledEventUpdateDispatchData = APIGuildScheduledEvent;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildScheduledEventDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventDelete,
GatewayGuildScheduledEventDeleteDispatchData
>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildScheduledEventDeleteDispatchData = APIGuildScheduledEvent;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildScheduledEventUserAddDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUserAdd,
GatewayGuildScheduledEventUserAddDispatchData
>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayGuildScheduledEventUserAddDispatchData {
guild_scheduled_event_id: Snowflake;
user_id: Snowflake;
guild_id: Snowflake;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildScheduledEventUserRemoveDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUserRemove,
GatewayGuildScheduledEventUserAddDispatchData
>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayGuildScheduledEventUserRemoveDispatchData {
guild_scheduled_event_id: Snowflake;
user_id: Snowflake;
@@ -865,6 +966,7 @@ export interface GatewayGuildScheduledEventUserRemoveDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#integration-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayIntegrationCreateDispatch = DataPayload<
GatewayDispatchEvents.IntegrationCreate,
@@ -873,11 +975,13 @@ export type GatewayIntegrationCreateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#integration-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayIntegrationCreateDispatchData = APIGuildIntegration & { guild_id: Snowflake };
/**
* https://discord.com/developers/docs/topics/gateway#integration-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayIntegrationUpdateDispatch = DataPayload<
GatewayDispatchEvents.IntegrationUpdate,
@@ -886,11 +990,13 @@ export type GatewayIntegrationUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#integration-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayIntegrationUpdateDispatchData = APIGuildIntegration & { guild_id: Snowflake };
/**
* https://discord.com/developers/docs/topics/gateway#integration-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayIntegrationDeleteDispatch = DataPayload<
GatewayDispatchEvents.IntegrationDelete,
@@ -899,6 +1005,7 @@ export type GatewayIntegrationDeleteDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#integration-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayIntegrationDeleteDispatchData {
/**
@@ -917,6 +1024,7 @@ export interface GatewayIntegrationDeleteDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#interaction-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayInteractionCreateDispatch = DataPayload<
GatewayDispatchEvents.InteractionCreate,
@@ -925,11 +1033,13 @@ export type GatewayInteractionCreateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#interaction-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayInteractionCreateDispatchData = APIApplicationCommandInteraction | APIMessageComponentInteraction;
export type GatewayInteractionCreateDispatchData = APIInteraction;
/**
* https://discord.com/developers/docs/topics/gateway#invite-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayInviteCreateDispatch = DataPayload<
GatewayDispatchEvents.InviteCreate,
@@ -938,6 +1048,7 @@ export type GatewayInviteCreateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#invite-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayInviteCreateDispatchData {
/**
@@ -1000,6 +1111,7 @@ export interface GatewayInviteCreateDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#invite-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayInviteDeleteDispatch = DataPayload<
GatewayDispatchEvents.InviteDelete,
@@ -1008,6 +1120,7 @@ export type GatewayInviteDeleteDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#invite-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayInviteDeleteDispatchData {
/**
@@ -1028,6 +1141,7 @@ export interface GatewayInviteDeleteDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#message-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageCreateDispatch = DataPayload<
GatewayDispatchEvents.MessageCreate,
@@ -1036,11 +1150,13 @@ export type GatewayMessageCreateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#message-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageCreateDispatchData = APIMessage;
/**
* https://discord.com/developers/docs/topics/gateway#message-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageUpdateDispatch = DataPayload<
GatewayDispatchEvents.MessageUpdate,
@@ -1049,6 +1165,7 @@ export type GatewayMessageUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#message-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageUpdateDispatchData = {
id: Snowflake;
@@ -1057,6 +1174,7 @@ export type GatewayMessageUpdateDispatchData = {
/**
* https://discord.com/developers/docs/topics/gateway#message-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageDeleteDispatch = DataPayload<
GatewayDispatchEvents.MessageDelete,
@@ -1065,6 +1183,7 @@ export type GatewayMessageDeleteDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#message-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayMessageDeleteDispatchData {
/**
@@ -1083,6 +1202,7 @@ export interface GatewayMessageDeleteDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#message-delete-bulk
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageDeleteBulkDispatch = DataPayload<
GatewayDispatchEvents.MessageDeleteBulk,
@@ -1091,6 +1211,7 @@ export type GatewayMessageDeleteBulkDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#message-delete-bulk
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayMessageDeleteBulkDispatchData {
/**
@@ -1109,26 +1230,31 @@ export interface GatewayMessageDeleteBulkDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-add
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageReactionAddDispatch = ReactionData<GatewayDispatchEvents.MessageReactionAdd>;
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-add
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageReactionAddDispatchData = GatewayMessageReactionAddDispatch['d'];
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageReactionRemoveDispatchData = GatewayMessageReactionRemoveDispatch['d'];
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageReactionRemoveAllDispatch = DataPayload<
GatewayDispatchEvents.MessageReactionRemoveAll,
@@ -1137,11 +1263,13 @@ export type GatewayMessageReactionRemoveAllDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageReactionRemoveAllDispatchData = MessageReactionRemoveData;
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<
GatewayDispatchEvents.MessageReactionRemoveEmoji,
@@ -1150,6 +1278,7 @@ export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayMessageReactionRemoveEmojiDispatchData extends MessageReactionRemoveData {
/**
@@ -1160,6 +1289,7 @@ export interface GatewayMessageReactionRemoveEmojiDispatchData extends MessageRe
/**
* https://discord.com/developers/docs/topics/gateway#presence-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayPresenceUpdateDispatch = DataPayload<
GatewayDispatchEvents.PresenceUpdate,
@@ -1168,11 +1298,13 @@ export type GatewayPresenceUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#presence-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayPresenceUpdateDispatchData = RawGatewayPresenceUpdate;
/**
* https://discord.com/developers/docs/topics/gateway#stage-instance-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayStageInstanceCreateDispatch = DataPayload<
GatewayDispatchEvents.StageInstanceCreate,
@@ -1181,11 +1313,13 @@ export type GatewayStageInstanceCreateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#stage-instance-create
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayStageInstanceCreateDispatchData = APIStageInstance;
/**
* https://discord.com/developers/docs/topics/gateway#stage-instance-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayStageInstanceDeleteDispatch = DataPayload<
GatewayDispatchEvents.StageInstanceDelete,
@@ -1194,11 +1328,13 @@ export type GatewayStageInstanceDeleteDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#stage-instance-delete
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayStageInstanceDeleteDispatchData = APIStageInstance;
/**
* https://discord.com/developers/docs/topics/gateway#stage-instance-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayStageInstanceUpdateDispatch = DataPayload<
GatewayDispatchEvents.StageInstanceUpdate,
@@ -1207,16 +1343,19 @@ export type GatewayStageInstanceUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#stage-instance-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayStageInstanceUpdateDispatchData = APIStageInstance;
/**
* https://discord.com/developers/docs/topics/gateway#typing-start
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayTypingStartDispatch = DataPayload<GatewayDispatchEvents.TypingStart, GatewayTypingStartDispatchData>;
/**
* https://discord.com/developers/docs/topics/gateway#typing-start
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayTypingStartDispatchData {
/**
@@ -1245,16 +1384,19 @@ export interface GatewayTypingStartDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#user-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUpdate, GatewayUserUpdateDispatchData>;
/**
* https://discord.com/developers/docs/topics/gateway#user-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayUserUpdateDispatchData = APIUser;
/**
* https://discord.com/developers/docs/topics/gateway#voice-state-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayVoiceStateUpdateDispatch = DataPayload<
GatewayDispatchEvents.VoiceStateUpdate,
@@ -1263,11 +1405,13 @@ export type GatewayVoiceStateUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#voice-state-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState;
/**
* https://discord.com/developers/docs/topics/gateway#voice-server-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayVoiceServerUpdateDispatch = DataPayload<
GatewayDispatchEvents.VoiceServerUpdate,
@@ -1276,6 +1420,7 @@ export type GatewayVoiceServerUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#voice-server-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayVoiceServerUpdateDispatchData {
/**
@@ -1298,6 +1443,7 @@ export interface GatewayVoiceServerUpdateDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#webhooks-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayWebhooksUpdateDispatch = DataPayload<
GatewayDispatchEvents.WebhooksUpdate,
@@ -1306,6 +1452,7 @@ export type GatewayWebhooksUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#webhooks-update
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayWebhooksUpdateDispatchData {
/**
@@ -1324,6 +1471,7 @@ export interface GatewayWebhooksUpdateDispatchData {
/**
* https://discord.com/developers/docs/topics/gateway#heartbeating
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayHeartbeat {
op: GatewayOpcodes.Heartbeat;
@@ -1332,11 +1480,13 @@ export interface GatewayHeartbeat {
/**
* https://discord.com/developers/docs/topics/gateway#heartbeating
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayHeartbeatData = number | null;
/**
* https://discord.com/developers/docs/topics/gateway#identify
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayIdentify {
op: GatewayOpcodes.Identify;
@@ -1345,6 +1495,7 @@ export interface GatewayIdentify {
/**
* https://discord.com/developers/docs/topics/gateway#identify
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayIdentifyData {
/**
@@ -1392,6 +1543,7 @@ export interface GatewayIdentifyData {
/**
* https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayIdentifyProperties {
/**
@@ -1410,6 +1562,7 @@ export interface GatewayIdentifyProperties {
/**
* https://discord.com/developers/docs/topics/gateway#resume
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayResume {
op: GatewayOpcodes.Resume;
@@ -1418,6 +1571,7 @@ export interface GatewayResume {
/**
* https://discord.com/developers/docs/topics/gateway#resume
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayResumeData {
/**
@@ -1436,6 +1590,7 @@ export interface GatewayResumeData {
/**
* https://discord.com/developers/docs/topics/gateway#request-guild-members
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayRequestGuildMembers {
op: GatewayOpcodes.RequestGuildMembers;
@@ -1444,6 +1599,7 @@ export interface GatewayRequestGuildMembers {
/**
* https://discord.com/developers/docs/topics/gateway#request-guild-members
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayRequestGuildMembersData {
/**
@@ -1479,6 +1635,7 @@ export interface GatewayRequestGuildMembersData {
/**
* https://discord.com/developers/docs/topics/gateway#update-voice-state
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayVoiceStateUpdate {
op: GatewayOpcodes.VoiceStateUpdate;
@@ -1487,6 +1644,7 @@ export interface GatewayVoiceStateUpdate {
/**
* https://discord.com/developers/docs/topics/gateway#update-voice-state
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayVoiceStateUpdateData {
/**
@@ -1509,6 +1667,7 @@ export interface GatewayVoiceStateUpdateData {
/**
* https://discord.com/developers/docs/topics/gateway#update-presence
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayUpdatePresence {
op: GatewayOpcodes.PresenceUpdate;
@@ -1517,6 +1676,7 @@ export interface GatewayUpdatePresence {
/**
* https://discord.com/developers/docs/topics/gateway#update-presence-gateway-presence-update-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface GatewayPresenceUpdateData {
/**
@@ -1543,6 +1703,7 @@ export interface GatewayPresenceUpdateData {
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'type' | 'url'>;
@@ -1616,6 +1777,9 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
>
>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
interface MessageReactionRemoveData {
/**
* The id of the channel

View File

@@ -3,20 +3,21 @@
*/
import type { Snowflake } from '../globals.ts';
import type { GatewayPresenceUpdate } from '../payloads/v9/gateway.ts';
import type {
APIApplication,
APIApplicationCommandInteraction,
APIChannel,
APIEmoji,
APIGuild,
APIGuildScheduledEvent,
APIGuildIntegration,
APIGuildMember,
APIGuildScheduledEvent,
APIInteraction,
APIMessage,
APIMessageComponentInteraction,
APIRole,
APIStageInstance,
APISticker,
APIThreadChannel,
APIThreadMember,
APIUnavailableGuild,
APIUser,
@@ -194,6 +195,7 @@ export enum GatewayIntentBits {
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
*/
export enum GatewayDispatchEvents {
ApplicationCommandPermissionsUpdate = 'APPLICATION_COMMAND_PERMISSIONS_UPDATE',
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
@@ -271,6 +273,7 @@ export type GatewayDispatchPayload =
| GatewayChannelModifyDispatch
| GatewayChannelPinsUpdateDispatch
| GatewayGuildBanModifyDispatch
| GatewayGuildCreateDispatch
| GatewayGuildDeleteDispatch
| GatewayGuildEmojisUpdateDispatch
| GatewayGuildIntegrationsUpdateDispatch
@@ -405,6 +408,10 @@ export interface GatewayReadyDispatchData {
* Used for resuming connections
*/
session_id: string;
/**
* Gateway url for resuming connections
*/
resume_gateway_url: string;
/**
* The shard information associated with this session, if sent when identifying
*
@@ -498,16 +505,11 @@ export interface GatewayChannelPinsUpdateDispatchData {
}
/**
* https://discord.com/developers/docs/topics/gateway#guild-create
* https://discord.com/developers/docs/topics/gateway#guild-update
*/
export type GatewayGuildModifyDispatch = DataPayload<
GatewayDispatchEvents.GuildCreate | GatewayDispatchEvents.GuildUpdate,
GatewayGuildModifyDispatchData
>;
export type GatewayGuildModifyDispatch = DataPayload<GatewayDispatchEvents.GuildUpdate, GatewayGuildModifyDispatchData>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-create
* https://discord.com/developers/docs/topics/gateway#guild-update
*/
export type GatewayGuildModifyDispatchData = APIGuild;
@@ -515,12 +517,92 @@ export type GatewayGuildModifyDispatchData = APIGuild;
/**
* https://discord.com/developers/docs/topics/gateway#guild-create
*/
export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch;
export type GatewayGuildCreateDispatch = DataPayload<GatewayDispatchEvents.GuildCreate, GatewayGuildCreateDispatchData>;
/**
* https://discord.com/developers/docs/topics/gateway#guild-create
* https://discord.com/developers/docs/topics/gateway#guild-create-guild-create-extra-fields
*/
export type GatewayGuildCreateDispatchData = GatewayGuildModifyDispatchData;
export interface GatewayGuildCreateDispatchData extends APIGuild {
/**
* When this guild was joined at
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
*/
joined_at: string;
/**
* `true` if this is considered a large guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
*/
large: boolean;
/**
* `true` if this guild is unavailable due to an outage
*/
unavailable?: boolean;
/**
* Total number of members in this guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
*/
member_count: number;
/**
* States of members currently in voice channels; lacks the `guild_id` key
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
*
* See https://discord.com/developers/docs/resources/voice#voice-state-object
*/
voice_states: Omit<GatewayVoiceState, 'guild_id'>[];
/**
* Users in the guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
*
* See https://discord.com/developers/docs/resources/guild#guild-member-object
*/
members: APIGuildMember[];
/**
* Channels in the guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
channels: APIChannel[];
/**
* Threads in the guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
threads: APIChannel[];
/**
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
*
* See https://discord.com/developers/docs/topics/gateway#presence-update
*/
presences: GatewayPresenceUpdate[];
/**
* The stage instances in the guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
*
* See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-stage-instance-structure
*/
stage_instances: APIStageInstance[];
/**
* The scheduled events in the guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
*
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
*/
guild_scheduled_events: APIGuildScheduledEvent[];
}
/**
* https://discord.com/developers/docs/topics/gateway#guild-update
@@ -742,11 +824,11 @@ export interface GatewayGuildMembersChunkDispatchData {
/**
* The chunk index in the expected chunks for this response (`0 <= chunk_index < chunk_count`)
*/
chunk_index?: number;
chunk_index: number;
/**
* The total number of expected chunks for this response
*/
chunk_count?: number;
chunk_count: number;
/**
* If passing an invalid id to `REQUEST_GUILD_MEMBERS`, it will be returned here
*/
@@ -939,7 +1021,7 @@ export type GatewayInteractionCreateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#interaction-create
*/
export type GatewayInteractionCreateDispatchData = APIApplicationCommandInteraction | APIMessageComponentInteraction;
export type GatewayInteractionCreateDispatchData = APIInteraction;
/**
* https://discord.com/developers/docs/topics/gateway#invite-create
@@ -1050,7 +1132,7 @@ export type GatewayMessageCreateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#message-create
*/
export type GatewayMessageCreateDispatchData = APIMessage;
export type GatewayMessageCreateDispatchData = Omit<APIMessage, 'mentions'> & GatewayMessageEventExtraFields;
/**
* https://discord.com/developers/docs/topics/gateway#message-update
@@ -1063,10 +1145,43 @@ export type GatewayMessageUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#message-update
*/
export type GatewayMessageUpdateDispatchData = {
id: Snowflake;
channel_id: Snowflake;
} & Partial<APIMessage>;
export type GatewayMessageUpdateDispatchData = Omit<Partial<APIMessage>, 'mentions'> &
GatewayMessageEventExtraFields & {
/**
* ID of the message
*/
id: Snowflake;
/**
* ID of the channel the message was sent in
*/
channel_id: Snowflake;
};
export interface GatewayMessageEventExtraFields {
/**
* ID of the guild the message was sent in
*/
guild_id?: Snowflake;
/**
* Member properties for this message's author
*
* The member object exists in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* See https://discord.com/developers/docs/resources/guild#guild-member-object
*/
member?: APIGuildMember;
/**
* Users specifically mentioned in the message
*
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* See https://discord.com/developers/docs/resources/user#user-object
* See https://discord.com/developers/docs/resources/guild#guild-member-object
*/
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
}
/**
* https://discord.com/developers/docs/topics/gateway#message-delete
@@ -1280,7 +1395,12 @@ export type GatewayThreadCreateDispatch = GatewayChannelModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#thread-create
*/
export type GatewayThreadCreateDispatchData = GatewayChannelModifyDispatchData;
export interface GatewayThreadCreateDispatchData extends APIThreadChannel {
/**
* Whether the thread is newly created or not.
*/
newly_created?: true;
}
/**
* https://discord.com/developers/docs/topics/gateway#thread-update
@@ -1489,15 +1609,15 @@ export interface GatewayIdentifyProperties {
/**
* Your operating system
*/
$os: string;
os: string;
/**
* Your library name
*/
$browser: string;
browser: string;
/**
* Your library name
*/
$device: string;
device: string;
}
/**
@@ -1534,31 +1654,15 @@ export interface GatewayRequestGuildMembers {
d: GatewayRequestGuildMembersData;
}
/**
* https://discord.com/developers/docs/topics/gateway#request-guild-members
*/
export interface GatewayRequestGuildMembersData {
export interface GatewayRequestGuildMembersDataBase {
/**
* ID of the guild to get members for
*/
guild_id: Snowflake;
/**
* String that username starts with, or an empty string to return all members
*/
query?: string;
/**
* Maximum number of members to send matching the `query`;
* a limit of `0` can be used with an empty string `query` to return all members
*/
limit: number;
/**
* Used to specify if we want the presences of the matched members
*/
presences?: boolean;
/**
* Used to specify which users you wish to fetch
*/
user_ids?: Snowflake | Snowflake[];
/**
* Nonce to identify the Guild Members Chunk response
*
@@ -1569,6 +1673,32 @@ export interface GatewayRequestGuildMembersData {
nonce?: string;
}
export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayRequestGuildMembersDataBase {
/**
* Used to specify which users you wish to fetch
*/
user_ids: Snowflake | Snowflake[];
}
export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestGuildMembersDataBase {
/**
* String that username starts with, or an empty string to return all members
*/
query: string;
/**
* Maximum number of members to send matching the `query`;
* a limit of `0` can be used with an empty string `query` to return all members
*/
limit: number;
}
/**
* https://discord.com/developers/docs/topics/gateway#request-guild-members
*/
export type GatewayRequestGuildMembersData =
| GatewayRequestGuildMembersDataWithUserIds
| GatewayRequestGuildMembersDataWithQuery;
/**
* https://discord.com/developers/docs/topics/gateway#update-voice-state
*/

View File

@@ -23,12 +23,14 @@ export const FormattingPatterns = {
* Regular expression for matching a user mention, strictly with a nickname
*
* The `id` group property is present on the `exec` result of this expression
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
*/
UserWithNickname: /<@!(?<id>\d{17,20})>/,
/**
* Regular expression for matching a user mention, with or without a nickname
*
* The `id` group property is present on the `exec` result of this expression
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
*/
UserWithOptionalNickname: /<@!?(?<id>\d{17,20})>/,
/**
@@ -43,6 +45,13 @@ export const FormattingPatterns = {
* The `id` group property is present on the `exec` result of this expression
*/
Role: /<@&(?<id>\d{17,20})>/,
/**
* Regular expression for matching a application command mention
*
* The `fullName` (possibly including `name`, `subcommandOrGroup` and `subcommand`) and `id` group properties are present on the `exec` result of this expression
*/
SlashCommand:
/<\/(?<fullName>(?<name>[\w-]{1,32})(?: (?<subcommandOrGroup>[\w-]{1,32}))?(?: (?<subcommand>[\w-]{1,32}))?):(?<id>\d{17,20})>/,
/**
* Regular expression for matching a custom emoji, either static or animated
*

98
deno/payloads/common.ts Normal file
View File

@@ -0,0 +1,98 @@
import type { LocaleString } from '../rest/common.ts';
/**
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
*
* These flags are exported as `BigInt`s and NOT numbers. Wrapping them in `Number()`
* may cause issues, try to use BigInts as much as possible or modules that can
* replicate them in some way
*/
export const PermissionFlagsBits = {
CreateInstantInvite: 1n << 0n,
KickMembers: 1n << 1n,
BanMembers: 1n << 2n,
Administrator: 1n << 3n,
ManageChannels: 1n << 4n,
ManageGuild: 1n << 5n,
AddReactions: 1n << 6n,
ViewAuditLog: 1n << 7n,
PrioritySpeaker: 1n << 8n,
Stream: 1n << 9n,
ViewChannel: 1n << 10n,
SendMessages: 1n << 11n,
SendTTSMessages: 1n << 12n,
ManageMessages: 1n << 13n,
EmbedLinks: 1n << 14n,
AttachFiles: 1n << 15n,
ReadMessageHistory: 1n << 16n,
MentionEveryone: 1n << 17n,
UseExternalEmojis: 1n << 18n,
ViewGuildInsights: 1n << 19n,
Connect: 1n << 20n,
Speak: 1n << 21n,
MuteMembers: 1n << 22n,
DeafenMembers: 1n << 23n,
MoveMembers: 1n << 24n,
UseVAD: 1n << 25n,
ChangeNickname: 1n << 26n,
ManageNicknames: 1n << 27n,
ManageRoles: 1n << 28n,
ManageWebhooks: 1n << 29n,
ManageEmojisAndStickers: 1n << 30n,
UseApplicationCommands: 1n << 31n,
RequestToSpeak: 1n << 32n,
ManageEvents: 1n << 33n,
ManageThreads: 1n << 34n,
CreatePublicThreads: 1n << 35n,
CreatePrivateThreads: 1n << 36n,
UseExternalStickers: 1n << 37n,
SendMessagesInThreads: 1n << 38n,
UseEmbeddedActivities: 1n << 39n,
ModerateMembers: 1n << 40n,
} as const;
/**
* Freeze the object of bits, preventing any modifications to it
* @internal
*/
Object.freeze(PermissionFlagsBits);
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json
*/
export interface RESTError {
code: number;
message: string;
errors?: RESTErrorData;
}
export interface RESTErrorFieldInformation {
code: string;
message: string;
}
export interface RESTErrorGroupWrapper {
_errors: RESTErrorData[];
}
export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation | { [k: string]: RESTErrorData } | string;
/**
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
*/
export interface RESTRateLimit {
/**
* A value indicating if you are being globally rate limited or not
*/
global: boolean;
/**
* A message saying you are being rate limited.
*/
message: string;
/**
* The number of seconds to wait before submitting another request.
*/
retry_after: number;
}

View File

@@ -1,4 +1,4 @@
// This file exports all the payloads available in the recommended API version
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
export * from './v9/mod.ts';
export * from './v10/mod.ts';

View File

@@ -0,0 +1,11 @@
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
export type APIApplicationCommandAttachmentOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;
export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Attachment,
Snowflake
>;

View File

@@ -0,0 +1,29 @@
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
import type { LocalizationMap } from '../../../../../v10.ts';
export interface APIApplicationCommandOptionBase<Type extends ApplicationCommandOptionType> {
type: Type;
name: string;
name_localizations?: LocalizationMap | null;
description: string;
description_localizations?: LocalizationMap | null;
required?: boolean;
}
export interface APIInteractionDataOptionBase<T extends ApplicationCommandOptionType, D> {
name: string;
type: T;
value: D;
}
export type APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
Base extends APIApplicationCommandOptionBase<ApplicationCommandOptionType>,
ChoiceType extends APIApplicationCommandOptionChoice,
> =
| (Base & {
autocomplete: true;
})
| (Base & {
autocomplete?: false;
choices?: ChoiceType[];
});

View File

@@ -0,0 +1,9 @@
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
export type APIApplicationCommandBooleanOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Boolean>;
export type APIApplicationCommandInteractionDataBooleanOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Boolean,
boolean
>;

View File

@@ -0,0 +1,14 @@
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';
export interface APIApplicationCommandChannelOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
}
export type APIApplicationCommandInteractionDataChannelOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Channel,
Snowflake
>;

View File

@@ -0,0 +1,28 @@
import type {
APIApplicationCommandOptionBase,
APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper,
APIInteractionDataOptionBase,
} from './base.ts';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
interface APIApplicationCommandIntegerOptionBase
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Integer> {
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}
export type APIApplicationCommandIntegerOption = APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
APIApplicationCommandIntegerOptionBase,
APIApplicationCommandOptionChoice<number>
>;
export interface APIApplicationCommandInteractionDataIntegerOption
extends APIInteractionDataOptionBase<ApplicationCommandOptionType.Integer, number> {
focused?: boolean;
}

View File

@@ -0,0 +1,11 @@
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
export type APIApplicationCommandMentionableOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Mentionable>;
export type APIApplicationCommandInteractionDataMentionableOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Mentionable,
Snowflake
>;

View File

@@ -0,0 +1,28 @@
import type {
APIApplicationCommandOptionBase,
APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper,
APIInteractionDataOptionBase,
} from './base.ts';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
interface APIApplicationCommandNumberOptionBase
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Number> {
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}
export type APIApplicationCommandNumberOption = APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
APIApplicationCommandNumberOptionBase,
APIApplicationCommandOptionChoice<number>
>;
export interface APIApplicationCommandInteractionDataNumberOption
extends APIInteractionDataOptionBase<ApplicationCommandOptionType.Number, number> {
focused?: boolean;
}

View File

@@ -0,0 +1,10 @@
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
export type APIApplicationCommandRoleOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Role>;
export type APIApplicationCommandInteractionDataRoleOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Role,
Snowflake
>;

View File

@@ -0,0 +1,27 @@
import type { LocalizationMap } from '../../../../../v10.ts';
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type
*/
export enum ApplicationCommandOptionType {
Subcommand = 1,
SubcommandGroup,
String,
Integer,
Boolean,
User,
Channel,
Role,
Mentionable,
Number,
Attachment,
}
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure
*/
export interface APIApplicationCommandOptionChoice<ValueType = string | number> {
name: string;
name_localizations?: LocalizationMap | null;
value: ValueType;
}

View File

@@ -0,0 +1,28 @@
import type {
APIApplicationCommandOptionBase,
APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper,
APIInteractionDataOptionBase,
} from './base.ts';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
interface APIApplicationCommandStringOptionBase
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.String> {
/**
* For option type `STRING`, the minimum allowed length (minimum of `0`, maximum of `6000`).
*/
min_length?: number;
/**
* For option type `STRING`, the maximum allowed length (minimum of `1`, maximum of `6000`).
*/
max_length?: number;
}
export type APIApplicationCommandStringOption = APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
APIApplicationCommandStringOptionBase,
APIApplicationCommandOptionChoice<string>
>;
export interface APIApplicationCommandInteractionDataStringOption
extends APIInteractionDataOptionBase<ApplicationCommandOptionType.String, string> {
focused?: boolean;
}

View File

@@ -0,0 +1,14 @@
import type { APIApplicationCommandOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
export interface APIApplicationCommandSubcommandOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Subcommand> {
options?: APIApplicationCommandBasicOption[];
}
export interface APIApplicationCommandInteractionDataSubcommandOption {
name: string;
type: ApplicationCommandOptionType.Subcommand;
options?: APIApplicationCommandInteractionDataBasicOption[];
}

View File

@@ -0,0 +1,17 @@
import type { APIApplicationCommandOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type {
APIApplicationCommandInteractionDataSubcommandOption,
APIApplicationCommandSubcommandOption,
} from './subcommand.ts';
export interface APIApplicationCommandSubcommandGroupOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.SubcommandGroup> {
options?: APIApplicationCommandSubcommandOption[];
}
export interface APIApplicationCommandInteractionDataSubcommandGroupOption {
name: string;
type: ApplicationCommandOptionType.SubcommandGroup;
options: APIApplicationCommandInteractionDataSubcommandOption[];
}

View File

@@ -0,0 +1,10 @@
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
export type APIApplicationCommandUserOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.User>;
export type APIApplicationCommandInteractionDataUserOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.User,
Snowflake
>;

View File

@@ -0,0 +1,147 @@
import type {
APIApplicationCommandAttachmentOption,
APIApplicationCommandInteractionDataAttachmentOption,
} from './_chatInput/attachment.ts';
import type {
APIApplicationCommandBooleanOption,
APIApplicationCommandInteractionDataBooleanOption,
} from './_chatInput/boolean.ts';
import type {
APIApplicationCommandChannelOption,
APIApplicationCommandInteractionDataChannelOption,
} from './_chatInput/channel.ts';
import type {
APIApplicationCommandIntegerOption,
APIApplicationCommandInteractionDataIntegerOption,
} from './_chatInput/integer.ts';
import type {
APIApplicationCommandInteractionDataMentionableOption,
APIApplicationCommandMentionableOption,
} from './_chatInput/mentionable.ts';
import type {
APIApplicationCommandInteractionDataNumberOption,
APIApplicationCommandNumberOption,
} from './_chatInput/number.ts';
import type {
APIApplicationCommandInteractionDataRoleOption,
APIApplicationCommandRoleOption,
} from './_chatInput/role.ts';
import type {
APIApplicationCommandInteractionDataStringOption,
APIApplicationCommandStringOption,
} from './_chatInput/string.ts';
import type {
APIApplicationCommandInteractionDataSubcommandOption,
APIApplicationCommandSubcommandOption,
} from './_chatInput/subcommand.ts';
import type {
APIApplicationCommandInteractionDataSubcommandGroupOption,
APIApplicationCommandSubcommandGroupOption,
} from './_chatInput/subcommandGroup.ts';
import type {
APIApplicationCommandInteractionDataUserOption,
APIApplicationCommandUserOption,
} from './_chatInput/user.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/base.ts';
export * from './_chatInput/boolean.ts';
export * from './_chatInput/channel.ts';
export * from './_chatInput/integer.ts';
export * from './_chatInput/mentionable.ts';
export * from './_chatInput/number.ts';
export * from './_chatInput/role.ts';
export * from './_chatInput/shared.ts';
export * from './_chatInput/string.ts';
export * from './_chatInput/subcommand.ts';
export * from './_chatInput/subcommandGroup.ts';
export * from './_chatInput/user.ts';
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
*/
export type APIApplicationCommandBasicOption =
| APIApplicationCommandStringOption
| APIApplicationCommandIntegerOption
| APIApplicationCommandBooleanOption
| APIApplicationCommandUserOption
| APIApplicationCommandChannelOption
| APIApplicationCommandRoleOption
| APIApplicationCommandMentionableOption
| APIApplicationCommandNumberOption
| APIApplicationCommandAttachmentOption;
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
*/
export type APIApplicationCommandOption =
| APIApplicationCommandSubcommandOption
| APIApplicationCommandSubcommandGroupOption
| APIApplicationCommandBasicOption;
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure
*/
export type APIApplicationCommandInteractionDataOption =
| APIApplicationCommandInteractionDataSubcommandOption
| APIApplicationCommandInteractionDataSubcommandGroupOption
| APIApplicationCommandInteractionDataBasicOption;
export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataStringOption
| APIApplicationCommandInteractionDataIntegerOption
| APIApplicationCommandInteractionDataBooleanOption
| APIApplicationCommandInteractionDataUserOption
| APIApplicationCommandInteractionDataChannelOption
| APIApplicationCommandInteractionDataRoleOption
| APIApplicationCommandInteractionDataMentionableOption
| APIApplicationCommandInteractionDataNumberOption
| APIApplicationCommandInteractionDataAttachmentOption;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIChatInputApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {
options?: APIApplicationCommandInteractionDataOption[];
resolved?: APIChatInputApplicationCommandInteractionDataResolved;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
export interface APIChatInputApplicationCommandInteractionDataResolved {
users?: Record<Snowflake, APIUser>;
roles?: Record<Snowflake, APIRole>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
attachments?: Record<Snowflake, APIAttachment>;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIChatInputApplicationCommandInteraction =
APIApplicationCommandInteractionWrapper<APIChatInputApplicationCommandInteractionData>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIChatInputApplicationCommandDMInteraction =
APIDMInteractionWrapper<APIChatInputApplicationCommandInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIChatInputApplicationCommandGuildInteraction =
APIGuildInteractionWrapper<APIChatInputApplicationCommandInteraction>;

View File

@@ -0,0 +1,104 @@
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIMessage } from '../../channel.ts';
import type { APIUser } from '../../user.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIUserApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.User> {
target_id: Snowflake;
resolved: APIUserApplicationCommandInteractionDataResolved;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
export interface APIUserApplicationCommandInteractionDataResolved {
users: Record<Snowflake, APIUser>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIMessageApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.Message> {
target_id: Snowflake;
resolved: APIMessageApplicationCommandInteractionDataResolved;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
export interface APIMessageApplicationCommandInteractionDataResolved {
messages: Record<Snowflake, APIMessage>;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIContextMenuInteractionData =
| APIUserApplicationCommandInteractionData
| APIMessageApplicationCommandInteractionData;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIUserApplicationCommandInteraction =
APIApplicationCommandInteractionWrapper<APIUserApplicationCommandInteractionData>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIUserApplicationCommandDMInteraction = APIDMInteractionWrapper<APIUserApplicationCommandInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIUserApplicationCommandGuildInteraction =
APIGuildInteractionWrapper<APIUserApplicationCommandInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIMessageApplicationCommandInteraction =
APIApplicationCommandInteractionWrapper<APIMessageApplicationCommandInteractionData>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIMessageApplicationCommandDMInteraction =
APIDMInteractionWrapper<APIMessageApplicationCommandInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIMessageApplicationCommandGuildInteraction =
APIGuildInteractionWrapper<APIMessageApplicationCommandInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIContextMenuInteraction = APIUserApplicationCommandInteraction | APIMessageApplicationCommandInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIContextMenuDMInteraction =
| APIUserApplicationCommandDMInteraction
| APIMessageApplicationCommandDMInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIContextMenuGuildInteraction =
| APIUserApplicationCommandGuildInteraction
| APIMessageApplicationCommandGuildInteraction;

View File

@@ -0,0 +1,9 @@
import type { Snowflake } from '../../../../globals.ts';
import type { ApplicationCommandType } from '../applicationCommands.ts';
export interface APIBaseApplicationCommandInteractionData<Type extends ApplicationCommandType> {
id: Snowflake;
type: Type;
name: string;
guild_id?: Snowflake;
}

View File

@@ -0,0 +1,58 @@
import type { Snowflake } from '../../../../globals.ts';
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure
*/
export interface APIGuildApplicationCommandPermissions {
/**
* The id of the command or the application id if that permission applies to all commands
*/
id: Snowflake;
/**
* The id of the application the command belongs to
*/
application_id: Snowflake;
/**
* The id of the guild
*/
guild_id: Snowflake;
/**
* The permissions for the command in the guild
*/
permissions: APIApplicationCommandPermission[];
}
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure
*/
export interface APIApplicationCommandPermission {
/**
* The id of the role, user or channel. Can also be a permission constant
*/
id: Snowflake;
/**
* Role, user or channel
*/
type: ApplicationCommandPermissionType;
/**
* `true` to allow, `false`, to disallow
*/
permission: boolean;
}
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type
*/
export enum ApplicationCommandPermissionType {
Role = 1,
User,
Channel,
}
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-constants
*/
export const APIApplicationCommandPermissionsConstant = {
Everyone: (guildId: string | bigint): Snowflake => String(guildId),
AllChannels: (guildId: string | bigint): Snowflake => String(BigInt(guildId) - 1n),
};

View File

@@ -0,0 +1,150 @@
import type {
APIApplicationCommandOption,
APIChatInputApplicationCommandDMInteraction,
APIChatInputApplicationCommandGuildInteraction,
APIChatInputApplicationCommandInteraction,
APIChatInputApplicationCommandInteractionData,
} from './_applicationCommands/chatInput.ts';
import type {
APIContextMenuDMInteraction,
APIContextMenuGuildInteraction,
APIContextMenuInteraction,
APIContextMenuInteractionData,
} from './_applicationCommands/contextMenu.ts';
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocalizationMap } from '../../../v10.ts';
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
export * from './_applicationCommands/chatInput.ts';
export * from './_applicationCommands/contextMenu.ts';
export * from './_applicationCommands/permissions.ts';
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object
*/
export interface APIApplicationCommand {
/**
* Unique id of the command
*/
id: Snowflake;
/**
* Type of the command
*/
type: ApplicationCommandType;
/**
* Unique id of the parent application
*/
application_id: Snowflake;
/**
* Guild id of the command, if not global
*/
guild_id?: Snowflake;
/**
* 1-32 character name; `CHAT_INPUT` command names must be all lowercase matching `^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$`
*/
name: string;
/**
* Localization dictionary for the name field. Values follow the same restrictions as name
*/
name_localizations?: LocalizationMap | null;
/**
* The localized name
*/
name_localized?: string;
/**
* 1-100 character description for `CHAT_INPUT` commands, empty string for `USER` and `MESSAGE` commands
*/
description: string;
/**
* Localization dictionary for the description field. Values follow the same restrictions as description
*/
description_localizations?: LocalizationMap | null;
/**
* The localized description
*/
description_localized?: string;
/**
* The parameters for the `CHAT_INPUT` command, max 25
*/
options?: APIApplicationCommandOption[];
/**
* Set of permissions represented as a bitset
*/
default_member_permissions: Permissions | null;
/**
* Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible
*/
dm_permission?: boolean;
/**
* Whether the command is enabled by default when the app is added to a guild
*
* If missing, this property should be assumed as `true`
* @deprecated Use `dm_permission` and/or `default_member_permissions` instead
*/
default_permission?: boolean;
/**
* Autoincrementing version identifier updated during substantial record changes
*/
version: Snowflake;
}
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types
*/
export enum ApplicationCommandType {
ChatInput = 1,
User,
Message,
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIApplicationCommandInteractionData =
| APIChatInputApplicationCommandInteractionData
| APIContextMenuInteractionData;
/**
* https://discord.com/developers/docs/resources/channel#channel-object
*/
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
thread_metadata?: APIThreadMetadata | null;
permissions: Permissions;
parent_id?: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
Required<Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data'>>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandInteraction = APIChatInputApplicationCommandInteraction | APIContextMenuInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandDMInteraction =
| APIChatInputApplicationCommandDMInteraction
| APIContextMenuDMInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandGuildInteraction =
| APIChatInputApplicationCommandGuildInteraction
| APIContextMenuGuildInteraction;

View File

@@ -0,0 +1,33 @@
import type {
APIBaseInteraction,
APIChatInputApplicationCommandInteractionData,
APIDMInteractionWrapper,
APIGuildInteractionWrapper,
InteractionType,
} from '../mod.ts';
export type APIApplicationCommandAutocompleteInteraction = APIBaseInteraction<
InteractionType.ApplicationCommandAutocomplete,
APIChatInputApplicationCommandInteractionData
> &
Required<
Pick<
APIBaseInteraction<
InteractionType.ApplicationCommandAutocomplete,
Required<Pick<APIChatInputApplicationCommandInteractionData, 'options'>>
>,
'data'
>
>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandAutocompleteDMInteraction =
APIDMInteractionWrapper<APIApplicationCommandAutocompleteInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandAutocompleteGuildInteraction =
APIGuildInteractionWrapper<APIApplicationCommandAutocompleteInteraction>;

View File

@@ -0,0 +1,131 @@
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocaleString } from '../../../v10.ts';
import type { APIMessage } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIUser } from '../user.ts';
export type PartialAPIMessageInteractionGuildMember = Pick<
APIGuildMember,
| 'roles'
| 'premium_since'
| 'pending'
| 'nick'
| 'mute'
| 'joined_at'
| 'deaf'
| 'communication_disabled_until'
| 'avatar'
>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#message-interaction-object
*/
export interface APIMessageInteraction {
/**
* ID of the interaction
*/
id: Snowflake;
/**
* The type of interaction
*/
type: InteractionType;
/**
* The name of the application command, including subcommands and subcommand groups
*/
name: string;
/**
* The user who invoked the interaction
*/
user: APIUser;
/**
* The guild member who invoked the interaction, only sent in MESSAGE_CREATE events
*/
member?: PartialAPIMessageInteractionGuildMember;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionGuildMember extends APIGuildMember {
permissions: Permissions;
user: APIUser;
}
// INTERACTIONS RECEIVED
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export interface APIBaseInteraction<Type extends InteractionType, Data> {
/**
* ID of the interaction
*/
id: Snowflake;
/**
* ID of the application this interaction is for
*/
application_id: Snowflake;
/**
* The type of interaction
*/
type: Type;
/**
* The command data payload
*/
data?: Data;
/**
* The guild it was sent from
*/
guild_id?: Snowflake;
/**
* The channel it was sent from
*/
channel_id?: Snowflake;
/**
* Guild member data for the invoking user, including permissions
*
* **This is only sent when an interaction is invoked in a guild**
*/
member?: APIInteractionGuildMember;
/**
* User object for the invoking user, if invoked in a DM
*/
user?: APIUser;
/**
* A continuation token for responding to the interaction
*/
token: string;
/**
* Read-only property, always `1`
*/
version: 1;
/**
* For components, the message they were attached to
*/
message?: APIMessage;
/**
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
*/
app_permissions?: Permissions;
/**
* The selected language of the invoking user
*/
locale: LocaleString;
/**
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: LocaleString;
}
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
Original,
'member' | 'guild_id'
> &
Required<Pick<Original, 'user'>>;
export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
Original,
'user'
> &
Required<Pick<Original, 'member' | 'guild_id'>>;

View File

@@ -0,0 +1,60 @@
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
import type { ComponentType } from '../channel.ts';
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
export type APIMessageComponentInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
APIMessageComponentInteractionData
> &
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
'channel_id' | 'data' | 'message'
>
>;
export type APIMessageComponentButtonInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
APIMessageButtonInteractionData
> &
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
'channel_id' | 'data' | 'message'
>
>;
export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
APIMessageSelectMenuInteractionData
> &
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
'channel_id' | 'data' | 'message'
>
>;
export type APIMessageComponentInteractionData = APIMessageButtonInteractionData | APIMessageSelectMenuInteractionData;
export interface APIMessageComponentBaseInteractionData<CType extends ComponentType> {
/**
* The `custom_id` of the component
*/
custom_id: string;
/**
* The type of the component
*/
component_type: CType;
}
export type APIMessageButtonInteractionData = APIMessageComponentBaseInteractionData<ComponentType.Button>;
export interface APIMessageSelectMenuInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.SelectMenu> {
values: string[];
}
export type APIMessageComponentDMInteraction = APIDMInteractionWrapper<APIMessageComponentInteraction>;
export type APIMessageComponentGuildInteraction = APIGuildInteractionWrapper<APIMessageComponentInteraction>;

View File

@@ -0,0 +1,49 @@
import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts';
import type {
APIBaseInteraction,
APIDMInteractionWrapper,
APIGuildInteractionWrapper,
ComponentType,
InteractionType,
} from '../mod.ts';
export interface ModalSubmitComponent {
type: ComponentType;
custom_id: string;
value: string;
}
export interface ModalSubmitActionRowComponent
extends Omit<APIActionRowComponent<APIModalActionRowComponent>, 'components'> {
components: ModalSubmitComponent[];
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure
*/
export interface APIModalSubmission {
/**
* A developer-defined identifier for the component, max 100 characters
*/
custom_id: string;
/**
* A list of child components
*/
components: ModalSubmitActionRowComponent[];
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIModalSubmitInteraction = APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission> &
Required<Pick<APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission>, 'data'>>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIModalSubmitDMInteraction = APIDMInteractionWrapper<APIModalSubmitInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIModalSubmitGuildInteraction = APIGuildInteractionWrapper<APIModalSubmitInteraction>;

View File

@@ -0,0 +1,4 @@
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
export type APIPingInteraction = Omit<APIBaseInteraction<InteractionType.Ping, never>, 'locale'>;

View File

@@ -0,0 +1,124 @@
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v10.ts';
import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts';
import type { MessageFlags } from '../mod.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
*/
export enum InteractionType {
Ping = 1,
ApplicationCommand,
MessageComponent,
ApplicationCommandAutocomplete,
ModalSubmit,
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object
*/
export type APIInteractionResponse =
| APIInteractionResponsePong
| APIInteractionResponseChannelMessageWithSource
| APIInteractionResponseDeferredChannelMessageWithSource
| APIInteractionResponseDeferredMessageUpdate
| APIInteractionResponseUpdateMessage
| APIApplicationCommandAutocompleteResponse
| APIModalInteractionResponse;
export interface APIInteractionResponsePong {
type: InteractionResponseType.Pong;
}
export interface APIApplicationCommandAutocompleteResponse {
type: InteractionResponseType.ApplicationCommandAutocompleteResult;
data: APICommandAutocompleteInteractionResponseCallbackData;
}
export interface APIModalInteractionResponse {
type: InteractionResponseType.Modal;
data: APIModalInteractionResponseCallbackData;
}
export interface APIInteractionResponseChannelMessageWithSource {
type: InteractionResponseType.ChannelMessageWithSource;
data: APIInteractionResponseCallbackData;
}
export interface APIInteractionResponseDeferredChannelMessageWithSource {
type: InteractionResponseType.DeferredChannelMessageWithSource;
data?: Pick<APIInteractionResponseCallbackData, 'flags'>;
}
export interface APIInteractionResponseDeferredMessageUpdate {
type: InteractionResponseType.DeferredMessageUpdate;
}
export interface APIInteractionResponseUpdateMessage {
type: InteractionResponseType.UpdateMessage;
data?: APIInteractionResponseCallbackData;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type
*/
export enum InteractionResponseType {
/**
* ACK a `Ping`
*/
Pong = 1,
/**
* Respond to an interaction with a message
*/
ChannelMessageWithSource = 4,
/**
* ACK an interaction and edit to a response later, the user sees a loading state
*/
DeferredChannelMessageWithSource,
/**
* ACK a button interaction and update it to a loading state
*/
DeferredMessageUpdate,
/**
* ACK a button interaction and edit the message to which the button was attached
*/
UpdateMessage,
/**
* For autocomplete interactions
*/
ApplicationCommandAutocompleteResult,
/**
* Respond to an interaction with an modal for a user to fill-out
*/
Modal,
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-data-structure
*/
export type APIInteractionResponseCallbackData = Omit<
RESTPostAPIWebhookWithTokenJSONBody,
'username' | 'avatar_url'
> & { flags?: MessageFlags };
export interface APICommandAutocompleteInteractionResponseCallbackData {
choices?: APIApplicationCommandOptionChoice[];
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal
*/
export interface APIModalInteractionResponseCallbackData {
/**
* A developer-defined identifier for the component, max 100 characters
*/
custom_id: string;
/**
* The title of the popup modal
*/
title: string;
/**
* Between 1 and 5 (inclusive) components that make up the modal
*/
components: APIActionRowComponent<APIModalActionRowComponent>[];
}

View File

@@ -0,0 +1,133 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/application
*/
import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
import type { Permissions, Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/application#application-object
*/
export interface APIApplication {
/**
* The id of the app
*/
id: Snowflake;
/**
* The name of the app
*/
name: string;
/**
* The icon hash of the app
*/
icon: string | null;
/**
* The description of the app
*/
description: string;
/**
* An array of rpc origin urls, if rpc is enabled
*/
rpc_origins?: string[];
/**
* When `false` only app owner can join the app's bot to guilds
*/
bot_public: boolean;
/**
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
*/
bot_require_code_grant: boolean;
/**
* The url of the application's terms of service
*/
terms_of_service_url?: string;
/**
* The url of the application's privacy policy
*/
privacy_policy_url?: string;
/**
* Partial user object containing info on the owner of the application
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
owner?: APIUser;
/**
* An empty string
*
* @deprecated This field will be removed in v11
*/
summary: string;
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
* See https://discord.com/developers/docs/game-sdk/applications#getticket
*/
verify_key: string;
/**
* The team this application belongs to
*
* See https://discord.com/developers/docs/topics/teams#data-models-team-object
*/
team: APITeam | null;
/**
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
*/
guild_id?: Snowflake;
/**
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
*/
primary_sku_id?: Snowflake;
/**
* If this application is a game sold on Discord, this field will be the URL slug that links to the store page
*/
slug?: string;
/**
* If this application is a game sold on Discord, this field will be the hash of the image on store embeds
*/
cover_image?: string;
/**
* The application's public flags
*
* See https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
flags: ApplicationFlags;
/**
* Up to 5 tags describing the content and functionality of the application
*/
tags?: [string, string?, string?, string?, string?];
/**
* Settings for the application's default in-app authorization link, if enabled
*/
install_params?: APIApplicationInstallParams;
/**
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
}
export interface APIApplicationInstallParams {
scopes: OAuth2Scopes[];
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
export enum ApplicationFlags {
EmbeddedReleased = 1 << 1,
ManagedEmoji = 1 << 2,
GroupDMCreate = 1 << 4,
RPCHasConnected = 1 << 11,
GatewayPresence = 1 << 12,
GatewayPresenceLimited = 1 << 13,
GatewayGuildMembers = 1 << 14,
GatewayGuildMembersLimited = 1 << 15,
VerificationPendingGuildLimit = 1 << 16,
Embedded = 1 << 17,
GatewayMessageContent = 1 << 18,
GatewayMessageContentLimited = 1 << 19,
EmbeddedFirstParty = 1 << 20,
ApplicationCommandBadge = 1 << 23,
}

View File

@@ -0,0 +1,723 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/audit-log
*/
import type { APIChannel, APIOverwrite } from './channel.ts';
import type {
APIGuildIntegration,
GuildDefaultMessageNotifications,
GuildExplicitContentFilter,
GuildMFALevel,
GuildVerificationLevel,
IntegrationExpireBehavior,
} from './guild.ts';
import type {
APIGuildScheduledEvent,
GuildScheduledEventEntityType,
GuildScheduledEventStatus,
} from './guildScheduledEvent.ts';
import type { APIApplicationCommand } from './interactions.ts';
import type { APIRole } from './permissions.ts';
import type { StageInstancePrivacyLevel } from './stageInstance.ts';
import type { StickerFormatType } from './sticker.ts';
import type { APIUser } from './user.ts';
import type { APIWebhook } from './webhook.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
*/
export interface APIAuditLog {
/**
* List of application commands found in the audit log
*
* See https://discord.com/developers/docs/interactions/application-commands#application-command-object
*/
application_commands: APIApplicationCommand[];
/**
* Webhooks found in the audit log
*
* See https://discord.com/developers/docs/resources/webhook#webhook-object
*/
webhooks: APIWebhook[];
/**
* Users found in the audit log
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
users: APIUser[];
/**
* Audit log entries
*
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object
*/
audit_log_entries: APIAuditLogEntry[];
/**
* Partial integration objects
*
* See https://discord.com/developers/docs/resources/guild#integration-object
*/
integrations: APIGuildIntegration[];
/**
* Threads found in the audit log
*
* Threads referenced in THREAD_CREATE and THREAD_UPDATE events are included in the threads map, since archived threads might not be kept in memory by clients.
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
threads: APIChannel[];
/**
* The guild scheduled events in the audit log
*
* See https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
*/
guild_scheduled_events: APIGuildScheduledEvent[];
}
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure
*/
export interface APIAuditLogEntry {
/**
* ID of the affected entity (webhook, user, role, etc.)
*/
target_id: string | null;
/**
* Changes made to the `target_id`
*
* See https://discord.com/developers/docs/resources/audit-log#audit-log-change-object
*/
changes?: APIAuditLogChange[];
/**
* The user who made the changes
*
* This can be `null` in some cases (webhooks deleting themselves by using their own token, for example)
*/
user_id: Snowflake | null;
/**
* ID of the entry
*/
id: Snowflake;
/**
* Type of action that occurred
*
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
*/
action_type: AuditLogEvent;
/**
* Additional info for certain action types
*
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
*/
options?: APIAuditLogOptions;
/**
* The reason for the change (0-512 characters)
*/
reason?: string;
}
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
*/
export enum AuditLogEvent {
GuildUpdate = 1,
ChannelCreate = 10,
ChannelUpdate,
ChannelDelete,
ChannelOverwriteCreate,
ChannelOverwriteUpdate,
ChannelOverwriteDelete,
MemberKick = 20,
MemberPrune,
MemberBanAdd,
MemberBanRemove,
MemberUpdate,
MemberRoleUpdate,
MemberMove,
MemberDisconnect,
BotAdd,
RoleCreate = 30,
RoleUpdate,
RoleDelete,
InviteCreate = 40,
InviteUpdate,
InviteDelete,
WebhookCreate = 50,
WebhookUpdate,
WebhookDelete,
EmojiCreate = 60,
EmojiUpdate,
EmojiDelete,
MessageDelete = 72,
MessageBulkDelete,
MessagePin,
MessageUnpin,
IntegrationCreate = 80,
IntegrationUpdate,
IntegrationDelete,
StageInstanceCreate,
StageInstanceUpdate,
StageInstanceDelete,
StickerCreate = 90,
StickerUpdate,
StickerDelete,
GuildScheduledEventCreate = 100,
GuildScheduledEventUpdate,
GuildScheduledEventDelete,
ThreadCreate = 110,
ThreadUpdate,
ThreadDelete,
ApplicationCommandPermissionUpdate = 121,
}
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
*/
export interface APIAuditLogOptions {
/**
* Number of days after which inactive members were kicked
*
* Present from:
* - MEMBER_PRUNE
*/
delete_member_days?: string;
/**
* Number of members removed by the prune
*
* Present from:
* - MEMBER_PRUNE
*/
members_removed?: string;
/**
* Channel in which the entities were targeted
*
* Present from:
* - MEMBER_MOVE
* - MESSAGE_PIN
* - MESSAGE_UNPIN
* - MESSAGE_DELETE
* - STAGE_INSTANCE_CREATE
* - STAGE_INSTANCE_UPDATE
* - STAGE_INSTANCE_DELETE
*/
channel_id?: Snowflake;
/**
* ID of the message that was targeted
*
* Present from:
* - MESSAGE_PIN
* - MESSAGE_UNPIN
*/
message_id?: Snowflake;
/**
* Number of entities that were targeted
*
* Present from:
* - MESSAGE_DELETE
* - MESSAGE_BULK_DELETE
* - MEMBER_DISCONNECT
* - MEMBER_MOVE
*/
count?: string;
/**
* ID of the overwritten entity
*
* Present from:
* - CHANNEL_OVERWRITE_CREATE
* - CHANNEL_OVERWRITE_UPDATE
* - CHANNEL_OVERWRITE_DELETE
*/
id?: Snowflake;
/**
* Type of overwritten entity - "0" for "role" or "1" for "member"
*
* Present from:
* - CHANNEL_OVERWRITE_CREATE
* - CHANNEL_OVERWRITE_UPDATE
* - CHANNEL_OVERWRITE_DELETE
*
* {@link AuditLogOptionsType}
*/
type?: AuditLogOptionsType;
/**
* Name of the role
*
* Present from:
* - CHANNEL_OVERWRITE_CREATE
* - CHANNEL_OVERWRITE_UPDATE
* - CHANNEL_OVERWRITE_DELETE
*
* **Present only if the {@link APIAuditLogOptions#type entry type} is "0"**
*/
role_name?: string;
}
export enum AuditLogOptionsType {
Role = '0',
Member = '1',
}
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
*/
export type APIAuditLogChange =
| APIAuditLogChangeKeyName
| APIAuditLogChangeKeyDescription
| APIAuditLogChangeKeyIconHash
| APIAuditLogChangeKeyImageHash
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeyDiscoverySplashHash
| APIAuditLogChangeKeyBannerHash
| APIAuditLogChangeKeyOwnerId
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyPreferredLocale
| APIAuditLogChangeKeyAFKChannelId
| APIAuditLogChangeKeyAFKTimeout
| APIAuditLogChangeKeyRulesChannelId
| APIAuditLogChangeKeyPublicUpdatesChannelId
| APIAuditLogChangeKeyMFALevel
| APIAuditLogChangeKeyVerificationLevel
| APIAuditLogChangeKeyExplicitContentFilter
| APIAuditLogChangeKeyDefaultMessageNotifications
| APIAuditLogChangeKeyVanityURLCode
| APIAuditLogChangeKey$Add
| APIAuditLogChangeKey$Remove
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyWidgetEnabled
| APIAuditLogChangeKeyWidgetChannelId
| APIAuditLogChangeKeySystemChannelId
| APIAuditLogChangeKeyPosition
| APIAuditLogChangeKeyTopic
| APIAuditLogChangeKeyBitrate
| APIAuditLogChangeKeyPermissionOverwrites
| APIAuditLogChangeKeyNSFW
| APIAuditLogChangeKeyApplicationId
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyPermissions
| APIAuditLogChangeKeyColor
| APIAuditLogChangeKeyHoist
| APIAuditLogChangeKeyMentionable
| APIAuditLogChangeKeyAllow
| APIAuditLogChangeKeyDeny
| APIAuditLogChangeKeyCode
| APIAuditLogChangeKeyChannelId
| APIAuditLogChangeKeyInviterId
| APIAuditLogChangeKeyMaxUses
| APIAuditLogChangeKeyUses
| APIAuditLogChangeKeyMaxAge
| APIAuditLogChangeKeyTemporary
| APIAuditLogChangeKeyDeaf
| APIAuditLogChangeKeyMute
| APIAuditLogChangeKeyNick
| APIAuditLogChangeKeyAvatarHash
| APIAuditLogChangeKeyId
| APIAuditLogChangeKeyType
| APIAuditLogChangeKeyEnableEmoticons
| APIAuditLogChangeKeyExpireBehavior
| APIAuditLogChangeKeyExpireGracePeriod
| APIAuditLogChangeKeyUserLimit
| APIAuditLogChangeKeyPrivacyLevel
| APIAuditLogChangeKeyTags
| APIAuditLogChangeKeyFormatType
| APIAuditLogChangeKeyAsset
| APIAuditLogChangeKeyAvailable
| APIAuditLogChangeKeyGuildId
| APIAuditLogChangeKeyArchived
| APIAuditLogChangeKeyLocked
| APIAuditLogChangeKeyAutoArchiveDuration
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeyLocation
| APIAuditLogChangeKeyCommunicationDisabledUntil;
/**
* Returned when an entity's name is changed
*/
export type APIAuditLogChangeKeyName = AuditLogChangeData<'name', string>;
/**
* Returned when a guild's or sticker's or guild scheduled event's description is changed
*/
export type APIAuditLogChangeKeyDescription = AuditLogChangeData<'description', string>;
/**
* Returned when a guild's icon is changed
*/
export type APIAuditLogChangeKeyIconHash = AuditLogChangeData<'icon_hash', string>;
/**
* Returned when a guild's scheduled event's cover image is changed
*/
export type APIAuditLogChangeKeyImageHash = AuditLogChangeData<'image_hash', string>;
/**
* Returned when a guild's splash is changed
*/
export type APIAuditLogChangeKeySplashHash = AuditLogChangeData<'splash_hash', string>;
/**
* Returned when a guild's discovery splash is changed
*/
export type APIAuditLogChangeKeyDiscoverySplashHash = AuditLogChangeData<'discovery_splash_hash', string>;
/**
* Returned when a guild's banner hash is changed
*/
export type APIAuditLogChangeKeyBannerHash = AuditLogChangeData<'banner_hash', string>;
/**
* Returned when a guild's owner_id is changed
*/
export type APIAuditLogChangeKeyOwnerId = AuditLogChangeData<'owner_id', Snowflake>;
/**
* Returned when a guild's region is changed
*/
export type APIAuditLogChangeKeyRegion = AuditLogChangeData<'region', string>;
/**
* Returned when a guild's preferred_locale is changed
*/
export type APIAuditLogChangeKeyPreferredLocale = AuditLogChangeData<'preferred_locale', string>;
/**
* Returned when a guild's afk_channel_id is changed
*/
export type APIAuditLogChangeKeyAFKChannelId = AuditLogChangeData<'afk_channel_id', Snowflake>;
/**
* Returned when a guild's afk_timeout is changed
*/
export type APIAuditLogChangeKeyAFKTimeout = AuditLogChangeData<'afk_timeout', number>;
/**
* Returned when a guild's rules_channel_id is changed
*/
export type APIAuditLogChangeKeyRulesChannelId = AuditLogChangeData<'rules_channel_id', string>;
/**
* Returned when a guild's public_updates_channel_id is changed
*/
export type APIAuditLogChangeKeyPublicUpdatesChannelId = AuditLogChangeData<'public_updates_channel_id', string>;
/**
* Returned when a guild's mfa_level is changed
*/
export type APIAuditLogChangeKeyMFALevel = AuditLogChangeData<'mfa_level', GuildMFALevel>;
/**
* Returned when a guild's verification_level is changed
*/
export type APIAuditLogChangeKeyVerificationLevel = AuditLogChangeData<'verification_level', GuildVerificationLevel>;
/**
* Returned when a guild's explicit_content_filter is changed
*/
export type APIAuditLogChangeKeyExplicitContentFilter = AuditLogChangeData<
'explicit_content_filter',
GuildExplicitContentFilter
>;
/**
* Returned when a guild's default_message_notifications is changed
*/
export type APIAuditLogChangeKeyDefaultMessageNotifications = AuditLogChangeData<
'default_message_notifications',
GuildDefaultMessageNotifications
>;
/**
* Returned when a guild's vanity_url_code is changed
*/
export type APIAuditLogChangeKeyVanityURLCode = AuditLogChangeData<'vanity_url_code', string>;
/**
* Returned when new role(s) are added
*/
export type APIAuditLogChangeKey$Add = AuditLogChangeData<'$add', APIRole[]>;
/**
* Returned when role(s) are removed
*/
export type APIAuditLogChangeKey$Remove = AuditLogChangeData<'$remove', APIRole[]>;
/**
* Returned when there is a change in number of days after which inactive and role-unassigned members are kicked
*/
export type APIAuditLogChangeKeyPruneDeleteDays = AuditLogChangeData<'prune_delete_days', number>;
/**
* Returned when a guild's widget is enabled
*/
export type APIAuditLogChangeKeyWidgetEnabled = AuditLogChangeData<'widget_enabled', boolean>;
/**
* Returned when a guild's widget_channel_id is changed
*/
export type APIAuditLogChangeKeyWidgetChannelId = AuditLogChangeData<'widget_channel_id', Snowflake>;
/**
* Returned when a guild's system_channel_id is changed
*/
export type APIAuditLogChangeKeySystemChannelId = AuditLogChangeData<'system_channel_id', Snowflake>;
/**
* Returned when a channel's position is changed
*/
export type APIAuditLogChangeKeyPosition = AuditLogChangeData<'position', number>;
/**
* Returned when a channel's topic is changed
*/
export type APIAuditLogChangeKeyTopic = AuditLogChangeData<'topic', string>;
/**
* Returned when a voice channel's bitrate is changed
*/
export type APIAuditLogChangeKeyBitrate = AuditLogChangeData<'bitrate', number>;
/**
* Returned when a channel's permission overwrites is changed
*/
export type APIAuditLogChangeKeyPermissionOverwrites = AuditLogChangeData<'permission_overwrites', APIOverwrite[]>;
/**
* Returned when a channel's NSFW restriction is changed
*/
export type APIAuditLogChangeKeyNSFW = AuditLogChangeData<'nsfw', boolean>;
/**
* The application ID of the added or removed Webhook or Bot
*/
export type APIAuditLogChangeKeyApplicationId = AuditLogChangeData<'application_id', Snowflake>;
/**
* Returned when a channel's amount of seconds a user has to wait before sending another message
* is changed
*/
export type APIAuditLogChangeKeyRateLimitPerUser = AuditLogChangeData<'rate_limit_per_user', number>;
/**
* Returned when a permission bitfield is changed
*/
export type APIAuditLogChangeKeyPermissions = AuditLogChangeData<'permissions', string>;
/**
* Returned when a role's color is changed
*/
export type APIAuditLogChangeKeyColor = AuditLogChangeData<'color', number>;
/**
* Represents a change where the key is a snowflake.
* Currently, the only known instance of this is returned when permissions for a command were updated (<insert name of object here>)
*/
export type APIAuditLogChangeKeySnowflake = AuditLogChangeData<Snowflake, unknown>;
/**
* Returned when a role's hoist status is changed
*/
export type APIAuditLogChangeKeyHoist = AuditLogChangeData<'hoist', boolean>;
/**
* Returned when a role's mentionable status is changed
*/
export type APIAuditLogChangeKeyMentionable = AuditLogChangeData<'mentionable', boolean>;
/**
* Returned when an overwrite's allowed permissions bitfield is changed
*/
export type APIAuditLogChangeKeyAllow = AuditLogChangeData<'allow', string>;
/**
* Returned when an overwrite's denied permissions bitfield is changed
*/
export type APIAuditLogChangeKeyDeny = AuditLogChangeData<'deny', string>;
/**
* Returned when an invite's code is changed
*/
export type APIAuditLogChangeKeyCode = AuditLogChangeData<'code', string>;
/**
* Returned when an invite's or guild scheduled event's channel_id is changed
*/
export type APIAuditLogChangeKeyChannelId = AuditLogChangeData<'channel_id', Snowflake>;
/**
* Returned when an invite's inviter_id is changed
*/
export type APIAuditLogChangeKeyInviterId = AuditLogChangeData<'inviter_id', Snowflake>;
/**
* Returned when an invite's max_uses is changed
*/
export type APIAuditLogChangeKeyMaxUses = AuditLogChangeData<'max_uses', number>;
/**
* Returned when an invite's uses is changed
*/
export type APIAuditLogChangeKeyUses = AuditLogChangeData<'uses', number>;
/**
* Returned when an invite's max_age is changed
*/
export type APIAuditLogChangeKeyMaxAge = AuditLogChangeData<'max_age', number>;
/**
* Returned when an invite's temporary status is changed
*/
export type APIAuditLogChangeKeyTemporary = AuditLogChangeData<'temporary', boolean>;
/**
* Returned when a user's deaf status is changed
*/
export type APIAuditLogChangeKeyDeaf = AuditLogChangeData<'deaf', boolean>;
/**
* Returned when a user's mute status is changed
*/
export type APIAuditLogChangeKeyMute = AuditLogChangeData<'mute', boolean>;
/**
* Returned when a user's nick is changed
*/
export type APIAuditLogChangeKeyNick = AuditLogChangeData<'nick', string>;
/**
* Returned when a user's avatar_hash is changed
*/
export type APIAuditLogChangeKeyAvatarHash = AuditLogChangeData<'avatar_hash', string>;
/**
* The ID of the changed entity - sometimes used in conjunction with other keys
*/
export type APIAuditLogChangeKeyId = AuditLogChangeData<'id', Snowflake>;
/**
* The type of entity created
*/
export type APIAuditLogChangeKeyType = AuditLogChangeData<'type', number | string>;
/**
* Returned when an integration's enable_emoticons is changed
*/
export type APIAuditLogChangeKeyEnableEmoticons = AuditLogChangeData<'enable_emoticons', boolean>;
/**
* Returned when an integration's expire_behavior is changed
*/
export type APIAuditLogChangeKeyExpireBehavior = AuditLogChangeData<'expire_behavior', IntegrationExpireBehavior>;
/**
* Returned when an integration's expire_grace_period is changed
*/
export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_grace_period', number>;
/**
* Returned when a voice channel's user_limit is changed
*/
export type APIAuditLogChangeKeyUserLimit = AuditLogChangeData<'user_limit', number>;
/**
* Returned when privacy level of a stage instance or guild scheduled event is changed
*/
export type APIAuditLogChangeKeyPrivacyLevel = AuditLogChangeData<'privacy_level', StageInstancePrivacyLevel>;
/**
* Returned when a sticker's related emoji is changed
*/
export type APIAuditLogChangeKeyTags = AuditLogChangeData<'tags', string>;
/**
* Returned when a sticker's format_type is changed
*/
export type APIAuditLogChangeKeyFormatType = AuditLogChangeData<'format_type', StickerFormatType>;
/**
* Empty string
*/
export type APIAuditLogChangeKeyAsset = AuditLogChangeData<'asset', ''>;
/**
* Returned when a sticker's availability is changed
*/
export type APIAuditLogChangeKeyAvailable = AuditLogChangeData<'available', boolean>;
/**
* Returned when a sticker's guild_id is changed
*/
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<
'default_auto_archive_duration',
number
>;
/**
* Returned when entity type of a guild scheduled event is changed
*/
export type APIAuditLogChangeKeyEntityType = AuditLogChangeData<'entity_type', GuildScheduledEventEntityType>;
/**
* Returned when status of a guild scheduled event is changed
*/
export type APIAuditLogChangeKeyStatus = AuditLogChangeData<'status', GuildScheduledEventStatus>;
/**
* Returned when location of a guild scheduled event is changed
*/
export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string>;
/**
* Returned when a user's timeout is changed
*/
export type APIAuditLogChangeKeyCommunicationDisabledUntil = AuditLogChangeData<'communication_disabled_until', string>;
interface AuditLogChangeData<K extends string, D> {
key: K;
/**
* The new value
*
* If `new_value` is not present in the change object, while `old_value` is,
* that means the property that was changed has been reset, or set to `null`
*/
new_value?: D;
old_value?: D;
}

1533
deno/payloads/v10/channel.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,51 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/emoji
*/
import type { APIRole } from './permissions.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* Not documented but mentioned
*/
export interface APIPartialEmoji {
/**
* Emoji id
*/
id: Snowflake | null;
/**
* Emoji name (can be null only in reaction emoji objects)
*/
name: string | null;
/**
* Whether this emoji is animated
*/
animated?: boolean;
}
/**
* https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure
*/
export interface APIEmoji extends APIPartialEmoji {
/**
* Roles this emoji is whitelisted to
*/
roles?: APIRole['id'][];
/**
* User that created this emoji
*/
user?: APIUser;
/**
* Whether this emoji must be wrapped in colons
*/
require_colons?: boolean;
/**
* Whether this emoji is managed
*/
managed?: boolean;
/**
* Whether this emoji can be used, may be false due to loss of Server Boosts
*/
available?: boolean;
}

View File

@@ -0,0 +1,385 @@
/**
* Types extracted from https://discord.com/developers/docs/topics/gateway
*/
import type { APIChannel, APIThreadMember } from './channel.ts';
import type { APIEmoji } from './emoji.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/topics/gateway#get-gateway
*/
export interface APIGatewayInfo {
/**
* The WSS URL that can be used for connecting to the gateway
*/
url: string;
}
/**
* https://discord.com/developers/docs/topics/gateway#get-gateway-bot
*/
export interface APIGatewayBotInfo extends APIGatewayInfo {
/**
* The recommended number of shards to use when connecting
*
* See https://discord.com/developers/docs/topics/gateway#sharding
*/
shards: number;
/**
* Information on the current session start limit
*
* See https://discord.com/developers/docs/topics/gateway#session-start-limit-object
*/
session_start_limit: APIGatewaySessionStartLimit;
}
/**
* https://discord.com/developers/docs/topics/gateway#session-start-limit-object
*/
export interface APIGatewaySessionStartLimit {
/**
* The total number of session starts the current user is allowed
*/
total: number;
/**
* The remaining number of session starts the current user is allowed
*/
remaining: number;
/**
* The number of milliseconds after which the limit resets
*/
reset_after: number;
/**
* The number of identify requests allowed per 5 seconds
*/
max_concurrency: number;
}
/**
* https://discord.com/developers/docs/topics/gateway#presence-update-presence-update-event-fields
*/
export interface GatewayPresenceUpdate {
/**
* The user presence is being updated for
*
* **The user object within this event can be partial, the only field which must be sent is the `id` field,
* everything else is optional.**
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
user: Partial<APIUser> & Pick<APIUser, 'id'>;
/**
* ID of the guild
*/
guild_id: Snowflake;
/**
* Either "idle", "dnd", "online", or "offline"
*/
status?: PresenceUpdateStatus;
/**
* User's current activities
*
* See https://discord.com/developers/docs/topics/gateway#activity-object
*/
activities?: GatewayActivity[];
/**
* User's platform-dependent status
*
* See https://discord.com/developers/docs/topics/gateway#client-status-object
*/
client_status?: GatewayPresenceClientStatus;
}
export enum PresenceUpdateStatus {
Online = 'online',
DoNotDisturb = 'dnd',
Idle = 'idle',
/**
* Invisible and shown as offline
*/
Invisible = 'invisible',
Offline = 'offline',
}
/**
* https://discord.com/developers/docs/topics/gateway#client-status-object
*/
export interface GatewayPresenceClientStatus {
/**
* The user's status set for an active desktop (Windows, Linux, Mac) application session
*/
desktop?: PresenceUpdateStatus;
/**
* The user's status set for an active mobile (iOS, Android) application session
*/
mobile?: PresenceUpdateStatus;
/**
* The user's status set for an active web (browser, bot account) application session
*/
web?: PresenceUpdateStatus;
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
*/
export interface GatewayActivity {
/**
* The activity's id
* @unstable
*/
id: string;
/**
* The activity's name
*/
name: string;
/**
* Activity type
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
*/
type: ActivityType;
/**
* Stream url, is validated when type is `1`
*/
url?: string | null;
/**
* Unix timestamp of when the activity was added to the user's session
*/
created_at: number;
/**
* Unix timestamps for start and/or end of the game
*/
timestamps?: GatewayActivityTimestamps;
/**
* The Spotify song id
* @unstable
*/
sync_id?: string;
/**
* The platform this activity is being done on
* @unstable You can use {@link ActivityPlatform} as a stepping stone, but this might be inaccurate
*/
platform?: string;
/**
* Application id for the game
*/
application_id?: Snowflake;
/**
* What the player is currently doing
*/
details?: string | null;
/**
* The user's current party status
*/
state?: string | null;
/**
* The emoji used for a custom status
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
*/
emoji?: GatewayActivityEmoji;
/**
* @unstable
*/
session_id?: string;
/**
* Information for the current party of the player
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
*/
party?: GatewayActivityParty;
/**
* Images for the presence and their hover texts
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
*/
assets?: GatewayActivityAssets;
/**
* Secrets for Rich Presence joining and spectating
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
*/
secrets?: GatewayActivitySecrets;
/**
* Whether or not the activity is an instanced game session
*/
instance?: boolean;
/**
* Activity flags `OR`d together, describes what the payload includes
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
flags?: ActivityFlags;
/**
* The custom buttons shown in the Rich Presence (max 2)
*/
buttons?: string[] | GatewayActivityButton[];
}
/**
* @unstable This enum is currently not documented by Discord but has known values which we will try to keep up to date.
* Values might be added or removed without a major version bump.
*/
export enum ActivityPlatform {
Desktop = 'desktop',
Xbox = 'xbox',
Samsung = 'samsung',
IOS = 'ios',
Android = 'android',
Embedded = 'embedded',
PS4 = 'ps4',
PS5 = 'ps5',
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
*/
export enum ActivityType {
/**
* Playing {game}
*/
Playing,
/**
* Streaming {details}
*/
Streaming,
/**
* Listening to {name}
*/
Listening,
/**
* Watching {details}
*/
Watching,
/**
* {emoji} {details}
*/
Custom,
/**
* Competing in {name}
*/
Competing,
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-timestamps
*/
export interface GatewayActivityTimestamps {
/**
* Unix time (in milliseconds) of when the activity started
*/
start?: number;
/**
* Unix time (in milliseconds) of when the activity ends
*/
end?: number;
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
*/
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'id' | 'animated'>> & Pick<APIEmoji, 'name'>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
*/
export interface GatewayActivityParty {
/**
* The id of the party
*/
id?: string;
/**
* Used to show the party's current and maximum size
*/
size?: [current_size: number, max_size: number];
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
*/
export type GatewayActivityAssets = Partial<
Record<'large_image' | 'large_text' | 'small_image' | 'small_text', string>
>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
*/
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
*/
export enum ActivityFlags {
Instance = 1 << 0,
Join = 1 << 1,
Spectate = 1 << 2,
JoinRequest = 1 << 3,
Sync = 1 << 4,
Play = 1 << 5,
PartyPrivacyFriends = 1 << 6,
PartyPrivacyVoiceChannel = 1 << 7,
Embedded = 1 << 8,
}
export interface GatewayActivityButton {
/**
* The text shown on the button (1-32 characters)
*/
label: string;
/**
* The url opened when clicking the button (1-512 characters)
*/
url: string;
}
/**
* https://discord.com/developers/docs/topics/gateway#thread-list-sync-thread-list-sync-event-fields
*/
export interface GatewayThreadListSync {
/**
* ID of the guild
*/
guild_id: Snowflake;
/**
* The ids of all the parent channels whose threads are being synced, otherwise the entire guild
*/
channel_ids?: Snowflake[];
/**
* Array of the synced threads
*/
threads: APIChannel[];
/**
* The member objects for the client user in each joined thread that was synced
*/
members: APIThreadMember[];
}
/**
* https://discord.com/developers/docs/topics/gateway#thread-members-update-thread-members-update-event-fields
*/
export interface GatewayThreadMembersUpdate {
/**
* The id of the thread for which members are being synced
*/
id: Snowflake;
/**
* The id of the guild that the thread is in
*/
guild_id: Snowflake;
/**
* The approximate member count of the thread, does not count above 50 even if there are more members
*/
member_count: number;
/**
* The members that were added to the thread
*/
added_members?: APIThreadMember[];
/**
* The ids of the members that were removed from the thread
*/
removed_member_ids?: Snowflake[];
}

912
deno/payloads/v10/guild.ts Normal file
View File

@@ -0,0 +1,912 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/guild
*/
import type { APIEmoji } from './emoji.ts';
import type { PresenceUpdateStatus } from './gateway.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker } from './sticker.ts';
import type { APIUser } from './user.ts';
import type { Permissions, Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
*/
export interface APIUnavailableGuild {
/**
* Guild id
*/
id: Snowflake;
/**
* `true` if this guild is unavailable due to an outage
*/
unavailable: boolean;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-guild-structure
*/
export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'>, Pick<APIGuild, 'welcome_screen'> {
/**
* Guild name (2-100 characters, excluding trailing and leading whitespace)
*/
name: string;
/**
* Icon hash
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
icon: string | null;
/**
* Splash hash
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
splash: string | null;
/**
* Banner hash
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
banner?: string | null;
/**
* The description for the guild
*/
description?: string | null;
/**
* Enabled guild features
*
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
*/
features?: GuildFeature[];
/**
* Verification level required for the guild
*
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
*/
verification_level?: GuildVerificationLevel;
/**
* The vanity url code for the guild
*/
vanity_url_code?: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-guild-structure
*/
export interface APIGuild extends APIPartialGuild {
/**
* Icon hash, returned when in the template object
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
icon_hash?: string | null;
/**
* Discovery splash hash; only present for guilds with the "DISCOVERABLE" feature
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
discovery_splash: string | null;
/**
* `true` if the user is the owner of the guild
*
* **This field is only received from https://discord.com/developers/docs/resources/user#get-current-user-guilds**
*/
owner?: boolean;
/**
* ID of owner
*/
owner_id: Snowflake;
/**
* Total permissions for the user in the guild (excludes overrides)
*
* **This field is only received from https://discord.com/developers/docs/resources/user#get-current-user-guilds**
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
permissions?: Permissions;
/**
* Voice region id for the guild
*
* See https://discord.com/developers/docs/resources/voice#voice-region-object
* @deprecated This field has been deprecated in favor of `rtc_region` on the channel.
*/
region: string;
/**
* ID of afk channel
*/
afk_channel_id: Snowflake | null;
/**
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout: number;
/**
* `true` if the guild widget is enabled
*/
widget_enabled?: boolean;
/**
* The channel id that the widget will generate an invite to, or `null` if set to no invite
*/
widget_channel_id?: Snowflake | null;
/**
* Verification level required for the guild
*
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
*/
verification_level: GuildVerificationLevel;
/**
* Default message notifications level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
*/
default_message_notifications: GuildDefaultMessageNotifications;
/**
* Explicit content filter level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
*/
explicit_content_filter: GuildExplicitContentFilter;
/**
* Roles in the guild
*
* See https://discord.com/developers/docs/topics/permissions#role-object
*/
roles: APIRole[];
/**
* Custom guild emojis
*
* See https://discord.com/developers/docs/resources/emoji#emoji-object
*/
emojis: APIEmoji[];
/**
* Enabled guild features
*
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
*/
features: GuildFeature[];
/**
* Required MFA level for the guild
*
* See https://discord.com/developers/docs/resources/guild#guild-object-mfa-level
*/
mfa_level: GuildMFALevel;
/**
* Application id of the guild creator if it is bot-created
*/
application_id: Snowflake | null;
/**
* The id of the channel where guild notices such as welcome messages and boost events are posted
*/
system_channel_id: Snowflake | null;
/**
* System channel flags
*
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
*/
system_channel_flags: GuildSystemChannelFlags;
/**
* The id of the channel where Community guilds can display rules and/or guidelines
*/
rules_channel_id: Snowflake | null;
/**
* The maximum number of presences for the guild (`null` is always returned, apart from the largest of guilds)
*/
max_presences?: number | null;
/**
* The maximum number of members for the guild
*/
max_members?: number;
/**
* The vanity url code for the guild
*/
vanity_url_code: string | null;
/**
* The description for the guild
*/
description: string | null;
/**
* Banner hash
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
banner: string | null;
/**
* Premium tier (Server Boost level)
*
* See https://discord.com/developers/docs/resources/guild#guild-object-premium-tier
*/
premium_tier: GuildPremiumTier;
/**
* The number of boosts this guild currently has
*/
premium_subscription_count?: number;
/**
* The preferred locale of a Community guild; used in guild discovery and notices from Discord; defaults to "en-US"
*
* @default "en-US"
*/
preferred_locale: string;
/**
* The id of the channel where admins and moderators of Community guilds receive notices from Discord
*/
public_updates_channel_id: Snowflake | null;
/**
* The maximum amount of users in a video channel
*/
max_video_channel_users?: number;
/**
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
*/
approximate_member_count?: number;
/**
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
*/
approximate_presence_count?: number;
/**
* The welcome screen of a Community guild, shown to new members
*
* Returned in the invite object
*/
welcome_screen?: APIGuildWelcomeScreen;
/**
* The nsfw level of the guild
*
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level
*/
nsfw_level: GuildNSFWLevel;
/**
* Custom guild stickers
*
* See https://discord.com/developers/docs/resources/sticker#sticker-object
*/
stickers: APISticker[];
/**
* Whether the guild has the boost progress bar enabled.
*/
premium_progress_bar_enabled: boolean;
/**
* The type of Student Hub the guild is
*/
hub_type: GuildHubType | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
*/
export enum GuildDefaultMessageNotifications {
AllMessages,
OnlyMentions,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
*/
export enum GuildExplicitContentFilter {
Disabled,
MembersWithoutRoles,
AllMembers,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-mfa-level
*/
export enum GuildMFALevel {
None,
Elevated,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level
*/
export enum GuildNSFWLevel {
Default,
Explicit,
Safe,
AgeRestricted,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-verification-level
*/
export enum GuildVerificationLevel {
/**
* Unrestricted
*/
None,
/**
* Must have verified email on account
*/
Low,
/**
* Must be registered on Discord for longer than 5 minutes
*/
Medium,
/**
* Must be a member of the guild for longer than 10 minutes
*/
High,
/**
* Must have a verified phone number
*/
VeryHigh,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-premium-tier
*/
export enum GuildPremiumTier {
None,
Tier1,
Tier2,
Tier3,
}
export enum GuildHubType {
Default,
HighSchool,
College,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
*/
export enum GuildSystemChannelFlags {
/**
* Suppress member join notifications
*/
SuppressJoinNotifications = 1 << 0,
/**
* Suppress server boost notifications
*/
SuppressPremiumSubscriptions = 1 << 1,
/**
* Suppress server setup tips
*/
SuppressGuildReminderNotifications = 1 << 2,
/**
* Hide member join sticker reply buttons
*/
SuppressJoinNotificationReplies = 1 << 3,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-guild-features
*/
export enum GuildFeature {
/**
* Guild has access to set an animated guild banner image
*/
AnimatedBanner = 'ANIMATED_BANNER',
/**
* Guild has access to set an animated guild icon
*/
AnimatedIcon = 'ANIMATED_ICON',
/**
* Guild has access to set a guild banner image
*/
Banner = 'BANNER',
/**
* Guild can enable welcome screen, Membership Screening and discovery, and receives community updates
*/
Community = 'COMMUNITY',
/**
* Guild is able to be discovered in the directory
*/
Discoverable = 'DISCOVERABLE',
/**
* Guild is able to be featured in the directory
*/
Featurable = 'FEATURABLE',
/**
* Guild is listed in a directory channel
*/
HasDirectoryEntry = 'HAS_DIRECTORY_ENTRY',
/**
* Guild is a Student Hub
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
*
* @unstable This feature is currently not documented by Discord, but has known value
*/
Hub = 'HUB',
/**
* Guild has disabled invite usage, preventing users from joining
*/
InvitesDisabled = 'INVITES_DISABLED',
/**
* Guild has access to set an invite splash background
*/
InviteSplash = 'INVITE_SPLASH',
/**
* Guild is in a Student Hub
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
*
* @unstable This feature is currently not documented by Discord, but has known value
*/
LinkedToHub = 'LINKED_TO_HUB',
/**
* Guild has enabled Membership Screening
*/
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
/**
* Guild has enabled monetization
*/
MonetizationEnabled = 'MONETIZATION_ENABLED',
/**
* Guild has increased custom sticker slots
*/
MoreStickers = 'MORE_STICKERS',
/**
* Guild has access to create news channels
*/
News = 'NEWS',
/**
* Guild is partnered
*/
Partnered = 'PARTNERED',
/**
* Guild can be previewed before joining via Membership Screening or the directory
*/
PreviewEnabled = 'PREVIEW_ENABLED',
/**
* Guild has access to create private threads
*/
PrivateThreads = 'PRIVATE_THREADS',
RelayEnabled = 'RELAY_ENABLED',
/**
* Guild is able to set role icons
*/
RoleIcons = 'ROLE_ICONS',
/**
* Guild has enabled ticketed events
*/
TicketedEventsEnabled = 'TICKETED_EVENTS_ENABLED',
/**
* Guild has access to set a vanity URL
*/
VanityURL = 'VANITY_URL',
/**
* Guild is verified
*/
Verified = 'VERIFIED',
/**
* Guild has access to set 384kbps bitrate in voice (previously VIP voice servers)
*/
VIPRegions = 'VIP_REGIONS',
/**
* Guild has enabled the welcome screen
*/
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
}
/**
* https://discord.com/developers/docs/resources/guild#guild-preview-object
*/
export interface APIGuildPreview {
/**
* Guild id
*/
id: Snowflake;
/**
* Guild name (2-100 characters)
*/
name: string;
/**
* Icon hash
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
icon: string | null;
/**
* Splash hash
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
splash: string | null;
/**
* Discovery splash hash; only present for guilds with the "DISCOVERABLE" feature
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
discovery_splash: string | null;
/**
* Custom guild emojis
*
* See https://discord.com/developers/docs/resources/emoji#emoji-object
*/
emojis: APIEmoji[];
/**
* Enabled guild features
*
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
*/
features: GuildFeature[];
/**
* Approximate number of members in this guild
*/
approximate_member_count: number;
/**
* Approximate number of online members in this guild
*/
approximate_presence_count: number;
/**
* The description for the guild
*/
description: string;
/**
* Custom guild stickers
*/
stickers: APISticker[];
}
/**
* https://discord.com/developers/docs/resources/guild#guild-widget-object
*/
export interface APIGuildWidgetSettings {
/**
* Whether the widget is enabled
*/
enabled: boolean;
/**
* The widget channel id
*/
channel_id: Snowflake | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIGuildMember {
/**
* The user this guild member represents
*
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
user?: APIUser;
/**
* This users guild nickname
*/
nick?: string | null;
/**
* The member's guild avatar hash
*/
avatar?: string | null;
/**
* Array of role object ids
*
* See https://discord.com/developers/docs/topics/permissions#role-object
*/
roles: Snowflake[];
/**
* When the user joined the guild
*/
joined_at: string;
/**
* When the user started boosting the guild
*
* See https://support.discord.com/hc/en-us/articles/360028038352-Server-Boosting-
*/
premium_since?: string | null;
/**
* Whether the user is deafened in voice channels
*/
deaf: boolean;
/**
* Whether the user is muted in voice channels
*/
mute: boolean;
/**
* Whether the user has not yet passed the guild's Membership Screening requirements
*
* *If this field is not present, it can be assumed as `false`.*
*/
pending?: boolean;
/**
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
*/
communication_disabled_until?: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#integration-object
*/
export interface APIGuildIntegration {
/**
* Integration id
*/
id: Snowflake;
/**
* Integration name
*/
name: string;
/**
* Integration type
*/
type: APIGuildIntegrationType;
/**
* Is this integration enabled
*/
enabled?: boolean;
/**
* Is this integration syncing
*
* **This field is not provided for `discord` bot integrations.**
*/
syncing?: boolean;
/**
* ID that this integration uses for "subscribers"
*
* **This field is not provided for `discord` bot integrations.**
*/
role_id?: Snowflake;
/**
* Whether emoticons should be synced for this integration (`twitch` only currently)
*
* **This field is not provided for `discord` bot integrations.**
*/
enable_emoticons?: boolean;
/**
* The behavior of expiring subscribers
*
* **This field is not provided for `discord` bot integrations.**
*
* See https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
*/
expire_behavior?: IntegrationExpireBehavior;
/**
* The grace period (in days) before expiring subscribers
*
* **This field is not provided for `discord` bot integrations.**
*/
expire_grace_period?: number;
/**
* User for this integration
*
* **This field is not provided for `discord` bot integrations.**
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
user?: APIUser;
/**
* Integration account information
*
* See https://discord.com/developers/docs/resources/guild#integration-account-object
*/
account: APIIntegrationAccount;
/**
* When this integration was last synced
*
* **This field is not provided for `discord` bot integrations.**
*/
synced_at?: string;
/**
* How many subscribers this integration has
*
* **This field is not provided for `discord` bot integrations.**
*/
subscriber_count?: number;
/**
* Has this integration been revoked
*
* **This field is not provided for `discord` bot integrations.**
*/
revoked?: boolean;
/**
* The bot/OAuth2 application for discord integrations
*
* See https://discord.com/developers/docs/resources/guild#integration-application-object
*
* **This field is not provided for `discord` bot integrations.**
*/
application?: APIGuildIntegrationApplication;
/**
* The scopes the application has been authorized for
*/
scopes?: OAuth2Scopes[];
}
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord';
/**
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
*/
export enum IntegrationExpireBehavior {
RemoveRole,
Kick,
}
/**
* https://discord.com/developers/docs/resources/guild#integration-account-object
*/
export interface APIIntegrationAccount {
/**
* ID of the account
*/
id: string;
/**
* Name of the account
*/
name: string;
}
/**
* https://discord.com/developers/docs/resources/guild#integration-application-object
*/
export interface APIGuildIntegrationApplication {
/**
* The id of the app
*/
id: Snowflake;
/**
* The name of the app
*/
name: string;
/**
* The icon hash of the app
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
icon: string | null;
/**
* The description of the app
*/
description: string;
/**
* The bot associated with this application
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
bot?: APIUser;
}
/**
* https://discord.com/developers/docs/resources/guild#ban-object
*/
export interface APIBan {
/**
* The reason for the ban
*/
reason: string | null;
/**
* The banned user
*/
user: APIUser;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-widget-object
*/
export interface APIGuildWidget {
id: Snowflake;
name: string;
instant_invite: string | null;
channels: APIGuildWidgetChannel[];
members: APIGuildWidgetMember[];
presence_count: number;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetChannel {
id: Snowflake;
name: string;
position: number;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetMember {
id: string;
username: string;
discriminator: string;
avatar: string | null;
status: PresenceUpdateStatus;
activity?: { name: string };
avatar_url: string;
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-image-widget-style-options
*/
export enum GuildWidgetStyle {
/**
* Shield style widget with Discord icon and guild members online count
*/
Shield = 'shield',
/**
* Large image with guild icon, name and online count. "POWERED BY DISCORD" as the footer of the widget
*/
Banner1 = 'banner1',
/**
* Smaller widget style with guild icon, name and online count. Split on the right with Discord logo
*/
Banner2 = 'banner2',
/**
* Large image with guild icon, name and online count. In the footer, Discord logo on the left and "Chat Now" on the right
*/
Banner3 = 'banner3',
/**
* Large Discord logo at the top of the widget. Guild icon, name and online count in the middle portion of the widget
* and a "JOIN MY SERVER" button at the bottom
*/
Banner4 = 'banner4',
}
export interface APIGuildWelcomeScreen {
/**
* The welcome screen short message
*/
description: string | null;
/**
* Array of suggested channels
*/
welcome_channels: APIGuildWelcomeScreenChannel[];
}
export interface APIGuildWelcomeScreenChannel {
/**
* The channel id that is suggested
*/
channel_id: Snowflake;
/**
* The description shown for the channel
*/
description: string;
/**
* The emoji id of the emoji that is shown on the left of the channel
*/
emoji_id: Snowflake | null;
/**
* The emoji name of the emoji that is shown on the left of the channel
*/
emoji_name: string | null;
}
export interface APIGuildMembershipScreening {
/**
* When the fields were last updated
*/
version: string;
/**
* The steps in the screening form
*/
form_fields: APIGuildMembershipScreeningField[];
/**
* The server description shown in the screening form
*/
description: string | null;
}
// TODO: make this a union based on the type in the future, when new types are added
export interface APIGuildMembershipScreeningField {
/**
* The type of field
*/
field_type: MembershipScreeningFieldType;
/**
* The title of the field
*/
label: string;
/**
* The list of rules
*/
values?: string[];
/**
* Whether the user has to fill out this field
*/
required: boolean;
}
export enum MembershipScreeningFieldType {
/**
* Server Rules
*/
Terms = 'TERMS',
}

View File

@@ -0,0 +1,152 @@
import type { APIGuildMember } from './guild.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType> {
/**
* The id of the guild event
*/
id: Snowflake;
/**
* The guild id which the scheduled event belongs to
*/
guild_id: Snowflake;
/**
* The channel id in which the scheduled event will be hosted, or `null` if entity type is `EXTERNAL`
*/
channel_id: Snowflake | null;
/**
* The id of the user that created the scheduled event
*/
creator_id?: Snowflake | null;
/**
* The name of the scheduled event
*/
name: string;
/**
* The description of the scheduled event
*/
description?: string | null;
/**
* The time the scheduled event will start
*/
scheduled_start_time: string;
/**
* The time at which the guild event will end, or `null` if the event does not have a scheduled time to end
*/
scheduled_end_time: string | null;
/**
* The privacy level of the scheduled event
*/
privacy_level: GuildScheduledEventPrivacyLevel;
/**
* The status of the scheduled event
*/
status: GuildScheduledEventStatus;
/**
* The type of hosting entity associated with the scheduled event
*/
entity_type: Type;
/**
* The id of the hosting entity associated with the scheduled event
*/
entity_id: Snowflake | null;
/**
* The entity metadata for the scheduled event
*/
entity_metadata: APIGuildScheduledEventEntityMetadata | null;
/**
* The user that created the scheduled event
*/
creator?: APIUser;
/**
* The number of users subscribed to the scheduled event
*/
user_count?: number;
/**
* The cover image of the scheduled event
*/
image?: string | null;
}
export interface APIStageInstanceGuildScheduledEvent
extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.StageInstance> {
channel_id: Snowflake;
entity_metadata: null;
}
export interface APIVoiceGuildScheduledEvent extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.Voice> {
channel_id: Snowflake;
entity_metadata: null;
}
export interface APIExternalGuildScheduledEvent
extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.External> {
channel_id: null;
entity_metadata: Required<APIGuildScheduledEventEntityMetadata>;
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
*/
export type APIGuildScheduledEvent =
| APIStageInstanceGuildScheduledEvent
| APIVoiceGuildScheduledEvent
| APIExternalGuildScheduledEvent;
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
*/
export interface APIGuildScheduledEventEntityMetadata {
/**
* The location of the scheduled event
*/
location?: string;
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types
*/
export enum GuildScheduledEventEntityType {
StageInstance = 1,
Voice,
External,
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status
*/
export enum GuildScheduledEventStatus {
Scheduled = 1,
Active,
Completed,
Canceled,
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level
*/
export enum GuildScheduledEventPrivacyLevel {
/**
* The scheduled event is only accessible to guild members
*/
GuildOnly = 2,
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-user-object-guild-scheduled-event-user-structure
*/
export interface APIGuildScheduledEventUser {
/**
* The scheduled event id which the user subscribed to
*/
guild_scheduled_event_id: Snowflake;
/**
* The user which subscribed to the event
*/
user: APIUser;
/**
* The guild member data for this user for the guild which this event belongs to, if any
*/
member?: APIGuildMember;
}

View File

@@ -0,0 +1,57 @@
import type {
APIApplicationCommandDMInteraction,
APIApplicationCommandGuildInteraction,
APIApplicationCommandInteraction,
} from './_interactions/applicationCommands.ts';
import type {
APIApplicationCommandAutocompleteDMInteraction,
APIApplicationCommandAutocompleteGuildInteraction,
APIApplicationCommandAutocompleteInteraction,
} from './_interactions/autocomplete.ts';
import type {
APIMessageComponentDMInteraction,
APIMessageComponentGuildInteraction,
APIMessageComponentInteraction,
} from './_interactions/messageComponents.ts';
import type {
APIModalSubmitDMInteraction,
APIModalSubmitGuildInteraction,
APIModalSubmitInteraction,
} from './_interactions/modalSubmit.ts';
import type { APIPingInteraction } from './_interactions/ping.ts';
export * from './_interactions/applicationCommands.ts';
export * from './_interactions/autocomplete.ts';
export * from './_interactions/base.ts';
export * from './_interactions/messageComponents.ts';
export * from './_interactions/modalSubmit.ts';
export * from './_interactions/ping.ts';
export * from './_interactions/responses.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIInteraction =
| APIPingInteraction
| APIApplicationCommandInteraction
| APIMessageComponentInteraction
| APIApplicationCommandAutocompleteInteraction
| APIModalSubmitInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIDMInteraction =
| APIApplicationCommandDMInteraction
| APIMessageComponentDMInteraction
| APIApplicationCommandAutocompleteDMInteraction
| APIModalSubmitDMInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIGuildInteraction =
| APIApplicationCommandGuildInteraction
| APIMessageComponentGuildInteraction
| APIApplicationCommandAutocompleteGuildInteraction
| APIModalSubmitGuildInteraction;

126
deno/payloads/v10/invite.ts Normal file
View File

@@ -0,0 +1,126 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/invite
*/
import type { APIApplication } from './application.ts';
import type { APIPartialChannel } from './channel.ts';
import type { APIGuild } from './guild.ts';
import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts';
import type { APIInviteStageInstance } from './stageInstance.ts';
import type { APIUser } from './user.ts';
export type APIInviteGuild = Pick<
APIGuild,
| 'id'
| 'name'
| 'splash'
| 'banner'
| 'icon'
| 'vanity_url_code'
| 'description'
| 'features'
| 'verification_level'
| 'nsfw_level'
| 'premium_subscription_count'
>;
/**
* https://discord.com/developers/docs/resources/invite#invite-object
*/
export interface APIInvite {
/**
* The invite code (unique ID)
*/
code: string;
/**
* The guild this invite is for
*
* See https://discord.com/developers/docs/resources/guild#guild-object
*/
guild?: APIInviteGuild;
/**
* The channel this invite is for
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
channel: Required<APIPartialChannel> | null;
/**
* The user who created the invite
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
inviter?: APIUser;
/**
* The type of target for this voice channel invite
*
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
*/
target_type?: InviteTargetType;
/**
* The user whose stream to display for this voice channel stream invite
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
target_user?: APIUser;
/**
* The embedded application to open for this voice channel embedded application invite
*
* See https://discord.com/developers/docs/resources/application#application-object
*/
target_application?: Partial<APIApplication>;
/**
* Approximate count of online members, returned from the `GET /invites/<code>` endpoint when `with_counts` is `true`
*/
approximate_presence_count?: number;
/**
* Approximate count of total members, returned from the `GET /invites/<code>` endpoint when `with_counts` is `true`
*/
approximate_member_count?: number;
/**
* The expiration date of this invite, returned from the `GET /invites/<code>` endpoint when `with_expiration` is `true`
*/
expires_at?: string | null;
/**
* The stage instance data if there is a public stage instance in the stage channel this invite is for
* @deprecated
*/
stage_instance?: APIInviteStageInstance;
/**
* The guild scheduled event data, returned from the `GET /invites/<code>` endpoint when `guild_scheduled_event_id` is a valid guild scheduled event id
*/
guild_scheduled_event?: APIGuildScheduledEvent;
}
/**
* https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
*/
export enum InviteTargetType {
Stream = 1,
EmbeddedApplication,
}
/**
* https://discord.com/developers/docs/resources/invite#invite-metadata-object
*/
export interface APIExtendedInvite extends APIInvite {
/**
* Number of times this invite has been used
*/
uses: number;
/**
* Max number of times this invite can be used
*/
max_uses: number;
/**
* Duration (in seconds) after which the invite expires
*/
max_age: number;
/**
* Whether this invite only grants temporary membership
*/
temporary: boolean;
/**
* When this invite was created
*/
created_at: string;
}

19
deno/payloads/v10/mod.ts Normal file
View File

@@ -0,0 +1,19 @@
export * from '../common.ts';
export * from './application.ts';
export * from './auditLog.ts';
export * from './channel.ts';
export * from './emoji.ts';
export * from './gateway.ts';
export * from './guild.ts';
export * from './guildScheduledEvent.ts';
export * from './interactions.ts';
export * from './invite.ts';
export * from './oauth2.ts';
export * from './permissions.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './teams.ts';
export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';

128
deno/payloads/v10/oauth2.ts Normal file
View File

@@ -0,0 +1,128 @@
/**
* Types extracted from https://discord.com/developers/docs/topics/oauth2
*/
export enum OAuth2Scopes {
/**
* For oauth2 bots, this puts the bot in the user's selected guild by default
*/
Bot = 'bot',
/**
* Allows [/users/@me/connections](https://discord.com/developers/docs/resources/user#get-user-connections)
* to return linked third-party accounts
*
* See https://discord.com/developers/docs/resources/user#get-user-connections
*/
Connections = 'connections',
/**
* Allows your app to see information about the user's DMs and group DMs - requires Discord approval
*/
DMChannelsRead = 'dm_channels.read',
/**
* Enables [/users/@me](https://discord.com/developers/docs/resources/user#get-current-user) to return an `email`
*
* See https://discord.com/developers/docs/resources/user#get-current-user
*/
Email = 'email',
/**
* Allows [/users/@me](https://discord.com/developers/docs/resources/user#get-current-user) without `email`
*
* See https://discord.com/developers/docs/resources/user#get-current-user
*/
Identify = 'identify',
/**
* Allows [/users/@me/guilds](https://discord.com/developers/docs/resources/user#get-current-user-guilds)
* to return basic information about all of a user's guilds
*
* See https://discord.com/developers/docs/resources/user#get-current-user-guilds
*/
Guilds = 'guilds',
/**
* Allows [/guilds/{guild.id}/members/{user.id}](https://discord.com/developers/docs/resources/guild#add-guild-member)
* to be used for joining users to a guild
*
* See https://discord.com/developers/docs/resources/guild#add-guild-member
*/
GuildsJoin = 'guilds.join',
/**
* Allows /users/@me/guilds/{guild.id}/member to return a user's member information in a guild
*
* See https://discord.com/developers/docs/resources/user#get-current-user-guild-member
*/
GuildsMembersRead = 'guilds.members.read',
/**
* Allows your app to join users to a group dm
*
* See https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
*/
GroupDMJoins = 'gdm.join',
/**
* For local rpc server api access, this allows you to read messages from all client channels
* (otherwise restricted to channels/guilds your app creates)
*/
MessagesRead = 'messages.read',
/**
* For local rpc server access, this allows you to control a user's local Discord client - requires Discord approval
*/
RPC = 'rpc',
/**
* For local rpc server api access, this allows you to receive notifications pushed out to the user - requires Discord approval
*/
RPCNotificationsRead = 'rpc.notifications.read',
/**
* This generates a webhook that is returned in the oauth token response for authorization code grants
*/
WebhookIncoming = 'webhook.incoming',
/**
* Allows your app to connect to voice on user's behalf and see all the voice members - requires Discord approval
*/
Voice = 'voice',
/**
* Allows your app to upload/update builds for a user's applications - requires Discord approval
*/
ApplicationsBuildsUpload = 'applications.builds.upload',
/**
* Allows your app to read build data for a user's applications
*/
ApplicationsBuildsRead = 'applications.builds.read',
/**
* Allows your app to read and update store data (SKUs, store listings, achievements, etc.) for a user's applications
*/
ApplicationsStoreUpdate = 'applications.store.update',
/**
* Allows your app to read entitlements for a user's applications
*/
ApplicationsEntitlements = 'applications.entitlements',
/**
* Allows your app to know a user's friends and implicit relationships - requires Discord approval
*/
RelationshipsRead = 'relationships.read',
/**
* Allows your app to fetch data from a user's "Now Playing/Recently Played" list - requires Discord approval
*/
ActivitiesRead = 'activities.read',
/**
* Allows your app to update a user's activity - requires Discord approval (NOT REQUIRED FOR GAMESDK ACTIVITY MANAGER)
*
* See https://discord.com/developers/docs/game-sdk/activities
*/
ActivitiesWrite = 'activities.write',
/**
* Allows your app to use Application Commands in a guild
*
* See https://discord.com/developers/docs/interactions/application-commands
*/
ApplicationsCommands = 'applications.commands',
/**
* Allows your app to update its Application Commands via this bearer token - client credentials grant only
*
* See https://discord.com/developers/docs/interactions/application-commands
*/
ApplicationsCommandsUpdate = 'applications.commands.update',
/**
* Allows your app to update permissions for its commands using a Bearer token - client credentials grant only
*
* See https://discord.com/developers/docs/interactions/application-commands
*/
ApplicationCommandsPermissionsUpdate = 'applications.commands.permissions.update',
}

View File

@@ -0,0 +1,75 @@
/**
* Types extracted from https://discord.com/developers/docs/topics/permissions
*/
import type { Permissions, Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/topics/permissions#role-object
*/
export interface APIRole {
/**
* Role id
*/
id: Snowflake;
/**
* Role name
*/
name: string;
/**
* Integer representation of hexadecimal color code
*/
color: number;
/**
* If this role is pinned in the user listing
*/
hoist: boolean;
/**
* The role icon hash
*/
icon?: string | null;
/**
* The role unicode emoji as a standard emoji
*/
unicode_emoji?: string | null;
/**
* Position of this role
*/
position: number;
/**
* Permission bit set
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
permissions: Permissions;
/**
* Whether this role is managed by an integration
*/
managed: boolean;
/**
* Whether this role is mentionable
*/
mentionable: boolean;
/**
* The tags this role has
*/
tags?: APIRoleTags;
}
/**
* https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure
*/
export interface APIRoleTags {
/**
* The id of the bot this role belongs to
*/
bot_id?: Snowflake;
/**
* Whether this is the guild's premium subscriber role
*/
premium_subscriber?: null;
/**
* The id of the integration this role belongs to
*/
integration_id?: Snowflake;
}

View File

@@ -0,0 +1,77 @@
import type { APIGuildMember } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/stage-instance#stage-instance-object
*/
export interface APIStageInstance {
/**
* The id of the stage instance
*/
id: Snowflake;
/**
* The guild id of the associated stage channel
*/
guild_id: Snowflake;
/**
* The id of the associated stage channel
*/
channel_id: Snowflake;
/**
* The topic of the stage instance (1-120 characters)
*/
topic: string;
/**
* The privacy level of the stage instance
*
* See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-privacy-level
*/
privacy_level: StageInstancePrivacyLevel;
/**
* Whether or not stage discovery is disabled
* @deprecated
*/
discoverable_disabled: boolean;
/**
* The id of the scheduled event for this stage instance
*/
guild_scheduled_event_id?: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-privacy-level
*/
export enum StageInstancePrivacyLevel {
/**
* The stage instance is visible publicly, such as on stage discovery
*/
Public = 1,
/**
* The stage instance is visible to only guild members
*/
GuildOnly,
}
/**
* https://discord.com/developers/docs/resources/invite#invite-stage-instance-object-invite-stage-instance-structure
*/
export interface APIInviteStageInstance {
/**
* The topic of the stage instance (1-120 characters)
*/
topic: string;
/**
* The number of users in the stage
*/
participant_count: number;
/**
* The number of users speaking in the stage
*/
speaker_count: number;
/**
* The members speaking in the stage
*
* See https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure
*/
members: APIGuildMember[];
}

View File

@@ -0,0 +1,127 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/sticker
*/
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/sticker#sticker-object
*/
export interface APISticker {
/**
* ID of the sticker
*/
id: Snowflake;
/**
* For standard stickers, ID of the pack the sticker is from
*/
pack_id?: Snowflake;
/**
* Name of the sticker
*/
name: string;
/**
* Description of the sticker
*/
description: string | null;
/**
* For guild stickers, the Discord name of a unicode emoji representing the sticker's expression. for standard stickers, a comma-separated list of related expressions.
*/
tags: string;
/**
* Previously the sticker asset hash, now an empty string
* @deprecated
*/
asset?: '';
/**
* Type of sticker
*
* See https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-types
*/
type: StickerType;
/**
* Type of sticker format
*
* See https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-format-types
*/
format_type: StickerFormatType;
/**
* Whether this guild sticker can be used, may be false due to loss of Server Boosts
*/
available?: boolean;
/**
* ID of the guild that owns this sticker
*/
guild_id?: Snowflake;
/**
* The user that uploaded the guild sticker
*/
user?: APIUser;
/**
* The standard sticker's sort order within its pack
*/
sort_value?: number;
}
/**
* https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-types
*/
export enum StickerType {
/**
* An official sticker in a pack, part of Nitro or in a removed purchasable pack
*/
Standard = 1,
/**
* A sticker uploaded to a Boosted guild for the guild's members
*/
Guild,
}
/**
* https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-format-types
*/
export enum StickerFormatType {
PNG = 1,
APNG,
Lottie,
}
/**
* https://discord.com/developers/docs/resources/sticker#sticker-item-object
*/
export type APIStickerItem = Pick<APISticker, 'id' | 'name' | 'format_type'>;
/**
* https://discord.com/developers/docs/resources/sticker#sticker-pack-object
*/
export interface APIStickerPack {
/**
* ID of the sticker pack
*/
id: Snowflake;
/**
* The stickers in the pack
*/
stickers: APISticker[];
/**
* Name of the sticker pack
*/
name: string;
/**
* ID of the pack's SKU
*/
sku_id: Snowflake;
/**
* ID of a sticker in the pack which is shown as the pack's icon
*/
cover_sticker_id?: Snowflake;
/**
* Description of the sticker pack
*/
description: string;
/**
* ID of the sticker pack's banner image
*/
banner_asset_id?: Snowflake;
}

View File

@@ -0,0 +1,66 @@
/**
* Types extracted from https://discord.com/developers/docs/topics/teams
*/
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/topics/teams#data-models-team-object
*/
export interface APITeam {
/**
* A hash of the image of the team's icon
*/
icon: string | null;
/**
* The unique id of the team
*/
id: Snowflake;
/**
* The members of the team
*/
members: APITeamMember[];
/**
* The name of the team
*/
name: string;
/**
* The user id of the current team owner
*/
owner_user_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/teams#data-models-team-member-object
*/
export interface APITeamMember {
/**
* The user's membership state on the team
*
* See https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum
*/
membership_state: TeamMemberMembershipState;
/**
* Will always be `["*"]`
*/
permissions: ['*'];
/**
* The id of the parent team of which they are a member
*/
team_id: Snowflake;
/**
* The avatar, discriminator, id, and username of the user
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
user: APIUser;
}
/**
* https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum
*/
export enum TeamMemberMembershipState {
Invited = 1,
Accepted,
}

View File

@@ -0,0 +1,65 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/guild-template
*/
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v10/mod.ts';
/**
* https://discord.com/developers/docs/resources/guild-template#guild-template-object
*/
export interface APITemplate {
/**
* The template code (unique ID)
*/
code: string;
/**
* Template name
*/
name: string;
/**
* The description for the template
*/
description: string | null;
/**
* Number of times this template has been used
*/
usage_count: number;
/**
* The ID of the user who created the template
*/
creator_id: Snowflake;
/**
* The user who created the template
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
creator: APIUser;
/**
* When this template was created
*/
created_at: string;
/**
* When this template was last synced to the source guild
*/
updated_at: string;
/**
* The ID of the guild this template is based on
*/
source_guild_id: Snowflake;
/**
* The guild snapshot this template contains
*/
serialized_source_guild: APITemplateSerializedSourceGuild;
/**
* Whether the template has unsynced changes
*/
is_dirty: boolean | null;
}
export interface APITemplateSerializedSourceGuild extends Omit<RESTPostAPIGuildsJSONBody, 'icon'> {
description: string | null;
preferred_locale: string;
icon_hash: string | null;
}

248
deno/payloads/v10/user.ts Normal file
View File

@@ -0,0 +1,248 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/user
*/
import type { APIGuildIntegration } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/user#user-object
*/
export interface APIUser {
/**
* The user's id
*/
id: Snowflake;
/**
* The user's username, not unique across the platform
*/
username: string;
/**
* The user's 4-digit discord-tag
*/
discriminator: string;
/**
* The user's avatar hash
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
avatar: string | null;
/**
* Whether the user belongs to an OAuth2 application
*/
bot?: boolean;
/**
* Whether the user is an Official Discord System user (part of the urgent message system)
*/
system?: boolean;
/**
* Whether the user has two factor enabled on their account
*/
mfa_enabled?: boolean;
/**
* The user's banner hash
*
* See https://discord.com/developers/docs/reference#image-formatting
*/
banner?: string | null;
/**
* The user's banner color encoded as an integer representation of hexadecimal color code
*/
accent_color?: number | null;
/**
* The user's chosen language option
*/
locale?: string;
/**
* Whether the email on this account has been verified
*/
verified?: boolean;
/**
* The user's email
*/
email?: string | null;
/**
* The flags on a user's account
*
* See https://discord.com/developers/docs/resources/user#user-object-user-flags
*/
flags?: UserFlags;
/**
* The type of Nitro subscription on a user's account
*
* See https://discord.com/developers/docs/resources/user#user-object-premium-types
*/
premium_type?: UserPremiumType;
/**
* The public flags on a user's account
*
* See https://discord.com/developers/docs/resources/user#user-object-user-flags
*/
public_flags?: UserFlags;
}
/**
* https://discord.com/developers/docs/resources/user#user-object-user-flags
*/
export enum UserFlags {
/**
* Discord Employee
*/
Staff = 1 << 0,
/**
* Partnered Server Owner
*/
Partner = 1 << 1,
/**
* HypeSquad Events Member
*/
Hypesquad = 1 << 2,
/**
* Bug Hunter Level 1
*/
BugHunterLevel1 = 1 << 3,
/**
* House Bravery Member
*/
HypeSquadOnlineHouse1 = 1 << 6,
/**
* House Brilliance Member
*/
HypeSquadOnlineHouse2 = 1 << 7,
/**
* House Balance Member
*/
HypeSquadOnlineHouse3 = 1 << 8,
/**
* Early Nitro Supporter
*/
PremiumEarlySupporter = 1 << 9,
/**
* User is a [team](https://discord.com/developers/docs/topics/teams)
*/
TeamPseudoUser = 1 << 10,
/**
* Bug Hunter Level 2
*/
BugHunterLevel2 = 1 << 14,
/**
* Verified Bot
*/
VerifiedBot = 1 << 16,
/**
* Early Verified Bot Developer
*/
VerifiedDeveloper = 1 << 17,
/**
* Discord Certified Moderator
*/
CertifiedModerator = 1 << 18,
/**
* Bot uses only [HTTP interactions](https://discord.com/developers/docs/interactions/receiving-and-responding#receiving-an-interaction) and is shown in the online member list
*/
BotHTTPInteractions = 1 << 19,
/**
* User has been identified as spammer
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Spammer = 1 << 20,
/**
* User's account has been quarantined based on recent activity
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Quarantined = Math.pow(2, 44),
}
/**
* https://discord.com/developers/docs/resources/user#user-object-premium-types
*/
export enum UserPremiumType {
None,
NitroClassic,
Nitro,
}
/**
* https://discord.com/developers/docs/resources/user#connection-object
*/
export interface APIConnection {
/**
* ID of the connection account
*/
id: string;
/**
* The username of the connection account
*/
name: string;
/**
* The service of the connection
*
* See https://discord.com/developers/docs/resources/user#connection-object-services
*/
type: ConnectionService;
/**
* Whether the connection is revoked
*/
revoked?: boolean;
/**
* An array of partial server integrations
*
* See https://discord.com/developers/docs/resources/guild#integration-object
*/
integrations?: Partial<APIGuildIntegration>[];
/**
* Whether the connection is verified
*/
verified: boolean;
/**
* Whether friend sync is enabled for this connection
*/
friend_sync: boolean;
/**
* Whether activities related to this connection will be shown in presence updates
*/
show_activity: boolean;
/**
* Whether this connection supports console voice transfer
*/
two_way_link: boolean;
/**
* Visibility of this connection
*
* See https://discord.com/developers/docs/resources/user#connection-object-visibility-types
*/
visibility: ConnectionVisibility;
}
export enum ConnectionService {
BattleNet = 'battlenet',
eBay = 'ebay',
EpicGames = 'epicgames',
Facebook = 'facebook',
GitHub = 'github',
LeagueOfLegends = 'leagueoflegends',
PayPal = 'paypal',
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
RiotGames = 'riotgames',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',
Twitch = 'twitch',
Twitter = 'twitter',
Xbox = 'xbox',
YouTube = 'youtube',
}
export enum ConnectionVisibility {
/**
* Invisible to everyone except the user themselves
*/
None,
/**
* Visible to everyone
*/
Everyone,
}

View File

@@ -0,0 +1,92 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/voice
*/
import type { APIGuildMember } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/voice#voice-state-object
*/
export interface GatewayVoiceState {
/**
* The guild id this voice state is for
*/
guild_id?: Snowflake;
/**
* The channel id this user is connected to
*/
channel_id: Snowflake | null;
/**
* The user id this voice state is for
*/
user_id: Snowflake;
/**
* The guild member this voice state is for
*
* See https://discord.com/developers/docs/resources/guild#guild-member-object
*/
member?: APIGuildMember;
/**
* The session id for this voice state
*/
session_id: string;
/**
* Whether this user is deafened by the server
*/
deaf: boolean;
/**
* Whether this user is muted by the server
*/
mute: boolean;
/**
* Whether this user is locally deafened
*/
self_deaf: boolean;
/**
* Whether this user is locally muted
*/
self_mute: boolean;
/**
* Whether this user is streaming using "Go Live"
*/
self_stream?: boolean;
/**
* Whether this user's camera is enabled
*/
self_video: boolean;
/**
* Whether this user is muted by the current user
*/
suppress: boolean;
/**
* The time at which the user requested to speak
*/
request_to_speak_timestamp: string | null;
}
/**
* https://discord.com/developers/docs/resources/voice#voice-region-object
*/
export interface APIVoiceRegion {
/**
* Unique ID for the region
*/
id: string;
/**
* Name of the region
*/
name: string;
/**
* `true` for a single server that is closest to the current user's client
*/
optimal: boolean;
/**
* Whether this is a deprecated voice region (avoid switching to these)
*/
deprecated: boolean;
/**
* Whether this is a custom voice region (used for events/etc)
*/
custom: boolean;
}

View File

@@ -0,0 +1,79 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/webhook
*/
import type { APIPartialChannel, APIPartialGuild, APIUser } from './mod.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/webhook#webhook-object
*/
export interface APIWebhook {
/**
* The id of the webhook
*/
id: Snowflake;
/**
* The type of the webhook
*
* See https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types
*/
type: WebhookType;
/**
* The guild id this webhook is for
*/
guild_id?: Snowflake;
/**
* The channel id this webhook is for
*/
channel_id: Snowflake;
/**
* The user this webhook was created by (not returned when getting a webhook with its token)
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
user?: APIUser;
/**
* The default name of the webhook
*/
name: string | null;
/**
* The default avatar of the webhook
*/
avatar: string | null;
/**
* The secure token of the webhook (returned for Incoming Webhooks)
*/
token?: string;
/**
* The bot/OAuth2 application that created this webhook
*/
application_id: Snowflake | null;
/**
* The guild of the channel that this webhook is following (returned for Channel Follower Webhooks)
*/
source_guild?: APIPartialGuild;
/**
* The channel that this webhook is following (returned for Channel Follower Webhooks)
*/
source_channel?: APIPartialChannel;
/**
* The url used for executing the webhook (returned by the webhooks OAuth2 flow)
*/
url?: string;
}
export enum WebhookType {
/**
* Incoming Webhooks can post messages to channels with a generated token
*/
Incoming = 1,
/**
* Channel Follower Webhooks are internal webhooks used with Channel Following to post new messages into channels
*/
ChannelFollower,
/**
* Application webhooks are webhooks used with Interactions
*/
Application,
}

View File

@@ -122,7 +122,6 @@ export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'name' | 'animated'>>
*/
export interface GatewayActivityParty {
id?: string;
// eslint-disable-next-line prettier/prettier
size?: [currentSize: number, maxSize: number];
}

View File

@@ -0,0 +1,17 @@
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandAttachmentOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Attachment,
Snowflake
>;

View File

@@ -1,5 +1,8 @@
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommandOptionBase<Type extends ApplicationCommandOptionType> {
type: Type;
name: string;
@@ -7,12 +10,18 @@ export interface APIApplicationCommandOptionBase<Type extends ApplicationCommand
required?: boolean;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIInteractionDataOptionBase<T extends ApplicationCommandOptionType, D> {
name: string;
type: T;
value: D;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
Base extends APIApplicationCommandOptionBase<ApplicationCommandOptionType>,
ChoiceType extends APIApplicationCommandOptionChoice,

View File

@@ -1,8 +1,14 @@
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandBooleanOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Boolean>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandInteractionDataBooleanOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Boolean,
boolean

View File

@@ -1,13 +1,19 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommandChannelOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandInteractionDataChannelOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Channel,
Snowflake

View File

@@ -5,23 +5,32 @@ import type {
} from './base.ts';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
export interface APIApplicationCommandIntegerOptionBase
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
interface APIApplicationCommandIntegerOptionBase
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Integer> {
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandIntegerOption = APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
APIApplicationCommandIntegerOptionBase,
APIApplicationCommandOptionChoice<number>
>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommandInteractionDataIntegerOption
extends APIInteractionDataOptionBase<ApplicationCommandOptionType.Integer, number> {
focused?: boolean;

View File

@@ -1,10 +1,16 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandMentionableOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Mentionable>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandInteractionDataMentionableOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Mentionable,
Snowflake

View File

@@ -5,23 +5,32 @@ import type {
} from './base.ts';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
export interface APIApplicationCommandNumberOptionBase
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
interface APIApplicationCommandNumberOptionBase
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Number> {
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandNumberOption = APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
APIApplicationCommandNumberOptionBase,
APIApplicationCommandOptionChoice<number>
>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommandInteractionDataNumberOption
extends APIInteractionDataOptionBase<ApplicationCommandOptionType.Number, number> {
focused?: boolean;

View File

@@ -1,9 +1,15 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandRoleOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Role>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandInteractionDataRoleOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.Role,
Snowflake

View File

@@ -1,5 +1,6 @@
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum ApplicationCommandOptionType {
Subcommand = 1,
@@ -12,10 +13,12 @@ export enum ApplicationCommandOptionType {
Role,
Mentionable,
Number,
Attachment,
}
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommandOptionChoice<ValueType = string | number> {
name: string;

View File

@@ -5,11 +5,17 @@ import type {
} from './base.ts';
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandStringOption = APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
APIApplicationCommandOptionBase<ApplicationCommandOptionType.String>,
APIApplicationCommandOptionChoice<string>
>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommandInteractionDataStringOption
extends APIInteractionDataOptionBase<ApplicationCommandOptionType.String, string> {
focused?: boolean;

View File

@@ -1,12 +1,18 @@
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
import type { APIApplicationCommandOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommandSubcommandOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Subcommand> {
options?: APIApplicationCommandBasicOption[];
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommandInteractionDataSubcommandOption {
name: string;
type: ApplicationCommandOptionType.Subcommand;

View File

@@ -5,11 +5,17 @@ import type {
APIApplicationCommandSubcommandOption,
} from './subcommand.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommandSubcommandGroupOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.SubcommandGroup> {
options?: APIApplicationCommandSubcommandOption[];
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommandInteractionDataSubcommandGroupOption {
name: string;
type: ApplicationCommandOptionType.SubcommandGroup;

View File

@@ -1,9 +1,15 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandUserOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.User>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandInteractionDataUserOption = APIInteractionDataOptionBase<
ApplicationCommandOptionType.User,
Snowflake

View File

@@ -1,5 +1,50 @@
import type {
APIApplicationCommandAttachmentOption,
APIApplicationCommandInteractionDataAttachmentOption,
} from './_chatInput/attachment.ts';
import type {
APIApplicationCommandBooleanOption,
APIApplicationCommandInteractionDataBooleanOption,
} from './_chatInput/boolean.ts';
import type {
APIApplicationCommandChannelOption,
APIApplicationCommandInteractionDataChannelOption,
} from './_chatInput/channel.ts';
import type {
APIApplicationCommandIntegerOption,
APIApplicationCommandInteractionDataIntegerOption,
} from './_chatInput/integer.ts';
import type {
APIApplicationCommandInteractionDataMentionableOption,
APIApplicationCommandMentionableOption,
} from './_chatInput/mentionable.ts';
import type {
APIApplicationCommandInteractionDataNumberOption,
APIApplicationCommandNumberOption,
} from './_chatInput/number.ts';
import type {
APIApplicationCommandInteractionDataRoleOption,
APIApplicationCommandRoleOption,
} from './_chatInput/role.ts';
import type {
APIApplicationCommandInteractionDataStringOption,
APIApplicationCommandStringOption,
} from './_chatInput/string.ts';
import type {
APIApplicationCommandInteractionDataSubcommandOption,
APIApplicationCommandSubcommandOption,
} from './_chatInput/subcommand.ts';
import type {
APIApplicationCommandInteractionDataSubcommandGroupOption,
APIApplicationCommandSubcommandGroupOption,
} from './_chatInput/subcommandGroup.ts';
import type {
APIApplicationCommandInteractionDataUserOption,
APIApplicationCommandUserOption,
} from './_chatInput/user.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIRole, APIUser } from '../../mod.ts';
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
@@ -7,76 +52,38 @@ import type {
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type {
APIApplicationCommandStringOption,
APIApplicationCommandInteractionDataStringOption,
} from './_chatInput/string.ts';
import type {
APIApplicationCommandIntegerOptionBase,
APIApplicationCommandInteractionDataIntegerOption,
} from './_chatInput/integer.ts';
import type {
APIApplicationCommandBooleanOption,
APIApplicationCommandInteractionDataBooleanOption,
} from './_chatInput/boolean.ts';
import type {
APIApplicationCommandUserOption,
APIApplicationCommandInteractionDataUserOption,
} from './_chatInput/user.ts';
import type {
APIApplicationCommandChannelOption,
APIApplicationCommandInteractionDataChannelOption,
} from './_chatInput/channel.ts';
import type {
APIApplicationCommandRoleOption,
APIApplicationCommandInteractionDataRoleOption,
} from './_chatInput/role.ts';
import type {
APIApplicationCommandMentionableOption,
APIApplicationCommandInteractionDataMentionableOption,
} from './_chatInput/mentionable.ts';
import type {
APIApplicationCommandNumberOptionBase,
APIApplicationCommandInteractionDataNumberOption,
} from './_chatInput/number.ts';
import type {
APIApplicationCommandSubcommandOption,
APIApplicationCommandInteractionDataSubcommandOption,
} from './_chatInput/subcommand.ts';
import type {
APIApplicationCommandSubcommandGroupOption,
APIApplicationCommandInteractionDataSubcommandGroupOption,
} from './_chatInput/subcommandGroup.ts';
export * from './_chatInput/string.ts';
export * from './_chatInput/integer.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/boolean.ts';
export * from './_chatInput/user.ts';
export * from './_chatInput/channel.ts';
export * from './_chatInput/role.ts';
export * from './_chatInput/integer.ts';
export * from './_chatInput/mentionable.ts';
export * from './_chatInput/number.ts';
export * from './_chatInput/role.ts';
export * from './_chatInput/shared.ts';
export * from './_chatInput/string.ts';
export * from './_chatInput/subcommand.ts';
export * from './_chatInput/subcommandGroup.ts';
export * from './_chatInput/shared.ts';
export * from './_chatInput/user.ts';
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandBasicOption =
| APIApplicationCommandStringOption
| APIApplicationCommandIntegerOptionBase
| APIApplicationCommandIntegerOption
| APIApplicationCommandBooleanOption
| APIApplicationCommandUserOption
| APIApplicationCommandChannelOption
| APIApplicationCommandRoleOption
| APIApplicationCommandMentionableOption
| APIApplicationCommandNumberOptionBase;
| APIApplicationCommandNumberOption
| APIApplicationCommandAttachmentOption;
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandOption =
| APIApplicationCommandSubcommandOption
@@ -85,12 +92,16 @@ export type APIApplicationCommandOption =
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandInteractionDataOption =
| APIApplicationCommandInteractionDataSubcommandOption
| APIApplicationCommandInteractionDataSubcommandGroupOption
| APIApplicationCommandInteractionDataBasicOption;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataStringOption
| APIApplicationCommandInteractionDataIntegerOption
@@ -99,10 +110,12 @@ export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataChannelOption
| APIApplicationCommandInteractionDataRoleOption
| APIApplicationCommandInteractionDataMentionableOption
| APIApplicationCommandInteractionDataNumberOption;
| APIApplicationCommandInteractionDataNumberOption
| APIApplicationCommandInteractionDataAttachmentOption;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIChatInputApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {
@@ -112,28 +125,33 @@ export interface APIChatInputApplicationCommandInteractionData
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIChatInputApplicationCommandInteractionDataResolved {
users?: Record<Snowflake, APIUser>;
roles?: Record<Snowflake, APIRole>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
attachments?: Record<Snowflake, APIAttachment>;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIChatInputApplicationCommandInteraction =
APIApplicationCommandInteractionWrapper<APIChatInputApplicationCommandInteractionData>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIChatInputApplicationCommandDMInteraction =
APIDMInteractionWrapper<APIChatInputApplicationCommandInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIChatInputApplicationCommandGuildInteraction =
APIGuildInteractionWrapper<APIChatInputApplicationCommandInteraction>;

View File

@@ -1,16 +1,17 @@
import type { APIUser } from '../../user.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIMessage } from '../../channel.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIUser } from '../../user.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIUserApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.User> {
@@ -20,6 +21,7 @@ export interface APIUserApplicationCommandInteractionData
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIUserApplicationCommandInteractionDataResolved {
users: Record<Snowflake, APIUser>;
@@ -28,6 +30,7 @@ export interface APIUserApplicationCommandInteractionDataResolved {
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIMessageApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.Message> {
@@ -37,6 +40,7 @@ export interface APIMessageApplicationCommandInteractionData
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIMessageApplicationCommandInteractionDataResolved {
messages: Record<Snowflake, APIMessage>;
@@ -44,6 +48,7 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIContextMenuInteractionData =
| APIUserApplicationCommandInteractionData
@@ -51,46 +56,54 @@ export type APIContextMenuInteractionData =
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIUserApplicationCommandInteraction =
APIApplicationCommandInteractionWrapper<APIUserApplicationCommandInteractionData>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIUserApplicationCommandDMInteraction = APIDMInteractionWrapper<APIUserApplicationCommandInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIUserApplicationCommandGuildInteraction =
APIGuildInteractionWrapper<APIUserApplicationCommandInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIMessageApplicationCommandInteraction =
APIApplicationCommandInteractionWrapper<APIMessageApplicationCommandInteractionData>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIMessageApplicationCommandDMInteraction =
APIDMInteractionWrapper<APIMessageApplicationCommandInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIMessageApplicationCommandGuildInteraction =
APIGuildInteractionWrapper<APIMessageApplicationCommandInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIContextMenuInteraction = APIUserApplicationCommandInteraction | APIMessageApplicationCommandInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIContextMenuDMInteraction =
| APIUserApplicationCommandDMInteraction
@@ -98,6 +111,7 @@ export type APIContextMenuDMInteraction =
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIContextMenuGuildInteraction =
| APIUserApplicationCommandGuildInteraction

View File

@@ -1,6 +1,9 @@
import type { Snowflake } from '../../../../globals.ts';
import type { ApplicationCommandType } from '../applicationCommands.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIBaseApplicationCommandInteractionData<Type extends ApplicationCommandType> {
id: Snowflake;
type: Type;

View File

@@ -2,6 +2,7 @@ import type { Snowflake } from '../../../../globals.ts';
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIGuildApplicationCommandPermissions {
/**
@@ -24,6 +25,7 @@ export interface APIGuildApplicationCommandPermissions {
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommandPermission {
/**
@@ -42,6 +44,7 @@ export interface APIApplicationCommandPermission {
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum ApplicationCommandPermissionType {
Role = 1,

View File

@@ -1,8 +1,3 @@
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { APIPartialChannel } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
import type {
APIApplicationCommandOption,
APIChatInputApplicationCommandDMInteraction,
@@ -16,6 +11,11 @@ import type {
APIContextMenuInteraction,
APIContextMenuInteractionData,
} from './_applicationCommands/contextMenu.ts';
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { APIPartialChannel } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
export * from './_applicationCommands/chatInput.ts';
export * from './_applicationCommands/contextMenu.ts';
@@ -23,6 +23,7 @@ export * from './_applicationCommands/permissions.ts';
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommand {
/**
@@ -67,6 +68,7 @@ export interface APIApplicationCommand {
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum ApplicationCommandType {
ChatInput = 1,
@@ -76,6 +78,7 @@ export enum ApplicationCommandType {
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandInteractionData =
| APIChatInputApplicationCommandInteractionData
@@ -83,6 +86,7 @@ export type APIApplicationCommandInteractionData =
/**
* https://discord.com/developers/docs/resources/channel#channel-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
permissions: Permissions;
@@ -90,6 +94,7 @@ export interface APIInteractionDataResolvedChannel extends Required<APIPartialCh
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
permissions: Permissions;
@@ -97,6 +102,7 @@ export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMemb
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
@@ -104,11 +110,13 @@ export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationC
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandInteraction = APIChatInputApplicationCommandInteraction | APIContextMenuInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandDMInteraction =
| APIChatInputApplicationCommandDMInteraction
@@ -116,6 +124,7 @@ export type APIApplicationCommandDMInteraction =
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandGuildInteraction =
| APIChatInputApplicationCommandGuildInteraction

View File

@@ -1,6 +1,38 @@
import type { APIBaseInteraction, APIChatInputApplicationCommandInteractionData, InteractionType } from '../mod.ts';
import type {
APIBaseInteraction,
APIChatInputApplicationCommandInteractionData,
APIDMInteractionWrapper,
APIGuildInteractionWrapper,
InteractionType,
} from '../mod.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandAutocompleteInteraction = APIBaseInteraction<
InteractionType.ApplicationCommandAutocomplete,
APIChatInputApplicationCommandInteractionData
>;
> &
Required<
Pick<
APIBaseInteraction<
InteractionType.ApplicationCommandAutocomplete,
Required<Pick<APIChatInputApplicationCommandInteractionData, 'options'>>
>,
'data'
>
>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandAutocompleteDMInteraction =
APIDMInteractionWrapper<APIApplicationCommandAutocompleteInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandAutocompleteGuildInteraction =
APIGuildInteractionWrapper<APIApplicationCommandAutocompleteInteraction>;

View File

@@ -1,11 +1,29 @@
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocaleString } from '../../../v8.ts';
import type { APIMessage } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIUser } from '../user.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type PartialAPIMessageInteractionGuildMember = Pick<
APIGuildMember,
| 'roles'
| 'premium_since'
| 'pending'
| 'nick'
| 'mute'
| 'joined_at'
| 'deaf'
| 'communication_disabled_until'
| 'avatar'
>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#message-interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIMessageInteraction {
/**
@@ -24,10 +42,15 @@ export interface APIMessageInteraction {
* The user who invoked the interaction
*/
user: APIUser;
/**
* The guild member who invoked the interaction, only sent in MESSAGE_CREATE events
*/
member?: PartialAPIMessageInteractionGuildMember;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIInteractionGuildMember extends APIGuildMember {
permissions: Permissions;
@@ -38,6 +61,7 @@ export interface APIInteractionGuildMember extends APIGuildMember {
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIBaseInteraction<Type extends InteractionType, Data> {
/**
@@ -86,14 +110,28 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
* For components, the message they were attached to
*/
message?: APIMessage;
/**
* The selected language of the invoking user
*/
locale: LocaleString;
/**
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: LocaleString;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
Original,
'member' | 'guild_id'
> &
Required<Pick<Original, 'user'>>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
Original,
'user'

View File

@@ -1,7 +1,10 @@
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
import type { ComponentType } from '../channel.ts';
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIMessageComponentInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
APIMessageComponentInteractionData
@@ -13,8 +16,14 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
>
>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIMessageComponentInteractionData = APIMessageButtonInteractionData | APIMessageSelectMenuInteractionData;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIMessageComponentBaseInteractionData<CType extends ComponentType> {
/**
* The `custom_id` of the component
@@ -26,13 +35,25 @@ export interface APIMessageComponentBaseInteractionData<CType extends ComponentT
component_type: CType;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIMessageButtonInteractionData = APIMessageComponentBaseInteractionData<ComponentType.Button>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIMessageSelectMenuInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.SelectMenu> {
values: string[];
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIMessageComponentDMInteraction = APIDMInteractionWrapper<APIMessageComponentInteraction>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIMessageComponentGuildInteraction = APIGuildInteractionWrapper<APIMessageComponentInteraction>;

View File

@@ -0,0 +1,58 @@
import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts';
import type {
APIBaseInteraction,
APIDMInteractionWrapper,
APIGuildInteractionWrapper,
ComponentType,
InteractionType,
} from '../mod.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface ModalSubmitComponent {
type: ComponentType;
custom_id: string;
value: string;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface ModalSubmitActionRowComponent
extends Omit<APIActionRowComponent<APIModalActionRowComponent>, 'components'> {
components: ModalSubmitComponent[];
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIModalSubmission {
/**
* A developer-defined identifier for the component, max 100 characters
*/
custom_id: string;
/**
* A list of child components
*/
components?: ModalSubmitActionRowComponent[];
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIModalSubmitInteraction = APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission> &
Required<Pick<APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission>, 'data'>>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIModalSubmitDMInteraction = APIDMInteractionWrapper<APIModalSubmitInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIModalSubmitGuildInteraction = APIGuildInteractionWrapper<APIModalSubmitInteraction>;

View File

@@ -1,4 +1,7 @@
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
export type APIPingInteraction = APIBaseInteraction<InteractionType.Ping, never>;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIPingInteraction = Omit<APIBaseInteraction<InteractionType.Ping, never>, 'locale'>;

View File

@@ -1,19 +1,23 @@
import type { MessageFlags } from '../mod.ts';
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v8.ts';
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v8.ts';
import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts';
import type { MessageFlags } from '../mod.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum InteractionType {
Ping = 1,
ApplicationCommand,
MessageComponent,
ApplicationCommandAutocomplete,
ModalSubmit,
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIInteractionResponse =
| APIInteractionResponsePong
@@ -21,31 +25,58 @@ export type APIInteractionResponse =
| APIInteractionResponseDeferredChannelMessageWithSource
| APIInteractionResponseDeferredMessageUpdate
| APIInteractionResponseUpdateMessage
| APIApplicationCommandAutocompleteResponse;
| APIApplicationCommandAutocompleteResponse
| APIModalInteractionResponse;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIInteractionResponsePong {
type: InteractionResponseType.Pong;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommandAutocompleteResponse {
type: InteractionResponseType.ApplicationCommandAutocompleteResult;
data: APICommandAutocompleteInteractionResponseCallbackData;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIModalInteractionResponse {
type: InteractionResponseType.Modal;
data: APIModalInteractionResponseCallbackData;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIInteractionResponseChannelMessageWithSource {
type: InteractionResponseType.ChannelMessageWithSource;
data: APIInteractionResponseCallbackData;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIInteractionResponseDeferredChannelMessageWithSource {
type: InteractionResponseType.DeferredChannelMessageWithSource;
data?: Pick<APIInteractionResponseCallbackData, 'flags'>;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIInteractionResponseDeferredMessageUpdate {
type: InteractionResponseType.DeferredMessageUpdate;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIInteractionResponseUpdateMessage {
type: InteractionResponseType.UpdateMessage;
data?: APIInteractionResponseCallbackData;
@@ -53,6 +84,7 @@ export interface APIInteractionResponseUpdateMessage {
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum InteractionResponseType {
/**
@@ -79,16 +111,43 @@ export enum InteractionResponseType {
* For autocomplete interactions
*/
ApplicationCommandAutocompleteResult,
/**
* Respond to an interaction with an modal for a user to fill-out
*/
Modal,
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-data-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIInteractionResponseCallbackData = Omit<
RESTPostAPIWebhookWithTokenJSONBody,
'username' | 'avatar_url'
> & { flags?: MessageFlags };
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APICommandAutocompleteInteractionResponseCallbackData {
choices?: APIApplicationCommandOptionChoice[];
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIModalInteractionResponseCallbackData {
/**
* A developer-defined identifier for the component, max 100 characters
*/
custom_id: string;
/**
* The title of the popup modal
*/
title: string;
/**
* Between 1 and 5 (inclusive) components that make up the modal
*/
components: APIActionRowComponent<APIModalActionRowComponent>[];
}

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