Compare commits

...

67 Commits

Author SHA1 Message Date
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
127 changed files with 3028 additions and 2220 deletions

View File

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

View File

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

View File

@@ -409,6 +409,10 @@ export interface GatewayReadyDispatchData {
* Used for resuming connections
*/
session_id: string;
/**
* Gateway url for resuming connections
*/
resume_gateway_url: string;
/**
* The shard information associated with this session, if sent when identifying
*
@@ -533,6 +537,10 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
* **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
*
@@ -817,11 +825,11 @@ export interface GatewayGuildMembersChunkDispatchData {
/**
* The chunk index in the expected chunks for this response (`0 <= chunk_index < chunk_count`)
*/
chunk_index?: number;
chunk_index: number;
/**
* The total number of expected chunks for this response
*/
chunk_count?: number;
chunk_count: number;
/**
* If passing an invalid id to `REQUEST_GUILD_MEMBERS`, it will be returned here
*/
@@ -1602,15 +1610,15 @@ export interface GatewayIdentifyProperties {
/**
* Your operating system
*/
$os: string;
os: string;
/**
* Your library name
*/
$browser: string;
browser: string;
/**
* Your library name
*/
$device: string;
device: string;
}
/**
@@ -1647,31 +1655,15 @@ export interface GatewayRequestGuildMembers {
d: GatewayRequestGuildMembersData;
}
/**
* https://discord.com/developers/docs/topics/gateway#request-guild-members
*/
export interface GatewayRequestGuildMembersData {
export interface GatewayRequestGuildMembersDataBase {
/**
* ID of the guild to get members for
*/
guild_id: Snowflake;
/**
* String that username starts with, or an empty string to return all members
*/
query?: string;
/**
* Maximum number of members to send matching the `query`;
* a limit of `0` can be used with an empty string `query` to return all members
*/
limit: number;
/**
* Used to specify if we want the presences of the matched members
*/
presences?: boolean;
/**
* Used to specify which users you wish to fetch
*/
user_ids?: Snowflake | Snowflake[];
/**
* Nonce to identify the Guild Members Chunk response
*
@@ -1682,6 +1674,32 @@ export interface GatewayRequestGuildMembersData {
nonce?: string;
}
export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayRequestGuildMembersDataBase {
/**
* Used to specify which users you wish to fetch
*/
user_ids: Snowflake | Snowflake[];
}
export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestGuildMembersDataBase {
/**
* String that username starts with, or an empty string to return all members
*/
query: string;
/**
* Maximum number of members to send matching the `query`;
* a limit of `0` can be used with an empty string `query` to return all members
*/
limit: number;
}
/**
* https://discord.com/developers/docs/topics/gateway#request-guild-members
*/
export type GatewayRequestGuildMembersData =
| GatewayRequestGuildMembersDataWithUserIds
| GatewayRequestGuildMembersDataWithQuery;
/**
* https://discord.com/developers/docs/topics/gateway#update-voice-state
*/

View File

@@ -408,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
*
@@ -532,6 +536,10 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
* **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
*
@@ -816,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
*/
@@ -1601,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;
}
/**
@@ -1646,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
*
@@ -1681,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

@@ -45,6 +45,13 @@ export const FormattingPatterns = {
* The `id` group property is present on the `exec` result of this expression
*/
Role: /<@&(?<id>\d{17,20})>/,
/**
* Regular expression for matching a application command mention
*
* The `fullName` (possibly including `name`, `subcommandOrGroup` and `subcommand`) and `id` group properties are present on the `exec` result of this expression
*/
SlashCommand:
/<\/(?<fullName>(?<name>[\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
*

View File

@@ -58,3 +58,23 @@ export const PermissionFlagsBits = {
Object.freeze(PermissionFlagsBits);
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json
*/
export interface RESTError {
code: number;
message: string;
errors?: RESTErrorData;
}
export interface RESTErrorFieldInformation {
code: string;
message: string;
}
export interface RESTErrorGroupWrapper {
_errors: RESTErrorData[];
}
export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation | { [k: string]: RESTErrorData } | string;

View File

@@ -12,7 +12,7 @@ interface APIApplicationCommandIntegerOptionBase
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}

View File

@@ -12,7 +12,7 @@ interface APIApplicationCommandNumberOptionBase
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}

View File

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

View File

@@ -54,6 +54,7 @@ import type {
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/base.ts';
export * from './_chatInput/boolean.ts';
export * from './_chatInput/channel.ts';
export * from './_chatInput/integer.ts';
@@ -108,7 +109,7 @@ export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataAttachmentOption;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIChatInputApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {

View File

@@ -10,7 +10,7 @@ import type {
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIUserApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.User> {
@@ -27,7 +27,7 @@ export interface APIUserApplicationCommandInteractionDataResolved {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIMessageApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.Message> {
@@ -43,7 +43,7 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIContextMenuInteractionData =
| APIUserApplicationCommandInteractionData

View File

@@ -101,7 +101,7 @@ export enum ApplicationCommandType {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIApplicationCommandInteractionData =
| APIChatInputApplicationCommandInteractionData

View File

@@ -31,7 +31,7 @@ export interface APIMessageInteraction {
*/
type: InteractionType;
/**
* The name of the ApplicationCommand
* The name of the application command, including subcommands and subcommand groups
*/
name: string;
/**
@@ -104,6 +104,10 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
* For components, the message they were attached to
*/
message?: APIMessage;
/**
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
*/
app_permissions?: Permissions;
/**
* The selected language of the invoking user
*/

View File

@@ -18,6 +18,9 @@ export interface ModalSubmitActionRowComponent
components: ModalSubmitComponent[];
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure
*/
export interface APIModalSubmission {
/**
* A developer-defined identifier for the component, max 100 characters
@@ -26,7 +29,7 @@ export interface APIModalSubmission {
/**
* A list of child components
*/
components?: ModalSubmitActionRowComponent[];
components: ModalSubmitActionRowComponent[];
}
/**

View File

@@ -62,7 +62,7 @@ export interface APIApplication {
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
* See https://discord.com/developers/docs/game-sdk/applications#get-ticket
* See https://discord.com/developers/docs/game-sdk/applications#getticket
*/
verify_key: string;
/**
@@ -129,4 +129,5 @@ export enum ApplicationFlags {
GatewayMessageContent = 1 << 18,
GatewayMessageContentLimited = 1 << 19,
EmbeddedFirstParty = 1 << 20,
ApplicationCommandBadge = 1 << 23,
}

View File

@@ -39,27 +39,34 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
flags?: ChannelFlags;
}
// TODO: update when text in voice is released
export type TextChannelType =
| ChannelType.DM
| ChannelType.GroupDM
| ChannelType.GuildNews
| ChannelType.GuildPublicThread
| ChannelType.GuildPrivateThread
| ChannelType.GuildNewsThread
| ChannelType.GuildAnnouncement
| ChannelType.PublicThread
| ChannelType.PrivateThread
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum;
| ChannelType.GuildForum
| ChannelType.GuildVoice;
export type GuildChannelType = Exclude<
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
ChannelType.DM | ChannelType.GroupDM
>;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
}
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
@@ -111,23 +118,11 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
last_pin_timestamp?: string | null;
}
export interface APITextChannel extends APIGuildTextChannel<ChannelType.GuildText> {
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
}
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageVoice | ChannelType.GuildVoice> {
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
/**
* The bitrate (in bits) of the voice channel
*/
@@ -142,6 +137,11 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
rtc_region?: string | null;
}
export interface APIGuildVoiceChannel
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
APITextBasedChannel<ChannelType.GuildVoice> {
/**
* The camera video quality mode of the voice channel, `1` when not present
*
@@ -150,7 +150,9 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
video_quality_mode?: VideoQualityMode;
}
interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T> {
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
/**
* The recipients of the DM
*
@@ -185,9 +187,7 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
}
export interface APIThreadChannel
extends APIGuildChannel<
ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread | ChannelType.GuildNewsThread
> {
extends APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -197,7 +197,9 @@ export interface APIThreadChannel
*/
thread_metadata?: APIThreadMetadata;
/**
* The approximate message count of the thread, does not count above 50 even if there are more messages
* Number of messages (not including the initial message or deleted messages) in a thread
*
* If the thread was created before July 1, 2022, it stops counting at 50 messages
*/
message_count?: number;
/**
@@ -222,6 +224,12 @@ export interface APIThreadChannel
* The id of the last message sent in this thread (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* Number of messages ever sent in a thread
*
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
*/
total_message_sent?: number;
}
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
@@ -234,7 +242,8 @@ export type APIChannel =
| APIDMChannel
| APITextChannel
| APINewsChannel
| APIVoiceChannel
| APIGuildVoiceChannel
| APIGuildStageVoiceChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APINewsChannel
@@ -271,19 +280,19 @@ export enum ChannelType {
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews,
GuildAnnouncement,
/**
* A thread channel (public) within a Guild News channel
* A temporary sub-channel within a Guild Announcement channel
*/
GuildNewsThread = 10,
AnnouncementThread = 10,
/**
* A public thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel
*/
GuildPublicThread,
PublicThread,
/**
* A private thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*/
GuildPrivateThread,
PrivateThread,
/**
* A voice channel for hosting events with an audience
*
@@ -300,6 +309,35 @@ export enum ChannelType {
* A channel that can only contain threads
*/
GuildForum,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
/**
* A channel that users can follow and crosspost into their own guild
*
* @deprecated This is the old name for {@apilink ChannelType#GuildAnnouncement}
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews = 5,
/**
* A temporary sub-channel within a Guild Announcement channel
*
* @deprecated This is the old name for {@apilink ChannelType#AnnouncementThread}
*/
GuildNewsThread = 10,
/**
* A temporary sub-channel within a Guild Text channel
*
* @deprecated This is the old name for {@apilink ChannelType#PublicThread}
*/
GuildPublicThread = 11,
/**
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*
* @deprecated This is the old name for {@apilink ChannelType#PrivateThread}
*/
GuildPrivateThread = 12,
}
export enum VideoQualityMode {
@@ -336,6 +374,13 @@ export interface APIMessage {
author: APIUser;
/**
* Contents of the message
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
content: string;
/**
@@ -386,12 +431,26 @@ export interface APIMessage {
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
attachments: APIAttachment[];
/**
* Any embedded content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
embeds: APIEmbed[];
/**
@@ -430,7 +489,7 @@ export interface APIMessage {
/**
* Sent with Rich Presence-related chat embeds
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
* See https://discord.com/developers/docs/resources/application#application-object
*/
application?: Partial<APIApplication>;
/**
@@ -475,6 +534,13 @@ export interface APIMessage {
thread?: APIChannel;
/**
* Sent if the message contains components like buttons, action rows, or other interactive components
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
/**
@@ -490,6 +556,12 @@ export interface APIMessage {
* @deprecated Use `sticker_items` instead
*/
stickers?: APISticker[];
/**
* A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread
*
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
*/
position?: number;
}
/**
@@ -503,11 +575,11 @@ export enum MessageType {
ChannelNameChange,
ChannelIconChange,
ChannelPinnedMessage,
GuildMemberJoin,
UserPremiumGuildSubscription,
UserPremiumGuildSubscriptionTier1,
UserPremiumGuildSubscriptionTier2,
UserPremiumGuildSubscriptionTier3,
UserJoin,
GuildBoost,
GuildBoostTier1,
GuildBoostTier2,
GuildBoostTier3,
ChannelFollowAdd,
GuildDiscoveryDisqualified = 14,
GuildDiscoveryRequalified,
@@ -903,6 +975,10 @@ export interface APIEmbedVideo {
* Source url of video
*/
url?: string;
/**
* A proxied url of the video
*/
proxy_url?: string;
/**
* Height of video
*/
@@ -1142,7 +1218,7 @@ export interface APIBaseComponent<T extends ComponentType> {
}
/**
* https://discord.com/developers/docs/interactions/message-components#component-types
* https://discord.com/developers/docs/interactions/message-components#component-object-component-types
*/
export enum ComponentType {
/**

View File

@@ -4,6 +4,7 @@
import type { APIEmoji } from './emoji.ts';
import type { PresenceUpdateStatus } from './gateway.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker } from './sticker.ts';
import type { APIUser } from './user.ts';
@@ -69,10 +70,6 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
* The vanity url code for the guild
*/
vanity_url_code?: string | null;
/**
* `true` if this guild is unavailable due to an outage
*/
unavailable?: boolean;
}
/**
@@ -389,10 +386,6 @@ export enum GuildFeature {
* Guild has access to set a guild banner image
*/
Banner = 'BANNER',
/**
* Guild has access to use commerce features (i.e. create store channels)
*/
Commerce = 'COMMERCE',
/**
* Guild can enable welcome screen, Membership Screening and discovery, and receives community updates
*/
@@ -413,8 +406,14 @@ export enum GuildFeature {
* 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
*/
@@ -423,6 +422,8 @@ export enum GuildFeature {
* 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',
/**
@@ -702,6 +703,10 @@ export interface APIGuildIntegration {
* **This field is not provided for `discord` bot integrations.**
*/
application?: APIGuildIntegrationApplication;
/**
* The scopes the application has been authorized for
*/
scopes?: OAuth2Scopes[];
}
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord';
@@ -773,7 +778,7 @@ export interface APIBan {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object
*/
export interface APIGuildWidget {
id: Snowflake;
@@ -785,7 +790,7 @@ export interface APIGuildWidget {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetChannel {
id: Snowflake;
@@ -794,7 +799,7 @@ export interface APIGuildWidgetChannel {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetMember {
id: string;

View File

@@ -53,7 +53,7 @@ export interface APIInvite {
/**
* The type of target for this voice channel invite
*
* See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
*/
target_type?: InviteTargetType;
/**
@@ -65,7 +65,7 @@ export interface APIInvite {
/**
* The embedded application to open for this voice channel embedded application invite
*
* See https://discord.com/developers/docs/topics/oauth2#application
* See https://discord.com/developers/docs/resources/application#application-object
*/
target_application?: Partial<APIApplication>;
/**

View File

@@ -32,7 +32,7 @@ export interface APITeam {
}
/**
* https://discord.com/developers/docs/topics/teams#data-models-team-members-object
* https://discord.com/developers/docs/topics/teams#data-models-team-member-object
*/
export interface APITeamMember {
/**

View File

@@ -1,5 +1,5 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/template
* Types extracted from https://discord.com/developers/docs/resources/guild-template
*/
import type { APIUser } from './user.ts';
@@ -7,7 +7,7 @@ import type { Snowflake } from '../../globals.ts';
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v10/mod.ts';
/**
* https://discord.com/developers/docs/resources/template#template-object
* https://discord.com/developers/docs/resources/guild-template#guild-template-object
*/
export interface APITemplate {
/**

View File

@@ -143,8 +143,16 @@ export enum UserFlags {
BotHTTPInteractions = 1 << 19,
/**
* User has been identified as spammer
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Spammer = 1 << 20,
/**
* User's account has been quarantined based on recent activity
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Quarantined = Math.pow(2, 44),
}
/**
@@ -170,8 +178,10 @@ export interface APIConnection {
name: string;
/**
* The service of the connection
*
* See https://discord.com/developers/docs/resources/user#connection-object-services
*/
type: string;
type: ConnectionService;
/**
* Whether the connection is revoked
*/
@@ -202,6 +212,24 @@ export interface APIConnection {
visibility: ConnectionVisibility;
}
export enum ConnectionService {
BattleNet = 'battlenet',
EpicGames = 'epicgames',
Facebook = 'facebook',
GitHub = 'github',
LeagueOfLegends = 'leagueoflegends',
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
SamsungGalaxy = 'samsunggalaxy',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',
Twitch = 'twitch',
Twitter = 'twitter',
Xbox = 'xbox',
YouTube = 'youtube',
}
export enum ConnectionVisibility {
/**
* Invisible to everyone except the user themselves

View File

@@ -15,7 +15,7 @@ interface APIApplicationCommandIntegerOptionBase
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}

View File

@@ -15,7 +15,7 @@ interface APIApplicationCommandNumberOptionBase
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}

View File

@@ -145,8 +145,16 @@ export enum UserFlags {
BotHTTPInteractions = 1 << 19,
/**
* User has been identified as spammer
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Spammer = 1 << 20,
/**
* User's account has been quarantined based on recent activity
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Quarantined = Math.pow(2, 44),
}
/**

View File

@@ -12,7 +12,7 @@ interface APIApplicationCommandIntegerOptionBase
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}

View File

@@ -12,7 +12,7 @@ interface APIApplicationCommandNumberOptionBase
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}

View File

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

View File

@@ -54,6 +54,7 @@ import type {
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/base.ts';
export * from './_chatInput/boolean.ts';
export * from './_chatInput/channel.ts';
export * from './_chatInput/integer.ts';
@@ -108,7 +109,7 @@ export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataAttachmentOption;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIChatInputApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {

View File

@@ -10,7 +10,7 @@ import type {
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIUserApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.User> {
@@ -27,7 +27,7 @@ export interface APIUserApplicationCommandInteractionDataResolved {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIMessageApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.Message> {
@@ -43,7 +43,7 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIContextMenuInteractionData =
| APIUserApplicationCommandInteractionData

View File

@@ -101,7 +101,7 @@ export enum ApplicationCommandType {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIApplicationCommandInteractionData =
| APIChatInputApplicationCommandInteractionData

View File

@@ -31,7 +31,7 @@ export interface APIMessageInteraction {
*/
type: InteractionType;
/**
* The name of the ApplicationCommand
* The name of the application command, including subcommands and subcommand groups
*/
name: string;
/**
@@ -104,6 +104,10 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
* For components, the message they were attached to
*/
message?: APIMessage;
/**
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
*/
app_permissions?: Permissions;
/**
* The selected language of the invoking user
*/

View File

@@ -18,6 +18,9 @@ export interface ModalSubmitActionRowComponent
components: ModalSubmitComponent[];
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure
*/
export interface APIModalSubmission {
/**
* A developer-defined identifier for the component, max 100 characters
@@ -26,7 +29,7 @@ export interface APIModalSubmission {
/**
* A list of child components
*/
components?: ModalSubmitActionRowComponent[];
components: ModalSubmitActionRowComponent[];
}
/**

View File

@@ -62,7 +62,7 @@ export interface APIApplication {
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
* See https://discord.com/developers/docs/game-sdk/applications#get-ticket
* See https://discord.com/developers/docs/game-sdk/applications#getticket
*/
verify_key: string;
/**
@@ -129,4 +129,5 @@ export enum ApplicationFlags {
GatewayMessageContent = 1 << 18,
GatewayMessageContentLimited = 1 << 19,
EmbeddedFirstParty = 1 << 20,
ApplicationCommandBadge = 1 << 23,
}

View File

@@ -39,27 +39,34 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
flags?: ChannelFlags;
}
// TODO: update when text in voice is released
export type TextChannelType =
| ChannelType.DM
| ChannelType.GroupDM
| ChannelType.GuildNews
| ChannelType.GuildPublicThread
| ChannelType.GuildPrivateThread
| ChannelType.GuildNewsThread
| ChannelType.GuildAnnouncement
| ChannelType.PublicThread
| ChannelType.PrivateThread
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum;
| ChannelType.GuildForum
| ChannelType.GuildVoice;
export type GuildChannelType = Exclude<
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
ChannelType.DM | ChannelType.GroupDM
>;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
}
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
@@ -111,23 +118,11 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
last_pin_timestamp?: string | null;
}
export interface APITextChannel extends APIGuildTextChannel<ChannelType.GuildText> {
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
}
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageVoice | ChannelType.GuildVoice> {
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
/**
* The bitrate (in bits) of the voice channel
*/
@@ -142,6 +137,11 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
rtc_region?: string | null;
}
export interface APIGuildVoiceChannel
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
APITextBasedChannel<ChannelType.GuildVoice> {
/**
* The camera video quality mode of the voice channel, `1` when not present
*
@@ -150,7 +150,9 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
video_quality_mode?: VideoQualityMode;
}
interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T> {
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
/**
* The recipients of the DM
*
@@ -185,9 +187,7 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
}
export interface APIThreadChannel
extends APIGuildChannel<
ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread | ChannelType.GuildNewsThread
> {
extends APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -197,7 +197,9 @@ export interface APIThreadChannel
*/
thread_metadata?: APIThreadMetadata;
/**
* The approximate message count of the thread, does not count above 50 even if there are more messages
* Number of messages (not including the initial message or deleted messages) in a thread
*
* If the thread was created before July 1, 2022, it stops counting at 50 messages
*/
message_count?: number;
/**
@@ -222,6 +224,12 @@ export interface APIThreadChannel
* The id of the last message sent in this thread (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* Number of messages ever sent in a thread
*
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
*/
total_message_sent?: number;
}
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
@@ -234,7 +242,8 @@ export type APIChannel =
| APIDMChannel
| APITextChannel
| APINewsChannel
| APIVoiceChannel
| APIGuildVoiceChannel
| APIGuildStageVoiceChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APINewsChannel
@@ -271,19 +280,19 @@ export enum ChannelType {
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews,
GuildAnnouncement,
/**
* A thread channel (public) within a Guild News channel
* A temporary sub-channel within a Guild Announcement channel
*/
GuildNewsThread = 10,
AnnouncementThread = 10,
/**
* A public thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel
*/
GuildPublicThread,
PublicThread,
/**
* A private thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*/
GuildPrivateThread,
PrivateThread,
/**
* A voice channel for hosting events with an audience
*
@@ -300,6 +309,34 @@ export enum ChannelType {
* A channel that can only contain threads
*/
GuildForum,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS
/**
* A channel that users can follow and crosspost into their own guild
*
* @deprecated This is the old name for {@apilink ChannelType#GuildAnnouncement}
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews = 5,
/**
* A temporary sub-channel within a Guild Announcement channel
*
* @deprecated This is the old name for {@apilink ChannelType#AnnouncementThread}
*/
GuildNewsThread = 10,
/**
* A temporary sub-channel within a Guild Text channel
*
* @deprecated This is the old name for {@apilink ChannelType#PublicThread}
*/
GuildPublicThread = 11,
/**
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*
* @deprecated This is the old name for {@apilink ChannelType#PrivateThread}
*/
GuildPrivateThread = 12,
}
export enum VideoQualityMode {
@@ -336,6 +373,12 @@ export interface APIMessage {
author: APIUser;
/**
* Contents of the message
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
content: string;
/**
@@ -386,12 +429,24 @@ export interface APIMessage {
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
attachments: APIAttachment[];
/**
* Any embedded content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
embeds: APIEmbed[];
/**
@@ -430,7 +485,7 @@ export interface APIMessage {
/**
* Sent with Rich Presence-related chat embeds
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
* See https://discord.com/developers/docs/resources/application#application-object
*/
application?: Partial<APIApplication>;
/**
@@ -475,6 +530,12 @@ export interface APIMessage {
thread?: APIChannel;
/**
* Sent if the message contains components like buttons, action rows, or other interactive components
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
/**
@@ -490,6 +551,12 @@ export interface APIMessage {
* @deprecated Use `sticker_items` instead
*/
stickers?: APISticker[];
/**
* A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread
*
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
*/
position?: number;
}
/**
@@ -503,11 +570,11 @@ export enum MessageType {
ChannelNameChange,
ChannelIconChange,
ChannelPinnedMessage,
GuildMemberJoin,
UserPremiumGuildSubscription,
UserPremiumGuildSubscriptionTier1,
UserPremiumGuildSubscriptionTier2,
UserPremiumGuildSubscriptionTier3,
UserJoin,
GuildBoost,
GuildBoostTier1,
GuildBoostTier2,
GuildBoostTier3,
ChannelFollowAdd,
GuildDiscoveryDisqualified = 14,
GuildDiscoveryRequalified,
@@ -907,6 +974,10 @@ export interface APIEmbedVideo {
* Source url of video
*/
url?: string;
/**
* A proxied url of the video
*/
proxy_url?: string;
/**
* Height of video
*/
@@ -1146,7 +1217,7 @@ export interface APIBaseComponent<T extends ComponentType> {
}
/**
* https://discord.com/developers/docs/interactions/message-components#component-types
* https://discord.com/developers/docs/interactions/message-components#component-object-component-types
*/
export enum ComponentType {
/**

View File

@@ -4,6 +4,7 @@
import type { APIEmoji } from './emoji.ts';
import type { PresenceUpdateStatus } from './gateway.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker } from './sticker.ts';
import type { APIUser } from './user.ts';
@@ -69,10 +70,6 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
* The vanity url code for the guild
*/
vanity_url_code?: string | null;
/**
* `true` if this guild is unavailable due to an outage
*/
unavailable?: boolean;
}
/**
@@ -389,10 +386,6 @@ export enum GuildFeature {
* Guild has access to set a guild banner image
*/
Banner = 'BANNER',
/**
* Guild has access to use commerce features (i.e. create store channels)
*/
Commerce = 'COMMERCE',
/**
* Guild can enable welcome screen, Membership Screening and discovery, and receives community updates
*/
@@ -413,8 +406,14 @@ export enum GuildFeature {
* 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
*/
@@ -423,6 +422,8 @@ export enum GuildFeature {
* 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',
/**
@@ -702,6 +703,10 @@ export interface APIGuildIntegration {
* **This field is not provided for `discord` bot integrations.**
*/
application?: APIGuildIntegrationApplication;
/**
* The scopes the application has been authorized for
*/
scopes?: OAuth2Scopes[];
}
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord';
@@ -773,7 +778,7 @@ export interface APIBan {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object
*/
export interface APIGuildWidget {
id: Snowflake;
@@ -785,7 +790,7 @@ export interface APIGuildWidget {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetChannel {
id: Snowflake;
@@ -794,7 +799,7 @@ export interface APIGuildWidgetChannel {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetMember {
id: string;

View File

@@ -53,7 +53,7 @@ export interface APIInvite {
/**
* The type of target for this voice channel invite
*
* See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
*/
target_type?: InviteTargetType;
/**
@@ -65,7 +65,7 @@ export interface APIInvite {
/**
* The embedded application to open for this voice channel embedded application invite
*
* See https://discord.com/developers/docs/topics/oauth2#application
* See https://discord.com/developers/docs/resources/application#application-object
*/
target_application?: Partial<APIApplication>;
/**

View File

@@ -32,7 +32,7 @@ export interface APITeam {
}
/**
* https://discord.com/developers/docs/topics/teams#data-models-team-members-object
* https://discord.com/developers/docs/topics/teams#data-models-team-member-object
*/
export interface APITeamMember {
/**

View File

@@ -1,5 +1,5 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/template
* Types extracted from https://discord.com/developers/docs/resources/guild-template
*/
import type { APIUser } from './user.ts';
@@ -7,7 +7,7 @@ import type { Snowflake } from '../../globals.ts';
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v9/mod.ts';
/**
* https://discord.com/developers/docs/resources/template#template-object
* https://discord.com/developers/docs/resources/guild-template#template-object
*/
export interface APITemplate {
/**

View File

@@ -143,8 +143,16 @@ export enum UserFlags {
BotHTTPInteractions = 1 << 19,
/**
* User has been identified as spammer
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Spammer = 1 << 20,
/**
* User's account has been quarantined based on recent activity
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Quarantined = Math.pow(2, 44),
}
/**
@@ -170,8 +178,10 @@ export interface APIConnection {
name: string;
/**
* The service of the connection
*
* See https://discord.com/developers/docs/resources/user#connection-object-services
*/
type: string;
type: ConnectionService;
/**
* Whether the connection is revoked
*/
@@ -202,6 +212,24 @@ export interface APIConnection {
visibility: ConnectionVisibility;
}
export enum ConnectionService {
BattleNet = 'battlenet',
EpicGames = 'epicgames',
Facebook = 'facebook',
GitHub = 'github',
LeagueOfLegends = 'leagueoflegends',
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
SamsungGalaxy = 'samsunggalaxy',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',
Twitch = 'twitch',
Twitter = 'twitter',
Xbox = 'xbox',
YouTube = 'youtube',
}
export enum ConnectionVisibility {
/**
* Invisible to everyone except the user themselves

View File

@@ -70,6 +70,8 @@ export enum RESTJSONErrorCodes {
AnnouncementEditLimitExceeded = 20022,
UnderMinimumAge = 20024,
ChannelSendRateLimit = 20028,
ServerSendRateLimit,
@@ -99,10 +101,10 @@ export enum RESTJSONErrorCodes {
MaximumNumberOfServerCategoriesReached = 30030,
GuildAlreadyHasTemplate = 30031,
MaximumThreadParticipants = 30033,
MaximumNumberOfNonGuildMemberBansHasBeenExceeded = 30035,
MaximumNumberOfApplicationCommandsReached,
MaximumThreadParticipantsReached,
MaximumDailyApplicationCommandCreatesReached,
MaximumNumberOfNonGuildMemberBansHasBeenExceeded,
MaximumNumberOfBanFetchesHasBeenReached = 30037,
MaximumNumberOfUncompletedGuildScheduledEventsReached,
@@ -126,11 +128,15 @@ export enum RESTJSONErrorCodes {
FeatureTemporarilyDisabledServerSide,
UserBannedFromThisGuild,
ConnectionHasBeenRevoked = 40012,
TargetUserIsNotConnectedToVoice = 40032,
ThisMessageWasAlreadyCrossposted,
ApplicationCommandWithThatNameAlreadyExists = 40041,
ApplicationInteractionFailedToSend = 40043,
InteractionHasAlreadyBeenAcknowledged = 40060,
TagNamesMustBeUnique,
@@ -198,6 +204,12 @@ export enum RESTJSONErrorCodes {
RequestBodyContainsInvalidJSON = 50109,
OwnershipCannotBeMovedToABotUser = 50132,
FailedToResizeAssetBelowTheMinimumSize = 50138,
UploadedFileNotFound = 50146,
YouDoNotHavePermissionToSendThisSticker = 50600,
TwoFactorAuthenticationIsRequired = 60003,
@@ -206,6 +218,8 @@ export enum RESTJSONErrorCodes {
ReactionWasBlocked = 90001,
ApplicationNotYetAvailable = 110001,
APIResourceOverloaded = 130000,
TheStageIsAlreadyOpen = 150006,
@@ -229,7 +243,12 @@ export enum RESTJSONErrorCodes {
FailedToCreateStageNeededForStageEvent = 180002,
MessageWasBlockedByAutomaticModeration = 200000,
TitleWasBlockedByAutomaticModeration,
WebhooksCanOnlyCreateThreadsInForumChannels = 220003,
MessageBlockedByHarmfulLinksFilter = 240000,
}
/**

View File

@@ -48,7 +48,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*
* Channel types: text, news
*/
type?: ChannelType.GuildNews | ChannelType.GuildText;
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText;
/**
* The position of the channel in the left-hand listing
*
@@ -619,9 +619,9 @@ export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThread
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*
* @default ChannelType.GuildPrivateThread
* @default ChannelType.PrivateThread
*/
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/
@@ -665,4 +665,9 @@ export interface RESTGetAPIChannelThreadsArchivedQuery {
/**
* https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads
*/
export type RESTGetAPIChannelUsersThreadsArchivedResult = APIThreadList;
export interface RESTGetAPIChannelUsersThreadsArchivedResult extends APIThreadList {
/**
* Whether there are potentially additional threads
*/
has_more: boolean;
}

View File

@@ -357,7 +357,7 @@ export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
export type RESTPatchAPIGuildChannelPositionsResult = never;
/**
* https://discord.com/developers/docs/resources/guild#list-active-threads
* https://discord.com/developers/docs/resources/guild#list-active-guild-threads
*/
export type RESTGetAPIGuildThreadsResult = APIThreadList;
@@ -573,8 +573,14 @@ export type RESTGetAPIGuildBanResult = APIBan;
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Number of days to delete messages for (0-7)
*
* @deprecated use `delete_message_seconds` instead
*/
delete_message_days?: number;
/**
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
*/
delete_message_seconds?: number;
}>;
/**
@@ -855,7 +861,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
channel_id?: Snowflake;
/**
* Toggles the user's suppress state
*/

View File

@@ -129,8 +129,10 @@ export type RESTPatchAPIApplicationGuildCommandResult = Omit<APIApplicationComma
* https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
*/
export type RESTPutAPIApplicationGuildCommandsJSONBody = (
| Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'>
| Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'>
| (Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'> &
Pick<Partial<APIApplicationCommand>, 'id'>)
| (Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'> &
Pick<Partial<APIApplicationCommand>, 'id'>)
)[];
/**

View File

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

View File

@@ -48,7 +48,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*
* Channel types: text, news
*/
type?: ChannelType.GuildNews | ChannelType.GuildText;
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText;
/**
* The position of the channel in the left-hand listing
*
@@ -633,9 +633,9 @@ export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThread
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*
* @default ChannelType.GuildPrivateThread
* @default ChannelType.PrivateThread
*/
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/

View File

@@ -357,7 +357,7 @@ export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
export type RESTPatchAPIGuildChannelPositionsResult = never;
/**
* https://discord.com/developers/docs/resources/guild#list-active-threads
* https://discord.com/developers/docs/resources/guild#list-active-guild-threads
*/
export type RESTGetAPIGuildThreadsResult = Omit<APIThreadList, 'has_more'>;
@@ -573,8 +573,14 @@ export type RESTGetAPIGuildBanResult = APIBan;
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Number of days to delete messages for (0-7)
*
* @deprecated use `delete_message_seconds` instead
*/
delete_message_days?: number;
/**
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
*/
delete_message_seconds?: number;
/**
* Reason for the ban
*
@@ -861,7 +867,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
channel_id?: Snowflake;
/**
* Toggles the user's suppress state
*/

View File

@@ -129,8 +129,10 @@ export type RESTPatchAPIApplicationGuildCommandResult = Omit<APIApplicationComma
* https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
*/
export type RESTPutAPIApplicationGuildCommandsJSONBody = (
| Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'>
| Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'>
| (Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'> &
Pick<Partial<APIApplicationCommand>, 'id'>)
| (Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'> &
Pick<Partial<APIApplicationCommand>, 'id'>)
)[];
/**

View File

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

View File

@@ -409,6 +409,10 @@ export interface GatewayReadyDispatchData {
* Used for resuming connections
*/
session_id: string;
/**
* Gateway url for resuming connections
*/
resume_gateway_url: string;
/**
* The shard information associated with this session, if sent when identifying
*
@@ -533,6 +537,10 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
* **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
*
@@ -817,11 +825,11 @@ export interface GatewayGuildMembersChunkDispatchData {
/**
* The chunk index in the expected chunks for this response (`0 <= chunk_index < chunk_count`)
*/
chunk_index?: number;
chunk_index: number;
/**
* The total number of expected chunks for this response
*/
chunk_count?: number;
chunk_count: number;
/**
* If passing an invalid id to `REQUEST_GUILD_MEMBERS`, it will be returned here
*/
@@ -1602,15 +1610,15 @@ export interface GatewayIdentifyProperties {
/**
* Your operating system
*/
$os: string;
os: string;
/**
* Your library name
*/
$browser: string;
browser: string;
/**
* Your library name
*/
$device: string;
device: string;
}
/**
@@ -1647,31 +1655,15 @@ export interface GatewayRequestGuildMembers {
d: GatewayRequestGuildMembersData;
}
/**
* https://discord.com/developers/docs/topics/gateway#request-guild-members
*/
export interface GatewayRequestGuildMembersData {
export interface GatewayRequestGuildMembersDataBase {
/**
* ID of the guild to get members for
*/
guild_id: Snowflake;
/**
* String that username starts with, or an empty string to return all members
*/
query?: string;
/**
* Maximum number of members to send matching the `query`;
* a limit of `0` can be used with an empty string `query` to return all members
*/
limit: number;
/**
* Used to specify if we want the presences of the matched members
*/
presences?: boolean;
/**
* Used to specify which users you wish to fetch
*/
user_ids?: Snowflake | Snowflake[];
/**
* Nonce to identify the Guild Members Chunk response
*
@@ -1682,6 +1674,32 @@ export interface GatewayRequestGuildMembersData {
nonce?: string;
}
export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayRequestGuildMembersDataBase {
/**
* Used to specify which users you wish to fetch
*/
user_ids: Snowflake | Snowflake[];
}
export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestGuildMembersDataBase {
/**
* String that username starts with, or an empty string to return all members
*/
query: string;
/**
* Maximum number of members to send matching the `query`;
* a limit of `0` can be used with an empty string `query` to return all members
*/
limit: number;
}
/**
* https://discord.com/developers/docs/topics/gateway#request-guild-members
*/
export type GatewayRequestGuildMembersData =
| GatewayRequestGuildMembersDataWithUserIds
| GatewayRequestGuildMembersDataWithQuery;
/**
* https://discord.com/developers/docs/topics/gateway#update-voice-state
*/

View File

@@ -408,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
*
@@ -532,6 +536,10 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
* **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
*
@@ -816,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
*/
@@ -1601,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;
}
/**
@@ -1646,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
*
@@ -1681,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

@@ -45,6 +45,13 @@ export const FormattingPatterns = {
* The `id` group property is present on the `exec` result of this expression
*/
Role: /<@&(?<id>\d{17,20})>/,
/**
* Regular expression for matching a application command mention
*
* The `fullName` (possibly including `name`, `subcommandOrGroup` and `subcommand`) and `id` group properties are present on the `exec` result of this expression
*/
SlashCommand:
/<\/(?<fullName>(?<name>[\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
*

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "discord-api-types",
"version": "0.34.0",
"version": "0.37.8",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "discord-api-types",
"version": "0.34.0",
"version": "0.37.8",
"license": "MIT",
"devDependencies": {
"@babel/runtime-corejs3": "^7.18.0",

View File

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

View File

@@ -58,3 +58,23 @@ export const PermissionFlagsBits = {
Object.freeze(PermissionFlagsBits);
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json
*/
export interface RESTError {
code: number;
message: string;
errors?: RESTErrorData;
}
export interface RESTErrorFieldInformation {
code: string;
message: string;
}
export interface RESTErrorGroupWrapper {
_errors: RESTErrorData[];
}
export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation | { [k: string]: RESTErrorData } | string;

View File

@@ -12,7 +12,7 @@ interface APIApplicationCommandIntegerOptionBase
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}

View File

@@ -12,7 +12,7 @@ interface APIApplicationCommandNumberOptionBase
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}

View File

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

View File

@@ -54,6 +54,7 @@ import type {
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base';
export * from './_chatInput/attachment';
export * from './_chatInput/base';
export * from './_chatInput/boolean';
export * from './_chatInput/channel';
export * from './_chatInput/integer';
@@ -108,7 +109,7 @@ export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataAttachmentOption;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIChatInputApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {

View File

@@ -10,7 +10,7 @@ import type {
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIUserApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.User> {
@@ -27,7 +27,7 @@ export interface APIUserApplicationCommandInteractionDataResolved {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIMessageApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.Message> {
@@ -43,7 +43,7 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIContextMenuInteractionData =
| APIUserApplicationCommandInteractionData

View File

@@ -101,7 +101,7 @@ export enum ApplicationCommandType {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIApplicationCommandInteractionData =
| APIChatInputApplicationCommandInteractionData

View File

@@ -31,7 +31,7 @@ export interface APIMessageInteraction {
*/
type: InteractionType;
/**
* The name of the ApplicationCommand
* The name of the application command, including subcommands and subcommand groups
*/
name: string;
/**
@@ -104,6 +104,10 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
* For components, the message they were attached to
*/
message?: APIMessage;
/**
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
*/
app_permissions?: Permissions;
/**
* The selected language of the invoking user
*/

View File

@@ -18,6 +18,9 @@ export interface ModalSubmitActionRowComponent
components: ModalSubmitComponent[];
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure
*/
export interface APIModalSubmission {
/**
* A developer-defined identifier for the component, max 100 characters
@@ -26,7 +29,7 @@ export interface APIModalSubmission {
/**
* A list of child components
*/
components?: ModalSubmitActionRowComponent[];
components: ModalSubmitActionRowComponent[];
}
/**

View File

@@ -62,7 +62,7 @@ export interface APIApplication {
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
* See https://discord.com/developers/docs/game-sdk/applications#get-ticket
* See https://discord.com/developers/docs/game-sdk/applications#getticket
*/
verify_key: string;
/**
@@ -129,4 +129,5 @@ export enum ApplicationFlags {
GatewayMessageContent = 1 << 18,
GatewayMessageContentLimited = 1 << 19,
EmbeddedFirstParty = 1 << 20,
ApplicationCommandBadge = 1 << 23,
}

View File

@@ -39,27 +39,34 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
flags?: ChannelFlags;
}
// TODO: update when text in voice is released
export type TextChannelType =
| ChannelType.DM
| ChannelType.GroupDM
| ChannelType.GuildNews
| ChannelType.GuildPublicThread
| ChannelType.GuildPrivateThread
| ChannelType.GuildNewsThread
| ChannelType.GuildAnnouncement
| ChannelType.PublicThread
| ChannelType.PrivateThread
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum;
| ChannelType.GuildForum
| ChannelType.GuildVoice;
export type GuildChannelType = Exclude<
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
ChannelType.DM | ChannelType.GroupDM
>;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
}
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
@@ -111,23 +118,11 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
last_pin_timestamp?: string | null;
}
export interface APITextChannel extends APIGuildTextChannel<ChannelType.GuildText> {
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
}
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageVoice | ChannelType.GuildVoice> {
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
/**
* The bitrate (in bits) of the voice channel
*/
@@ -142,6 +137,11 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
rtc_region?: string | null;
}
export interface APIGuildVoiceChannel
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
APITextBasedChannel<ChannelType.GuildVoice> {
/**
* The camera video quality mode of the voice channel, `1` when not present
*
@@ -150,7 +150,9 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
video_quality_mode?: VideoQualityMode;
}
interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T> {
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
/**
* The recipients of the DM
*
@@ -185,9 +187,7 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
}
export interface APIThreadChannel
extends APIGuildChannel<
ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread | ChannelType.GuildNewsThread
> {
extends APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -197,7 +197,9 @@ export interface APIThreadChannel
*/
thread_metadata?: APIThreadMetadata;
/**
* The approximate message count of the thread, does not count above 50 even if there are more messages
* Number of messages (not including the initial message or deleted messages) in a thread
*
* If the thread was created before July 1, 2022, it stops counting at 50 messages
*/
message_count?: number;
/**
@@ -222,6 +224,12 @@ export interface APIThreadChannel
* The id of the last message sent in this thread (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* Number of messages ever sent in a thread
*
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
*/
total_message_sent?: number;
}
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
@@ -234,7 +242,8 @@ export type APIChannel =
| APIDMChannel
| APITextChannel
| APINewsChannel
| APIVoiceChannel
| APIGuildVoiceChannel
| APIGuildStageVoiceChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APINewsChannel
@@ -271,19 +280,19 @@ export enum ChannelType {
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews,
GuildAnnouncement,
/**
* A thread channel (public) within a Guild News channel
* A temporary sub-channel within a Guild Announcement channel
*/
GuildNewsThread = 10,
AnnouncementThread = 10,
/**
* A public thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel
*/
GuildPublicThread,
PublicThread,
/**
* A private thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*/
GuildPrivateThread,
PrivateThread,
/**
* A voice channel for hosting events with an audience
*
@@ -300,6 +309,35 @@ export enum ChannelType {
* A channel that can only contain threads
*/
GuildForum,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
/**
* A channel that users can follow and crosspost into their own guild
*
* @deprecated This is the old name for {@apilink ChannelType#GuildAnnouncement}
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews = 5,
/**
* A temporary sub-channel within a Guild Announcement channel
*
* @deprecated This is the old name for {@apilink ChannelType#AnnouncementThread}
*/
GuildNewsThread = 10,
/**
* A temporary sub-channel within a Guild Text channel
*
* @deprecated This is the old name for {@apilink ChannelType#PublicThread}
*/
GuildPublicThread = 11,
/**
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*
* @deprecated This is the old name for {@apilink ChannelType#PrivateThread}
*/
GuildPrivateThread = 12,
}
export enum VideoQualityMode {
@@ -336,6 +374,13 @@ export interface APIMessage {
author: APIUser;
/**
* Contents of the message
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
content: string;
/**
@@ -386,12 +431,26 @@ export interface APIMessage {
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
attachments: APIAttachment[];
/**
* Any embedded content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
embeds: APIEmbed[];
/**
@@ -430,7 +489,7 @@ export interface APIMessage {
/**
* Sent with Rich Presence-related chat embeds
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
* See https://discord.com/developers/docs/resources/application#application-object
*/
application?: Partial<APIApplication>;
/**
@@ -475,6 +534,13 @@ export interface APIMessage {
thread?: APIChannel;
/**
* Sent if the message contains components like buttons, action rows, or other interactive components
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
/**
@@ -490,6 +556,12 @@ export interface APIMessage {
* @deprecated Use `sticker_items` instead
*/
stickers?: APISticker[];
/**
* A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread
*
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
*/
position?: number;
}
/**
@@ -503,11 +575,11 @@ export enum MessageType {
ChannelNameChange,
ChannelIconChange,
ChannelPinnedMessage,
GuildMemberJoin,
UserPremiumGuildSubscription,
UserPremiumGuildSubscriptionTier1,
UserPremiumGuildSubscriptionTier2,
UserPremiumGuildSubscriptionTier3,
UserJoin,
GuildBoost,
GuildBoostTier1,
GuildBoostTier2,
GuildBoostTier3,
ChannelFollowAdd,
GuildDiscoveryDisqualified = 14,
GuildDiscoveryRequalified,
@@ -903,6 +975,10 @@ export interface APIEmbedVideo {
* Source url of video
*/
url?: string;
/**
* A proxied url of the video
*/
proxy_url?: string;
/**
* Height of video
*/
@@ -1142,7 +1218,7 @@ export interface APIBaseComponent<T extends ComponentType> {
}
/**
* https://discord.com/developers/docs/interactions/message-components#component-types
* https://discord.com/developers/docs/interactions/message-components#component-object-component-types
*/
export enum ComponentType {
/**

View File

@@ -4,6 +4,7 @@
import type { APIEmoji } from './emoji';
import type { PresenceUpdateStatus } from './gateway';
import type { OAuth2Scopes } from './oauth2';
import type { APIRole } from './permissions';
import type { APISticker } from './sticker';
import type { APIUser } from './user';
@@ -69,10 +70,6 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
* The vanity url code for the guild
*/
vanity_url_code?: string | null;
/**
* `true` if this guild is unavailable due to an outage
*/
unavailable?: boolean;
}
/**
@@ -389,10 +386,6 @@ export enum GuildFeature {
* Guild has access to set a guild banner image
*/
Banner = 'BANNER',
/**
* Guild has access to use commerce features (i.e. create store channels)
*/
Commerce = 'COMMERCE',
/**
* Guild can enable welcome screen, Membership Screening and discovery, and receives community updates
*/
@@ -413,8 +406,14 @@ export enum GuildFeature {
* 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
*/
@@ -423,6 +422,8 @@ export enum GuildFeature {
* 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',
/**
@@ -702,6 +703,10 @@ export interface APIGuildIntegration {
* **This field is not provided for `discord` bot integrations.**
*/
application?: APIGuildIntegrationApplication;
/**
* The scopes the application has been authorized for
*/
scopes?: OAuth2Scopes[];
}
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord';
@@ -773,7 +778,7 @@ export interface APIBan {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object
*/
export interface APIGuildWidget {
id: Snowflake;
@@ -785,7 +790,7 @@ export interface APIGuildWidget {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetChannel {
id: Snowflake;
@@ -794,7 +799,7 @@ export interface APIGuildWidgetChannel {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetMember {
id: string;

View File

@@ -53,7 +53,7 @@ export interface APIInvite {
/**
* The type of target for this voice channel invite
*
* See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
*/
target_type?: InviteTargetType;
/**
@@ -65,7 +65,7 @@ export interface APIInvite {
/**
* The embedded application to open for this voice channel embedded application invite
*
* See https://discord.com/developers/docs/topics/oauth2#application
* See https://discord.com/developers/docs/resources/application#application-object
*/
target_application?: Partial<APIApplication>;
/**

View File

@@ -32,7 +32,7 @@ export interface APITeam {
}
/**
* https://discord.com/developers/docs/topics/teams#data-models-team-members-object
* https://discord.com/developers/docs/topics/teams#data-models-team-member-object
*/
export interface APITeamMember {
/**

View File

@@ -1,5 +1,5 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/template
* Types extracted from https://discord.com/developers/docs/resources/guild-template
*/
import type { APIUser } from './user';
@@ -7,7 +7,7 @@ import type { Snowflake } from '../../globals';
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v10/index';
/**
* https://discord.com/developers/docs/resources/template#template-object
* https://discord.com/developers/docs/resources/guild-template#guild-template-object
*/
export interface APITemplate {
/**

View File

@@ -143,8 +143,16 @@ export enum UserFlags {
BotHTTPInteractions = 1 << 19,
/**
* User has been identified as spammer
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Spammer = 1 << 20,
/**
* User's account has been quarantined based on recent activity
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Quarantined = Math.pow(2, 44),
}
/**
@@ -170,8 +178,10 @@ export interface APIConnection {
name: string;
/**
* The service of the connection
*
* See https://discord.com/developers/docs/resources/user#connection-object-services
*/
type: string;
type: ConnectionService;
/**
* Whether the connection is revoked
*/
@@ -202,6 +212,24 @@ export interface APIConnection {
visibility: ConnectionVisibility;
}
export enum ConnectionService {
BattleNet = 'battlenet',
EpicGames = 'epicgames',
Facebook = 'facebook',
GitHub = 'github',
LeagueOfLegends = 'leagueoflegends',
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
SamsungGalaxy = 'samsunggalaxy',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',
Twitch = 'twitch',
Twitter = 'twitter',
Xbox = 'xbox',
YouTube = 'youtube',
}
export enum ConnectionVisibility {
/**
* Invisible to everyone except the user themselves

View File

@@ -15,7 +15,7 @@ interface APIApplicationCommandIntegerOptionBase
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}

View File

@@ -15,7 +15,7 @@ interface APIApplicationCommandNumberOptionBase
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}

View File

@@ -145,8 +145,16 @@ export enum UserFlags {
BotHTTPInteractions = 1 << 19,
/**
* User has been identified as spammer
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Spammer = 1 << 20,
/**
* User's account has been quarantined based on recent activity
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Quarantined = Math.pow(2, 44),
}
/**

View File

@@ -12,7 +12,7 @@ interface APIApplicationCommandIntegerOptionBase
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}

View File

@@ -12,7 +12,7 @@ interface APIApplicationCommandNumberOptionBase
*/
min_value?: number;
/**
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
*/
max_value?: number;
}

View File

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

View File

@@ -54,6 +54,7 @@ import type {
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base';
export * from './_chatInput/attachment';
export * from './_chatInput/base';
export * from './_chatInput/boolean';
export * from './_chatInput/channel';
export * from './_chatInput/integer';
@@ -108,7 +109,7 @@ export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataAttachmentOption;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIChatInputApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {

View File

@@ -10,7 +10,7 @@ import type {
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIUserApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.User> {
@@ -27,7 +27,7 @@ export interface APIUserApplicationCommandInteractionDataResolved {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIMessageApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.Message> {
@@ -43,7 +43,7 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIContextMenuInteractionData =
| APIUserApplicationCommandInteractionData

View File

@@ -101,7 +101,7 @@ export enum ApplicationCommandType {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIApplicationCommandInteractionData =
| APIChatInputApplicationCommandInteractionData

View File

@@ -31,7 +31,7 @@ export interface APIMessageInteraction {
*/
type: InteractionType;
/**
* The name of the ApplicationCommand
* The name of the application command, including subcommands and subcommand groups
*/
name: string;
/**
@@ -104,6 +104,10 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
* For components, the message they were attached to
*/
message?: APIMessage;
/**
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
*/
app_permissions?: Permissions;
/**
* The selected language of the invoking user
*/

View File

@@ -18,6 +18,9 @@ export interface ModalSubmitActionRowComponent
components: ModalSubmitComponent[];
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure
*/
export interface APIModalSubmission {
/**
* A developer-defined identifier for the component, max 100 characters
@@ -26,7 +29,7 @@ export interface APIModalSubmission {
/**
* A list of child components
*/
components?: ModalSubmitActionRowComponent[];
components: ModalSubmitActionRowComponent[];
}
/**

View File

@@ -62,7 +62,7 @@ export interface APIApplication {
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
* See https://discord.com/developers/docs/game-sdk/applications#get-ticket
* See https://discord.com/developers/docs/game-sdk/applications#getticket
*/
verify_key: string;
/**
@@ -129,4 +129,5 @@ export enum ApplicationFlags {
GatewayMessageContent = 1 << 18,
GatewayMessageContentLimited = 1 << 19,
EmbeddedFirstParty = 1 << 20,
ApplicationCommandBadge = 1 << 23,
}

View File

@@ -39,27 +39,34 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
flags?: ChannelFlags;
}
// TODO: update when text in voice is released
export type TextChannelType =
| ChannelType.DM
| ChannelType.GroupDM
| ChannelType.GuildNews
| ChannelType.GuildPublicThread
| ChannelType.GuildPrivateThread
| ChannelType.GuildNewsThread
| ChannelType.GuildAnnouncement
| ChannelType.PublicThread
| ChannelType.PrivateThread
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum;
| ChannelType.GuildForum
| ChannelType.GuildVoice;
export type GuildChannelType = Exclude<
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
ChannelType.DM | ChannelType.GroupDM
>;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
}
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
@@ -111,23 +118,11 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
last_pin_timestamp?: string | null;
}
export interface APITextChannel extends APIGuildTextChannel<ChannelType.GuildText> {
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
}
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageVoice | ChannelType.GuildVoice> {
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
/**
* The bitrate (in bits) of the voice channel
*/
@@ -142,6 +137,11 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
rtc_region?: string | null;
}
export interface APIGuildVoiceChannel
extends APIVoiceChannelBase<ChannelType.GuildVoice>,
APITextBasedChannel<ChannelType.GuildVoice> {
/**
* The camera video quality mode of the voice channel, `1` when not present
*
@@ -150,7 +150,9 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
video_quality_mode?: VideoQualityMode;
}
interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T> {
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
/**
* The recipients of the DM
*
@@ -185,9 +187,7 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
}
export interface APIThreadChannel
extends APIGuildChannel<
ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread | ChannelType.GuildNewsThread
> {
extends APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -197,7 +197,9 @@ export interface APIThreadChannel
*/
thread_metadata?: APIThreadMetadata;
/**
* The approximate message count of the thread, does not count above 50 even if there are more messages
* Number of messages (not including the initial message or deleted messages) in a thread
*
* If the thread was created before July 1, 2022, it stops counting at 50 messages
*/
message_count?: number;
/**
@@ -222,6 +224,12 @@ export interface APIThreadChannel
* The id of the last message sent in this thread (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* Number of messages ever sent in a thread
*
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
*/
total_message_sent?: number;
}
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
@@ -234,7 +242,8 @@ export type APIChannel =
| APIDMChannel
| APITextChannel
| APINewsChannel
| APIVoiceChannel
| APIGuildVoiceChannel
| APIGuildStageVoiceChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APINewsChannel
@@ -271,19 +280,19 @@ export enum ChannelType {
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews,
GuildAnnouncement,
/**
* A thread channel (public) within a Guild News channel
* A temporary sub-channel within a Guild Announcement channel
*/
GuildNewsThread = 10,
AnnouncementThread = 10,
/**
* A public thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel
*/
GuildPublicThread,
PublicThread,
/**
* A private thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*/
GuildPrivateThread,
PrivateThread,
/**
* A voice channel for hosting events with an audience
*
@@ -300,6 +309,34 @@ export enum ChannelType {
* A channel that can only contain threads
*/
GuildForum,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS
/**
* A channel that users can follow and crosspost into their own guild
*
* @deprecated This is the old name for {@apilink ChannelType#GuildAnnouncement}
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews = 5,
/**
* A temporary sub-channel within a Guild Announcement channel
*
* @deprecated This is the old name for {@apilink ChannelType#AnnouncementThread}
*/
GuildNewsThread = 10,
/**
* A temporary sub-channel within a Guild Text channel
*
* @deprecated This is the old name for {@apilink ChannelType#PublicThread}
*/
GuildPublicThread = 11,
/**
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*
* @deprecated This is the old name for {@apilink ChannelType#PrivateThread}
*/
GuildPrivateThread = 12,
}
export enum VideoQualityMode {
@@ -336,6 +373,12 @@ export interface APIMessage {
author: APIUser;
/**
* Contents of the message
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
content: string;
/**
@@ -386,12 +429,24 @@ export interface APIMessage {
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
attachments: APIAttachment[];
/**
* Any embedded content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
embeds: APIEmbed[];
/**
@@ -430,7 +485,7 @@ export interface APIMessage {
/**
* Sent with Rich Presence-related chat embeds
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
* See https://discord.com/developers/docs/resources/application#application-object
*/
application?: Partial<APIApplication>;
/**
@@ -475,6 +530,12 @@ export interface APIMessage {
thread?: APIChannel;
/**
* Sent if the message contains components like buttons, action rows, or other interactive components
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
*
* See https://support-dev.discord.com/hc/en-us/articles/4404772028055
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
/**
@@ -490,6 +551,12 @@ export interface APIMessage {
* @deprecated Use `sticker_items` instead
*/
stickers?: APISticker[];
/**
* A generally increasing integer (there may be gaps or duplicates) that represents the approximate position of the message in a thread
*
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
*/
position?: number;
}
/**
@@ -503,11 +570,11 @@ export enum MessageType {
ChannelNameChange,
ChannelIconChange,
ChannelPinnedMessage,
GuildMemberJoin,
UserPremiumGuildSubscription,
UserPremiumGuildSubscriptionTier1,
UserPremiumGuildSubscriptionTier2,
UserPremiumGuildSubscriptionTier3,
UserJoin,
GuildBoost,
GuildBoostTier1,
GuildBoostTier2,
GuildBoostTier3,
ChannelFollowAdd,
GuildDiscoveryDisqualified = 14,
GuildDiscoveryRequalified,
@@ -907,6 +974,10 @@ export interface APIEmbedVideo {
* Source url of video
*/
url?: string;
/**
* A proxied url of the video
*/
proxy_url?: string;
/**
* Height of video
*/
@@ -1146,7 +1217,7 @@ export interface APIBaseComponent<T extends ComponentType> {
}
/**
* https://discord.com/developers/docs/interactions/message-components#component-types
* https://discord.com/developers/docs/interactions/message-components#component-object-component-types
*/
export enum ComponentType {
/**

View File

@@ -4,6 +4,7 @@
import type { APIEmoji } from './emoji';
import type { PresenceUpdateStatus } from './gateway';
import type { OAuth2Scopes } from './oauth2';
import type { APIRole } from './permissions';
import type { APISticker } from './sticker';
import type { APIUser } from './user';
@@ -69,10 +70,6 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
* The vanity url code for the guild
*/
vanity_url_code?: string | null;
/**
* `true` if this guild is unavailable due to an outage
*/
unavailable?: boolean;
}
/**
@@ -389,10 +386,6 @@ export enum GuildFeature {
* Guild has access to set a guild banner image
*/
Banner = 'BANNER',
/**
* Guild has access to use commerce features (i.e. create store channels)
*/
Commerce = 'COMMERCE',
/**
* Guild can enable welcome screen, Membership Screening and discovery, and receives community updates
*/
@@ -413,8 +406,14 @@ export enum GuildFeature {
* 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
*/
@@ -423,6 +422,8 @@ export enum GuildFeature {
* 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',
/**
@@ -702,6 +703,10 @@ export interface APIGuildIntegration {
* **This field is not provided for `discord` bot integrations.**
*/
application?: APIGuildIntegrationApplication;
/**
* The scopes the application has been authorized for
*/
scopes?: OAuth2Scopes[];
}
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord';
@@ -773,7 +778,7 @@ export interface APIBan {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object
*/
export interface APIGuildWidget {
id: Snowflake;
@@ -785,7 +790,7 @@ export interface APIGuildWidget {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetChannel {
id: Snowflake;
@@ -794,7 +799,7 @@ export interface APIGuildWidgetChannel {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetMember {
id: string;

View File

@@ -53,7 +53,7 @@ export interface APIInvite {
/**
* The type of target for this voice channel invite
*
* See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
*/
target_type?: InviteTargetType;
/**
@@ -65,7 +65,7 @@ export interface APIInvite {
/**
* The embedded application to open for this voice channel embedded application invite
*
* See https://discord.com/developers/docs/topics/oauth2#application
* See https://discord.com/developers/docs/resources/application#application-object
*/
target_application?: Partial<APIApplication>;
/**

View File

@@ -32,7 +32,7 @@ export interface APITeam {
}
/**
* https://discord.com/developers/docs/topics/teams#data-models-team-members-object
* https://discord.com/developers/docs/topics/teams#data-models-team-member-object
*/
export interface APITeamMember {
/**

View File

@@ -1,5 +1,5 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/template
* Types extracted from https://discord.com/developers/docs/resources/guild-template
*/
import type { APIUser } from './user';
@@ -7,7 +7,7 @@ import type { Snowflake } from '../../globals';
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v9/index';
/**
* https://discord.com/developers/docs/resources/template#template-object
* https://discord.com/developers/docs/resources/guild-template#template-object
*/
export interface APITemplate {
/**

View File

@@ -143,8 +143,16 @@ export enum UserFlags {
BotHTTPInteractions = 1 << 19,
/**
* User has been identified as spammer
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Spammer = 1 << 20,
/**
* User's account has been quarantined based on recent activity
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Quarantined = Math.pow(2, 44),
}
/**
@@ -170,8 +178,10 @@ export interface APIConnection {
name: string;
/**
* The service of the connection
*
* See https://discord.com/developers/docs/resources/user#connection-object-services
*/
type: string;
type: ConnectionService;
/**
* Whether the connection is revoked
*/
@@ -202,6 +212,24 @@ export interface APIConnection {
visibility: ConnectionVisibility;
}
export enum ConnectionService {
BattleNet = 'battlenet',
EpicGames = 'epicgames',
Facebook = 'facebook',
GitHub = 'github',
LeagueOfLegends = 'leagueoflegends',
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
SamsungGalaxy = 'samsunggalaxy',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',
Twitch = 'twitch',
Twitter = 'twitter',
Xbox = 'xbox',
YouTube = 'youtube',
}
export enum ConnectionVisibility {
/**
* Invisible to everyone except the user themselves

View File

@@ -70,6 +70,8 @@ export enum RESTJSONErrorCodes {
AnnouncementEditLimitExceeded = 20022,
UnderMinimumAge = 20024,
ChannelSendRateLimit = 20028,
ServerSendRateLimit,
@@ -99,10 +101,10 @@ export enum RESTJSONErrorCodes {
MaximumNumberOfServerCategoriesReached = 30030,
GuildAlreadyHasTemplate = 30031,
MaximumThreadParticipants = 30033,
MaximumNumberOfNonGuildMemberBansHasBeenExceeded = 30035,
MaximumNumberOfApplicationCommandsReached,
MaximumThreadParticipantsReached,
MaximumDailyApplicationCommandCreatesReached,
MaximumNumberOfNonGuildMemberBansHasBeenExceeded,
MaximumNumberOfBanFetchesHasBeenReached = 30037,
MaximumNumberOfUncompletedGuildScheduledEventsReached,
@@ -126,11 +128,15 @@ export enum RESTJSONErrorCodes {
FeatureTemporarilyDisabledServerSide,
UserBannedFromThisGuild,
ConnectionHasBeenRevoked = 40012,
TargetUserIsNotConnectedToVoice = 40032,
ThisMessageWasAlreadyCrossposted,
ApplicationCommandWithThatNameAlreadyExists = 40041,
ApplicationInteractionFailedToSend = 40043,
InteractionHasAlreadyBeenAcknowledged = 40060,
TagNamesMustBeUnique,
@@ -198,6 +204,12 @@ export enum RESTJSONErrorCodes {
RequestBodyContainsInvalidJSON = 50109,
OwnershipCannotBeMovedToABotUser = 50132,
FailedToResizeAssetBelowTheMinimumSize = 50138,
UploadedFileNotFound = 50146,
YouDoNotHavePermissionToSendThisSticker = 50600,
TwoFactorAuthenticationIsRequired = 60003,
@@ -206,6 +218,8 @@ export enum RESTJSONErrorCodes {
ReactionWasBlocked = 90001,
ApplicationNotYetAvailable = 110001,
APIResourceOverloaded = 130000,
TheStageIsAlreadyOpen = 150006,
@@ -229,7 +243,12 @@ export enum RESTJSONErrorCodes {
FailedToCreateStageNeededForStageEvent = 180002,
MessageWasBlockedByAutomaticModeration = 200000,
TitleWasBlockedByAutomaticModeration,
WebhooksCanOnlyCreateThreadsInForumChannels = 220003,
MessageBlockedByHarmfulLinksFilter = 240000,
}
/**

View File

@@ -48,7 +48,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*
* Channel types: text, news
*/
type?: ChannelType.GuildNews | ChannelType.GuildText;
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText;
/**
* The position of the channel in the left-hand listing
*
@@ -619,9 +619,9 @@ export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThread
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*
* @default ChannelType.GuildPrivateThread
* @default ChannelType.PrivateThread
*/
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/
@@ -665,4 +665,9 @@ export interface RESTGetAPIChannelThreadsArchivedQuery {
/**
* https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads
*/
export type RESTGetAPIChannelUsersThreadsArchivedResult = APIThreadList;
export interface RESTGetAPIChannelUsersThreadsArchivedResult extends APIThreadList {
/**
* Whether there are potentially additional threads
*/
has_more: boolean;
}

View File

@@ -357,7 +357,7 @@ export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
export type RESTPatchAPIGuildChannelPositionsResult = never;
/**
* https://discord.com/developers/docs/resources/guild#list-active-threads
* https://discord.com/developers/docs/resources/guild#list-active-guild-threads
*/
export type RESTGetAPIGuildThreadsResult = APIThreadList;
@@ -573,8 +573,14 @@ export type RESTGetAPIGuildBanResult = APIBan;
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Number of days to delete messages for (0-7)
*
* @deprecated use `delete_message_seconds` instead
*/
delete_message_days?: number;
/**
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
*/
delete_message_seconds?: number;
}>;
/**
@@ -855,7 +861,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
channel_id?: Snowflake;
/**
* Toggles the user's suppress state
*/

View File

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

View File

@@ -129,8 +129,10 @@ export type RESTPatchAPIApplicationGuildCommandResult = Omit<APIApplicationComma
* https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
*/
export type RESTPutAPIApplicationGuildCommandsJSONBody = (
| Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'>
| Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'>
| (Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'> &
Pick<Partial<APIApplicationCommand>, 'id'>)
| (Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'> &
Pick<Partial<APIApplicationCommand>, 'id'>)
)[];
/**

View File

@@ -48,7 +48,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*
* Channel types: text, news
*/
type?: ChannelType.GuildNews | ChannelType.GuildText;
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText;
/**
* The position of the channel in the left-hand listing
*
@@ -633,9 +633,9 @@ export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThread
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*
* @default ChannelType.GuildPrivateThread
* @default ChannelType.PrivateThread
*/
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/

View File

@@ -357,7 +357,7 @@ export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
export type RESTPatchAPIGuildChannelPositionsResult = never;
/**
* https://discord.com/developers/docs/resources/guild#list-active-threads
* https://discord.com/developers/docs/resources/guild#list-active-guild-threads
*/
export type RESTGetAPIGuildThreadsResult = Omit<APIThreadList, 'has_more'>;
@@ -573,8 +573,14 @@ export type RESTGetAPIGuildBanResult = APIBan;
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Number of days to delete messages for (0-7)
*
* @deprecated use `delete_message_seconds` instead
*/
delete_message_days?: number;
/**
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
*/
delete_message_seconds?: number;
/**
* Reason for the ban
*
@@ -861,7 +867,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
channel_id?: Snowflake;
/**
* Toggles the user's suppress state
*/

View File

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

View File

@@ -129,8 +129,10 @@ export type RESTPatchAPIApplicationGuildCommandResult = Omit<APIApplicationComma
* https://discord.com/developers/docs/interactions/application-commands#bulk-overwrite-guild-application-commands
*/
export type RESTPutAPIApplicationGuildCommandsJSONBody = (
| Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'>
| Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'>
| (Omit<RESTPostAPIChatInputApplicationCommandsJSONBody, 'dm_permission'> &
Pick<Partial<APIApplicationCommand>, 'id'>)
| (Omit<RESTPostAPIContextMenuApplicationCommandsJSONBody, 'dm_permission'> &
Pick<Partial<APIApplicationCommand>, 'id'>)
)[];
/**

View File

@@ -18,8 +18,8 @@ We recommend you contribute either through locally editing the files on your des
:::info Still can't figure it out?
No problem! We await you with open hands in our [`Discord Server`](https://discord.gg/djs) in the `#discord-api-types`
channel (under the `Miscellaneous` category)
No problem! We await you with open hands in our [`Discord Server`](https://discord.gg/djs) in the `#developing-djs`
channel.
:::

View File

@@ -190,6 +190,7 @@ const config = {
items: [
{ label: versions.length === 0 ? 'Development Time' : 'next 🚧', to: versions.length === 0 ? 'api' : 'api/next' },
...versions.map((version, i) => ({
activeBaseRegex: `api/(${version}/)${i === 0 ? '?' : ''}discord-api-types.*`,
label: version,
to: i === 0 ? 'api' : `api/${version}`
}))
@@ -252,13 +253,13 @@ const config = {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: ['powershell', 'batch']
},
algolia: {
appId: 'TR1O0DBFL9',
apiKey: '6822440beca69053ab122881d75064dc',
indexName: 'discord-api-types',
contextualSearch: true
}
// algolia: {
// appId: 'TO_BE_DONE',
// apiKey: 'TO_BE_DONE',
// indexName: 'TO_BE_DONE',
// contextualSearch: false
// }
})
};

1424
website/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -48,3 +48,40 @@
.navbar__toggle {
color: #f5f6f7;
}
// Search
[data-theme='light'] .DocSearch {
/* --docsearch-primary-color: var(--ifm-color-primary); */
/* --docsearch-text-color: var(--ifm-font-color-base); */
--docsearch-muted-color: var(--ifm-color-secondary-darkest);
--docsearch-container-background: rgba(94, 100, 112, 0.7);
/* Modal */
--docsearch-modal-background: var(--ifm-color-secondary-lighter);
/* Search box */
--docsearch-searchbox-background: var(--ifm-color-secondary);
--docsearch-searchbox-focus-background: var(--ifm-color-white);
/* Hit */
--docsearch-hit-color: var(--ifm-font-color-base);
--docsearch-hit-active-color: var(--ifm-color-white);
--docsearch-hit-background: var(--ifm-color-white);
/* Footer */
--docsearch-footer-background: var(--ifm-color-white);
}
[data-theme='dark'] .DocSearch {
--docsearch-text-color: var(--ifm-font-color-base);
--docsearch-muted-color: var(--ifm-color-secondary-darkest);
--docsearch-container-background: rgba(47, 55, 69, 0.7);
/* Modal */
--docsearch-modal-background: var(--ifm-background-color);
/* Search box */
--docsearch-searchbox-background: var(--ifm-background-color);
--docsearch-searchbox-focus-background: var(--ifm-color-black);
/* Hit */
--docsearch-hit-color: var(--ifm-font-color-base);
--docsearch-hit-active-color: var(--ifm-color-white);
--docsearch-hit-background: var(--ifm-color-emphasis-100);
/* Footer */
--docsearch-footer-background: var(--ifm-background-surface-color);
--docsearch-key-gradient: linear-gradient(-26.5deg, var(--ifm-color-emphasis-200) 0%, var(--ifm-color-emphasis-100) 100%);
}

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