Compare commits

...

674 Commits

Author SHA1 Message Date
github-actions[bot]
66958cb67e chore(release): 0.37.76 🎉 (#923)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-21 14:18:44 +02:00
renovate[bot]
bd7e1e7b4f chore(deps): lock file maintenance (#922)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-21 12:51:39 +02:00
renovate[bot]
6ce581c0db chore(deps): lock file maintenance (#918)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-21 12:30:05 +02:00
renovate[bot]
7f22d4da37 chore(deps): update dependency typescript to v5.4.3 (#920)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-20 21:53:55 +02:00
renovate[bot]
d6d2fb69c9 chore(deps): update dependency @types/node to v20.11.30 (#919)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-19 15:05:35 +02:00
renovate[bot]
dfc109f3f1 chore(deps): update patch/minor dependencies (#917)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-19 10:59:04 +02:00
Almeida
1377730766 ci: ignore new releases triggered only by renovate (#916) 2024-03-18 22:52:38 +02:00
renovate[bot]
22e6bafd39 chore(deps): lock file maintenance (#915)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-18 22:12:47 +02:00
renovate[bot]
5e175e1595 chore(deps): update dependency @typescript-eslint/utils to v7.3.0 (#914)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-18 22:09:02 +02:00
Vlad Frangu
fcf14c3ea2 chore: make renovate be less spamy 2024-03-18 22:06:09 +02:00
renovate[bot]
8640cdd360 chore(deps): update dependency @types/node to v20.11.29 (#912)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-18 22:03:03 +02:00
github-actions[bot]
1f83534ccb chore(release): 0.37.75 🎉 (#911)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-18 14:28:55 +02:00
dependabot[bot]
affc669a73 chore(deps): bump follow-redirects from 1.15.4 to 1.15.6 in /website (#905)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 12:55:36 +02:00
renovate[bot]
15fe19b39d chore(deps): update dependency @commitlint/cli to v19.2.0 (#903)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-15 12:55:20 +02:00
renovate[bot]
c83a604076 chore(deps): update dependency @types/node to v20.11.28 (#904)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-15 12:52:31 +02:00
github-actions[bot]
6887b8fc46 chore(release): 0.37.74 🎉 (#902)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-14 14:20:15 +02:00
renovate[bot]
f509930e00 chore(deps): update dependency @types/node to v20.11.27 (#901)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-13 17:01:31 +02:00
renovate[bot]
597b7f7fb0 chore(deps): update commitlint monorepo to v19.1.0 (#900)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-12 10:52:13 +02:00
renovate[bot]
badf590103 chore(deps): update dependency @types/node to v20.11.26 (#898)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-12 01:01:04 +02:00
renovate[bot]
d7d089e3cd chore(deps): update dependency @octokit/webhooks-types to v7.4.0 (#899)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-12 00:55:37 +02:00
renovate[bot]
36e8d3caed chore(deps): update dependency @typescript-eslint/utils to v7.2.0 (#897)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-11 21:26:47 +02:00
github-actions[bot]
9fc46f8ecb chore(release): 0.37.73 🎉 (#895)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-07 14:26:22 +02:00
Vlad Frangu
930162c7a6 chore: fix release flow 2024-03-07 14:24:26 +02:00
github-actions[bot]
1cf1a57365 chore(release): 0.37.72 🎉 (#894)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-07 14:18:44 +02:00
Vlad Frangu
a39a5d9d41 chore: remove useless all matcher for labeler 2024-03-06 21:48:17 +02:00
renovate[bot]
a0e00ffaf7 chore(deps): update actions/labeler action to v5 (#893)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vlad Frangu <me@vladfrangu.dev>
2024-03-06 21:45:57 +02:00
renovate[bot]
45e2d17c65 chore(deps): update dependency typescript to v5.4.2 (#892)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-06 21:22:01 +02:00
renovate[bot]
8691b992e0 chore(deps): update dependency @types/node to v20.11.25 (#891)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-06 21:21:37 +02:00
renovate[bot]
36d1b4ba50 chore(deps): update actions/setup-node action to v4 (#889)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-05 10:00:31 +02:00
renovate[bot]
de02125eec chore(deps): update dependency npm-run-all2 to v6 (#890)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-05 10:00:19 +02:00
Vlad Frangu
8acc356d27 chore: use github provided concurrency to prevent multiple publish nexts 2024-03-05 00:12:53 +02:00
renovate[bot]
803e5b31b9 chore(deps): update styfle/cancel-workflow-action action to v0.12.1 (#886)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-05 00:01:43 +02:00
renovate[bot]
c7e0e32aa5 chore(deps): replace dependency npm-run-all with npm-run-all2 ^5.0.0 (#885)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-05 00:01:21 +02:00
renovate[bot]
5aec2d293e chore: Configure Renovate (#884)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: Vlad Frangu <me@vladfrangu.dev>
2024-03-04 23:59:04 +02:00
Vlad Frangu
5e09570716 chore: woopsie daisy 2024-03-04 23:13:50 +02:00
Vlad Frangu
d98c991c35 chore: my bad boo 2024-03-04 21:45:48 +02:00
Vlad Frangu
2814d7e2f5 chore: wowzah 2024-03-04 21:41:06 +02:00
Vlad Frangu
23f87a8ff2 chore: fix rimraf and build script 2024-03-04 21:29:45 +02:00
Vlad Frangu
1d39612329 chore: give this repo some LOVE 2024-03-04 21:17:19 +02:00
René
ef31e116b6 chore: remove deprecated importsNotUsedAsValues from tsconfig (#831) 2024-03-04 21:12:01 +02:00
Superchupu
abbd4b2e21 ci: enable npm provenance (#882) 2024-03-04 21:04:22 +02:00
Isidro Casiano
5e295706b8 docs(APISelectMenuOption): correct character limit (#881) 2024-03-04 20:59:49 +02:00
github-actions[bot]
803dcd7bdd chore(release): 0.37.71 🎉 (#880)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-26 14:19:12 +02:00
dependabot[bot]
62de95fd6f chore(deps): bump follow-redirects from 1.15.1 to 1.15.4 in /website (#865)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-23 02:17:45 +02:00
dependabot[bot]
4f46175c3c chore(deps-dev): bump ip from 1.1.5 to 1.1.9 (#876)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-23 02:17:36 +02:00
MateoDeveloper
150dc46b87 feat: add initial support for super reactions (#744)
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
2024-02-23 02:16:59 +02:00
github-actions[bot]
c008413a8a chore(release): 0.37.70 🎉 (#875)
Build ran for 9564941b3a

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-15 14:18:10 +02:00
n1ck_pro
9564941b3a feat(RESTPostAPIChannelMessageJSONBody): add enforce_nonce (#874) 2024-02-12 23:13:34 +02:00
github-actions[bot]
f329a80a6b chore(release): 0.37.69 🎉 (#873)
Build ran for 0cfe05dad8

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-08 14:19:06 +02:00
MateoDeveloper
0cfe05dad8 feat(Locale): add SpanishLATAM (#859) 2024-02-07 21:38:22 +02:00
github-actions[bot]
4473293b0e chore(release): 0.37.68 🎉 (#872)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-05 14:22:11 +02:00
TÆMBØ
a28b2d749e types(CDNRoutes): use generics for format options (#868) 2024-02-05 14:19:50 +02:00
Danial Raza
55efcca4f8 fix(CDNRoutes): make format optional and default to png (#869) 2024-02-01 02:59:16 +02:00
Danial Raza
6f541d58d2 fix(CDNRoutes): fix store page wrong extension (#867) 2024-02-01 00:19:20 +02:00
github-actions[bot]
71caf7cfc6 chore(release): 0.37.67 🎉 (#863)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-12-28 14:19:11 +02:00
Walter Min
819d85207a fix(GatewayThreadDispatch): properly type thread create/update/delete dispatches (#861)
* fix: properly type thread create/update/delete dispatches

* fix(GatewayThreadDispatch): deno types

* fix(GatewayThreadDispatch): deprecate GatewayThreadModifyDispatch
2023-12-27 14:22:42 +02:00
github-actions[bot]
7f797b2b4b chore(release): 0.37.66 🎉 (#857)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-12-07 14:24:45 +02:00
Danial Raza
470fe189ae chore: use string values in vs code settings (#856) 2023-12-05 19:29:13 +02:00
Danial Raza
b4226bb708 feat(RESTPostAPIWebhookWithTokenJSONBody): add applied_tags (#855) 2023-12-05 19:28:52 +02:00
github-actions[bot]
72a78a4f6f chore(release): 0.37.65 🎉 (#852)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-23 14:21:14 +02:00
Jiralite
957488134e fix(TextChannelType): Remove forum and media channels (#849)
* fix: remove forum and media channels from text channel types

* refactor: extend `APIGuildChannel` instead
2023-11-21 17:42:53 +00:00
github-actions[bot]
5327f3f38c chore(release): 0.37.64 🎉 (#850)
Build ran for ca05ee5eb2

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-20 14:20:47 +02:00
Almeida
ca05ee5eb2 feat(PermissionFlagsBits): split up expressions and events perms (#790) 2023-11-16 23:16:57 +00:00
github-actions[bot]
1d8399d925 chore(release): 0.37.63 🎉 (#846)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-11-09 14:29:41 +02:00
Almeida
a8efb1949a fix(RESTPutAPIGuildOnboardingJSONBody): optional keys and flattened emoji (#839)
* fix(RESTPutAPIGuildOnboardingJSONBody): optional keys and flattened emoji

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

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

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

* docs(APIApplication): update tag documentation

* fix(RESTPatchCurrentApplicationJSONBody): add `flags`

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

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

* docs: edit description of state

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

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-07-10 15:23:47 +03:00
Danial Raza
3bb2821e8d docs(APITextInputComponent): correct label max characters (#784) 2023-07-08 18:33:54 +03:00
github-actions[bot]
201cb13b6d chore(release): 0.37.47 🎉 (#781)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-29 15:22:52 +03:00
advaith
844ad568c4 feat(Guild): add join raid and mention raid protection (#677)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2023-06-27 14:28:51 +03:00
Jiralite
374f690860 docs(RESTPostAPIChannelMessagesThreadsJSONBody): Remove 3/7-day requirement text (#778) 2023-06-22 18:04:38 +03:00
github-actions[bot]
e5d8050f39 chore(release): 0.37.46 🎉 (#776)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-19 15:22:15 +03:00
MateoDeveloper
300e31b514 feat(RESTJSONErrorCodes): add error 50131 (#753)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2023-06-15 19:33:19 +03:00
github-actions[bot]
40b9d60549 chore(release): 0.37.45 🎉 (#775)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-15 15:43:43 +03:00
n1ck_pro
5af7147863 feat: support new username system (#765) 2023-06-15 15:24:48 +03:00
github-actions[bot]
e01cf7cfb4 chore(release): 0.37.44 🎉 (#774)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-06-15 15:23:52 +03:00
Almeida
eced39cc3f feat: guild onboarding (#713) 2023-06-14 15:12:08 +03:00
github-actions[bot]
f3fe162848 chore(release): 0.37.43 🎉 (#771)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-29 15:19:28 +03:00
Almeida
da09a267d1 chore(PermissionFlagsBits): mark UseExternalSounds as stable (#770) 2023-05-26 00:53:47 +03:00
Almeida
30fb4978b7 feat(RESTJSONErrorCodes): add error 50178 (#752) 2023-05-26 00:53:29 +03:00
github-actions[bot]
1db56d30a8 chore(release): 0.37.42 🎉 (#766)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-08 16:27:20 +03:00
Almeida
0e6b19d2bc fix: allow sending empty choices with autocomplete: true (#762) 2023-05-04 18:50:48 +03:00
Jiralite
21d1be9e18 chore: migrate to eslint-config-neon (#756) 2023-05-04 18:50:10 +03:00
github-actions[bot]
db49793666 chore(release): 0.37.41 🎉 (#764)
Build ran for 9dce6ed392

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-05-01 15:22:02 +03:00
Mateusz Burzyński
9dce6ed392 fix(types): move types condition to the front (#763) 2023-05-01 02:45:11 +03:00
dependabot[bot]
be770c91be chore(deps): bump vm2 from 3.9.16 to 3.9.17 (#755)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-30 14:06:18 +03:00
dependabot[bot]
cd8b63f9ba chore(deps): bump yaml, @commitlint/load and lint-staged (#759)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-30 13:53:09 +03:00
Jiralite
5079b164db fix(GatewayGuildMembersChunkDispatchData): Omit guild_id for presences (#761) 2023-04-30 13:52:20 +03:00
github-actions[bot]
50ace3b7e0 chore(release): 0.37.40 🎉 (#758)
Build ran for 7c69137a47

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-24 18:30:35 +03:00
Almeida
7c69137a47 docs(PermissionFlagsBits): add descriptions (#757) 2023-04-24 10:59:13 +03:00
MateoDeveloper
3dac5b93e7 feat: add support for voice messages (#749)
Co-authored-by: advaith <advaithj1@gmail.com>
2023-04-21 11:33:12 +03:00
github-actions[bot]
0f7602605c chore(release): 0.37.39 🎉 (#751)
Build ran for ca6a95d69c

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-17 15:46:05 +03:00
Aura Román
ca6a95d69c fix(RESTPostAPIChannelMessagesThreadsJSONBody): mark auto_archive_duration as optional 2023-04-16 12:26:49 +03:00
Vitor
9a66d21f49 feat(APIGuild): add max_stage_video_channel_users (#550) 2023-04-13 20:25:22 +03:00
dependabot[bot]
bb0ccf1e28 chore(deps): bump dns-packet from 5.3.1 to 5.4.0 in /website (#729)
Bumps [dns-packet](https://github.com/mafintosh/dns-packet) from 5.3.1 to 5.4.0.
- [Release notes](https://github.com/mafintosh/dns-packet/releases)
- [Changelog](https://github.com/mafintosh/dns-packet/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mafintosh/dns-packet/compare/v5.3.1...5.4.0)

---
updated-dependencies:
- dependency-name: dns-packet
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-13 19:03:10 +03:00
Almeida
cfedc17338 refactor(PermissionFlagsBits): update permissions (#737)
Co-authored-by: advaith <advaithj1@gmail.com>
2023-04-13 18:50:08 +03:00
dependabot[bot]
e647e795c9 chore(deps): bump vm2 from 3.9.11 to 3.9.16 (#747)
Bumps [vm2](https://github.com/patriksimek/vm2) from 3.9.11 to 3.9.16.
- [Release notes](https://github.com/patriksimek/vm2/releases)
- [Changelog](https://github.com/patriksimek/vm2/blob/master/CHANGELOG.md)
- [Commits](https://github.com/patriksimek/vm2/compare/3.9.11...3.9.16)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-13 18:49:40 +03:00
github-actions[bot]
f52efabbb1 chore(release): 0.37.38 🎉 (#746)
Build ran for 9074621085

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-04-10 15:19:17 +03:00
MateoDeveloper
9074621085 feat(RESTJSONErrorCodes): add error 50163 (#725) 2023-04-06 21:52:42 +03:00
Almeida
8e2a5d2451 docs(ApplicationFlags): ApplicationAutoModerationRuleCreateBadge is no longer unstable (#738) 2023-04-06 21:52:10 +03:00
Almeida
311b7a2eb9 feat(APIBaseInteraction): add channel (#741) 2023-04-06 21:51:44 +03:00
Aura Román
4aa9646d05 chore(docsearch): increase contrast for hits in dark mode (#742) 2023-04-05 18:23:04 +00:00
github-actions[bot]
d8435774d6 chore(release): 0.37.37 🎉 (#736)
Build ran for 8f9370d259

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-23 14:21:44 +02:00
Almeida
8f9370d259 feat(RESTPostAPIGuildChannelJSONBody): add default_thread_rate_limit_per_user (#730) 2023-03-22 20:49:53 +02:00
Almeida
0cd9b0debb feat(RESTGetAPICurrentUserGuildsQuery): add with_counts (#641) 2023-03-22 20:36:51 +02:00
advaith
4723d29c9e feat: add various new flags (#733) 2023-03-22 20:28:57 +02:00
Suneet Tipirneni
2a78a517d2 fix: add missing RESTGetAPIWebhookWithTokenQuery (#735) 2023-03-22 20:27:46 +02:00
github-actions[bot]
08cbcd74a8 chore(release): 0.37.36 🎉 (#731)Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Build ran for 9e68e0c9e0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-03-13 22:25:32 +02:00
Vlad Frangu
9e68e0c9e0 chore: fix workflow 2023-03-13 22:22:24 +02:00
DD
590e0e4883 refactor: remove over-use of AddUndefinedToPossiblyUndefinedPropertiesOfInterface (#726) 2023-02-25 16:35:52 +02:00
MateoDeveloper
0d47c69ca8 feat(AutoModeration): add custom_message field support (#727) 2023-02-25 16:17:33 +02:00
github-actions[bot]
dc09aceb2f chore(release): 0.37.35 🎉 (#724)
Build ran for a968c5f78a

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-17 17:54:56 +02:00
Almeida
a968c5f78a docs(AutoModerationRuleTriggerType): increase keyword limits (#709) 2023-02-17 17:51:31 +02:00
dependabot[bot]
b37b34277b chore(deps): bump @sideway/formula from 3.0.0 to 3.0.1 in /website (#711)
Bumps [@sideway/formula](https://github.com/sideway/formula) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/sideway/formula/releases)
- [Commits](https://github.com/sideway/formula/compare/v3.0.0...v3.0.1)

---
updated-dependencies:
- dependency-name: "@sideway/formula"
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-17 17:51:08 +02:00
Jiralite
85051eaab7 fix: StageRaiseHand should be unstable (#722) 2023-02-17 17:48:21 +02:00
MateoDeveloper
040b6826c3 refactor(APIVoiceChannelBase): support text and video in stages (#721) 2023-02-17 16:01:31 +02:00
github-actions[bot]
c09c5f5093 chore(release): 0.37.34 🎉 (#723)Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Build ran for b1446279a8

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-16 14:24:31 +02:00
Jiralite
b1446279a8 refactor(MessageType): remove @unstable stage message types (#718) 2023-02-15 22:53:21 +02:00
MateoDeveloper
20153f6fe2 feat(RESTJSONErrorCodes): add error 30060 (#720) 2023-02-15 21:51:25 +02:00
Almeida
d661ff5ee7 docs(RESTPostAPIGuildStickerFormDataBody): clarify constraints (#696) 2023-02-15 21:42:40 +02:00
Almeida
4cf6fd2cec feat(CDNRoutes): add storePageAsset() (#695) 2023-02-15 21:42:01 +02:00
MateoDeveloper
c65e214fdd feat(ConnectionService): add instagram (#701) 2023-02-15 21:40:38 +02:00
panley01
8477deb6a8 feat: add managed field to ChannelType.GroupDM (#698) 2023-02-15 21:40:25 +02:00
MateoDeveloper
41b31ebfd6 feat(RESTJSONErrorCodes): add error 30011 (#697) 2023-02-15 21:39:57 +02:00
Almeida
d609efc746 feat(RESTJSONErrorCodes): add error 30061 (#717) 2023-02-15 21:37:46 +02:00
Jiralite
8d37bc5e30 fix(GuildSystemChannelFlags): "suppress" typo (#719) 2023-02-15 15:16:00 +02:00
github-actions[bot]
052ceb2d02 chore(release): 0.37.33 🎉 (#716)
Build ran for 602c16eee1

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-12 01:07:04 +02:00
IRONM00N
602c16eee1 fix(GatewayDispatchPayload): add missing GuildAuditLogEntry (#715)
closes https://github.com/discordjs/discord-api-types/issues/714
2023-02-12 01:02:44 +02:00
github-actions[bot]
1247cfc624 chore(release): 0.37.32 🎉 (#712)Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Build ran for b14aea65f8

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-02-09 15:12:15 +02:00
Almeida
b14aea65f8 feat(MessageType): add SuppressNotifications (#710) 2023-02-09 00:01:17 +02:00
dependabot[bot]
fddb6f1362 chore(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 in /website (#706)Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-08 14:50:36 +02:00
dependabot[bot]
4edd16cc7e chore(deps): bump http-cache-semantics from 4.1.0 to 4.1.1 (#705)Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [http-cache-semantics](https://github.com/kornelski/http-cache-semantics) from 4.1.0 to 4.1.1.
- [Release notes](https://github.com/kornelski/http-cache-semantics/releases)
- [Commits](https://github.com/kornelski/http-cache-semantics/compare/v4.1.0...v4.1.1)

---
updated-dependencies:
- dependency-name: http-cache-semantics
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-08 14:50:31 +02:00
github-actions[bot]
cc3aec7aa1 chore(release): 0.37.31 🎉 (#704)
Build ran for 0e44dd9681

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-30 15:35:43 +02:00
dependabot[bot]
0e44dd9681 chore(deps): bump ua-parser-js from 0.7.31 to 0.7.33 in /website (#703)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-26 23:00:55 +02:00
github-actions[bot]
ff20a503bc chore(release): 0.37.30 🎉 (#702)
Build ran for 31ca234dec

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-26 14:22:19 +02:00
Almeida
31ca234dec feat(GatewayDispatchEvents): add GuildAuditLogEntryCreate (#692) 2023-01-24 00:33:22 +02:00
MateoDeveloper
e902671411 feat(APIGuildMember): add support for guild member flags (#700) 2023-01-24 00:31:41 +02:00
github-actions[bot]
2df39d296f chore(release): 0.37.29 🎉 (#699)
Build ran for 4edcd6a8dd

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-23 14:21:00 +02:00
Almeida
4edcd6a8dd docs(APIApplicationRoleConnectionMetadata): specify lower bound of fields (#694)
* docs(APIApplicationRoleConnectionMetadata): specify lower bound of fields

* docs: requested changes
2023-01-22 21:55:51 +02:00
github-actions[bot]
14a54994b7 chore(release): 0.37.28 🎉 (#691)
Build ran for 7798f2642b

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-12 15:15:21 +02:00
Jiralite
7798f2642b chore: add blocked label (#690) 2023-01-11 01:44:09 +02:00
Jiralite
792c60b332 feat: Add role subscription data and system channel flags (#686) 2023-01-11 01:03:19 +02:00
Almeida
3dbe985b6e feat(APIRoleTags): add guild_connections (#675) 2023-01-10 21:16:13 +00:00
advaith
af06df6cae feat(ConnectionService): add TikTok (#632) 2023-01-10 23:11:05 +02:00
Almeida
8869e92336 feat(RESTJSONErrorCodes): add error 50091 (#671) 2023-01-10 23:09:52 +02:00
Almeida
b10e9bbe5a fix(GuildIntegration): enabled and user are present on bots (#660) 2023-01-10 23:09:35 +02:00
Almeida
a6bcb3f0fe feat(StickerFormatType): add GIF (#688) 2023-01-10 23:09:08 +02:00
MateoDeveloper
e2fb5ee488 feat(APIThreadMember): add support for thread member pagination (#689) 2023-01-10 23:08:36 +02:00
Almeida
0b4058bdd4 feat: role subscriptions (#665) 2023-01-10 23:07:28 +02:00
github-actions[bot]
195156480c chore(release): 0.37.27 🎉 (#687)
Build ran for 7d55b33bac

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-09 14:29:12 +02:00
Almeida
7d55b33bac feat(MessageType): add missing types (#681) 2023-01-07 18:54:39 +02:00
github-actions[bot]
ba4ee01f79 chore(release): 0.37.26 🎉 (#684)
Build ran for e389a2189a

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2023-01-05 14:21:20 +02:00
dependabot[bot]
e389a2189a chore(deps): bump json5 from 1.0.1 to 1.0.2 (#683)
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

---
updated-dependencies:
- dependency-name: json5
  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>
2023-01-05 13:41:09 +02:00
dependabot[bot]
77585d1ffa chore(deps): bump json5 from 2.2.1 to 2.2.2 in /website (#680)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-01-05 13:40:13 +02:00
advaith
4a25caf506 feat: add RESTJSONErrorCode 40062 and RESTRateLimit.code (#620) 2023-01-05 13:38:37 +02:00
MateoDeveloper
6e4a6115ae feat(RESTJSONErrorCodes): add error 50067 (#640) 2023-01-05 13:38:00 +02:00
Almeida
921bffd1b2 feat(RESTJSONErrorCodes): add error 30058 (#676) 2023-01-05 13:37:39 +02:00
Jiralite
bb2ef84313 feat(RESTGetAPIAuditLogQuery): support after (#682) 2023-01-04 23:22:12 +02:00
github-actions[bot]
5e9bff9d0e chore(release): 0.37.25 🎉 (#679)
Build ran for 4c334f6eb8

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-29 14:19:24 +02:00
Almeida
4c334f6eb8 docs(ApplicationFlags): add descriptions to each flag (#639) 2022-12-22 20:10:03 +02:00
github-actions[bot]
93667b9a9e chore(release): 0.37.24 🎉 (#674)
Build ran for 8df9f14a24

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-19 15:37:05 +02:00
Almeida
8df9f14a24 fix(APIApplicationRoleConnection): metadata values can be numbers (#673) 2022-12-16 16:15:06 +02:00
github-actions[bot]
c2bec62a8e chore(release): 0.37.23 🎉 (#672)
Build ran for 190242a59d

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-15 16:59:48 +02:00
advaith
190242a59d feat(APIGuildForumChannel): add default_forum_layout (#658)
* feat(APIGuildForumChannel): add `default_forum_layout`

* chore: use official names and text
2022-12-15 07:19:15 +02:00
MateoDeveloper
2b75d13b39 feat(Locale): add Indonesian locale (#643) 2022-12-14 23:45:04 +02:00
advaith
89bc0f40b6 fix(Interactions): make app_permissions required (#652) 2022-12-14 23:21:41 +02:00
Cynthia
2a5413def4 fix(APIChannel): correctly type present properties based on channel type (#669) 2022-12-14 23:20:04 +02:00
Almeida
d7b666c739 feat: add role connections (#651) 2022-12-14 23:18:41 +02:00
MateoDeveloper
c3fda99637 feat(APIApplicationCommand): add nsfw field (#637) 2022-12-14 23:16:14 +02:00
github-actions[bot]
57a69a1301 chore(release): 0.37.22 🎉 (#668)
Build ran for e818213043

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-12 14:38:24 +02:00
advaith
e818213043 chore(UserFlags): update certified moderator description (#659) 2022-12-11 22:50:47 +02:00
dependabot[bot]
40ec4363bb chore(deps): bump minimatch, recursive-readdir and serve-handler (#662)
Bumps [minimatch](https://github.com/isaacs/minimatch), [recursive-readdir](https://github.com/jergason/recursive-readdir) and [serve-handler](https://github.com/zeit/serve-handler). These dependencies needed to be updated together.

Updates `minimatch` from 3.0.4 to 3.1.2
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

Updates `recursive-readdir` from 2.2.2 to 2.2.3
- [Release notes](https://github.com/jergason/recursive-readdir/releases)
- [Changelog](https://github.com/jergason/recursive-readdir/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jergason/recursive-readdir/commits/v2.2.3)

Updates `serve-handler` from 6.1.3 to 6.1.5
- [Release notes](https://github.com/zeit/serve-handler/releases)
- [Commits](https://github.com/zeit/serve-handler/compare/6.1.3...6.1.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
- dependency-name: recursive-readdir
  dependency-type: indirect
- dependency-name: serve-handler
  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-12-11 22:50:25 +02:00
dependabot[bot]
190223f1f9 chore(deps): bump minimatch, recursive-readdir and serve-handler (#662)
Bumps [minimatch](https://github.com/isaacs/minimatch), [recursive-readdir](https://github.com/jergason/recursive-readdir) and [serve-handler](https://github.com/zeit/serve-handler). These dependencies needed to be updated together.

Updates `minimatch` from 3.0.4 to 3.1.2
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

Updates `recursive-readdir` from 2.2.2 to 2.2.3
- [Release notes](https://github.com/jergason/recursive-readdir/releases)
- [Changelog](https://github.com/jergason/recursive-readdir/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jergason/recursive-readdir/commits/v2.2.3)

Updates `serve-handler` from 6.1.3 to 6.1.5
- [Release notes](https://github.com/zeit/serve-handler/releases)
- [Commits](https://github.com/zeit/serve-handler/compare/6.1.3...6.1.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
- dependency-name: recursive-readdir
  dependency-type: indirect
- dependency-name: serve-handler
  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-12-11 22:50:12 +02:00
Cynthia
995126e2cc fix(APIChannel): correctly type name based on channel type (#666)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2022-12-11 22:48:02 +02:00
github-actions[bot]
549d1daaa0 chore(release): 0.37.21 🎉 (#663)
Build ran for 38aad33ed8

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-12-05 14:34:31 +02:00
Jiralite
38aad33ed8 ci: Assign reviewers on drafts (#661) 2022-12-03 11:27:26 +00:00
Eejit
390c628ee3 docs: update description for StickerType.Guild (#657) 2022-12-02 14:35:56 +02:00
github-actions[bot]
c730f1a8d1 chore(release): 0.37.20 🎉 (#655)
Build ran for 33e0f3f411

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-24 18:30:56 +02:00
Eejit
33e0f3f411 docs: Link Quarantined to article (#653)
* Link `Quarantined` to article

* revert changes to v8

* remove locale in url
2022-11-24 13:14:07 +02:00
Eejit
3713a553e9 docs: Remove locales and titles in help center article links (#654)
* Remove locales in help center article links

* remove article names from help center urls
2022-11-24 13:12:51 +02:00
github-actions[bot]
b03b1fb0cd chore(release): 0.37.19 🎉 (#650)
Build ran for 0aa384ca9a

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-21 14:24:19 +02:00
Jiralite
0aa384ca9a docs(RESTGetAPIChannelThreadsResult): update deprecation url (#649) 2022-11-21 08:06:43 +02:00
Jiralite
2695dade8b fix(channel): add missing type aliases (#648) 2022-11-21 00:15:19 +02:00
Tuur Martens
9d72e82e07 fix(APIGuildChannel): make position of guild channel non optional (#647) 2022-11-20 18:57:06 +00:00
dependabot[bot]
f91e10f830 chore(deps): bump loader-utils from 2.0.2 to 2.0.4 in /website (#644)
Bumps [loader-utils](https://github.com/webpack/loader-utils) from 2.0.2 to 2.0.4.
- [Release notes](https://github.com/webpack/loader-utils/releases)
- [Changelog](https://github.com/webpack/loader-utils/blob/v2.0.4/CHANGELOG.md)
- [Commits](https://github.com/webpack/loader-utils/compare/v2.0.2...v2.0.4)

---
updated-dependencies:
- dependency-name: loader-utils
  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-11-18 11:57:42 +02:00
Suneet Tipirneni
a1869a6a6d feat(GuildFeatures): Add APPLICATION_COMMAND_PERMISSIONS_V2 (#646)
* feat(GuildFeature): add APPLICATION_COMMAND_PERMISSIONS_V2

* chore: fix links
2022-11-18 11:55:57 +02:00
github-actions[bot]
5aa4c28635 chore(release): 0.37.18 🎉 (#642)
Build ran for 65da837673

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-14 18:29:36 +02:00
Almeida
65da837673 feat(UserFlags): add ActiveDeveloper (#638) 2022-11-10 22:30:28 +02:00
github-actions[bot]
5e854245e1 chore(release): 0.37.17 🎉 (#635)
Build ran for 67ecd76d3e

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-11-07 14:28:29 +02:00
MateoDeveloper
67ecd76d3e docs: add limits for tags in forums (#614) 2022-11-05 11:18:16 +02:00
Vitor
88a60f78ef feat(APIAutoMod): add support for regex matching (#603) 2022-11-05 11:17:19 +02:00
Almeida
0858b7c70a docs: remove ~ (#633) 2022-11-02 09:06:54 +02:00
github-actions[bot]
cf80b2fa6b chore(release): 0.37.16 🎉 (#629)
Build ran for 7040d9b333

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-10-31 14:38:42 +02:00
Almeida
7040d9b333 fix(docs): update gateway documentation links (#628) 2022-10-30 15:37:27 +02:00
Almeida
5091f6e707 fix(UserFlags): hardcode the value of Quarantined (#624) 2022-10-29 16:20:27 +03:00
Vlad Frangu
69aa717902 fix: export RESTGetAPIVoiceRegionsResult with the correct name (#627) 2022-10-29 16:19:46 +03:00
Jiralite
c15106b424 refactor(RESTGetAPICurrentUserGuildsQuery): Update guild limit (#626) 2022-10-28 20:01:53 +03:00
github-actions[bot]
a1ab25db1f chore(release): 0.37.15 🎉 (#623)
Build ran for 9448e9befd

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-10-27 21:19:01 +03:00
MateoDeveloper
9448e9befd feat(UserPremiumType): add NitroBasic (#616) 2022-10-27 21:16:12 +03:00
john-batch
348dd416d1 fix: add missing gateway dispatch payloads to gateway event union (#619) 2022-10-27 18:16:05 +00:00
MateoDeveloper
aaa57b4fe9 fix(APIGuild): change type of afk_timeout to allowed values (#590) 2022-10-22 23:12:08 +03:00
advaith
88ce2910fb fix: default_thread_rate_limit_per_user is only for forum channels (#596) 2022-10-22 21:50:58 +03:00
Vitor
131637fbd2 feat(RESTJSONErrorCodes): add 50039 error (#607) 2022-10-22 21:44:52 +03:00
Vitor
8c1484ebbe feat(GuildFeature): add DeveloperSupportServer (#618) 2022-10-21 20:05:15 +03:00
Almeida
8d25f233a5 feat: add some missing REST types (#612) 2022-10-21 00:54:10 +03:00
advaith
df1452dc28 feat(Components): new select menus (#602)
Co-authored-by: Almeida <almeidx@pm.me>
2022-10-21 00:53:14 +03:00
advaith
5053ac30d9 docs(ChannelType): publicthreads can be in forum channels (#610) 2022-10-18 07:01:06 +03:00
Vlad Frangu
91a7762b5d chore: fix placeholder being too large 2022-10-15 12:14:26 +03:00
Vlad Frangu
f311574d1f chore(GitHub): flashy new issue templates (#601) 2022-10-15 12:11:54 +03:00
github-actions[bot]
e082afb93f chore(release): 0.37.14 🎉 (#609)
Build ran for bce07950fd

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-10-15 11:31:31 +03:00
Suneet Tipirneni
bce07950fd fix(APIAutoModeration): export v10 json payloads and correct route types (#608) 2022-10-15 11:27:34 +03:00
Almeida
70826ed76e feat(RESTJSONErrorCodes): add error 50073 (#594) 2022-10-15 11:25:57 +03:00
github-actions[bot]
9978b77ef2 chore(release): 0.37.13 🎉 (#606)
Build ran for 3696ce7805

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-10-14 22:01:14 +03:00
Jiralite
3696ce7805 refactor(APIAuditLogOptions): Use AuditLogRuleTriggerType for auto_moderation_rule_trigger_type (#605) 2022-10-14 17:32:49 +00:00
Vitor
b216f7a8be feat(APIAutoModeration): add support for auto moderation (#418) 2022-10-14 19:56:21 +03:00
dependabot[bot]
05cfe1bf96 chore(deps): bump vm2 from 3.9.9 to 3.9.11 (#593)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-13 22:29:18 +03:00
github-actions[bot]
5ffb2d3586 chore(release): 0.37.12 🎉 (#598)
Build ran for f62f2506b0

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-10-06 15:30:56 +03:00
Almeida
f62f2506b0 refactor(FormattingPatterns): update SlashCommand pattern (#597) 2022-10-06 12:18:06 +00:00
github-actions[bot]
2876125975 chore(release): 0.37.11 🎉 (#591)
Build ran for 143b003fbe

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* feat: add 50138

* feat: add 40043

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

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

* feat: add `epicgames`

* feat: add old connections

* refactor: capitalization

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

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

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

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

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

* fix: change to Math.pow()

* chore: add @unstable

* fix: improvements to @unstable

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

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

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

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

* docs: update from upstream

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

* fix: actually make the changelog generation work

* chore: cleanup

* chore: safety

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

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

* fix: add github token to branch creation

* fix: actually patch the module on install

* chore: cleanup some more of the PR

* chore: make the script more agnostic

* chore: cleanup package-lock

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

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

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

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

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

* refactor(RESTPostAPIGuildForumThreadsJSONBody): add `message` field

* chore: branch issues fix

* fix: unnecessary type & correct `message` type

* fix: use json body instead of form data

* feat: update also form data

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

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

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

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

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

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

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

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

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

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

[1]: https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-field-requirements-by-entity-type
2021-12-26 16:56:43 +02:00
Almeida
9f4f59c8e5 feat(ApplicationFlags): add embedded application flags (#277)
While Discord considers it not relevant, invites for in-app applications use at least one of these flags. Reference PR: https://github.com/discord/discord-api-docs/pull/4248
2021-12-25 14:30:10 +02:00
Vlad Frangu
cd580fa2c6 chore(release): 0.26.0 🎉 (#276) 2021-12-24 17:31:30 +02:00
Vlad Frangu
c20e5ae2a9 chore: bring in support for TS 4.5's exactOptionalPropertyTypes (#275)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-12-24 17:08:58 +02:00
Vlad Frangu
7fe78cec25 chore: cleanup chat input options (#274) 2021-12-24 15:37:08 +02:00
Jiralite
bfc5e46f53 feat: Add API error code 50109 (#268)
* feat: add API error

* refactor: elongate error name
2021-12-23 10:44:42 +02:00
Suneet Tipirneni
8bbb81942b types: make application command option union easier to use (#250) 2021-12-22 20:19:45 +02:00
Bryce Roethel
46db72da2f fix(GatewayStageInstance): Stage Instance dispatches not included in GatewayDispatchPayload (#267) 2021-12-21 14:37:35 +02:00
Suneet Tipirneni
0bbc9721f6 feat(APIGuildMember): add guild timeouts (#235) 2021-12-21 14:32:54 +02:00
Jiralite
7eee39d86c fix(StickerPack): Optional banner_asset_id (#270)
BREAKING CHANGE: `banner_asset_id` is now optional. Reference PR: https://github.com/discord/discord-api-docs/pull/4245
2021-12-16 20:20:20 +02:00
Suneet Tipirneni
2c72242a03 feat(GatewayThreadMemberUpdateDispatchData): add guild_id extra field (#266) 2021-12-14 21:26:46 +02:00
Cynthia
7ab780b3ae fix: only a partial object is needed when updating attachments (#263) 2021-12-13 11:08:39 +02:00
Marvin Witt
315ce35849 fix(NonDispatchPayload): t & s fields are always null on non-dispatch payloads (#259) 2021-12-08 15:16:31 +02:00
Advaith
c67d426e3d fix(APIInvite): channel can be null (#182)
BREAKING CHANGE: this marks the channel property of invites as possibly null
2021-12-07 22:57:28 +02:00
Suneet Tipirneni
e9d02a19fc feat: add support for user guild member read oauth2 scope and route (#254) 2021-12-07 22:25:50 +02:00
Suneet Tipirneni
9e619fc460 feat(RESTJSONErrorCodes): add error 20029 (#257) 2021-12-07 19:26:01 +02:00
Jiralite
b01716bf22 feat: Add API error code 50055 (#256) 2021-12-07 01:29:36 +02:00
Suneet Tipirneni
c7efcd5505 feat(APIAuditLog): add guild_scheduled_events prop (#251) 2021-12-01 10:17:08 +02:00
Vlad Frangu
52c91f8f73 chore(release): 0.25.2 🎉 (#249) 2021-11-30 22:28:16 +02:00
Suneet Tipirneni
47382b6183 feat(Guild): boost progress bars (#227)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
2021-11-30 21:12:26 +02:00
PikaDude
51dee6e0e5 fix(APISelectMenuComponent): options property is required (#248) 2021-11-30 20:11:44 +02:00
Vlad Frangu
3ff85eede4 chore(release): 0.25.1 🎉 (#246) 2021-11-30 13:15:45 +02:00
Kot
44c0f05cb2 fix(deno): faulty import paths for guild scheduled events (#245) 2021-11-30 12:11:41 +02:00
Vlad Frangu
68d5c08c93 chore(release): 0.25.0 🎉 (#244) 2021-11-29 12:50:19 +02:00
Shubham Parihar
d333962715 feat: add guild scheduled event (#186)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-11-25 15:15:05 +02:00
Almeida
f2d62e3cdf refactor(UserFlags): update flag names (#229)
BREAKING CHANGE: All user flags now follow the internal name, with descriptions added for what they represent. This means you'll have to do some minor renaming in your code if you check for flags.
2021-11-24 16:59:51 +02:00
Suneet Tipirneni
faa8bf494b fix(APIApplicationCommandOption): remove default property (#242)
BREAKING CHANGE: If you were using the `default` property for ApplicationCommandOptions, it has been removed, as Discord wasn't even taking it into account anymore.
2021-11-22 21:20:24 +02:00
GC
7379a345e8 fix: make subcommand options optional (#241) 2021-11-19 19:19:28 +02:00
GC
fa54b9de55 fix: correct types for REST attachments (#238) 2021-11-17 18:38:43 +02:00
Suneet Tipirneni
1e52e0ceab feat(RESTPostAPIChannelThreadsJSONBody): add rate_limit_per_user (#237) 2021-11-15 21:46:04 +02:00
Suneet Tipirneni
691abb581f fix: correct types for autocomplete interaction data (#234)
BREAKING CHANGE: The types for autocomplete interactions have been corrected.
2021-11-09 22:40:26 +02:00
Jupith
7a15c97863 feat: add maze api error (#228)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-11-06 01:52:50 +02:00
Suneet Tipirneni
bc1d03e527 feat: add max/min option for number-based options (#221) 2021-11-02 17:12:18 +02:00
Almeida
0f51d8e83f feat(ActivityFlags): add new flags (#207)
ref: https://github.com/discord/discord-api-docs/pull/3877
2021-11-02 14:57:48 +02:00
Almeida
4021dae44b feat(GuildSystemChannelFlags): add suppress member join sticker replies flag (#222) 2021-11-02 14:56:34 +02:00
Advaith
d189e36c49 feat(ApplicationFlags): add message content intent flags (#226) 2021-11-02 14:54:14 +02:00
Almeida
a015f96fcb feat(UserFlags): add BOT_HTTP_INTERACTIONS flag (#212) 2021-11-02 14:53:14 +02:00
Suneet Tipirneni
3b9320dbf2 feat(Interactions): add autocomplete api types (#205) 2021-10-29 16:02:42 +03:00
Advaith
fdf133ef45 feat(Attachments): multi uploads and alt text (#223) 2021-10-29 11:59:07 +03:00
Suneet Tipirneni
7c36a6cdf3 docs: update docs for thread members route (#225) 2021-10-29 11:56:30 +03:00
Vlad Frangu
a507765bba chore(release): 0.24.0 🎉 (#220) 2021-10-17 00:06:25 +03:00
Matt (IPv4) Cowley
9dd3446b64 feat(Routes): add missing OAuth2 routes (#218) 2021-10-10 01:55:18 +03:00
Advaith
24f658de38 chore(GuildFeature): sort guild features (#216) 2021-10-07 13:49:09 +03:00
Shubham Parihar
329451c6c9 chore(APIRole): make icon and unicode_emoji nullable (#217) 2021-10-06 22:01:41 +03:00
Almeida
7db69531d8 refactor(APIVoiceRegion): removed vip property (#214)
BREAKING CHANGE: The `vip` property has been removed.
2021-10-05 11:29:17 +03:00
Suneet Tipirneni
77396b557c feat(APIApplicationCommand): add channel_types field to channel options (#198) 2021-10-03 16:18:45 +03:00
Suneet Tipirneni
0331518c49 feat(APIGuildMember): add per guild avatars (#208)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-10-03 16:15:19 +03:00
Suneet Tipirneni
64e4e5246c feat(InteractionResolvedChannels): add parent_id and thread_metadata fields to resolved channels (#210) 2021-10-02 14:30:02 +02:00
Suneet Tipirneni
b453d75e4d feat(RESTJSONErrorCodes): add error 50101 (#202) 2021-10-02 14:26:31 +02:00
Suneet Tipirneni
1076822b90 feat(APIRole): add role icons (#204)
* feat: add role icons

* Apply suggestions from code review

Co-authored-by: Antonio Román <kyradiscord@gmail.com>

* fix: make requested changes

* chore: update descriptions

Co-authored-by: Antonio Román <kyradiscord@gmail.com>
2021-10-01 08:29:47 +02:00
Shubham Parihar
0c592a0950 fix(APISelectMenuComponenet): make options field optional (#209) 2021-09-29 18:20:56 +02:00
Advaith
68d97aed14 feat(PermissionFlagBits): update thread permissions (#181) 2021-09-21 16:14:43 +03:00
Suneet Tipirneni
a787426082 chore: make git hooks executable (#203) 2021-09-20 19:33:12 +03:00
Shubham Parihar
2aee879600 feat(APIAttachment): add ephemeral field (#199) 2021-09-17 17:21:08 +03:00
Advaith
4bbe1eaa86 feat(PermissionFlagsBits): add StartEmbeddedActivities (#197) 2021-09-15 09:57:47 +03:00
Vlad Frangu
6f6e6daccd chore(release): 0.23.1 🎉 (#196) 2021-09-08 14:08:17 +03:00
Khasms
43cc755e33 fix(RESTPostAPIBaseApplicationCommandsJSONBody): omit version field (#195)
Co-authored-by: Keenser1 <36800359+Keenser1@users.noreply.github.com>
2021-09-07 21:16:01 +03:00
Vlad Frangu
21e1148f2d chore(release): 0.23.0 🎉 (#194) 2021-09-07 17:41:34 +03:00
Vlad Frangu
8b49887c7f feat(JSONErrorCodes): add 160002 (#190)
ref: https://github.com/discord/discord-api-docs/pull/3738
2021-09-07 12:57:06 +03:00
Vlad Frangu
d590caf359 chore(Gateway): remove APPLICATION_COMMAND_* events (#191)
BREAKING CHANGE: The three Application Command events have been removed
2021-09-07 12:56:43 +03:00
Vlad Frangu
ecbed18042 feat(APIApplicationCommand): add version field (#193)
ref: https://github.com/discord/discord-api-docs/pull/3524
2021-09-07 12:56:34 +03:00
Vlad Frangu
e628f0f6f0 fix(Embed): corrent certain optional types as being required (#192)
BREAKING CHANGE:
- `APIEmbedAuthor#name` is required, not optional
- `APIEmbedThumbnail#url` is required, not optional
- `APIEmbedImage#url` is required, not optional
2021-09-07 12:56:14 +03:00
Advaith
0024823d05 feat(MessageType): add ContextMenuCommand and rename ApplicationCommand to ChatInputCommand (#180) 2021-09-05 19:41:15 +03:00
Jiralite
64937e2311 fix(AuditLog): correct nickname type (#189)
* fix(auditLog): Correct nickname type

* something something deno

* chore: Apply fix to v8
2021-08-30 12:31:56 +02:00
Jiralite
f2e22869d0 chore: Update invite link (#188) 2021-08-25 07:41:30 +02:00
Advaith
b6babf2ee2 feat(threads): add invitable (#185) 2021-08-22 11:32:31 +02:00
Advaith
f2b58acbf8 chore: add missing json error codes (#184) 2021-08-22 02:33:04 +02:00
Advaith
b07b9030c1 feat(APIUser): add banner and accent_color (#183)
* feat(APIUser): add `banner` and `accent_color`

* chore: v8
2021-08-22 02:31:02 +02:00
Advaith
fdc1c1a5b4 feat(Interactions): context menu items (#166) 2021-08-14 19:58:34 +02:00
Arcoz
8fcd0f2222 fix: import causing error 404 on deno (#178) 2021-08-07 09:53:10 +02:00
Vlad Frangu
5723cc04bf chore(release): 0.22.0 🎉 (#177) 2021-08-01 00:51:03 +03:00
Vlad Frangu
f93b6be252 chore(ApplicationCommandOptionType): casing changes for subcommands (#175)
BREAKING CHANGE: This renames `SubCommand` to `Subcommand`, and `SubCommandGroup` to `SubcommandGroup`
2021-08-01 00:48:14 +03:00
Vlad Frangu
b75b05f0d5 fix(MessageComponent): correct type for emoji (#176) 2021-08-01 00:47:15 +03:00
Advaith
47100bcf2c feat: thread updates (#167)
* feat: thread updates

* feat: update Routes

BREAKING CHANGE: `Routes#channelJoinedArchivedThreads` is now spelled right (from `Routes#channelJoinedArhivedThreads`)
2021-07-31 23:54:06 +03:00
ckohen
a93235c9df fix(Gateway): thread list sync now sends an array as documented (#174)
BREAKING CHANGE: `GatewayThreadListSync#members` is now an array of APIThreadMember instead of a Record of GatewayThreadListSyncMember
2021-07-31 23:52:27 +03:00
Vlad Frangu
b1589545e9 chore(release): 0.21.0 🎉 (#173) 2021-07-31 02:14:54 +03:00
Vlad Frangu
647905e16b revert: fix: change resolved index types to string (#172)
This reverts commit d338409410.
2021-07-31 02:10:57 +03:00
Noel
f2995073e0 feat(Globals): revert template bigint type to string type (#171)
BREAKING CHANGE: The type for Snowflake and Permissions is reverted from the `${bigint}` template type back to a normal string type
2021-07-31 02:05:50 +03:00
Advaith
6f15e537df feat(ApplicationCommandOptionType): add Number (10) (#153) 2021-07-26 22:12:54 +03:00
Advaith
d338409410 fix: change resolved index types to string (#169) 2021-07-26 22:12:35 +03:00
Advaith
ef2a0aeb07 fix: export APIPingInteraction (#168) 2021-07-26 08:49:31 +03:00
Vlad Frangu
ab1951b7b9 chore(release): 0.20.2 🎉 (#165) 2021-07-21 12:57:08 +03:00
Vlad Frangu
ff75eb3f5d fix(APIInteraction): bring back Ping type (#164)
* fix(APIInteraction): bring back Ping type

* fix(APIPingInteraction): there be no data here!
2021-07-21 12:52:28 +03:00
Vlad Frangu
f0f44e6db4 chore(release): 0.20.1 🎉 (#163) 2021-07-20 14:52:22 +03:00
Advaith
f99f07f72e feat(Interactions): add interaction response and followup route (#162) 2021-07-20 14:04:09 +03:00
Vlad Frangu
b9d61aed90 chore(release): 0.20.0 🎉 (#161) 2021-07-20 10:33:35 +03:00
Advaith
d009554cae chore: Add more missing stuff (#160)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

BREAKING CHANGE: `GatewayGuildMemberUpdateDispatchData#joined_at` is properly marked as nullable now

BREAKING CHANGE: In v9, `thread_id` was incorrectly placed in `RESTPostAPIWebhookWithTokenJSONBody` and has been moved to `RESTPostAPIWebhookWithTokenQuery`
2021-07-20 10:25:51 +03:00
Advaith
8dbeca0fc9 feat(RESTJSONErrorCodes): add sticker errors (#155)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-07-20 01:46:12 +03:00
Advaith
5dccc6b2a3 feat(PermissionFlagsBits): add UseExternalStickers (1n << 37n) (#154) 2021-07-20 01:29:03 +03:00
Antonio Román
323e531a77 refactor: change xID to xId (#159)
BREAKING CHANGE: All types that contained the `ID` word in them have had it renamed to `Id` (ex: `APIButtonComponentWithCustomID` is now `APIButtonComponentWithCustomId`)
2021-07-20 01:17:39 +03:00
Advaith
634f64d4ce refactor: rename isStyledButton to isInteractionButton (#158)
BREAKING CHANGE: The `isStyledButton` util has been renamed to `isInteractionButton`
2021-07-20 00:43:48 +03:00
Vlad Frangu
ecaf52008b chore(release): 0.19.0 🎉 (#157) 2021-07-19 22:10:57 +03:00
Vlad Frangu
86e0736726 chore: Get up to date *again* (#156)
Co-authored-by: monbrey <rsm999@uowmail.edu.au>

* Added `DiscordCertifiedModerator` flag to UserFlags

* Updated types for Message Components
  * Added `disabled` to APISelectMenuCompponent
  * Cleaned up Buttons types, making them stricter based on the `style` you provide

BREAKING CHANGE: `APISelectOption` has been renamed to `APISelectMenuOption`

BREAKING CHANGE: APISelectMenuOption#default is now properly marked as optional

* Updated OAuth2 Application types

BREAKING CHANGE: `APIApplication#owner` is now marked as optional, per the docs

* Correct APIAuditLogChangeKeyNick's key

BREAKING CHANGE: This renames APIAuditLogChangeKeyNick's key from `mute` to `nick`

* Add `application_id` to APIMessage
* Correct type of `id` and `user_id` in APIThreadMember

BREAKING CHANGE: The type of `id` and `user_id` in APIThreadMember are now marked as optional; read the TSDoc for when it's actually optional

* Correctly version API route in RouteBases

BREAKING CHANGE: This changes the `RouteBases.api` to be versioned based on the API version you're importing. **Make sure to update your code to handle that**

* Added new guild features
ref: 4d36e533cf

* Cleaned up interaction types

BREAKING CHANGE: While this shouldn't be necessary, this is a warning that types for interactions HAVE changed and you may need to update your code. For the most part, the types *should* be the same, more accurate and strictly typed. You will also see that every type of interaction has a Guild/DM counterpart exported (ex: APIApplicationCommandGuildInteraction vs APIApplicationCommandInteraction, where the former has all the guild properties, while the latter has all properties that depend on context marked as optional).

* Add TSD testing support in CI
This is mostly useful for testing unions of types

* Add message property to MessageComponent interactions
2021-07-19 22:00:20 +03:00
모메MoMe
ca933ae84d fix(RESTPostAPIWebhookWithTokenJSONBody): add missing components (#152) 2021-07-18 18:51:25 +03:00
Advaith
4a836293d5 feat(Stickers): sticker packs, sticker routes, and guild stickers (#145)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-07-07 17:07:32 +03:00
Shubham Parihar
836e8fb294 feat: add stage instance related typings to audit logs (#151) 2021-07-03 20:25:45 +03:00
Vlad Frangu
c5b6091c43 chore: deprecate old @next versions (#150) 2021-07-03 17:55:04 +03:00
Shubham Parihar
5256ac7f97 feat(APIGuild): add nsfw_level (#149) 2021-07-03 16:46:45 +03:00
ckohen
f393ba520d feat(Threads): add typed thread creation (#148)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-06-24 12:30:56 +03:00
Shubham Parihar
e36ef9e1d2 feat: add typings for stage instance (#144) 2021-06-24 12:12:03 +03:00
ckohen
dd12c6ac99 fix(FormattingPatterns): fix StyledTimestamp (#147) 2021-06-24 12:09:22 +03:00
monbrey
036bb035c9 feat(Interactions): components and component interactions (#132)
Co-authored-by: nearlySplat <splatterxl@outlook.ie>
Co-authored-by: Advaith <advaithj1@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-06-19 21:18:10 +03:00
ckohen
16eae7eafe feat(FormattingPatterns): add timestamp (#146)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-06-19 21:15:10 +03:00
ckohen
13d483ef2e feat(Channel): add embeds to post / patch (#143)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-06-16 01:51:43 +03:00
ckohen
d2b6276119 feat(Threads): add default auto archive and minor tweaks (#142) 2021-06-15 15:36:39 +03:00
Vlad Frangu
8627c9d219 fix: fix autopublish CD (#140) 2021-06-05 16:09:13 +03:00
Vlad Frangu
72043a2645 chore: add automatic npm deploys (#139) 2021-06-05 15:29:16 +03:00
ckohen
d1498c3ce2 feat: api v9 and threads (#133)
* feat: api v9 and threads

* fix: address review comments
2021-06-02 10:06:40 +03:00
Carter
7b47fc9680 feat(RESTErrors): add types for rest errors (#122)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-05-26 00:14:56 +03:00
Vlad Frangu
c4e69c9ce3 chore: don't install huskies in CI 2021-05-26 00:13:36 +03:00
Vlad Frangu
ca6612e0a4 chore(RESTErrorCodes): correct casing for OAuth
BREAKING CHANGE: This properly capitalizes certain error codes with the right OAuth capitalization
2021-05-22 16:25:41 +03:00
Vlad Frangu
63e5e8b7ab chore: update all the deps
build: deno build for 8111146265bbfe527daabfe852292d9c0803d8be
2021-05-22 13:54:42 +03:00
Vlad Frangu
8fdf8c4453 chore(Husky): update to Husky v6 (#135) 2021-05-22 13:43:52 +03:00
Vlad Frangu
f0b2766d5b fix(RESTOAuth2): correct casing of OAuth (#134)
BREAKING CHANGE: `RESTGetAPIOauth2CurrentApplicationResult` and `RESTGetAPIOauth2CurrentAuthorizationResult` have been renamed to `RESTGetAPIOAuth2CurrentApplicationResult ` and `RESTGetAPIOAuth2CurrentAuthorizationResult`, to correct the casing of `OAuth`

build: deno build for 03c88f5a49ba74ea87a35efb27cb75c2e4d0aa44

chore: fix Actions

build: deno build for d5a7b8d8ceee1530f941da7c1e2d6281cf1ea3ba
2021-05-22 13:07:24 +03:00
Jan
aa5e26d92b refactor(Enums): make property casing consistent (#131)
BREAKING CHANGE: Enum keys have been normalized, and they are all PascalCased now (for API v8 and above). API v6 did not receive these changes.
2021-05-11 23:58:27 +03:00
Vlad Frangu
557b969f35 chore(release): 0.18.1 🎉 (#130) 2021-05-03 23:34:40 +03:00
Jan
bd638b97e5 feat: add new interfaces for interaction-related structures (#129) 2021-05-03 23:19:17 +03:00
Advaith
44b956ad85 fix(APIInvite): expires_at is nullable (#128) 2021-04-30 19:58:16 +03:00
Advaith
82ca0ce5c4 feat(APIInvite): add expires_at field and with_expiration param (#127) 2021-04-30 19:32:24 +03:00
Advaith
91afb0bb49 feat(ApplicationCommandOptionType): add MENTIONABLE (9) (#126) 2021-04-28 20:42:22 +03:00
Vlad Frangu
653b9ff17f chore(release): 0.18.0 🎉 (#125) 2021-04-18 11:03:16 +03:00
Advaith
bc9ab4556c refactor(Invite): rename InviteTargetUserType to InviteTargetType (#124)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

BREAKING CHANGE: `InviteTargetUserType` is renamed to `InviteTargetType`, to match the documentation.
  - Reference: https://github.com/discord/discord-api-docs/pull/2690
2021-04-18 10:34:51 +03:00
Advaith
abe05136fd fix(APIInvite): channel is not optional (#123)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-04-18 10:33:32 +03:00
Vlad Frangu
d6fb271df8 chore(release): 0.17.0 🎉 (#121) 2021-04-17 18:48:20 +03:00
Jan
3294fb15ae feat(WebhookMessage): add GET route types (#120)
- Reference: https://github.com/discord/discord-api-docs/pull/2812
2021-04-16 00:48:22 +03:00
Jan
9817623291 refactor(APISticker): remove preview_asset (#119)
BREAKING CHANGE: This removes the `preview_asset` property from sticket objects
  - Reference: https://github.com/discord/discord-api-docs/commit/b9b8db2
2021-04-15 17:59:30 +03:00
Jan
617f507427 fix(APIChannel): rtc_region is optional (#118)
BREAKING CHANGE: This corrects the fact that `rtc_region` isn't present on non-voice-like channels
2021-04-15 17:47:07 +03:00
Vlad Frangu
df09356edd chore(release): 0.16.0 🎉 (#117) 2021-04-14 20:44:47 +03:00
Vlad Frangu
21b572b7f2 feat(Guild): add nsfw property (#116) 2021-04-14 19:39:34 +03:00
Vlad Frangu
6451679c9a docs(Routes): add GET route to webhookMessage (#114) 2021-04-14 19:39:23 +03:00
Vlad Frangu
ced37d0a5e feat(RESTJSONErrorCode): add UnknownInteraction error code (#115) 2021-04-14 19:39:12 +03:00
Vlad Frangu
a95f40e5b8 fix(TypeScript): imports not working in TypeScript (#113) 2021-04-12 12:01:37 +03:00
Vlad Frangu
75f902b0f5 chore(release): 0.15.0 🎉 (#112)
* chore(release): 0.15.0 🎉

* fix(Scripts): `await` in `versions` script, log any errors from deno one

* chore(Changelog): update changelog
2021-04-11 23:29:03 +03:00
Jan
9420c3e0af fix(APIApplicationCommand): default_permission (#111)
BREAKING CHANGE: This renames the `default_permissions` property to `default_permission`, the correct spelling.
2021-04-11 23:08:13 +03:00
Vlad Frangu
24d8037c47 feat(*): Polish Week - Discord API Types Edition (#110)
Co-authored-by: Antonio Román <kyradiscord@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-04-11 21:45:23 +03:00
Advaith
07ba907242 feat(APIChannel): add rtc_region (#108)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-04-09 13:18:32 +03:00
Advaith
b90714f677 feat: invite reminder system message type and flag (#105)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-04-08 14:15:12 +03:00
Vlad Frangu
6cd75426c6 feat: stage channels! (#107) 2021-04-08 14:14:31 +03:00
Advaith
d8d7bccea6 feat(APIChannel): add video_quality_mode (#106)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-04-08 14:09:47 +03:00
Advaith
4462255168 feat(MessageFlags): EPHEMERAL desc and added LOADING (#109)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-04-08 14:09:01 +03:00
Vlad Frangu
679a5cfd77 chore: fix globs (#104) 2021-03-28 15:19:43 +03:00
Vlad Frangu
fc4b7e2708 chore: release 0.13.2 (#103) 2021-03-28 12:56:01 +03:00
Tiemen
15c171c558 fix(ApplicationCommandInteractionDataOptionSubCommandGroup): typo (#102)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-03-28 12:48:01 +03:00
Vlad Frangu
ebd5754242 chore: release 0.13.1 (#101) 2021-03-28 00:43:10 +02:00
Advaith
ffcd95d597 fix(APIInteractionResponse): data should not always be present (#100)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-03-28 00:40:52 +02:00
Vlad Frangu
2636bd0949 chore: release 0.13.0 (#99) 2021-03-27 18:15:41 +02:00
Advaith
ceb787ba36 feat(PermissionFlagsBits): add USE_APPLICATION_COMMANDS (#85)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-03-27 18:09:47 +02:00
Ben Richeson
ca61396577 chore(APIApplicationCommandInteractionDataOption): add types and their values (#72)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-03-27 18:06:35 +02:00
Advaith
0582f883c5 feat(APIBaseInteraction): add application_id (#98)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-03-27 17:40:14 +02:00
didinele
9d8d090c9c fix(RESTPostAPIChannelMessageJSONBody): mark tts as a full boolean (#96) 2021-03-17 10:02:14 +02:00
Vlad Frangu
eb3f8e1dea chore: add missing GitHub mds (#95) 2021-03-17 01:04:10 +02:00
Advaith
24155aeb71 feat(APIApplicationCommandInteractionData): add resolved (#86)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-03-16 01:05:44 +02:00
Advaith
76651acd49 chore(APIInteractionResponse, APIInteractionResponseType): remove old response types (#94)
Because they're out :3

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-03-16 01:03:32 +02:00
Advaith
92f76f1a3c feat(APIApplication): add ApplicationFlags (#92)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-03-16 01:01:30 +02:00
Advaith
0f29b32e05 feat(APIMessage): add interaction (#93)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-03-16 01:00:04 +02:00
Apacheopteryx
7343fabe82 fix(deno): replace const enum exports in deno with normal enums (#89)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-03-16 00:56:02 +02:00
Advaith
d0b3106758 feat(APIInteraction): DM slash commands and property descriptions (#84)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-03-16 00:50:46 +02:00
Advaith
eafe7ba96f feat(APIInteractionResponse, APIInteractionResponseType): update for UI changes (#90) 2021-03-08 00:06:12 +02:00
Vlad Frangu
ff761755a6 chore: miscellaneous tasks (#77)
Co-authored-by: Noel <buechler.noel@outlook.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-02-18 19:20:46 +01:00
cherryblossom000
ae1900dc2f fix(RESTPostAPIGuildsJSONBody): make some fields nullable (#91) 2021-02-17 12:46:46 +02:00
didinele
466fa95b0e feat(rest): api base routes (#87)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-02-13 01:05:13 +02:00
aetheryx
70bfe9f4aa chore(Gateway): clarify Heartbeat OP as bidirectional (#83) 2021-02-06 19:01:58 +02:00
Vlad Frangu
63096d807d chore: add missing audit log keys (#81)
ref: https://github.com/discord/discord-api-docs/pull/2570
2021-02-05 22:29:00 +02:00
Advaith
855f36d930 feat(APIMessageReferenceSend): add fail_if_not_exists (#82) 2021-02-04 21:44:11 +02:00
Vlad Frangu
3bf9738a72 chore: shorten regular expression group properties (#80)
They are now strictly `id`, `name`, or `animated`.
2021-02-03 00:47:20 +02:00
Carter
4e4a084003 feat: implement FormatPatterns (#79)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2021-02-03 00:25:59 +02:00
TTtie
75ed123018 chore(APIGuildMember): make premium_since not optional (#78) 2021-01-29 23:28:35 +02:00
Vlad Frangu
5826da22e3 feat: add GET single Application Command (#76) 2021-01-26 23:47:37 +02:00
Vlad Frangu
da2c2e9ada feat: add Application Command events (#75) 2021-01-26 23:47:24 +02:00
Advaith
4c77a5d90a feat(Webhook): add Edit Webhook Message result and error 50027 (#71) 2021-01-26 21:59:23 +02:00
Advaith
84759d19bc feat(OAuth2): add /oauth2/@me route (#73) 2021-01-21 22:02:59 +02:00
Vlad Frangu
999b3594d8 chore: release 0.12.1 (#70)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2021-01-05 10:41:23 +02:00
Advaith
549a6f0236 feat: add Snowflake and Permissions types (#69)
Nice.
2021-01-05 02:54:11 +02:00
Vlad Frangu
35bd1f7dcd chore: move deno path from .deno to deno; update readme (#67) 2021-01-04 15:54:37 +02:00
Vlad Frangu
0ef46202f6 fix: run deno workflow only on branch push (#66) 2021-01-02 00:09:14 +02:00
670 changed files with 135687 additions and 11748 deletions

View File

@@ -1,102 +0,0 @@
<div style="text-align:center;"><h1>Discord API Types</h1></div>
[![GitHub](https://img.shields.io/github/license/discordjs/discord-api-types)](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
[![npm](https://img.shields.io/npm/v/discord-api-types?color=crimson&logo=npm)](https://www.npmjs.com/package/discord-api-types)
[![Patreon Donate](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Donate%20with%20Patreon&logo=patreon&colorB=F96854&link=https://www.patreon.com/vladfrangu)](https://www.patreon.com/vladfrangu)
[![Ko-fi Donate](https://img.shields.io/badge/kofi-donate-brightgreen.svg?label=Donate%20with%20Ko-fi&logo=ko-fi&colorB=F16061&link=https://ko-fi.com/wolfgalvlad&logoColor=FFFFFF)](https://ko-fi.com/wolfgalvlad)
Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro).
## Installation
Install with [npm](https://www.npmjs.com/) / [yarn](https://yarnpkg.com) / [pnpm](https://pnpm.js.org/):
```sh
npm install discord-api-types
yarn add discord-api-types
pnpm add discord-api-types
```
We also provide typings compatible with the [deno](https://deno.land/) runtime. You have 3 ways you can import them:
1. Directly from GitHub
```ts
// Importing the default API version
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/.deno/mod.ts';
// Importing a specific API version
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/.deno/v8/mod.ts';
```
2. From [deno.land/x](https://deno.land/x)
```ts
// Importing the default API version
import { APIUser } from 'https://deno.land/x/discord_api_types@0.12.0/mod.ts';
// Importing a specific API version
import { APIUser } from 'https://deno.land/x/discord_api_types@0.12.0/v8/mod.ts';
```
3. From [skypack.dev](https://www.skypack.dev/)
```ts
// Importing the default API version
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types?dts';
// Importing a specific API version
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v8?dts';
```
## Project Structure
The exports of each API version is split into three main parts:
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `common` directory. They will still be prefixed accordingly as described above.
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means _and have received the green light to be used_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will NOT be included.
## Usage
You can `require` / `import` the module directly, which will give you the latest types as of the current API version. This is considered the `default` version and will be updated according to Discord's default API version; this means it may break at any point in time.
> We **strongly recommend** you use a version when importing this module! This will prevent breaking changes when updating the module.
```js
const { APIUser } = require('discord-api-types');
```
```ts
// TypeScript/ES Module support
import { APIUser } from 'discord-api-types';
```
You should instead consider adding the API version you want to target by appending `/v*`, where the `*` represents the API version.
```js
const { APIUser } = require('discord-api-types/v8');
```
```ts
// TypeScript/ES Module support
import { APIUser } from 'discord-api-types/v8';
```

View File

@@ -1,149 +0,0 @@
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes
*/
export const enum RESTJSONErrorCodes {
GeneralError,
UnknownAccount = 10001,
UnknownApplication,
UnknownChannel,
UnknownGuild,
UnknownIntegration,
UnknownInvite,
UnknownMember,
UnknownMessage,
UnknownPermissionOverwrite,
UnknownProvider,
UnknownRole,
UnknownToken,
UnknownUser,
UnknownEmoji,
UnknownWebhook,
UnknownBan = 10026,
UnknownSKU,
UnknownStoreListing,
UnknownEntitlement,
UnknownBuild,
UnknownLobby,
UnknownBranch,
UnknownRedistributable = 10036,
BotsCannotUseThisEndpoint = 20001,
OnlyBotsCanUseThisEndpoint,
AnnouncementEditLimitExceeded = 20022,
ChannelSendRateLimit = 20028,
MaximumNumberOfGuildsReached = 30001,
MaximumNumberOfFriendsReached,
MaximumNumberOfPinsReachedForTheChannel,
MaximumNumberOfGuildRolesReached = 30005,
MaximumNumberOfWebhooksReached = 30007,
MaximumNumberOfReactionsReached = 30010,
MaximumNumberOfGuildChannelsReached = 30013,
MaximumNumberOfAttachmentsInAMessageReached = 30015,
MaximumNumberOfInvitesReached,
GuildAlreadyHasTemplate = 30031,
Unauthorized = 40001,
VerifyYourAccount,
RequestEntityTooLarge = 40005,
FeatureTemporarilyDisabledServerSide,
UserBannedFromThisGuild,
ThisMessageWasAlreadyCrossposted = 40033,
MissingAccess = 50001,
InvalidAccountType,
CannotExecuteActionOnDMChannel,
GuildWidgetDisabled,
CannotEditMessageAuthoredByAnotherUser,
CannotSendAnEmptyMessage,
CannotSendMessagesToThisUser,
CannotSendMessagesInVoiceChannel,
ChannelVerificationLevelTooHighForYouToGainAccess,
Oauth2ApplicationDoesNotHaveBot,
Oauth2ApplicationLimitReached,
InvalidOauth2State,
MissingPermissions,
InvalidToken,
NoteWasTooLong,
ProvidedTooFewOrTooManyMessagesToDelete,
MessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019,
InviteCodeInvalidOrTaken,
CannotExecuteActionOnSystemMessage,
CannotExecuteActionOnThisChannelType = 50024,
InvalidOauth2AccessToken,
InvalidRecipients = 50033,
OneOfTheMessagesProvidedWasTooOldForBulkDelete,
InvalidFormBodyOrContentType,
InviteAcceptedToGuildWithoutTheBotBeingIn,
InvalidAPIVersion = 50041,
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
InvalidStickerSent = 50081,
TwoFactorAuthenticationIsRequired = 60003,
ReactionWasBlocked = 90001,
APIResourceOverloaded = 130000,
}
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes
*/
export const enum RPCErrorCodes {
UnknownError = 1000,
InvalidPayload = 4000,
InvalidCommand = 4002,
InvalidGuild,
InvalidEvent,
InvalidChannel,
InvalidPermissions,
InvalidClientID,
InvalidOrigin,
InvalidToken,
InvalidUser,
OAuth2Error = 5000,
SelectChannelTimedOut,
GetGuildTimedOut,
SelectVoiceForceRequired,
CaptureShortcutAlreadyListening,
}
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-close-event-codes
*/
export const enum RPCCloseEventCodes {
InvalidClientID = 4000,
InvalidOrigin,
RateLimited,
TokenRevoked,
InvalidVersion,
InvalidEncoding,
}
/**
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params
*/
export interface GatewayConnectQuery {
v: string;
encoding: 'json' | 'etf';
compress?: 'zlib-stream';
}

View File

@@ -1,4 +0,0 @@
// This file exports all the types available in the default API version
// Thereby, things MAY break in the future
export * from './v8/mod.ts';

View File

@@ -1,4 +0,0 @@
export * from '../common/mod.ts';
export * from './gateway/mod.ts';
export * from './payloads/mod.ts';
export * from './rest/mod.ts';

View File

@@ -1,4 +0,0 @@
export * from '../common/mod.ts';
export * from './gateway/mod.ts';
export * from './payloads/mod.ts';
export * from './rest/mod.ts';

View File

@@ -1,531 +0,0 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/audit-log
*/
import type { APIOverwrite, ChannelType } from './channel.ts';
import type {
APIGuildIntegration,
GuildDefaultMessageNotifications,
GuildExplicitContentFilter,
GuildMFALevel,
GuildVerificationLevel,
IntegrationExpireBehavior,
} from './guild.ts';
import type { APIRole } from './permissions.ts';
import type { APIUser } from './user.ts';
import type { APIWebhook } from './webhook.ts';
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
*/
export interface APIAuditLog {
/**
* Webhooks found in the audit log
*
* See https://discord.com/developers/docs/resources/webhook#webhook-object
*/
webhooks: APIWebhook[];
/**
* Users found in the audit log
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
users: APIUser[];
/**
* Audit log entries
*
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object
*/
audit_log_entries: APIAuditLogEntry[];
/**
* Partial integration objects
*
* See https://discord.com/developers/docs/resources/guild#integration-object
*/
integrations: APIGuildIntegration[];
}
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure
*/
export interface APIAuditLogEntry {
/**
* ID of the affected entity (webhook, user, role, etc.)
*/
target_id: string | null;
/**
* Changes made to the `target_id`
*
* See https://discord.com/developers/docs/resources/audit-log#audit-log-change-object
*/
changes?: APIAuditLogChange[];
/**
* The user who made the changes
*
* *Against all odds, this can be `null` in some cases (webhooks deleting themselves
* by using their own token, for example)*
*/
user_id: string | null;
/**
* ID of the entry
*/
id: string;
/**
* Type of action that occurred
*
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
*/
action_type: AuditLogEvent;
/**
* Additional info for certain action types
*
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
*/
options?: APIAuditLogOptions;
/**
* The reason for the change (0-512 characters)
*/
reason?: string;
}
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
*/
export const enum AuditLogEvent {
GUILD_UPDATE = 1,
CHANNEL_CREATE = 10,
CHANNEL_UPDATE,
CHANNEL_DELETE,
CHANNEL_OVERWRITE_CREATE,
CHANNEL_OVERWRITE_UPDATE,
CHANNEL_OVERWRITE_DELETE,
MEMBER_KICK = 20,
MEMBER_PRUNE,
MEMBER_BAN_ADD,
MEMBER_BAN_REMOVE,
MEMBER_UPDATE,
MEMBER_ROLE_UPDATE,
MEMBER_MOVE,
MEMBER_DISCONNECT,
BOT_ADD,
ROLE_CREATE = 30,
ROLE_UPDATE,
ROLE_DELETE,
INVITE_CREATE = 40,
INVITE_UPDATE,
INVITE_DELETE,
WEBHOOK_CREATE = 50,
WEBHOOK_UPDATE,
WEBHOOK_DELETE,
EMOJI_CREATE = 60,
EMOJI_UPDATE,
EMOJI_DELETE,
MESSAGE_DELETE = 72,
MESSAGE_BULK_DELETE,
MESSAGE_PIN,
MESSAGE_UNPIN,
INTEGRATION_CREATE = 80,
INTEGRATION_UPDATE,
INTEGRATION_DELETE,
}
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
*/
export interface APIAuditLogOptions {
/**
* Number of days after which inactive members were kicked
*
* Present from:
* - MEMBER_PRUNE
*/
delete_member_days?: string;
/**
* Number of members removed by the prune
*
* Present from:
* - MEMBER_PRUNE
*/
members_removed?: string;
/**
* Channel in which the entities were targeted
*
* Present from:
* - MEMBER_MOVE
* - MESSAGE_PIN
* - MESSAGE_UNPIN
* - MESSAGE_DELETE
*/
channel_id?: string;
/**
* ID of the message that was targeted
*
* Present from:
* - MESSAGE_PIN
* - MESSAGE_UNPIN
*/
message_id?: string;
/**
* Number of entities that were targeted
*
* Present from:
* - MESSAGE_DELETE
* - MESSAGE_BULK_DELETE
* - MEMBER_DISCONNECT
* - MEMBER_MOVE
*/
count?: string;
/**
* ID of the overwritten entity
*
* Present from:
* - CHANNEL_OVERWRITE_CREATE
* - CHANNEL_OVERWRITE_UPDATE
* - CHANNEL_OVERWRITE_DELETE
*/
id?: string;
/**
* Type of overwritten entity - "0" for "role" or "1" for "member"
*
* Present from:
* - CHANNEL_OVERWRITE_CREATE
* - CHANNEL_OVERWRITE_UPDATE
* - CHANNEL_OVERWRITE_DELETE
*
* {@link AuditLogOptionsType}
*/
type?: AuditLogOptionsType;
/**
* Name of the role
*
* Present from:
* - CHANNEL_OVERWRITE_CREATE
* - CHANNEL_OVERWRITE_UPDATE
* - CHANNEL_OVERWRITE_DELETE
*
* **Present only if the {@link APIAuditLogOptions#type entry type} is "0"**
*/
role_name?: string;
}
export const enum AuditLogOptionsType {
Role = '0',
Member = '1',
}
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
*/
export type APIAuditLogChange =
| APIAuditLogChangeKeyName
| APIAuditLogChangeKeyIconHash
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeyOwnerID
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyAFKChannelID
| APIAuditLogChangeKeyAFKTimeout
| APIAuditLogChangeKeyMFALevel
| APIAuditLogChangeKeyVerificationLevel
| APIAuditLogChangeKeyExplicitContentFilter
| APIAuditLogChangeKeyDefaultMessageNotifications
| APIAuditLogChangeKeyVanityURLCode
| APIAuditLogChangeKey$Add
| APIAuditLogChangeKey$Remove
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyWidgetEnabled
| APIAuditLogChangeKeyWidgetChannelID
| APIAuditLogChangeKeySystemChannelID
| APIAuditLogChangeKeyPosition
| APIAuditLogChangeKeyTopic
| APIAuditLogChangeKeyBitrate
| APIAuditLogChangeKeyPermissionOverwrites
| APIAuditLogChangeKeyNSFW
| APIAuditLogChangeKeyApplicationID
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyPermissions
| APIAuditLogChangeKeyColor
| APIAuditLogChangeKeyHoist
| APIAuditLogChangeKeyMentionable
| APIAuditLogChangeKeyAllow
| APIAuditLogChangeKeyDeny
| APIAuditLogChangeKeyCode
| APIAuditLogChangeKeyChannelID
| APIAuditLogChangeKeyInviterID
| APIAuditLogChangeKeyMaxUses
| APIAuditLogChangeKeyUses
| APIAuditLogChangeKeyMaxAge
| APIAuditLogChangeKeyTemporary
| APIAuditLogChangeKeyDeaf
| APIAuditLogChangeKeyMute
| APIAuditLogChangeKeyNick
| APIAuditLogChangeKeyAvatarHash
| APIAuditLogChangeKeyID
| APIAuditLogChangeKeyType
| APIAuditLogChangeKeyEnableEmoticons
| APIAuditLogChangeKeyExpireBehavior
| APIAuditLogChangeKeyExpireGracePeriod;
/**
* Returned when a guild's name is changed
*/
export type APIAuditLogChangeKeyName = AuditLogChangeData<'name', string>;
/**
* Returned when a guild's icon is changed
*/
export type APIAuditLogChangeKeyIconHash = AuditLogChangeData<'icon_hash', string>;
/**
* Returned when a guild's splash is changed
*/
export type APIAuditLogChangeKeySplashHash = AuditLogChangeData<'splash_hash', string>;
/**
* Returned when a guild's owner ID is changed
*/
export type APIAuditLogChangeKeyOwnerID = AuditLogChangeData<'owner_id', string>;
/**
* Returned when a guild's region is changed
*/
export type APIAuditLogChangeKeyRegion = AuditLogChangeData<'region', string>;
/**
* Returned when a guild's afk_channel_id is changed
*/
export type APIAuditLogChangeKeyAFKChannelID = AuditLogChangeData<'afk_channel_id', string>;
/**
* Returned when a guild's afk_timeout is changed
*/
export type APIAuditLogChangeKeyAFKTimeout = AuditLogChangeData<'afk_timeout', number>;
/**
* Returned when a guild's mfa_level is changed
*/
export type APIAuditLogChangeKeyMFALevel = AuditLogChangeData<'mfa_level', GuildMFALevel>;
/**
* Returned when a guild's verification_level is changed
*/
export type APIAuditLogChangeKeyVerificationLevel = AuditLogChangeData<'verification_level', GuildVerificationLevel>;
/**
* Returned when a guild's explicit_content_filter is changed
*/
export type APIAuditLogChangeKeyExplicitContentFilter = AuditLogChangeData<
'explicit_content_filter',
GuildExplicitContentFilter
>;
/**
* Returned when a guild's default_message_notifications is changed
*/
export type APIAuditLogChangeKeyDefaultMessageNotifications = AuditLogChangeData<
'default_message_notifications',
GuildDefaultMessageNotifications
>;
/**
* Returned when a guild's vanity_url_code is changed
*/
export type APIAuditLogChangeKeyVanityURLCode = AuditLogChangeData<'vanity_url_code', string>;
/**
* Returned when new role(s) are added
*/
export type APIAuditLogChangeKey$Add = AuditLogChangeData<'$add', APIRole[]>;
/**
* Returned when role(s) are removed
*/
export type APIAuditLogChangeKey$Remove = AuditLogChangeData<'$remove', APIRole[]>;
/**
* Returned when there is a change in number of days after which inactive and role-unassigned members are kicked
*/
export type APIAuditLogChangeKeyPruneDeleteDays = AuditLogChangeData<'prune_delete_days', number>;
/**
* Returned when a guild's widget is enabled
*/
export type APIAuditLogChangeKeyWidgetEnabled = AuditLogChangeData<'widget_enabled', boolean>;
/**
* Returned when a guild's widget_channel_id is changed
*/
export type APIAuditLogChangeKeyWidgetChannelID = AuditLogChangeData<'widget_channel_id', string>;
/**
* Returned when a guild's system_channel_id is changed
*/
export type APIAuditLogChangeKeySystemChannelID = AuditLogChangeData<'system_channel_id', string>;
/**
* Returned when a channel's position is changed
*/
export type APIAuditLogChangeKeyPosition = AuditLogChangeData<'position', number>;
/**
* Returned when a channel's topic is changed
*/
export type APIAuditLogChangeKeyTopic = AuditLogChangeData<'topic', string>;
/**
* Returned when a voice channel's bitrate is changed
*/
export type APIAuditLogChangeKeyBitrate = AuditLogChangeData<'bitrate', number>;
/**
* Returned when a channel's permission overwrites is changed
*/
export type APIAuditLogChangeKeyPermissionOverwrites = AuditLogChangeData<'permission_overwrites', APIOverwrite[]>;
/**
* Returned when a channel's NSFW restriction is changed
*/
export type APIAuditLogChangeKeyNSFW = AuditLogChangeData<'nsfw', boolean>;
/**
* The application ID of the added or removed Webhook or Bot
*/
export type APIAuditLogChangeKeyApplicationID = AuditLogChangeData<'application_id', string>;
/**
* Returned when a channel's amount of seconds a user has to wait before sending another message
* is changed
*/
export type APIAuditLogChangeKeyRateLimitPerUser = AuditLogChangeData<'rate_limit_per_user', number>;
/**
* Returned when a permission bitfield is changed
*/
export type APIAuditLogChangeKeyPermissions = AuditLogChangeData<'permissions', string>;
/**
* Returned when a role's color is changed
*/
export type APIAuditLogChangeKeyColor = AuditLogChangeData<'color', number>;
/**
* Returned when a role's hoist status is changed
*/
export type APIAuditLogChangeKeyHoist = AuditLogChangeData<'hoist', boolean>;
/**
* Returned when a role's mentionable status is changed
*/
export type APIAuditLogChangeKeyMentionable = AuditLogChangeData<'mentionable', boolean>;
/**
* Returned when an overwrite's allowed permissions bitfield is changed
*/
export type APIAuditLogChangeKeyAllow = AuditLogChangeData<'allow', string>;
/**
* Returned when an overwrite's denied permissions bitfield is changed
*/
export type APIAuditLogChangeKeyDeny = AuditLogChangeData<'deny', string>;
/**
* Returned when an invite's code is changed
*/
export type APIAuditLogChangeKeyCode = AuditLogChangeData<'code', string>;
/**
* Returned when an invite's channel_id is changed
*/
export type APIAuditLogChangeKeyChannelID = AuditLogChangeData<'channel_id', string>;
/**
* Returned when an invite's inviter_id is changed
*/
export type APIAuditLogChangeKeyInviterID = AuditLogChangeData<'inviter_id', string>;
/**
* Returned when an invite's max_uses is changed
*/
export type APIAuditLogChangeKeyMaxUses = AuditLogChangeData<'max_uses', number>;
/**
* Returned when an invite's uses is changed
*/
export type APIAuditLogChangeKeyUses = AuditLogChangeData<'uses', number>;
/**
* Returned when an invite's max_age is changed
*/
export type APIAuditLogChangeKeyMaxAge = AuditLogChangeData<'max_age', number>;
/**
* Returned when an invite's temporary status is changed
*/
export type APIAuditLogChangeKeyTemporary = AuditLogChangeData<'temporary', boolean>;
/**
* Returned when a user's deaf status is changed
*/
export type APIAuditLogChangeKeyDeaf = AuditLogChangeData<'deaf', boolean>;
/**
* Returned when a user's mute status is changed
*/
export type APIAuditLogChangeKeyMute = AuditLogChangeData<'mute', boolean>;
/**
* Returned when a user's nick is changed
*/
export type APIAuditLogChangeKeyNick = AuditLogChangeData<'mute', boolean>;
/**
* Returned when a user's avatar_hash is changed
*/
export type APIAuditLogChangeKeyAvatarHash = AuditLogChangeData<'avatar_hash', string>;
/**
* The ID of the changed entity - sometimes used in conjunction with other keys
*/
export type APIAuditLogChangeKeyID = AuditLogChangeData<'id', string>;
/**
* The type of entity created
*/
export type APIAuditLogChangeKeyType = AuditLogChangeData<'type', ChannelType | string>;
/**
* Returned when an integration's enable_emoticons is changed
*/
export type APIAuditLogChangeKeyEnableEmoticons = AuditLogChangeData<'enable_emoticons', boolean>;
/**
* Returned when an integration's expire_behavior is changed
*/
export type APIAuditLogChangeKeyExpireBehavior = AuditLogChangeData<'expire_behavior', IntegrationExpireBehavior>;
/**
* Returned when an integration's expire_grace_period is changed
*/
export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_grace_period', number>;
/**
* @internal
*/
interface AuditLogChangeData<K extends string, D extends unknown> {
key: K;
new_value?: D;
old_value?: D;
}

View File

@@ -1,911 +0,0 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/channel
*/
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
import type { APIUser } from './user.ts';
/**
* Not documented, but partial only includes id, name, and type
*/
export interface APIPartialChannel {
/**
* The id of the channel
*/
id: string;
/**
* The type of the channel
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*/
type: ChannelType;
/**
* The name of the channel (2-100 characters)
*/
name?: string;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
*/
export interface APIChannel extends APIPartialChannel {
/**
* The id of the guild
*/
guild_id?: string;
/**
* Sorting position of the channel
*/
position?: number;
/**
* Explicit permission overwrites for members and roles
*
* See https://discord.com/developers/docs/resources/channel#overwrite-object
*/
permission_overwrites?: APIOverwrite[];
/**
* The channel topic (0-1024 characters)
*/
topic?: string | null;
/**
* Whether the channel is nsfw
*/
nsfw?: boolean;
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: string | null;
/**
* The bitrate (in bits) of the voice channel
*/
bitrate?: number;
/**
* The user limit of the voice channel
*/
user_limit?: number;
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*/
rate_limit_per_user?: number;
/**
* The recipients of the DM
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
recipients?: APIUser[];
/**
* Icon hash
*/
icon?: string | null;
/**
* ID of the DM creator
*/
owner_id?: string;
/**
* Application id of the group DM creator if it is bot-created
*/
application_id?: string;
/**
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
*/
parent_id?: string | null;
/**
* When the last pinned message was pinned.
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
*/
last_pin_timestamp?: string | null;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*/
export const enum ChannelType {
/**
* A text channel within a guild
*/
GUILD_TEXT = 0,
/**
* A direct message between users
*/
DM,
/**
* A voice channel within a guild
*/
GUILD_VOICE,
/**
* A direct message between multiple users
*/
GROUP_DM,
/**
* An organizational category that contains up to 50 channels
*
* See https://support.discord.com/hc/en-us/articles/115001580171-Channel-Categories-101
*/
GUILD_CATEGORY,
/**
* A channel that users can follow and crosspost into their own guild
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GUILD_NEWS,
/**
* A channel in which game developers can sell their game on Discord
*
* See https://discord.com/developers/docs/game-and-server-management/special-channels
*/
GUILD_STORE,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-structure
*/
export interface APIMessage {
/**
* ID of the message
*/
id: string;
/**
* ID of the channel the message was sent in
*/
channel_id: string;
/**
* ID of the guild the message was sent in
*/
guild_id?: string;
/**
* The author of this message (only a valid user in the case where the message is generated by a user or bot user)
*
* If the message is generated by a webhook, the author object corresponds to the webhook's id,
* username, and avatar. You can tell if a message is generated by a webhook by checking for the `webhook_id` property
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
author: APIUser;
/**
* Member properties for this message's author
*
* The member object exists in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* See https://discord.com/developers/docs/resources/guild#guild-member-object
*/
member?: APIGuildMember;
/**
* Contents of the message
*/
content: string;
/**
* When this message was sent
*/
timestamp: string;
/**
* When this message was edited (or null if never)
*/
edited_timestamp: string | null;
/**
* Whether this was a TTS message
*/
tts: boolean;
/**
* Whether this message mentions everyone
*/
mention_everyone: boolean;
/**
* Users specifically mentioned in the message
*
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
* from text-based guild channels
*
* See https://discord.com/developers/docs/resources/user#user-object
* See https://discord.com/developers/docs/resources/guild#guild-member-object
*/
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
/**
* Roles specifically mentioned in this message
*
* See https://discord.com/developers/docs/topics/permissions#role-object
*/
mention_roles: string[];
/**
* Channels specifically mentioned in this message
*
* Not all channel mentions in a message will appear in `mention_channels`.
* - Only textual channels that are visible to everyone in a lurkable guild will ever be included
* - Only crossposted messages (via Channel Following) currently include `mention_channels` at all
*
* If no mentions in the message meet these requirements, this field will not be sent
*
* See https://discord.com/developers/docs/resources/channel#channel-mention-object
*/
mention_channels?: APIChannelMention[];
/**
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments: APIAttachment[];
/**
* Any embedded content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*/
embeds: APIEmbed[];
/**
* Reactions to the message
*
* See https://discord.com/developers/docs/resources/channel#reaction-object
*/
reactions?: APIReaction[];
/**
* Used for validating a message was sent
*
* **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE`
* event to ensure it got sent**
*/
nonce?: string | number;
/**
* Whether this message is pinned
*/
pinned: boolean;
/**
* If the message is generated by a webhook, this is the webhook's id
*/
webhook_id?: string;
/**
* Type of message
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-types
*/
type: MessageType;
/**
* Sent with Rich Presence-related chat embeds
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
*/
activity?: APIMessageActivity;
/**
* Sent with Rich Presence-related chat embeds
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
*/
application?: APIMessageApplication;
/**
* Reference data sent with crossposted messages and replies
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
*/
message_reference?: APIMessageReference;
/**
* Message flags combined as a bitfield
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-flags
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
flags?: MessageFlags;
/**
* The stickers sent with the message (bots currently can only receive messages with stickers, not send)
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-sticker-structure
*/
stickers?: APISticker[];
/**
* The message associated with the `message_reference`
*
* This field is only returned for messages with a `type` of `19` (REPLY).
*
* If the message is a reply but the `referenced_message` field is not present,
* the backend did not attempt to fetch the message that was being replied to,
* so its state is unknown.
*
* If the field exists but is `null`, the referenced message was deleted
*
* See https://discord.com/developers/docs/resources/channel#message-object
*/
referenced_message?: APIMessage | null;
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-types
*/
export const enum MessageType {
DEFAULT,
RECIPIENT_ADD,
RECIPIENT_REMOVE,
CALL,
CHANNEL_NAME_CHANGE,
CHANNEL_ICON_CHANGE,
CHANNEL_PINNED_MESSAGE,
GUILD_MEMBER_JOIN,
USER_PREMIUM_GUILD_SUBSCRIPTION,
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1,
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2,
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3,
CHANNEL_FOLLOW_ADD,
GUILD_DISCOVERY_DISQUALIFIED = 14,
GUILD_DISCOVERY_REQUALIFIED,
GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING,
GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING,
REPLY = 19,
APPLICATION_COMMAND,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
*/
export interface APIMessageActivity {
/**
* Type of message activity
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
*/
type: MessageActivityType;
/**
* `party_id` from a Rich Presence event
*
* See https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields
*/
party_id?: string;
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
*/
export interface APIMessageApplication {
/**
* ID of the application
*/
id: string;
/**
* ID of the embed's image asset
*/
cover_image?: string;
/**
* Application's description
*/
description: string;
/**
* ID of the application's icon
*/
icon: string | null;
/**
* Name of the application
*/
name: string;
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
*/
export interface APIMessageReference {
/**
* ID of the originating message
*/
message_id?: string;
/**
* ID of the originating message's channel
*/
channel_id: string;
/**
* ID of the originating message's guild
*/
guild_id?: string;
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
*/
export const enum MessageActivityType {
JOIN = 1,
SPECTATE,
LISTEN,
JOIN_REQUEST = 5,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
*/
export const enum MessageFlags {
/**
* This message has been published to subscribed channels (via Channel Following)
*/
CROSSPOSTED = 1 << 0,
/**
* This message originated from a message in another channel (via Channel Following)
*/
IS_CROSSPOST = 1 << 1,
/**
* Do not include any embeds when serializing this message
*/
SUPPRESS_EMBEDS = 1 << 2,
/**
* The source message for this crosspost has been deleted (via Channel Following)
*/
SOURCE_MESSAGE_DELETED = 1 << 3,
/**
* This message came from the urgent message system
*/
URGENT = 1 << 4,
EPHEMERAL = 1 << 6,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-sticker-structure
*/
export interface APISticker {
/**
* ID of the sticker
*/
id: string;
/**
* ID of the pack the sticker is from
*/
pack_id: string;
/**
* Name of the sticker
*/
name: string;
/**
* Description of the sticker
*/
description: string;
/**
* A comma-separated list of tags for the sticker
*/
tags?: string;
/**
* Sticker asset hash
*/
asset: string;
/**
* Sticker preview asset hash
*/
preview_asset: string | null;
/**
* Type of sticker format
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-sticker-format-types
*/
format_type: StickerFormatType;
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-sticker-format-types
*/
export const enum StickerFormatType {
PNG = 1,
APNG,
LOTTIE,
}
/**
* https://discord.com/developers/docs/resources/channel#followed-channel-object
*/
export interface APIFollowedChannel {
/**
* Source channel id
*/
channel_id: string;
/**
* Created target webhook id
*/
webhook_id: string;
}
/**
* https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure
*/
export interface APIReaction {
/**
* Times this emoji has been used to react
*/
count: number;
/**
* Whether the current user reacted using this emoji
*/
me: boolean;
/**
* Emoji information
*
* See https://discord.com/developers/docs/resources/emoji#emoji-object
*/
emoji: APIPartialEmoji;
}
/**
* https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure
*/
export interface APIOverwrite {
/**
* Role or user id
*/
id: string;
/**
* Either 0 (role) or 1 (member)
*
* {@link OverwriteType}
*/
type: OverwriteType;
/**
* Permission bit set
*
* See https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
allow: string;
/**
* Permission bit set
*
* See https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
deny: string;
}
export const enum OverwriteType {
Role,
Member,
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-structure
*
* Length limit: 6000 characters
*/
export interface APIEmbed {
/**
* Title of embed
*
* Length limit: 256 characters
*/
title?: string;
/**
* Type of embed (always "rich" for webhook embeds)
*
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-types
*/
type?: EmbedType;
/**
* Description of embed
*
* Length limit: 2048 characters
*/
description?: string;
/**
* URL of embed
*/
url?: string;
/**
* Timestamp of embed content
*/
timestamp?: string;
/**
* Color code of the embed
*/
color?: number;
/**
* Footer information
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
*/
footer?: APIEmbedFooter;
/**
* Image information
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
*/
image?: APIEmbedImage;
/**
* Thumbnail information
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
*/
thumbnail?: APIEmbedThumbnail;
/**
* Video information
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
*/
video?: APIEmbedVideo;
/**
* Provider information
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
*/
provider?: APIEmbedProvider;
/**
* Author information
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
*/
author?: APIEmbedAuthor;
/**
* Fields information
*
* Length limit: 25 field objects
*
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
*/
fields?: APIEmbedField[];
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-types
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
*/
export const enum EmbedType {
/**
* Generic embed rendered from embed attributes
*/
Rich = 'rich',
/**
* Image embed
*/
Image = 'image',
/**
* Video embed
*/
Video = 'video',
/**
* Animated gif image embed rendered as a video embed
*/
GifV = 'gifv',
/**
* Article embed
*/
Article = 'article',
/**
* Link embed
*/
Link = 'link',
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
*/
export interface APIEmbedThumbnail {
/**
* Source url of thumbnail (only supports http(s) and attachments)
*/
url?: string;
/**
* A proxied url of the thumbnail
*/
proxy_url?: string;
/**
* Height of thumbnail
*/
height?: number;
/**
* Width of thumbnail
*/
width?: number;
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
*/
export interface APIEmbedVideo {
/**
* Source url of video
*/
url?: string;
/**
* Height of video
*/
height?: number;
/**
* Width of video
*/
width?: number;
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
*/
export interface APIEmbedImage {
/**
* Source url of image (only supports http(s) and attachments)
*/
url?: string;
/**
* A proxied url of the image
*/
proxy_url?: string;
/**
* Height of image
*/
height?: number;
/**
* Width of image
*/
width?: number;
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
*/
export interface APIEmbedProvider {
/**
* Name of provider
*/
name?: string;
/**
* URL of provider
*/
url?: string;
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
*/
export interface APIEmbedAuthor {
/**
* Name of author
*
* Length limit: 256 characters
*/
name?: string;
/**
* URL of author
*/
url?: string;
/**
* URL of author icon (only supports http(s) and attachments)
*/
icon_url?: string;
/**
* A proxied url of author icon
*/
proxy_icon_url?: string;
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
*/
export interface APIEmbedFooter {
/**
* Footer text
*
* Length limit: 2048 characters
*/
text: string;
/**
* URL of footer icon (only supports http(s) and attachments)
*/
icon_url?: string;
/**
* A proxied url of footer icon
*/
proxy_icon_url?: string;
}
/**
* https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
*/
export interface APIEmbedField {
/**
* Name of the field
*
* Length limit: 256 characters
*/
name: string;
/**
* Value of the field
*
* Length limit: 1024 characters
*/
value: string;
/**
* Whether or not this field should display inline
*/
inline?: boolean;
}
/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
*/
export interface APIAttachment {
/**
* Attachment id
*/
id: string;
/**
* Name of file attached
*/
filename: string;
/**
* Size of file in bytes
*/
size: number;
/**
* Source url of file
*/
url: string;
/**
* A proxied url of file
*/
proxy_url: string;
/**
* Height of file (if image)
*/
height?: number | null;
/**
* Width of file (if image)
*/
width?: number | null;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-mention-object-channel-mention-structure
*/
export interface APIChannelMention {
/**
* ID of the channel
*/
id: string;
/**
* ID of the guild containing the channel
*/
guild_id: string;
/**
* The type of channel
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*/
type: ChannelType;
/**
* The name of the channel
*/
name: string;
}
/**
* https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
*/
export const enum AllowedMentionsTypes {
/**
* Controls @everyone and @here mentions
*/
Everyone = 'everyone',
/**
* Controls role mentions
*/
Role = 'roles',
/**
* Controls user mentions
*/
User = 'users',
}
/**
* https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure
*/
export interface APIAllowedMentions {
/**
* An array of allowed mention types to parse from the content
*
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
*/
parse?: AllowedMentionsTypes[];
/**
* Array of role_ids to mention (Max size of 100)
*/
roles?: string[];
/**
* Array of user_ids to mention (Max size of 100)
*/
users?: string[];
/**
* For replies, whether to mention the author of the message being replied to (default false)
*
* @default false
*/
replied_user?: boolean;
}

View File

@@ -1,180 +0,0 @@
import type { APIGuildMember, APIUser, MessageFlags } from './mod.ts';
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../rest/mod.ts';
/**
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommand
*/
export interface APIApplicationCommand {
id: string;
application_id: string;
name: string;
description: string;
options?: APIApplicationCommandOption[];
}
interface APIApplicationCommandOptionBase {
type:
| ApplicationCommandOptionType.BOOLEAN
| ApplicationCommandOptionType.USER
| ApplicationCommandOptionType.CHANNEL
| ApplicationCommandOptionType.ROLE;
name: string;
description: string;
default?: boolean;
required?: boolean;
}
/**
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoption
*/
export type APIApplicationCommandOption =
| APIApplicationCommandArgumentOptions
| APIApplicationCommandSubCommandOptions
| APIApplicationCommandOptionBase;
/**
* This type is exported as a way to make it stricter for you when you're writing your commands
*
* If the option is a `SUB_COMMAND` or `SUB_COMMAND_GROUP` type, this nested options will be the parameters
*/
export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
type: ApplicationCommandOptionType.SUB_COMMAND | ApplicationCommandOptionType.SUB_COMMAND_GROUP;
options?: APIApplicationCommandOption[];
}
/**
* This type is exported as a way to make it stricter for you when you're writing your commands
*
* In contrast to @see APIApplicationCommandSubCommandOptions, these types cannot have an `options` array,
* but they can have a `choices` one
*/
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
type: ApplicationCommandOptionType.STRING | ApplicationCommandOptionType.INTEGER;
choices?: APIApplicationCommandOptionChoice[];
}
/**
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptiontype
*/
export const enum ApplicationCommandOptionType {
SUB_COMMAND = 1,
SUB_COMMAND_GROUP,
STRING,
INTEGER,
BOOLEAN,
USER,
CHANNEL,
ROLE,
}
/**
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptionchoice
*/
export interface APIApplicationCommandOptionChoice {
name: string;
value: string | number;
}
/**
* https://discord.com/developers/docs/interactions/slash-commands#interaction
*/
export interface APIInteraction {
id: string;
type: InteractionType;
data?: APIApplicationCommandInteractionData;
guild_id: string;
channel_id: string;
member: APIGuildMember & { permissions: string; user: APIUser };
token: string;
version: 1;
}
/**
* Like See APIInteraction, only with the `data` property always present
*/
export type APIApplicationCommandInteraction = Required<APIInteraction>;
/**
* https://discord.com/developers/docs/interactions/slash-commands#interaction-interactiontype
*/
export const enum InteractionType {
Ping = 1,
ApplicationCommand,
}
/**
* https://discord.com/developers/docs/interactions/slash-commands#interaction-applicationcommandinteractiondata
*/
export interface APIApplicationCommandInteractionData {
id: string;
name: string;
options?: APIApplicationCommandInteractionDataOption[];
}
/**
* https://discord.com/developers/docs/interactions/slash-commands#interaction-applicationcommandinteractiondataoption
*/
export interface APIApplicationCommandInteractionDataOption {
name: string;
/**
* The value returned here depends on the `ApplicationCommandOptionType` type of the option with the name
* that matches this interface's `name`.
*
* You will need to manually cast this to the appropriate type based on the returned data
*/
value?: unknown;
options?: APIApplicationCommandInteractionDataOption[];
}
/**
* https://discord.com/developers/docs/interactions/slash-commands#interaction-interaction-response
*/
export type APIInteractionResponse =
| APIInteractionResponsePong
| APIInteractionResponseAcknowledge
| APIInteractionResponseAcknowledgeWithSource
| APIInteractionResponseChannelMessage
| APIInteractionResponseChannelMessageWithSource;
export type APIInteractionResponsePong = InteractionResponsePayload<APIInteractionResponseType.Pong>;
export type APIInteractionResponseAcknowledge = InteractionResponsePayload<APIInteractionResponseType.Acknowledge>;
export type APIInteractionResponseAcknowledgeWithSource = InteractionResponsePayload<APIInteractionResponseType.AcknowledgeWithSource>;
export type APIInteractionResponseChannelMessage = InteractionResponsePayload<
APIInteractionResponseType.ChannelMessage,
true
>;
export type APIInteractionResponseChannelMessageWithSource = InteractionResponsePayload<
APIInteractionResponseType.ChannelMessageWithSource,
true
>;
/**
* https://discord.com/developers/docs/interactions/slash-commands#interaction-interactionresponsetype
*/
export const enum APIInteractionResponseType {
Pong = 1,
Acknowledge,
ChannelMessage,
ChannelMessageWithSource,
AcknowledgeWithSource,
}
/**
* https://discord.com/developers/docs/interactions/slash-commands#interaction-interactionapplicationcommandcallbackdata
*/
export type APIInteractionApplicationCommandCallbackData = Omit<
RESTPostAPIWebhookWithTokenJSONBody,
'username' | 'avatar_url'
> & { flags?: MessageFlags };
/**
* @internal
*/
interface InteractionResponsePayload<T extends APIInteractionResponseType, D = false> {
type: T;
data?: D extends true ? APIInteractionApplicationCommandCallbackData : never;
}

View File

@@ -1,88 +0,0 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/invite
*/
import type { APIPartialChannel } from './channel.ts';
import type { APIPartialGuild } from './guild.ts';
import type { APIUser } from './user.ts';
/**
* https://discord.com/developers/docs/resources/invite#invite-object
*/
export interface APIInvite {
/**
* The invite code (unique ID)
*/
code: string;
/**
* The guild this invite is for
*
* See https://discord.com/developers/docs/resources/guild#guild-object
*/
guild?: APIPartialGuild;
/**
* The channel this invite is for
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
channel?: Required<APIPartialChannel>;
/**
* The user who created the invite
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
inviter?: APIUser;
/**
* The target user for this invite
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
target_user?: APIUser;
/**
* The type of user target for this invite
*
* See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
*/
target_user_type?: InviteTargetUserType;
/**
* Approximate count of online members (only present when `target_user` is set)
*/
approximate_presence_count?: number;
/**
* Approximate count of total members
*/
approximate_member_count?: number;
}
/**
* https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
*/
export const enum InviteTargetUserType {
STREAM = 1,
}
/**
* https://discord.com/developers/docs/resources/invite#invite-metadata-object
*/
export interface APIExtendedInvite extends APIInvite {
/**
* Number of times this invite has been used
*/
uses: number;
/**
* Max number of times this invite can be used
*/
max_uses: number;
/**
* Duration (in seconds) after which the invite expires
*/
max_age: number;
/**
* Whether this invite only grants temporary membership
*/
temporary: boolean;
/**
* When this invite was created
*/
created_at: string;
}

View File

@@ -1,113 +0,0 @@
/**
* Types extracted from https://discord.com/developers/docs/topics/permissions
*/
/**
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
*
* These flags are exported as `BigInt`s and NOT numbers. For most of them, you can
* convert them in a number by wrapping it in `Number()`, however be careful as any
* further bits added may cause issues if done so. Try to use BigInts as much as possible
* or modules that can replicate them in some way
*/
export const PermissionFlagsBits = {
CREATE_INSTANT_INVITE: 1n << 0n,
KICK_MEMBERS: 1n << 1n,
BAN_MEMBERS: 1n << 2n,
ADMINISTRATOR: 1n << 3n,
MANAGE_CHANNELS: 1n << 4n,
MANAGE_GUILD: 1n << 5n,
ADD_REACTIONS: 1n << 6n,
VIEW_AUDIT_LOG: 1n << 7n,
PRIORITY_SPEAKER: 1n << 8n,
STREAM: 1n << 9n,
VIEW_CHANNEL: 1n << 10n,
SEND_MESSAGES: 1n << 11n,
SEND_TTS_MESSAGES: 1n << 12n,
MANAGE_MESSAGES: 1n << 13n,
EMBED_LINKS: 1n << 14n,
ATTACH_FILES: 1n << 15n,
READ_MESSAGE_HISTORY: 1n << 16n,
MENTION_EVERYONE: 1n << 17n,
USE_EXTERNAL_EMOJIS: 1n << 18n,
VIEW_GUILD_INSIGHTS: 1n << 19n,
CONNECT: 1n << 20n,
SPEAK: 1n << 21n,
MUTE_MEMBERS: 1n << 22n,
DEAFEN_MEMBERS: 1n << 23n,
MOVE_MEMBERS: 1n << 24n,
USE_VAD: 1n << 25n,
CHANGE_NICKNAME: 1n << 26n,
MANAGE_NICKNAMES: 1n << 27n,
MANAGE_ROLES: 1n << 28n,
MANAGE_WEBHOOKS: 1n << 29n,
MANAGE_EMOJIS: 1n << 30n,
} as const;
/**
* Freeze the object of bits, preventing any modifications to it
* @internal
*/
Object.freeze(PermissionFlagsBits);
/**
* https://discord.com/developers/docs/topics/permissions#role-object
*/
export interface APIRole {
/**
* Role id
*/
id: string;
/**
* Role name
*/
name: string;
/**
* Integer representation of hexadecimal color code
*/
color: number;
/**
* If this role is pinned in the user listing
*/
hoist: boolean;
/**
* Position of this role
*/
position: number;
/**
* Permission bit set
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
permissions: string;
/**
* Whether this role is managed by an integration
*/
managed: boolean;
/**
* Whether this role is mentionable
*/
mentionable: boolean;
/**
* The tags this role has
*/
tags?: APIRoleTags;
}
/**
* https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure
*/
export interface APIRoleTags {
/**
* The id of the bot this role belongs to
*/
bot_id?: string;
/**
* Whether this is the guild's premium subscriber role
*/
premium_subscriber?: null;
/**
* The id of the integration this role belongs to
*/
integration_id?: string;
}

View File

@@ -1,443 +0,0 @@
import type {
APIAllowedMentions,
APIChannel,
APIEmbed,
APIExtendedInvite,
APIFollowedChannel,
APIMessage,
APIMessageReference,
APIOverwrite,
APIUser,
ChannelType,
InviteTargetUserType,
MessageFlags,
OverwriteType,
} from '../payloads/mod.ts';
/**
* https://discord.com/developers/docs/resources/channel#get-channel
*/
export type RESTGetAPIChannelResult = APIChannel;
/**
* https://discord.com/developers/docs/resources/channel#modify-channel
*/
export interface RESTPatchAPIChannelJSONBody {
/**
* 2-100 character channel name
*
* Channel types: all
*/
name?: string;
/**
* The type of channel; only conversion between `text` and `news`
* is supported and only in guilds with the "NEWS" feature
*
* Channel types: text, news
*/
type?: ChannelType.GUILD_NEWS | ChannelType.GUILD_TEXT;
/**
* The position of the channel in the left-hand listing
*
* Channel types: all
*/
position?: number | null;
/**
* 0-1024 character channel topic
*
* Channel types: text, news
*/
topic?: string | null;
/**
* Whether the channel is nsfw
*
* Channel types: text, news, store
*/
nsfw?: boolean | 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
*
* Channel types: text
*/
rate_limit_per_user?: number | null;
/**
* The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers)
*
* Channel types: voice
*/
bitrate?: number | null;
/**
* The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit
*
* Channel types: voice
*/
user_limit?: number | null;
/**
* Channel or category-specific permissions
*
* Channel types: all
*/
permission_overwrites?: APIOverwrite[] | null;
/**
* ID of the new parent category for a channel
*
* Channel types: text, news, store, voice
*/
parent_id?: string | null;
}
/**
* https://discord.com/developers/docs/resources/channel#modify-channel
*/
export type RESTPatchAPIChannelResult = APIChannel;
/**
* https://discord.com/developers/docs/resources/channel#deleteclose-channel
*/
export type RESTDeleteAPIChannelResult = APIChannel;
/**
* https://discord.com/developers/docs/resources/channel#get-channel-messages
*/
export interface RESTGetAPIChannelMessagesQuery {
/**
* Get messages around this message ID
*/
around?: string;
/**
* Get messages before this message ID
*/
before?: string;
/**
* Get messages after this message ID
*/
after?: string;
/**
* Max number of messages to return (1-100)
*
* @default 50
*/
limit?: number;
}
/**
* https://discord.com/developers/docs/resources/channel#get-channel-messages
*/
export type RESTGetAPIChannelMessagesResult = APIMessage[];
/**
* https://discord.com/developers/docs/resources/channel#get-channel-message
*/
export type RESTGetAPIChannelMessageResult = APIMessage;
export type APIMessageReferenceSend = Partial<APIMessageReference> & Required<Pick<APIMessageReference, 'message_id'>>;
/**
* https://discord.com/developers/docs/resources/channel#create-message
*/
export interface RESTPostAPIChannelMessageJSONBody {
/**
* The message contents (up to 2000 characters)
*/
content?: string;
/**
* A nonce that can be used for optimistic message sending
*/
nonce?: number | string;
/**
* `true` if this is a TTS message
*/
tts?: true;
/**
* Embedded `rich` content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*/
embed?: APIEmbed;
/**
* Allowed mentions for a message
*
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
*/
allowed_mentions?: APIAllowedMentions;
/**
* Include to make your message a reply
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
*/
message_reference?: APIMessageReferenceSend;
}
/**
* https://discord.com/developers/docs/resources/channel#create-message
*/
export type RESTPostAPIChannelMessageFormDataBody =
| {
/**
* JSON stringified message body
*/
payload_json?: string;
/**
* The file contents
*/
file: unknown;
}
| (RESTPostAPIChannelMessageJSONBody & {
/**
* The file contents
*/
file: unknown;
});
/**
* https://discord.com/developers/docs/resources/channel#create-message
*/
export type RESTPostAPIChannelMessageResult = APIMessage;
/**
* https://discord.com/developers/docs/resources/channel#crosspost-message
*/
export type RESTPostAPIChannelMessageCrosspostResult = APIMessage;
/**
* https://discord.com/developers/docs/resources/channel#create-reaction
*/
export type RESTPutAPIChannelMessageReactionResult = never;
/**
* https://discord.com/developers/docs/resources/channel#delete-own-reaction
*/
export type RESTDeleteAPIChannelMessageOwnReaction = never;
/**
* https://discord.com/developers/docs/resources/channel#delete-user-reaction
*/
export type RESTDeleteAPIChannelMessageUserReactionResult = never;
/*
* https://discord.com/developers/docs/resources/channel#get-reactions
*/
export interface RESTGetAPIChannelMessageReactionUsersQuery {
/**
* Get users before this user ID
*/
before?: string;
/**
* Get users after this user ID
*/
after?: string;
/**
* Max number of users to return (1-100)
*
* @default 25
*/
limit?: number;
}
/**
* https://discord.com/developers/docs/resources/channel#get-reactions
*/
export type RESTGetAPIChannelMessageReactionUsersResult = APIUser[];
/**
* https://discord.com/developers/docs/resources/channel#delete-all-reactions
*/
export type RESTDeleteAPIChannelAllMessageReactionsResult = never;
/**
* https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji
*/
export type RESTDeleteAPIChannelMessageReactionResult = never;
/**
* https://discord.com/developers/docs/resources/channel#edit-message
*/
export interface RESTPatchAPIChannelMessageJSONBody {
/**
* The new message contents (up to 2000 characters)
*/
content?: string | null;
/**
* Embedded `rich` content
*/
embed?: APIEmbed | null;
/**
* Edit the flags of a message (only `SUPPRESS_EMBEDS` can currently be set/unset)
*
* When specifying flags, ensure to include all previously set flags/bits
* in addition to ones that you are modifying
*/
flags?: MessageFlags | null;
/**
* Allowed mentions for the message
*/
allowed_mentions?: APIAllowedMentions | null;
}
/**
* https://discord.com/developers/docs/resources/channel#edit-message
*/
export type RESTPatchAPIChannelMessageResult = APIMessage;
/**
* https://discord.com/developers/docs/resources/channel#delete-message
*/
export type RESTDeleteAPIChannelMessageResult = never;
/**
* https://discord.com/developers/docs/resources/channel#bulk-delete-messages
*/
export interface RESTPostAPIChannelMessagesBulkDeleteJSONBody {
/**
* An array of message ids to delete (2-100)
*/
messages: string[];
}
/**
* https://discord.com/developers/docs/resources/channel#bulk-delete-messages
*/
export type RESTPostAPIChannelMessagesBulkDeleteResult = never;
/**
* https://discord.com/developers/docs/resources/channel#edit-channel-permissions
*/
export interface RESTPutAPIChannelPermissionJSONBody {
/**
* The bitwise value of all allowed permissions
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
allow: string;
/**
* The bitwise value of all disallowed permissions
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
deny: string;
/**
* `0` for a role or `1` for a member
*/
type: OverwriteType;
}
/**
* https://discord.com/developers/docs/resources/channel#edit-channel-permissions
*/
export type RESTPutAPIChannelPermissionResult = never;
/**
* https://discord.com/developers/docs/resources/channel#get-channel-invites
*/
export type RESTGetAPIChannelInvitesResult = APIExtendedInvite[];
/**
* https://discord.com/developers/docs/resources/channel#create-channel-invite
*/
export interface RESTPostAPIChannelInviteJSONBody {
/**
* Duration of invite in seconds before expiry, or 0 for never
*
* @default 86400 (24 hours)
*/
max_age?: number;
/**
* Max number of uses or 0 for unlimited
*
* @default 0
*/
max_uses?: number;
/**
* Whether this invite only grants temporary membership
*
* @default false
*/
temporary?: boolean;
/**
* If true, don't try to reuse a similar invite
* (useful for creating many unique one time use invites)
*
* @default false
*/
unique?: boolean;
/**
* The target user id for this invite
*/
target_user_id?: string;
/**
* The type of target user for this invite
*/
target_user_type?: InviteTargetUserType;
}
/**
* https://discord.com/developers/docs/resources/channel#create-channel-invite
*/
export type RESTPostAPIChannelInviteResult = APIExtendedInvite;
/**
* https://discord.com/developers/docs/resources/channel#delete-channel-permission
*/
export type RESTDeleteAPIChannelPermissionResult = never;
/**
* https://discord.com/developers/docs/resources/channel#follow-news-channel
*/
export interface RESTPostAPIChannelFollowersJSONBody {
/**
* ID of target channel
*/
webhook_channel_id: string;
}
/**
* https://discord.com/developers/docs/resources/channel#follow-news-channel
*/
export type RESTPostAPIChannelFollowersResult = APIFollowedChannel;
/**
* https://discord.com/developers/docs/resources/channel#trigger-typing-indicator
*/
export type RESTPostAPIChannelTypingResult = never;
/**
* https://discord.com/developers/docs/resources/channel#get-pinned-messages
*/
export type RESTGetAPIChannelPinsResult = APIMessage[];
/**
* https://discord.com/developers/docs/resources/channel#add-pinned-channel-message
*/
export type RESTPutAPIChannelPinResult = never;
/**
* https://discord.com/developers/docs/resources/channel#delete-pinned-channel-message
*/
export type RESTDeleteAPIChannelPinResult = never;
/**
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
*/
export interface RESTPutAPIChannelRecipientJSONBody {
/**
* Access token of a user that has granted your app the `gdm.join` scope
*/
access_token: string;
/**
* Nickname of the user being added
*/
nick?: string;
}
/**
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
*/
export type RESTPutAPIChannelRecipientResult = unknown;
/**
* https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient
*/
export type RESTDeleteAPIChannelRecipientResult = unknown;

View File

@@ -1,77 +0,0 @@
import type { APIApplicationCommand, APIInteractionResponse } from '../payloads/mod.ts';
/**
* https://discord.com/developers/docs/interactions/slash-commands#get-global-application-commands
*/
export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
/**
* https://discord.com/developers/docs/interactions/slash-commands#create-global-application-command
*/
export type RESTPostAPIApplicationCommandsJSONBody = Omit<APIApplicationCommand, 'id' | 'application_id'>;
/**
* https://discord.com/developers/docs/interactions/slash-commands#create-global-application-command
*/
export type RESTPostAPIApplicationCommandsResult = APIApplicationCommand;
/**
* https://discord.com/developers/docs/interactions/slash-commands#edit-global-application-command
*/
export type RESTPatchAPIApplicationCommandJSONBody = Partial<RESTPostAPIApplicationCommandsJSONBody>;
/**
* https://discord.com/developers/docs/interactions/slash-commands#edit-global-application-command
*/
export type RESTPatchAPIApplicationCommandResult = APIApplicationCommand;
/**
* https://discord.com/developers/docs/interactions/slash-commands#get-guild-application-commands
*/
export type RESTGetAPIApplicationGuildCommandsResult = APIApplicationCommand[];
/**
* https://discord.com/developers/docs/interactions/slash-commands#create-guild-application-command
*/
export type RESTPostAPIApplicationGuildCommandsJSONBody = RESTPostAPIApplicationCommandsJSONBody;
/**
* https://discord.com/developers/docs/interactions/slash-commands#create-guild-application-command
*/
export type RESTPostAPIApplicationGuildCommandsResult = APIApplicationCommand;
/**
* https://discord.com/developers/docs/interactions/slash-commands#edit-guild-application-command
*/
export type RESTPatchAPIApplicationGuildCommandJSONBody = Partial<RESTPostAPIApplicationCommandsJSONBody>;
/**
* https://discord.com/developers/docs/interactions/slash-commands#edit-guild-application-command
*/
export type RESTPatchAPIApplicationGuildCommandResult = APIApplicationCommand;
/**
* https://discord.com/developers/docs/interactions/slash-commands#create-interaction-response
*/
export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse;
/**
* https://discord.com/developers/docs/interactions/slash-commands#create-interaction-response
*/
export type RESTPostAPIInteractionCallbackFormDataBody =
| {
/**
* JSON stringified message body
*/
payload_json?: string;
/**
* The file contents
*/
file: unknown;
}
| (RESTPostAPIInteractionCallbackJSONBody & {
/**
* The file contents
*/
file: unknown;
});

View File

@@ -1,632 +0,0 @@
export * from './auditLog.ts';
export * from './channel.ts';
export * from './emoji.ts';
export * from './gateway.ts';
export * from './guild.ts';
export * from './interactions.ts';
export * from './invite.ts';
export * from './oauth2.ts';
export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export const APIVersion = '8';
export const Routes = {
/**
* Route for:
* - GET `/guilds/{guild.id}/audit-logs`
*/
guildAuditLog(guildID: string) {
return `/guilds/${guildID}/audit-logs`;
},
/**
* Route for:
* - GET `/channels/{channel.id}`
* - PATCH `/channels/{channel.id}`
* - DELETE `/channels/{channel.id}`
*/
channel(channelID: string) {
return `/channels/${channelID}`;
},
/**
* Route for:
* - GET `/channels/{channel.id}/messages`
* - POST `/channels/{channel.id}/messages`
*/
channelMessages(channelID: string) {
return `/channels/${channelID}/messages`;
},
/**
* Route for:
* - GET `/channels/{channel.id}/messages/{message.id}`
* - PATCH `/channels/{channel.id}/messages/{message.id}`
* - DELETE `/channels/{channel.id}/messages/{message.id}`
*/
channelMessage(channelID: string, messageID: string) {
return `/channels/${channelID}/messages/${messageID}`;
},
/**
* Route for:
* - POST `/channels/{channel.id}/messages/{message.id}/crosspost`
*/
channelMessageCrosspost(channelID: string, messageID: string) {
return `/channels/${channelID}/messages/${messageID}/crosspost`;
},
/**
* Route for:
* - PUT `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
*
* **Note**: You need to URL encode the emoji yourself
*/
channelMessageOwnReaction(channelID: string, messageID: string, emoji: string) {
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/@me`;
},
/**
* Route for:
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}`
*
* **Note**: You need to URL encode the emoji yourself
*/
channelMessageUserReaction(channelID: string, messageID: string, emoji: string, userID: string) {
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/${userID}`;
},
/**
* Route for:
* - GET `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
*
* **Note**: You need to URL encode the emoji yourself
*/
channelMessageReaction(channelID: string, messageID: string, emoji: string) {
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}`;
},
/**
* Route for:
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions`
*/
channelMessageAllReactions(channelID: string, messageID: string) {
return `/channels/${channelID}/messages/${messageID}/reactions`;
},
/**
* Route for:
* - POST `/channels/{channel.id}/messages/bulk-delete`
*/
channelBulkDelete(channelID: string) {
return `/channels/${channelID}/messages/bulk-delete`;
},
/**
* Route for:
* - PUT `/channels/{channel.id}/permissions/{overwrite.id}`
* - DELETE `/channels/{channel.id}/permissions/{overwrite.id}`
*/
channelPermission(channelID: string, overwriteID: string) {
return `/channels/${channelID}/permissions/${overwriteID}`;
},
/**
* Route for:
* - GET `/channels/{channel.id}/invites`
* - POST `/channels/{channel.id}/invites`
*/
channelInvites(channelID: string) {
return `/channels/${channelID}/invites`;
},
/**
* Route for:
* - POST `/channels/{channel.id}/followers`
*/
channelFollowers(channelID: string) {
return `/channels/${channelID}/followers`;
},
/**
* Route for:
* - POST `/channels/{channel.id}/typing`
*/
channelTyping(channelID: string) {
return `/channels/${channelID}/typing`;
},
/**
* Route for:
* - GET `/channels/{channel.id}/pins`
*/
channelPins(channelID: string) {
return `/channels/${channelID}/pins`;
},
/**
* Route for:
* - PUT `/channels/{channel.id}/pins/{message.id}`
* - DELETE `/channels/{channel.id}/pins/{message.id}`
*/
channelPin(channelID: string, messageID: string) {
return `/channels/${channelID}/pins/${messageID}`;
},
/**
* Route for:
* - PUT `/channels/{channel.id}/recipients/{user.id}`
* - DELETE `/channels/{channel.id}/recipients/{user.id}`
*/
channelRecipient(channelID: string, userID: string) {
return `/channels/${channelID}/recipients/${userID}`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/emojis`
* - POST `/guilds/{guild.id}/emojis`
*/
guildEmojis(guildID: string) {
return `/guilds/${guildID}/emojis`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/emojis/{emoji.id}`
* - PATCH `/guilds/{guild.id}/emojis/{emoji.id}`
* - DELETE `/guilds/{guild.id}/emojis/{emoji.id}`
*/
guildEmoji(guildID: string, emojiID: string) {
return `/guilds/${guildID}/emojis/${emojiID}`;
},
/**
* Route for:
* - POST `/guilds`
*/
guilds() {
return '/guilds';
},
/**
* Route for:
* - GET `/guilds/{guild.id}`
* - PATCH `/guilds/{guild.id}`
* - DELETE `/guilds/{guild.id}`
*/
guild(guildID: string) {
return `/guilds/${guildID}`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/preview`
*/
guildPreview(guildID: string) {
return `/guilds/${guildID}/preview`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/channels`
* - POST `/guilds/{guild.id}/channels`
* - PATCH `/guilds/{guild.id}/channels`
*/
guildChannels(guildID: string) {
return `/guilds/${guildID}/channels`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/members/{user.id}`
* - PUT `/guilds/{guild.id}/members/{user.id}`
* - PATCH `/guilds/{guild.id}/members/{user.id}`
* - DELETE `/guilds/{guild.id}/members/{user.id}`
*/
guildMember(guildID: string, userID: string) {
return `/guilds/${guildID}/members/${userID}`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/members`
*/
guildMembers(guildID: string) {
return `/guilds/${guildID}/members`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/members/search`
*/
guildMembersSearch(guildID: string) {
return `/guilds/${guildID}/members/search`;
},
/**
* Route for:
* - PATCH `/guilds/{guild.id}/members/@me/nick`
*/
guildCurrentMemberNickname(guildID: string) {
return `/guilds/${guildID}/members/@me/nick`;
},
/**
* Route for:
* - PUT `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
* - DELETE `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
*/
guildMemberRole(guildID: string, memberID: string, roleID: string) {
return `/guilds/${guildID}/members/${memberID}/roles/${roleID}`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/bans`
*/
guildBans(guildID: string) {
return `/guilds/${guildID}/bans`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/bans/{user.id}`
* - PUT `/guilds/{guild.id}/bans/{user.id}`
* - DELETE `/guilds/{guild.id}/bans/{user.id}`
*/
guildBan(guildID: string, userID: string) {
return `/guilds/${guildID}/bans/${userID}`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/roles`
* - POST `/guilds/{guild.id}/roles`
* - PATCH `/guilds/{guild.id}/roles`
*/
guildRoles(guildID: string) {
return `/guilds/${guildID}/roles`;
},
/**
* Route for:
* - PATCH `/guilds/{guild.id}/roles/{role.id}`
* - DELETE `/guilds/{guild.id}/roles/{role.id}`
*/
guildRole(guildID: string, roleID: string) {
return `/guilds/${guildID}/roles/${roleID}`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/prune`
* - POST `/guilds/{guild.id}/prune`
*/
guildPrune(guildID: string) {
return `/guilds/${guildID}/prune`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/regions`
*/
guildVoiceRegions(guildID: string) {
return `/guilds/${guildID}/regions`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/invites`
*/
guildInvites(guildID: string) {
return `/guilds/${guildID}/invites`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/integrations`
* - POST `/guilds/{guild.id}/integrations`
*/
guildIntegrations(guildID: string) {
return `/guilds/${guildID}/integrations`;
},
/**
* Route for:
* - PATCH `/guilds/{guild.id}/integrations/{integration.id}`
* - DELETE `/guilds/{guild.id}/integrations/{integration.id}`
*/
guildIntegration(guildID: string, integrationID: string) {
return `/guilds/${guildID}/integrations/${integrationID}`;
},
/**
* Route for:
* - POST `/guilds/{guild.id}/integrations/{integration.id}/sync`
*/
guildIntegrationSync(guildID: string, integrationID: string) {
return `/guilds/${guildID}/integrations/${integrationID}/sync`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/widget`
* - PATCH `/guilds/{guild.id}/widget`
*/
guildWidgetSettings(guildID: string) {
return `/guilds/${guildID}/widget`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/widget.json`
*/
guildWidgetJSON(guildID: string) {
return `/guilds/${guildID}/widget.json`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/vanity-url`
*/
guildVanityUrl(guildID: string) {
return `/guilds/${guildID}/vanity-url`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/widget.png`
*/
guildWidgetImage(guildID: string) {
return `/guilds/${guildID}/widget.png`;
},
/**
* Route for:
* - GET `/invites/{invite.code}`
* - DELETE `/invites/{invite.code}`
*/
invite(code: string) {
return `/invites/${code}`;
},
/**
* Route for:
* - GET `/guilds/templates/{template.code}`
* - POST `/guilds/templates/{template.code}`
*/
template(code: string) {
return `/guilds/templates/${code}`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/templates`
* - POST `/guilds/{guild.id}/templates`
*/
guildTemplates(guildID: string) {
return `/guilds/${guildID}/templates`;
},
/**
* Route for:
* - PUT `/guilds/{guild.id}/templates/{template.code}`
* - PATCH `/guilds/{guild.id}/templates/{template.code}`
* - DELETE `/guilds/{guild.id}/templates/{template.code}`
*/
guildTemplate(guildID: string, code: string) {
return `/guilds/${guildID}/templates/${code}`;
},
/**
* Route for:
* - GET `/users/@me`
* - GET `/users/{user.id}`
* - PATCH `/users/@me`
*
* @param [userID='@me'] The user ID, defaulted to `@me`
*/
user(userID = '@me') {
return `/users/${userID}`;
},
/**
* Route for:
* - GET `/users/@me/guilds`
*/
userGuilds() {
return `/users/@me/guilds`;
},
/**
* Route for:
* - DELETE `/users/@me/guilds/{guild.id}`
*/
userGuild(guildID: string) {
return `/users/@me/guilds/${guildID}`;
},
/**
* Route for:
* - POST `/users/@me/channels`
*/
userChannels() {
return `/users/@me/channels`;
},
/**
* Route for:
* - GET `/users/@me/connections`
*/
userConnections() {
return `/users/@me/connections`;
},
/**
* Route for:
* - GET `/voice/regions`
*/
voiceRegions() {
return `/voice/regions`;
},
/**
* Route for:
* - GET `/channels/{channel.id}/webhooks`
* - POST `/channels/{channel.id}/webhooks`
*/
channelWebhooks(channelID: string) {
return `/channels/${channelID}/webhooks`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/webhooks`
*/
guildWebhooks(guildID: string) {
return `/guilds/${guildID}/webhooks`;
},
/**
* Route for:
* - GET `/webhooks/{webhook.id}`
* - GET `/webhooks/{webhook.id}/{webhook.token}`
* - PATCH `/webhooks/{webhook.id}`
* - PATCH `/webhooks/{webhook.id}/{webhook.token}`
* - DELETE `/webhooks/{webhook.id}`
* - DELETE `/webhooks/{webhook.id}/{webhook.token}`
* - POST `/webhooks/{webhook.id}/{webhook.token}`
*
* - POST `/webhooks/{application.id}/{interaction.token}`
*/
webhook(webhookID: string, webhookToken?: string) {
const parts = ['', 'webhooks', webhookID];
if (webhookToken) parts.push(webhookToken);
return parts.join('/');
},
/**
* Route for:
* - PATCH `/webhooks/{webhook.id}/{webhook.token}/messages/@original`
* - PATCH `/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}`
* - DELETE `/webhooks/{webhook.id}/{webhook.token}/messages/@original`
* - DELETE `/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}`
*
* - PATCH `/webhooks/{application.id}/{interaction.token}/messages/@original`
* - PATCH `/webhooks/{application.id}/{interaction.token}/messages/{message.id}`
* - DELETE `/webhooks/{application.id}/{interaction.token}/messages/{message.id}`
*
* @param [messageID='@original'] The message ID to change, defaulted to `@original`
*/
webhookMessage(webhookID: string, webhookToken: string, messageID = '@original') {
return `/webhooks/${webhookID}/${webhookToken}/messages/${messageID}`;
},
/**
* Route for:
* - POST `/webhooks/{webhook.id}/{webhook.token}/github`
* - POST `/webhooks/{webhook.id}/{webhook.token}/slack`
*/
webhookPlatform(webhookID: string, webhookToken: string, platform: 'github' | 'slack') {
return `/webhooks/${webhookID}/${webhookToken}/${platform}`;
},
/**
* Route for:
* - GET `/gateway`
*/
gateway() {
return `/gateway`;
},
/**
* Route for:
* - GET `/gateway/bot`
*/
gatewayBot() {
return `/gateway/bot`;
},
/**
* Route for:
* - GET `/oauth2/applications/@me`
*/
oauth2CurrentApplication() {
return `/oauth2/applications/@me`;
},
/**
* Route for:
* - GET `/applications/{application.id}/commands`
* - POST `/applications/{application.id}/commands`
*/
applicationCommands(applicationID: string) {
return `/applications/${applicationID}/commands`;
},
/**
* Route for:
* - PATCH `/applications/{application.id}/commands/{command.id}`
* - DELETE `/applications/{application.id}/commands/{command.id}`
*/
applicationCommand(applicationID: string, commandID: string) {
return `/applications/${applicationID}/commands/${commandID}`;
},
/**
* Route for:
* - GET `/applications/{application.id}/guilds/{guild.id}/commands`
* - POST `/applications/{application.id}/guilds/{guild.id}/commands`
*/
applicationGuildCommands(applicationID: string, guildID: string) {
return `/applications/${applicationID}/guilds/${guildID}/commands`;
},
/**
* Route for:
* - PATCH `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}`
* - DELETE `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}`
*/
applicationGuildCommand(applicationID: string, guildID: string, commandID: string) {
return `/applications/${applicationID}/guilds/${guildID}/commands/${commandID}`;
},
/**
* Route for:
* - POST `/interactions/{interaction.id}/{interaction.token}/callback`
*/
interactionCallback(interactionID: string, interactionToken: string) {
return `/interactions/${interactionID}/${interactionToken}/callback`;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/member-verification`
* - PATCH `/guilds/{guild.id}/member-verification`
*/
guildMemberVerification(guildID: string) {
return `/guilds/${guildID}/member-verification`;
},
};
export const OAuth2Routes = {
authorizationURL: `https://discord.com/api/v${APIVersion}/oauth2/authorize`,
tokenURL: `https://discord.com/api/v${APIVersion}/oauth2/token`,
/**
* See https://tools.ietf.org/html/rfc7009
*/
tokenRevocationURL: `https://discord.com/api/v${APIVersion}/oauth2/token/revoke`,
} as const;
/**
* Freeze route object
* @internal
*/
Object.freeze(OAuth2Routes);

View File

@@ -1,6 +0,0 @@
import type { APIVoiceRegion } from '../payloads/mod.ts';
/**
* https://discord.com/developers/docs/resources/voice#list-voice-regions
*/
export type GetAPIVoiceRegionsResult = APIVoiceRegion[];

View File

@@ -0,0 +1,135 @@
import { AST_NODE_TYPES, ESLintUtils, TSESTree } from '@typescript-eslint/utils';
import * as typescript from 'typescript';
import * as tsutils from 'tsutils';
type Options = [
{
interfaceEndings: string[];
},
];
function shouldRun(eslNode: TSESTree.TSPropertySignature, interfaceEndings: string[]): boolean {
// The first parent is the TSInterfaceBody, the second is the TSInterfaceDeclaration
const interfaceNode = eslNode.parent?.parent;
if (!(interfaceNode && 'id' in interfaceNode && interfaceNode.id?.type === AST_NODE_TYPES.Identifier)) {
return false;
}
const { name } = interfaceNode.id;
if (typeof name !== 'string') {
return false;
}
return interfaceEndings.some((ending) => name.endsWith(ending));
}
const schema = [
{
type: 'object',
properties: {
interfaceEndings: {
type: 'array',
items: {
type: 'string',
},
},
},
},
] as const;
export = {
rules: {
'explicitly-optional-undefined-properties': ESLintUtils.RuleCreator.withoutDocs<Options, 'missingOptional'>({
create: (context) => {
const { interfaceEndings } = context.options[0];
return {
TSPropertySignature: (eslNode) => {
if (!shouldRun(eslNode, interfaceEndings)) {
return;
}
if (eslNode.optional) {
return;
}
const parserServices = ESLintUtils.getParserServices(context);
const checker = parserServices.program.getTypeChecker();
const tsNode = parserServices.esTreeNodeToTSNodeMap.get(eslNode);
const type = checker.getApparentType(checker.getTypeAtLocation(tsNode));
const unionParts = tsutils.unionTypeParts(type);
// If our prop is not optional, but has undefined in its union, we should report
if (!unionParts.some((ty) => tsutils.isTypeFlagSet(ty, typescript.TypeFlags.Undefined))) {
return;
}
context.report({
node: eslNode,
messageId: 'missingOptional',
fix: (fixer) => fixer.insertTextAfter(eslNode.key, '?'),
});
},
};
},
meta: {
fixable: 'code',
messages: {
missingOptional: 'When a property has `| undefined`, it should be marked as optional.',
},
type: 'problem',
schema: schema,
},
defaultOptions: [{ interfaceEndings: [] }],
}),
'explicit-undefined-on-optional-properties': ESLintUtils.RuleCreator.withoutDocs<Options, 'missingUndefined'>({
create: (context) => {
const { interfaceEndings } = context.options[0];
return {
// This is done naively because type-checking the node will always include `| undefined`
// due to it being optional. ideally, we'd have a way to get the type of the node disregarding
// the optional flag, which would make this check a lot more trivial
TSPropertySignature: (eslNode) => {
if (!shouldRun(eslNode, interfaceEndings)) {
return;
}
// If our prop is't optional or if it doesn't have a type annotation, we don't need to do anything
if (!eslNode.optional || !eslNode.typeAnnotation) {
return;
}
const { typeAnnotation } = eslNode.typeAnnotation;
switch (typeAnnotation.type) {
case AST_NODE_TYPES.TSUnionType: {
if (typeAnnotation.types.some((t) => t.type === AST_NODE_TYPES.TSUndefinedKeyword)) {
return;
}
break;
}
case AST_NODE_TYPES.TSUndefinedKeyword: {
return;
}
}
context.report({
node: eslNode,
messageId: 'missingUndefined',
fix: (fixer) => fixer.insertTextAfter(eslNode.typeAnnotation!, ' | undefined'),
});
},
};
},
meta: {
fixable: 'code',
messages: {
missingUndefined: 'When a property is optional, explicitly include `undefined` in the union.',
},
type: 'suggestion',
schema: schema,
},
defaultOptions: [{ interfaceEndings: [] }],
}),
},
};

View File

@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"declaration": false,
"declarationMap": false,
"skipLibCheck": true
},
"include": ["./index.ts"]
}

1
.eslintignore Normal file
View File

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

21
.eslintrc.json Normal file
View File

@@ -0,0 +1,21 @@
{
"extends": ["neon/common", "neon/node", "neon/typescript", "neon/prettier"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"project": "./tsconfig.eslint.json"
},
"plugins": ["local"],
"rules": {
"local/explicit-undefined-on-optional-properties": ["error", { "interfaceEndings": ["JSONBody"] }],
"local/explicitly-optional-undefined-properties": ["error", { "interfaceEndings": ["JSONBody"] }],
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
"@typescript-eslint/prefer-literal-enum-member": "off",
"@typescript-eslint/sort-type-union-intersection-members": "off",
"import/extensions": "off",
"tsdoc/syntax": "off",
"typescript-sort-keys/interface": "off",
"typescript-sort-keys/string-enum": "off",
"unicorn/prefer-math-trunc": "off",
"jsdoc/no-undefined-types": "off"
}
}

10
.github/CODEOWNERS vendored Normal file
View File

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

76
.github/CODE_OF_CONDUCT.md vendored Normal file
View File

@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct
## Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.
## Our Standards
Examples of behavior that contributes to creating a positive environment
include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
## Scope
This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at https://discord.gg/djs. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
## Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
[homepage]: https://www.contributor-covenant.org
For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq

91
.github/COMMIT_CONVENTION.md vendored Normal file
View File

@@ -0,0 +1,91 @@
## Git Commit Message Convention
> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular).
#### TL;DR:
Messages must be matched by the following regex:
```js
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .{1,72}/;
```
#### Examples
Appears under "Features" header, `GuildMember` subheader:
```
feat(GuildMember): add 'tag' method
```
Appears under "Bug Fixes" header, `Guild` subheader, with a link to issue #28:
```
fix(Guild): handle events correctly
close #28
```
Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:
```
perf(core): improve patching by removing 'bar' option
BREAKING CHANGE: The 'bar' option has been removed.
```
The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header.
```
revert: feat(Managers): add Managers
This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
```
### Full Message Format
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:
```
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
```
The **header** is mandatory and the **scope** of the header is optional.
### Revert
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body, it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
### Type
If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However, if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog.
Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks.
### Scope
The scope could be anything specifying the place of the commit change. For example `GuildMember`, `Guild`, `Message`, `MessageEmbed` etc...
### Subject
The subject contains a succinct description of the change:
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize the first letter
- no dot (.) at the end
### Body
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
The body should include the motivation for the change and contrast this with previous behavior.
### Footer
The footer should contain any information about **Breaking Changes** and is also the place to
reference GitHub issues that this commit **Closes**.
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.

53
.github/CONTRIBUTING.md vendored Normal file
View File

@@ -0,0 +1,53 @@
# discord-api-types Contributing Guide
**The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the [Discord server](https://discord.gg/djs) instead of opening an issue, or on [GitHub Discussions](https://github.com/discordjs/discord-api-types/discussions) you will get redirected there anyway.**
- [Code of Conduct](https://github.com/discordjs/discord-api-types/blob/main/.github/CODE_OF_CONDUCT.md)
- [Pull Request Guidelines](#pull-request-guidelines)
- [Development Setup](#development-setup)
- [Project Structure](#project-structure)
- [Contributing Tests](#contributing-tests)
## Pull Request Guidelines
- Checkout a topic branch from a base branch, e.g. `main`, and merge back against that branch.
- If adding a new feature:
- Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it.
- If fixing a bug:
- If you are resolving a special issue, add `fix/close #xxxx[,#xxxx]` (#xxxx is the issue id) in your PR body for a better release log, e.g.
```
fix(Guild): handle events correctly
close #28
```
- Provide a detailed description of the bug in the PR. Live demo preferred.
- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging.
- Make sure tests pass!
- Commit messages must follow the [commit message convention](./COMMIT_CONVENTION.md) so that changelogs can be automatically generated. Commit messages are automatically validated before commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)).
- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)).
## Development Setup
You will need [Node.js](http://nodejs.org) **version 12+**, and [npm](https://www.npmjs.com/).
After cloning the repo, run:
```bash
$ npm i # install the dependencies of the project
```
A high level overview of tools used:
- [TypeScript](https://www.typescriptlang.org/) as the development language
- [ESLint](https://eslint.org/) for code-style
- [Prettier](https://prettier.io/) for code formatting

83
.github/ISSUE_TEMPLATE/bug_report.yml vendored Normal file
View File

@@ -0,0 +1,83 @@
name: Bug report
description: Report incorrect or unexpected behavior of discord-api-types, or a mistyped type
labels: [bug]
body:
- type: markdown
attributes:
value: |
Use Discord for questions: https://discord.gg/djs
- type: textarea
id: description
attributes:
label: Issue description
description: |
Please describe the problem you are having in as much detail as possible.
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files into it.
placeholder: |
Steps to reproduce with below code sample:
1. do thing
2. it broke :c
validations:
required: true
- type: textarea
id: codesample
attributes:
label: Code sample
description: Include a reproducible, minimal code sample. This will be automatically formatted into code, so no need for backticks.
render: typescript
placeholder: |
Your code sample should be...
... Minimal - Use as little code as possible that still produces the same problem (and is understandable)
... Complete - Provide all parts someone else needs to reproduce your problem
... Reproducible - Test the code you're about to provide to make sure it reproduces the problem
- type: input
id: types-version
attributes:
label: Package version
description: Which version of the package are you using? Run `npm list discord-api-types` in your project directory and paste the output.
validations:
required: true
- type: dropdown
id: runtime
attributes:
label: Runtime
description: What runtime are you using?
options:
- Node.js
- Deno
- Bun
- Other / Browser
validations:
required: true
- type: input
id: runtime-version
attributes:
label: Runtime version
description: |
Which version of your runtime of choice are you using?
If you are using TypeScript, please include its version (`npm list typescript`) as well.
For Node.js: Run `node --version` in your project directory and paste the output.
For Deno: Run `deno --version` in your project directory and paste the output.
For Bun: Run `bun --version` in your project directory and paste the output.
For Other / Browser: Find the version in your runtime of choice and paste it here.
placeholder: v4.2.0
validations:
required: true
- type: dropdown
id: priority
attributes:
label: Priority this issue should have
description: Please be realistic. If you need to elaborate on your reasoning, please use the Issue description field above.
options:
- Low (slightly annoying)
- Medium (should be fixed soon)
- High (immediate attention needed)
validations:
required: true

5
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Discord server
url: https://discord.gg/djs
about: Please visit our Discord server for questions and support requests.

View File

@@ -0,0 +1,39 @@
name: Feature request
description: Request a feature for the discord-api-types library (we accept documented features of the official Discord developer API only!)
labels: [discussion]
body:
- type: markdown
attributes:
value: |
We will only only document types that Discord publishes, documents, and merges into the Discord API documentation.
We do not implement unreleased types, or types considered client only.
Use Discord for questions: https://discord.gg/djs
- type: textarea
id: description
attributes:
label: Feature
description: A clear and concise description of what the problem is, or what feature you want to be implemented.
placeholder: I'm always frustrated when..., Discord has recently released..., A good addition would be...
validations:
required: true
- type: textarea
id: solution
attributes:
label: Ideal solution or implementation
description: A clear and concise description of what you want to happen.
validations:
required: true
- type: textarea
id: alternatives
attributes:
label: Alternative solutions or implementations
description: A clear and concise description of any alternative solutions or features you have considered.
- type: textarea
id: additional-context
attributes:
label: Other context
description: Any other context, screenshots, or file uploads that help us understand your feature request.

3
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View File

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

8
.github/SUPPORT.md vendored Normal file
View File

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

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

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

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

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

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

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

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

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

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

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

56
.github/workflows/cicd.yml vendored Normal file
View File

@@ -0,0 +1,56 @@
name: Continuous Integration / Deployment
on:
push:
branches:
- '**'
pull_request:
jobs:
testing:
name: ESLint and TypeScript compilation
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Add problem matcher
run: echo "::add-matcher::.github/problemMatchers/eslint.json" && echo "::add-matcher::.github/problemMatchers/tsc.json"
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci
- name: Check lint on discord-api-types
run: npm run test:lint
- name: Run TSC
run: npm run build:ci
tsd:
name: TSD checks
runs-on: ubuntu-latest
needs: testing
if: needs.testing.result == 'success'
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
run: npm ci
- name: Run TSD
run: npm run test:types

View File

@@ -1,42 +0,0 @@
name: Code Quality
on:
push:
branches:
- master
- main
- stable
pull_request:
jobs:
ESLint:
name: ESLint
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v1
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install Dependencies
run: npm ci
- name: Run ESLint
uses: icrawl/action-eslint@v1
with:
custom-glob: '{v*,default,common}/**'
TypeScript:
name: TypeScript
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v1
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install Dependencies
run: npm ci
- name: Run TSC
uses: icrawl/action-tsc@v1

View File

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

View File

@@ -1,40 +0,0 @@
name: Deno Deploy
on:
push:
jobs:
BuildDeno:
name: Publish Deno Types
runs-on: ubuntu-latest
if: "contains(github.event.head_commit.message, 'release')"
steps:
- name: Checkout Project
uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14
- name: Install Dependencies
run: npm ci
- name: Get GitHub Branch Name
run: echo "GITHUB_BRANCH_NAME=$(echo ${{ github.ref }} | cut -c12-)" >> $GITHUB_ENV
- name: Push new code
run: |
# Build files
npm run build:deno
echo -e "\n# Commit and push"
git add --all .
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "build: deno build for ${GITHUB_SHA}" || true
git push origin $TARGET_BRANCH
env:
TARGET_BRANCH: '${{ env.GITHUB_BRANCH_NAME }}'
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'

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

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

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

@@ -0,0 +1,17 @@
name: 'PR Automation'
on:
pull_request_target:
jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Automatically label PR
uses: actions/labeler@v5
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
sync-labels: true

53
.github/workflows/publish-next.yml vendored Normal file
View File

@@ -0,0 +1,53 @@
name: Publish next
on:
workflow_dispatch:
push:
branches:
- main
jobs:
publish:
concurrency:
group: publish-next
cancel-in-progress: true
name: Publish @next release to npm
runs-on: ubuntu-latest
permissions:
id-token: write
if: github.repository_owner == 'discordjs' && !(github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release)'))
steps:
# - name: Cancel previous publish attempts
# uses: styfle/cancel-workflow-action@0.12.1
# with:
# access_token: ${{ github.token }}
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Node v20
uses: actions/setup-node@v4
with:
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci
- name: Bump version
run: node ./scripts/bump-version.mjs
- name: Deprecate old @next versions
run: npx npm-deprecate --name "*next*" --package discord-api-types --message "No longer supported. Install the latest @next release" || true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Publish new @next version
run: |
npm version $(jq --raw-output '.version' package.json)-next.$(git rev-parse --short HEAD).$(date +%s)
npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

70
.gitignore vendored
View File

@@ -1,24 +1,60 @@
node_modules/
out/
coverage/
.nyc_output/
debug.log
# Custom ESLint rules
.eslint-plugin-local/*
!.eslint-plugin-local/index.ts
!.eslint-plugin-local/tsconfig.json
# Don't commit build outputs
globals.js
globals.*map
globals.d.ts
globals.mjs
v*/**/*.js
v*/**/*.map
v*/**/*.d.ts
v*/**/*.mjs
v*.js
v*.*map
v*.d.ts
v*.mjs
default/*.js
default/*.map
default/*.d.ts
default/*.mjs
deno/**/*.js
deno/**/*.map
deno/**/*.d.ts
deno/**/*.mjs
common/*.js
common/*.map
common/*.d.ts
common/*.mjs
gateway/**/*.js
gateway/**/*.map
gateway/**/*.d.ts
gateway/**/*.mjs
payloads/**/*.js
payloads/**/*.map
payloads/**/*.d.ts
payloads/**/*.mjs
rest/**/*.js
rest/**/*.map
rest/**/*.d.ts
rest/**/*.mjs
rpc/**/*.js
rpc/**/*.map
rpc/**/*.d.ts
rpc/**/*.mjs
shortcuts/**/*.js
shortcuts/**/*.map
shortcuts/**/*.d.ts
shortcuts/**/*.mjs
utils/**/*.js
utils/**/*.map
utils/**/*.d.ts
utils/**/*.mjs
voice/**/*.js
voice/**/*.map
voice/**/*.d.ts
voice/**/*.mjs
# macOS files
.DS_Store

1
.husky/commit-msg Executable file
View File

@@ -0,0 +1 @@
npx --no-install commitlint --edit $1

1
.husky/pre-commit Executable file
View File

@@ -0,0 +1 @@
npx --no-install pretty-quick --staged && npx --no-install lint-staged && npm run build:deno && git add deno

6
.npmrc Normal file
View File

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

26
.prettierignore Normal file
View File

@@ -0,0 +1,26 @@
# Node modules
node_modules/
# Generated data
deno/
# Versioned json
website/versioned_sidebars/
website/versioned_docs/
website/versions.json
website/.docusaurus/
website/build
# Don't format build outputs
*.js
*.d.ts
*.mjs
# Miscellaneous
CODEOWNERS
renovate.json
CHANGELOG.md
# Format all of scripts
!scripts/**/*
!.prettierrc.mjs

12
.prettierrc.mjs Normal file
View File

@@ -0,0 +1,12 @@
import sapphirePrettierConfig from '@sapphire/prettier-config';
export default {
...sapphirePrettierConfig,
printWidth: 120,
useTabs: true,
singleQuote: true,
quoteProps: 'as-needed',
trailingComma: 'all',
endOfLine: 'lf',
experimentalTernaries: true,
};

10
.vscode/settings.json vendored Normal file
View File

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

1516
CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

101
README.md
View File

@@ -1,9 +1,14 @@
<div style="text-align:center;"><h1>Discord API Types</h1></div>
# Discord API Types
[![discord-api-types](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/svgs/logo_long_blurple.svg)](https://github.com/discordjs/discord-api-types)
[![GitHub](https://img.shields.io/github/license/discordjs/discord-api-types)](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
[![npm](https://img.shields.io/npm/v/discord-api-types?color=crimson&logo=npm)](https://www.npmjs.com/package/discord-api-types)
[![deno](https://img.shields.io/npm/v/discord-api-types?color=blue&label=deno&logo=deno)](https://deno.land/x/discord_api_types)
[![Patreon Donate](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Donate%20with%20Patreon&logo=patreon&colorB=F96854&link=https://www.patreon.com/vladfrangu)](https://www.patreon.com/vladfrangu)
[![Ko-fi Donate](https://img.shields.io/badge/kofi-donate-brightgreen.svg?label=Donate%20with%20Ko-fi&logo=ko-fi&colorB=F16061&link=https://ko-fi.com/wolfgalvlad&logoColor=FFFFFF)](https://ko-fi.com/wolfgalvlad)
[![GitHub Sponsors](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Sponsor%20through%20GitHub&logo=github&colorB=F96854&link=https://github.com/sponsors/vladfrangu)](https://github.com/sponsors/vladfrangu)
[![Powered by Vercel](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/powered-by-vercel.svg)](https://vercel.com?utm_source=discordjs&utm_campaign=oss)
Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro).
@@ -17,86 +22,84 @@ yarn add discord-api-types
pnpm add discord-api-types
```
### Usage
You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples
```js
const { APIUser } = require('discord-api-types/v10');
```
```ts
// TypeScript/ES Module support
import { APIUser } from 'discord-api-types/v10';
```
You may also import just certain parts of the module that you need. The possible values are: `globals`, `gateway`, `gateway/v*`, `payloads`, `payloads/v*`, `rest`, `rest/v*`, `rpc`, `rpc/v*`, `utils`, `utils/v*`, `voice`, and `voice/v*`. Below are some examples
```js
const { GatewayVersion } = require('discord-api-types/gateway/v10');
```
```ts
// TypeScript/ES Module support
import { GatewayVersion } from 'discord-api-types/gateway/v10';
```
> _**Note:** The `v*` exports (`discord-api-types/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
### Deno
We also provide typings compatible with the [deno](https://deno.land/) runtime. You have 3 ways you can import them:
1. Directly from GitHub
```ts
// Importing the default API version
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/.deno/mod.ts';
// Importing a specific API version
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/.deno/v8/mod.ts';
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v10.ts';
```
2. From [deno.land/x](https://deno.land/x)
```ts
// Importing the default API version
import { APIUser } from 'https://deno.land/x/discord_api_types@0.12.0/mod.ts';
// Importing a specific API version
import { APIUser } from 'https://deno.land/x/discord_api_types@0.12.0/v8/mod.ts';
import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts';
```
3. From [skypack.dev](https://www.skypack.dev/)
```ts
// Importing the default API version
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types?dts';
// Importing a specific API version
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v8?dts';
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
```
## Project Structure
The exports of each API version is split into three main parts:
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `common` directory. They will still be prefixed accordingly as described above.
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means _and have received the green light to be used_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will NOT be included.
**A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs),
that are mentioned in an open pull request, or known through other means _and have received the green light to be used_.
Anything else will not be documented (for example client only types).
## Usage
You can `require` / `import` the module directly, which will give you the latest types as of the current API version. This is considered the `default` version and will be updated according to Discord's default API version; this means it may break at any point in time.
> We **strongly recommend** you use a version when importing this module! This will prevent breaking changes when updating the module.
```js
const { APIUser } = require('discord-api-types');
```
```ts
// TypeScript/ES Module support
import { APIUser } from 'discord-api-types';
```
You should instead consider adding the API version you want to target by appending `/v*`, where the `*` represents the API version.
```js
const { APIUser } = require('discord-api-types/v8');
```
```ts
// TypeScript/ES Module support
import { APIUser } from 'discord-api-types/v8';
```
With that aside, we may allow certain types that are not documented in the [API Documentation repository](https://github.com/discord/discord-api-docs) on a case by case basis.
They will be documented with an `@unstable` tag and are not subject with the same versioning rules.

View File

@@ -1,149 +0,0 @@
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes
*/
export const enum RESTJSONErrorCodes {
GeneralError,
UnknownAccount = 10001,
UnknownApplication,
UnknownChannel,
UnknownGuild,
UnknownIntegration,
UnknownInvite,
UnknownMember,
UnknownMessage,
UnknownPermissionOverwrite,
UnknownProvider,
UnknownRole,
UnknownToken,
UnknownUser,
UnknownEmoji,
UnknownWebhook,
UnknownBan = 10026,
UnknownSKU,
UnknownStoreListing,
UnknownEntitlement,
UnknownBuild,
UnknownLobby,
UnknownBranch,
UnknownRedistributable = 10036,
BotsCannotUseThisEndpoint = 20001,
OnlyBotsCanUseThisEndpoint,
AnnouncementEditLimitExceeded = 20022,
ChannelSendRateLimit = 20028,
MaximumNumberOfGuildsReached = 30001,
MaximumNumberOfFriendsReached,
MaximumNumberOfPinsReachedForTheChannel,
MaximumNumberOfGuildRolesReached = 30005,
MaximumNumberOfWebhooksReached = 30007,
MaximumNumberOfReactionsReached = 30010,
MaximumNumberOfGuildChannelsReached = 30013,
MaximumNumberOfAttachmentsInAMessageReached = 30015,
MaximumNumberOfInvitesReached,
GuildAlreadyHasTemplate = 30031,
Unauthorized = 40001,
VerifyYourAccount,
RequestEntityTooLarge = 40005,
FeatureTemporarilyDisabledServerSide,
UserBannedFromThisGuild,
ThisMessageWasAlreadyCrossposted = 40033,
MissingAccess = 50001,
InvalidAccountType,
CannotExecuteActionOnDMChannel,
GuildWidgetDisabled,
CannotEditMessageAuthoredByAnotherUser,
CannotSendAnEmptyMessage,
CannotSendMessagesToThisUser,
CannotSendMessagesInVoiceChannel,
ChannelVerificationLevelTooHighForYouToGainAccess,
Oauth2ApplicationDoesNotHaveBot,
Oauth2ApplicationLimitReached,
InvalidOauth2State,
MissingPermissions,
InvalidToken,
NoteWasTooLong,
ProvidedTooFewOrTooManyMessagesToDelete,
MessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019,
InviteCodeInvalidOrTaken,
CannotExecuteActionOnSystemMessage,
CannotExecuteActionOnThisChannelType = 50024,
InvalidOauth2AccessToken,
InvalidRecipients = 50033,
OneOfTheMessagesProvidedWasTooOldForBulkDelete,
InvalidFormBodyOrContentType,
InviteAcceptedToGuildWithoutTheBotBeingIn,
InvalidAPIVersion = 50041,
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
InvalidStickerSent = 50081,
TwoFactorAuthenticationIsRequired = 60003,
ReactionWasBlocked = 90001,
APIResourceOverloaded = 130000,
}
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes
*/
export const enum RPCErrorCodes {
UnknownError = 1000,
InvalidPayload = 4000,
InvalidCommand = 4002,
InvalidGuild,
InvalidEvent,
InvalidChannel,
InvalidPermissions,
InvalidClientID,
InvalidOrigin,
InvalidToken,
InvalidUser,
OAuth2Error = 5000,
SelectChannelTimedOut,
GetGuildTimedOut,
SelectVoiceForceRequired,
CaptureShortcutAlreadyListening,
}
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-close-event-codes
*/
export const enum RPCCloseEventCodes {
InvalidClientID = 4000,
InvalidOrigin,
RateLimited,
TokenRevoked,
InvalidVersion,
InvalidEncoding,
}
/**
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params
*/
export interface GatewayConnectQuery {
v: string;
encoding: 'json' | 'etf';
compress?: 'zlib-stream';
}

View File

@@ -1,4 +0,0 @@
// This file exports all the types available in the default API version
// Thereby, things MAY break in the future
export * from '../v8/index';

1516
deno/CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

105
deno/README.md Normal file
View File

@@ -0,0 +1,105 @@
# Discord API Types
[![discord-api-types](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/svgs/logo_long_blurple.svg)](https://github.com/discordjs/discord-api-types)
[![GitHub](https://img.shields.io/github/license/discordjs/discord-api-types)](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
[![npm](https://img.shields.io/npm/v/discord-api-types?color=crimson&logo=npm)](https://www.npmjs.com/package/discord-api-types)
[![deno](https://img.shields.io/npm/v/discord-api-types?color=blue&label=deno&logo=deno)](https://deno.land/x/discord_api_types)
[![Patreon Donate](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Donate%20with%20Patreon&logo=patreon&colorB=F96854&link=https://www.patreon.com/vladfrangu)](https://www.patreon.com/vladfrangu)
[![Ko-fi Donate](https://img.shields.io/badge/kofi-donate-brightgreen.svg?label=Donate%20with%20Ko-fi&logo=ko-fi&colorB=F16061&link=https://ko-fi.com/wolfgalvlad&logoColor=FFFFFF)](https://ko-fi.com/wolfgalvlad)
[![GitHub Sponsors](https://img.shields.io/badge/patreon-donate-brightgreen.svg?label=Sponsor%20through%20GitHub&logo=github&colorB=F96854&link=https://github.com/sponsors/vladfrangu)](https://github.com/sponsors/vladfrangu)
[![Powered by Vercel](https://raw.githubusercontent.com/discordjs/discord-api-types/main/website/static/powered-by-vercel.svg)](https://vercel.com?utm_source=discordjs&utm_campaign=oss)
Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro).
## Installation
Install with [npm](https://www.npmjs.com/) / [yarn](https://yarnpkg.com) / [pnpm](https://pnpm.js.org/):
```sh
npm install discord-api-types
yarn add discord-api-types
pnpm add discord-api-types
```
### Usage
You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples
```js
const { APIUser } = require('discord-api-types/v10');
```
```ts
// TypeScript/ES Module support
import { APIUser } from 'discord-api-types/v10';
```
You may also import just certain parts of the module that you need. The possible values are: `globals`, `gateway`, `gateway/v*`, `payloads`, `payloads/v*`, `rest`, `rest/v*`, `rpc`, `rpc/v*`, `utils`, `utils/v*`, `voice`, and `voice/v*`. Below are some examples
```js
const { GatewayVersion } = require('discord-api-types/gateway/v10');
```
```ts
// TypeScript/ES Module support
import { GatewayVersion } from 'discord-api-types/gateway/v10';
```
> _**Note:** The `v*` exports (`discord-api-types/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
### Deno
We also provide typings compatible with the [deno](https://deno.land/) runtime. You have 3 ways you can import them:
1. Directly from GitHub
```ts
// Importing a specific API version
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v10.ts';
```
2. From [deno.land/x](https://deno.land/x)
```ts
// Importing a specific API version
import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts';
```
3. From [skypack.dev](https://www.skypack.dev/)
```ts
// Importing a specific API version
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
```
## Project Structure
The exports of each API version is split into three main parts:
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
**A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs),
that are mentioned in an open pull request, or known through other means _and have received the green light to be used_.
Anything else will not be documented (for example client only types).
With that aside, we may allow certain types that are not documented in the [API Documentation repository](https://github.com/discord/discord-api-docs) on a case by case basis.
They will be documented with an `@unstable` tag and are not subject with the same versioning rules.

8
deno/gateway/common.ts Normal file
View File

@@ -0,0 +1,8 @@
/**
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params
*/
export interface GatewayURLQuery {
v: string;
encoding: 'etf' | 'json';
compress?: 'zlib-stream';
}

4
deno/gateway/mod.ts Normal file
View File

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

2142
deno/gateway/v10.ts Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -16,7 +16,9 @@ import type {
GatewayVoiceState,
InviteTargetUserType,
PresenceUpdateStatus,
} from '../payloads/mod.ts';
} from '../payloads/v6/mod.ts';
export * from './common.ts';
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
@@ -25,6 +27,7 @@ export const GatewayVersion = '6';
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export enum GatewayOPCodes {
@@ -44,17 +47,18 @@ export enum GatewayOPCodes {
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export enum GatewayCloseCodes {
UnknownError = 4000,
UnknownError = 4_000,
UnknownOpCode,
DecodeError,
NotAuthenticated,
AuthenticationFailed,
AlreadyAuthenticated,
InvalidSeq = 4007,
InvalidSeq = 4_007,
RateLimited,
SessionTimedOut,
InvalidShard,
@@ -66,6 +70,7 @@ export enum GatewayCloseCodes {
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export enum VoiceOPCodes {
@@ -85,28 +90,30 @@ export enum VoiceOPCodes {
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export enum VoiceCloseCodes {
UnknownOpCode = 4001,
UnknownOpCode = 4_001,
NotAuthenticated = 4003,
NotAuthenticated = 4_003,
AuthenticationFailed,
AlreadyAuthenticated,
SessionNoLongerValid,
SessionTimeout = 4009,
SessionTimeout = 4_009,
ServerNotFound = 4011,
ServerNotFound = 4_011,
UnknownProtocol,
Disconnected = 4014,
Disconnected = 4_014,
VoiceServerCrashed,
UnknownEncryptionMode,
}
/**
* https://discord.com/developers/docs/topics/gateway#list-of-intents
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export enum GatewayIntentBits {
@@ -129,6 +136,7 @@ export enum GatewayIntentBits {
/**
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export enum GatewayDispatchEvents {
@@ -176,61 +184,62 @@ export enum GatewayDispatchEvents {
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayUpdatePresence
| GatewayVoiceStateUpdate
| GatewayRequestGuildMembers
| GatewayResume
| GatewayRequestGuildMembers;
| GatewayUpdatePresence
| GatewayVoiceStateUpdate;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayReceivePayload =
| GatewayHello
| GatewayHeartbeatRequest
| GatewayDispatchPayload
| GatewayHeartbeatAck
| GatewayHeartbeatRequest
| GatewayHello
| GatewayInvalidSession
| GatewayReconnect
| GatewayDispatchPayload;
| GatewayReconnect;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayDispatchPayload =
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewayChannelModifyDispatch
| GatewayChannelPinsUpdateDispatch
| GatewayGuildModifyDispatch
| GatewayGuildDeleteDispatch
| GatewayGuildBanModifyDispatch
| GatewayGuildDeleteDispatch
| GatewayGuildEmojisUpdateDispatch
| GatewayGuildIntegrationsUpdateDispatch
| GatewayGuildMemberAddDispatch
| GatewayGuildMemberRemoveDispatch
| GatewayGuildMemberUpdateDispatch
| GatewayGuildMembersChunkDispatch
| GatewayGuildRoleModifyDispatch
| GatewayGuildMemberUpdateDispatch
| GatewayGuildModifyDispatch
| GatewayGuildRoleDeleteDispatch
| GatewayGuildRoleModifyDispatch
| GatewayInviteCreateDispatch
| GatewayInviteDeleteDispatch
| GatewayMessageCreateDispatch
| GatewayMessageUpdateDispatch
| GatewayMessageDeleteDispatch
| GatewayMessageDeleteBulkDispatch
| GatewayMessageDeleteDispatch
| GatewayMessageReactionAddDispatch
| GatewayMessageReactionRemoveDispatch
| GatewayMessageReactionRemoveAllDispatch
| GatewayMessageReactionRemoveDispatch
| GatewayMessageReactionRemoveEmojiDispatch
| GatewayMessageUpdateDispatch
| GatewayPresenceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
// #region Dispatch Payloads
/**
* https://discord.com/developers/docs/topics/gateway#hello
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayHello extends NonDispatchPayload {
@@ -242,6 +251,7 @@ export interface GatewayHello extends NonDispatchPayload {
/**
* https://discord.com/developers/docs/topics/gateway#heartbeating
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayHeartbeatRequest extends NonDispatchPayload {
@@ -251,6 +261,7 @@ export interface GatewayHeartbeatRequest extends NonDispatchPayload {
/**
* https://discord.com/developers/docs/topics/gateway#heartbeating-example-gateway-heartbeat-ack
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayHeartbeatAck extends NonDispatchPayload {
@@ -260,6 +271,7 @@ export interface GatewayHeartbeatAck extends NonDispatchPayload {
/**
* https://discord.com/developers/docs/topics/gateway#invalid-session
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayInvalidSession extends NonDispatchPayload {
@@ -269,6 +281,7 @@ export interface GatewayInvalidSession extends NonDispatchPayload {
/**
* https://discord.com/developers/docs/topics/gateway#reconnect
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayReconnect extends NonDispatchPayload {
@@ -278,6 +291,7 @@ export interface GatewayReconnect extends NonDispatchPayload {
/**
* https://discord.com/developers/docs/topics/gateway#ready
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayReadyDispatch = DataPayload<
@@ -294,6 +308,7 @@ export type GatewayReadyDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#resumed
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
@@ -303,6 +318,7 @@ export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed,
* https://discord.com/developers/docs/topics/gateway#channel-create
* https://discord.com/developers/docs/topics/gateway#channel-update
* https://discord.com/developers/docs/topics/gateway#channel-delete
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayChannelModifyDispatch = DataPayload<
@@ -328,6 +344,7 @@ export type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#channel-pins-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayChannelPinsUpdateDispatch = DataPayload<
@@ -342,6 +359,7 @@ export type GatewayChannelPinsUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-create
* https://discord.com/developers/docs/topics/gateway#guild-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildModifyDispatch = DataPayload<
@@ -361,6 +379,7 @@ export type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-delete
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildDelete, APIUnavailableGuild>;
@@ -368,6 +387,7 @@ export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.Guild
/**
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
* https://discord.com/developers/docs/topics/gateway#guild-ban-remove
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildBanModifyDispatch = DataPayload<
@@ -390,6 +410,7 @@ export type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-emojis-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildEmojisUpdateDispatch = DataPayload<
@@ -402,6 +423,7 @@ export type GatewayGuildEmojisUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-integrations-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildIntegrationsUpdateDispatch = DataPayload<
@@ -411,6 +433,7 @@ export type GatewayGuildIntegrationsUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-add
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildMemberAddDispatch = DataPayload<
@@ -420,6 +443,7 @@ export type GatewayGuildMemberAddDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-remove
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildMemberRemoveDispatch = DataPayload<
@@ -432,6 +456,7 @@ export type GatewayGuildMemberRemoveDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-member-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildMemberUpdateDispatch = DataPayload<
@@ -443,6 +468,7 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-members-chunk
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildMembersChunkDispatch = DataPayload<
@@ -461,6 +487,7 @@ export type GatewayGuildMembersChunkDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-create
* https://discord.com/developers/docs/topics/gateway#guild-role-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildRoleModifyDispatch = DataPayload<
@@ -483,6 +510,7 @@ export type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#guild-role-delete
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayGuildRoleDeleteDispatch = DataPayload<
@@ -495,6 +523,7 @@ export type GatewayGuildRoleDeleteDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#invite-create
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayInviteCreateDispatch = DataPayload<
@@ -516,6 +545,7 @@ export type GatewayInviteCreateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#invite-delete
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayInviteDeleteDispatch = DataPayload<
@@ -529,21 +559,24 @@ export type GatewayInviteDeleteDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#message-create
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageCreateDispatch = DataPayload<GatewayDispatchEvents.MessageCreate, APIMessage>;
/**
* https://discord.com/developers/docs/topics/gateway#message-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageUpdateDispatch = DataPayload<
GatewayDispatchEvents.MessageUpdate,
{ id: string; channel_id: string } & Partial<APIMessage>
Partial<APIMessage> & { id: string; channel_id: string }
>;
/**
* https://discord.com/developers/docs/topics/gateway#message-delete
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageDeleteDispatch = DataPayload<
@@ -557,6 +590,7 @@ export type GatewayMessageDeleteDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#message-delete-bulk
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageDeleteBulkDispatch = DataPayload<
@@ -570,18 +604,21 @@ export type GatewayMessageDeleteBulkDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-add
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageReactionAddDispatch = ReactionData<GatewayDispatchEvents.MessageReactionAdd>;
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageReactionRemoveAllDispatch = DataPayload<
@@ -591,6 +628,7 @@ export type GatewayMessageReactionRemoveAllDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<
@@ -602,12 +640,14 @@ export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#presence-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayPresenceUpdateDispatch = DataPayload<GatewayDispatchEvents.PresenceUpdate, RawGatewayPresenceUpdate>;
/**
* https://discord.com/developers/docs/topics/gateway#typing-start
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayTypingStartDispatch = DataPayload<
@@ -623,18 +663,21 @@ export type GatewayTypingStartDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#user-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUpdate, APIUser>;
/**
* https://discord.com/developers/docs/topics/gateway#voice-state-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayVoiceStateUpdateDispatch = DataPayload<GatewayDispatchEvents.VoiceStateUpdate, GatewayVoiceState>;
/**
* https://discord.com/developers/docs/topics/gateway#voice-server-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayVoiceServerUpdateDispatch = DataPayload<
@@ -648,6 +691,7 @@ export type GatewayVoiceServerUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#webhooks-update
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayWebhooksUpdateDispatch = DataPayload<
@@ -664,6 +708,7 @@ export type GatewayWebhooksUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway#heartbeating
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayHeartbeat {
@@ -673,6 +718,7 @@ export interface GatewayHeartbeat {
/**
* https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayIdentifyProperties {
@@ -683,6 +729,7 @@ export interface GatewayIdentifyProperties {
/**
* https://discord.com/developers/docs/topics/gateway#identify
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayIdentify {
@@ -692,7 +739,6 @@ export interface GatewayIdentify {
properties: GatewayIdentifyProperties;
compress?: boolean;
large_threshold?: number;
// eslint-disable-next-line prettier/prettier
shard?: [shard_id: number, shard_count: number];
presence?: RawGatewayPresenceUpdate;
guild_subscriptions?: boolean;
@@ -702,6 +748,7 @@ export interface GatewayIdentify {
/**
* https://discord.com/developers/docs/topics/gateway#resume
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayResume {
@@ -715,22 +762,24 @@ export interface GatewayResume {
/**
* https://discord.com/developers/docs/topics/gateway#request-guild-members
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayRequestGuildMembers {
op: GatewayOPCodes.RequestGuildMembers;
d: {
guild_id: string | string[];
guild_id: string[] | string;
query?: string;
limit: number;
presences?: boolean;
user_ids?: string | string[];
user_ids?: string[] | string;
nonce?: string;
};
}
/**
* https://discord.com/developers/docs/topics/gateway#update-voice-state
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayVoiceStateUpdate {
@@ -745,6 +794,7 @@ export interface GatewayVoiceStateUpdate {
/**
* https://discord.com/developers/docs/topics/gateway#update-status
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayUpdatePresence {
@@ -754,6 +804,7 @@ export interface GatewayUpdatePresence {
/**
* https://discord.com/developers/docs/topics/gateway#update-status-gateway-status-update-structure
*
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface GatewayPresenceUpdateData {

File diff suppressed because it is too large Load Diff

2141
deno/gateway/v9.ts Normal file

File diff suppressed because it is too large Load Diff

103
deno/globals.ts Normal file
View File

@@ -0,0 +1,103 @@
/**
* https://discord.com/developers/docs/reference#snowflakes
*/
export type Snowflake = string;
/**
* https://discord.com/developers/docs/topics/permissions
*
* @internal
*/
export type Permissions = string;
/**
* https://discord.com/developers/docs/reference#message-formatting-formats
*/
export const FormattingPatterns = {
/**
* Regular expression for matching a user mention, strictly without a nickname
*
* The `id` group property is present on the `exec` result of this expression
*/
User: /<@(?<id>\d{17,20})>/,
/**
* Regular expression for matching a user mention, strictly with a nickname
*
* The `id` group property is present on the `exec` result of this expression
*
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
*/
UserWithNickname: /<@!(?<id>\d{17,20})>/,
/**
* Regular expression for matching a user mention, with or without a nickname
*
* The `id` group property is present on the `exec` result of this expression
*
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
*/
UserWithOptionalNickname: /<@!?(?<id>\d{17,20})>/,
/**
* Regular expression for matching a channel mention
*
* The `id` group property is present on the `exec` result of this expression
*/
Channel: /<#(?<id>\d{17,20})>/,
/**
* Regular expression for matching a role mention
*
* 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:
// eslint-disable-next-line unicorn/no-unsafe-regex
/<\/(?<fullName>(?<name>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32})(?: (?<subcommandOrGroup>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?(?: (?<subcommand>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?):(?<id>\d{17,20})>/u,
/**
* Regular expression for matching a custom emoji, either static or animated
*
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
*/
Emoji: /<(?<animated>a)?:(?<name>\w{2,32}):(?<id>\d{17,20})>/,
/**
* Regular expression for matching strictly an animated custom emoji
*
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
*/
AnimatedEmoji: /<(?<animated>a):(?<name>\w{2,32}):(?<id>\d{17,20})>/,
/**
* Regular expression for matching strictly a static custom emoji
*
* The `name` and `id` group properties are present on the `exec` result of this expression
*/
StaticEmoji: /<:(?<name>\w{2,32}):(?<id>\d{17,20})>/,
/**
* Regular expression for matching a timestamp, either default or custom styled
*
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
*/
// eslint-disable-next-line prefer-named-capture-group
Timestamp: /<t:(?<timestamp>-?\d{1,13})(:(?<style>[DFRTdft]))?>/,
/**
* Regular expression for matching strictly default styled timestamps
*
* The `timestamp` group property is present on the `exec` result of this expression
*/
DefaultStyledTimestamp: /<t:(?<timestamp>-?\d{1,13})>/,
/**
* Regular expression for matching strictly custom styled timestamps
*
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
*/
StyledTimestamp: /<t:(?<timestamp>-?\d{1,13}):(?<style>[DFRTdft])>/,
} as const;
/**
* Freezes the formatting patterns
*
* @internal
*/
Object.freeze(FormattingPatterns);

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

@@ -0,0 +1,332 @@
import type { LocaleString } from '../rest/common.ts';
/**
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
*
* These flags are exported as `BigInt`s and NOT numbers. Wrapping them in `Number()`
* may cause issues, try to use BigInts as much as possible or modules that can
* replicate them in some way
*/
export const PermissionFlagsBits = {
/**
* Allows creation of instant invites
*
* Applies to channel types: Text, Voice, Stage
*/
CreateInstantInvite: 1n << 0n,
/**
* Allows kicking members
*/
// eslint-disable-next-line sonarjs/no-identical-expressions
KickMembers: 1n << 1n,
/**
* Allows banning members
*/
BanMembers: 1n << 2n,
/**
* Allows all permissions and bypasses channel permission overwrites
*/
Administrator: 1n << 3n,
/**
* Allows management and editing of channels
*
* Applies to channel types: Text, Voice, Stage
*/
ManageChannels: 1n << 4n,
/**
* Allows management and editing of the guild
*/
ManageGuild: 1n << 5n,
/**
* Allows for the addition of reactions to messages
*
* Applies to channel types: Text, Voice, Stage
*/
AddReactions: 1n << 6n,
/**
* Allows for viewing of audit logs
*/
ViewAuditLog: 1n << 7n,
/**
* Allows for using priority speaker in a voice channel
*
* Applies to channel types: Voice
*/
PrioritySpeaker: 1n << 8n,
/**
* Allows the user to go live
*
* Applies to channel types: Voice, Stage
*/
Stream: 1n << 9n,
/**
* Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels
*
* Applies to channel types: Text, Voice, Stage
*/
ViewChannel: 1n << 10n,
/**
* Allows for sending messages in a channel and creating threads in a forum
* (does not allow sending messages in threads)
*
* Applies to channel types: Text, Voice, Stage
*/
SendMessages: 1n << 11n,
/**
* Allows for sending of `/tts` messages
*
* Applies to channel types: Text, Voice, Stage
*/
SendTTSMessages: 1n << 12n,
/**
* Allows for deletion of other users messages
*
* Applies to channel types: Text, Voice, Stage
*/
ManageMessages: 1n << 13n,
/**
* Links sent by users with this permission will be auto-embedded
*
* Applies to channel types: Text, Voice, Stage
*/
EmbedLinks: 1n << 14n,
/**
* Allows for uploading images and files
*
* Applies to channel types: Text, Voice, Stage
*/
AttachFiles: 1n << 15n,
/**
* Allows for reading of message history
*
* Applies to channel types: Text, Voice, Stage
*/
ReadMessageHistory: 1n << 16n,
/**
* Allows for using the `@everyone` tag to notify all users in a channel,
* and the `@here` tag to notify all online users in a channel
*
* Applies to channel types: Text, Voice, Stage
*/
MentionEveryone: 1n << 17n,
/**
* Allows the usage of custom emojis from other servers
*
* Applies to channel types: Text, Voice, Stage
*/
UseExternalEmojis: 1n << 18n,
/**
* Allows for viewing guild insights
*/
ViewGuildInsights: 1n << 19n,
/**
* Allows for joining of a voice channel
*
* Applies to channel types: Voice, Stage
*/
Connect: 1n << 20n,
/**
* Allows for speaking in a voice channel
*
* Applies to channel types: Voice
*/
Speak: 1n << 21n,
/**
* Allows for muting members in a voice channel
*
* Applies to channel types: Voice, Stage
*/
MuteMembers: 1n << 22n,
/**
* Allows for deafening of members in a voice channel
*
* Applies to channel types: Voice
*/
DeafenMembers: 1n << 23n,
/**
* Allows for moving of members between voice channels
*
* Applies to channel types: Voice, Stage
*/
MoveMembers: 1n << 24n,
/**
* Allows for using voice-activity-detection in a voice channel
*
* Applies to channel types: Voice
*/
UseVAD: 1n << 25n,
/**
* Allows for modification of own nickname
*/
ChangeNickname: 1n << 26n,
/**
* Allows for modification of other users nicknames
*/
ManageNicknames: 1n << 27n,
/**
* Allows management and editing of roles
*
* Applies to channel types: Text, Voice, Stage
*/
ManageRoles: 1n << 28n,
/**
* Allows management and editing of webhooks
*
* Applies to channel types: Text, Voice, Stage
*/
ManageWebhooks: 1n << 29n,
/**
* Allows management and editing of emojis, stickers, and soundboard sounds
*
* @deprecated This is the old name for {@apilink PermissionFlagsBits#ManageGuildExpressions}
*/
ManageEmojisAndStickers: 1n << 30n,
/**
* Allows for editing and deleting emojis, stickers, and soundboard sounds created by all users
*/
ManageGuildExpressions: 1n << 30n,
/**
* Allows members to use application commands, including slash commands and context menu commands
*
* Applies to channel types: Text, Voice, Stage
*/
UseApplicationCommands: 1n << 31n,
/**
* Allows for requesting to speak in stage channels
*
* Applies to channel types: Stage
*/
RequestToSpeak: 1n << 32n,
/**
* Allows for editing and deleting scheduled events created by all users
*
* Applies to channel types: Voice, Stage
*/
ManageEvents: 1n << 33n,
/**
* Allows for deleting and archiving threads, and viewing all private threads
*
* Applies to channel types: Text
*/
ManageThreads: 1n << 34n,
/**
* Allows for creating public and announcement threads
*
* Applies to channel types: Text
*/
CreatePublicThreads: 1n << 35n,
/**
* Allows for creating private threads
*
* Applies to channel types: Text
*/
CreatePrivateThreads: 1n << 36n,
/**
* Allows the usage of custom stickers from other servers
*
* Applies to channel types: Text, Voice, Stage
*/
UseExternalStickers: 1n << 37n,
/**
* Allows for sending messages in threads
*
* Applies to channel types: Text
*/
SendMessagesInThreads: 1n << 38n,
/**
* Allows for using Activities (applications with the {@apilink ApplicationFlags.Embedded} flag) in a voice channel
*
* Applies to channel types: Voice
*/
UseEmbeddedActivities: 1n << 39n,
/**
* Allows for timing out users to prevent them from sending or reacting to messages in chat and threads,
* and from speaking in voice and stage channels
*/
ModerateMembers: 1n << 40n,
/**
* Allows for viewing role subscription insights
*/
ViewCreatorMonetizationAnalytics: 1n << 41n,
/**
* Allows for using soundboard in a voice channel
*
* Applies to channel types: Voice
*/
UseSoundboard: 1n << 42n,
/**
* Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those created by the current user
*/
CreateGuildExpressions: 1n << 43n,
/**
* Allows for creating scheduled events, and editing and deleting those created by the current user
*
* Applies to channel types: Voice, Stage
*/
CreateEvents: 1n << 44n,
/**
* Allows the usage of custom soundboard sounds from other servers
*
* Applies to channel types: Voice
*/
UseExternalSounds: 1n << 45n,
/**
* Allows sending voice messages
*
* Applies to channel types: Text, Voice, Stage
*/
SendVoiceMessages: 1n << 46n,
} as const;
/**
* Freeze the object of bits, preventing any modifications to it
*
* @internal
*/
Object.freeze(PermissionFlagsBits);
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json
*/
export interface RESTError {
code: number;
message: string;
errors?: RESTErrorData;
}
export interface RESTErrorFieldInformation {
code: string;
message: string;
}
export interface RESTErrorGroupWrapper {
_errors: RESTErrorData[];
}
export type RESTErrorData = RESTErrorFieldInformation | RESTErrorGroupWrapper | string | { [k: string]: RESTErrorData };
/**
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
*/
export interface RESTRateLimit {
/**
* An error code for some limits
*
* {@link RESTJSONErrorCodes}
*/
code?: number;
/**
* A value indicating if you are being globally rate limited or not
*/
global: boolean;
/**
* A message saying you are being rate limited.
*/
message: string;
/**
* The number of seconds to wait before submitting another request.
*/
retry_after: number;
}

4
deno/payloads/mod.ts Normal file
View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,197 @@
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { APIRole, LocaleString } from '../../../v10.ts';
import type {
APIAttachment,
APIChannel,
APIMessage,
APIPartialChannel,
APIThreadChannel,
ChannelType,
ThreadChannelType,
} from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIEntitlement } from '../monetization.ts';
import type { APIUser } from '../user.ts';
import type { InteractionType } from './responses.ts';
export type PartialAPIMessageInteractionGuildMember = Pick<
APIGuildMember,
| 'avatar'
| 'communication_disabled_until'
| 'deaf'
| 'joined_at'
| 'mute'
| 'nick'
| 'pending'
| 'premium_since'
| 'roles'
>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#message-interaction-object
*/
export interface APIMessageInteraction {
/**
* ID of the interaction
*/
id: Snowflake;
/**
* The type of interaction
*/
type: InteractionType;
/**
* The name of the application command, including subcommands and subcommand groups
*/
name: string;
/**
* The user who invoked the interaction
*/
user: APIUser;
/**
* The guild member who invoked the interaction, only sent in MESSAGE_CREATE events
*/
member?: PartialAPIMessageInteractionGuildMember;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionGuildMember extends APIGuildMember {
permissions: Permissions;
user: APIUser;
}
// INTERACTIONS RECEIVED
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export interface APIBaseInteraction<Type extends InteractionType, Data> {
/**
* ID of the interaction
*/
id: Snowflake;
/**
* ID of the application this interaction is for
*/
application_id: Snowflake;
/**
* The type of interaction
*/
type: Type;
/**
* The command data payload
*/
data?: Data;
/**
* The guild it was sent from
*/
guild_id?: Snowflake;
/**
* The channel it was sent from
*/
channel?: Partial<APIChannel> & Pick<APIChannel, 'id' | 'type'>;
/**
* The id of the channel it was sent from
*
* @deprecated Use {@apilink APIBaseInteraction#channel} instead
*/
channel_id?: Snowflake;
/**
* Guild member data for the invoking user, including permissions
*
* **This is only sent when an interaction is invoked in a guild**
*/
member?: APIInteractionGuildMember;
/**
* User object for the invoking user, if invoked in a DM
*/
user?: APIUser;
/**
* A continuation token for responding to the interaction
*/
token: string;
/**
* Read-only property, always `1`
*/
version: 1;
/**
* For components, the message they were attached to
*/
message?: APIMessage;
/**
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
*/
app_permissions?: Permissions;
/**
* The selected language of the invoking user
*/
locale: LocaleString;
/**
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: LocaleString;
/**
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
*/
entitlements: APIEntitlement[];
}
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
Original,
'guild_id' | 'member'
> &
Required<Pick<Original, 'user'>>;
export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
Original,
'user'
> &
Required<Pick<Original, 'guild_id' | 'member'>>;
export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> extends Required<APIPartialChannel> {
type: T;
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object
*/
export type APIInteractionDataResolvedChannel =
| APIInteractionDataResolvedChannelBase<Exclude<ChannelType, ThreadChannelType>>
| (APIInteractionDataResolvedChannelBase<ThreadChannelType> &
Pick<APIThreadChannel, 'parent_id' | 'thread_metadata'>);
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'deaf' | 'mute' | 'user'> {
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
export interface APIInteractionDataResolved {
users?: Record<Snowflake, APIUser>;
roles?: Record<Snowflake, APIRole>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
attachments?: Record<Snowflake, APIAttachment>;
}
/**
* @deprecated Renamed to `APIInteractionDataResolved`
*/
export type APIChatInputApplicationCommandInteractionDataResolved = APIInteractionDataResolved;
/**
* `users` and optional `members` from APIInteractionDataResolved, for user commands and user selects
*/
export type APIUserInteractionDataResolved = Pick<APIInteractionDataResolved, 'members'> &
Required<Pick<APIInteractionDataResolved, 'users'>>;
/**
* @deprecated Renamed to `APIUserInteractionDataResolved`
*/
export type APIUserApplicationCommandInteractionDataResolved = APIUserInteractionDataResolved;

View File

@@ -0,0 +1,97 @@
import type { Snowflake } from '../../../globals.ts';
import type { ComponentType } from '../channel.ts';
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
import type {
APIDMInteractionWrapper,
APIGuildInteractionWrapper,
APIInteractionDataResolved,
APIUserInteractionDataResolved,
} from './base.ts';
export type APIMessageComponentInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
APIMessageComponentInteractionData
> &
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
>
>;
export type APIMessageComponentButtonInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
APIMessageButtonInteractionData
> &
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
>
>;
export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
APIMessageSelectMenuInteractionData
> &
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
>
>;
export type APIMessageComponentInteractionData = APIMessageButtonInteractionData | APIMessageSelectMenuInteractionData;
export interface APIMessageComponentBaseInteractionData<CType extends ComponentType> {
/**
* The `custom_id` of the component
*/
custom_id: string;
/**
* The type of the component
*/
component_type: CType;
}
export type APIMessageButtonInteractionData = APIMessageComponentBaseInteractionData<ComponentType.Button>;
export interface APIMessageStringSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.StringSelect> {
values: string[];
}
export interface APIMessageUserSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.UserSelect> {
values: Snowflake[];
resolved: APIUserInteractionDataResolved;
}
export interface APIMessageRoleSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.RoleSelect> {
values: Snowflake[];
resolved: Required<Pick<APIInteractionDataResolved, 'roles'>>;
}
export interface APIMessageMentionableSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.MentionableSelect> {
values: Snowflake[];
resolved: Pick<APIInteractionDataResolved, 'members' | 'roles' | 'users'>;
}
export interface APIMessageChannelSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.ChannelSelect> {
values: Snowflake[];
resolved: Required<Pick<APIInteractionDataResolved, 'channels'>>;
}
export type APIMessageSelectMenuInteractionData =
| APIMessageChannelSelectInteractionData
| APIMessageMentionableSelectInteractionData
| APIMessageRoleSelectInteractionData
| APIMessageStringSelectInteractionData
| APIMessageUserSelectInteractionData;
export type APIMessageComponentDMInteraction = APIDMInteractionWrapper<APIMessageComponentInteraction>;
export type APIMessageComponentGuildInteraction = APIGuildInteractionWrapper<APIMessageComponentInteraction>;

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,281 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/application
*/
import type { Permissions, Snowflake } from '../../globals.ts';
import type { LocalizationMap } from '../common.ts';
import type { APIPartialGuild } from './guild.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
/**
* https://discord.com/developers/docs/resources/application#application-object
*/
export interface APIApplication {
/**
* The id of the app
*/
id: Snowflake;
/**
* The name of the app
*/
name: string;
/**
* The icon hash of the app
*/
icon: string | null;
/**
* The description of the app
*/
description: string;
/**
* An array of rpc origin urls, if rpc is enabled
*/
rpc_origins?: string[];
/**
* When `false` only app owner can join the app's bot to guilds
*/
bot_public: boolean;
/**
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
*/
bot_require_code_grant: boolean;
/**
* Partial user object for the bot user associated with the application
*/
bot?: APIUser;
/**
* The url of the application's terms of service
*/
terms_of_service_url?: string;
/**
* The url of the application's privacy policy
*/
privacy_policy_url?: string;
/**
* Partial user object containing info on the owner of the application
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
owner?: APIUser;
/**
* An empty string
*
* @deprecated This field will be removed in v11
*/
summary: '';
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
* See https://discord.com/developers/docs/game-sdk/applications#getticket
*/
verify_key: string;
/**
* The team this application belongs to
*
* See https://discord.com/developers/docs/topics/teams#data-models-team-object
*/
team: APITeam | null;
/**
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
*/
guild_id?: Snowflake;
/**
* A partial object of the associated guild
*/
guild?: APIPartialGuild;
/**
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
*/
primary_sku_id?: Snowflake;
/**
* If this application is a game sold on Discord, this field will be the URL slug that links to the store page
*/
slug?: string;
/**
* If this application is a game sold on Discord, this field will be the hash of the image on store embeds
*/
cover_image?: string;
/**
* The application's public flags
*
* See https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
flags: ApplicationFlags;
/**
* Approximate count of guilds the application has been added to
*/
approximate_guild_count?: number;
/**
* Array of redirect URIs for the application
*/
redirect_uris?: string[];
/**
* The interactions endpoint URL for the application
*/
interactions_endpoint_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
/**
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
*/
tags?: [string, string?, string?, string?, string?];
/**
* Settings for the application's default in-app authorization link, if enabled
*/
install_params?: APIApplicationInstallParams;
/**
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
}
export interface APIApplicationInstallParams {
scopes: OAuth2Scopes[];
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
export enum ApplicationFlags {
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
EmbeddedReleased = 1 << 1,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
ManagedEmoji = 1 << 2,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
EmbeddedIAP = 1 << 3,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
GroupDMCreate = 1 << 4,
/**
* Indicates if an app uses the Auto Moderation API
*/
ApplicationAutoModerationRuleCreateBadge = 1 << 6,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
RPCHasConnected = 1 << 11,
/**
* Intent required for bots in 100 or more servers to receive `presence_update` events
*/
GatewayPresence = 1 << 12,
/**
* Intent required for bots in under 100 servers to receive `presence_update` events, found in Bot Settings
*/
GatewayPresenceLimited = 1 << 13,
/**
* Intent required for bots in 100 or more servers to receive member-related events like `guild_member_add`.
* See list of member-related events [under `GUILD_MEMBERS`](https://discord.com/developers/docs/topics/gateway#list-of-intents)
*/
GatewayGuildMembers = 1 << 14,
/**
* Intent required for bots in under 100 servers to receive member-related events like `guild_member_add`, found in Bot Settings.
* See list of member-related events [under `GUILD_MEMBERS`](https://discord.com/developers/docs/topics/gateway#list-of-intents)
*/
GatewayGuildMembersLimited = 1 << 15,
/**
* Indicates unusual growth of an app that prevents verification
*/
VerificationPendingGuildLimit = 1 << 16,
/**
* Indicates if an app is embedded within the Discord client (currently unavailable publicly)
*/
Embedded = 1 << 17,
/**
* Intent required for bots in 100 or more servers to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055)
*/
GatewayMessageContent = 1 << 18,
/**
* Intent required for bots in under 100 servers to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055),
* found in Bot Settings
*/
GatewayMessageContentLimited = 1 << 19,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
EmbeddedFirstParty = 1 << 20,
/**
* Indicates if an app has registered global [application commands](https://discord.com/developers/docs/interactions/application-commands)
*/
ApplicationCommandBadge = 1 << 23,
}
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure
*/
export interface APIApplicationRoleConnectionMetadata {
/**
* Type of metadata value
*/
type: ApplicationRoleConnectionMetadataType;
/**
* Dictionary key for the metadata field (must be `a-z`, `0-9`, or `_` characters; 1-50 characters)
*/
key: string;
/**
* Name of the metadata field (1-100 characters)
*/
name: string;
/**
* Translations of the name
*/
name_localizations?: LocalizationMap;
/**
* Description of the metadata field (1-200 characters)
*/
description: string;
/**
* Translations of the description
*/
description_localizations?: LocalizationMap;
}
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type
*/
export enum ApplicationRoleConnectionMetadataType {
/**
* The metadata value (`integer`) is less than or equal to the guild's configured value (`integer`)
*/
IntegerLessThanOrEqual = 1,
/**
* The metadata value (`integer`) is greater than or equal to the guild's configured value (`integer`)
*/
IntegerGreaterThanOrEqual,
/**
* The metadata value (`integer`) is equal to the guild's configured value (`integer`)
*/
IntegerEqual,
/**
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`)
*/
IntegerNotEqual,
/**
* The metadata value (`ISO8601 string`) is less than or equal to the guild's configured value (`integer`; days before current date)
*/
DatetimeLessThanOrEqual,
/**
* The metadata value (`ISO8601 string`) is greater than or equal to the guild's configured value (`integer`; days before current date)
*/
DatetimeGreaterThanOrEqual,
/**
* The metadata value (`integer`) is equal to the guild's configured value (`integer`; `1`)
*/
BooleanEqual,
/**
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`; `1`)
*/
BooleanNotEqual,
}

View File

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

View File

@@ -0,0 +1,216 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/auto-moderation
*/
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-auto-moderation-rule-structure
*/
export interface APIAutoModerationRule {
/**
* The id of this rule
*/
id: Snowflake;
/**
* The guild which this rule belongs to
*/
guild_id: Snowflake;
/**
* The rule name
*/
name: string;
/**
* The user id who created this rule
*/
creator_id: Snowflake;
/**
* The rule event type
*/
event_type: AutoModerationRuleEventType;
/**
* The rule trigger type
*/
trigger_type: AutoModerationRuleTriggerType;
/**
* The rule trigger metadata
*/
trigger_metadata: APIAutoModerationRuleTriggerMetadata;
/**
* The actions which will execute when this rule is triggered
*/
actions: APIAutoModerationAction[];
/**
* Whether this rule is enabled
*/
enabled: boolean;
/**
* The role ids that shouldn't be affected by this rule (Maximum of 20)
*/
exempt_roles: Snowflake[];
/**
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
*/
exempt_channels: Snowflake[];
}
/**
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types
*/
export enum AutoModerationRuleTriggerType {
/**
* Check if content contains words from a user defined list of keywords (Maximum of 6 per guild)
*/
Keyword = 1,
/**
* Check if content represents generic spam (Maximum of 1 per guild)
*/
Spam = 3,
/**
* Check if content contains words from internal pre-defined wordsets (Maximum of 1 per guild)
*/
KeywordPreset,
/**
* Check if content contains more mentions than allowed (Maximum of 1 per guild)
*/
MentionSpam,
}
/**
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata
*/
export interface APIAutoModerationRuleTriggerMetadata {
/**
* Substrings which will be searched for in content (Maximum of 1000)
*
* A keyword can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
*/
keyword_filter?: string[];
/**
* The internally pre-defined wordsets which will be searched for in content
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
*/
presets?: AutoModerationRuleKeywordPresetType[];
/**
* Substrings which will be exempt from triggering the preset trigger type (Maximum of 1000)
*
* A allowed-word can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 60 characters or less
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
*/
allow_list?: string[];
/**
* Regular expression patterns which will be matched against content (Maximum of 10)
*
* Only Rust flavored regex is currently supported (Maximum of 260 characters)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
*/
regex_patterns?: string[];
/**
* Total number of mentions (role & user) allowed per message (Maximum of 50)
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
*/
mention_total_limit?: number;
/**
* Whether to automatically detect mention raids
*
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
*/
mention_raid_protection_enabled?: boolean;
}
/**
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-preset-types
*/
export enum AutoModerationRuleKeywordPresetType {
/**
* Words that may be considered forms of swearing or cursing
*/
Profanity = 1,
/**
* Words that refer to sexually explicit behavior or activity
*/
SexualContent,
/**
* Personal insults or words that may be considered hate speech
*/
Slurs,
}
/**
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types
*/
export enum AutoModerationRuleEventType {
/**
* When a member sends or edits a message in the guild
*/
MessageSend = 1,
}
/**
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-auto-moderation-action-structure
*/
export interface APIAutoModerationAction {
/**
* The action type
*/
type: AutoModerationActionType;
/**
* Additional metadata needed during execution for this specific action type
*
* Will only be omitted if the action type is {@link AutoModerationActionType.BlockMessage}
*/
metadata?: APIAutoModerationActionMetadata;
}
/**
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types
*/
export enum AutoModerationActionType {
/**
* Blocks a member's message and prevents it from being posted.
* A custom explanation can be specified and shown to members whenever their message is blocked
*/
BlockMessage = 1,
/**
* Logs user content to a specified channel
*/
SendAlertMessage,
/**
* Timeout user for specified duration, this action type can be set if the bot has `MODERATE_MEMBERS` permission
*/
Timeout,
}
/**
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-metadata
*/
export interface APIAutoModerationActionMetadata {
/**
* Channel to which user content should be logged
*
* Associated action type: {@link AutoModerationActionType.SendAlertMessage}
*/
channel_id?: Snowflake;
/**
* Timeout duration in seconds (Maximum of 4 weeks - 2419200 seconds)
*
* Only available if using {@link AutoModerationRuleTriggerType.Keyword}
*
* Associated action type: {@link AutoModerationActionType.Timeout}
*/
duration_seconds?: number;
/**
* Additional explanation that will be shown to members whenever their message is blocked (Maximum 150 characters)
*
* Associated action type {@link AutoModerationActionType.BlockMessage}
*/
custom_message?: string;
}

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

File diff suppressed because it is too large Load Diff

View File

@@ -2,6 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/emoji
*/
import type { Snowflake } from '../../globals.ts';
import type { APIRole } from './permissions.ts';
import type { APIUser } from './user.ts';
/**
@@ -11,7 +13,7 @@ export interface APIPartialEmoji {
/**
* Emoji id
*/
id: string | null;
id: Snowflake | null;
/**
* Emoji name (can be null only in reaction emoji objects)
*/
@@ -29,7 +31,7 @@ export interface APIEmoji extends APIPartialEmoji {
/**
* Roles this emoji is whitelisted to
*/
roles?: string[];
roles?: APIRole['id'][];
/**
* User that created this emoji
*/

View File

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

1122
deno/payloads/v10/guild.ts Normal file

File diff suppressed because it is too large Load Diff

View File

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

View File

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

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

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

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

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

View File

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

View File

@@ -2,87 +2,7 @@
* Types extracted from https://discord.com/developers/docs/topics/oauth2
*/
import type { APITeam } from './teams';
import type { APIUser } from './user';
/**
* https://discord.com/developers/docs/topics/oauth2#get-current-application-information-response-structure
*/
export interface APIApplication {
/**
* The id of the app
*/
id: string;
/**
* The name of the app
*/
name: string;
/**
* The icon hash of the app
*/
icon: string | null;
/**
* The description of the app
*/
description: string;
/**
* An array of rpc origin urls, if rpc is enabled
*/
rpc_origins?: string[];
/**
* When `false` only app owner can join the app's bot to guilds
*/
bot_public: boolean;
/**
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
*/
bot_require_code_grant: boolean;
/**
* Partial user object containing info on the owner of the application
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
owner: APIUser;
/**
* If this application is a game sold on Discord, this field will be the summary field for the store page
* of its primary sku
*/
summary: string;
/**
* The base64 encoded key for the GameSDK's GetTicket
*
* See https://discord.com/developers/docs/game-sdk/applications#get-ticket
*/
verify_key: string;
/**
* The team this application belongs to
*
* See https://discord.com/developers/docs/topics/teams#data-models-team-object
*/
team: APITeam | null;
/**
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
*/
guild_id?: string;
/**
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
*/
primary_sku_id?: string;
/**
* If this application is a game sold on Discord, this field will be the URL slug that links to the store page
*/
slug?: string;
/**
* If this application is a game sold on Discord, this field will be the hash of the image on store embeds
*/
cover_image?: string;
/**
* The application's public flags
*/
flags: number;
}
export const enum OAuth2Scopes {
export enum OAuth2Scopes {
/**
* For oauth2 bots, this puts the bot in the user's selected guild by default
*/
@@ -94,6 +14,10 @@ export const enum OAuth2Scopes {
* See https://discord.com/developers/docs/resources/user#get-user-connections
*/
Connections = 'connections',
/**
* Allows your app to see information about the user's DMs and group DMs - requires Discord approval
*/
DMChannelsRead = 'dm_channels.read',
/**
* Enables [/users/@me](https://discord.com/developers/docs/resources/user#get-current-user) to return an `email`
*
@@ -120,6 +44,12 @@ export const enum OAuth2Scopes {
* See https://discord.com/developers/docs/resources/guild#add-guild-member
*/
GuildsJoin = 'guilds.join',
/**
* Allows /users/@me/guilds/{guild.id}/member to return a user's member information in a guild
*
* See https://discord.com/developers/docs/resources/user#get-current-user-guild-member
*/
GuildsMembersRead = 'guilds.members.read',
/**
* Allows your app to join users to a group dm
*
@@ -132,15 +62,15 @@ export const enum OAuth2Scopes {
*/
MessagesRead = 'messages.read',
/**
* For local rpc server access, this allows you to control a user's local Discord client - whitelist only
* Allows your app to update a user's connection and metadata for the app
*/
RoleConnectionsWrite = 'role_connections.write',
/**
* For local rpc server access, this allows you to control a user's local Discord client - requires Discord approval
*/
RPC = 'rpc',
/**
* For local rpc server api access, this allows you to access the API as the local user - whitelist only
*/
RPCApi = 'rpc.api',
/**
* For local rpc server api access, this allows you to receive notifications pushed out to the user - whitelist only
* For local rpc server api access, this allows you to receive notifications pushed out to the user - requires Discord approval
*/
RPCNotificationsRead = 'rpc.notifications.read',
/**
@@ -148,7 +78,11 @@ export const enum OAuth2Scopes {
*/
WebhookIncoming = 'webhook.incoming',
/**
* Allows your app to upload/update builds for a user's applications - whitelist only
* Allows your app to connect to voice on user's behalf and see all the voice members - requires Discord approval
*/
Voice = 'voice',
/**
* Allows your app to upload/update builds for a user's applications - requires Discord approval
*/
ApplicationsBuildsUpload = 'applications.builds.upload',
/**
@@ -164,29 +98,35 @@ export const enum OAuth2Scopes {
*/
ApplicationsEntitlements = 'applications.entitlements',
/**
* Allows your app to know a user's friends and implicit relationships - whitelist only
* Allows your app to know a user's friends and implicit relationships - requires Discord approval
*/
RelationshipsRead = 'relationships.read',
/**
* Allows your app to fetch data from a user's "Now Playing/Recently Played" list - whitelist only
* Allows your app to fetch data from a user's "Now Playing/Recently Played" list - requires Discord approval
*/
ActivitiesRead = 'activities.read',
/**
* Allows your app to update a user's activity - whitelist only (NOT REQUIRED FOR GAMESDK ACTIVITY MANAGER)
* Allows your app to update a user's activity - requires Discord approval (NOT REQUIRED FOR GAMESDK ACTIVITY MANAGER)
*
* See https://discord.com/developers/docs/game-sdk/activities
*/
ActivitiesWrite = 'activities.write',
/**
* Allows your app to create Slash Commands in the authorized guild
* Allows your app to use Application Commands in a guild
*
* See https://discord.com/developers/docs/interactions/slash-commands
* See https://discord.com/developers/docs/interactions/application-commands
*/
ApplicationsCommands = 'applications.commands',
/**
* Allows your app to update Slash Commands via this bearer token
* Allows your app to update its Application Commands via this bearer token - client credentials grant only
*
* See https://discord.com/developers/docs/interactions/slash-commands
* See https://discord.com/developers/docs/interactions/application-commands
*/
ApplicationsCommandsUpdate = 'applications.commands.update',
/**
* Allows your app to update permissions for its commands using a Bearer token - client credentials grant only
*
* See https://discord.com/developers/docs/interactions/application-commands
*/
ApplicationCommandsPermissionsUpdate = 'applications.commands.permissions.update',
}

View File

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

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