Compare commits

...

41 Commits

Author SHA1 Message Date
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
96 changed files with 3765 additions and 1929 deletions

View File

@@ -1,3 +1,87 @@
## [0.37.14](https://github.com/discordjs/discord-api-types/compare/0.37.13...0.37.14) (2022-10-15)
### Bug Fixes
- **APIAutoModeration:** export v10 json payloads and correct route types ([#608](https://github.com/discordjs/discord-api-types/issues/608)) ([bce0795](https://github.com/discordjs/discord-api-types/commit/bce07950fdfec7ae5e96ce3158f73cfb5db0a890))
### Features
- **RESTJSONErrorCodes:** add error `50073` ([#594](https://github.com/discordjs/discord-api-types/issues/594)) ([70826ed](https://github.com/discordjs/discord-api-types/commit/70826ed76e4b4880fb7425a07d04921823954c95))
## [0.37.13](https://github.com/discordjs/discord-api-types/compare/0.37.12...0.37.13) (2022-10-14)
### Features
- **APIAutoModeration:** add support for auto moderation ([#418](https://github.com/discordjs/discord-api-types/issues/418)) ([b216f7a](https://github.com/discordjs/discord-api-types/commit/b216f7a8bee2c02fe0e75189fe31f95973bfbe2e))
## [0.37.12](https://github.com/discordjs/discord-api-types/compare/0.37.11...0.37.12) (2022-10-06)
## [0.37.11](https://github.com/discordjs/discord-api-types/compare/0.37.10...0.37.11) (2022-09-26)
### Features
- **APIGuildForumChannel:** add `default_sort_order` ([#589](https://github.com/discordjs/discord-api-types/issues/589)) ([143b003](https://github.com/discordjs/discord-api-types/commit/143b003fbe5a86eda225e9da1d0914d6e48cddfd))
- **APIGuildForumChannel:** update and add missing features ([#575](https://github.com/discordjs/discord-api-types/issues/575)) ([0f118d3](https://github.com/discordjs/discord-api-types/commit/0f118d382f94151b1c9be42620520c91b20a05f6))
## [0.37.10](https://github.com/discordjs/discord-api-types/compare/0.37.9...0.37.10) (2022-09-15)
### Features
- add `RESTRateLimit` ([#585](https://github.com/discordjs/discord-api-types/issues/585)) ([f4d3f4d](https://github.com/discordjs/discord-api-types/commit/f4d3f4d5b1c1b6e42c2a8f8184f43d67b586c8c1))
- **APIConnection:** add `two_way_link` ([#546](https://github.com/discordjs/discord-api-types/issues/546)) ([d452f63](https://github.com/discordjs/discord-api-types/commit/d452f6346bd4953a8d777f3818797c4285b1b842))
- **APIGuild:** document afk timeout values ([#570](https://github.com/discordjs/discord-api-types/issues/570)) ([32f5a7b](https://github.com/discordjs/discord-api-types/commit/32f5a7b9814b69da7fc3772ec1f0307d39cda087))
## [0.37.9](https://github.com/discordjs/discord-api-types/compare/0.37.8...0.37.9) (2022-09-12)
### Features
- **ConnectionService:** add new connections ([#548](https://github.com/discordjs/discord-api-types/issues/548)) ([afd3b55](https://github.com/discordjs/discord-api-types/commit/afd3b55c08b0cf75cc4f5a06d3574b6cf532cb6c))
## [0.37.8](https://github.com/discordjs/discord-api-types/compare/0.37.7...0.37.8) (2022-09-08)
### Features
- **GuildFeature:** add `InvitesDisabled` ([#549](https://github.com/discordjs/discord-api-types/issues/549)) ([2708cb9](https://github.com/discordjs/discord-api-types/commit/2708cb9dcaa07d19ca71e9ca211e78939b9d1ff4))
## [0.37.7](https://github.com/discordjs/discord-api-types/compare/0.37.6...0.37.7) (2022-09-05)
### Bug Fixes
- **ChannelType:** bring back old names ([b08f2e3](https://github.com/discordjs/discord-api-types/commit/b08f2e34dbe9afccca6f565db6c7b27a21453d85))
## [0.37.6](https://github.com/discordjs/discord-api-types/compare/0.37.5...0.37.6) (2022-09-05)
### Bug Fixes
- **APIModalSubmission:** `components` is not optional ([#574](https://github.com/discordjs/discord-api-types/issues/574)) ([f69b586](https://github.com/discordjs/discord-api-types/commit/f69b586d0148afd017e6da70ab8d745b6ba04ba4))
- **GuildChannelType:** add missing `GuildCategory` type ([#579](https://github.com/discordjs/discord-api-types/issues/579)) ([815c68f](https://github.com/discordjs/discord-api-types/commit/815c68fe46034029200a8e2903748a3d2e6af7b9))
- **RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody:** `channel_id` is optional ([#547](https://github.com/discordjs/discord-api-types/issues/547)) ([b7b855b](https://github.com/discordjs/discord-api-types/commit/b7b855b2005bb3989810850d6e00bec443a15c92))
### Features
- **APIGuildIntegration:** add `scopes` ([#563](https://github.com/discordjs/discord-api-types/issues/563)) ([73d15dd](https://github.com/discordjs/discord-api-types/commit/73d15ddcbbc676efac876602a3cd726bfe4c378a))
- **ApplicationFlags:** add `ApplicationCommandBadge` ([#537](https://github.com/discordjs/discord-api-types/issues/537)) ([48f0f56](https://github.com/discordjs/discord-api-types/commit/48f0f562bab10d2a1e331474fb963af8631b788b))
- **RESTPutAPIGuildBanJSONBody:** add `delete_message_seconds` ([#534](https://github.com/discordjs/discord-api-types/issues/534)) ([4e362d5](https://github.com/discordjs/discord-api-types/commit/4e362d52608e99d466b43cd37ec6b6bb1222b660))
## [0.37.5](https://github.com/discordjs/discord-api-types/compare/0.37.4...0.37.5) (2022-08-25)
### Features
- **FormattingPatterns:** add `ApplicationCommand` ([#525](https://github.com/discordjs/discord-api-types/issues/525)) ([0098889](https://github.com/discordjs/discord-api-types/commit/00988894995f7ac5e8ddc34125704a230329137c))
## [0.37.4](https://github.com/discordjs/discord-api-types/compare/0.37.3...0.37.4) (2022-08-22)
### Features
- add common JSON error types ([#568](https://github.com/discordjs/discord-api-types/issues/568)) ([956f289](https://github.com/discordjs/discord-api-types/commit/956f289e885763a620cb67a36e7e42683b5c08bf))
- **ApplicationCommand:** export base chat input types ([#569](https://github.com/discordjs/discord-api-types/issues/569)) ([248484e](https://github.com/discordjs/discord-api-types/commit/248484e55613e2da3f1d659395e1f4c010cb51b5))
## [0.37.3](https://github.com/discordjs/discord-api-types/compare/0.37.2...0.37.3) (2022-08-18)
### Features
- **RESTJSONErrorCodes:** add 240000 ([#565](https://github.com/discordjs/discord-api-types/issues/565)) ([5bb50ae](https://github.com/discordjs/discord-api-types/commit/5bb50ae7ea6859845c9d9996f02ac42c61413df0))
## [0.37.2](https://github.com/discordjs/discord-api-types/compare/0.37.1...0.37.2) (2022-08-11)
### Bug Fixes

View File

@@ -1,3 +1,87 @@
## [0.37.14](https://github.com/discordjs/discord-api-types/compare/0.37.13...0.37.14) (2022-10-15)
### Bug Fixes
- **APIAutoModeration:** export v10 json payloads and correct route types ([#608](https://github.com/discordjs/discord-api-types/issues/608)) ([bce0795](https://github.com/discordjs/discord-api-types/commit/bce07950fdfec7ae5e96ce3158f73cfb5db0a890))
### Features
- **RESTJSONErrorCodes:** add error `50073` ([#594](https://github.com/discordjs/discord-api-types/issues/594)) ([70826ed](https://github.com/discordjs/discord-api-types/commit/70826ed76e4b4880fb7425a07d04921823954c95))
## [0.37.13](https://github.com/discordjs/discord-api-types/compare/0.37.12...0.37.13) (2022-10-14)
### Features
- **APIAutoModeration:** add support for auto moderation ([#418](https://github.com/discordjs/discord-api-types/issues/418)) ([b216f7a](https://github.com/discordjs/discord-api-types/commit/b216f7a8bee2c02fe0e75189fe31f95973bfbe2e))
## [0.37.12](https://github.com/discordjs/discord-api-types/compare/0.37.11...0.37.12) (2022-10-06)
## [0.37.11](https://github.com/discordjs/discord-api-types/compare/0.37.10...0.37.11) (2022-09-26)
### Features
- **APIGuildForumChannel:** add `default_sort_order` ([#589](https://github.com/discordjs/discord-api-types/issues/589)) ([143b003](https://github.com/discordjs/discord-api-types/commit/143b003fbe5a86eda225e9da1d0914d6e48cddfd))
- **APIGuildForumChannel:** update and add missing features ([#575](https://github.com/discordjs/discord-api-types/issues/575)) ([0f118d3](https://github.com/discordjs/discord-api-types/commit/0f118d382f94151b1c9be42620520c91b20a05f6))
## [0.37.10](https://github.com/discordjs/discord-api-types/compare/0.37.9...0.37.10) (2022-09-15)
### Features
- add `RESTRateLimit` ([#585](https://github.com/discordjs/discord-api-types/issues/585)) ([f4d3f4d](https://github.com/discordjs/discord-api-types/commit/f4d3f4d5b1c1b6e42c2a8f8184f43d67b586c8c1))
- **APIConnection:** add `two_way_link` ([#546](https://github.com/discordjs/discord-api-types/issues/546)) ([d452f63](https://github.com/discordjs/discord-api-types/commit/d452f6346bd4953a8d777f3818797c4285b1b842))
- **APIGuild:** document afk timeout values ([#570](https://github.com/discordjs/discord-api-types/issues/570)) ([32f5a7b](https://github.com/discordjs/discord-api-types/commit/32f5a7b9814b69da7fc3772ec1f0307d39cda087))
## [0.37.9](https://github.com/discordjs/discord-api-types/compare/0.37.8...0.37.9) (2022-09-12)
### Features
- **ConnectionService:** add new connections ([#548](https://github.com/discordjs/discord-api-types/issues/548)) ([afd3b55](https://github.com/discordjs/discord-api-types/commit/afd3b55c08b0cf75cc4f5a06d3574b6cf532cb6c))
## [0.37.8](https://github.com/discordjs/discord-api-types/compare/0.37.7...0.37.8) (2022-09-08)
### Features
- **GuildFeature:** add `InvitesDisabled` ([#549](https://github.com/discordjs/discord-api-types/issues/549)) ([2708cb9](https://github.com/discordjs/discord-api-types/commit/2708cb9dcaa07d19ca71e9ca211e78939b9d1ff4))
## [0.37.7](https://github.com/discordjs/discord-api-types/compare/0.37.6...0.37.7) (2022-09-05)
### Bug Fixes
- **ChannelType:** bring back old names ([b08f2e3](https://github.com/discordjs/discord-api-types/commit/b08f2e34dbe9afccca6f565db6c7b27a21453d85))
## [0.37.6](https://github.com/discordjs/discord-api-types/compare/0.37.5...0.37.6) (2022-09-05)
### Bug Fixes
- **APIModalSubmission:** `components` is not optional ([#574](https://github.com/discordjs/discord-api-types/issues/574)) ([f69b586](https://github.com/discordjs/discord-api-types/commit/f69b586d0148afd017e6da70ab8d745b6ba04ba4))
- **GuildChannelType:** add missing `GuildCategory` type ([#579](https://github.com/discordjs/discord-api-types/issues/579)) ([815c68f](https://github.com/discordjs/discord-api-types/commit/815c68fe46034029200a8e2903748a3d2e6af7b9))
- **RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody:** `channel_id` is optional ([#547](https://github.com/discordjs/discord-api-types/issues/547)) ([b7b855b](https://github.com/discordjs/discord-api-types/commit/b7b855b2005bb3989810850d6e00bec443a15c92))
### Features
- **APIGuildIntegration:** add `scopes` ([#563](https://github.com/discordjs/discord-api-types/issues/563)) ([73d15dd](https://github.com/discordjs/discord-api-types/commit/73d15ddcbbc676efac876602a3cd726bfe4c378a))
- **ApplicationFlags:** add `ApplicationCommandBadge` ([#537](https://github.com/discordjs/discord-api-types/issues/537)) ([48f0f56](https://github.com/discordjs/discord-api-types/commit/48f0f562bab10d2a1e331474fb963af8631b788b))
- **RESTPutAPIGuildBanJSONBody:** add `delete_message_seconds` ([#534](https://github.com/discordjs/discord-api-types/issues/534)) ([4e362d5](https://github.com/discordjs/discord-api-types/commit/4e362d52608e99d466b43cd37ec6b6bb1222b660))
## [0.37.5](https://github.com/discordjs/discord-api-types/compare/0.37.4...0.37.5) (2022-08-25)
### Features
- **FormattingPatterns:** add `ApplicationCommand` ([#525](https://github.com/discordjs/discord-api-types/issues/525)) ([0098889](https://github.com/discordjs/discord-api-types/commit/00988894995f7ac5e8ddc34125704a230329137c))
## [0.37.4](https://github.com/discordjs/discord-api-types/compare/0.37.3...0.37.4) (2022-08-22)
### Features
- add common JSON error types ([#568](https://github.com/discordjs/discord-api-types/issues/568)) ([956f289](https://github.com/discordjs/discord-api-types/commit/956f289e885763a620cb67a36e7e42683b5c08bf))
- **ApplicationCommand:** export base chat input types ([#569](https://github.com/discordjs/discord-api-types/issues/569)) ([248484e](https://github.com/discordjs/discord-api-types/commit/248484e55613e2da3f1d659395e1f4c010cb51b5))
## [0.37.3](https://github.com/discordjs/discord-api-types/compare/0.37.2...0.37.3) (2022-08-18)
### Features
- **RESTJSONErrorCodes:** add 240000 ([#565](https://github.com/discordjs/discord-api-types/issues/565)) ([5bb50ae](https://github.com/discordjs/discord-api-types/commit/5bb50ae7ea6859845c9d9996f02ac42c61413df0))
## [0.37.2](https://github.com/discordjs/discord-api-types/compare/0.37.1...0.37.2) (2022-08-11)
### Bug Fixes

View File

@@ -6,6 +6,8 @@ import type { Snowflake } from '../globals.ts';
import type { GatewayPresenceUpdate } from '../payloads/v10/gateway.ts';
import type {
APIApplication,
APIAutoModerationRule,
APIAutoModerationAction,
APIChannel,
APIEmoji,
APIGuild,
@@ -28,6 +30,7 @@ import type {
GatewayVoiceState,
InviteTargetType,
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
} from '../payloads/v10/mod.ts';
import type { Nullable } from '../utils/internals.ts';
@@ -190,6 +193,8 @@ export enum GatewayIntentBits {
DirectMessageTyping = 1 << 14,
MessageContent = 1 << 15,
GuildScheduledEvents = 1 << 16,
AutoModerationConfiguration = 1 << 20,
AutoModerationExecution = 1 << 21,
}
/**
@@ -252,6 +257,10 @@ export enum GatewayDispatchEvents {
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
}
export type GatewaySendPayload =
@@ -432,6 +441,121 @@ export interface GatewayReadyDispatchData {
*/
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleModifyDispatch = DataPayload<
| GatewayDispatchEvents.AutoModerationRuleCreate
| GatewayDispatchEvents.AutoModerationRuleUpdate
| GatewayDispatchEvents.AutoModerationRuleDelete,
GatewayAutoModerationRuleModifyDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleModifyDispatchData = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
*/
export type GatewayAutoModerationRuleCreateDispatch = GatewayAutoModerationRuleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
*/
export type GatewayAutoModerationRuleCreateDispatchData = GatewayAutoModerationRuleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
*/
export type GatewayAutoModerationRuleUpdateDispatch = GatewayAutoModerationRuleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
*/
export type GatewayAutoModerationRuleUpdateDispatchData = GatewayAutoModerationRuleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleDeleteDispatch = GatewayAutoModerationRuleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleDeleteDispatchData = GatewayAutoModerationRuleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-action-execution
*/
export type GatewayAutoModerationActionExecutionDispatch = DataPayload<
GatewayDispatchEvents.AutoModerationActionExecution,
GatewayAutoModerationActionExecutionDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution
*/
export interface GatewayAutoModerationActionExecutionDispatchData {
/**
* The id of the guild in which action was executed
*/
guild_id: Snowflake;
/**
* The action which was executed
*/
action: APIAutoModerationAction;
/**
* The id of the rule which action belongs to
*/
rule_id: Snowflake;
/**
* The trigger type of rule which was triggered
*/
rule_trigger_type: AutoModerationRuleTriggerType;
/**
* The id of the user which generated the content which triggered the rule
*/
user_id: Snowflake;
/**
* The id of the channel in which user content was posted
*/
channel_id?: Snowflake;
/**
* The id of any user message which content belongs to
*
* This field will not be present if message was blocked by AutoMod or content was not part of any message
*/
message_id?: Snowflake;
/**
* The id of any system auto moderation messages posted as a result of this action
*
* This field will not be present if this event does not correspond to an action with type {@link AutoModerationActionType.SendAlertMessage}
*/
alert_system_message_id?: Snowflake;
/**
* The user generated text content
*
* `MESSAGE_CONTENT` (`1 << 15`) gateway intent is required to receive non-empty values from this field
*/
content: string;
/**
* The word or phrase configured in the rule that triggered the rule
*/
matched_keyword: string | null;
/**
* The substring in content that triggered the rule
*
* `MESSAGE_CONTENT` (`1 << 15`) gateway intent is required to receive non-empty values from this field
*/
matched_content: string | null;
}
/**
* https://discord.com/developers/docs/topics/gateway#channel-create
* https://discord.com/developers/docs/topics/gateway#channel-update

View File

@@ -6,6 +6,8 @@ import type { Snowflake } from '../globals.ts';
import type { GatewayPresenceUpdate } from '../payloads/v9/gateway.ts';
import type {
APIApplication,
APIAutoModerationRule,
APIAutoModerationAction,
APIChannel,
APIEmoji,
APIGuild,
@@ -28,6 +30,7 @@ import type {
GatewayVoiceState,
InviteTargetType,
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
} from '../payloads/v9/mod.ts';
import type { Nullable } from '../utils/internals.ts';
@@ -189,6 +192,8 @@ export enum GatewayIntentBits {
DirectMessageReactions = 1 << 13,
DirectMessageTyping = 1 << 14,
GuildScheduledEvents = 1 << 16,
AutoModerationConfiguration = 1 << 20,
AutoModerationExecution = 1 << 21,
}
/**
@@ -251,6 +256,10 @@ export enum GatewayDispatchEvents {
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
}
export type GatewaySendPayload =
@@ -431,6 +440,121 @@ export interface GatewayReadyDispatchData {
*/
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleModifyDispatch = DataPayload<
| GatewayDispatchEvents.AutoModerationRuleCreate
| GatewayDispatchEvents.AutoModerationRuleUpdate
| GatewayDispatchEvents.AutoModerationRuleDelete,
GatewayAutoModerationRuleModifyDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleModifyDispatchData = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
*/
export type GatewayAutoModerationRuleCreateDispatch = GatewayAutoModerationRuleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
*/
export type GatewayAutoModerationRuleCreateDispatchData = GatewayAutoModerationRuleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
*/
export type GatewayAutoModerationRuleUpdateDispatch = GatewayAutoModerationRuleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
*/
export type GatewayAutoModerationRuleUpdateDispatchData = GatewayAutoModerationRuleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleDeleteDispatch = GatewayAutoModerationRuleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleDeleteDispatchData = GatewayAutoModerationRuleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-action-execution
*/
export type GatewayAutoModerationActionExecutionDispatch = DataPayload<
GatewayDispatchEvents.AutoModerationActionExecution,
GatewayAutoModerationActionExecutionDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution
*/
export interface GatewayAutoModerationActionExecutionDispatchData {
/**
* The id of the guild in which action was executed
*/
guild_id: Snowflake;
/**
* The action which was executed
*/
action: APIAutoModerationAction;
/**
* The id of the rule which action belongs to
*/
rule_id: Snowflake;
/**
* The trigger type of rule which was triggered
*/
rule_trigger_type: AutoModerationRuleTriggerType;
/**
* The id of the user which generated the content which triggered the rule
*/
user_id: Snowflake;
/**
* The id of the channel in which user content was posted
*/
channel_id?: Snowflake;
/**
* The id of any user message which content belongs to
*
* This field will not be present if message was blocked by AutoMod or content was not part of any message
*/
message_id?: Snowflake;
/**
* The id of any system auto moderation messages posted as a result of this action
*
* This field will not be present if this event does not correspond to an action with type {@link AutoModerationActionType.SendAlertMessage}
*/
alert_system_message_id?: Snowflake;
/**
* The user generated text content
*
* `MESSAGE_CONTENT` (`1 << 15`) gateway intent is required to receive non-empty values from this field
*/
content: string;
/**
* The word or phrase configured in the rule that triggered the rule
*/
matched_keyword: string | null;
/**
* The substring in content that triggered the rule
*
* `MESSAGE_CONTENT` (`1 << 15`) gateway intent is required to receive non-empty values from this field
*/
matched_content: string | null;
}
/**
* https://discord.com/developers/docs/topics/gateway#channel-create
* https://discord.com/developers/docs/topics/gateway#channel-update

View File

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

View File

@@ -58,3 +58,41 @@ export const PermissionFlagsBits = {
Object.freeze(PermissionFlagsBits);
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json
*/
export interface RESTError {
code: number;
message: string;
errors?: RESTErrorData;
}
export interface RESTErrorFieldInformation {
code: string;
message: string;
}
export interface RESTErrorGroupWrapper {
_errors: RESTErrorData[];
}
export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation | { [k: string]: RESTErrorData } | string;
/**
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
*/
export interface RESTRateLimit {
/**
* A value indicating if you are being globally rate limited or not
*/
global: boolean;
/**
* A message saying you are being rate limited.
*/
message: string;
/**
* The number of seconds to wait before submitting another request.
*/
retry_after: number;
}

View File

@@ -54,6 +54,7 @@ import type {
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/base.ts';
export * from './_chatInput/boolean.ts';
export * from './_chatInput/channel.ts';
export * from './_chatInput/integer.ts';

View File

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

View File

@@ -129,4 +129,5 @@ export enum ApplicationFlags {
GatewayMessageContent = 1 << 18,
GatewayMessageContentLimited = 1 << 19,
EmbeddedFirstParty = 1 << 20,
ApplicationCommandBadge = 1 << 23,
}

View File

@@ -2,6 +2,13 @@
* Types extracted from https://discord.com/developers/docs/resources/audit-log
*/
import type {
APIAutoModerationAction,
APIAutoModerationRule,
APIAutoModerationRuleTriggerMetadata,
AutoModerationRuleEventType,
AutoModerationRuleTriggerType,
} from './autoModeration.ts';
import type { APIChannel, APIOverwrite } from './channel.ts';
import type {
APIGuildIntegration,
@@ -52,6 +59,12 @@ export interface APIAuditLog {
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object
*/
audit_log_entries: APIAuditLogEntry[];
/**
* List of auto moderation rules referenced in the audit log
*
* See https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object
*/
auto_moderation_rules: APIAutoModerationRule[];
/**
* Partial integration objects
*
@@ -180,12 +193,37 @@ export enum AuditLogEvent {
ThreadDelete,
ApplicationCommandPermissionUpdate = 121,
AutoModerationRuleCreate = 140,
AutoModerationRuleUpdate,
AutoModerationRuleDelete,
AutoModerationBlockMessage,
AutoModerationFlagToChannel,
AutoModerationUserCommunicationDisabled,
}
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
*/
export interface APIAuditLogOptions {
/**
* Name of the Auto Moderation rule that was triggered
*
* Present from:
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
*/
auto_moderation_rule_name?: string;
/**
* Trigger type of the Auto Moderation rule that was triggered
*
* Present from:
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
*/
auto_moderation_rule_trigger_type?: AuditLogRuleTriggerType;
/**
* Number of days after which inactive members were kicked
*
@@ -212,6 +250,9 @@ export interface APIAuditLogOptions {
* - STAGE_INSTANCE_CREATE
* - STAGE_INSTANCE_UPDATE
* - STAGE_INSTANCE_DELETE
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
*/
channel_id?: Snowflake;
@@ -275,6 +316,8 @@ export enum AuditLogOptionsType {
Member = '1',
}
export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
*/
@@ -347,7 +390,14 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeyLocation
| APIAuditLogChangeKeyCommunicationDisabledUntil;
| APIAuditLogChangeKeyCommunicationDisabledUntil
| APIAuditLogChangeKeyTriggerType
| APIAuditLogChangeKeyEventType
| APIAuditLogChangeKeyTriggerMetadata
| APIAuditLogChangeKeyActions
| APIAuditLogChangeKeyEnabled
| APIAuditLogChangeKeyExemptRoles
| APIAuditLogChangeKeyExemptChannels;
/**
* Returned when an entity's name is changed
@@ -710,6 +760,44 @@ export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string
*/
export type APIAuditLogChangeKeyCommunicationDisabledUntil = AuditLogChangeData<'communication_disabled_until', string>;
/**
* Returned when an auto moderation rule's trigger type is changed (only in rule creation or deletion)
*/
export type APIAuditLogChangeKeyTriggerType = AuditLogChangeData<'trigger_type', AutoModerationRuleTriggerType>;
/**
* Returned when an auto moderation rule's event type is changed
*/
export type APIAuditLogChangeKeyEventType = AuditLogChangeData<'event_type', AutoModerationRuleEventType>;
/**
* Returned when an auto moderation rule's trigger metadata is changed
*/
export type APIAuditLogChangeKeyTriggerMetadata = AuditLogChangeData<
'trigger_metadata',
APIAutoModerationRuleTriggerMetadata
>;
/**
* Returned when an auto moderation rule's actions is changed
*/
export type APIAuditLogChangeKeyActions = AuditLogChangeData<'actions', APIAutoModerationAction[]>;
/**
* Returned when an auto moderation rule's enabled status is changed
*/
export type APIAuditLogChangeKeyEnabled = AuditLogChangeData<'enabled', boolean>;
/**
* Returned when an auto moderation rule's exempt roles is changed
*/
export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles', Snowflake[]>;
/**
* Returned when an auto moderation rule's exempt channels is changed
*/
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
interface AuditLogChangeData<K extends string, D> {
key: K;
/**

View File

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

View File

@@ -42,18 +42,15 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
export type TextChannelType =
| ChannelType.DM
| ChannelType.GroupDM
| ChannelType.GuildNews
| ChannelType.GuildPublicThread
| ChannelType.GuildPrivateThread
| ChannelType.GuildNewsThread
| ChannelType.GuildAnnouncement
| ChannelType.PublicThread
| ChannelType.PrivateThread
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum
| ChannelType.GuildVoice;
export type GuildChannelType = Exclude<
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
ChannelType.DM | ChannelType.GroupDM
>;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
@@ -111,7 +108,7 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration;
/**
* The channel topic (0-1024 characters)
* The channel topic (0-4096 characters for forum channels, 0-1024 characters for all others)
*/
topic?: string | null;
/**
@@ -122,7 +119,7 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
}
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
@@ -190,9 +187,7 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
}
export interface APIThreadChannel
extends APIGuildChannel<
ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread | ChannelType.GuildNewsThread
> {
extends APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -235,9 +230,85 @@ export interface APIThreadChannel
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
*/
total_message_sent?: number;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel
*/
applied_tags: Snowflake[];
}
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
/**
* https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure
*/
export interface APIGuildForumTag {
/**
* The id of the tag
*/
id: Snowflake;
/**
* The name of the tag (0-20 characters)
*/
name: string;
/**
* Whether this tag can only be added to or removed from threads by a member with the `MANAGE_THREADS` permission
*/
moderated: boolean;
/**
* The id of a guild's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of the emoji
*/
emoji_name: string | null;
}
/**
* https://discord.com/developers/docs/resources/channel#default-reaction-object-default-reaction-structure
*/
export interface APIGuildForumDefaultReactionEmoji {
/**
* The id of a guild's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of the emoji
*/
emoji_name: string | null;
}
/**
* https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types
*/
export enum SortOrderType {
/**
* Sort forum posts by activity
*/
LatestActivity,
/**
* Sort forum posts by creation time (from most recent to oldest)
*/
CreationDate,
}
export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
/**
* The set of tags that can be used in a forum channel
*/
available_tags: APIGuildForumTag[];
/**
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
* This field is copied to the thread at creation time and does not live update
*/
default_thread_rate_limit_per_user?: number;
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*/
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
/**
* The default sort order type used to order posts in forum channels
*/
default_sort_order: SortOrderType | null;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
@@ -285,19 +356,19 @@ export enum ChannelType {
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews,
GuildAnnouncement,
/**
* A thread channel (public) within a Guild News channel
* A temporary sub-channel within a Guild Announcement channel
*/
GuildNewsThread = 10,
AnnouncementThread = 10,
/**
* A public thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel
*/
GuildPublicThread,
PublicThread,
/**
* A private thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*/
GuildPrivateThread,
PrivateThread,
/**
* A voice channel for hosting events with an audience
*
@@ -314,6 +385,35 @@ export enum ChannelType {
* A channel that can only contain threads
*/
GuildForum,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
/**
* A channel that users can follow and crosspost into their own guild
*
* @deprecated This is the old name for {@apilink ChannelType#GuildAnnouncement}
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews = 5,
/**
* A temporary sub-channel within a Guild Announcement channel
*
* @deprecated This is the old name for {@apilink ChannelType#AnnouncementThread}
*/
GuildNewsThread = 10,
/**
* A temporary sub-channel within a Guild Text channel
*
* @deprecated This is the old name for {@apilink ChannelType#PublicThread}
*/
GuildPublicThread = 11,
/**
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*
* @deprecated This is the old name for {@apilink ChannelType#PrivateThread}
*/
GuildPrivateThread = 12,
}
export enum VideoQualityMode {
@@ -567,6 +667,7 @@ export enum MessageType {
ThreadStarterMessage,
GuildInviteReminder,
ContextMenuCommand,
AutoModerationAction,
}
/**
@@ -919,6 +1020,12 @@ export enum EmbedType {
* Link embed
*/
Link = 'link',
/**
* Auto moderation alert embed
*
* @unstable This embed type is currently not documented by Discord, but it is returned in the auto moderation system messages.
*/
AutoModerationMessage = 'auto_moderation_message',
}
/**
@@ -1405,7 +1512,15 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
*/
export enum ChannelFlags {
/**
* This thread is pinned to the top of its parent forum channel
*/
Pinned = 1 << 1,
/**
* Whether a tag is required to be specified when creating a thread in a forum channel.
* Tags are specified in the `applied_tags` field
*/
RequireTag = 1 << 4,
}
/**

View File

@@ -4,6 +4,7 @@
import type { APIEmoji } from './emoji.ts';
import type { PresenceUpdateStatus } from './gateway.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker } from './sticker.ts';
import type { APIUser } from './user.ts';
@@ -117,7 +118,7 @@ export interface APIGuild extends APIPartialGuild {
*/
afk_channel_id: Snowflake | null;
/**
* afk timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout: number;
/**
@@ -381,6 +382,10 @@ export enum GuildFeature {
* Guild has access to set an animated guild icon
*/
AnimatedIcon = 'ANIMATED_ICON',
/**
* Guild has set up auto moderation rules
*/
AutoModeration = 'AUTO_MODERATION',
/**
* Guild has access to set a guild banner image
*/
@@ -409,6 +414,10 @@ export enum GuildFeature {
* @unstable This feature is currently not documented by Discord, but has known value
*/
Hub = 'HUB',
/**
* Guild has disabled invite usage, preventing users from joining
*/
InvitesDisabled = 'INVITES_DISABLED',
/**
* Guild has access to set an invite splash background
*/
@@ -698,6 +707,10 @@ export interface APIGuildIntegration {
* **This field is not provided for `discord` bot integrations.**
*/
application?: APIGuildIntegrationApplication;
/**
* The scopes the application has been authorized for
*/
scopes?: OAuth2Scopes[];
}
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord';

View File

@@ -1,6 +1,7 @@
export * from '../common.ts';
export * from './application.ts';
export * from './auditLog.ts';
export * from './autoModeration.ts';
export * from './channel.ts';
export * from './emoji.ts';
export * from './gateway.ts';

View File

@@ -204,6 +204,10 @@ export interface APIConnection {
* Whether activities related to this connection will be shown in presence updates
*/
show_activity: boolean;
/**
* Whether this connection supports console voice transfer
*/
two_way_link: boolean;
/**
* Visibility of this connection
*
@@ -214,13 +218,15 @@ export interface APIConnection {
export enum ConnectionService {
BattleNet = 'battlenet',
eBay = 'ebay',
EpicGames = 'epicgames',
Facebook = 'facebook',
GitHub = 'github',
LeagueOfLegends = 'leagueoflegends',
PayPal = 'paypal',
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
SamsungGalaxy = 'samsunggalaxy',
RiotGames = 'riotgames',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',

View File

@@ -54,6 +54,7 @@ import type {
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/base.ts';
export * from './_chatInput/boolean.ts';
export * from './_chatInput/channel.ts';
export * from './_chatInput/integer.ts';

View File

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

View File

@@ -129,4 +129,5 @@ export enum ApplicationFlags {
GatewayMessageContent = 1 << 18,
GatewayMessageContentLimited = 1 << 19,
EmbeddedFirstParty = 1 << 20,
ApplicationCommandBadge = 1 << 23,
}

View File

@@ -2,6 +2,13 @@
* Types extracted from https://discord.com/developers/docs/resources/audit-log
*/
import type {
APIAutoModerationAction,
APIAutoModerationRule,
APIAutoModerationRuleTriggerMetadata,
AutoModerationRuleEventType,
AutoModerationRuleTriggerType,
} from './autoModeration.ts';
import type { APIChannel, APIOverwrite } from './channel.ts';
import type {
APIGuildIntegration,
@@ -52,6 +59,12 @@ export interface APIAuditLog {
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object
*/
audit_log_entries: APIAuditLogEntry[];
/**
* List of auto moderation rules referenced in the audit log
*
* See https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object
*/
auto_moderation_rules: APIAutoModerationRule[];
/**
* Partial integration objects
*
@@ -180,12 +193,37 @@ export enum AuditLogEvent {
ThreadDelete,
ApplicationCommandPermissionUpdate = 121,
AutoModerationRuleCreate = 140,
AutoModerationRuleUpdate,
AutoModerationRuleDelete,
AutoModerationBlockMessage,
AutoModerationFlagToChannel,
AutoModerationUserCommunicationDisabled,
}
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
*/
export interface APIAuditLogOptions {
/**
* Name of the Auto Moderation rule that was triggered
*
* Present from:
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
*/
auto_moderation_rule_name?: string;
/**
* Trigger type of the Auto Moderation rule that was triggered
*
* Present from:
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
*/
auto_moderation_rule_trigger_type?: AuditLogRuleTriggerType;
/**
* Number of days after which inactive members were kicked
*
@@ -212,6 +250,9 @@ export interface APIAuditLogOptions {
* - STAGE_INSTANCE_CREATE
* - STAGE_INSTANCE_UPDATE
* - STAGE_INSTANCE_DELETE
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
*/
channel_id?: Snowflake;
@@ -275,6 +316,8 @@ export enum AuditLogOptionsType {
Member = '1',
}
export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
*/
@@ -347,7 +390,14 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeyLocation
| APIAuditLogChangeKeyCommunicationDisabledUntil;
| APIAuditLogChangeKeyCommunicationDisabledUntil
| APIAuditLogChangeKeyTriggerType
| APIAuditLogChangeKeyEventType
| APIAuditLogChangeKeyTriggerMetadata
| APIAuditLogChangeKeyActions
| APIAuditLogChangeKeyEnabled
| APIAuditLogChangeKeyExemptRoles
| APIAuditLogChangeKeyExemptChannels;
/**
* Returned when an entity's name is changed
@@ -710,6 +760,44 @@ export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string
*/
export type APIAuditLogChangeKeyCommunicationDisabledUntil = AuditLogChangeData<'communication_disabled_until', string>;
/**
* Returned when an auto moderation rule's trigger type is changed (only in rule creation or deletion)
*/
export type APIAuditLogChangeKeyTriggerType = AuditLogChangeData<'trigger_type', AutoModerationRuleTriggerType>;
/**
* Returned when an auto moderation rule's event type is changed
*/
export type APIAuditLogChangeKeyEventType = AuditLogChangeData<'event_type', AutoModerationRuleEventType>;
/**
* Returned when an auto moderation rule's trigger metadata is changed
*/
export type APIAuditLogChangeKeyTriggerMetadata = AuditLogChangeData<
'trigger_metadata',
APIAutoModerationRuleTriggerMetadata
>;
/**
* Returned when an auto moderation rule's actions is changed
*/
export type APIAuditLogChangeKeyActions = AuditLogChangeData<'actions', APIAutoModerationAction[]>;
/**
* Returned when an auto moderation rule's enabled status is changed
*/
export type APIAuditLogChangeKeyEnabled = AuditLogChangeData<'enabled', boolean>;
/**
* Returned when an auto moderation rule's exempt roles is changed
*/
export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles', Snowflake[]>;
/**
* Returned when an auto moderation rule's exempt channels is changed
*/
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
interface AuditLogChangeData<K extends string, D> {
key: K;
/**

View File

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

View File

@@ -42,18 +42,15 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
export type TextChannelType =
| ChannelType.DM
| ChannelType.GroupDM
| ChannelType.GuildNews
| ChannelType.GuildPublicThread
| ChannelType.GuildPrivateThread
| ChannelType.GuildNewsThread
| ChannelType.GuildAnnouncement
| ChannelType.PublicThread
| ChannelType.PrivateThread
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum
| ChannelType.GuildVoice;
export type GuildChannelType = Exclude<
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
ChannelType.DM | ChannelType.GroupDM
>;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
@@ -122,7 +119,7 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
}
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
@@ -190,9 +187,7 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
}
export interface APIThreadChannel
extends APIGuildChannel<
ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread | ChannelType.GuildNewsThread
> {
extends APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -235,9 +230,85 @@ export interface APIThreadChannel
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
*/
total_message_sent?: number;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel
*/
applied_tags: Snowflake[];
}
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
/**
* https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure
*/
export interface APIGuildForumTag {
/**
* The id of the tag
*/
id: Snowflake;
/**
* The name of the tag (0-20 characters)
*/
name: string;
/**
* Whether this tag can only be added to or removed from threads by a member with the `MANAGE_THREADS` permission
*/
moderated: boolean;
/**
* The id of a guild's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of the emoji
*/
emoji_name: string | null;
}
/**
* https://discord.com/developers/docs/resources/channel#default-reaction-object-default-reaction-structure
*/
export interface APIGuildForumDefaultReactionEmoji {
/**
* The id of a guild's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of the emoji
*/
emoji_name: string | null;
}
/**
* https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types
*/
export enum SortOrderType {
/**
* Sort forum posts by activity
*/
LatestActivity,
/**
* Sort forum posts by creation time (from most recent to oldest)
*/
CreationDate,
}
export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
/**
* The set of tags that can be used in a forum channel
*/
available_tags: APIGuildForumTag[];
/**
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
* This field is copied to the thread at creation time and does not live update
*/
default_thread_rate_limit_per_user?: number;
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*/
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
/**
* The default sort order type used to order posts in forum channels
*/
default_sort_order: SortOrderType | null;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
@@ -285,19 +356,19 @@ export enum ChannelType {
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews,
GuildAnnouncement,
/**
* A thread channel (public) within a Guild News channel
* A temporary sub-channel within a Guild Announcement channel
*/
GuildNewsThread = 10,
AnnouncementThread = 10,
/**
* A public thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel
*/
GuildPublicThread,
PublicThread,
/**
* A private thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*/
GuildPrivateThread,
PrivateThread,
/**
* A voice channel for hosting events with an audience
*
@@ -314,6 +385,34 @@ export enum ChannelType {
* A channel that can only contain threads
*/
GuildForum,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS
/**
* A channel that users can follow and crosspost into their own guild
*
* @deprecated This is the old name for {@apilink ChannelType#GuildAnnouncement}
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews = 5,
/**
* A temporary sub-channel within a Guild Announcement channel
*
* @deprecated This is the old name for {@apilink ChannelType#AnnouncementThread}
*/
GuildNewsThread = 10,
/**
* A temporary sub-channel within a Guild Text channel
*
* @deprecated This is the old name for {@apilink ChannelType#PublicThread}
*/
GuildPublicThread = 11,
/**
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*
* @deprecated This is the old name for {@apilink ChannelType#PrivateThread}
*/
GuildPrivateThread = 12,
}
export enum VideoQualityMode {
@@ -563,6 +662,7 @@ export enum MessageType {
ThreadStarterMessage,
GuildInviteReminder,
ContextMenuCommand,
AutoModerationAction,
}
/**
@@ -919,6 +1019,12 @@ export enum EmbedType {
* Link embed
*/
Link = 'link',
/**
* Auto moderation alert embed
*
* @unstable This embed type is currently not documented by Discord, but it is returned in the auto moderation system messages.
*/
AutoModerationMessage = 'auto_moderation_message',
}
/**
@@ -1405,7 +1511,15 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
*/
export enum ChannelFlags {
/**
* This thread is pinned to the top of its parent forum channel
*/
Pinned = 1 << 1,
/**
* Whether a tag is required to be specified when creating a thread in a forum channel.
* Tags are specified in the `applied_tags` field
*/
RequireTag = 1 << 4,
}
/**

View File

@@ -4,6 +4,7 @@
import type { APIEmoji } from './emoji.ts';
import type { PresenceUpdateStatus } from './gateway.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker } from './sticker.ts';
import type { APIUser } from './user.ts';
@@ -117,7 +118,7 @@ export interface APIGuild extends APIPartialGuild {
*/
afk_channel_id: Snowflake | null;
/**
* afk timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout: number;
/**
@@ -381,6 +382,10 @@ export enum GuildFeature {
* Guild has access to set an animated guild icon
*/
AnimatedIcon = 'ANIMATED_ICON',
/**
* Guild has set up auto moderation rules
*/
AutoModeration = 'AUTO_MODERATION',
/**
* Guild has access to set a guild banner image
*/
@@ -409,6 +414,10 @@ export enum GuildFeature {
* @unstable This feature is currently not documented by Discord, but has known value
*/
Hub = 'HUB',
/**
* Guild has disabled invite usage, preventing users from joining
*/
InvitesDisabled = 'INVITES_DISABLED',
/**
* Guild has access to set an invite splash background
*/
@@ -698,6 +707,10 @@ export interface APIGuildIntegration {
* **This field is not provided for `discord` bot integrations.**
*/
application?: APIGuildIntegrationApplication;
/**
* The scopes the application has been authorized for
*/
scopes?: OAuth2Scopes[];
}
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord';

View File

@@ -1,6 +1,7 @@
export * from '../common.ts';
export * from './application.ts';
export * from './auditLog.ts';
export * from './autoModeration.ts';
export * from './channel.ts';
export * from './emoji.ts';
export * from './gateway.ts';

View File

@@ -204,6 +204,10 @@ export interface APIConnection {
* Whether activities related to this connection will be shown in presence updates
*/
show_activity: boolean;
/**
* Whether this connection supports console voice transfer
*/
two_way_link: boolean;
/**
* Visibility of this connection
*
@@ -214,13 +218,15 @@ export interface APIConnection {
export enum ConnectionService {
BattleNet = 'battlenet',
eBay = 'ebay',
EpicGames = 'epicgames',
Facebook = 'facebook',
GitHub = 'github',
LeagueOfLegends = 'leagueoflegends',
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
SamsungGalaxy = 'samsunggalaxy',
RiotGames = 'riotgames',
PayPal = 'paypal',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',

View File

@@ -137,9 +137,14 @@ export enum RESTJSONErrorCodes {
ApplicationInteractionFailedToSend = 40043,
CannotSendAMessageInAForumChannel = 40058,
InteractionHasAlreadyBeenAcknowledged = 40060,
TagNamesMustBeUnique,
ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40066,
TagRequiredToCreateAForumPostInThisChannel,
MissingAccess = 50001,
InvalidAccountType,
CannotExecuteActionOnDMChannel,
@@ -186,7 +191,8 @@ export enum RESTJSONErrorCodes {
PaymentSourceRequiredToRedeemGift = 50070,
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
CannotModifyASystemWebhook = 50073,
CannotDeleteChannelRequiredForCommunityGuilds,
CannotEditStickersWithinMessage = 50080,
InvalidStickerSent,
@@ -246,7 +252,12 @@ export enum RESTJSONErrorCodes {
MessageWasBlockedByAutomaticModeration = 200000,
TitleWasBlockedByAutomaticModeration,
WebhooksCanOnlyCreateThreadsInForumChannels = 220003,
WebhooksPostedToForumChannelsMustHaveAThreadNameOrThreadId = 220001,
WebhooksPostedToForumChannelsCannotHaveBothAThreadNameAndThreadId,
WebhooksCanOnlyCreateThreadsInForumChannels,
WebhookServicesCannotBeUsedInForumChannels,
MessageBlockedByHarmfulLinksFilter = 240000,
}
/**

View File

@@ -0,0 +1,84 @@
import type { Snowflake } from '../../globals.ts';
import type {
APIAutoModerationAction,
APIAutoModerationRule,
AutoModerationRuleEventType,
APIAutoModerationRuleTriggerMetadata,
AutoModerationRuleTriggerType,
} from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
*/
export type RESTGetAPIAutoModerationRulesResult = APIAutoModerationRule[];
/**
* https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule
*/
export type RESTGetAPIAutoModerationRuleResult = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
*/
export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* The rule name
*/
name: string;
/**
* The rule event type
*/
event_type: AutoModerationRuleEventType;
/**
* The rule trigger type
*/
trigger_type: AutoModerationRuleTriggerType;
/**
* The rule trigger metadata
*
* Can be omitted if the trigger type is {@link AutoModerationRuleTriggerType.HarmfulLink} or {@link AutoModerationRuleTriggerType.Spam}
*/
trigger_metadata?: APIAutoModerationRuleTriggerMetadata;
/**
* The actions which will execute when this rule is triggered
*/
actions: APIAutoModerationAction[];
/**
* Whether this rule is enabled
*
* @default false
*/
enabled?: boolean;
/**
* The role ids that shouldn't be affected by this rule (Maximum of 20)
*/
exempt_roles?: Snowflake[];
/**
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
*/
exempt_channels?: Snowflake[];
}>;
/**
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
*/
export type RESTPostAPIAutoModerationRuleResult = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
*/
export type RESTPatchAPIAutoModerationRuleJSONBody = Omit<
Partial<RESTPostAPIAutoModerationRuleJSONBody>,
'trigger_type'
>;
/**
* https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
*/
export type RESTPatchAPIAutoModerationRuleResult = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule
*/
export type RESTDeleteAPIAutoModerationRuleResult = never;

View File

@@ -19,6 +19,9 @@ import type {
OverwriteType,
ThreadAutoArchiveDuration,
VideoQualityMode,
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
} from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
@@ -48,7 +51,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*
* Channel types: text, news
*/
type?: ChannelType.GuildNews | ChannelType.GuildText;
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText;
/**
* The position of the channel in the left-hand listing
*
@@ -56,15 +59,15 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*/
position?: number | null;
/**
* 0-1024 character channel topic
* 0-1024 character channel topic (0-4096 characters for forum channels)
*
* Channel types: text, news
* Channel types: text, news, forum
*/
topic?: string | null;
/**
* Whether the channel is nsfw
*
* Channel types: text, voice, news
* Channel types: text, voice, news, forum
*/
nsfw?: boolean | null;
/**
@@ -72,7 +75,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
* are unaffected
*
* Channel types: text, newsThread, publicThread, privateThread
* Channel types: text, newsThread, publicThread, privateThread, forum
*/
rate_limit_per_user?: number | null;
/**
@@ -141,6 +144,31 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
* Channel types: privateThread
*/
invitable?: boolean;
/**
* The set of tags that can be used in a forum channel
*
* Channel types: forum
*/
available_tags?: APIGuildForumTag[];
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*
* Channel types: forum
*/
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji;
/**
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
* This field is copied to the thread at creation time and does not live update
*
* Channel types: text, forum
*/
default_thread_rate_limit_per_user?: number | null;
/**
* The default sort order type used to order posts in forum channels
*
* Channel types: forum
*/
default_sort_order?: SortOrderType | null;
}>;
/**
@@ -589,6 +617,10 @@ export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThr
* First message in the forum thread
*/
message: RESTPostAPIChannelMessageJSONBody;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel
*/
applied_tags?: Snowflake[];
};
/**
@@ -619,9 +651,9 @@ export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThread
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*
* @default ChannelType.GuildPrivateThread
* @default ChannelType.PrivateThread
*/
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/

View File

@@ -53,6 +53,9 @@ export type APIGuildCreatePartialChannel = StrictPartial<
| 'rtc_region'
| 'video_quality_mode'
| 'flags'
| 'default_reaction_emoji'
| 'available_tags'
| 'default_sort_order'
>
> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
@@ -135,7 +138,7 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*/
afk_channel_id?: number | Snowflake | null;
/**
* AFK timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: number;
/**
@@ -235,7 +238,7 @@ export type RESTPatchAPIGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*/
afk_channel_id?: Snowflake | null;
/**
* AFK timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: number;
/**
@@ -573,8 +576,14 @@ export type RESTGetAPIGuildBanResult = APIBan;
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Number of days to delete messages for (0-7)
*
* @deprecated use `delete_message_seconds` instead
*/
delete_message_days?: number;
/**
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
*/
delete_message_seconds?: number;
}>;
/**
@@ -855,7 +864,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
channel_id?: Snowflake;
/**
* Toggles the user's suppress state
*/

View File

@@ -2,6 +2,7 @@ import type { Snowflake } from '../../globals.ts';
export * from '../common.ts';
export * from './auditLog.ts';
export * from './autoModeration.ts';
export * from './channel.ts';
export * from './emoji.ts';
export * from './gateway.ts';
@@ -20,6 +21,25 @@ export * from './webhook.ts';
export const APIVersion = '10';
export const Routes = {
/**
* Route for:
* - GET `/guilds/{guild.id}/auto-moderation/rules`
* - POST `/guilds/{guild.id}/auto-moderation/rules`
*/
guildAutoModerationRules(guildId: Snowflake) {
return `/guilds/${guildId}/auto-moderation/rules` as const;
},
/**
* Routes for:
* - GET `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
* - PATCH `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
* - DELETE `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
*/
guildAutoModerationRule(guildId: Snowflake, ruleId: Snowflake) {
return `/guilds/${guildId}/auto-moderation/rules/${ruleId}` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/audit-logs`

View File

@@ -0,0 +1,84 @@
import type { Snowflake } from '../../globals.ts';
import type {
APIAutoModerationAction,
APIAutoModerationRule,
AutoModerationRuleEventType,
APIAutoModerationRuleTriggerMetadata,
AutoModerationRuleTriggerType,
} from '../../payloads/v9/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
*/
export type RESTGetAPIAutoModerationRulesResult = APIAutoModerationRule[];
/**
* https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule
*/
export type RESTGetAPIAutoModerationRuleResult = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
*/
export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* The rule name
*/
name: string;
/**
* The rule event type
*/
event_type: AutoModerationRuleEventType;
/**
* The rule trigger type
*/
trigger_type: AutoModerationRuleTriggerType;
/**
* The rule trigger metadata
*
* Can be omitted if the trigger type is {@link AutoModerationRuleTriggerType.HarmfulLink} or {@link AutoModerationRuleTriggerType.Spam}
*/
trigger_metadata?: APIAutoModerationRuleTriggerMetadata;
/**
* The actions which will execute when this rule is triggered
*/
actions: APIAutoModerationAction[];
/**
* Whether this rule is enabled
*
* @default false
*/
enabled?: boolean;
/**
* The role ids that shouldn't be affected by this rule (Maximum of 20)
*/
exempt_roles?: Snowflake[];
/**
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
*/
exempt_channels?: Snowflake[];
}>;
/**
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
*/
export type RESTPostAPIAutoModerationRuleResult = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
*/
export type RESTPatchAPIAutoModerationRuleJSONBody = Omit<
Partial<RESTPostAPIAutoModerationRuleJSONBody>,
'trigger_type'
>;
/**
* https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
*/
export type RESTPatchAPIAutoModerationRuleResult = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule
*/
export type RESTDeleteAPIAutoModerationRuleResult = never;

View File

@@ -19,6 +19,9 @@ import type {
OverwriteType,
ThreadAutoArchiveDuration,
VideoQualityMode,
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
} from '../../payloads/v9/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
@@ -48,7 +51,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*
* Channel types: text, news
*/
type?: ChannelType.GuildNews | ChannelType.GuildText;
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText;
/**
* The position of the channel in the left-hand listing
*
@@ -56,15 +59,15 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*/
position?: number | null;
/**
* 0-1024 character channel topic
* 0-1024 character channel topic (0-4096 characters for forum channels)
*
* Channel types: text, news
* Channel types: text, news, forum
*/
topic?: string | null;
/**
* Whether the channel is nsfw
*
* Channel types: text, voice, news
* Channel types: text, voice, news, forum
*/
nsfw?: boolean | null;
/**
@@ -72,7 +75,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
* are unaffected
*
* Channel types: text, newsThread, publicThread, privateThread
* Channel types: text, newsThread, publicThread, privateThread, forum
*/
rate_limit_per_user?: number | null;
/**
@@ -141,6 +144,31 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
* Channel types: privateThread
*/
invitable?: boolean;
/**
* The set of tags that can be used in a forum channel
*
* Channel types: forum
*/
available_tags?: APIGuildForumTag[];
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*
* Channel types: forum
*/
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji;
/**
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
* This field is copied to the thread at creation time and does not live update
*
* Channel types: text, forum
*/
default_thread_rate_limit_per_user?: number | null;
/**
* The default sort order type used to order posts in forum channels
*
* Channel types: forum
*/
default_sort_order?: SortOrderType | null;
}>;
/**
@@ -603,6 +631,10 @@ export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThr
* First message in the forum thread
*/
message: RESTPostAPIChannelMessageJSONBody;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel
*/
applied_tags?: Snowflake[];
};
/**
@@ -633,9 +665,9 @@ export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThread
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*
* @default ChannelType.GuildPrivateThread
* @default ChannelType.PrivateThread
*/
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/

View File

@@ -53,6 +53,9 @@ export type APIGuildCreatePartialChannel = StrictPartial<
| 'rtc_region'
| 'video_quality_mode'
| 'flags'
| 'default_reaction_emoji'
| 'available_tags'
| 'default_sort_order'
>
> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
@@ -135,7 +138,7 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*/
afk_channel_id?: number | Snowflake | null;
/**
* AFK timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: number;
/**
@@ -235,7 +238,7 @@ export type RESTPatchAPIGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*/
afk_channel_id?: Snowflake | null;
/**
* AFK timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: number;
/**
@@ -573,8 +576,14 @@ export type RESTGetAPIGuildBanResult = APIBan;
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Number of days to delete messages for (0-7)
*
* @deprecated use `delete_message_seconds` instead
*/
delete_message_days?: number;
/**
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
*/
delete_message_seconds?: number;
/**
* Reason for the ban
*
@@ -861,7 +870,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
channel_id?: Snowflake;
/**
* Toggles the user's suppress state
*/

View File

@@ -2,6 +2,7 @@ import type { Snowflake } from '../../globals.ts';
export * from '../common.ts';
export * from './auditLog.ts';
export * from './autoModeration.ts';
export * from './channel.ts';
export * from './emoji.ts';
export * from './gateway.ts';
@@ -20,6 +21,25 @@ export * from './webhook.ts';
export const APIVersion = '9';
export const Routes = {
/**
* Route for:
* - GET `/guilds/{guild.id}/auto-moderation/rules`
* - POST `/guilds/{guild.id}/auto-moderation/rules`
*/
guildAutoModerationRules(guildId: Snowflake) {
return `/guilds/${guildId}/auto-moderation/rules` as const;
},
/**
* Routes for:
* - GET `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
* - PATCH `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
* - DELETE `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
*/
guildAutoModerationRule(guildId: Snowflake, ruleId: Snowflake) {
return `/guilds/${guildId}/auto-moderation/rules/${ruleId}` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/audit-logs`

View File

@@ -6,6 +6,8 @@ import type { Snowflake } from '../globals';
import type { GatewayPresenceUpdate } from '../payloads/v10/gateway';
import type {
APIApplication,
APIAutoModerationRule,
APIAutoModerationAction,
APIChannel,
APIEmoji,
APIGuild,
@@ -28,6 +30,7 @@ import type {
GatewayVoiceState,
InviteTargetType,
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
} from '../payloads/v10/index';
import type { Nullable } from '../utils/internals';
@@ -190,6 +193,8 @@ export enum GatewayIntentBits {
DirectMessageTyping = 1 << 14,
MessageContent = 1 << 15,
GuildScheduledEvents = 1 << 16,
AutoModerationConfiguration = 1 << 20,
AutoModerationExecution = 1 << 21,
}
/**
@@ -252,6 +257,10 @@ export enum GatewayDispatchEvents {
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
}
export type GatewaySendPayload =
@@ -432,6 +441,121 @@ export interface GatewayReadyDispatchData {
*/
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleModifyDispatch = DataPayload<
| GatewayDispatchEvents.AutoModerationRuleCreate
| GatewayDispatchEvents.AutoModerationRuleUpdate
| GatewayDispatchEvents.AutoModerationRuleDelete,
GatewayAutoModerationRuleModifyDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleModifyDispatchData = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
*/
export type GatewayAutoModerationRuleCreateDispatch = GatewayAutoModerationRuleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
*/
export type GatewayAutoModerationRuleCreateDispatchData = GatewayAutoModerationRuleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
*/
export type GatewayAutoModerationRuleUpdateDispatch = GatewayAutoModerationRuleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
*/
export type GatewayAutoModerationRuleUpdateDispatchData = GatewayAutoModerationRuleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleDeleteDispatch = GatewayAutoModerationRuleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleDeleteDispatchData = GatewayAutoModerationRuleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-action-execution
*/
export type GatewayAutoModerationActionExecutionDispatch = DataPayload<
GatewayDispatchEvents.AutoModerationActionExecution,
GatewayAutoModerationActionExecutionDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution
*/
export interface GatewayAutoModerationActionExecutionDispatchData {
/**
* The id of the guild in which action was executed
*/
guild_id: Snowflake;
/**
* The action which was executed
*/
action: APIAutoModerationAction;
/**
* The id of the rule which action belongs to
*/
rule_id: Snowflake;
/**
* The trigger type of rule which was triggered
*/
rule_trigger_type: AutoModerationRuleTriggerType;
/**
* The id of the user which generated the content which triggered the rule
*/
user_id: Snowflake;
/**
* The id of the channel in which user content was posted
*/
channel_id?: Snowflake;
/**
* The id of any user message which content belongs to
*
* This field will not be present if message was blocked by AutoMod or content was not part of any message
*/
message_id?: Snowflake;
/**
* The id of any system auto moderation messages posted as a result of this action
*
* This field will not be present if this event does not correspond to an action with type {@link AutoModerationActionType.SendAlertMessage}
*/
alert_system_message_id?: Snowflake;
/**
* The user generated text content
*
* `MESSAGE_CONTENT` (`1 << 15`) gateway intent is required to receive non-empty values from this field
*/
content: string;
/**
* The word or phrase configured in the rule that triggered the rule
*/
matched_keyword: string | null;
/**
* The substring in content that triggered the rule
*
* `MESSAGE_CONTENT` (`1 << 15`) gateway intent is required to receive non-empty values from this field
*/
matched_content: string | null;
}
/**
* https://discord.com/developers/docs/topics/gateway#channel-create
* https://discord.com/developers/docs/topics/gateway#channel-update

View File

@@ -6,6 +6,8 @@ import type { Snowflake } from '../globals';
import type { GatewayPresenceUpdate } from '../payloads/v9/gateway';
import type {
APIApplication,
APIAutoModerationRule,
APIAutoModerationAction,
APIChannel,
APIEmoji,
APIGuild,
@@ -28,6 +30,7 @@ import type {
GatewayVoiceState,
InviteTargetType,
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
} from '../payloads/v9/index';
import type { Nullable } from '../utils/internals';
@@ -189,6 +192,8 @@ export enum GatewayIntentBits {
DirectMessageReactions = 1 << 13,
DirectMessageTyping = 1 << 14,
GuildScheduledEvents = 1 << 16,
AutoModerationConfiguration = 1 << 20,
AutoModerationExecution = 1 << 21,
}
/**
@@ -251,6 +256,10 @@ export enum GatewayDispatchEvents {
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
}
export type GatewaySendPayload =
@@ -431,6 +440,121 @@ export interface GatewayReadyDispatchData {
*/
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleModifyDispatch = DataPayload<
| GatewayDispatchEvents.AutoModerationRuleCreate
| GatewayDispatchEvents.AutoModerationRuleUpdate
| GatewayDispatchEvents.AutoModerationRuleDelete,
GatewayAutoModerationRuleModifyDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleModifyDispatchData = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
*/
export type GatewayAutoModerationRuleCreateDispatch = GatewayAutoModerationRuleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-create
*/
export type GatewayAutoModerationRuleCreateDispatchData = GatewayAutoModerationRuleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
*/
export type GatewayAutoModerationRuleUpdateDispatch = GatewayAutoModerationRuleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-update
*/
export type GatewayAutoModerationRuleUpdateDispatchData = GatewayAutoModerationRuleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleDeleteDispatch = GatewayAutoModerationRuleModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-rule-delete
*/
export type GatewayAutoModerationRuleDeleteDispatchData = GatewayAutoModerationRuleModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway#auto-moderation-action-execution
*/
export type GatewayAutoModerationActionExecutionDispatch = DataPayload<
GatewayDispatchEvents.AutoModerationActionExecution,
GatewayAutoModerationActionExecutionDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#auto-moderation-action-execution
*/
export interface GatewayAutoModerationActionExecutionDispatchData {
/**
* The id of the guild in which action was executed
*/
guild_id: Snowflake;
/**
* The action which was executed
*/
action: APIAutoModerationAction;
/**
* The id of the rule which action belongs to
*/
rule_id: Snowflake;
/**
* The trigger type of rule which was triggered
*/
rule_trigger_type: AutoModerationRuleTriggerType;
/**
* The id of the user which generated the content which triggered the rule
*/
user_id: Snowflake;
/**
* The id of the channel in which user content was posted
*/
channel_id?: Snowflake;
/**
* The id of any user message which content belongs to
*
* This field will not be present if message was blocked by AutoMod or content was not part of any message
*/
message_id?: Snowflake;
/**
* The id of any system auto moderation messages posted as a result of this action
*
* This field will not be present if this event does not correspond to an action with type {@link AutoModerationActionType.SendAlertMessage}
*/
alert_system_message_id?: Snowflake;
/**
* The user generated text content
*
* `MESSAGE_CONTENT` (`1 << 15`) gateway intent is required to receive non-empty values from this field
*/
content: string;
/**
* The word or phrase configured in the rule that triggered the rule
*/
matched_keyword: string | null;
/**
* The substring in content that triggered the rule
*
* `MESSAGE_CONTENT` (`1 << 15`) gateway intent is required to receive non-empty values from this field
*/
matched_content: string | null;
}
/**
* https://discord.com/developers/docs/topics/gateway#channel-create
* https://discord.com/developers/docs/topics/gateway#channel-update

View File

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

16
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{
"name": "discord-api-types",
"version": "0.37.2",
"version": "0.37.14",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "discord-api-types",
"version": "0.37.2",
"version": "0.37.14",
"license": "MIT",
"devDependencies": {
"@babel/runtime-corejs3": "^7.18.0",
@@ -7611,9 +7611,9 @@
}
},
"node_modules/vm2": {
"version": "3.9.9",
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.9.tgz",
"integrity": "sha512-xwTm7NLh/uOjARRBs8/95H0e8fT3Ukw5D/JJWhxMbhKzNh1Nu981jQKvkep9iKYNxzlVrdzD0mlBGkDKZWprlw==",
"version": "3.9.11",
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.11.tgz",
"integrity": "sha512-PFG8iJRSjvvBdisowQ7iVF580DXb1uCIiGaXgm7tynMR1uTBlv7UJlB1zdv5KJ+Tmq1f0Upnj3fayoEOPpCBKg==",
"dev": true,
"dependencies": {
"acorn": "^8.7.0",
@@ -13609,9 +13609,9 @@
}
},
"vm2": {
"version": "3.9.9",
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.9.tgz",
"integrity": "sha512-xwTm7NLh/uOjARRBs8/95H0e8fT3Ukw5D/JJWhxMbhKzNh1Nu981jQKvkep9iKYNxzlVrdzD0mlBGkDKZWprlw==",
"version": "3.9.11",
"resolved": "https://registry.npmjs.org/vm2/-/vm2-3.9.11.tgz",
"integrity": "sha512-PFG8iJRSjvvBdisowQ7iVF580DXb1uCIiGaXgm7tynMR1uTBlv7UJlB1zdv5KJ+Tmq1f0Upnj3fayoEOPpCBKg==",
"dev": true,
"requires": {
"acorn": "^8.7.0",

View File

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

View File

@@ -58,3 +58,41 @@ export const PermissionFlagsBits = {
Object.freeze(PermissionFlagsBits);
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json
*/
export interface RESTError {
code: number;
message: string;
errors?: RESTErrorData;
}
export interface RESTErrorFieldInformation {
code: string;
message: string;
}
export interface RESTErrorGroupWrapper {
_errors: RESTErrorData[];
}
export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation | { [k: string]: RESTErrorData } | string;
/**
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
*/
export interface RESTRateLimit {
/**
* A value indicating if you are being globally rate limited or not
*/
global: boolean;
/**
* A message saying you are being rate limited.
*/
message: string;
/**
* The number of seconds to wait before submitting another request.
*/
retry_after: number;
}

View File

@@ -54,6 +54,7 @@ import type {
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base';
export * from './_chatInput/attachment';
export * from './_chatInput/base';
export * from './_chatInput/boolean';
export * from './_chatInput/channel';
export * from './_chatInput/integer';

View File

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

View File

@@ -129,4 +129,5 @@ export enum ApplicationFlags {
GatewayMessageContent = 1 << 18,
GatewayMessageContentLimited = 1 << 19,
EmbeddedFirstParty = 1 << 20,
ApplicationCommandBadge = 1 << 23,
}

View File

@@ -2,6 +2,13 @@
* Types extracted from https://discord.com/developers/docs/resources/audit-log
*/
import type {
APIAutoModerationAction,
APIAutoModerationRule,
APIAutoModerationRuleTriggerMetadata,
AutoModerationRuleEventType,
AutoModerationRuleTriggerType,
} from './autoModeration';
import type { APIChannel, APIOverwrite } from './channel';
import type {
APIGuildIntegration,
@@ -52,6 +59,12 @@ export interface APIAuditLog {
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object
*/
audit_log_entries: APIAuditLogEntry[];
/**
* List of auto moderation rules referenced in the audit log
*
* See https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object
*/
auto_moderation_rules: APIAutoModerationRule[];
/**
* Partial integration objects
*
@@ -180,12 +193,37 @@ export enum AuditLogEvent {
ThreadDelete,
ApplicationCommandPermissionUpdate = 121,
AutoModerationRuleCreate = 140,
AutoModerationRuleUpdate,
AutoModerationRuleDelete,
AutoModerationBlockMessage,
AutoModerationFlagToChannel,
AutoModerationUserCommunicationDisabled,
}
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
*/
export interface APIAuditLogOptions {
/**
* Name of the Auto Moderation rule that was triggered
*
* Present from:
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
*/
auto_moderation_rule_name?: string;
/**
* Trigger type of the Auto Moderation rule that was triggered
*
* Present from:
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
*/
auto_moderation_rule_trigger_type?: AuditLogRuleTriggerType;
/**
* Number of days after which inactive members were kicked
*
@@ -212,6 +250,9 @@ export interface APIAuditLogOptions {
* - STAGE_INSTANCE_CREATE
* - STAGE_INSTANCE_UPDATE
* - STAGE_INSTANCE_DELETE
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
*/
channel_id?: Snowflake;
@@ -275,6 +316,8 @@ export enum AuditLogOptionsType {
Member = '1',
}
export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
*/
@@ -347,7 +390,14 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeyLocation
| APIAuditLogChangeKeyCommunicationDisabledUntil;
| APIAuditLogChangeKeyCommunicationDisabledUntil
| APIAuditLogChangeKeyTriggerType
| APIAuditLogChangeKeyEventType
| APIAuditLogChangeKeyTriggerMetadata
| APIAuditLogChangeKeyActions
| APIAuditLogChangeKeyEnabled
| APIAuditLogChangeKeyExemptRoles
| APIAuditLogChangeKeyExemptChannels;
/**
* Returned when an entity's name is changed
@@ -710,6 +760,44 @@ export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string
*/
export type APIAuditLogChangeKeyCommunicationDisabledUntil = AuditLogChangeData<'communication_disabled_until', string>;
/**
* Returned when an auto moderation rule's trigger type is changed (only in rule creation or deletion)
*/
export type APIAuditLogChangeKeyTriggerType = AuditLogChangeData<'trigger_type', AutoModerationRuleTriggerType>;
/**
* Returned when an auto moderation rule's event type is changed
*/
export type APIAuditLogChangeKeyEventType = AuditLogChangeData<'event_type', AutoModerationRuleEventType>;
/**
* Returned when an auto moderation rule's trigger metadata is changed
*/
export type APIAuditLogChangeKeyTriggerMetadata = AuditLogChangeData<
'trigger_metadata',
APIAutoModerationRuleTriggerMetadata
>;
/**
* Returned when an auto moderation rule's actions is changed
*/
export type APIAuditLogChangeKeyActions = AuditLogChangeData<'actions', APIAutoModerationAction[]>;
/**
* Returned when an auto moderation rule's enabled status is changed
*/
export type APIAuditLogChangeKeyEnabled = AuditLogChangeData<'enabled', boolean>;
/**
* Returned when an auto moderation rule's exempt roles is changed
*/
export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles', Snowflake[]>;
/**
* Returned when an auto moderation rule's exempt channels is changed
*/
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
interface AuditLogChangeData<K extends string, D> {
key: K;
/**

View File

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

View File

@@ -42,18 +42,15 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
export type TextChannelType =
| ChannelType.DM
| ChannelType.GroupDM
| ChannelType.GuildNews
| ChannelType.GuildPublicThread
| ChannelType.GuildPrivateThread
| ChannelType.GuildNewsThread
| ChannelType.GuildAnnouncement
| ChannelType.PublicThread
| ChannelType.PrivateThread
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum
| ChannelType.GuildVoice;
export type GuildChannelType = Exclude<
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
ChannelType.DM | ChannelType.GroupDM
>;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
@@ -111,7 +108,7 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration;
/**
* The channel topic (0-1024 characters)
* The channel topic (0-4096 characters for forum channels, 0-1024 characters for all others)
*/
topic?: string | null;
/**
@@ -122,7 +119,7 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
}
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
@@ -190,9 +187,7 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
}
export interface APIThreadChannel
extends APIGuildChannel<
ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread | ChannelType.GuildNewsThread
> {
extends APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -235,9 +230,85 @@ export interface APIThreadChannel
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
*/
total_message_sent?: number;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel
*/
applied_tags: Snowflake[];
}
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
/**
* https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure
*/
export interface APIGuildForumTag {
/**
* The id of the tag
*/
id: Snowflake;
/**
* The name of the tag (0-20 characters)
*/
name: string;
/**
* Whether this tag can only be added to or removed from threads by a member with the `MANAGE_THREADS` permission
*/
moderated: boolean;
/**
* The id of a guild's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of the emoji
*/
emoji_name: string | null;
}
/**
* https://discord.com/developers/docs/resources/channel#default-reaction-object-default-reaction-structure
*/
export interface APIGuildForumDefaultReactionEmoji {
/**
* The id of a guild's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of the emoji
*/
emoji_name: string | null;
}
/**
* https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types
*/
export enum SortOrderType {
/**
* Sort forum posts by activity
*/
LatestActivity,
/**
* Sort forum posts by creation time (from most recent to oldest)
*/
CreationDate,
}
export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
/**
* The set of tags that can be used in a forum channel
*/
available_tags: APIGuildForumTag[];
/**
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
* This field is copied to the thread at creation time and does not live update
*/
default_thread_rate_limit_per_user?: number;
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*/
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
/**
* The default sort order type used to order posts in forum channels
*/
default_sort_order: SortOrderType | null;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
@@ -285,19 +356,19 @@ export enum ChannelType {
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews,
GuildAnnouncement,
/**
* A thread channel (public) within a Guild News channel
* A temporary sub-channel within a Guild Announcement channel
*/
GuildNewsThread = 10,
AnnouncementThread = 10,
/**
* A public thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel
*/
GuildPublicThread,
PublicThread,
/**
* A private thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*/
GuildPrivateThread,
PrivateThread,
/**
* A voice channel for hosting events with an audience
*
@@ -314,6 +385,35 @@ export enum ChannelType {
* A channel that can only contain threads
*/
GuildForum,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
/**
* A channel that users can follow and crosspost into their own guild
*
* @deprecated This is the old name for {@apilink ChannelType#GuildAnnouncement}
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews = 5,
/**
* A temporary sub-channel within a Guild Announcement channel
*
* @deprecated This is the old name for {@apilink ChannelType#AnnouncementThread}
*/
GuildNewsThread = 10,
/**
* A temporary sub-channel within a Guild Text channel
*
* @deprecated This is the old name for {@apilink ChannelType#PublicThread}
*/
GuildPublicThread = 11,
/**
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*
* @deprecated This is the old name for {@apilink ChannelType#PrivateThread}
*/
GuildPrivateThread = 12,
}
export enum VideoQualityMode {
@@ -567,6 +667,7 @@ export enum MessageType {
ThreadStarterMessage,
GuildInviteReminder,
ContextMenuCommand,
AutoModerationAction,
}
/**
@@ -919,6 +1020,12 @@ export enum EmbedType {
* Link embed
*/
Link = 'link',
/**
* Auto moderation alert embed
*
* @unstable This embed type is currently not documented by Discord, but it is returned in the auto moderation system messages.
*/
AutoModerationMessage = 'auto_moderation_message',
}
/**
@@ -1405,7 +1512,15 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
*/
export enum ChannelFlags {
/**
* This thread is pinned to the top of its parent forum channel
*/
Pinned = 1 << 1,
/**
* Whether a tag is required to be specified when creating a thread in a forum channel.
* Tags are specified in the `applied_tags` field
*/
RequireTag = 1 << 4,
}
/**

View File

@@ -4,6 +4,7 @@
import type { APIEmoji } from './emoji';
import type { PresenceUpdateStatus } from './gateway';
import type { OAuth2Scopes } from './oauth2';
import type { APIRole } from './permissions';
import type { APISticker } from './sticker';
import type { APIUser } from './user';
@@ -117,7 +118,7 @@ export interface APIGuild extends APIPartialGuild {
*/
afk_channel_id: Snowflake | null;
/**
* afk timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout: number;
/**
@@ -381,6 +382,10 @@ export enum GuildFeature {
* Guild has access to set an animated guild icon
*/
AnimatedIcon = 'ANIMATED_ICON',
/**
* Guild has set up auto moderation rules
*/
AutoModeration = 'AUTO_MODERATION',
/**
* Guild has access to set a guild banner image
*/
@@ -409,6 +414,10 @@ export enum GuildFeature {
* @unstable This feature is currently not documented by Discord, but has known value
*/
Hub = 'HUB',
/**
* Guild has disabled invite usage, preventing users from joining
*/
InvitesDisabled = 'INVITES_DISABLED',
/**
* Guild has access to set an invite splash background
*/
@@ -698,6 +707,10 @@ export interface APIGuildIntegration {
* **This field is not provided for `discord` bot integrations.**
*/
application?: APIGuildIntegrationApplication;
/**
* The scopes the application has been authorized for
*/
scopes?: OAuth2Scopes[];
}
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord';

View File

@@ -1,6 +1,7 @@
export * from '../common';
export * from './application';
export * from './auditLog';
export * from './autoModeration';
export * from './channel';
export * from './emoji';
export * from './gateway';

View File

@@ -204,6 +204,10 @@ export interface APIConnection {
* Whether activities related to this connection will be shown in presence updates
*/
show_activity: boolean;
/**
* Whether this connection supports console voice transfer
*/
two_way_link: boolean;
/**
* Visibility of this connection
*
@@ -214,13 +218,15 @@ export interface APIConnection {
export enum ConnectionService {
BattleNet = 'battlenet',
eBay = 'ebay',
EpicGames = 'epicgames',
Facebook = 'facebook',
GitHub = 'github',
LeagueOfLegends = 'leagueoflegends',
PayPal = 'paypal',
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
SamsungGalaxy = 'samsunggalaxy',
RiotGames = 'riotgames',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',

View File

@@ -54,6 +54,7 @@ import type {
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base';
export * from './_chatInput/attachment';
export * from './_chatInput/base';
export * from './_chatInput/boolean';
export * from './_chatInput/channel';
export * from './_chatInput/integer';

View File

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

View File

@@ -129,4 +129,5 @@ export enum ApplicationFlags {
GatewayMessageContent = 1 << 18,
GatewayMessageContentLimited = 1 << 19,
EmbeddedFirstParty = 1 << 20,
ApplicationCommandBadge = 1 << 23,
}

View File

@@ -2,6 +2,13 @@
* Types extracted from https://discord.com/developers/docs/resources/audit-log
*/
import type {
APIAutoModerationAction,
APIAutoModerationRule,
APIAutoModerationRuleTriggerMetadata,
AutoModerationRuleEventType,
AutoModerationRuleTriggerType,
} from './autoModeration';
import type { APIChannel, APIOverwrite } from './channel';
import type {
APIGuildIntegration,
@@ -52,6 +59,12 @@ export interface APIAuditLog {
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object
*/
audit_log_entries: APIAuditLogEntry[];
/**
* List of auto moderation rules referenced in the audit log
*
* See https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object
*/
auto_moderation_rules: APIAutoModerationRule[];
/**
* Partial integration objects
*
@@ -180,12 +193,37 @@ export enum AuditLogEvent {
ThreadDelete,
ApplicationCommandPermissionUpdate = 121,
AutoModerationRuleCreate = 140,
AutoModerationRuleUpdate,
AutoModerationRuleDelete,
AutoModerationBlockMessage,
AutoModerationFlagToChannel,
AutoModerationUserCommunicationDisabled,
}
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
*/
export interface APIAuditLogOptions {
/**
* Name of the Auto Moderation rule that was triggered
*
* Present from:
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
*/
auto_moderation_rule_name?: string;
/**
* Trigger type of the Auto Moderation rule that was triggered
*
* Present from:
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
*/
auto_moderation_rule_trigger_type?: AuditLogRuleTriggerType;
/**
* Number of days after which inactive members were kicked
*
@@ -212,6 +250,9 @@ export interface APIAuditLogOptions {
* - STAGE_INSTANCE_CREATE
* - STAGE_INSTANCE_UPDATE
* - STAGE_INSTANCE_DELETE
* - AUTO_MODERATION_BLOCK_MESSAGE
* - AUTO_MODERATION_FLAG_TO_CHANNEL
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
*/
channel_id?: Snowflake;
@@ -275,6 +316,8 @@ export enum AuditLogOptionsType {
Member = '1',
}
export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
*/
@@ -347,7 +390,14 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeyLocation
| APIAuditLogChangeKeyCommunicationDisabledUntil;
| APIAuditLogChangeKeyCommunicationDisabledUntil
| APIAuditLogChangeKeyTriggerType
| APIAuditLogChangeKeyEventType
| APIAuditLogChangeKeyTriggerMetadata
| APIAuditLogChangeKeyActions
| APIAuditLogChangeKeyEnabled
| APIAuditLogChangeKeyExemptRoles
| APIAuditLogChangeKeyExemptChannels;
/**
* Returned when an entity's name is changed
@@ -710,6 +760,44 @@ export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string
*/
export type APIAuditLogChangeKeyCommunicationDisabledUntil = AuditLogChangeData<'communication_disabled_until', string>;
/**
* Returned when an auto moderation rule's trigger type is changed (only in rule creation or deletion)
*/
export type APIAuditLogChangeKeyTriggerType = AuditLogChangeData<'trigger_type', AutoModerationRuleTriggerType>;
/**
* Returned when an auto moderation rule's event type is changed
*/
export type APIAuditLogChangeKeyEventType = AuditLogChangeData<'event_type', AutoModerationRuleEventType>;
/**
* Returned when an auto moderation rule's trigger metadata is changed
*/
export type APIAuditLogChangeKeyTriggerMetadata = AuditLogChangeData<
'trigger_metadata',
APIAutoModerationRuleTriggerMetadata
>;
/**
* Returned when an auto moderation rule's actions is changed
*/
export type APIAuditLogChangeKeyActions = AuditLogChangeData<'actions', APIAutoModerationAction[]>;
/**
* Returned when an auto moderation rule's enabled status is changed
*/
export type APIAuditLogChangeKeyEnabled = AuditLogChangeData<'enabled', boolean>;
/**
* Returned when an auto moderation rule's exempt roles is changed
*/
export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles', Snowflake[]>;
/**
* Returned when an auto moderation rule's exempt channels is changed
*/
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
interface AuditLogChangeData<K extends string, D> {
key: K;
/**

View File

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

View File

@@ -42,18 +42,15 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
export type TextChannelType =
| ChannelType.DM
| ChannelType.GroupDM
| ChannelType.GuildNews
| ChannelType.GuildPublicThread
| ChannelType.GuildPrivateThread
| ChannelType.GuildNewsThread
| ChannelType.GuildAnnouncement
| ChannelType.PublicThread
| ChannelType.PrivateThread
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum
| ChannelType.GuildVoice;
export type GuildChannelType = Exclude<
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
ChannelType.DM | ChannelType.GroupDM
>;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
@@ -122,7 +119,7 @@ export interface APIGuildTextChannel<T extends GuildTextChannelType>
}
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export interface APIVoiceChannelBase<T extends ChannelType> extends APIGuildChannel<T> {
@@ -190,9 +187,7 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
}
export interface APIThreadChannel
extends APIGuildChannel<
ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread | ChannelType.GuildNewsThread
> {
extends APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -235,9 +230,85 @@ export interface APIThreadChannel
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
*/
total_message_sent?: number;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel
*/
applied_tags: Snowflake[];
}
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
/**
* https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure
*/
export interface APIGuildForumTag {
/**
* The id of the tag
*/
id: Snowflake;
/**
* The name of the tag (0-20 characters)
*/
name: string;
/**
* Whether this tag can only be added to or removed from threads by a member with the `MANAGE_THREADS` permission
*/
moderated: boolean;
/**
* The id of a guild's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of the emoji
*/
emoji_name: string | null;
}
/**
* https://discord.com/developers/docs/resources/channel#default-reaction-object-default-reaction-structure
*/
export interface APIGuildForumDefaultReactionEmoji {
/**
* The id of a guild's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of the emoji
*/
emoji_name: string | null;
}
/**
* https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types
*/
export enum SortOrderType {
/**
* Sort forum posts by activity
*/
LatestActivity,
/**
* Sort forum posts by creation time (from most recent to oldest)
*/
CreationDate,
}
export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
/**
* The set of tags that can be used in a forum channel
*/
available_tags: APIGuildForumTag[];
/**
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
* This field is copied to the thread at creation time and does not live update
*/
default_thread_rate_limit_per_user?: number;
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*/
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
/**
* The default sort order type used to order posts in forum channels
*/
default_sort_order: SortOrderType | null;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
@@ -285,19 +356,19 @@ export enum ChannelType {
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews,
GuildAnnouncement,
/**
* A thread channel (public) within a Guild News channel
* A temporary sub-channel within a Guild Announcement channel
*/
GuildNewsThread = 10,
AnnouncementThread = 10,
/**
* A public thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel
*/
GuildPublicThread,
PublicThread,
/**
* A private thread channel within a Guild Text channel
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*/
GuildPrivateThread,
PrivateThread,
/**
* A voice channel for hosting events with an audience
*
@@ -314,6 +385,34 @@ export enum ChannelType {
* A channel that can only contain threads
*/
GuildForum,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS
/**
* A channel that users can follow and crosspost into their own guild
*
* @deprecated This is the old name for {@apilink ChannelType#GuildAnnouncement}
*
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews = 5,
/**
* A temporary sub-channel within a Guild Announcement channel
*
* @deprecated This is the old name for {@apilink ChannelType#AnnouncementThread}
*/
GuildNewsThread = 10,
/**
* A temporary sub-channel within a Guild Text channel
*
* @deprecated This is the old name for {@apilink ChannelType#PublicThread}
*/
GuildPublicThread = 11,
/**
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
*
* @deprecated This is the old name for {@apilink ChannelType#PrivateThread}
*/
GuildPrivateThread = 12,
}
export enum VideoQualityMode {
@@ -563,6 +662,7 @@ export enum MessageType {
ThreadStarterMessage,
GuildInviteReminder,
ContextMenuCommand,
AutoModerationAction,
}
/**
@@ -919,6 +1019,12 @@ export enum EmbedType {
* Link embed
*/
Link = 'link',
/**
* Auto moderation alert embed
*
* @unstable This embed type is currently not documented by Discord, but it is returned in the auto moderation system messages.
*/
AutoModerationMessage = 'auto_moderation_message',
}
/**
@@ -1405,7 +1511,15 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
*/
export enum ChannelFlags {
/**
* This thread is pinned to the top of its parent forum channel
*/
Pinned = 1 << 1,
/**
* Whether a tag is required to be specified when creating a thread in a forum channel.
* Tags are specified in the `applied_tags` field
*/
RequireTag = 1 << 4,
}
/**

View File

@@ -4,6 +4,7 @@
import type { APIEmoji } from './emoji';
import type { PresenceUpdateStatus } from './gateway';
import type { OAuth2Scopes } from './oauth2';
import type { APIRole } from './permissions';
import type { APISticker } from './sticker';
import type { APIUser } from './user';
@@ -117,7 +118,7 @@ export interface APIGuild extends APIPartialGuild {
*/
afk_channel_id: Snowflake | null;
/**
* afk timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout: number;
/**
@@ -381,6 +382,10 @@ export enum GuildFeature {
* Guild has access to set an animated guild icon
*/
AnimatedIcon = 'ANIMATED_ICON',
/**
* Guild has set up auto moderation rules
*/
AutoModeration = 'AUTO_MODERATION',
/**
* Guild has access to set a guild banner image
*/
@@ -409,6 +414,10 @@ export enum GuildFeature {
* @unstable This feature is currently not documented by Discord, but has known value
*/
Hub = 'HUB',
/**
* Guild has disabled invite usage, preventing users from joining
*/
InvitesDisabled = 'INVITES_DISABLED',
/**
* Guild has access to set an invite splash background
*/
@@ -698,6 +707,10 @@ export interface APIGuildIntegration {
* **This field is not provided for `discord` bot integrations.**
*/
application?: APIGuildIntegrationApplication;
/**
* The scopes the application has been authorized for
*/
scopes?: OAuth2Scopes[];
}
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord';

View File

@@ -1,6 +1,7 @@
export * from '../common';
export * from './application';
export * from './auditLog';
export * from './autoModeration';
export * from './channel';
export * from './emoji';
export * from './gateway';

View File

@@ -204,6 +204,10 @@ export interface APIConnection {
* Whether activities related to this connection will be shown in presence updates
*/
show_activity: boolean;
/**
* Whether this connection supports console voice transfer
*/
two_way_link: boolean;
/**
* Visibility of this connection
*
@@ -214,13 +218,15 @@ export interface APIConnection {
export enum ConnectionService {
BattleNet = 'battlenet',
eBay = 'ebay',
EpicGames = 'epicgames',
Facebook = 'facebook',
GitHub = 'github',
LeagueOfLegends = 'leagueoflegends',
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
SamsungGalaxy = 'samsunggalaxy',
RiotGames = 'riotgames',
PayPal = 'paypal',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',

View File

@@ -137,9 +137,14 @@ export enum RESTJSONErrorCodes {
ApplicationInteractionFailedToSend = 40043,
CannotSendAMessageInAForumChannel = 40058,
InteractionHasAlreadyBeenAcknowledged = 40060,
TagNamesMustBeUnique,
ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40066,
TagRequiredToCreateAForumPostInThisChannel,
MissingAccess = 50001,
InvalidAccountType,
CannotExecuteActionOnDMChannel,
@@ -186,7 +191,8 @@ export enum RESTJSONErrorCodes {
PaymentSourceRequiredToRedeemGift = 50070,
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
CannotModifyASystemWebhook = 50073,
CannotDeleteChannelRequiredForCommunityGuilds,
CannotEditStickersWithinMessage = 50080,
InvalidStickerSent,
@@ -246,7 +252,12 @@ export enum RESTJSONErrorCodes {
MessageWasBlockedByAutomaticModeration = 200000,
TitleWasBlockedByAutomaticModeration,
WebhooksCanOnlyCreateThreadsInForumChannels = 220003,
WebhooksPostedToForumChannelsMustHaveAThreadNameOrThreadId = 220001,
WebhooksPostedToForumChannelsCannotHaveBothAThreadNameAndThreadId,
WebhooksCanOnlyCreateThreadsInForumChannels,
WebhookServicesCannotBeUsedInForumChannels,
MessageBlockedByHarmfulLinksFilter = 240000,
}
/**

View File

@@ -0,0 +1,84 @@
import type { Snowflake } from '../../globals';
import type {
APIAutoModerationAction,
APIAutoModerationRule,
AutoModerationRuleEventType,
APIAutoModerationRuleTriggerMetadata,
AutoModerationRuleTriggerType,
} from '../../payloads/v10/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals';
/**
* https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
*/
export type RESTGetAPIAutoModerationRulesResult = APIAutoModerationRule[];
/**
* https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule
*/
export type RESTGetAPIAutoModerationRuleResult = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
*/
export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* The rule name
*/
name: string;
/**
* The rule event type
*/
event_type: AutoModerationRuleEventType;
/**
* The rule trigger type
*/
trigger_type: AutoModerationRuleTriggerType;
/**
* The rule trigger metadata
*
* Can be omitted if the trigger type is {@link AutoModerationRuleTriggerType.HarmfulLink} or {@link AutoModerationRuleTriggerType.Spam}
*/
trigger_metadata?: APIAutoModerationRuleTriggerMetadata;
/**
* The actions which will execute when this rule is triggered
*/
actions: APIAutoModerationAction[];
/**
* Whether this rule is enabled
*
* @default false
*/
enabled?: boolean;
/**
* The role ids that shouldn't be affected by this rule (Maximum of 20)
*/
exempt_roles?: Snowflake[];
/**
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
*/
exempt_channels?: Snowflake[];
}>;
/**
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
*/
export type RESTPostAPIAutoModerationRuleResult = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
*/
export type RESTPatchAPIAutoModerationRuleJSONBody = Omit<
Partial<RESTPostAPIAutoModerationRuleJSONBody>,
'trigger_type'
>;
/**
* https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
*/
export type RESTPatchAPIAutoModerationRuleResult = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule
*/
export type RESTDeleteAPIAutoModerationRuleResult = never;

View File

@@ -19,6 +19,9 @@ import type {
OverwriteType,
ThreadAutoArchiveDuration,
VideoQualityMode,
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
} from '../../payloads/v10/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
@@ -48,7 +51,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*
* Channel types: text, news
*/
type?: ChannelType.GuildNews | ChannelType.GuildText;
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText;
/**
* The position of the channel in the left-hand listing
*
@@ -56,15 +59,15 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*/
position?: number | null;
/**
* 0-1024 character channel topic
* 0-1024 character channel topic (0-4096 characters for forum channels)
*
* Channel types: text, news
* Channel types: text, news, forum
*/
topic?: string | null;
/**
* Whether the channel is nsfw
*
* Channel types: text, voice, news
* Channel types: text, voice, news, forum
*/
nsfw?: boolean | null;
/**
@@ -72,7 +75,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
* are unaffected
*
* Channel types: text, newsThread, publicThread, privateThread
* Channel types: text, newsThread, publicThread, privateThread, forum
*/
rate_limit_per_user?: number | null;
/**
@@ -141,6 +144,31 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
* Channel types: privateThread
*/
invitable?: boolean;
/**
* The set of tags that can be used in a forum channel
*
* Channel types: forum
*/
available_tags?: APIGuildForumTag[];
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*
* Channel types: forum
*/
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji;
/**
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
* This field is copied to the thread at creation time and does not live update
*
* Channel types: text, forum
*/
default_thread_rate_limit_per_user?: number | null;
/**
* The default sort order type used to order posts in forum channels
*
* Channel types: forum
*/
default_sort_order?: SortOrderType | null;
}>;
/**
@@ -589,6 +617,10 @@ export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThr
* First message in the forum thread
*/
message: RESTPostAPIChannelMessageJSONBody;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel
*/
applied_tags?: Snowflake[];
};
/**
@@ -619,9 +651,9 @@ export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThread
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*
* @default ChannelType.GuildPrivateThread
* @default ChannelType.PrivateThread
*/
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/

View File

@@ -53,6 +53,9 @@ export type APIGuildCreatePartialChannel = StrictPartial<
| 'rtc_region'
| 'video_quality_mode'
| 'flags'
| 'default_reaction_emoji'
| 'available_tags'
| 'default_sort_order'
>
> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
@@ -135,7 +138,7 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*/
afk_channel_id?: number | Snowflake | null;
/**
* AFK timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: number;
/**
@@ -235,7 +238,7 @@ export type RESTPatchAPIGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*/
afk_channel_id?: Snowflake | null;
/**
* AFK timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: number;
/**
@@ -573,8 +576,14 @@ export type RESTGetAPIGuildBanResult = APIBan;
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Number of days to delete messages for (0-7)
*
* @deprecated use `delete_message_seconds` instead
*/
delete_message_days?: number;
/**
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
*/
delete_message_seconds?: number;
}>;
/**
@@ -855,7 +864,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
channel_id?: Snowflake;
/**
* Toggles the user's suppress state
*/

View File

@@ -2,6 +2,7 @@ import type { Snowflake } from '../../globals';
export * from '../common';
export * from './auditLog';
export * from './autoModeration';
export * from './channel';
export * from './emoji';
export * from './gateway';
@@ -20,6 +21,25 @@ export * from './webhook';
export const APIVersion = '10';
export const Routes = {
/**
* Route for:
* - GET `/guilds/{guild.id}/auto-moderation/rules`
* - POST `/guilds/{guild.id}/auto-moderation/rules`
*/
guildAutoModerationRules(guildId: Snowflake) {
return `/guilds/${guildId}/auto-moderation/rules` as const;
},
/**
* Routes for:
* - GET `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
* - PATCH `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
* - DELETE `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
*/
guildAutoModerationRule(guildId: Snowflake, ruleId: Snowflake) {
return `/guilds/${guildId}/auto-moderation/rules/${ruleId}` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/audit-logs`

84
rest/v9/autoModeration.ts Normal file
View File

@@ -0,0 +1,84 @@
import type { Snowflake } from '../../globals';
import type {
APIAutoModerationAction,
APIAutoModerationRule,
AutoModerationRuleEventType,
APIAutoModerationRuleTriggerMetadata,
AutoModerationRuleTriggerType,
} from '../../payloads/v9/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals';
/**
* https://discord.com/developers/docs/resources/auto-moderation#list-auto-moderation-rules-for-guild
*/
export type RESTGetAPIAutoModerationRulesResult = APIAutoModerationRule[];
/**
* https://discord.com/developers/docs/resources/auto-moderation#get-auto-moderation-rule
*/
export type RESTGetAPIAutoModerationRuleResult = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
*/
export type RESTPostAPIAutoModerationRuleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* The rule name
*/
name: string;
/**
* The rule event type
*/
event_type: AutoModerationRuleEventType;
/**
* The rule trigger type
*/
trigger_type: AutoModerationRuleTriggerType;
/**
* The rule trigger metadata
*
* Can be omitted if the trigger type is {@link AutoModerationRuleTriggerType.HarmfulLink} or {@link AutoModerationRuleTriggerType.Spam}
*/
trigger_metadata?: APIAutoModerationRuleTriggerMetadata;
/**
* The actions which will execute when this rule is triggered
*/
actions: APIAutoModerationAction[];
/**
* Whether this rule is enabled
*
* @default false
*/
enabled?: boolean;
/**
* The role ids that shouldn't be affected by this rule (Maximum of 20)
*/
exempt_roles?: Snowflake[];
/**
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
*/
exempt_channels?: Snowflake[];
}>;
/**
* https://discord.com/developers/docs/resources/auto-moderation#create-auto-moderation-rule
*/
export type RESTPostAPIAutoModerationRuleResult = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
*/
export type RESTPatchAPIAutoModerationRuleJSONBody = Omit<
Partial<RESTPostAPIAutoModerationRuleJSONBody>,
'trigger_type'
>;
/**
* https://discord.com/developers/docs/resources/auto-moderation#modify-auto-moderation-rule
*/
export type RESTPatchAPIAutoModerationRuleResult = APIAutoModerationRule;
/**
* https://discord.com/developers/docs/resources/auto-moderation#delete-auto-moderation-rule
*/
export type RESTDeleteAPIAutoModerationRuleResult = never;

View File

@@ -19,6 +19,9 @@ import type {
OverwriteType,
ThreadAutoArchiveDuration,
VideoQualityMode,
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
} from '../../payloads/v9/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
@@ -48,7 +51,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*
* Channel types: text, news
*/
type?: ChannelType.GuildNews | ChannelType.GuildText;
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText;
/**
* The position of the channel in the left-hand listing
*
@@ -56,15 +59,15 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*/
position?: number | null;
/**
* 0-1024 character channel topic
* 0-1024 character channel topic (0-4096 characters for forum channels)
*
* Channel types: text, news
* Channel types: text, news, forum
*/
topic?: string | null;
/**
* Whether the channel is nsfw
*
* Channel types: text, voice, news
* Channel types: text, voice, news, forum
*/
nsfw?: boolean | null;
/**
@@ -72,7 +75,7 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
* are unaffected
*
* Channel types: text, newsThread, publicThread, privateThread
* Channel types: text, newsThread, publicThread, privateThread, forum
*/
rate_limit_per_user?: number | null;
/**
@@ -141,6 +144,31 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
* Channel types: privateThread
*/
invitable?: boolean;
/**
* The set of tags that can be used in a forum channel
*
* Channel types: forum
*/
available_tags?: APIGuildForumTag[];
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*
* Channel types: forum
*/
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji;
/**
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
* This field is copied to the thread at creation time and does not live update
*
* Channel types: text, forum
*/
default_thread_rate_limit_per_user?: number | null;
/**
* The default sort order type used to order posts in forum channels
*
* Channel types: forum
*/
default_sort_order?: SortOrderType | null;
}>;
/**
@@ -603,6 +631,10 @@ export type RESTPostAPIGuildForumThreadsJSONBody = RESTPostAPIChannelMessagesThr
* First message in the forum thread
*/
message: RESTPostAPIChannelMessageJSONBody;
/**
* The IDs of the set of tags that have been applied to a thread in a forum channel
*/
applied_tags?: Snowflake[];
};
/**
@@ -633,9 +665,9 @@ export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThread
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*
* @default ChannelType.GuildPrivateThread
* @default ChannelType.PrivateThread
*/
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/

View File

@@ -53,6 +53,9 @@ export type APIGuildCreatePartialChannel = StrictPartial<
| 'rtc_region'
| 'video_quality_mode'
| 'flags'
| 'default_reaction_emoji'
| 'available_tags'
| 'default_sort_order'
>
> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
@@ -135,7 +138,7 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*/
afk_channel_id?: number | Snowflake | null;
/**
* AFK timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: number;
/**
@@ -235,7 +238,7 @@ export type RESTPatchAPIGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*/
afk_channel_id?: Snowflake | null;
/**
* AFK timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: number;
/**
@@ -573,8 +576,14 @@ export type RESTGetAPIGuildBanResult = APIBan;
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Number of days to delete messages for (0-7)
*
* @deprecated use `delete_message_seconds` instead
*/
delete_message_days?: number;
/**
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
*/
delete_message_seconds?: number;
/**
* Reason for the ban
*
@@ -861,7 +870,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
channel_id?: Snowflake;
/**
* Toggles the user's suppress state
*/

View File

@@ -2,6 +2,7 @@ import type { Snowflake } from '../../globals';
export * from '../common';
export * from './auditLog';
export * from './autoModeration';
export * from './channel';
export * from './emoji';
export * from './gateway';
@@ -20,6 +21,25 @@ export * from './webhook';
export const APIVersion = '9';
export const Routes = {
/**
* Route for:
* - GET `/guilds/{guild.id}/auto-moderation/rules`
* - POST `/guilds/{guild.id}/auto-moderation/rules`
*/
guildAutoModerationRules(guildId: Snowflake) {
return `/guilds/${guildId}/auto-moderation/rules` as const;
},
/**
* Routes for:
* - GET `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
* - PATCH `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
* - DELETE `/guilds/{guild.id}/auto-moderation/rules/{rule.id}`
*/
guildAutoModerationRule(guildId: Snowflake, ruleId: Snowflake) {
return `/guilds/${guildId}/auto-moderation/rules/${ruleId}` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/audit-logs`

View File

@@ -190,6 +190,7 @@ const config = {
items: [
{ label: versions.length === 0 ? 'Development Time' : 'next 🚧', to: versions.length === 0 ? 'api' : 'api/next' },
...versions.map((version, i) => ({
activeBaseRegex: `api/(${version}/)${i === 0 ? '?' : ''}discord-api-types.*`,
label: version,
to: i === 0 ? 'api' : `api/${version}`
}))
@@ -257,7 +258,7 @@ const config = {
appId: 'TR1O0DBFL9',
apiKey: '6822440beca69053ab122881d75064dc',
indexName: 'discord-api-types',
contextualSearch: false
contextualSearch: true
}
})
};

1412
website/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

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

View File

@@ -1,263 +0,0 @@
---
id: contributing_to_discord-api-types
title: How to Contribute
sidebar_position: 1
---
So, you'd like to contribute to `discord-api-types` but don't know where to start or what to do? Here are some of the
things you need to keep in mind before opening a pull request!
:::tip Before you begin
We recommend you contribute either through locally editing the files on your desktop (which means also installing
[`npm`](https://www.npmjs.com/) dependencies as this will ensure not only a consistent code style, but also that the
`deno` types stay in sync automatically) or through a service like
[`GitHub Codespaces`](https://github.com/features/codespaces).
:::
:::info Still can't figure it out?
No problem! We await you with open hands in our [`Discord Server`](https://discord.gg/djs) in the
`#discord-api-types-help` channel (under the `Miscellaneous` category)
:::
### Install npm dependencies first
One of the most crucial steps is installing [`npm`](https://www.npmjs.com/) dependencies via `npm ci`. This ensures that
linting can be done, and it also sets up the `git` hooks for building the `deno` types and automatically
formatting/linting the code when you commit it.
If you forget to install [`npm`](https://www.npmjs.com/) dependencies, or are doing the contributions through other
means (like directly from GitHub web), you might see a comment like this one being sent as a review to your pull
request:
![An image showing the style of comment the automatic deno checker reports](./images/deno_types_out_of_sync.png)
The easiest way to solve this is to run the `build:deno` script (`npm run build:deno`) and pushing the results.
### Figure out if the update you want to contribute respects our rules about documentation
:::danger
We will not document client-only / client related types. If you plan on contributing, make sure the types you want to
document can be used by bots and are _intended_ for usage by bots. This is a hard rule that will never change.
:::
Not every single update to the API is valid to be documented here. Our main stance for documentation is that properties
must be known and documented on [`Discord's API Documentation repository`](https://github.com/discord/discord-api-docs),
must be mentioned in an open pull request or must have received the green light to be used.
With that aside, there are times where documentation for certain types is not approved/merged by Discord on the grounds
that `it isn't helpful for bots` (or similar), but it would actually benefit bot developers to have it documented (one
good example is the UserFlags `SPAMMER` flag). As such, if you think your update should still be merged, please propose
it and we will be handled on a case by case basis. If approved, your update will be documented with an `@unstable` tag.
It will also not be subject to the same versioning rules as the rest of the types.
### Figure out what API versions need to receive the update
`discord-api-types` has multiple API versions in the repository, some of which may be considered `deprecated` or
`discontinued` as we keep them till the version is completely dead before removing them. This is a good time to figure
out which API versions need to be updated, and you can use the table below to guide you.
You can also check [`Discord's API versioning table`](https://discord.com/developers/docs/reference#api-versioning) if
you want to be 1000% sure.
| **API Version** | **Should receive updates** |
| :-------------: | :------------------------: |
| 10 | Yes |
| 9 | Yes |
| 8 | No |
| 7 | No |
| 6 | No |
If the version you want to contribute to is not listed above (for instance if a new API version rolls out) or if the
version you want to contribute to is for a different part of the API (for instance `voice`), feel free to submit it and
we will review it accordingly.
### Figure out where exactly are the files you need to modify to make the update
The file structure might seem confusing at first, especially if it's your first time contributing, but we're here to
guide you through it.
When you clone the repository for the first time, you'll see a folder structure like this (we've not mentioned some
tooling specific files like `.eslintrc.json` to keep the structure clean). We've highlighted the important folders and
files you need to keep in mind when contributing.
```bash {2,4-6,9-10,12-16}
├── deno
├── gateway
├── node_modules (once you ran `npm ci`)
├── payloads
├── rest
├── rpc
├── scripts
├── tests
├── utils
├── voice
├── website
├── globals.ts
├── v6.ts
├── v8.ts
├── v9.ts
├── v10.ts
└── package.json
```
#### `deno`
This folder stores the [`deno`](https://deno.land/) compatible typings for Discord's API.
:::danger
This folder should not be manually modified. Any manual changes will be overwritten by the `build:deno` script.
Any changes that need to be done to this folder need to be done through the `scripts/deno.mjs` file.
:::
#### `gateway`
This folder holds types that are strictly received from
[`Discord's gateway`](https://discord.com/developers/docs/topics/gateway). It stores the gateway version the types are
for, the intents and opcodes, and any data that can be received/sent through the gateway.
Each file in the folder represents a gateway version. It references types from the versioned [`payloads`](#payloads)
folder unless the payloads come _only_ through the gateway. There is also a `common.ts` file which represents shared
types across all versions, as well as an `index.ts` file that exports the recommended gateway version's types.
:::info
Types created here must start with the `Gateway` prefix (for instance `GatewayGuildCreateDispatchData` which is an
extension of the `APIGuild` type with extra fields received only through the gateway).
:::
#### `payloads`
This folder holds the bulk of type definitions for Discord's APIs. Each API version receives its own folder. Inside of
each folder there is always an `index.ts` file that exports every type available in that version, as well as the common
types that can be found in `payloads/common.ts`. At the root of the `payloads` folder is also an `index.ts` file which
exports the recommended API version's types.
Inside of each versioned folder, the files are defined from the structure in
[`Discord's API Documentation`](https://discord.dev), under the `Resources` category. Depending on the complexity of the
resource, you may opt for splitting it up into multiple files. If you want to do so, please create a folder named
`_{resource_name}` where the `resource_name` is the same name as the resource you're splitting up (a good example is the
`_interactions` folder which stores all the types for interactions in a neater structure), and create a
`{resource_name}.ts` file which exports everything from that folder). If you feel like you need to split it up even
more, just repeat the same structure of creating an `_{file_name}` folder and exporting everything from it in the
`{file_name}.ts` file (you can see an example
[here](https://github.com/discordjs/discord-api-types/tree/85802f1/payloads/v10/_interactions)).
:::info
Types created here must start with the `API` prefix (for instance `APIUser`), **except** for enums, which should have a
normal name (for instance `UserFlags`).
:::
#### `rest`
This folder holds all the types that are related to Discord's REST API. Just like [`payloads`](#payloads), it is split
into folders that have an `index.ts` file, from the structure in [`Discord's API Documentation`](https://discord.dev),
under the `Resources` category.
:::info
Types created here must start with the `REST` prefix (for instance `RESTGetAPIUserResult`) unless they are objects or
enums (for instance `Routes`).
They must also follow the following structure: `REST{http_method}{type_name}{Query|(JSON|FormData)Body|Result}`, where:
- `http_method` is the PascalCase HTTP method name (for instance `Get`, `Post`, and so on)
- `type_name` is the actual name of the type it returns (for instance `APIUser`)
- `Query|(JSON|FormData)Body|Result` should be used depending on what the route takes or returns
- If a route doesn't take in any parameters, be it query, JSON or FormData, it shouldn't define any of those types
- A route should always define a `Result` type, and should reference an `API*` type unless the data returned is only
received through a REST call
- If a route returns a `204 No Content` response, it should define a `Result` type with `never` as its value (this
does not account for errors)
This structure should be followed whenever possible, however that might not always be doable. Specifically, types for
OAuth2 may not follow the structure exactly, but should aim to follow it as much as possible.
:::
#### `rpc`
This folder holds types that are strictly related to
[`Discord's RPC API`](https://discord.com/developers/docs/topics/rpc). Just like [`gateway`](#gateway), each RPC API
version receives its own file.
:::info
Types created here must start with the `RPC` prefix (for instance `RPCErrorCodes`).
:::
#### `scripts`
This folder holds the module's scripts that empower our Continuous Integration / Deployment pipelines, as well as other
miscellaneous scripts we might need. There's really not much to say about these really...
#### `tests`
This folder holds tests for certain complex types that the module might have, and is especially useful for validating
unions.
:::info
Files created here **must** end in `.test-d.ts`, as otherwise they will not be picked up by
[`tsd`](https://www.npmjs.com/package/tsd).
:::
#### `utils`
This folder holds certain utility functions which can be used while working with some complicated types (for instance
for more complicated unions). Each API version gets its own file with utility functions, but a folder can be created if
a lot of methods are created.
:::info
The `internals.ts` file stores types that are strictly used inside the module to help build out our strict types. These
types should never be exported from the module.
:::
#### `voice`
This folder holds types that are strictly related to
[`Discord's Voice API`](https://discord.com/developers/docs/topics/voice-connections). It follows the same folder
structure as [`gateway`](#gateway).
:::info
Types in this folder must start with the `Voice` prefix (for instance `VoiceOpcodes`).
:::
#### `website`
This folder holds...well...this very site you are reading this page from! For the most part, you do not need to alter
its contents, except if you're contributing a new API version to the module.
To add the new version to this very website, edit the `docusaurus.config.js` file, and in the `plugins` array, for the
`docusaurus-plugin-typedoc-api` plugin, you need to add an entry similar to the ones already present.
#### `globals.ts`
This file stores types that are present regardless of the API version you use.
#### `v*.ts`
These files export everything from the previously mentioned folders that match the version the file is named after. It
serves as the entry point for importing types from the module (for example by importing `discord-api-types/v10`).
#### `package.json`
This is the entry point of the package for [`npm`](https://www.npmjs.com/). You won't need to edit this file unless
you're adding a new API version, in which case you should follow the same structure as seen in the `exports` field.

View File

@@ -1 +0,0 @@
[{"entryPoints":{"globals":{"path":"globals.ts","label":"Global Types"},"gateway/common":{"path":"gateway/common.ts","label":"Gateway - Common Types"},"payloads/common":{"path":"payloads/common.ts","label":"Payloads - Common Types"},"rest/common":{"path":"rest/common.ts","label":"REST - Common Types"},"rpc/common":{"path":"rpc/common.ts","label":"RPC - Common Types"},"v6":{"path":"v6.ts","label":"API v6 - Deprecated"},"v8":{"path":"v8.ts","label":"API v8 - Deprecated"},"v9":{"path":"v9.ts","label":"API v9"},"v10":{"path":"v10.ts","label":"API v10"},"rpc/v8":{"path":"rpc/v8.ts","label":"RPC v8"},"rpc/v9":{"path":"rpc/v9.ts","label":"RPC v9"},"rpc/v10":{"path":"rpc/v10.ts","label":"RPC v10"},"voice/v4":{"path":"voice/v4.ts","label":"Voice v4"},"utils/v8":{"path":"utils/v8.ts","label":"Utils v8"},"utils/v9":{"path":"utils/v9.ts","label":"Utils v9"},"utils/v10":{"path":"utils/v10.ts","label":"Utils v10"}},"packagePath":"./","packageSlug":"discord-api-types","packageName":"discord-api-types","packageVersion":"0.36.3"}]

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
[{"entryPoints":{"globals":{"path":"globals.ts","label":"Global Types"},"gateway/common":{"path":"gateway/common.ts","label":"Gateway - Common Types"},"payloads/common":{"path":"payloads/common.ts","label":"Payloads - Common Types"},"rest/common":{"path":"rest/common.ts","label":"REST - Common Types"},"rpc/common":{"path":"rpc/common.ts","label":"RPC - Common Types"},"v6":{"path":"v6.ts","label":"API v6 - Deprecated"},"v8":{"path":"v8.ts","label":"API v8 - Deprecated"},"v9":{"path":"v9.ts","label":"API v9"},"v10":{"path":"v10.ts","label":"API v10"},"rpc/v8":{"path":"rpc/v8.ts","label":"RPC v8"},"rpc/v9":{"path":"rpc/v9.ts","label":"RPC v9"},"rpc/v10":{"path":"rpc/v10.ts","label":"RPC v10"},"voice/v4":{"path":"voice/v4.ts","label":"Voice v4"},"utils/v8":{"path":"utils/v8.ts","label":"Utils v8"},"utils/v9":{"path":"utils/v9.ts","label":"Utils v9"},"utils/v10":{"path":"utils/v10.ts","label":"Utils v10"}},"packagePath":"./","packageSlug":"discord-api-types","packageName":"discord-api-types","packageVersion":"0.37.0"}]

File diff suppressed because one or more lines are too long

View File

@@ -1,167 +0,0 @@
---
id: introduction_to_discord-api-types
title: Introduction
sidebar_position: 0
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<div align="center">
<img src="/svgs/logo_long_blurple.svg" className="markdown__logo" />
[![Discord server](https://img.shields.io/discord/222078108977594368?color=5865F2&logo=discord&logoColor=white)](https://discord-api-types.dev/discord)
[![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)
[![npm version](https://img.shields.io/npm/v/discord-api-types?color=crimson&label=NPM%20Version&logo=npm)](https://www.npmjs.com/package/discord-api-types)
[![npm downloads](https://img.shields.io/npm/dt/discord-api-types.svg?label=NPM%20Downloads&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)
</div>
## About
Discord API Types is a community-maintained project that brings API types for Discord's REST, Gateway and Voice APIs.
## Installation
Install with [`npm`](https://www.npmjs.com/) / [`yarn`](https://yarnpkg.com) / [`pnpm`](https://pnpm.js.org/):
```bash npm2yarn2pnpm
npm install 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
<Tabs groupId="ts2esm2cjs">
<TabItem value="javascript" label="JavaScript">
```typescript showLineNumbers
/**
* @type {import('discord-api-types/v10').APIUser}
*/
```
</TabItem>
<TabItem value="esm" label="ESM">
```typescript showLineNumbers
/**
* @type {import('discord-api-types/v10').APIUser}
*/
```
</TabItem>
<TabItem value="typescript" label="TypeScript">
```typescript showLineNumbers
import { type APIUser } from 'discord-api-types/v10';
```
</TabItem>
</Tabs>
:::info
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 is an example of importing directly from the gateway submodule
```typescript ts2esm2cjs
import { GatewayVersion } from 'discord-api-types/gateway/v10';
console.log(`Let's connect to wss://gateway.discord.gg/?v=${GatewayVersion}`);
```
> _**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. Here are 3 examples of how you can
import them:
<Tabs>
<TabItem value="github" label="From GitHub">
```typescript showLineNumbers
// Importing a specific API version
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v10.ts';
```
</TabItem>
<TabItem value="deno" label="From deno.land/x" default>
```typescript showLineNumbers
// Importing a specific API version
import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts';
```
</TabItem>
<TabItem value="skypack" label="From skypack.dev">
```typescript showLineNumbers
// Importing a specific API version
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
```
</TabItem>
</Tabs>
## 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.
:::danger 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.
:::

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

View File

@@ -1 +1 @@
[{"entryPoints":{"globals":{"path":"globals.ts","label":"Global Types"},"gateway/common":{"path":"gateway/common.ts","label":"Gateway - Common Types"},"payloads/common":{"path":"payloads/common.ts","label":"Payloads - Common Types"},"rest/common":{"path":"rest/common.ts","label":"REST - Common Types"},"rpc/common":{"path":"rpc/common.ts","label":"RPC - Common Types"},"v6":{"path":"v6.ts","label":"API v6 - Deprecated"},"v8":{"path":"v8.ts","label":"API v8 - Deprecated"},"v9":{"path":"v9.ts","label":"API v9"},"v10":{"path":"v10.ts","label":"API v10"},"rpc/v8":{"path":"rpc/v8.ts","label":"RPC v8"},"rpc/v9":{"path":"rpc/v9.ts","label":"RPC v9"},"rpc/v10":{"path":"rpc/v10.ts","label":"RPC v10"},"voice/v4":{"path":"voice/v4.ts","label":"Voice v4"},"utils/v8":{"path":"utils/v8.ts","label":"Utils v8"},"utils/v9":{"path":"utils/v9.ts","label":"Utils v9"},"utils/v10":{"path":"utils/v10.ts","label":"Utils v10"}},"packagePath":"./","packageSlug":"discord-api-types","packageName":"discord-api-types","packageVersion":"0.37.1"}]
[{"entryPoints":{"globals":{"path":"globals.ts","label":"Global Types"},"gateway/common":{"path":"gateway/common.ts","label":"Gateway - Common Types"},"payloads/common":{"path":"payloads/common.ts","label":"Payloads - Common Types"},"rest/common":{"path":"rest/common.ts","label":"REST - Common Types"},"rpc/common":{"path":"rpc/common.ts","label":"RPC - Common Types"},"v6":{"path":"v6.ts","label":"API v6 - Deprecated"},"v8":{"path":"v8.ts","label":"API v8 - Deprecated"},"v9":{"path":"v9.ts","label":"API v9"},"v10":{"path":"v10.ts","label":"API v10"},"rpc/v8":{"path":"rpc/v8.ts","label":"RPC v8"},"rpc/v9":{"path":"rpc/v9.ts","label":"RPC v9"},"rpc/v10":{"path":"rpc/v10.ts","label":"RPC v10"},"voice/v4":{"path":"voice/v4.ts","label":"Voice v4"},"utils/v8":{"path":"utils/v8.ts","label":"Utils v8"},"utils/v9":{"path":"utils/v9.ts","label":"Utils v9"},"utils/v10":{"path":"utils/v10.ts","label":"Utils v10"}},"packagePath":"./","packageSlug":"discord-api-types","packageName":"discord-api-types","packageVersion":"0.37.13"}]

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
[{"entryPoints":{"globals":{"path":"globals.ts","label":"Global Types"},"gateway/common":{"path":"gateway/common.ts","label":"Gateway - Common Types"},"payloads/common":{"path":"payloads/common.ts","label":"Payloads - Common Types"},"rest/common":{"path":"rest/common.ts","label":"REST - Common Types"},"rpc/common":{"path":"rpc/common.ts","label":"RPC - Common Types"},"v6":{"path":"v6.ts","label":"API v6 - Deprecated"},"v8":{"path":"v8.ts","label":"API v8 - Deprecated"},"v9":{"path":"v9.ts","label":"API v9"},"v10":{"path":"v10.ts","label":"API v10"},"rpc/v8":{"path":"rpc/v8.ts","label":"RPC v8"},"rpc/v9":{"path":"rpc/v9.ts","label":"RPC v9"},"rpc/v10":{"path":"rpc/v10.ts","label":"RPC v10"},"voice/v4":{"path":"voice/v4.ts","label":"Voice v4"},"utils/v8":{"path":"utils/v8.ts","label":"Utils v8"},"utils/v9":{"path":"utils/v9.ts","label":"Utils v9"},"utils/v10":{"path":"utils/v10.ts","label":"Utils v10"}},"packagePath":"./","packageSlug":"discord-api-types","packageName":"discord-api-types","packageVersion":"0.37.2"}]
[{"entryPoints":{"globals":{"path":"globals.ts","label":"Global Types"},"gateway/common":{"path":"gateway/common.ts","label":"Gateway - Common Types"},"payloads/common":{"path":"payloads/common.ts","label":"Payloads - Common Types"},"rest/common":{"path":"rest/common.ts","label":"REST - Common Types"},"rpc/common":{"path":"rpc/common.ts","label":"RPC - Common Types"},"v6":{"path":"v6.ts","label":"API v6 - Deprecated"},"v8":{"path":"v8.ts","label":"API v8 - Deprecated"},"v9":{"path":"v9.ts","label":"API v9"},"v10":{"path":"v10.ts","label":"API v10"},"rpc/v8":{"path":"rpc/v8.ts","label":"RPC v8"},"rpc/v9":{"path":"rpc/v9.ts","label":"RPC v9"},"rpc/v10":{"path":"rpc/v10.ts","label":"RPC v10"},"voice/v4":{"path":"voice/v4.ts","label":"Voice v4"},"utils/v8":{"path":"utils/v8.ts","label":"Utils v8"},"utils/v9":{"path":"utils/v9.ts","label":"Utils v9"},"utils/v10":{"path":"utils/v10.ts","label":"Utils v10"}},"packagePath":"./","packageSlug":"discord-api-types","packageName":"discord-api-types","packageVersion":"0.37.14"}]

File diff suppressed because one or more lines are too long

View File

@@ -1,263 +0,0 @@
---
id: contributing_to_discord-api-types
title: How to Contribute
sidebar_position: 1
---
So, you'd like to contribute to `discord-api-types` but don't know where to start or what to do? Here are some of the
things you need to keep in mind before opening a pull request!
:::tip Before you begin
We recommend you contribute either through locally editing the files on your desktop (which means also installing
[`npm`](https://www.npmjs.com/) dependencies as this will ensure not only a consistent code style, but also that the
`deno` types stay in sync automatically) or through a service like
[`GitHub Codespaces`](https://github.com/features/codespaces).
:::
:::info Still can't figure it out?
No problem! We await you with open hands in our [`Discord Server`](https://discord.gg/djs) in the `#developing-djs`
channel.
:::
### Install npm dependencies first
One of the most crucial steps is installing [`npm`](https://www.npmjs.com/) dependencies via `npm ci`. This ensures that
linting can be done, and it also sets up the `git` hooks for building the `deno` types and automatically
formatting/linting the code when you commit it.
If you forget to install [`npm`](https://www.npmjs.com/) dependencies, or are doing the contributions through other
means (like directly from GitHub web), you might see a comment like this one being sent as a review to your pull
request:
![An image showing the style of comment the automatic deno checker reports](./images/deno_types_out_of_sync.png)
The easiest way to solve this is to run the `build:deno` script (`npm run build:deno`) and pushing the results.
### Figure out if the update you want to contribute respects our rules about documentation
:::danger
We will not document client-only / client related types. If you plan on contributing, make sure the types you want to
document can be used by bots and are _intended_ for usage by bots. This is a hard rule that will never change.
:::
Not every single update to the API is valid to be documented here. Our main stance for documentation is that properties
must be known and documented on [`Discord's API Documentation repository`](https://github.com/discord/discord-api-docs),
must be mentioned in an open pull request or must have received the green light to be used.
With that aside, there are times where documentation for certain types is not approved/merged by Discord on the grounds
that `it isn't helpful for bots` (or similar), but it would actually benefit bot developers to have it documented (one
good example is the UserFlags `SPAMMER` flag). As such, if you think your update should still be merged, please propose
it and we will be handled on a case by case basis. If approved, your update will be documented with an `@unstable` tag.
It will also not be subject to the same versioning rules as the rest of the types.
### Figure out what API versions need to receive the update
`discord-api-types` has multiple API versions in the repository, some of which may be considered `deprecated` or
`discontinued` as we keep them till the version is completely dead before removing them. This is a good time to figure
out which API versions need to be updated, and you can use the table below to guide you.
You can also check [`Discord's API versioning table`](https://discord.com/developers/docs/reference#api-versioning) if
you want to be 1000% sure.
| **API Version** | **Should receive updates** |
| :-------------: | :------------------------: |
| 10 | Yes |
| 9 | Yes |
| 8 | No |
| 7 | No |
| 6 | No |
If the version you want to contribute to is not listed above (for instance if a new API version rolls out) or if the
version you want to contribute to is for a different part of the API (for instance `voice`), feel free to submit it and
we will review it accordingly.
### Figure out where exactly are the files you need to modify to make the update
The file structure might seem confusing at first, especially if it's your first time contributing, but we're here to
guide you through it.
When you clone the repository for the first time, you'll see a folder structure like this (we've not mentioned some
tooling specific files like `.eslintrc.json` to keep the structure clean). We've highlighted the important folders and
files you need to keep in mind when contributing.
```bash {2,4-6,9-10,12-16}
├── deno
├── gateway
├── node_modules (once you ran `npm ci`)
├── payloads
├── rest
├── rpc
├── scripts
├── tests
├── utils
├── voice
├── website
├── globals.ts
├── v6.ts
├── v8.ts
├── v9.ts
├── v10.ts
└── package.json
```
#### `deno`
This folder stores the [`deno`](https://deno.land/) compatible typings for Discord's API.
:::danger
This folder should not be manually modified. Any manual changes will be overwritten by the `build:deno` script.
Any changes that need to be done to this folder need to be done through the `scripts/deno.mjs` file.
:::
#### `gateway`
This folder holds types that are strictly received from
[`Discord's gateway`](https://discord.com/developers/docs/topics/gateway). It stores the gateway version the types are
for, the intents and opcodes, and any data that can be received/sent through the gateway.
Each file in the folder represents a gateway version. It references types from the versioned [`payloads`](#payloads)
folder unless the payloads come _only_ through the gateway. There is also a `common.ts` file which represents shared
types across all versions, as well as an `index.ts` file that exports the recommended gateway version's types.
:::info
Types created here must start with the `Gateway` prefix (for instance `GatewayGuildCreateDispatchData` which is an
extension of the `APIGuild` type with extra fields received only through the gateway).
:::
#### `payloads`
This folder holds the bulk of type definitions for Discord's APIs. Each API version receives its own folder. Inside of
each folder there is always an `index.ts` file that exports every type available in that version, as well as the common
types that can be found in `payloads/common.ts`. At the root of the `payloads` folder is also an `index.ts` file which
exports the recommended API version's types.
Inside of each versioned folder, the files are defined from the structure in
[`Discord's API Documentation`](https://discord.dev), under the `Resources` category. Depending on the complexity of the
resource, you may opt for splitting it up into multiple files. If you want to do so, please create a folder named
`_{resource_name}` where the `resource_name` is the same name as the resource you're splitting up (a good example is the
`_interactions` folder which stores all the types for interactions in a neater structure), and create a
`{resource_name}.ts` file which exports everything from that folder). If you feel like you need to split it up even
more, just repeat the same structure of creating an `_{file_name}` folder and exporting everything from it in the
`{file_name}.ts` file (you can see an example
[here](https://github.com/discordjs/discord-api-types/tree/85802f1/payloads/v10/_interactions)).
:::info
Types created here must start with the `API` prefix (for instance `APIUser`), **except** for enums, which should have a
normal name (for instance `UserFlags`).
:::
#### `rest`
This folder holds all the types that are related to Discord's REST API. Just like [`payloads`](#payloads), it is split
into folders that have an `index.ts` file, from the structure in [`Discord's API Documentation`](https://discord.dev),
under the `Resources` category.
:::info
Types created here must start with the `REST` prefix (for instance `RESTGetAPIUserResult`) unless they are objects or
enums (for instance `Routes`).
They must also follow the following structure: `REST{http_method}{type_name}{Query|(JSON|FormData)Body|Result}`, where:
- `http_method` is the PascalCase HTTP method name (for instance `Get`, `Post`, and so on)
- `type_name` is the actual name of the type it returns (for instance `APIUser`)
- `Query|(JSON|FormData)Body|Result` should be used depending on what the route takes or returns
- If a route doesn't take in any parameters, be it query, JSON or FormData, it shouldn't define any of those types
- A route should always define a `Result` type, and should reference an `API*` type unless the data returned is only
received through a REST call
- If a route returns a `204 No Content` response, it should define a `Result` type with `never` as its value (this
does not account for errors)
This structure should be followed whenever possible, however that might not always be doable. Specifically, types for
OAuth2 may not follow the structure exactly, but should aim to follow it as much as possible.
:::
#### `rpc`
This folder holds types that are strictly related to
[`Discord's RPC API`](https://discord.com/developers/docs/topics/rpc). Just like [`gateway`](#gateway), each RPC API
version receives its own file.
:::info
Types created here must start with the `RPC` prefix (for instance `RPCErrorCodes`).
:::
#### `scripts`
This folder holds the module's scripts that empower our Continuous Integration / Deployment pipelines, as well as other
miscellaneous scripts we might need. There's really not much to say about these really...
#### `tests`
This folder holds tests for certain complex types that the module might have, and is especially useful for validating
unions.
:::info
Files created here **must** end in `.test-d.ts`, as otherwise they will not be picked up by
[`tsd`](https://www.npmjs.com/package/tsd).
:::
#### `utils`
This folder holds certain utility functions which can be used while working with some complicated types (for instance
for more complicated unions). Each API version gets its own file with utility functions, but a folder can be created if
a lot of methods are created.
:::info
The `internals.ts` file stores types that are strictly used inside the module to help build out our strict types. These
types should never be exported from the module.
:::
#### `voice`
This folder holds types that are strictly related to
[`Discord's Voice API`](https://discord.com/developers/docs/topics/voice-connections). It follows the same folder
structure as [`gateway`](#gateway).
:::info
Types in this folder must start with the `Voice` prefix (for instance `VoiceOpcodes`).
:::
#### `website`
This folder holds...well...this very site you are reading this page from! For the most part, you do not need to alter
its contents, except if you're contributing a new API version to the module.
To add the new version to this very website, edit the `docusaurus.config.js` file, and in the `plugins` array, for the
`docusaurus-plugin-typedoc-api` plugin, you need to add an entry similar to the ones already present.
#### `globals.ts`
This file stores types that are present regardless of the API version you use.
#### `v*.ts`
These files export everything from the previously mentioned folders that match the version the file is named after. It
serves as the entry point for importing types from the module (for example by importing `discord-api-types/v10`).
#### `package.json`
This is the entry point of the package for [`npm`](https://www.npmjs.com/). You won't need to edit this file unless
you're adding a new API version, in which case you should follow the same structure as seen in the `exports` field.

View File

@@ -1,167 +0,0 @@
---
id: introduction_to_discord-api-types
title: Introduction
sidebar_position: 0
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
<div align="center">
<img src="/svgs/logo_long_blurple.svg" className="markdown__logo" />
[![Discord server](https://img.shields.io/discord/222078108977594368?color=5865F2&logo=discord&logoColor=white)](https://discord-api-types.dev/discord)
[![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)
[![npm version](https://img.shields.io/npm/v/discord-api-types?color=crimson&label=NPM%20Version&logo=npm)](https://www.npmjs.com/package/discord-api-types)
[![npm downloads](https://img.shields.io/npm/dt/discord-api-types.svg?label=NPM%20Downloads&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)
</div>
## About
Discord API Types is a community-maintained project that brings API types for Discord's REST, Gateway and Voice APIs.
## Installation
Install with [`npm`](https://www.npmjs.com/) / [`yarn`](https://yarnpkg.com) / [`pnpm`](https://pnpm.js.org/):
```bash npm2yarn2pnpm
npm install 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
<Tabs groupId="ts2esm2cjs">
<TabItem value="javascript" label="JavaScript">
```typescript showLineNumbers
/**
* @type {import('discord-api-types/v10').APIUser}
*/
```
</TabItem>
<TabItem value="esm" label="ESM">
```typescript showLineNumbers
/**
* @type {import('discord-api-types/v10').APIUser}
*/
```
</TabItem>
<TabItem value="typescript" label="TypeScript">
```typescript showLineNumbers
import { type APIUser } from 'discord-api-types/v10';
```
</TabItem>
</Tabs>
:::info
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 is an example of importing directly from the gateway submodule
```typescript ts2esm2cjs
import { GatewayVersion } from 'discord-api-types/gateway/v10';
console.log(`Let's connect to wss://gateway.discord.gg/?v=${GatewayVersion}`);
```
> _**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. Here are 3 examples of how you can
import them:
<Tabs>
<TabItem value="github" label="From GitHub">
```typescript showLineNumbers
// Importing a specific API version
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/v10.ts';
```
</TabItem>
<TabItem value="deno" label="From deno.land/x" default>
```typescript showLineNumbers
// Importing a specific API version
import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts';
```
</TabItem>
<TabItem value="skypack" label="From skypack.dev">
```typescript showLineNumbers
// Importing a specific API version
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
```
</TabItem>
</Tabs>
## 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.
:::danger 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.
:::

File diff suppressed because one or more lines are too long

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

View File

@@ -1,8 +0,0 @@
{
"sidebar": [
{
"type": "autogenerated",
"dirName": "."
}
]
}

View File

@@ -1,8 +0,0 @@
{
"sidebar": [
{
"type": "autogenerated",
"dirName": "."
}
]
}

View File

@@ -1,6 +1,4 @@
[
"0.37.2",
"0.37.1",
"0.37.0",
"0.36.3"
"0.37.14",
"0.37.13"
]