Compare commits

...

162 Commits

Author SHA1 Message Date
github-actions[bot]
d8435774d6 chore(release): 0.37.37 🎉 (#736)
Build ran for 8f9370d259

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
- dependency-name: recursive-readdir
  dependency-type: indirect
- dependency-name: serve-handler
  dependency-type: indirect
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-11 22:50:25 +02:00
dependabot[bot]
190223f1f9 chore(deps): bump minimatch, recursive-readdir and serve-handler (#662)
Bumps [minimatch](https://github.com/isaacs/minimatch), [recursive-readdir](https://github.com/jergason/recursive-readdir) and [serve-handler](https://github.com/zeit/serve-handler). These dependencies needed to be updated together.

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

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

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

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
- dependency-name: recursive-readdir
  dependency-type: indirect
- dependency-name: serve-handler
  dependency-type: indirect
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-12-11 22:50:12 +02:00
Cynthia
995126e2cc fix(APIChannel): correctly type name based on channel type (#666)
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
2022-12-11 22:48:02 +02:00
github-actions[bot]
549d1daaa0 chore(release): 0.37.21 🎉 (#663)
Build ran for 38aad33ed8

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

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

* revert changes to v8

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

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

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

---
updated-dependencies:
- dependency-name: loader-utils
  dependency-type: indirect
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-11-18 11:57:42 +02:00
Suneet Tipirneni
a1869a6a6d feat(GuildFeatures): Add APPLICATION_COMMAND_PERMISSIONS_V2 (#646)
* feat(GuildFeature): add APPLICATION_COMMAND_PERMISSIONS_V2

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

135
.eslintplugin/index.ts Normal file
View File

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

View File

@@ -0,0 +1,20 @@
{
"compileOnSave": true,
"compilerOptions": {
"alwaysStrict": true,
"lib": ["esnext"],
"module": "commonjs",
"noUnusedParameters": true,
"sourceMap": true,
"declaration": false,
"noUnusedLocals": true,
"removeComments": false,
"target": "ES2020",
"importsNotUsedAsValues": "error",
"strictNullChecks": true,
"preserveConstEnums": true,
"exactOptionalPropertyTypes": true,
"skipLibCheck": true
},
"include": ["./index.ts"]
}

View File

@@ -4,5 +4,10 @@
"parserOptions": {
"project": "./tsconfig.eslint.json",
"extraFileExtensions": [".mjs"]
},
"plugins": ["local"],
"rules": {
"local/explicitly-optional-undefined-properties": ["error", { "interfaceEndings": ["JSONBody"] }],
"local/explicit-undefined-on-optional-properties": ["error", { "interfaceEndings": ["JSONBody"] }]
}
}

View File

@@ -1,25 +0,0 @@
---
name: Bug report
about: Report incorrect or unexpected behavior of discord-api-types
title: ''
labels: 'bug'
assignees: ''
---
<!-- Use Discord for questions: https://discord.gg/djs -->
**Please describe the problem you are having in as much detail as possible:**
**Include a reproducible code sample here, if possible:**
```ts
// Place your code here
```
**Further details:**
- Runtime:
<!-- Complete whichever is applicable -->
- Node.js version:
- deno version:
- Priority this issue should have please be realistic and elaborate if possible:

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

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

View File

@@ -1,21 +0,0 @@
---
name: Feature request
about: Request a feature for the discord-api-types library
title: ''
labels: 'discussion'
assignees: ''
---
<!-- Use Discord for questions: https://discord.gg/djs -->
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Eg. I'm always frustrated when [...]
**Describe the ideal solution**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

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

View File

@@ -5,3 +5,4 @@ reviewers:
- kyranet
- vladfrangu
numberOfReviewers: 0
runOnDraft: true

2
.github/labels.yml vendored
View File

@@ -5,6 +5,8 @@
color: 'e4f486'
- name: 'semver:patch'
color: 'e8be8b'
- name: 'blocked'
color: 'fc1423'
- name: 'question (please use Discord instead)'
color: 'd876e3'
- name: 'regression'

View File

@@ -28,7 +28,7 @@ jobs:
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci --ignore-scripts
run: npm ci
- name: Install website dependencies
run: pushd website && npm ci --ignore-scripts && popd
@@ -80,7 +80,7 @@ jobs:
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci --ignore-scripts
run: npm ci
- name: Publish release to npm
run: npm publish

View File

@@ -14,5 +14,5 @@ jobs:
sync-labels: true
- name: Automatically assign reviewers
if: ${{ github.event.action == 'opened' }}
uses: kentaro-m/auto-assign-action@v1.1.2
if: github.event.action == 'opened'
uses: kentaro-m/auto-assign-action@v1.2.4

18
.gitignore vendored
View File

@@ -1,15 +1,25 @@
node_modules/
# Custom ESLint rules
.eslintplugin/*
!.eslintplugin/index.ts
!.eslintplugin/tsconfig.json
# Don't commit build outputs
globals.js
globals.*map
globals.d.ts
globals.mjs
./v*.js
./v*.*map
./v*.d.ts
./v*.mjs
v*.js
v*.*map
v*.d.ts
v*.mjs
deno/**/*.js
deno/**/*.map
deno/**/*.d.ts
deno/**/*.mjs
gateway/**/*.js
gateway/**/*.map

View File

@@ -1,4 +1,3 @@
# Node modules
node_modules/
@@ -11,3 +10,8 @@ website/versioned_docs/
website/versions.json
website/.docusaurus/
website/build
# Don't format build outputs
*.js
*.d.ts
*.mjs

View File

@@ -1,3 +1,285 @@
## [0.37.37](https://github.com/discordjs/discord-api-types/compare/0.37.36...0.37.37) (2023-03-23)
### Bug Fixes
- add missing `RESTGetAPIWebhookWithTokenQuery` ([#735](https://github.com/discordjs/discord-api-types/issues/735)) ([2a78a51](https://github.com/discordjs/discord-api-types/commit/2a78a517d2a3511913a8b2b74bba942db097b577))
### Features
- add various new flags ([#733](https://github.com/discordjs/discord-api-types/issues/733)) ([4723d29](https://github.com/discordjs/discord-api-types/commit/4723d29c9ee17c3efa8e8e86351754dee13428ef))
- **RESTGetAPICurrentUserGuildsQuery:** add `with_counts` ([#641](https://github.com/discordjs/discord-api-types/issues/641)) ([0cd9b0d](https://github.com/discordjs/discord-api-types/commit/0cd9b0debbf17f60267bf2f42349fcebea5bf588))
- **RESTPostAPIGuildChannelJSONBody:** add `default_thread_rate_limit_per_user` ([#730](https://github.com/discordjs/discord-api-types/issues/730)) ([8f9370d](https://github.com/discordjs/discord-api-types/commit/8f9370d2592d6a450820bee52fe153eb00ba830f))
## [0.37.36](https://github.com/discordjs/discord-api-types/compare/0.37.35...0.37.36) (2023-03-13)
### Features
- **AutoModeration:** add `custom_message` field support ([#727](https://github.com/discordjs/discord-api-types/issues/727)) ([0d47c69](https://github.com/discordjs/discord-api-types/commit/0d47c69ca80909205f14004aaf26645f367c06d0))
## [0.37.35](https://github.com/discordjs/discord-api-types/compare/0.37.34...0.37.35) (2023-02-17)
### Bug Fixes
- `StageRaiseHand` should be unstable ([#722](https://github.com/discordjs/discord-api-types/issues/722)) ([85051ea](https://github.com/discordjs/discord-api-types/commit/85051eaab7e262b4f60e3f5565bf8a7a5225513e))
## [0.37.34](https://github.com/discordjs/discord-api-types/compare/0.37.33...0.37.34) (2023-02-16)
### Bug Fixes
- **GuildSystemChannelFlags:** "suppress" typo ([#719](https://github.com/discordjs/discord-api-types/issues/719)) ([8d37bc5](https://github.com/discordjs/discord-api-types/commit/8d37bc5e30f76552bca402c858cc67bb8a5ddc9c))
### Features
- add `managed` field to `ChannelType.GroupDM` ([#698](https://github.com/discordjs/discord-api-types/issues/698)) ([8477deb](https://github.com/discordjs/discord-api-types/commit/8477deb6a832b0c985fa0f6d1df4b99eaeab2a87))
- **CDNRoutes:** add `storePageAsset()` ([#695](https://github.com/discordjs/discord-api-types/issues/695)) ([4cf6fd2](https://github.com/discordjs/discord-api-types/commit/4cf6fd2cecd92a9c3ffa32368ccc7b1994295be3))
- **ConnectionService:** add `instagram` ([#701](https://github.com/discordjs/discord-api-types/issues/701)) ([c65e214](https://github.com/discordjs/discord-api-types/commit/c65e214fddeb3aa959034ac14de39edab38ff0f3))
- **RESTJSONErrorCodes:** add error `30011` ([#697](https://github.com/discordjs/discord-api-types/issues/697)) ([41b31eb](https://github.com/discordjs/discord-api-types/commit/41b31ebfd62a8dba32da1e748c49877924c0602d))
- **RESTJSONErrorCodes:** add error `30060` ([#720](https://github.com/discordjs/discord-api-types/issues/720)) ([20153f6](https://github.com/discordjs/discord-api-types/commit/20153f6fe24676d73bcb41e92c6d9d52961f1f73))
- **RESTJSONErrorCodes:** add error `30061` ([#717](https://github.com/discordjs/discord-api-types/issues/717)) ([d609efc](https://github.com/discordjs/discord-api-types/commit/d609efc746df620925237575dd24fd0f38213f09))
## [0.37.33](https://github.com/discordjs/discord-api-types/compare/0.37.32...0.37.33) (2023-02-11)
### Bug Fixes
- **GatewayDispatchPayload:** add missing GuildAuditLogEntry ([#715](https://github.com/discordjs/discord-api-types/issues/715)) ([602c16e](https://github.com/discordjs/discord-api-types/commit/602c16eee12e85a8052f40c695314a42b1d15979))
## [0.37.32](https://github.com/discordjs/discord-api-types/compare/0.37.31...0.37.32) (2023-02-09)
### Features
- **MessageType:** add `SuppressNotifications` ([#710](https://github.com/discordjs/discord-api-types/issues/710)) ([b14aea6](https://github.com/discordjs/discord-api-types/commit/b14aea65f886db047ea9fcbd1b8f49f1bc38f594))
## [0.37.31](https://github.com/discordjs/discord-api-types/compare/0.37.30...0.37.31) (2023-01-30)
## [0.37.30](https://github.com/discordjs/discord-api-types/compare/0.37.29...0.37.30) (2023-01-26)
### Features
- **APIGuildMember:** add support for guild member flags ([#700](https://github.com/discordjs/discord-api-types/issues/700)) ([e902671](https://github.com/discordjs/discord-api-types/commit/e902671411b518504b9adc6b0d7310501fd531ad))
- **GatewayDispatchEvents:** add `GuildAuditLogEntryCreate` ([#692](https://github.com/discordjs/discord-api-types/issues/692)) ([31ca234](https://github.com/discordjs/discord-api-types/commit/31ca234decd6d62b503aadd88111a2af3778f455))
## [0.37.29](https://github.com/discordjs/discord-api-types/compare/0.37.28...0.37.29) (2023-01-23)
## [0.37.28](https://github.com/discordjs/discord-api-types/compare/0.37.27...0.37.28) (2023-01-12)
### Bug Fixes
- **GuildIntegration:** `enabled` and `user` are present on bots ([#660](https://github.com/discordjs/discord-api-types/issues/660)) ([b10e9bb](https://github.com/discordjs/discord-api-types/commit/b10e9bbe5ab450df065fc78da85d49f335db2b82))
### Features
- Add role subscription data and system channel flags ([#686](https://github.com/discordjs/discord-api-types/issues/686)) ([792c60b](https://github.com/discordjs/discord-api-types/commit/792c60b3328d8440de79546bf43d6b317400c788))
- **APIRoleTags:** add `guild_connections` ([#675](https://github.com/discordjs/discord-api-types/issues/675)) ([3dbe985](https://github.com/discordjs/discord-api-types/commit/3dbe985b6e05e6aa68248e79f45d550e783bc6a7))
- **APIThreadMember:** add support for thread member pagination ([#689](https://github.com/discordjs/discord-api-types/issues/689)) ([e2fb5ee](https://github.com/discordjs/discord-api-types/commit/e2fb5ee4886a33bb752a75d5894f726f6f76340f))
- **ConnectionService:** add TikTok ([#632](https://github.com/discordjs/discord-api-types/issues/632)) ([af06df6](https://github.com/discordjs/discord-api-types/commit/af06df6cae224a60e7a35e356028677e8736ed89))
- **RESTJSONErrorCodes:** add error `50091` ([#671](https://github.com/discordjs/discord-api-types/issues/671)) ([8869e92](https://github.com/discordjs/discord-api-types/commit/8869e923362740e491f267d71073d4266d36cb42))
- role subscriptions ([#665](https://github.com/discordjs/discord-api-types/issues/665)) ([0b4058b](https://github.com/discordjs/discord-api-types/commit/0b4058bdd48b74fcd9944dcf4b6f98d5e0bee105))
- **StickerFormatType:** add `GIF` ([#688](https://github.com/discordjs/discord-api-types/issues/688)) ([a6bcb3f](https://github.com/discordjs/discord-api-types/commit/a6bcb3f0fe7bc4edceee61b7cdab0e46db9c7109))
## [0.37.27](https://github.com/discordjs/discord-api-types/compare/0.37.26...0.37.27) (2023-01-09)
### Features
- **MessageType:** add missing types ([#681](https://github.com/discordjs/discord-api-types/issues/681)) ([7d55b33](https://github.com/discordjs/discord-api-types/commit/7d55b33bacb96e156f41fb67a1819c07c8fa959f))
## [0.37.26](https://github.com/discordjs/discord-api-types/compare/0.37.25...0.37.26) (2023-01-05)
### Features
- add RESTJSONErrorCode `40062` and RESTRateLimit.code ([#620](https://github.com/discordjs/discord-api-types/issues/620)) ([4a25caf](https://github.com/discordjs/discord-api-types/commit/4a25caf506c685a8e0af630eef3bd3d2735d64ed))
- **RESTGetAPIAuditLogQuery:** support `after` ([#682](https://github.com/discordjs/discord-api-types/issues/682)) ([bb2ef84](https://github.com/discordjs/discord-api-types/commit/bb2ef843133b29e3042bdfde20b5adb1c3639e01))
- **RESTJSONErrorCodes:** add error `30058` ([#676](https://github.com/discordjs/discord-api-types/issues/676)) ([921bffd](https://github.com/discordjs/discord-api-types/commit/921bffd1b210b6cf2dc6971e451fa0a9e6f6c185))
- **RESTJSONErrorCodes:** add error `50067` ([#640](https://github.com/discordjs/discord-api-types/issues/640)) ([6e4a611](https://github.com/discordjs/discord-api-types/commit/6e4a6115ae44aca5c0b61f621ad75829632850f4))
## [0.37.25](https://github.com/discordjs/discord-api-types/compare/0.37.24...0.37.25) (2022-12-29)
## [0.37.24](https://github.com/discordjs/discord-api-types/compare/0.37.23...0.37.24) (2022-12-19)
### Bug Fixes
- **APIApplicationRoleConnection:** `metadata` values can be numbers ([#673](https://github.com/discordjs/discord-api-types/issues/673)) ([8df9f14](https://github.com/discordjs/discord-api-types/commit/8df9f14a24b714d3b009711eec894cad1e199881))
## [0.37.23](https://github.com/discordjs/discord-api-types/compare/0.37.22...0.37.23) (2022-12-15)
### Bug Fixes
- **APIChannel:** correctly type present properties based on channel type ([#669](https://github.com/discordjs/discord-api-types/issues/669)) ([2a5413d](https://github.com/discordjs/discord-api-types/commit/2a5413def49dbb413227d9b02be500b9184b731d))
- **Interactions:** make app_permissions required ([#652](https://github.com/discordjs/discord-api-types/issues/652)) ([89bc0f4](https://github.com/discordjs/discord-api-types/commit/89bc0f40b60434a768abac95188a2e4e47c2acd9))
### Features
- add role connections ([#651](https://github.com/discordjs/discord-api-types/issues/651)) ([d7b666c](https://github.com/discordjs/discord-api-types/commit/d7b666c739bb848ead5a3af09e37e64ed962014b))
- **APIApplicationCommand:** add `nsfw` field ([#637](https://github.com/discordjs/discord-api-types/issues/637)) ([c3fda99](https://github.com/discordjs/discord-api-types/commit/c3fda99637b4d7688111180f90d6aa41c008ed17))
- **APIGuildForumChannel:** add `default_forum_layout` ([#658](https://github.com/discordjs/discord-api-types/issues/658)) ([190242a](https://github.com/discordjs/discord-api-types/commit/190242a59d5512fdc766217ec9f7c9c54a7b2dcb))
- **Locale:** add Indonesian locale ([#643](https://github.com/discordjs/discord-api-types/issues/643)) ([2b75d13](https://github.com/discordjs/discord-api-types/commit/2b75d13b393f8f9011ec68617cb4e9f9d3fa09e7))
## [0.37.22](https://github.com/discordjs/discord-api-types/compare/0.37.21...0.37.22) (2022-12-12)
### Bug Fixes
- **APIChannel:** correctly type `name` based on channel type ([#666](https://github.com/discordjs/discord-api-types/issues/666)) ([995126e](https://github.com/discordjs/discord-api-types/commit/995126e2cc1494f9fad2ad7c44ecc87898994e44))
## [0.37.21](https://github.com/discordjs/discord-api-types/compare/0.37.20...0.37.21) (2022-12-05)
## [0.37.20](https://github.com/discordjs/discord-api-types/compare/0.37.19...0.37.20) (2022-11-24)
## [0.37.19](https://github.com/discordjs/discord-api-types/compare/0.37.18...0.37.19) (2022-11-21)
### Bug Fixes
- **APIGuildChannel:** make position of guild channel non optional ([#647](https://github.com/discordjs/discord-api-types/issues/647)) ([9d72e82](https://github.com/discordjs/discord-api-types/commit/9d72e82e07e3a3bb9a894081d955bdc5c6b64089))
- **channel:** add missing type aliases ([#648](https://github.com/discordjs/discord-api-types/issues/648)) ([2695dad](https://github.com/discordjs/discord-api-types/commit/2695dade8be818cf5bacbe69ec9aca0b50b9f9b0))
### Features
- **GuildFeatures:** Add `APPLICATION_COMMAND_PERMISSIONS_V2` ([#646](https://github.com/discordjs/discord-api-types/issues/646)) ([a1869a6](https://github.com/discordjs/discord-api-types/commit/a1869a6a6d4e15adf7a3cf64cade1ed051b330fc))
## [0.37.18](https://github.com/discordjs/discord-api-types/compare/0.37.17...0.37.18) (2022-11-14)
### Features
- **UserFlags:** add `ActiveDeveloper` ([#638](https://github.com/discordjs/discord-api-types/issues/638)) ([65da837](https://github.com/discordjs/discord-api-types/commit/65da837673142267a92aea28ecd65d3c05aa0706))
## [0.37.17](https://github.com/discordjs/discord-api-types/compare/0.37.16...0.37.17) (2022-11-07)
### Features
- **APIAutoMod:** add support for regex matching ([#603](https://github.com/discordjs/discord-api-types/issues/603)) ([88a60f7](https://github.com/discordjs/discord-api-types/commit/88a60f78efb6498d861b33d54c809d9d1b39b3d7))
## [0.37.16](https://github.com/discordjs/discord-api-types/compare/0.37.15...0.37.16) (2022-10-31)
### Bug Fixes
- **docs:** update gateway documentation links ([#628](https://github.com/discordjs/discord-api-types/issues/628)) ([7040d9b](https://github.com/discordjs/discord-api-types/commit/7040d9b33370a5d1d7d3c3cb10a25c0e5fb7d0b8))
- export `RESTGetAPIVoiceRegionsResult` with the correct name ([#627](https://github.com/discordjs/discord-api-types/issues/627)) ([69aa717](https://github.com/discordjs/discord-api-types/commit/69aa7179028e0a011e6ba246cc1faa55f463c619))
- **UserFlags:** hardcode the value of `Quarantined` ([#624](https://github.com/discordjs/discord-api-types/issues/624)) ([5091f6e](https://github.com/discordjs/discord-api-types/commit/5091f6e70774fd97ec7dd3ae3f500c3850f81d94))
## [0.37.15](https://github.com/discordjs/discord-api-types/compare/0.37.14...0.37.15) (2022-10-27)
### Bug Fixes
- `default_thread_rate_limit_per_user` is only for forum channels ([#596](https://github.com/discordjs/discord-api-types/issues/596)) ([88ce291](https://github.com/discordjs/discord-api-types/commit/88ce2910fb3640d9be165ac9f6488cc7e4c32663))
- add missing gateway dispatch payloads to gateway event union ([#619](https://github.com/discordjs/discord-api-types/issues/619)) ([348dd41](https://github.com/discordjs/discord-api-types/commit/348dd416d1c94231fdfda88fa0ef03b34a384bb4))
- **APIGuild:** change type of `afk_timeout` to allowed values ([#590](https://github.com/discordjs/discord-api-types/issues/590)) ([aaa57b4](https://github.com/discordjs/discord-api-types/commit/aaa57b4fe96b4f045b312c1a6a2ed17f9fcb3552))
### Features
- add some missing REST types ([#612](https://github.com/discordjs/discord-api-types/issues/612)) ([8d25f23](https://github.com/discordjs/discord-api-types/commit/8d25f233a5366f1d43de942f465e696c73f26c86))
- **Components:** new select menus ([#602](https://github.com/discordjs/discord-api-types/issues/602)) ([df1452d](https://github.com/discordjs/discord-api-types/commit/df1452dc28f2fddb32a20912ca3ca3634556a3da))
- **GuildFeature:** add `DeveloperSupportServer` ([#618](https://github.com/discordjs/discord-api-types/issues/618)) ([8c1484e](https://github.com/discordjs/discord-api-types/commit/8c1484ebbe95afbd850b22262d6223b2f3d40017))
- **RESTJSONErrorCodes:** add 50039 error ([#607](https://github.com/discordjs/discord-api-types/issues/607)) ([131637f](https://github.com/discordjs/discord-api-types/commit/131637fbd20573750a60df2281f94b339443c82c))
- **UserPremiumType:** add `NitroBasic` ([#616](https://github.com/discordjs/discord-api-types/issues/616)) ([9448e9b](https://github.com/discordjs/discord-api-types/commit/9448e9befdfff38ecbf186e5dc9c1fcd88596422))
## [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
- **GatewayGuildMembersChunkDispatchData:** make chunk pagination properties mandatory ([#558](https://github.com/discordjs/discord-api-types/issues/558)) ([0e03e39](https://github.com/discordjs/discord-api-types/commit/0e03e39aa2bf8f1b9a58113a3242c4722e64922b))
- **GatewayRequestGuildMembersData:** limit being required with user_ids ([#559](https://github.com/discordjs/discord-api-types/issues/559)) ([dc3d5df](https://github.com/discordjs/discord-api-types/commit/dc3d5df0a2931eff63991987166634661d5bd1d8))
- **RESTGetAPIChannelUsersThreadsArchivedResult:** add `has_more` missing field ([#543](https://github.com/discordjs/discord-api-types/issues/543)) ([796f6d8](https://github.com/discordjs/discord-api-types/commit/796f6d8a3b2f55d2a120137801e0450ddf30576e))
### Features
- add search that might or might not work ([f8a9c8b](https://github.com/discordjs/discord-api-types/commit/f8a9c8b5c6bdd73bcbf9dd6fff66fafac2594ba4))
- **APIVoiceChannel:** support text in voice, properties `last_message_id` and `rate_limit_per_user` ([#544](https://github.com/discordjs/discord-api-types/issues/544)) ([4488d8f](https://github.com/discordjs/discord-api-types/commit/4488d8fd2611a6547fc6149ba1cec5682340a119))
- **GatewayReadyDispatchData:** add `resume_gateway_url` ([#552](https://github.com/discordjs/discord-api-types/issues/552)) ([9a50367](https://github.com/discordjs/discord-api-types/commit/9a50367dad3a06fbca6e8d1fdd98fbf144595d4e))
## [0.37.1](https://github.com/discordjs/discord-api-types/compare/0.37.0...0.37.1) (2022-08-04)
# [0.37.0](https://github.com/discordjs/discord-api-types/compare/0.36.3...0.37.0) (2022-07-28)
### Code Refactoring
- **RESTJSONErrorCodes:** use `MaximumThreadParticipantsReached` instead in error code 30033 ([#540](https://github.com/discordjs/discord-api-types/issues/540)) ([cecf17b](https://github.com/discordjs/discord-api-types/commit/cecf17b4158fbebb3ee508518a9e9a7b1297356f))
### BREAKING CHANGES
- **RESTJSONErrorCodes:** `MaximumThreadParticipants` was renamed to `MaximumThreadParticipantsReached` for consistency with the rest of the codes
## [0.36.3](https://github.com/discordjs/discord-api-types/compare/0.36.2...0.36.3) (2022-07-21)
### Features

View File

@@ -1,3 +1,285 @@
## [0.37.37](https://github.com/discordjs/discord-api-types/compare/0.37.36...0.37.37) (2023-03-23)
### Bug Fixes
- add missing `RESTGetAPIWebhookWithTokenQuery` ([#735](https://github.com/discordjs/discord-api-types/issues/735)) ([2a78a51](https://github.com/discordjs/discord-api-types/commit/2a78a517d2a3511913a8b2b74bba942db097b577))
### Features
- add various new flags ([#733](https://github.com/discordjs/discord-api-types/issues/733)) ([4723d29](https://github.com/discordjs/discord-api-types/commit/4723d29c9ee17c3efa8e8e86351754dee13428ef))
- **RESTGetAPICurrentUserGuildsQuery:** add `with_counts` ([#641](https://github.com/discordjs/discord-api-types/issues/641)) ([0cd9b0d](https://github.com/discordjs/discord-api-types/commit/0cd9b0debbf17f60267bf2f42349fcebea5bf588))
- **RESTPostAPIGuildChannelJSONBody:** add `default_thread_rate_limit_per_user` ([#730](https://github.com/discordjs/discord-api-types/issues/730)) ([8f9370d](https://github.com/discordjs/discord-api-types/commit/8f9370d2592d6a450820bee52fe153eb00ba830f))
## [0.37.36](https://github.com/discordjs/discord-api-types/compare/0.37.35...0.37.36) (2023-03-13)
### Features
- **AutoModeration:** add `custom_message` field support ([#727](https://github.com/discordjs/discord-api-types/issues/727)) ([0d47c69](https://github.com/discordjs/discord-api-types/commit/0d47c69ca80909205f14004aaf26645f367c06d0))
## [0.37.35](https://github.com/discordjs/discord-api-types/compare/0.37.34...0.37.35) (2023-02-17)
### Bug Fixes
- `StageRaiseHand` should be unstable ([#722](https://github.com/discordjs/discord-api-types/issues/722)) ([85051ea](https://github.com/discordjs/discord-api-types/commit/85051eaab7e262b4f60e3f5565bf8a7a5225513e))
## [0.37.34](https://github.com/discordjs/discord-api-types/compare/0.37.33...0.37.34) (2023-02-16)
### Bug Fixes
- **GuildSystemChannelFlags:** "suppress" typo ([#719](https://github.com/discordjs/discord-api-types/issues/719)) ([8d37bc5](https://github.com/discordjs/discord-api-types/commit/8d37bc5e30f76552bca402c858cc67bb8a5ddc9c))
### Features
- add `managed` field to `ChannelType.GroupDM` ([#698](https://github.com/discordjs/discord-api-types/issues/698)) ([8477deb](https://github.com/discordjs/discord-api-types/commit/8477deb6a832b0c985fa0f6d1df4b99eaeab2a87))
- **CDNRoutes:** add `storePageAsset()` ([#695](https://github.com/discordjs/discord-api-types/issues/695)) ([4cf6fd2](https://github.com/discordjs/discord-api-types/commit/4cf6fd2cecd92a9c3ffa32368ccc7b1994295be3))
- **ConnectionService:** add `instagram` ([#701](https://github.com/discordjs/discord-api-types/issues/701)) ([c65e214](https://github.com/discordjs/discord-api-types/commit/c65e214fddeb3aa959034ac14de39edab38ff0f3))
- **RESTJSONErrorCodes:** add error `30011` ([#697](https://github.com/discordjs/discord-api-types/issues/697)) ([41b31eb](https://github.com/discordjs/discord-api-types/commit/41b31ebfd62a8dba32da1e748c49877924c0602d))
- **RESTJSONErrorCodes:** add error `30060` ([#720](https://github.com/discordjs/discord-api-types/issues/720)) ([20153f6](https://github.com/discordjs/discord-api-types/commit/20153f6fe24676d73bcb41e92c6d9d52961f1f73))
- **RESTJSONErrorCodes:** add error `30061` ([#717](https://github.com/discordjs/discord-api-types/issues/717)) ([d609efc](https://github.com/discordjs/discord-api-types/commit/d609efc746df620925237575dd24fd0f38213f09))
## [0.37.33](https://github.com/discordjs/discord-api-types/compare/0.37.32...0.37.33) (2023-02-11)
### Bug Fixes
- **GatewayDispatchPayload:** add missing GuildAuditLogEntry ([#715](https://github.com/discordjs/discord-api-types/issues/715)) ([602c16e](https://github.com/discordjs/discord-api-types/commit/602c16eee12e85a8052f40c695314a42b1d15979))
## [0.37.32](https://github.com/discordjs/discord-api-types/compare/0.37.31...0.37.32) (2023-02-09)
### Features
- **MessageType:** add `SuppressNotifications` ([#710](https://github.com/discordjs/discord-api-types/issues/710)) ([b14aea6](https://github.com/discordjs/discord-api-types/commit/b14aea65f886db047ea9fcbd1b8f49f1bc38f594))
## [0.37.31](https://github.com/discordjs/discord-api-types/compare/0.37.30...0.37.31) (2023-01-30)
## [0.37.30](https://github.com/discordjs/discord-api-types/compare/0.37.29...0.37.30) (2023-01-26)
### Features
- **APIGuildMember:** add support for guild member flags ([#700](https://github.com/discordjs/discord-api-types/issues/700)) ([e902671](https://github.com/discordjs/discord-api-types/commit/e902671411b518504b9adc6b0d7310501fd531ad))
- **GatewayDispatchEvents:** add `GuildAuditLogEntryCreate` ([#692](https://github.com/discordjs/discord-api-types/issues/692)) ([31ca234](https://github.com/discordjs/discord-api-types/commit/31ca234decd6d62b503aadd88111a2af3778f455))
## [0.37.29](https://github.com/discordjs/discord-api-types/compare/0.37.28...0.37.29) (2023-01-23)
## [0.37.28](https://github.com/discordjs/discord-api-types/compare/0.37.27...0.37.28) (2023-01-12)
### Bug Fixes
- **GuildIntegration:** `enabled` and `user` are present on bots ([#660](https://github.com/discordjs/discord-api-types/issues/660)) ([b10e9bb](https://github.com/discordjs/discord-api-types/commit/b10e9bbe5ab450df065fc78da85d49f335db2b82))
### Features
- Add role subscription data and system channel flags ([#686](https://github.com/discordjs/discord-api-types/issues/686)) ([792c60b](https://github.com/discordjs/discord-api-types/commit/792c60b3328d8440de79546bf43d6b317400c788))
- **APIRoleTags:** add `guild_connections` ([#675](https://github.com/discordjs/discord-api-types/issues/675)) ([3dbe985](https://github.com/discordjs/discord-api-types/commit/3dbe985b6e05e6aa68248e79f45d550e783bc6a7))
- **APIThreadMember:** add support for thread member pagination ([#689](https://github.com/discordjs/discord-api-types/issues/689)) ([e2fb5ee](https://github.com/discordjs/discord-api-types/commit/e2fb5ee4886a33bb752a75d5894f726f6f76340f))
- **ConnectionService:** add TikTok ([#632](https://github.com/discordjs/discord-api-types/issues/632)) ([af06df6](https://github.com/discordjs/discord-api-types/commit/af06df6cae224a60e7a35e356028677e8736ed89))
- **RESTJSONErrorCodes:** add error `50091` ([#671](https://github.com/discordjs/discord-api-types/issues/671)) ([8869e92](https://github.com/discordjs/discord-api-types/commit/8869e923362740e491f267d71073d4266d36cb42))
- role subscriptions ([#665](https://github.com/discordjs/discord-api-types/issues/665)) ([0b4058b](https://github.com/discordjs/discord-api-types/commit/0b4058bdd48b74fcd9944dcf4b6f98d5e0bee105))
- **StickerFormatType:** add `GIF` ([#688](https://github.com/discordjs/discord-api-types/issues/688)) ([a6bcb3f](https://github.com/discordjs/discord-api-types/commit/a6bcb3f0fe7bc4edceee61b7cdab0e46db9c7109))
## [0.37.27](https://github.com/discordjs/discord-api-types/compare/0.37.26...0.37.27) (2023-01-09)
### Features
- **MessageType:** add missing types ([#681](https://github.com/discordjs/discord-api-types/issues/681)) ([7d55b33](https://github.com/discordjs/discord-api-types/commit/7d55b33bacb96e156f41fb67a1819c07c8fa959f))
## [0.37.26](https://github.com/discordjs/discord-api-types/compare/0.37.25...0.37.26) (2023-01-05)
### Features
- add RESTJSONErrorCode `40062` and RESTRateLimit.code ([#620](https://github.com/discordjs/discord-api-types/issues/620)) ([4a25caf](https://github.com/discordjs/discord-api-types/commit/4a25caf506c685a8e0af630eef3bd3d2735d64ed))
- **RESTGetAPIAuditLogQuery:** support `after` ([#682](https://github.com/discordjs/discord-api-types/issues/682)) ([bb2ef84](https://github.com/discordjs/discord-api-types/commit/bb2ef843133b29e3042bdfde20b5adb1c3639e01))
- **RESTJSONErrorCodes:** add error `30058` ([#676](https://github.com/discordjs/discord-api-types/issues/676)) ([921bffd](https://github.com/discordjs/discord-api-types/commit/921bffd1b210b6cf2dc6971e451fa0a9e6f6c185))
- **RESTJSONErrorCodes:** add error `50067` ([#640](https://github.com/discordjs/discord-api-types/issues/640)) ([6e4a611](https://github.com/discordjs/discord-api-types/commit/6e4a6115ae44aca5c0b61f621ad75829632850f4))
## [0.37.25](https://github.com/discordjs/discord-api-types/compare/0.37.24...0.37.25) (2022-12-29)
## [0.37.24](https://github.com/discordjs/discord-api-types/compare/0.37.23...0.37.24) (2022-12-19)
### Bug Fixes
- **APIApplicationRoleConnection:** `metadata` values can be numbers ([#673](https://github.com/discordjs/discord-api-types/issues/673)) ([8df9f14](https://github.com/discordjs/discord-api-types/commit/8df9f14a24b714d3b009711eec894cad1e199881))
## [0.37.23](https://github.com/discordjs/discord-api-types/compare/0.37.22...0.37.23) (2022-12-15)
### Bug Fixes
- **APIChannel:** correctly type present properties based on channel type ([#669](https://github.com/discordjs/discord-api-types/issues/669)) ([2a5413d](https://github.com/discordjs/discord-api-types/commit/2a5413def49dbb413227d9b02be500b9184b731d))
- **Interactions:** make app_permissions required ([#652](https://github.com/discordjs/discord-api-types/issues/652)) ([89bc0f4](https://github.com/discordjs/discord-api-types/commit/89bc0f40b60434a768abac95188a2e4e47c2acd9))
### Features
- add role connections ([#651](https://github.com/discordjs/discord-api-types/issues/651)) ([d7b666c](https://github.com/discordjs/discord-api-types/commit/d7b666c739bb848ead5a3af09e37e64ed962014b))
- **APIApplicationCommand:** add `nsfw` field ([#637](https://github.com/discordjs/discord-api-types/issues/637)) ([c3fda99](https://github.com/discordjs/discord-api-types/commit/c3fda99637b4d7688111180f90d6aa41c008ed17))
- **APIGuildForumChannel:** add `default_forum_layout` ([#658](https://github.com/discordjs/discord-api-types/issues/658)) ([190242a](https://github.com/discordjs/discord-api-types/commit/190242a59d5512fdc766217ec9f7c9c54a7b2dcb))
- **Locale:** add Indonesian locale ([#643](https://github.com/discordjs/discord-api-types/issues/643)) ([2b75d13](https://github.com/discordjs/discord-api-types/commit/2b75d13b393f8f9011ec68617cb4e9f9d3fa09e7))
## [0.37.22](https://github.com/discordjs/discord-api-types/compare/0.37.21...0.37.22) (2022-12-12)
### Bug Fixes
- **APIChannel:** correctly type `name` based on channel type ([#666](https://github.com/discordjs/discord-api-types/issues/666)) ([995126e](https://github.com/discordjs/discord-api-types/commit/995126e2cc1494f9fad2ad7c44ecc87898994e44))
## [0.37.21](https://github.com/discordjs/discord-api-types/compare/0.37.20...0.37.21) (2022-12-05)
## [0.37.20](https://github.com/discordjs/discord-api-types/compare/0.37.19...0.37.20) (2022-11-24)
## [0.37.19](https://github.com/discordjs/discord-api-types/compare/0.37.18...0.37.19) (2022-11-21)
### Bug Fixes
- **APIGuildChannel:** make position of guild channel non optional ([#647](https://github.com/discordjs/discord-api-types/issues/647)) ([9d72e82](https://github.com/discordjs/discord-api-types/commit/9d72e82e07e3a3bb9a894081d955bdc5c6b64089))
- **channel:** add missing type aliases ([#648](https://github.com/discordjs/discord-api-types/issues/648)) ([2695dad](https://github.com/discordjs/discord-api-types/commit/2695dade8be818cf5bacbe69ec9aca0b50b9f9b0))
### Features
- **GuildFeatures:** Add `APPLICATION_COMMAND_PERMISSIONS_V2` ([#646](https://github.com/discordjs/discord-api-types/issues/646)) ([a1869a6](https://github.com/discordjs/discord-api-types/commit/a1869a6a6d4e15adf7a3cf64cade1ed051b330fc))
## [0.37.18](https://github.com/discordjs/discord-api-types/compare/0.37.17...0.37.18) (2022-11-14)
### Features
- **UserFlags:** add `ActiveDeveloper` ([#638](https://github.com/discordjs/discord-api-types/issues/638)) ([65da837](https://github.com/discordjs/discord-api-types/commit/65da837673142267a92aea28ecd65d3c05aa0706))
## [0.37.17](https://github.com/discordjs/discord-api-types/compare/0.37.16...0.37.17) (2022-11-07)
### Features
- **APIAutoMod:** add support for regex matching ([#603](https://github.com/discordjs/discord-api-types/issues/603)) ([88a60f7](https://github.com/discordjs/discord-api-types/commit/88a60f78efb6498d861b33d54c809d9d1b39b3d7))
## [0.37.16](https://github.com/discordjs/discord-api-types/compare/0.37.15...0.37.16) (2022-10-31)
### Bug Fixes
- **docs:** update gateway documentation links ([#628](https://github.com/discordjs/discord-api-types/issues/628)) ([7040d9b](https://github.com/discordjs/discord-api-types/commit/7040d9b33370a5d1d7d3c3cb10a25c0e5fb7d0b8))
- export `RESTGetAPIVoiceRegionsResult` with the correct name ([#627](https://github.com/discordjs/discord-api-types/issues/627)) ([69aa717](https://github.com/discordjs/discord-api-types/commit/69aa7179028e0a011e6ba246cc1faa55f463c619))
- **UserFlags:** hardcode the value of `Quarantined` ([#624](https://github.com/discordjs/discord-api-types/issues/624)) ([5091f6e](https://github.com/discordjs/discord-api-types/commit/5091f6e70774fd97ec7dd3ae3f500c3850f81d94))
## [0.37.15](https://github.com/discordjs/discord-api-types/compare/0.37.14...0.37.15) (2022-10-27)
### Bug Fixes
- `default_thread_rate_limit_per_user` is only for forum channels ([#596](https://github.com/discordjs/discord-api-types/issues/596)) ([88ce291](https://github.com/discordjs/discord-api-types/commit/88ce2910fb3640d9be165ac9f6488cc7e4c32663))
- add missing gateway dispatch payloads to gateway event union ([#619](https://github.com/discordjs/discord-api-types/issues/619)) ([348dd41](https://github.com/discordjs/discord-api-types/commit/348dd416d1c94231fdfda88fa0ef03b34a384bb4))
- **APIGuild:** change type of `afk_timeout` to allowed values ([#590](https://github.com/discordjs/discord-api-types/issues/590)) ([aaa57b4](https://github.com/discordjs/discord-api-types/commit/aaa57b4fe96b4f045b312c1a6a2ed17f9fcb3552))
### Features
- add some missing REST types ([#612](https://github.com/discordjs/discord-api-types/issues/612)) ([8d25f23](https://github.com/discordjs/discord-api-types/commit/8d25f233a5366f1d43de942f465e696c73f26c86))
- **Components:** new select menus ([#602](https://github.com/discordjs/discord-api-types/issues/602)) ([df1452d](https://github.com/discordjs/discord-api-types/commit/df1452dc28f2fddb32a20912ca3ca3634556a3da))
- **GuildFeature:** add `DeveloperSupportServer` ([#618](https://github.com/discordjs/discord-api-types/issues/618)) ([8c1484e](https://github.com/discordjs/discord-api-types/commit/8c1484ebbe95afbd850b22262d6223b2f3d40017))
- **RESTJSONErrorCodes:** add 50039 error ([#607](https://github.com/discordjs/discord-api-types/issues/607)) ([131637f](https://github.com/discordjs/discord-api-types/commit/131637fbd20573750a60df2281f94b339443c82c))
- **UserPremiumType:** add `NitroBasic` ([#616](https://github.com/discordjs/discord-api-types/issues/616)) ([9448e9b](https://github.com/discordjs/discord-api-types/commit/9448e9befdfff38ecbf186e5dc9c1fcd88596422))
## [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
- **GatewayGuildMembersChunkDispatchData:** make chunk pagination properties mandatory ([#558](https://github.com/discordjs/discord-api-types/issues/558)) ([0e03e39](https://github.com/discordjs/discord-api-types/commit/0e03e39aa2bf8f1b9a58113a3242c4722e64922b))
- **GatewayRequestGuildMembersData:** limit being required with user_ids ([#559](https://github.com/discordjs/discord-api-types/issues/559)) ([dc3d5df](https://github.com/discordjs/discord-api-types/commit/dc3d5df0a2931eff63991987166634661d5bd1d8))
- **RESTGetAPIChannelUsersThreadsArchivedResult:** add `has_more` missing field ([#543](https://github.com/discordjs/discord-api-types/issues/543)) ([796f6d8](https://github.com/discordjs/discord-api-types/commit/796f6d8a3b2f55d2a120137801e0450ddf30576e))
### Features
- add search that might or might not work ([f8a9c8b](https://github.com/discordjs/discord-api-types/commit/f8a9c8b5c6bdd73bcbf9dd6fff66fafac2594ba4))
- **APIVoiceChannel:** support text in voice, properties `last_message_id` and `rate_limit_per_user` ([#544](https://github.com/discordjs/discord-api-types/issues/544)) ([4488d8f](https://github.com/discordjs/discord-api-types/commit/4488d8fd2611a6547fc6149ba1cec5682340a119))
- **GatewayReadyDispatchData:** add `resume_gateway_url` ([#552](https://github.com/discordjs/discord-api-types/issues/552)) ([9a50367](https://github.com/discordjs/discord-api-types/commit/9a50367dad3a06fbca6e8d1fdd98fbf144595d4e))
## [0.37.1](https://github.com/discordjs/discord-api-types/compare/0.37.0...0.37.1) (2022-08-04)
# [0.37.0](https://github.com/discordjs/discord-api-types/compare/0.36.3...0.37.0) (2022-07-28)
### Code Refactoring
- **RESTJSONErrorCodes:** use `MaximumThreadParticipantsReached` instead in error code 30033 ([#540](https://github.com/discordjs/discord-api-types/issues/540)) ([cecf17b](https://github.com/discordjs/discord-api-types/commit/cecf17b4158fbebb3ee508518a9e9a7b1297356f))
### BREAKING CHANGES
- **RESTJSONErrorCodes:** `MaximumThreadParticipants` was renamed to `MaximumThreadParticipantsReached` for consistency with the rest of the codes
## [0.36.3](https://github.com/discordjs/discord-api-types/compare/0.36.2...0.36.3) (2022-07-21)
### Features

View File

@@ -1,5 +1,5 @@
/**
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params
*/
export interface GatewayURLQuery {
v: string;

File diff suppressed because it is too large Load Diff

View File

@@ -1686,7 +1686,7 @@ export interface GatewayPresenceUpdateData {
/**
* The user's activities
*
* See https://discord.com/developers/docs/topics/gateway#activity-object
* See https://discord.com/developers/docs/topics/gateway-events#activity-object
*/
activities: GatewayActivityUpdateData[];
/**
@@ -1702,7 +1702,7 @@ export interface GatewayPresenceUpdateData {
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayActivityUpdateData = Pick<GatewayActivity, 'name' | 'type' | 'url'>;

File diff suppressed because it is too large Load Diff

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,47 @@ 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 {
/**
* An error code for some limits
*
* {@link RESTJSONErrorCodes}
*/
code?: number;
/**
* A value indicating if you are being globally rate limited or not
*/
global: boolean;
/**
* A message saying you are being rate limited.
*/
message: string;
/**
* The number of seconds to wait before submitting another request.
*/
retry_after: number;
}

View File

@@ -43,17 +43,12 @@ import type {
APIApplicationCommandUserOption,
} from './_chatInput/user.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIInteractionDataResolved } from '../../mod.ts';
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/base.ts';
export * from './_chatInput/boolean.ts';
export * from './_chatInput/channel.ts';
export * from './_chatInput/integer.ts';
@@ -108,23 +103,12 @@ export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataAttachmentOption;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIChatInputApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {
options?: APIApplicationCommandInteractionDataOption[];
resolved?: APIChatInputApplicationCommandInteractionDataResolved;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
export interface APIChatInputApplicationCommandInteractionDataResolved {
users?: Record<Snowflake, APIUser>;
roles?: Record<Snowflake, APIRole>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
attachments?: Record<Snowflake, APIAttachment>;
resolved?: APIInteractionDataResolved;
}
/**

View File

@@ -1,33 +1,20 @@
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIMessage } from '../../channel.ts';
import type { APIUser } from '../../user.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper, APIUserInteractionDataResolved } from '../base.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIUserApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.User> {
target_id: Snowflake;
resolved: APIUserApplicationCommandInteractionDataResolved;
resolved: APIUserInteractionDataResolved;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
export interface APIUserApplicationCommandInteractionDataResolved {
users: Record<Snowflake, APIUser>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIMessageApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.Message> {
@@ -43,7 +30,7 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIContextMenuInteractionData =
| APIUserApplicationCommandInteractionData

View File

@@ -15,8 +15,6 @@ import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocalizationMap } from '../../../v10.ts';
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
export * from './_applicationCommands/chatInput.ts';
export * from './_applicationCommands/contextMenu.ts';
@@ -85,6 +83,10 @@ export interface APIApplicationCommand {
* @deprecated Use `dm_permission` and/or `default_member_permissions` instead
*/
default_permission?: boolean;
/**
* Indicates whether the command is age-restricted, defaults to `false`
*/
nsfw?: boolean;
/**
* Autoincrementing version identifier updated during substantial record changes
*/
@@ -101,34 +103,20 @@ export enum ApplicationCommandType {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIApplicationCommandInteractionData =
| APIChatInputApplicationCommandInteractionData
| APIContextMenuInteractionData;
/**
* https://discord.com/developers/docs/resources/channel#channel-object
*/
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
thread_metadata?: APIThreadMetadata | null;
permissions: Permissions;
parent_id?: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
Required<Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data'>>;
Required<
Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data' | 'app_permissions'>
>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object

View File

@@ -1,7 +1,7 @@
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocaleString } from '../../../v10.ts';
import type { APIMessage } from '../channel.ts';
import type { APIRole, LocaleString } from '../../../v10.ts';
import type { APIAttachment, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIUser } from '../user.ts';
@@ -129,3 +129,46 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
'user'
> &
Required<Pick<Original, 'member' | 'guild_id'>>;
/**
* https://discord.com/developers/docs/resources/channel#channel-object
*/
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
thread_metadata?: APIThreadMetadata | null;
permissions: Permissions;
parent_id?: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
export interface APIInteractionDataResolved {
users?: Record<Snowflake, APIUser>;
roles?: Record<Snowflake, APIRole>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
attachments?: Record<Snowflake, APIAttachment>;
}
/**
* @deprecated Renamed to `APIInteractionDataResolved`
*/
export type APIChatInputApplicationCommandInteractionDataResolved = APIInteractionDataResolved;
/**
* `users` and optional `members` from APIInteractionDataResolved, for user commands and user selects
*/
export type APIUserInteractionDataResolved = Required<Pick<APIInteractionDataResolved, 'users'>> &
Pick<APIInteractionDataResolved, 'members'>;
/**
* @deprecated Renamed to `APIUserInteractionDataResolved`
*/
export type APIUserApplicationCommandInteractionDataResolved = APIUserInteractionDataResolved;

View File

@@ -1,4 +1,10 @@
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
import type {
APIDMInteractionWrapper,
APIGuildInteractionWrapper,
APIInteractionDataResolved,
APIUserInteractionDataResolved,
} from './base.ts';
import type { Snowflake } from '../../../globals.ts';
import type { ComponentType } from '../channel.ts';
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
@@ -9,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;
@@ -20,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;
@@ -31,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;
@@ -50,11 +56,42 @@ export interface APIMessageComponentBaseInteractionData<CType extends ComponentT
export type APIMessageButtonInteractionData = APIMessageComponentBaseInteractionData<ComponentType.Button>;
export interface APIMessageSelectMenuInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.SelectMenu> {
export interface APIMessageStringSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.StringSelect> {
values: string[];
}
export interface APIMessageUserSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.UserSelect> {
values: Snowflake[];
resolved: APIUserInteractionDataResolved;
}
export interface APIMessageRoleSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.RoleSelect> {
values: Snowflake[];
resolved: Required<Pick<APIInteractionDataResolved, 'roles'>>;
}
export interface APIMessageMentionableSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.MentionableSelect> {
values: Snowflake[];
resolved: Pick<APIInteractionDataResolved, 'users' | 'members' | 'roles'>;
}
export interface APIMessageChannelSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.ChannelSelect> {
values: Snowflake[];
resolved: Required<Pick<APIInteractionDataResolved, 'channels'>>;
}
export type APIMessageSelectMenuInteractionData =
| APIMessageStringSelectInteractionData
| APIMessageUserSelectInteractionData
| APIMessageRoleSelectInteractionData
| APIMessageMentionableSelectInteractionData
| APIMessageChannelSelectInteractionData;
export type APIMessageComponentDMInteraction = APIDMInteractionWrapper<APIMessageComponentInteraction>;
export type APIMessageComponentGuildInteraction = APIGuildInteractionWrapper<APIMessageComponentInteraction>;

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

@@ -6,6 +6,7 @@ import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
import type { Permissions, Snowflake } from '../../globals.ts';
import type { LocalizationMap } from '../common.ts';
/**
* https://discord.com/developers/docs/resources/application#application-object
@@ -62,7 +63,7 @@ export interface APIApplication {
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
* See https://discord.com/developers/docs/game-sdk/applications#get-ticket
* See https://discord.com/developers/docs/game-sdk/applications#getticket
*/
verify_key: string;
/**
@@ -105,6 +106,11 @@ export interface APIApplication {
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
}
export interface APIApplicationInstallParams {
@@ -116,17 +122,139 @@ export interface APIApplicationInstallParams {
* https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
export enum ApplicationFlags {
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
EmbeddedReleased = 1 << 1,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
ManagedEmoji = 1 << 2,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
EmbeddedIAP = 1 << 3,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
GroupDMCreate = 1 << 4,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
ApplicationAutoModerationRuleCreateBadge = 1 << 6,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
RPCHasConnected = 1 << 11,
/**
* Intent required for bots in 100 or more servers to receive `presence_update` events
*/
GatewayPresence = 1 << 12,
/**
* Intent required for bots in under 100 servers to receive `presence_update` events, found in Bot Settings
*/
GatewayPresenceLimited = 1 << 13,
/**
* Intent required for bots in 100 or more servers to receive member-related events like `guild_member_add`.
* See list of member-related events [under `GUILD_MEMBERS`](https://discord.com/developers/docs/topics/gateway#list-of-intents)
*/
GatewayGuildMembers = 1 << 14,
/**
* Intent required for bots in under 100 servers to receive member-related events like `guild_member_add`, found in Bot Settings.
* See list of member-related events [under `GUILD_MEMBERS`](https://discord.com/developers/docs/topics/gateway#list-of-intents)
*/
GatewayGuildMembersLimited = 1 << 15,
/**
* Indicates unusual growth of an app that prevents verification
*/
VerificationPendingGuildLimit = 1 << 16,
/**
* Indicates if an app is embedded within the Discord client (currently unavailable publicly)
*/
Embedded = 1 << 17,
/**
* Intent required for bots in 100 or more servers to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055)
*/
GatewayMessageContent = 1 << 18,
/**
* Intent required for bots in under 100 servers to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055),
* found in Bot Settings
*/
GatewayMessageContentLimited = 1 << 19,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
EmbeddedFirstParty = 1 << 20,
/**
* Indicates if an app has registered global [application commands](https://discord.com/developers/docs/interactions/application-commands)
*/
ApplicationCommandBadge = 1 << 23,
}
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure
*/
export interface APIApplicationRoleConnectionMetadata {
/**
* Type of metadata value
*/
type: ApplicationRoleConnectionMetadataType;
/**
* Dictionary key for the metadata field (must be `a-z`, `0-9`, or `_` characters; 1-50 characters)
*/
key: string;
/**
* Name of the metadata field (1-100 characters)
*/
name: string;
/**
* Translations of the name
*/
name_localizations?: LocalizationMap;
/**
* Description of the metadata field (1-200 characters)
*/
description: string;
/**
* Translations of the description
*/
description_localizations?: LocalizationMap;
}
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type
*/
export enum ApplicationRoleConnectionMetadataType {
/**
* The metadata value (`integer`) is less than or equal to the guild's configured value (`integer`)
*/
IntegerLessThanOrEqual = 1,
/**
* The metadata value (`integer`) is greater than or equal to the guild's configured value (`integer`)
*/
IntegerGreaterThanOrEqual,
/**
* The metadata value (`integer`) is equal to the guild's configured value (`integer`)
*/
IntegerEqual,
/**
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`)
*/
IntegerNotEqual,
/**
* The metadata value (`ISO8601 string`) is less than or equal to the guild's configured value (`integer`; days before current date)
*/
DatetimeLessThanOrEqual,
/**
* The metadata value (`ISO8601 string`) is greater than or equal to the guild's configured value (`integer`; days before current date)
*/
DatetimeGreaterThanOrEqual,
/**
* The metadata value (`integer`) is equal to the guild's configured value (`integer`; `1`)
*/
BooleanEqual,
/**
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`; `1`)
*/
BooleanNotEqual,
}

View File

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

View File

@@ -4,6 +4,7 @@
import type { APIApplication } from './application.ts';
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
import type { APIMessageInteraction } from './interactions.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker, APIStickerItem } from './sticker.ts';
@@ -25,9 +26,9 @@ export interface APIPartialChannel {
*/
type: ChannelType;
/**
* The name of the channel (2-100 characters)
* The name of the channel (1-100 characters)
*/
name?: string;
name?: string | null;
}
/**
@@ -39,30 +40,47 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
flags?: ChannelFlags;
}
// TODO: update when text in voice is released
export type TextChannelType =
| ChannelType.DM
| ChannelType.GroupDM
| ChannelType.GuildNews
| ChannelType.GuildPublicThread
| ChannelType.GuildPrivateThread
| ChannelType.GuildNewsThread
| ChannelType.GuildAnnouncement
| ChannelType.PublicThread
| ChannelType.PrivateThread
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum;
| ChannelType.GuildForum
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice;
export type GuildChannelType = Exclude<
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
ChannelType.DM | ChannelType.GroupDM
>;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* When the last pinned message was pinned.
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
*/
last_pin_timestamp?: string | null;
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
}
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelBase<T>, 'name'> {
/**
* The name of the channel (1-100 characters)
*/
name: string;
/**
* The id of the guild (may be missing for some channel objects received over gateway guild dispatches)
*/
@@ -76,7 +94,7 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
/**
* Sorting position of the channel
*/
position?: number;
position: number;
/**
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
*
@@ -94,46 +112,36 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APIGuildTextChannel<T extends GuildTextChannelType>
extends APITextBasedChannel<T>,
extends Omit<APITextBasedChannel<T>, 'name'>,
APIGuildChannel<T> {
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration;
/**
* The channel topic (0-1024 characters)
* The initial `rate_limit_per_user` to set on newly created threads.
* This field is copied to the thread at creation time and does not live update
*/
default_thread_rate_limit_per_user?: number;
/**
* The channel topic (0-4096 characters for forum channels, 0-1024 characters for all others)
*/
topic?: string | null;
/**
* When the last pinned message was pinned.
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
*/
last_pin_timestamp?: string | null;
}
export interface APITextChannel extends APIGuildTextChannel<ChannelType.GuildText> {
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
}
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageVoice | ChannelType.GuildVoice> {
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
/**
* The bitrate (in bits) of the voice channel
* The bitrate (in bits) of the voice or stage channel
*/
bitrate?: number;
/**
* The user limit of the voice channel
* The user limit of the voice or stage channel
*/
user_limit?: number;
/**
@@ -143,14 +151,18 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
*/
rtc_region?: string | null;
/**
* The camera video quality mode of the voice channel, `1` when not present
* The camera video quality mode of the voice or stage channel, `1` when not present
*
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
*/
video_quality_mode?: VideoQualityMode;
}
interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T> {
export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
/**
* The recipients of the DM
*
@@ -159,9 +171,18 @@ interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>
recipients?: APIUser[];
}
export type APIDMChannel = APIDMChannelBase<ChannelType.DM>;
export interface APIDMChannel extends Omit<APIDMChannelBase<ChannelType.DM>, 'name'> {
/**
* The name of the channel (always null for DM channels)
*/
name: null;
}
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
/**
* The name of the channel (1-100 characters)
*/
name: string | null;
/**
* Application id of the group DM creator if it is bot-created
*/
@@ -170,10 +191,6 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
* Icon hash
*/
icon?: string | null;
/**
* The name of the channel (2-100 characters)
*/
name?: string | null;
/**
* ID of the DM creator
*/
@@ -182,12 +199,18 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* Whether the channel is managed by an OAuth2 application
*/
managed?: boolean;
}
export interface APIThreadChannel
extends APIGuildChannel<
ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread | ChannelType.GuildNewsThread
> {
extends Omit<
APITextBasedChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread>,
'name'
>,
APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -206,33 +229,112 @@ export interface APIThreadChannel
* The approximate member count of the thread, does not count above 50 even if there are more members
*/
member_count?: number;
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
/**
* ID of the thread creator
*/
owner_id?: Snowflake;
/**
* The id of the last message sent in this thread (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* Number of messages ever sent in a thread
*
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
*/
total_message_sent?: number;
/**
* 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,
}
/**
* https://discord.com/developers/docs/resources/channel/#channel-object-forum-layout-types
*/
export enum ForumLayoutType {
/**
* No default has been set for forum channel
*/
NotSet,
/**
* Display posts as a list
*/
ListView,
/**
* Display posts as a collection of tiles
*/
GalleryView,
}
export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
/**
* The set of tags that can be used in a forum channel
*/
available_tags: APIGuildForumTag[];
/**
* 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 a forum channel
*/
default_sort_order: SortOrderType | null;
/**
* The default layout type used to display posts in a forum channel. Defaults to `0`, which indicates a layout view has not been set by a channel admin
*/
default_forum_layout: ForumLayoutType;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
@@ -242,10 +344,10 @@ export type APIChannel =
| APIDMChannel
| APITextChannel
| APINewsChannel
| APIVoiceChannel
| APIGuildVoiceChannel
| APIGuildStageVoiceChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APINewsChannel
| APIGuildForumChannel;
/**
@@ -271,43 +373,72 @@ export enum ChannelType {
/**
* An organizational category that contains up to 50 channels
*
* See https://support.discord.com/hc/en-us/articles/115001580171-Channel-Categories-101
* See https://support.discord.com/hc/articles/115001580171
*/
GuildCategory,
/**
* A channel that users can follow and crosspost into their own guild
*
* See https://support.discord.com/hc/en-us/articles/360032008192
* See https://support.discord.com/hc/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 or Guild Forum 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
*
* See https://support.discord.com/hc/en-us/articles/1500005513722
* See https://support.discord.com/hc/articles/1500005513722
*/
GuildStageVoice,
/**
* The channel in a Student Hub containing the listed servers
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
* See https://support.discord.com/hc/articles/4406046651927
*/
GuildDirectory,
/**
* 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/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 {
@@ -344,6 +475,13 @@ export interface APIMessage {
author: APIUser;
/**
* Contents of the message
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
*
* See https://support-dev.discord.com/hc/articles/4404772028055
*/
content: string;
/**
@@ -394,12 +532,26 @@ export interface APIMessage {
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
*
* See https://support-dev.discord.com/hc/articles/4404772028055
*/
attachments: APIAttachment[];
/**
* Any embedded content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
*
* See https://support-dev.discord.com/hc/articles/4404772028055
*/
embeds: APIEmbed[];
/**
@@ -438,7 +590,7 @@ export interface APIMessage {
/**
* Sent with Rich Presence-related chat embeds
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
* See https://discord.com/developers/docs/resources/application#application-object
*/
application?: Partial<APIApplication>;
/**
@@ -483,6 +635,13 @@ export interface APIMessage {
thread?: APIChannel;
/**
* Sent if the message contains components like buttons, action rows, or other interactive components
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**.
* You also need to specify the intent bit value (`1 << 15`) if you are connecting to the gateway
*
* See https://support-dev.discord.com/hc/articles/4404772028055
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
/**
@@ -504,6 +663,11 @@ export interface APIMessage {
* It can be used to estimate the relative position of the message in a thread in company with `total_message_sent` on parent thread
*/
position?: number;
/**
* Data of the role subscription purchase or renewal that prompted this `ROLE_SUBSCRIPTION_PURCHASE` message
*/
role_subscription_data?: APIMessageRoleSubscriptionData;
}
/**
@@ -523,6 +687,7 @@ export enum MessageType {
GuildBoostTier2,
GuildBoostTier3,
ChannelFollowAdd,
GuildDiscoveryDisqualified = 14,
GuildDiscoveryRequalified,
GuildDiscoveryGracePeriodInitialWarning,
@@ -533,6 +698,18 @@ export enum MessageType {
ThreadStarterMessage,
GuildInviteReminder,
ContextMenuCommand,
AutoModerationAction,
RoleSubscriptionPurchase,
InteractionPremiumUpsell,
StageStart,
StageEnd,
StageSpeaker,
/**
* @unstable https://github.com/discord/discord-api-docs/pull/5927#discussion_r1107678548
*/
StageRaiseHand,
StageTopic,
GuildApplicationPremiumSubscription,
}
/**
@@ -621,6 +798,40 @@ export enum MessageFlags {
* This message failed to mention some roles and add their members to the thread
*/
FailedToMentionSomeRolesInThread = 1 << 8,
/**
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
ShouldShowLinkNotDiscordWarning = 1 << 10,
/**
* This message will not trigger push and desktop notifications
*/
SuppressNotifications = 1 << 12,
/**
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
IsVoiceMessage = 1 << 13,
}
/**
* https://discord.com/developers/docs/resources/channel#role-subscription-data-object-role-subscription-data-object-structure
*/
export interface APIMessageRoleSubscriptionData {
/**
* The id of the SKU and listing the user is subscribed to
*/
role_subscription_listing_id: Snowflake;
/**
* The name of the tier the user is subscribed to
*/
tier_name: string;
/**
* The number of months the user has been subscribed for
*/
total_months_subscribed: number;
/**
* Whether this notification is for a renewal
*/
is_renewal: boolean;
}
/**
@@ -757,9 +968,34 @@ export interface APIThreadMember {
* See https://en.wikipedia.org/wiki/Bit_field
*/
flags: ThreadMemberFlags;
/**
* Additional information about the user
*
* **This field is omitted on the member sent within each thread in the `GUILD_CREATE` event**
*
* **This field is only present when `with_member` is set to true when calling `List Thread Members` or `Get Thread Member`**
*/
member?: APIGuildMember;
}
export enum ThreadMemberFlags {}
export enum ThreadMemberFlags {
/**
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
HasInteracted = 1 << 0,
/**
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
AllMessages = 1 << 1,
/**
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
OnlyMentions = 1 << 2,
/**
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
NoMessages = 1 << 3,
}
export interface APIThreadList {
/**
@@ -885,6 +1121,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',
}
/**
@@ -1160,7 +1402,7 @@ export interface APIBaseComponent<T extends ComponentType> {
}
/**
* https://discord.com/developers/docs/interactions/message-components#component-types
* https://discord.com/developers/docs/interactions/message-components#component-object-component-types
*/
export enum ComponentType {
/**
@@ -1172,13 +1414,38 @@ export enum ComponentType {
*/
Button,
/**
* Select Menu component
* Select menu for picking from defined text options
*/
SelectMenu,
StringSelect,
/**
* Text Input component
*/
TextInput,
/**
* Select menu for users
*/
UserSelect,
/**
* Select menu for roles
*/
RoleSelect,
/**
* Select menu for users and roles
*/
MentionableSelect,
/**
* Select menu for channels
*/
ChannelSelect,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
/**
* Select menu for picking from defined text options
*
* @deprecated This is the old name for {@apilink ComponentType#StringSelect}
*/
SelectMenu = 3,
}
/**
@@ -1270,15 +1537,18 @@ export enum TextInputStyle {
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.SelectMenu> {
export interface APIBaseSelectMenuComponent<
T extends
| ComponentType.StringSelect
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect,
> extends APIBaseComponent<T> {
/**
* A developer-defined identifier for the select menu, max 100 characters
*/
custom_id: string;
/**
* The choices in the select, max 25
*/
options: APISelectMenuOption[];
/**
* Custom placeholder text if nothing is selected, max 150 characters
*/
@@ -1303,6 +1573,51 @@ export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.S
disabled?: boolean;
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<ComponentType.StringSelect> {
/**
* Specified choices in a select menu; max 25
*/
options: APISelectMenuOption[];
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIUserSelectComponent = APIBaseSelectMenuComponent<ComponentType.UserSelect>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIRoleSelectComponent = APIBaseSelectMenuComponent<ComponentType.RoleSelect>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIMentionableSelectComponent = APIBaseSelectMenuComponent<ComponentType.MentionableSelect>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APIChannelSelectComponent extends APIBaseSelectMenuComponent<ComponentType.ChannelSelect> {
/**
* List of channel types to include in the ChannelSelect component
*/
channel_types?: ChannelType[];
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APISelectMenuComponent =
| APIStringSelectComponent
| APIUserSelectComponent
| APIRoleSelectComponent
| APIMentionableSelectComponent
| APIChannelSelectComponent;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
*/
@@ -1371,7 +1686,39 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
*/
export enum ChannelFlags {
/**
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
GuildFeedRemoved = 1 << 0,
/**
* This thread is pinned to the top of its parent forum channel
*/
Pinned = 1 << 1,
/**
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
ActiveChannelsRemoved = 1 << 2,
/**
* 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,
/**
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
IsSpam = 1 << 5,
/**
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
IsGuildResourceChannel = 1 << 7,
/**
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
ClydeAI = 1 << 8,
/**
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
IsScheduledForDeletion = 1 << 9,
}
/**

View File

@@ -1,5 +1,7 @@
/**
* Types extracted from https://discord.com/developers/docs/topics/gateway
* Types extracted from
* - https://discord.com/developers/docs/topics/gateway
* - https://discord.com/developers/docs/topics/gateway-events
*/
import type { APIChannel, APIThreadMember } from './channel.ts';
@@ -58,7 +60,7 @@ export interface APIGatewaySessionStartLimit {
}
/**
* https://discord.com/developers/docs/topics/gateway#presence-update-presence-update-event-fields
* https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields
*/
export interface GatewayPresenceUpdate {
/**
@@ -81,13 +83,13 @@ export interface GatewayPresenceUpdate {
/**
* User's current activities
*
* See https://discord.com/developers/docs/topics/gateway#activity-object
* See https://discord.com/developers/docs/topics/gateway-events#activity-object
*/
activities?: GatewayActivity[];
/**
* User's platform-dependent status
*
* See https://discord.com/developers/docs/topics/gateway#client-status-object
* See https://discord.com/developers/docs/topics/gateway-events#client-status-object
*/
client_status?: GatewayPresenceClientStatus;
}
@@ -104,7 +106,7 @@ export enum PresenceUpdateStatus {
}
/**
* https://discord.com/developers/docs/topics/gateway#client-status-object
* https://discord.com/developers/docs/topics/gateway-events#client-status-object
*/
export interface GatewayPresenceClientStatus {
/**
@@ -122,7 +124,7 @@ export interface GatewayPresenceClientStatus {
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure
*/
export interface GatewayActivity {
/**
@@ -137,7 +139,7 @@ export interface GatewayActivity {
/**
* Activity type
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types
*/
type: ActivityType;
/**
@@ -177,7 +179,7 @@ export interface GatewayActivity {
/**
* The emoji used for a custom status
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji
*/
emoji?: GatewayActivityEmoji;
/**
@@ -187,19 +189,19 @@ export interface GatewayActivity {
/**
* Information for the current party of the player
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
*/
party?: GatewayActivityParty;
/**
* Images for the presence and their hover texts
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets
*/
assets?: GatewayActivityAssets;
/**
* Secrets for Rich Presence joining and spectating
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets
*/
secrets?: GatewayActivitySecrets;
/**
@@ -209,7 +211,7 @@ export interface GatewayActivity {
/**
* Activity flags `OR`d together, describes what the payload includes
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
@@ -236,7 +238,7 @@ export enum ActivityPlatform {
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types
*/
export enum ActivityType {
/**
@@ -266,7 +268,7 @@ export enum ActivityType {
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-timestamps
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-timestamps
*/
export interface GatewayActivityTimestamps {
/**
@@ -280,12 +282,12 @@ export interface GatewayActivityTimestamps {
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji
*/
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'id' | 'animated'>> & Pick<APIEmoji, 'name'>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
*/
export interface GatewayActivityParty {
/**
@@ -299,19 +301,19 @@ export interface GatewayActivityParty {
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets
*/
export type GatewayActivityAssets = Partial<
Record<'large_image' | 'large_text' | 'small_image' | 'small_text', string>
>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets
*/
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags
*/
export enum ActivityFlags {
Instance = 1 << 0,
@@ -337,7 +339,7 @@ export interface GatewayActivityButton {
}
/**
* https://discord.com/developers/docs/topics/gateway#thread-list-sync-thread-list-sync-event-fields
* https://discord.com/developers/docs/topics/gateway-events#thread-list-sync-thread-list-sync-event-fields
*/
export interface GatewayThreadListSync {
/**
@@ -359,7 +361,7 @@ export interface GatewayThreadListSync {
}
/**
* https://discord.com/developers/docs/topics/gateway#thread-members-update-thread-members-update-event-fields
* https://discord.com/developers/docs/topics/gateway-events#thread-members-update-thread-members-update-event-fields
*/
export interface GatewayThreadMembersUpdate {
/**

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,9 +118,9 @@ 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;
afk_timeout: 60 | 300 | 900 | 1800 | 3600;
/**
* `true` if the guild widget is enabled
*/
@@ -235,11 +236,13 @@ export interface APIGuild extends APIPartialGuild {
*/
max_video_channel_users?: number;
/**
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
* Approximate number of members in this guild,
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
*/
approximate_member_count?: number;
/**
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
* Approximate number of non-offline members in this guild,
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
*/
approximate_presence_count?: number;
/**
@@ -367,6 +370,14 @@ export enum GuildSystemChannelFlags {
* Hide member join sticker reply buttons
*/
SuppressJoinNotificationReplies = 1 << 3,
/**
* Suppress role subscription purchase and renewal notifications
*/
SuppressRoleSubscriptionPurchaseNotifications = 1 << 4,
/**
* Hide role subscription sticker reply buttons
*/
SuppressRoleSubscriptionPurchaseNotificationReplies = 1 << 5,
}
/**
@@ -381,6 +392,16 @@ export enum GuildFeature {
* Guild has access to set an animated guild icon
*/
AnimatedIcon = 'ANIMATED_ICON',
/**
* Guild is using the old permissions configuration behavior
*
* See https://discord.com/developers/docs/change-log#upcoming-application-command-permission-changes
*/
ApplicationCommandPermissionsV2 = 'APPLICATION_COMMAND_PERMISSIONS_V2',
/**
* Guild has set up auto moderation rules
*/
AutoModeration = 'AUTO_MODERATION',
/**
* Guild has access to set a guild banner image
*/
@@ -389,6 +410,18 @@ export enum GuildFeature {
* Guild can enable welcome screen, Membership Screening and discovery, and receives community updates
*/
Community = 'COMMUNITY',
/**
* Guild has enabled monetization
*/
CreatorMonetizableProvisional = 'CREATOR_MONETIZABLE_PROVISIONAL',
/**
* Guild has enabled the role subscription promo page
*/
CreatorStorePage = 'CREATOR_STORE_PAGE',
/*
* Guild has been set as a support server on the App Directory
*/
DeveloperSupportServer = 'DEVELOPER_SUPPORT_SERVER',
/**
* Guild is able to be discovered in the directory
*/
@@ -404,11 +437,15 @@ export enum GuildFeature {
/**
* Guild is a Student Hub
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
* See https://support.discord.com/hc/articles/4406046651927
*
* @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
*/
@@ -416,7 +453,7 @@ export enum GuildFeature {
/**
* Guild is in a Student Hub
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
* See https://support.discord.com/hc/articles/4406046651927
*
* @unstable This feature is currently not documented by Discord, but has known value
*/
@@ -427,6 +464,8 @@ export enum GuildFeature {
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
/**
* Guild has enabled monetization
*
* @unstable This feature is no longer documented by Discord
*/
MonetizationEnabled = 'MONETIZATION_ENABLED',
/**
@@ -454,6 +493,14 @@ export enum GuildFeature {
* Guild is able to set role icons
*/
RoleIcons = 'ROLE_ICONS',
/**
* Guild has role subscriptions that can be purchased
*/
RoleSubscriptionsAvailableForPurchase = 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE',
/**
* Guild has enabled role subscriptions
*/
RoleSubscriptionsEnabled = 'ROLE_SUBSCRIPTIONS_ENABLED',
/**
* Guild has enabled ticketed events
*/
@@ -583,7 +630,7 @@ export interface APIGuildMember {
/**
* When the user started boosting the guild
*
* See https://support.discord.com/hc/en-us/articles/360028038352-Server-Boosting-
* See https://support.discord.com/hc/articles/360028038352
*/
premium_since?: string | null;
/**
@@ -594,6 +641,10 @@ export interface APIGuildMember {
* Whether the user is muted in voice channels
*/
mute: boolean;
/**
* Guild member flags represented as a bit set, defaults to `0`
*/
flags: GuildMemberFlags;
/**
* Whether the user has not yet passed the guild's Membership Screening requirements
*
@@ -606,6 +657,44 @@ export interface APIGuildMember {
communication_disabled_until?: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags
*/
export enum GuildMemberFlags {
/**
* Member has left and rejoined the guild
*/
DidRejoin = 1 << 0,
/**
* Member has completed onboarding
*/
CompletedOnboarding = 1 << 1,
/**
* Member bypasses guild verification requirements
*/
BypassesVerification = 1 << 2,
/**
* Member has started onboarding
*/
StartedOnboarding = 1 << 3,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
StartedHomeActions = 1 << 5,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
CompletedHomeActions = 1 << 6,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
AutomodQuarantinedUsernameOrGuildNickname = 1 << 7,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
AutomodQuarantinedBio = 1 << 8,
}
/**
* https://discord.com/developers/docs/resources/guild#integration-object
*/
@@ -625,7 +714,7 @@ export interface APIGuildIntegration {
/**
* Is this integration enabled
*/
enabled?: boolean;
enabled: boolean;
/**
* Is this integration syncing
*
@@ -661,7 +750,7 @@ export interface APIGuildIntegration {
/**
* User for this integration
*
* **This field is not provided for `discord` bot integrations.**
* **Some older integrations may not have an attached user.**
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
@@ -698,9 +787,13 @@ 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';
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription';
/**
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
@@ -769,7 +862,7 @@ export interface APIBan {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object
*/
export interface APIGuildWidget {
id: Snowflake;
@@ -781,7 +874,7 @@ export interface APIGuildWidget {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetChannel {
id: Snowflake;
@@ -790,7 +883,7 @@ export interface APIGuildWidgetChannel {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetMember {
id: string;

View File

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

View File

@@ -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

@@ -61,6 +61,10 @@ export enum OAuth2Scopes {
* (otherwise restricted to channels/guilds your app creates)
*/
MessagesRead = 'messages.read',
/**
* Allows your app to update a user's connection and metadata for the app
*/
RoleConnectionsWrite = 'role_connections.write',
/**
* For local rpc server access, this allows you to control a user's local Discord client - requires Discord approval
*/

View File

@@ -72,4 +72,16 @@ export interface APIRoleTags {
* The id of the integration this role belongs to
*/
integration_id?: Snowflake;
/**
* The id of this role's subscription sku and listing
*/
subscription_listing_id?: Snowflake;
/**
* Whether this role is available for purchase
*/
available_for_purchase?: null;
/**
* Whether this role is a guild's linked role
*/
guild_connections?: null;
}

View File

@@ -73,7 +73,7 @@ export enum StickerType {
*/
Standard = 1,
/**
* A sticker uploaded to a Boosted guild for the guild's members
* A sticker uploaded to a guild for the guild's members
*/
Guild,
}
@@ -85,6 +85,7 @@ export enum StickerFormatType {
PNG = 1,
APNG,
Lottie,
GIF,
}
/**

View File

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

View File

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

View File

@@ -101,6 +101,14 @@ export enum UserFlags {
* Bug Hunter Level 1
*/
BugHunterLevel1 = 1 << 3,
/**
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
MFASMS = 1 << 4,
/**
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
PremiumPromoDismissed = 1 << 5,
/**
* House Bravery Member
*/
@@ -121,6 +129,10 @@ export enum UserFlags {
* User is a [team](https://discord.com/developers/docs/topics/teams)
*/
TeamPseudoUser = 1 << 10,
/**
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
HasUnreadUrgentMessages = 1 << 13,
/**
* Bug Hunter Level 2
*/
@@ -134,7 +146,7 @@ export enum UserFlags {
*/
VerifiedDeveloper = 1 << 17,
/**
* Discord Certified Moderator
* Moderator Programs Alumni
*/
CertifiedModerator = 1 << 18,
/**
@@ -148,11 +160,39 @@ export enum UserFlags {
*/
Spammer = 1 << 20,
/**
* User's account has been quarantined based on recent activity
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Quarantined = Math.pow(2, 44),
DisablePremium = 1 << 21,
/**
* User is an [Active Developer](https://support-dev.discord.com/hc/articles/10113997751447)
*/
ActiveDeveloper = 1 << 22,
/**
* User's account has been [quarantined](https://support.discord.com/hc/articles/6461420677527) based on recent activity
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*
* @privateRemarks
*
* This value would be 1 << 44, but bit shifting above 1 << 30 requires bigints
*/
Quarantined = 17592186044416,
/**
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*
* @privateRemarks
*
* This value would be 1 << 50, but bit shifting above 1 << 30 requires bigints
*/
Collaborator = 1125899906842624,
/**
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*
* @privateRemarks
*
* This value would be 1 << 51, but bit shifting above 1 << 30 requires bigints
*/
RestrictedCollaborator = 2251799813685248,
}
/**
@@ -162,6 +202,7 @@ export enum UserPremiumType {
None,
NitroClassic,
Nitro,
NitroBasic,
}
/**
@@ -204,6 +245,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,16 +259,20 @@ export interface APIConnection {
export enum ConnectionService {
BattleNet = 'battlenet',
eBay = 'ebay',
EpicGames = 'epicgames',
Facebook = 'facebook',
GitHub = 'github',
Instagram = 'instagram',
LeagueOfLegends = 'leagueoflegends',
PayPal = 'paypal',
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
SamsungGalaxy = 'samsunggalaxy',
RiotGames = 'riotgames',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',
TikTok = 'tiktok',
Twitch = 'twitch',
Twitter = 'twitter',
Xbox = 'xbox',
@@ -240,3 +289,21 @@ export enum ConnectionVisibility {
*/
Everyone,
}
/**
* https://discord.com/developers/docs/resources/user#application-role-connection-object-application-role-connection-structure
*/
export interface APIApplicationRoleConnection {
/**
* The vanity name of the platform a bot has connected (max 50 characters)
*/
platform_name: string | null;
/**
* The username on the platform a bot has connected (max 100 characters)
*/
platform_username: string | null;
/**
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
*/
metadata: Record<string, string | number>;
}

View File

@@ -86,7 +86,7 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
/**
* Sorting position of the channel
*/
position?: number;
position: number;
/**
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
*/

View File

@@ -43,17 +43,12 @@ import type {
APIApplicationCommandUserOption,
} from './_chatInput/user.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIInteractionDataResolved } from '../../mod.ts';
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/base.ts';
export * from './_chatInput/boolean.ts';
export * from './_chatInput/channel.ts';
export * from './_chatInput/integer.ts';
@@ -108,23 +103,12 @@ export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataAttachmentOption;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIChatInputApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {
options?: APIApplicationCommandInteractionDataOption[];
resolved?: APIChatInputApplicationCommandInteractionDataResolved;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
export interface APIChatInputApplicationCommandInteractionDataResolved {
users?: Record<Snowflake, APIUser>;
roles?: Record<Snowflake, APIRole>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
attachments?: Record<Snowflake, APIAttachment>;
resolved?: APIInteractionDataResolved;
}
/**

View File

@@ -1,33 +1,20 @@
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIMessage } from '../../channel.ts';
import type { APIUser } from '../../user.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper, APIUserInteractionDataResolved } from '../base.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIUserApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.User> {
target_id: Snowflake;
resolved: APIUserApplicationCommandInteractionDataResolved;
resolved: APIUserInteractionDataResolved;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
export interface APIUserApplicationCommandInteractionDataResolved {
users: Record<Snowflake, APIUser>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export interface APIMessageApplicationCommandInteractionData
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.Message> {
@@ -43,7 +30,7 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIContextMenuInteractionData =
| APIUserApplicationCommandInteractionData

View File

@@ -15,8 +15,6 @@ import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocalizationMap } from '../../../v9.ts';
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
export * from './_applicationCommands/chatInput.ts';
export * from './_applicationCommands/contextMenu.ts';
@@ -85,6 +83,10 @@ export interface APIApplicationCommand {
* @deprecated Use `dm_permission` and/or `default_member_permissions` instead
*/
default_permission?: boolean;
/**
* Indicates whether the command is age-restricted, defaults to `false`
*/
nsfw?: boolean;
/**
* Autoincrementing version identifier updated during substantial record changes
*/
@@ -101,34 +103,20 @@ export enum ApplicationCommandType {
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIApplicationCommandInteractionData =
| APIChatInputApplicationCommandInteractionData
| APIContextMenuInteractionData;
/**
* https://discord.com/developers/docs/resources/channel#channel-object
*/
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
thread_metadata?: APIThreadMetadata | null;
permissions: Permissions;
parent_id?: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
Required<Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data'>>;
Required<
Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data' | 'app_permissions'>
>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object

View File

@@ -1,7 +1,7 @@
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocaleString } from '../../../v9.ts';
import type { APIMessage } from '../channel.ts';
import type { APIRole, LocaleString } from '../../../v9.ts';
import type { APIAttachment, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIUser } from '../user.ts';
@@ -129,3 +129,46 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
'user'
> &
Required<Pick<Original, 'member' | 'guild_id'>>;
/**
* https://discord.com/developers/docs/resources/channel#channel-object
*/
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
thread_metadata?: APIThreadMetadata | null;
permissions: Permissions;
parent_id?: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
permissions: Permissions;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
*/
export interface APIInteractionDataResolved {
users?: Record<Snowflake, APIUser>;
roles?: Record<Snowflake, APIRole>;
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
attachments?: Record<Snowflake, APIAttachment>;
}
/**
* @deprecated Renamed to `APIInteractionDataResolved`
*/
export type APIChatInputApplicationCommandInteractionDataResolved = APIInteractionDataResolved;
/**
* `users` and optional `members` from APIInteractionDataResolved, for user commands and user selects
*/
export type APIUserInteractionDataResolved = Required<Pick<APIInteractionDataResolved, 'users'>> &
Pick<APIInteractionDataResolved, 'members'>;
/**
* @deprecated Renamed to `APIUserInteractionDataResolved`
*/
export type APIUserApplicationCommandInteractionDataResolved = APIUserInteractionDataResolved;

View File

@@ -1,4 +1,10 @@
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
import type {
APIDMInteractionWrapper,
APIGuildInteractionWrapper,
APIInteractionDataResolved,
APIUserInteractionDataResolved,
} from './base.ts';
import type { Snowflake } from '../../../globals.ts';
import type { ComponentType } from '../channel.ts';
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
@@ -9,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;
@@ -20,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;
@@ -31,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
'channel_id' | 'data' | 'message'
'channel_id' | 'data' | 'app_permissions' | 'message'
>
>;
@@ -50,11 +56,42 @@ export interface APIMessageComponentBaseInteractionData<CType extends ComponentT
export type APIMessageButtonInteractionData = APIMessageComponentBaseInteractionData<ComponentType.Button>;
export interface APIMessageSelectMenuInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.SelectMenu> {
export interface APIMessageStringSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.StringSelect> {
values: string[];
}
export interface APIMessageUserSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.UserSelect> {
values: Snowflake[];
resolved: APIUserInteractionDataResolved;
}
export interface APIMessageRoleSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.RoleSelect> {
values: Snowflake[];
resolved: Required<Pick<APIInteractionDataResolved, 'roles'>>;
}
export interface APIMessageMentionableSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.MentionableSelect> {
values: Snowflake[];
resolved: Pick<APIInteractionDataResolved, 'users' | 'members' | 'roles'>;
}
export interface APIMessageChannelSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.ChannelSelect> {
values: Snowflake[];
resolved: Required<Pick<APIInteractionDataResolved, 'channels'>>;
}
export type APIMessageSelectMenuInteractionData =
| APIMessageStringSelectInteractionData
| APIMessageUserSelectInteractionData
| APIMessageRoleSelectInteractionData
| APIMessageMentionableSelectInteractionData
| APIMessageChannelSelectInteractionData;
export type APIMessageComponentDMInteraction = APIDMInteractionWrapper<APIMessageComponentInteraction>;
export type APIMessageComponentGuildInteraction = APIGuildInteractionWrapper<APIMessageComponentInteraction>;

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

@@ -6,6 +6,7 @@ import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
import type { Permissions, Snowflake } from '../../globals.ts';
import type { LocalizationMap } from '../common.ts';
/**
* https://discord.com/developers/docs/resources/application#application-object
@@ -62,7 +63,7 @@ export interface APIApplication {
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
* See https://discord.com/developers/docs/game-sdk/applications#get-ticket
* See https://discord.com/developers/docs/game-sdk/applications#getticket
*/
verify_key: string;
/**
@@ -105,6 +106,11 @@ export interface APIApplication {
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
/**
* The application's role connection verification entry point,
* which when configured will render the app as a verification method in the guild role verification configuration
*/
role_connections_verification_url?: string;
}
export interface APIApplicationInstallParams {
@@ -116,17 +122,139 @@ export interface APIApplicationInstallParams {
* https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
export enum ApplicationFlags {
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
EmbeddedReleased = 1 << 1,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
ManagedEmoji = 1 << 2,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
EmbeddedIAP = 1 << 3,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
GroupDMCreate = 1 << 4,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
ApplicationAutoModerationRuleCreateBadge = 1 << 6,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
RPCHasConnected = 1 << 11,
/**
* Intent required for bots in 100 or more servers to receive `presence_update` events
*/
GatewayPresence = 1 << 12,
/**
* Intent required for bots in under 100 servers to receive `presence_update` events, found in Bot Settings
*/
GatewayPresenceLimited = 1 << 13,
/**
* Intent required for bots in 100 or more servers to receive member-related events like `guild_member_add`.
* See list of member-related events [under `GUILD_MEMBERS`](https://discord.com/developers/docs/topics/gateway#list-of-intents)
*/
GatewayGuildMembers = 1 << 14,
/**
* Intent required for bots in under 100 servers to receive member-related events like `guild_member_add`, found in Bot Settings.
* See list of member-related events [under `GUILD_MEMBERS`](https://discord.com/developers/docs/topics/gateway#list-of-intents)
*/
GatewayGuildMembersLimited = 1 << 15,
/**
* Indicates unusual growth of an app that prevents verification
*/
VerificationPendingGuildLimit = 1 << 16,
/**
* Indicates if an app is embedded within the Discord client (currently unavailable publicly)
*/
Embedded = 1 << 17,
/**
* Intent required for bots in 100 or more servers to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055)
*/
GatewayMessageContent = 1 << 18,
/**
* Intent required for bots in under 100 servers to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055),
* found in Bot Settings
*/
GatewayMessageContentLimited = 1 << 19,
/**
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
EmbeddedFirstParty = 1 << 20,
/**
* Indicates if an app has registered global [application commands](https://discord.com/developers/docs/interactions/application-commands)
*/
ApplicationCommandBadge = 1 << 23,
}
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure
*/
export interface APIApplicationRoleConnectionMetadata {
/**
* Type of metadata value
*/
type: ApplicationRoleConnectionMetadataType;
/**
* Dictionary key for the metadata field (must be `a-z`, `0-9`, or `_` characters; 1-50 characters)
*/
key: string;
/**
* Name of the metadata field (1-100 characters)
*/
name: string;
/**
* Translations of the name
*/
name_localizations?: LocalizationMap;
/**
* Description of the metadata field (1-200 characters)
*/
description: string;
/**
* Translations of the description
*/
description_localizations?: LocalizationMap;
}
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type
*/
export enum ApplicationRoleConnectionMetadataType {
/**
* The metadata value (`integer`) is less than or equal to the guild's configured value (`integer`)
*/
IntegerLessThanOrEqual = 1,
/**
* The metadata value (`integer`) is greater than or equal to the guild's configured value (`integer`)
*/
IntegerGreaterThanOrEqual,
/**
* The metadata value (`integer`) is equal to the guild's configured value (`integer`)
*/
IntegerEqual,
/**
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`)
*/
IntegerNotEqual,
/**
* The metadata value (`ISO8601 string`) is less than or equal to the guild's configured value (`integer`; days before current date)
*/
DatetimeLessThanOrEqual,
/**
* The metadata value (`ISO8601 string`) is greater than or equal to the guild's configured value (`integer`; days before current date)
*/
DatetimeGreaterThanOrEqual,
/**
* The metadata value (`integer`) is equal to the guild's configured value (`integer`; `1`)
*/
BooleanEqual,
/**
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`; `1`)
*/
BooleanNotEqual,
}

View File

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

View File

@@ -4,6 +4,7 @@
import type { APIApplication } from './application.ts';
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
import type { APIMessageInteraction } from './interactions.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker, APIStickerItem } from './sticker.ts';
@@ -25,9 +26,9 @@ export interface APIPartialChannel {
*/
type: ChannelType;
/**
* The name of the channel (2-100 characters)
* The name of the channel (1-100 characters)
*/
name?: string;
name?: string | null;
}
/**
@@ -39,30 +40,47 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
flags?: ChannelFlags;
}
// TODO: update when text in voice is released
export type TextChannelType =
| ChannelType.DM
| ChannelType.GroupDM
| ChannelType.GuildNews
| ChannelType.GuildPublicThread
| ChannelType.GuildPrivateThread
| ChannelType.GuildNewsThread
| ChannelType.GuildAnnouncement
| ChannelType.PublicThread
| ChannelType.PrivateThread
| ChannelType.AnnouncementThread
| ChannelType.GuildText
| ChannelType.GuildForum;
| ChannelType.GuildForum
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice;
export type GuildChannelType = Exclude<
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
ChannelType.DM | ChannelType.GroupDM
>;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T> {
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* When the last pinned message was pinned.
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
*/
last_pin_timestamp?: string | null;
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
}
export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T> {
export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelBase<T>, 'name'> {
/**
* The name of the channel (1-100 characters)
*/
name: string;
/**
* The id of the guild (may be missing for some channel objects received over gateway guild dispatches)
*/
@@ -76,7 +94,7 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
/**
* Sorting position of the channel
*/
position?: number;
position: number;
/**
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
*
@@ -94,46 +112,36 @@ export interface APIGuildChannel<T extends ChannelType> extends APIChannelBase<T
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APIGuildTextChannel<T extends GuildTextChannelType>
extends APITextBasedChannel<T>,
extends Omit<APITextBasedChannel<T>, 'name'>,
APIGuildChannel<T> {
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration;
/**
* The initial `rate_limit_per_user` to set on newly created threads.
* This field is copied to the thread at creation time and does not live update
*/
default_thread_rate_limit_per_user?: number;
/**
* The channel topic (0-1024 characters)
*/
topic?: string | null;
/**
* When the last pinned message was pinned.
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
*/
last_pin_timestamp?: string | null;
}
export interface APITextChannel extends APIGuildTextChannel<ChannelType.GuildText> {
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
}
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageVoice | ChannelType.GuildVoice> {
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
/**
* The bitrate (in bits) of the voice channel
* The bitrate (in bits) of the voice or stage channel
*/
bitrate?: number;
/**
* The user limit of the voice channel
* The user limit of the voice or stage channel
*/
user_limit?: number;
/**
@@ -143,14 +151,18 @@ export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageV
*/
rtc_region?: string | null;
/**
* The camera video quality mode of the voice channel, `1` when not present
* The camera video quality mode of the voice or stage channel, `1` when not present
*
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
*/
video_quality_mode?: VideoQualityMode;
}
interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T> {
export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
export interface APIDMChannelBase<T extends ChannelType> extends Omit<APITextBasedChannel<T>, 'rate_limit_per_user'> {
/**
* The recipients of the DM
*
@@ -159,9 +171,18 @@ interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>
recipients?: APIUser[];
}
export type APIDMChannel = APIDMChannelBase<ChannelType.DM>;
export interface APIDMChannel extends Omit<APIDMChannelBase<ChannelType.DM>, 'name'> {
/**
* The name of the channel (always null for DM channels)
*/
name: null;
}
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
/**
* The name of the channel (1-100 characters)
*/
name: string | null;
/**
* Application id of the group DM creator if it is bot-created
*/
@@ -170,24 +191,22 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
* Icon hash
*/
icon?: string | null;
/**
* The name of the channel (2-100 characters)
*/
name?: string | null;
/**
* ID of the DM creator
*/
owner_id?: Snowflake;
/**
* The id of the last message sent in this channel (may not point to an existing or valid message)
* Whether the channel is managed by an OAuth2 application
*/
last_message_id?: Snowflake | null;
managed?: boolean;
}
export interface APIThreadChannel
extends APIGuildChannel<
ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread | ChannelType.GuildNewsThread
> {
extends Omit<
APITextBasedChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread>,
'name'
>,
APIGuildChannel<ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread> {
/**
* The client users member for the thread, only included in select endpoints
*/
@@ -206,33 +225,112 @@ export interface APIThreadChannel
* The approximate member count of the thread, does not count above 50 even if there are more members
*/
member_count?: number;
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
*
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
*
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
*/
rate_limit_per_user?: number;
/**
* ID of the thread creator
*/
owner_id?: Snowflake;
/**
* The id of the last message sent in this thread (may not point to an existing or valid message)
*/
last_message_id?: Snowflake | null;
/**
* Number of messages ever sent in a thread
*
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
*/
total_message_sent?: number;
/**
* 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,
}
/**
* https://discord.com/developers/docs/resources/channel/#channel-object-forum-layout-types
*/
export enum ForumLayoutType {
/**
* No default has been set for forum channel
*/
NotSet,
/**
* Display posts as a list
*/
ListView,
/**
* Display posts as a collection of tiles
*/
GalleryView,
}
export interface APIGuildForumChannel extends APIGuildTextChannel<ChannelType.GuildForum> {
/**
* The set of tags that can be used in a forum channel
*/
available_tags: APIGuildForumTag[];
/**
* 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 a forum channel
*/
default_sort_order: SortOrderType | null;
/**
* The default layout type used to display posts in a forum channel. Defaults to `0`, which indicates a layout view has not been set by a channel admin
*/
default_forum_layout: ForumLayoutType;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
@@ -242,10 +340,10 @@ export type APIChannel =
| APIDMChannel
| APITextChannel
| APINewsChannel
| APIVoiceChannel
| APIGuildVoiceChannel
| APIGuildStageVoiceChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APINewsChannel
| APIGuildForumChannel;
/**
@@ -271,43 +369,71 @@ export enum ChannelType {
/**
* An organizational category that contains up to 50 channels
*
* See https://support.discord.com/hc/en-us/articles/115001580171-Channel-Categories-101
* See https://support.discord.com/hc/articles/115001580171
*/
GuildCategory,
/**
* A channel that users can follow and crosspost into their own guild
*
* See https://support.discord.com/hc/en-us/articles/360032008192
* See https://support.discord.com/hc/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 or Guild Forum 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
*
* See https://support.discord.com/hc/en-us/articles/1500005513722
* See https://support.discord.com/hc/articles/1500005513722
*/
GuildStageVoice,
/**
* The channel in a Student Hub containing the listed servers
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
* See https://support.discord.com/hc/articles/4406046651927
*/
GuildDirectory,
/**
* 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/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 {
@@ -344,6 +470,12 @@ export interface APIMessage {
author: APIUser;
/**
* Contents of the message
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
*
* See https://support-dev.discord.com/hc/articles/4404772028055
*/
content: string;
/**
@@ -394,12 +526,24 @@ export interface APIMessage {
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
*
* See https://support-dev.discord.com/hc/articles/4404772028055
*/
attachments: APIAttachment[];
/**
* Any embedded content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
*
* See https://support-dev.discord.com/hc/articles/4404772028055
*/
embeds: APIEmbed[];
/**
@@ -438,7 +582,7 @@ export interface APIMessage {
/**
* Sent with Rich Presence-related chat embeds
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
* See https://discord.com/developers/docs/resources/application#application-object
*/
application?: Partial<APIApplication>;
/**
@@ -483,6 +627,12 @@ export interface APIMessage {
thread?: APIChannel;
/**
* Sent if the message contains components like buttons, action rows, or other interactive components
*
* The `MESSAGE_CONTENT` privileged gateway intent will become required after **August 31, 2022** for verified applications to receive a non-empty value from this field
*
* In the Discord Developers Portal, you need to enable the toggle of this intent of your application in **Bot > Privileged Gateway Intents**
*
* See https://support-dev.discord.com/hc/articles/4404772028055
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
/**
@@ -523,6 +673,7 @@ export enum MessageType {
GuildBoostTier2,
GuildBoostTier3,
ChannelFollowAdd,
GuildDiscoveryDisqualified = 14,
GuildDiscoveryRequalified,
GuildDiscoveryGracePeriodInitialWarning,
@@ -533,6 +684,18 @@ export enum MessageType {
ThreadStarterMessage,
GuildInviteReminder,
ContextMenuCommand,
AutoModerationAction,
RoleSubscriptionPurchase,
InteractionPremiumUpsell,
StageStart,
StageEnd,
StageSpeaker,
/**
* @unstable https://github.com/discord/discord-api-docs/pull/5927#discussion_r1107678548
*/
StageRaiseHand,
StageTopic,
GuildApplicationPremiumSubscription,
}
/**
@@ -621,6 +784,18 @@ export enum MessageFlags {
* This message failed to mention some roles and add their members to the thread
*/
FailedToMentionSomeRolesInThread = 1 << 8,
/**
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
ShouldShowLinkNotDiscordWarning = 1 << 10,
/**
* This message will not trigger push and desktop notifications
*/
SuppressNotifications = 1 << 12,
/**
* @unstable This message flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
IsVoiceMessage = 1 << 13,
}
/**
@@ -757,9 +932,34 @@ export interface APIThreadMember {
* See https://en.wikipedia.org/wiki/Bit_field
*/
flags: ThreadMemberFlags;
/**
* Additional information about the user
*
* **This field is omitted on the member sent within each thread in the `GUILD_CREATE` event**
*
* **This field is only present when `with_member` is set to true when calling `List Thread Members` or `Get Thread Member`**
*/
member?: APIGuildMember;
}
export enum ThreadMemberFlags {}
export enum ThreadMemberFlags {
/**
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
HasInteracted = 1 << 0,
/**
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
AllMessages = 1 << 1,
/**
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
OnlyMentions = 1 << 2,
/**
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
NoMessages = 1 << 3,
}
export interface APIThreadList {
/**
@@ -889,6 +1089,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',
}
/**
@@ -1164,7 +1370,7 @@ export interface APIBaseComponent<T extends ComponentType> {
}
/**
* https://discord.com/developers/docs/interactions/message-components#component-types
* https://discord.com/developers/docs/interactions/message-components#component-object-component-types
*/
export enum ComponentType {
/**
@@ -1176,13 +1382,38 @@ export enum ComponentType {
*/
Button,
/**
* Select Menu component
* Select menu for picking from defined text options
*/
SelectMenu,
StringSelect,
/**
* Text Input component
*/
TextInput,
/**
* Select menu for users
*/
UserSelect,
/**
* Select menu for roles
*/
RoleSelect,
/**
* Select menu for users and roles
*/
MentionableSelect,
/**
* Select menu for channels
*/
ChannelSelect,
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
/**
* Select menu for picking from defined text options
*
* @deprecated This is the old name for {@apilink ComponentType#StringSelect}
*/
SelectMenu = 3,
}
/**
@@ -1274,15 +1505,18 @@ export enum TextInputStyle {
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.SelectMenu> {
export interface APIBaseSelectMenuComponent<
T extends
| ComponentType.StringSelect
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect,
> extends APIBaseComponent<T> {
/**
* A developer-defined identifier for the select menu, max 100 characters
*/
custom_id: string;
/**
* The choices in the select, max 25
*/
options: APISelectMenuOption[];
/**
* Custom placeholder text if nothing is selected, max 150 characters
*/
@@ -1307,6 +1541,51 @@ export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.S
disabled?: boolean;
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APIStringSelectComponent extends APIBaseSelectMenuComponent<ComponentType.StringSelect> {
/**
* Specified choices in a select menu; max 25
*/
options: APISelectMenuOption[];
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIUserSelectComponent = APIBaseSelectMenuComponent<ComponentType.UserSelect>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIRoleSelectComponent = APIBaseSelectMenuComponent<ComponentType.RoleSelect>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APIMentionableSelectComponent = APIBaseSelectMenuComponent<ComponentType.MentionableSelect>;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export interface APIChannelSelectComponent extends APIBaseSelectMenuComponent<ComponentType.ChannelSelect> {
/**
* List of channel types to include in the ChannelSelect component
*/
channel_types?: ChannelType[];
}
/**
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APISelectMenuComponent =
| APIStringSelectComponent
| APIUserSelectComponent
| APIRoleSelectComponent
| APIMentionableSelectComponent
| APIChannelSelectComponent;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
*/
@@ -1375,7 +1654,39 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
*/
export enum ChannelFlags {
/**
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
GuildFeedRemoved = 1 << 0,
/**
* This thread is pinned to the top of its parent forum channel
*/
Pinned = 1 << 1,
/**
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
ActiveChannelsRemoved = 1 << 2,
/**
* 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,
/**
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
IsSpam = 1 << 5,
/**
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
IsGuildResourceChannel = 1 << 7,
/**
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
ClydeAI = 1 << 8,
/**
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
IsScheduledForDeletion = 1 << 9,
}
/**

View File

@@ -1,5 +1,7 @@
/**
* Types extracted from https://discord.com/developers/docs/topics/gateway
* Types extracted from
* - https://discord.com/developers/docs/topics/gateway
* - https://discord.com/developers/docs/topics/gateway-events
*/
import type { APIChannel, APIThreadMember } from './channel.ts';
@@ -58,7 +60,7 @@ export interface APIGatewaySessionStartLimit {
}
/**
* https://discord.com/developers/docs/topics/gateway#presence-update-presence-update-event-fields
* https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields
*/
export interface GatewayPresenceUpdate {
/**
@@ -81,13 +83,13 @@ export interface GatewayPresenceUpdate {
/**
* User's current activities
*
* See https://discord.com/developers/docs/topics/gateway#activity-object
* See https://discord.com/developers/docs/topics/gateway-events#activity-object
*/
activities?: GatewayActivity[];
/**
* User's platform-dependent status
*
* See https://discord.com/developers/docs/topics/gateway#client-status-object
* See https://discord.com/developers/docs/topics/gateway-events#client-status-object
*/
client_status?: GatewayPresenceClientStatus;
}
@@ -104,7 +106,7 @@ export enum PresenceUpdateStatus {
}
/**
* https://discord.com/developers/docs/topics/gateway#client-status-object
* https://discord.com/developers/docs/topics/gateway-events#client-status-object
*/
export interface GatewayPresenceClientStatus {
/**
@@ -122,7 +124,7 @@ export interface GatewayPresenceClientStatus {
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-structure
*/
export interface GatewayActivity {
/**
@@ -136,7 +138,7 @@ export interface GatewayActivity {
/**
* Activity type
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types
*/
type: ActivityType;
/**
@@ -171,26 +173,26 @@ export interface GatewayActivity {
/**
* The emoji used for a custom status
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji
*/
emoji?: GatewayActivityEmoji;
session_id?: string;
/**
* Information for the current party of the player
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
*/
party?: GatewayActivityParty;
/**
* Images for the presence and their hover texts
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets
*/
assets?: GatewayActivityAssets;
/**
* Secrets for Rich Presence joining and spectating
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets
*/
secrets?: GatewayActivitySecrets;
/**
@@ -200,7 +202,7 @@ export interface GatewayActivity {
/**
* Activity flags `OR`d together, describes what the payload includes
*
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags
*
* See https://en.wikipedia.org/wiki/Bit_field
*/
@@ -227,7 +229,7 @@ export enum ActivityPlatform {
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types
*/
export enum ActivityType {
/**
@@ -257,7 +259,7 @@ export enum ActivityType {
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-timestamps
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-timestamps
*/
export interface GatewayActivityTimestamps {
/**
@@ -271,12 +273,12 @@ export interface GatewayActivityTimestamps {
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji
*/
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'id' | 'animated'>> & Pick<APIEmoji, 'name'>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
*/
export interface GatewayActivityParty {
/**
@@ -290,19 +292,19 @@ export interface GatewayActivityParty {
}
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets
*/
export type GatewayActivityAssets = Partial<
Record<'large_image' | 'large_text' | 'small_image' | 'small_text', string>
>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets
*/
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags
*/
export enum ActivityFlags {
Instance = 1 << 0,
@@ -328,7 +330,7 @@ export interface GatewayActivityButton {
}
/**
* https://discord.com/developers/docs/topics/gateway#thread-list-sync-thread-list-sync-event-fields
* https://discord.com/developers/docs/topics/gateway-events#thread-list-sync-thread-list-sync-event-fields
*/
export interface GatewayThreadListSync {
/**
@@ -350,7 +352,7 @@ export interface GatewayThreadListSync {
}
/**
* https://discord.com/developers/docs/topics/gateway#thread-members-update-thread-members-update-event-fields
* https://discord.com/developers/docs/topics/gateway-events#thread-members-update-thread-members-update-event-fields
*/
export interface GatewayThreadMembersUpdate {
/**

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,9 +118,9 @@ 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;
afk_timeout: 60 | 300 | 900 | 1800 | 3600;
/**
* `true` if the guild widget is enabled
*/
@@ -235,11 +236,13 @@ export interface APIGuild extends APIPartialGuild {
*/
max_video_channel_users?: number;
/**
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
* Approximate number of members in this guild,
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
*/
approximate_member_count?: number;
/**
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
* Approximate number of non-offline members in this guild,
* returned from the `GET /guilds/<id>` and `/users/@me/guilds` (OAuth2) endpoints when `with_counts` is `true`
*/
approximate_presence_count?: number;
/**
@@ -381,6 +384,16 @@ export enum GuildFeature {
* Guild has access to set an animated guild icon
*/
AnimatedIcon = 'ANIMATED_ICON',
/**
* Guild is using the old permissions configuration behavior
*
* See https://discord.com/developers/docs/change-log#upcoming-application-command-permission-changes
*/
ApplicationCommandPermissionsV2 = 'APPLICATION_COMMAND_PERMISSIONS_V2',
/**
* Guild has set up auto moderation rules
*/
AutoModeration = 'AUTO_MODERATION',
/**
* Guild has access to set a guild banner image
*/
@@ -389,6 +402,18 @@ export enum GuildFeature {
* Guild can enable welcome screen, Membership Screening and discovery, and receives community updates
*/
Community = 'COMMUNITY',
/**
* Guild has enabled monetization
*/
CreatorMonetizableProvisional = 'CREATOR_MONETIZABLE_PROVISIONAL',
/**
* Guild has enabled the role subscription promo page
*/
CreatorStorePage = 'CREATOR_STORE_PAGE',
/*
* Guild has been set as a support server on the App Directory
*/
DeveloperSupportServer = 'DEVELOPER_SUPPORT_SERVER',
/**
* Guild is able to be discovered in the directory
*/
@@ -404,11 +429,15 @@ export enum GuildFeature {
/**
* Guild is a Student Hub
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
* See https://support.discord.com/hc/articles/4406046651927
*
* @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
*/
@@ -416,7 +445,7 @@ export enum GuildFeature {
/**
* Guild is in a Student Hub
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
* See https://support.discord.com/hc/articles/4406046651927
*
* @unstable This feature is currently not documented by Discord, but has known value
*/
@@ -427,6 +456,8 @@ export enum GuildFeature {
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
/**
* Guild has enabled monetization
*
* @unstable This feature is no longer documented by Discord
*/
MonetizationEnabled = 'MONETIZATION_ENABLED',
/**
@@ -454,6 +485,14 @@ export enum GuildFeature {
* Guild is able to set role icons
*/
RoleIcons = 'ROLE_ICONS',
/**
* Guild has role subscriptions that can be purchased
*/
RoleSubscriptionsAvailableForPurchase = 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE',
/**
* Guild has enabled role subscriptions
*/
RoleSubscriptionsEnabled = 'ROLE_SUBSCRIPTIONS_ENABLED',
/**
* Guild has enabled ticketed events
*/
@@ -583,7 +622,7 @@ export interface APIGuildMember {
/**
* When the user started boosting the guild
*
* See https://support.discord.com/hc/en-us/articles/360028038352-Server-Boosting-
* See https://support.discord.com/hc/articles/360028038352
*/
premium_since?: string | null;
/**
@@ -594,6 +633,10 @@ export interface APIGuildMember {
* Whether the user is muted in voice channels
*/
mute: boolean;
/**
* Guild member flags represented as a bit set, defaults to `0`
*/
flags: GuildMemberFlags;
/**
* Whether the user has not yet passed the guild's Membership Screening requirements
*
@@ -606,6 +649,44 @@ export interface APIGuildMember {
communication_disabled_until?: string | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-flags
*/
export enum GuildMemberFlags {
/**
* Member has left and rejoined the guild
*/
DidRejoin = 1 << 0,
/**
* Member has completed onboarding
*/
CompletedOnboarding = 1 << 1,
/**
* Member bypasses guild verification requirements
*/
BypassesVerification = 1 << 2,
/**
* Member has started onboarding
*/
StartedOnboarding = 1 << 3,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
StartedHomeActions = 1 << 5,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
CompletedHomeActions = 1 << 6,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
AutomodQuarantinedUsernameOrGuildNickname = 1 << 7,
/**
* @unstable This guild member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
AutomodQuarantinedBio = 1 << 8,
}
/**
* https://discord.com/developers/docs/resources/guild#integration-object
*/
@@ -625,7 +706,7 @@ export interface APIGuildIntegration {
/**
* Is this integration enabled
*/
enabled?: boolean;
enabled: boolean;
/**
* Is this integration syncing
*
@@ -661,7 +742,7 @@ export interface APIGuildIntegration {
/**
* User for this integration
*
* **This field is not provided for `discord` bot integrations.**
* **Some older integrations may not have an attached user.**
*
* See https://discord.com/developers/docs/resources/user#user-object
*/
@@ -698,9 +779,13 @@ 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';
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription';
/**
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
@@ -769,7 +854,7 @@ export interface APIBan {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object
*/
export interface APIGuildWidget {
id: Snowflake;
@@ -781,7 +866,7 @@ export interface APIGuildWidget {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetChannel {
id: Snowflake;
@@ -790,7 +875,7 @@ export interface APIGuildWidgetChannel {
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-guild-widget
*/
export interface APIGuildWidgetMember {
id: string;

View File

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

View File

@@ -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

@@ -61,6 +61,10 @@ export enum OAuth2Scopes {
* (otherwise restricted to channels/guilds your app creates)
*/
MessagesRead = 'messages.read',
/**
* Allows your app to update a user's connection and metadata for the app
*/
RoleConnectionsWrite = 'role_connections.write',
/**
* For local rpc server access, this allows you to control a user's local Discord client - requires Discord approval
*/

View File

@@ -72,4 +72,16 @@ export interface APIRoleTags {
* The id of the integration this role belongs to
*/
integration_id?: Snowflake;
/**
* The id of this role's subscription sku and listing
*/
subscription_listing_id?: Snowflake;
/**
* Whether this role is available for purchase
*/
available_for_purchase?: null;
/**
* Whether this role is a guild's linked role
*/
guild_connections?: null;
}

View File

@@ -73,7 +73,7 @@ export enum StickerType {
*/
Standard = 1,
/**
* A sticker uploaded to a Boosted guild for the guild's members
* A sticker uploaded to a guild for the guild's members
*/
Guild,
}
@@ -85,6 +85,7 @@ export enum StickerFormatType {
PNG = 1,
APNG,
Lottie,
GIF,
}
/**

View File

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

View File

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

View File

@@ -101,6 +101,14 @@ export enum UserFlags {
* Bug Hunter Level 1
*/
BugHunterLevel1 = 1 << 3,
/**
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
MFASMS = 1 << 4,
/**
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
PremiumPromoDismissed = 1 << 5,
/**
* House Bravery Member
*/
@@ -121,6 +129,10 @@ export enum UserFlags {
* User is a [team](https://discord.com/developers/docs/topics/teams)
*/
TeamPseudoUser = 1 << 10,
/**
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
HasUnreadUrgentMessages = 1 << 13,
/**
* Bug Hunter Level 2
*/
@@ -134,7 +146,7 @@ export enum UserFlags {
*/
VerifiedDeveloper = 1 << 17,
/**
* Discord Certified Moderator
* Moderator Programs Alumni
*/
CertifiedModerator = 1 << 18,
/**
@@ -148,11 +160,39 @@ export enum UserFlags {
*/
Spammer = 1 << 20,
/**
* User's account has been quarantined based on recent activity
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*/
Quarantined = Math.pow(2, 44),
DisablePremium = 1 << 21,
/**
* User is an [Active Developer](https://support-dev.discord.com/hc/articles/10113997751447)
*/
ActiveDeveloper = 1 << 22,
/**
* User's account has been [quarantined](https://support.discord.com/hc/articles/6461420677527) based on recent activity
*
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*
* @privateRemarks
*
* This value would be 1 << 44, but bit shifting above 1 << 30 requires bigints
*/
Quarantined = 17592186044416,
/**
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*
* @privateRemarks
*
* This value would be 1 << 50, but bit shifting above 1 << 30 requires bigints
*/
Collaborator = 1125899906842624,
/**
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
*
* @privateRemarks
*
* This value would be 1 << 51, but bit shifting above 1 << 30 requires bigints
*/
RestrictedCollaborator = 2251799813685248,
}
/**
@@ -162,6 +202,7 @@ export enum UserPremiumType {
None,
NitroClassic,
Nitro,
NitroBasic,
}
/**
@@ -204,6 +245,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,16 +259,20 @@ export interface APIConnection {
export enum ConnectionService {
BattleNet = 'battlenet',
eBay = 'ebay',
EpicGames = 'epicgames',
Facebook = 'facebook',
GitHub = 'github',
Instagram = 'instagram',
LeagueOfLegends = 'leagueoflegends',
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
SamsungGalaxy = 'samsunggalaxy',
RiotGames = 'riotgames',
PayPal = 'paypal',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',
TikTok = 'tiktok',
Twitch = 'twitch',
Twitter = 'twitter',
Xbox = 'xbox',
@@ -240,3 +289,21 @@ export enum ConnectionVisibility {
*/
Everyone,
}
/**
* https://discord.com/developers/docs/resources/user#application-role-connection-object-application-role-connection-structure
*/
export interface APIApplicationRoleConnection {
/**
* The vanity name of the platform a bot has connected (max 50 characters)
*/
platform_name: string | null;
/**
* The username on the platform a bot has connected (max 100 characters)
*/
platform_username: string | null;
/**
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
*/
metadata: Record<string, string | number>;
}

View File

@@ -89,6 +89,7 @@ export enum RESTJSONErrorCodes {
MaximumNumberOfEmojisReached,
MaximumNumberOfReactionsReached = 30010,
MaximumNumberOfGroupDMsReached,
MaximumNumberOfGuildChannelsReached = 30013,
@@ -102,7 +103,7 @@ export enum RESTJSONErrorCodes {
GuildAlreadyHasTemplate = 30031,
MaximumNumberOfApplicationCommandsReached,
MaximumThreadParticipants,
MaximumThreadParticipantsReached,
MaximumDailyApplicationCommandCreatesReached,
MaximumNumberOfNonGuildMemberBansHasBeenExceeded,
@@ -120,6 +121,13 @@ export enum RESTJSONErrorCodes {
BitrateIsTooHighForChannelOfThisType = 30052,
MaximumNumberOfPremiumEmojisReached = 30056,
MaximumNumberOfWebhooksPerGuildReached = 30058,
MaximumNumberOfChannelPermissionOverwritesReached = 30060,
TheChannelsForThisGuildAreTooLarge,
Unauthorized = 40001,
VerifyYourAccount,
OpeningDirectMessagesTooFast,
@@ -137,8 +145,14 @@ export enum RESTJSONErrorCodes {
ApplicationInteractionFailedToSend = 40043,
CannotSendAMessageInAForumChannel = 40058,
InteractionHasAlreadyBeenAcknowledged = 40060,
TagNamesMustBeUnique,
ServiceResourceIsBeingRateLimited,
ThereAreNoTagsAvailableThatCanBeSetByNonModerators = 40066,
TagRequiredToCreateAForumPostInThisChannel,
MissingAccess = 50001,
InvalidAccountType,
@@ -174,6 +188,8 @@ export enum RESTJSONErrorCodes {
InvalidFormBodyOrContentType,
InviteAcceptedToGuildWithoutTheBotBeingIn,
InvalidActivityAction = 50039,
InvalidAPIVersion = 50041,
FileUploadedExceedsMaximumSize = 50045,
@@ -182,11 +198,13 @@ export enum RESTJSONErrorCodes {
CannotSelfRedeemThisGift = 50054,
InvalidGuild,
InvalidMessageType = 50068,
InvalidRequestOrigin = 50067,
InvalidMessageType,
PaymentSourceRequiredToRedeemGift = 50070,
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
CannotModifyASystemWebhook = 50073,
CannotDeleteChannelRequiredForCommunityGuilds,
CannotEditStickersWithinMessage = 50080,
InvalidStickerSent,
@@ -196,6 +214,8 @@ export enum RESTJSONErrorCodes {
ParameterEarlierThanCreation,
CommunityServerChannelsMustBeTextChannels,
TheEntityTypeOfTheEventIsDifferentFromTheEntityYouAreTryingToStartTheEventFor = 50091,
ServerNotAvailableInYourLocation = 50095,
ServerNeedsMonetizationEnabledToPerformThisAction = 50097,
@@ -208,7 +228,9 @@ export enum RESTJSONErrorCodes {
FailedToResizeAssetBelowTheMinimumSize = 50138,
UploadedFileNotFound = 50146,
CannotMixSubscriptionAndNonSubscriptionRolesForAnEmoji = 50144,
CannotConvertBetweenPremiumEmojiAndNormalEmoji,
UploadedFileNotFound,
YouDoNotHavePermissionToSendThisSticker = 50600,
@@ -246,13 +268,19 @@ export enum RESTJSONErrorCodes {
MessageWasBlockedByAutomaticModeration = 200000,
TitleWasBlockedByAutomaticModeration,
WebhooksCanOnlyCreateThreadsInForumChannels = 220003,
WebhooksPostedToForumChannelsMustHaveAThreadNameOrThreadId = 220001,
WebhooksPostedToForumChannelsCannotHaveBothAThreadNameAndThreadId,
WebhooksCanOnlyCreateThreadsInForumChannels,
WebhookServicesCannotBeUsedInForumChannels,
MessageBlockedByHarmfulLinksFilter = 240000,
}
/**
* https://discord.com/developers/docs/reference#locales
*/
export enum Locale {
Indonesian = 'id',
EnglishUS = 'en-US',
EnglishGB = 'en-GB',
Bulgarian = 'bg',

View File

@@ -0,0 +1,16 @@
import type { APIApplicationRoleConnectionMetadata } from '../../payloads/v10/application.ts';
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
*/
export type RESTGetAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
*/
export type RESTPutAPIApplicationRoleConnectionMetadataJSONBody = APIApplicationRoleConnectionMetadata[];
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
*/
export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];

View File

@@ -17,6 +17,10 @@ export interface RESTGetAPIAuditLogQuery {
* Filter the log before a certain entry ID
*/
before?: Snowflake;
/**
* Filter the log after a certain entry ID
*/
after?: Snowflake;
/**
* How many entries are returned (default 50, minimum 1, maximum 100)
*

View File

@@ -0,0 +1,83 @@
import type { Snowflake } from '../../globals.ts';
import type {
APIAutoModerationAction,
APIAutoModerationRule,
AutoModerationRuleEventType,
APIAutoModerationRuleTriggerMetadata,
AutoModerationRuleTriggerType,
} from '../../payloads/v10/mod.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 interface RESTPostAPIAutoModerationRuleJSONBody {
/**
* 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 | undefined;
/**
* The actions which will execute when this rule is triggered
*/
actions: APIAutoModerationAction[];
/**
* Whether this rule is enabled
*
* @default false
*/
enabled?: boolean | undefined;
/**
* The role ids that shouldn't be affected by this rule (Maximum of 20)
*/
exempt_roles?: Snowflake[] | undefined;
/**
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
*/
exempt_channels?: Snowflake[] | undefined;
}
/**
* 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,10 @@ import type {
OverwriteType,
ThreadAutoArchiveDuration,
VideoQualityMode,
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
ForumLayoutType,
} from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
@@ -34,13 +38,13 @@ export type RESTGetAPIChannelResult = APIChannel;
/**
* https://discord.com/developers/docs/resources/channel#modify-channel
*/
export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIChannelJSONBody {
/**
* 1-100 character channel name
*
* Channel types: all
*/
name?: string;
name?: string | undefined;
/**
* The type of channel; only conversion between `text` and `news`
@@ -48,100 +52,131 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*
* Channel types: text, news
*/
type?: ChannelType.GuildNews | ChannelType.GuildText;
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText | undefined;
/**
* The position of the channel in the left-hand listing
*
* Channel types: all excluding newsThread, publicThread, privateThread
*/
position?: number | null;
position?: number | null | undefined;
/**
* 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;
topic?: string | null | undefined;
/**
* Whether the channel is nsfw
*
* Channel types: text, voice, news
* Channel types: text, voice, news, forum
*/
nsfw?: boolean | null;
nsfw?: boolean | null | undefined;
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
* are unaffected
*
* Channel types: text, newsThread, publicThread, privateThread
* Channel types: text, newsThread, publicThread, privateThread, forum
*/
rate_limit_per_user?: number | null;
rate_limit_per_user?: number | null | undefined;
/**
* The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers)
*
* Channel types: voice
*/
bitrate?: number | null;
bitrate?: number | null | undefined;
/**
* The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit
*
* Channel types: voice
*/
user_limit?: number | null;
user_limit?: number | null | undefined;
/**
* Channel or category-specific permissions
*
* Channel types: all excluding newsThread, publicThread, privateThread
*/
permission_overwrites?: APIChannelPatchOverwrite[] | null;
permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined;
/**
* ID of the new parent category for a channel
*
* Channel types: text, voice, news
*/
parent_id?: Snowflake | null;
parent_id?: Snowflake | null | undefined;
/**
* Voice region id for the voice or stage channel, automatic when set to `null`
*
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
rtc_region?: string | null;
rtc_region?: string | null | undefined;
/**
* The camera video quality mode of the voice channel
*
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
*/
video_quality_mode?: VideoQualityMode | null;
video_quality_mode?: VideoQualityMode | null | undefined;
/**
* Whether the thread should be archived
*
* Channel types: newsThread, publicThread, privateThread
*/
archived?: boolean;
archived?: boolean | undefined;
/**
* The amount of time in minutes to wait before automatically archiving the thread
*
* Channel types: newsThread, publicThread, privateThread
*/
auto_archive_duration?: ThreadAutoArchiveDuration;
auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
/**
* Whether the thread should be locked
*
* Channel types: newsThread, publicThread, privateThread
*/
locked?: boolean;
locked?: boolean | undefined;
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*
* Channel types: text, news
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration;
default_auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread
*
* Channel types: privateThread
*/
invitable?: boolean;
}>;
invitable?: boolean | undefined;
/**
* The set of tags that can be used in a forum channel; limited to 20
*
* Channel types: forum
*/
available_tags?: APIGuildForumTag[] | undefined;
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*
* Channel types: forum
*/
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji | undefined;
/**
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
* This field is copied to the thread at creation time and does not live update
*
* Channel types: forum
*/
default_thread_rate_limit_per_user?: number | null | undefined;
/**
* The default sort order type used to order posts in a forum channel
*
* Channel types: forum
*/
default_sort_order?: SortOrderType | null | undefined;
/**
* The default layout type used to display posts in a forum channel
*
* Channel types: forum
*/
default_forum_layout?: ForumLayoutType | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#modify-channel
@@ -191,71 +226,70 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
Required<Pick<APIMessageReference, 'message_id'>> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Required<Pick<APIMessageReference, 'message_id'>>> & {
/**
* Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message
*
* @default true
*/
fail_if_not_exists?: boolean;
}>;
fail_if_not_exists?: boolean | undefined;
};
/**
* https://discord.com/developers/docs/resources/channel#create-message
*/
export type RESTPostAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIChannelMessageJSONBody {
/**
* The message contents (up to 2000 characters)
*/
content?: string;
content?: string | undefined;
/**
* A nonce that can be used for optimistic message sending
*/
nonce?: number | string;
nonce?: number | string | undefined;
/**
* `true` if this is a TTS message
*/
tts?: boolean;
tts?: boolean | undefined;
/**
* Embedded `rich` content (up to 6000 characters)
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*/
embeds?: APIEmbed[];
embeds?: APIEmbed[] | undefined;
/**
* Allowed mentions for a message
*
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
*/
allowed_mentions?: APIAllowedMentions;
allowed_mentions?: APIAllowedMentions | undefined;
/**
* Include to make your message a reply
*
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
message_reference?: APIMessageReferenceSend;
message_reference?: APIMessageReferenceSend | undefined;
/**
* The components to include with the message
*
* See https://discord.com/developers/docs/interactions/message-components#component-object
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
/**
* IDs of up to 3 stickers in the server to send in the message
*
* See https://discord.com/developers/docs/resources/sticker#sticker-object
*/
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake];
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined;
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
/**
* Message flags combined as a bitfield
*/
flags?: MessageFlags;
}>;
flags?: MessageFlags | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#create-message
@@ -265,7 +299,7 @@ export type RESTPostAPIChannelMessageFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
@@ -328,17 +362,17 @@ export type RESTDeleteAPIChannelMessageReactionResult = never;
/**
* https://discord.com/developers/docs/resources/channel#edit-message
*/
export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIChannelMessageJSONBody {
/**
* The new message contents (up to 2000 characters)
*/
content?: string | null;
content?: string | null | undefined;
/**
* Embedded `rich` content (up to 6000 characters)
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*/
embeds?: APIEmbed[] | null;
embeds?: APIEmbed[] | null | undefined;
/**
* Edit the flags of a message (only `SUPPRESS_EMBEDS` can currently be set/unset)
*
@@ -347,13 +381,13 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-flags
*/
flags?: MessageFlags | null;
flags?: MessageFlags | null | undefined;
/**
* Allowed mentions for the message
*
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
*/
allowed_mentions?: APIAllowedMentions | null;
allowed_mentions?: APIAllowedMentions | null | undefined;
/**
* Attached files to keep
*
@@ -361,14 +395,14 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
/**
* The components to include with the message
*
* See https://discord.com/developers/docs/interactions/message-components#component-object
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null;
}>;
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#edit-message
@@ -378,7 +412,7 @@ export type RESTPatchAPIChannelMessageFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
@@ -418,7 +452,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
*
* @default "0"
*/
allow?: Permissions | null;
allow?: Permissions | null | undefined;
/**
* The bitwise value of all disallowed permissions
*
@@ -426,7 +460,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
*
* @default "0"
*/
deny?: Permissions | null;
deny?: Permissions | null | undefined;
/**
* `0` for a role or `1` for a member
*/
@@ -446,51 +480,51 @@ export type RESTGetAPIChannelInvitesResult = APIExtendedInvite[];
/**
* https://discord.com/developers/docs/resources/channel#create-channel-invite
*/
export type RESTPostAPIChannelInviteJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIChannelInviteJSONBody {
/**
* Duration of invite in seconds before expiry, or 0 for never
*
* @default 86400 (24 hours)
*/
max_age?: number;
max_age?: number | undefined;
/**
* Max number of uses or 0 for unlimited
*
* @default 0
*/
max_uses?: number;
max_uses?: number | undefined;
/**
* Whether this invite only grants temporary membership
*
* @default false
*/
temporary?: boolean;
temporary?: boolean | undefined;
/**
* If true, don't try to reuse a similar invite
* (useful for creating many unique one time use invites)
*
* @default false
*/
unique?: boolean;
unique?: boolean | undefined;
/**
* The type of target for this voice channel invite
*
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
*/
target_type?: InviteTargetType;
target_type?: InviteTargetType | undefined;
/**
* The id of the user whose stream to display for this invite
* - Required if `target_type` is 1
* - The user must be streaming in the channel
*/
target_user_id?: Snowflake;
target_user_id?: Snowflake | undefined;
/**
* The id of the embedded application to open for this invite
* - Required if `target_type` is 2
* - The application must have the `EMBEDDED` flag
*/
target_application_id?: Snowflake;
}>;
target_application_id?: Snowflake | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#create-channel-invite
@@ -540,7 +574,7 @@ export type RESTDeleteAPIChannelPinResult = never;
/**
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
*/
export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPutAPIChannelRecipientJSONBody {
/**
* Access token of a user that has granted your app the `gdm.join` scope
*/
@@ -548,8 +582,8 @@ export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefined
/**
* Nickname of the user being added
*/
nick?: string;
}>;
nick?: string | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
@@ -564,7 +598,7 @@ export type RESTDeleteAPIChannelRecipientResult = unknown;
/**
* https://discord.com/developers/docs/resources/channel#start-thread-from-message
*/
export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIChannelMessagesThreadsJSONBody {
/**
* 1-100 character thread name
*/
@@ -578,8 +612,8 @@ export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUn
/**
* Amount of seconds a user has to wait before sending another message (0-21600)
*/
rate_limit_per_user?: number;
}>;
rate_limit_per_user?: number | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
@@ -589,6 +623,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; limited to 5
*/
applied_tags?: Snowflake[] | undefined;
};
/**
@@ -609,24 +647,23 @@ export type RESTPostAPIChannelMessagesThreadsResult = APIChannel;
/**
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
*/
export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* The type of thread to create
*
* In API v9 and v10, `type` defaults to `PRIVATE_THREAD`.
* In a future API version this will be changed to be a required field, with no default.
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*
* @default ChannelType.GuildPrivateThread
*/
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/
invitable?: boolean;
}>;
export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMessagesThreadsJSONBody {
/**
* The type of thread to create
*
* In API v9 and v10, `type` defaults to `PRIVATE_THREAD`.
* In a future API version this will be changed to be a required field, with no default.
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*
* @default ChannelType.PrivateThread
*/
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/
invitable?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
@@ -643,6 +680,39 @@ export type RESTPutAPIChannelThreadMembersResult = never;
*/
export type RESTDeleteAPIChannelThreadMembersResult = never;
/**
* https://discord.com/developers/docs/resources/channel#get-thread-member
*/
export interface RESTGetAPIChannelThreadMemberQuery {
/**
* Whether to include a guild member object for the thread member
*/
with_member?: boolean;
}
/**
* https://discord.com/developers/docs/resources/channel#get-thread-member
*/
export type RESTGetAPIChannelThreadMemberResult = APIThreadMember;
/**
* https://discord.com/developers/docs/resources/channel#list-thread-members
*/
export interface RESTGetAPIChannelThreadMembersQuery {
/**
* Whether to include a guild member object for each thread member
*/
with_member?: boolean;
/**
* Get thread members after this user ID
*/
after?: Snowflake;
/**
* Max number of thread members to return (1-100). Defaults to 100
*/
limit?: number;
}
/**
* https://discord.com/developers/docs/resources/channel#list-thread-members
*/
@@ -662,7 +732,22 @@ export interface RESTGetAPIChannelThreadsArchivedQuery {
limit?: number;
}
/**
* https://discord.com/developers/docs/resources/channel#list-public-archived-threads
*/
export type RESTGetAPIChannelThreadsArchivedPublicResult = RESTGetAPIChannelUsersThreadsArchivedResult;
/**
* https://discord.com/developers/docs/resources/channel#list-private-archived-threads
*/
export type RESTGetAPIChannelThreadsArchivedPrivateResult = RESTGetAPIChannelUsersThreadsArchivedResult;
/**
* https://discord.com/developers/docs/resources/channel#list-joined-private-archived-threads
*/
export type RESTGetAPIChannelUsersThreadsArchivedResult = APIThreadList;
export interface RESTGetAPIChannelUsersThreadsArchivedResult extends APIThreadList {
/**
* Whether there are potentially additional threads
*/
has_more: boolean;
}

View File

@@ -1,6 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { APIEmoji } from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/emoji#list-guild-emojis
@@ -15,7 +14,7 @@ export type RESTGetAPIGuildEmojiResult = APIEmoji;
/**
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params
*/
export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildEmojiJSONBody {
/**
* Name of the emoji
*/
@@ -29,8 +28,8 @@ export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPrope
/**
* Roles for which this emoji will be whitelisted
*/
roles?: Snowflake[];
}>;
roles?: Snowflake[] | undefined;
}
/**
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji
@@ -40,16 +39,16 @@ export type RESTPostAPIGuildEmojiResult = APIEmoji;
/**
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
*/
export type RESTPatchAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildEmojiJSONBody {
/**
* Name of the emoji
*/
name?: string;
name?: string | undefined;
/**
* Roles for which this emoji will be whitelisted
*/
roles?: Snowflake[] | null;
}>;
roles?: Snowflake[] | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji

View File

@@ -26,7 +26,6 @@ import type {
GuildWidgetStyle,
} from '../../payloads/v10/mod.ts';
import type {
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
DistributiveOmit,
DistributivePick,
Nullable,
@@ -53,14 +52,18 @@ export type APIGuildCreatePartialChannel = StrictPartial<
| 'rtc_region'
| 'video_quality_mode'
| 'flags'
| 'default_reaction_emoji'
| 'available_tags'
| 'default_sort_order'
| 'default_forum_layout'
| 'default_thread_rate_limit_per_user'
>
> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
name: string;
id?: number | string;
parent_id?: number | string | null;
permission_overwrites?: APIGuildCreateOverwrite[];
}>;
> & {
name: string;
id?: number | string | undefined;
parent_id?: number | string | null | undefined;
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
};
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
id: number | string;
@@ -69,7 +72,7 @@ export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
/**
* https://discord.com/developers/docs/resources/guild#create-guild
*/
export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildsJSONBody {
/**
* Name of the guild (2-100 characters)
*/
@@ -79,31 +82,31 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
region?: string;
region?: string | undefined;
/**
* base64 1024x1024 png/jpeg image for the guild icon
*
* See https://discord.com/developers/docs/reference#image-data
*/
icon?: string;
icon?: string | undefined;
/**
* Verification level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
*/
verification_level?: GuildVerificationLevel;
verification_level?: GuildVerificationLevel | undefined;
/**
* Default message notification level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
*/
default_message_notifications?: GuildDefaultMessageNotifications;
default_message_notifications?: GuildDefaultMessageNotifications | undefined;
/**
* Explicit content filter level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
*/
explicit_content_filter?: GuildExplicitContentFilter;
explicit_content_filter?: GuildExplicitContentFilter | undefined;
/**
* New guild roles
*
@@ -116,7 +119,7 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*
* See https://discord.com/developers/docs/topics/permissions#role-object
*/
roles?: APIGuildCreateRole[];
roles?: APIGuildCreateRole[] | undefined;
/**
* New guild's channels
*
@@ -129,30 +132,30 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
channels?: APIGuildCreatePartialChannel[];
channels?: APIGuildCreatePartialChannel[] | undefined;
/**
* ID for afk channel
*/
afk_channel_id?: number | Snowflake | null;
afk_channel_id?: number | Snowflake | null | undefined;
/**
* AFK timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: number;
afk_timeout?: 60 | 300 | 900 | 1800 | 3600 | undefined;
/**
* The id of the channel where guild notices such as welcome messages and boost events are posted
*/
system_channel_id?: number | Snowflake | null;
system_channel_id?: number | Snowflake | null | undefined;
/**
* System channel flags
*
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
*/
system_channel_flags?: GuildSystemChannelFlags;
system_channel_flags?: GuildSystemChannelFlags | undefined;
/**
* Whether the boosts progress bar should be enabled.
*/
premium_progress_bar_enabled?: boolean;
}>;
premium_progress_bar_enabled?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#create-guild
@@ -201,106 +204,106 @@ export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild
*/
export type RESTPatchAPIGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildJSONBody {
/**
* New name for the guild (2-100 characters)
*/
name?: string;
name?: string | undefined;
/**
* Voice region id
*
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
region?: string | null;
region?: string | null | undefined;
/**
* Verification level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
*/
verification_level?: GuildVerificationLevel | null;
verification_level?: GuildVerificationLevel | null | undefined;
/**
* Default message notification level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
*/
default_message_notifications?: GuildDefaultMessageNotifications | null;
default_message_notifications?: GuildDefaultMessageNotifications | null | undefined;
/**
* Explicit content filter level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
*/
explicit_content_filter?: GuildExplicitContentFilter | null;
explicit_content_filter?: GuildExplicitContentFilter | null | undefined;
/**
* ID for afk channel
*/
afk_channel_id?: Snowflake | null;
afk_channel_id?: Snowflake | null | undefined;
/**
* AFK timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: number;
afk_timeout?: 60 | 300 | 900 | 1800 | 3600 | undefined;
/**
* base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature)
*
* See https://discord.com/developers/docs/reference#image-data
*/
icon?: string | null;
icon?: string | null | undefined;
/**
* User id to transfer guild ownership to (must be owner)
*/
owner_id?: Snowflake;
owner_id?: Snowflake | undefined;
/**
* base64 16:9 png/jpeg image for the guild splash (when the guild has `INVITE_SPLASH` feature)
*
* See https://discord.com/developers/docs/reference#image-data
*/
splash?: string | null;
splash?: string | null | undefined;
/**
* base64 png/jpeg image for the guild discovery splash (when the guild has `DISCOVERABLE` feature)
*/
discovery_splash?: string | null;
discovery_splash?: string | null | undefined;
/**
* base64 16:9 png/jpeg image for the guild banner (when the server has the `BANNER` feature; can be animated gif when the server has the `ANIMATED_BANNER` feature)
*/
banner?: string | null;
banner?: string | null | undefined;
/**
* The id of the channel where guild notices such as welcome messages and boost events are posted
*/
system_channel_id?: Snowflake | null;
system_channel_id?: Snowflake | null | undefined;
/**
* System channel flags
*
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
*/
system_channel_flags?: GuildSystemChannelFlags;
system_channel_flags?: GuildSystemChannelFlags | undefined;
/**
* The id of the channel where Community guilds display rules and/or guidelines
*/
rules_channel_id?: Snowflake | null;
rules_channel_id?: Snowflake | null | undefined;
/**
* The id of the channel where admins and moderators of Community guilds receive notices from Discord
*/
public_updates_channel_id?: Snowflake | null;
public_updates_channel_id?: Snowflake | null | undefined;
/**
* The preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US"
*
* @default "en-US" (if the value is set to `null`)
*/
preferred_locale?: string | null;
preferred_locale?: string | null | undefined;
/**
* Enabled guild features
*
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
*/
features?: GuildFeature[];
features?: GuildFeature[] | undefined;
/**
* The description for the guild
*/
description?: string | null;
description?: string | null | undefined;
/**
* Whether the boosts progress bar should be enabled.
*/
premium_progress_bar_enabled?: boolean;
}>;
premium_progress_bar_enabled?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-guild
@@ -330,26 +333,24 @@ export type RESTPostAPIGuildChannelResult = APIChannel;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
*/
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Channel id
*/
id: Snowflake;
/**
* Sorting position of the channel
*/
position: number;
/**
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
*/
lock_permissions?: boolean;
/**
* The new parent id of this channel
*/
parent_id?: Snowflake | null;
}>
>;
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
/**
* Channel id
*/
id: Snowflake;
/**
* Sorting position of the channel
*/
position: number;
/**
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
*/
lock_permissions?: boolean | undefined;
/**
* The new parent id of this channel
*/
parent_id?: Snowflake | null | undefined;
}>;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
@@ -357,7 +358,7 @@ export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
export type RESTPatchAPIGuildChannelPositionsResult = never;
/**
* https://discord.com/developers/docs/resources/guild#list-active-threads
* https://discord.com/developers/docs/resources/guild#list-active-guild-threads
*/
export type RESTGetAPIGuildThreadsResult = APIThreadList;
@@ -410,7 +411,7 @@ export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
/**
* https://discord.com/developers/docs/resources/guild#add-guild-member
*/
export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPutAPIGuildMemberJSONBody {
/**
* An oauth2 access token granted with the `guilds.join` to the bot's application for the user you want to add to the guild
*/
@@ -420,68 +421,68 @@ export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPrope
*
* Requires `MANAGE_NICKNAMES` permission
*/
nick?: string;
nick?: string | undefined;
/**
* Array of role ids the member is assigned
*
* Requires `MANAGE_ROLES` permission
*/
roles?: Snowflake[];
roles?: Snowflake[] | undefined;
/**
* Whether the user is muted in voice channels
*
* Requires `MUTE_MEMBERS` permission
*/
mute?: boolean;
mute?: boolean | undefined;
/**
* Whether the user is deafened in voice channels
*
* Requires `DEAFEN_MEMBERS` permission
*/
deaf?: boolean;
}>;
deaf?: boolean | undefined;
}
export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-member
*/
export type RESTPatchAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildMemberJSONBody {
/**
* Value to set users nickname to
*
* Requires `MANAGE_NICKNAMES` permission
*/
nick?: string | null;
nick?: string | null | undefined;
/**
* Array of role ids the member is assigned
*
* Requires `MANAGE_ROLES` permission
*/
roles?: Snowflake[] | null;
roles?: Snowflake[] | null | undefined;
/**
* Whether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channel
*
* Requires `MUTE_MEMBERS` permission
*/
mute?: boolean | null;
mute?: boolean | null | undefined;
/**
* Whether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channel
*
* Requires `DEAFEN_MEMBERS` permission
*/
deaf?: boolean | null;
deaf?: boolean | null | undefined;
/**
* ID of channel to move user to (if they are connected to voice)
*
* Requires `MOVE_MEMBERS` permission
*/
channel_id?: Snowflake | null;
channel_id?: Snowflake | null | undefined;
/**
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
*/
communication_disabled_until?: string | null;
}>;
communication_disabled_until?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#add-guild-member
@@ -493,26 +494,26 @@ export type RESTPatchAPIGuildMemberResult = APIGuildMember;
*
* @deprecated Use [Modify Current Member](https://discord.com/developers/docs/resources/guild#modify-current-member) instead.
*/
export type RESTPatchAPICurrentGuildMemberNicknameJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
/**
* Value to set users nickname to
*
* Requires `CHANGE_NICKNAME` permission
*/
nick?: string | null;
}>;
nick?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-current-member
*/
export type RESTPatchAPICurrentGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPICurrentGuildMemberJSONBody {
/**
* Value to set users nickname to
*
* Requires `CHANGE_NICKNAME` permission
*/
nick?: string | null;
}>;
nick?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-nick
@@ -570,12 +571,18 @@ export type RESTGetAPIGuildBanResult = APIBan;
/**
* https://discord.com/developers/docs/resources/guild#create-guild-ban
*/
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPutAPIGuildBanJSONBody {
/**
* Number of days to delete messages for (0-7)
*
* @deprecated use `delete_message_seconds` instead
*/
delete_message_days?: number;
}>;
delete_message_days?: number | undefined;
/**
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
*/
delete_message_seconds?: number | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#create-guild-ban
@@ -595,46 +602,46 @@ export type RESTGetAPIGuildRolesResult = APIRole[];
/**
* https://discord.com/developers/docs/resources/guild#create-guild-role
*/
export type RESTPostAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildRoleJSONBody {
/**
* Name of the role
*
* @default "new role"
*/
name?: string | null;
name?: string | null | undefined;
/**
* Bitwise value of the enabled/disabled permissions
*
* @default "default role permissions in guild"
*/
permissions?: Permissions | null;
permissions?: Permissions | null | undefined;
/**
* RGB color value
*
* @default 0
*/
color?: number | null;
color?: number | null | undefined;
/**
* Whether the role should be displayed separately in the sidebar
*
* @default false
*/
hoist?: boolean | null;
hoist?: boolean | null | undefined;
/**
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
*/
icon?: string | null;
icon?: string | null | undefined;
/**
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
*/
unicode_emoji?: string | null;
unicode_emoji?: string | null | undefined;
/**
* Whether the role should be mentionable
*
* @default false
*/
mentionable?: boolean | null;
}>;
mentionable?: boolean | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#create-guild-role
@@ -644,18 +651,16 @@ export type RESTPostAPIGuildRoleResult = APIRole;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
*/
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Role id
*/
id: Snowflake;
/**
* Sorting position of the role
*/
position?: number;
}>
>;
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
/**
* Role id
*/
id: Snowflake;
/**
* Sorting position of the role
*/
position?: number | undefined;
}>;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
@@ -665,36 +670,36 @@ export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-role
*/
export type RESTPatchAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildRoleJSONBody {
/**
* Name of the role
*/
name?: string | null;
name?: string | null | undefined;
/**
* Bitwise value of the enabled/disabled permissions
*/
permissions?: Permissions | null;
permissions?: Permissions | null | undefined;
/**
* RGB color value
*/
color?: number | null;
color?: number | null | undefined;
/**
* Whether the role should be displayed separately in the sidebar
*/
hoist?: boolean | null;
hoist?: boolean | null | undefined;
/**
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
*/
icon?: string | null;
icon?: string | null | undefined;
/**
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
*/
unicode_emoji?: string | null;
unicode_emoji?: string | null | undefined;
/**
* Whether the role should be mentionable
*/
mentionable?: boolean | null;
}>;
mentionable?: boolean | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-role
@@ -737,24 +742,24 @@ export interface RESTGetAPIGuildPruneCountResult {
/**
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
*/
export type RESTPostAPIGuildPruneJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildPruneJSONBody {
/**
* Number of days to count prune for (1 or more)
*
* @default 7
*/
days?: number;
days?: number | undefined;
/**
* Whether `pruned is returned, discouraged for large guilds
*
* @default true
*/
compute_prune_count?: boolean;
compute_prune_count?: boolean | undefined;
/**
* Role(s) to include
*/
include_roles?: Snowflake[];
}>;
include_roles?: Snowflake[] | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
@@ -831,40 +836,40 @@ export type RESTGetAPIGuildWidgetImageResult = ArrayBuffer;
export type RESTGetAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
export type RESTPatchAPIGuildMemberVerificationJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildMemberVerificationJSONBody {
/**
* Whether Membership Screening is enabled
*/
enabled?: boolean;
enabled?: boolean | undefined;
/**
* Array of field objects serialized in a string
*/
form_fields?: string;
form_fields?: string | undefined;
/**
* The server description to show in the screening form
*/
description?: string | null;
}>;
description?: string | null | undefined;
}
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
channel_id?: Snowflake | undefined;
/**
* Toggles the user's suppress state
*/
suppress?: boolean;
suppress?: boolean | undefined;
/**
* Sets the user's request to speak
*/
request_to_speak_timestamp?: string | null;
}>;
request_to_speak_timestamp?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
@@ -874,7 +879,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
/**
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
/**
* The id of the channel the user is currently in
*/
@@ -882,8 +887,13 @@ export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUnde
/**
* Toggles the user's suppress state
*/
suppress?: boolean;
}>;
suppress?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateUserResult = never;
/**
* https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
@@ -893,13 +903,12 @@ export type RESTGetAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
*/
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Whether the welcome screen is enabled
*/
enabled?: boolean | null;
}>;
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> & {
/**
* Whether the welcome screen is enabled
*/
enabled?: boolean | null | undefined;
};
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen

View File

@@ -1,5 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
import type { StrictPartial } from '../../utils/internals.ts';
import type {
APIGuildScheduledEvent,
APIGuildScheduledEventEntityMetadata,
@@ -27,11 +27,11 @@ export type RESTGetAPIGuildScheduledEventsResult = APIGuildScheduledEvent[];
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
*/
export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildScheduledEventJSONBody {
/**
* The stage channel id of the guild event
*/
channel_id?: Snowflake;
channel_id?: Snowflake | undefined;
/**
* The name of the guild event
*/
@@ -47,24 +47,24 @@ export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndef
/**
* The time when the scheduled event is scheduled to end
*/
scheduled_end_time?: string;
scheduled_end_time?: string | undefined;
/**
* The description of the guild event
*/
description?: string;
description?: string | undefined;
/**
* The scheduled entity type of the guild event
*/
entity_type?: GuildScheduledEventEntityType;
entity_type?: GuildScheduledEventEntityType | undefined;
/**
* The entity metadata of the scheduled event
*/
entity_metadata?: APIGuildScheduledEventEntityMetadata;
entity_metadata?: APIGuildScheduledEventEntityMetadata | undefined;
/**
* The cover image of the scheduled event
*/
image?: string | null;
}>;
image?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
@@ -89,21 +89,20 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
*/
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus;
/**
* The entity metadata of the scheduled event
*/
entity_metadata?: APIGuildScheduledEventEntityMetadata | null;
/**
* The description of the guild event
*/
description?: string | null;
}>;
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> & {
/**
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus | undefined;
/**
* The entity metadata of the scheduled event
*/
entity_metadata?: APIGuildScheduledEventEntityMetadata | null | undefined;
/**
* The description of the guild event
*/
description?: string | null | undefined;
};
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event

View File

@@ -16,6 +16,19 @@ import type {
} from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands
*/
export interface RESTGetAPIApplicationCommandsQuery {
/**
* Whether to include full localization dictionaries (name_localizations and description_localizations)
* in the returned objects, instead of the name_localized and description_localized fields.
*
* @default false
*/
with_localizations?: boolean;
}
/**
* https://discord.com/developers/docs/interactions/application-commands#get-global-application-commands
*/
@@ -45,11 +58,10 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
/**
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
*/
export type RESTPostAPIChatInputApplicationCommandsJSONBody = RESTPostAPIBaseApplicationCommandsJSONBody &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
type?: ApplicationCommandType.ChatInput;
description: string;
}>;
export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody {
type?: ApplicationCommandType.ChatInput | undefined;
description: string;
}
/**
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
@@ -90,6 +102,11 @@ export type RESTPutAPIApplicationCommandsJSONBody = RESTPostAPIApplicationComman
*/
export type RESTPutAPIApplicationCommandsResult = APIApplicationCommand[];
/**
* https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
*/
export type RESTGetAPIApplicationGuildCommandsQuery = RESTGetAPIApplicationCommandsQuery;
/**
* https://discord.com/developers/docs/interactions/application-commands#get-guild-application-commands
*/
@@ -153,7 +170,7 @@ export type RESTPostAPIInteractionCallbackFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>);
@@ -195,7 +212,7 @@ export type RESTPostAPIInteractionFollowupFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>);

View File

@@ -1,7 +1,9 @@
import type { Snowflake } from '../../globals.ts';
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';
@@ -20,6 +22,33 @@ export * from './webhook.ts';
export const APIVersion = '10';
export const Routes = {
/**
* Route for:
* - GET `/applications/{application.id}/role-connections/metadata`
* - PUT `/applications/{application.id}/role-connections/metadata`
*/
applicationRoleConnectionMetadata(applicationId: Snowflake) {
return `/applications/${applicationId}/role-connections/metadata` as const;
},
/**
* 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`
@@ -501,6 +530,15 @@ export const Routes = {
return `/users/${userId}` as const;
},
/**
* Route for:
* - GET `/users/@me/applications/{application.id}/role-connection`
* - PUT `/users/@me/applications/{application.id}/role-connection`
*/
userApplicationRoleConnection(applicationId: Snowflake) {
return `/users/@me/applications/${applicationId}/role-connection` as const;
},
/**
* Route for:
* - GET `/users/@me/guilds`
@@ -973,12 +1011,12 @@ export const CDNRoutes = {
/**
* Route for:
* - GET `/app-icons/{application.id}/{application.asset_id}.{png|jpeg|webp}`
* - GET `/app-assets/{application.id}/{application.asset_id}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
applicationAsset(applicationId: Snowflake, applicationAssetId: string, format: ApplicationAssetFormat) {
return `/app-icons/${applicationId}/${applicationAssetId}.${format}` as const;
return `/app-assets/${applicationId}/${applicationAssetId}.${format}` as const;
},
/**
@@ -1006,6 +1044,16 @@ export const CDNRoutes = {
return `/app-assets/${StickerPackApplicationId}/store/${stickerPackBannerAssetId}.${format}` as const;
},
/**
* Route for:
* - GET `/app-assets/${application.id}/store/${asset.id}.{png|jpeg|webp}}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
storePageAsset(applicationId: Snowflake, assetId: string) {
return `/app-assets/${applicationId}/store/${assetId}.png` as const;
},
/**
* Route for:
* - GET `team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
@@ -1020,7 +1068,7 @@ export const CDNRoutes = {
* Route for:
* - GET `/stickers/{sticker.id}.{png|json}`
*
* This route supports the extensions: PNG, Lottie
* This route supports the extensions: PNG, Lottie, GIF
*/
sticker(stickerId: Snowflake, format: StickerFormat) {
return `/stickers/${stickerId}.${format}` as const;
@@ -1078,7 +1126,7 @@ export type ApplicationAssetFormat = Exclude<ImageFormat, ImageFormat.Lottie | I
export type AchievementIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type StickerPackBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type TeamIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type StickerFormat = Extract<ImageFormat, ImageFormat.PNG | ImageFormat.Lottie>;
export type StickerFormat = Extract<ImageFormat, ImageFormat.PNG | ImageFormat.Lottie | ImageFormat.GIF>;
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;

View File

@@ -1,6 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { APIStageInstance, StageInstancePrivacyLevel } from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/stage-instance#create-stage-instance
@@ -19,11 +18,11 @@ export interface RESTPostAPIStageInstanceJSONBody {
*
* @default GuildOnly
*/
privacy_level?: StageInstancePrivacyLevel;
privacy_level?: StageInstancePrivacyLevel | undefined;
/**
* Notify @everyone that a stage instance has started
*/
send_start_notification?: boolean;
send_start_notification?: boolean | undefined;
}
/**
@@ -39,16 +38,16 @@ export type RESTGetAPIStageInstanceResult = APIStageInstance;
/**
* https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance
*/
export type RESTPatchAPIStageInstanceJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIStageInstanceJSONBody {
/**
* The topic of the stage instance (1-120 characters)
*/
topic?: string;
topic?: string | undefined;
/**
* The privacy level of the stage instance
*/
privacy_level?: StageInstancePrivacyLevel;
}>;
privacy_level?: StageInstancePrivacyLevel | undefined;
}
/**
* https://discord.com/developers/docs/resources/stage-instance#modify-stage-instance

View File

@@ -1,5 +1,4 @@
import type { APISticker, APIStickerPack } from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/sticker#get-sticker
@@ -40,7 +39,9 @@ export interface RESTPostAPIGuildStickerFormDataBody {
*/
tags: string;
/**
* The sticker file to upload, must be a PNG, APNG, or Lottie JSON file, max 500 KB
* The sticker file to upload, must be a PNG, APNG, GIF, or Lottie JSON file, max 512 KB
*
* Uploaded stickers are constrained to 5 seconds in length for animated stickers, and 320 x 320 pixels.
*/
file: unknown;
}
@@ -53,20 +54,20 @@ export type RESTPostAPIGuildStickerResult = APISticker;
/**
* https://discord.com/developers/docs/resources/sticker#modify-guild-sticker
*/
export type RESTPatchAPIGuildStickerJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildStickerJSONBody {
/**
* Name of the sticker (2-30 characters)
*/
name?: string;
name?: string | undefined;
/**
* Description of the sticker (2-100 characters)
*/
description?: string | null;
description?: string | null | undefined;
/**
* The Discord name of a unicode emoji representing the sticker's expression (2-200 characters)
*/
tags?: string;
}>;
tags?: string | undefined;
}
/**
* https://discord.com/developers/docs/resources/sticker#modify-guild-sticker

View File

@@ -1,5 +1,5 @@
import type { APIGuild, APITemplate } from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
import type { StrictPartial } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/guild-template#get-guild-template
@@ -9,7 +9,7 @@ export type RESTGetAPITemplateResult = APITemplate;
/**
* https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
*/
export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPITemplateCreateGuildJSONBody {
/**
* Name of the guild (2-100 characters)
*/
@@ -19,8 +19,8 @@ export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndef
*
* See https://discord.com/developers/docs/reference#image-data
*/
icon?: string;
}>;
icon?: string | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild-template#create-guild-from-guild-template
@@ -35,7 +35,7 @@ export type RESTGetAPIGuildTemplatesResult = APITemplate[];
/**
* https://discord.com/developers/docs/resources/guild-template#create-guild-template
*/
export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildTemplatesJSONBody {
/**
* Name of the template (1-100 characters)
*/
@@ -43,8 +43,8 @@ export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedP
/**
* Description for the template (0-120 characters)
*/
description?: string | null;
}>;
description?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild-template#create-guild-template

View File

@@ -1,6 +1,12 @@
import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIChannel, APIConnection, APIGuildMember, APIUser, GuildFeature } from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
import type {
APIChannel,
APIConnection,
APIGuildMember,
APIUser,
APIApplicationRoleConnection,
GuildFeature,
} from '../../payloads/v10/mod.ts';
/**
* https://discord.com/developers/docs/resources/user#get-current-user
@@ -20,16 +26,16 @@ export type RESTGetCurrentUserGuildMemberResult = APIGuildMember;
/**
* https://discord.com/developers/docs/resources/user#modify-current-user
*/
export type RESTPatchAPICurrentUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPICurrentUserJSONBody {
/**
* User's username, if changed may cause the user's discriminator to be randomized
*/
username?: string;
username?: string | undefined;
/**
* If passed, modifies the user's avatar
*/
avatar?: string | null;
}>;
avatar?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/user#modify-current-user
@@ -49,11 +55,17 @@ export interface RESTGetAPICurrentUserGuildsQuery {
*/
after?: Snowflake;
/**
* Max number of guilds to return (1-100)
* Max number of guilds to return (1-200)
*
* @default 100
* @default 200
*/
limit?: number;
/**
* Include approximate member and presence counts in response
*
* @default false
*/
with_counts?: boolean;
}
export interface RESTAPIPartialCurrentUserGuild {
@@ -63,6 +75,8 @@ export interface RESTAPIPartialCurrentUserGuild {
owner: boolean;
features: GuildFeature[];
permissions: Permissions;
approximate_member_count?: number;
approximate_presence_count?: number;
}
/**
@@ -94,3 +108,31 @@ export type RESTPostAPICurrentUserCreateDMChannelResult = APIChannel;
* https://discord.com/developers/docs/resources/user#get-user-connections
*/
export type RESTGetAPICurrentUserConnectionsResult = APIConnection[];
/**
* https://discord.com/developers/docs/resources/user#get-user-application-role-connection
*/
export type RESTGetAPICurrentUserApplicationRoleConnectionResult = APIApplicationRoleConnection;
/**
* https://discord.com/developers/docs/resources/user#update-user-application-role-connection
*/
export interface RESTPutAPICurrentUserApplicationRoleConnectionJSONBody {
/**
* The vanity name of the platform a bot has connected (max 50 characters)
*/
platform_name?: string | undefined;
/**
* The username on the platform a bot has connected (max 100 characters)
*/
platform_username?: string | undefined;
/**
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
*/
metadata?: Record<string, string | number> | undefined;
}
/**
* https://discord.com/developers/docs/resources/user#update-user-application-role-connection
*/
export type RESTPutAPICurrentUserApplicationRoleConnectionResult = APIApplicationRoleConnection;

View File

@@ -3,4 +3,9 @@ import type { APIVoiceRegion } from '../../payloads/v10/mod.ts';
/**
* https://discord.com/developers/docs/resources/voice#list-voice-regions
*/
export type GetAPIVoiceRegionsResult = APIVoiceRegion[];
export type RESTGetAPIVoiceRegionsResult = APIVoiceRegion[];
/**
* @deprecated This was exported with the wrong name, use `RESTGetAPIVoiceRegionsResult` instead
*/
export type GetAPIVoiceRegionsResult = RESTGetAPIVoiceRegionsResult;

View File

@@ -13,7 +13,7 @@ import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } f
/**
* https://discord.com/developers/docs/resources/webhook#create-webhook
*/
export type RESTPostAPIChannelWebhookJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIChannelWebhookJSONBody {
/**
* Name of the webhook (1-80 characters)
*/
@@ -23,8 +23,8 @@ export type RESTPostAPIChannelWebhookJSONBody = AddUndefinedToPossiblyUndefinedP
*
* See https://discord.com/developers/docs/reference#image-data
*/
avatar?: string | null;
}>;
avatar?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/webhook#create-webhook
@@ -54,22 +54,22 @@ export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
/**
* https://discord.com/developers/docs/resources/webhook#modify-webhook
*/
export type RESTPatchAPIWebhookJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIWebhookJSONBody {
/**
* The default name of the webhook
*/
name?: string;
name?: string | undefined;
/**
* Image for the default webhook avatar
*
* See https://discord.com/developers/docs/reference#image-data
*/
avatar?: string | null;
avatar?: string | null | undefined;
/**
* The new channel id this webhook should be moved to
*/
channel_id?: Snowflake;
}>;
channel_id?: Snowflake | undefined;
}
/**
* https://discord.com/developers/docs/resources/webhook#modify-webhook
@@ -99,35 +99,35 @@ export type RESTDeleteAPIWebhookWithTokenResult = never;
/**
* https://discord.com/developers/docs/resources/webhook#execute-webhook
*/
export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIWebhookWithTokenJSONBody {
/**
* The message contents (up to 2000 characters)
*/
content?: string;
content?: string | undefined;
/**
* Override the default username of the webhook
*/
username?: string;
username?: string | undefined;
/**
* Override the default avatar of the webhook
*/
avatar_url?: string;
avatar_url?: string | undefined;
/**
* `true` if this is a TTS message
*/
tts?: boolean;
tts?: boolean | undefined;
/**
* Embedded `rich` content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*/
embeds?: APIEmbed[];
embeds?: APIEmbed[] | undefined;
/**
* Allowed mentions for the message
*
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
*/
allowed_mentions?: APIAllowedMentions;
allowed_mentions?: APIAllowedMentions | undefined;
/**
* The components to include with the message
*
@@ -135,22 +135,22 @@ export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefine
*
* See https://discord.com/developers/docs/interactions/message-components#component-object
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
/**
* Message flags combined as a bitfield
*/
flags?: MessageFlags;
flags?: MessageFlags | undefined;
/**
* Name of thread to create
*
* Available only if the webhook is in a forum channel and a thread is not specified in {@link RESTPostAPIWebhookWithTokenQuery.thread_id} query parameter
*/
thread_name?: string;
}>;
thread_name?: string | undefined;
}
/**
* https://discord.com/developers/docs/resources/webhook#execute-webhook
@@ -160,7 +160,7 @@ export type RESTPostAPIWebhookWithTokenFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>);
@@ -237,21 +237,28 @@ export type RESTPostAPIWebhookWithTokenGitHubWaitResult = APIMessage;
*/
export type RESTGetAPIWebhookWithTokenMessageResult = APIMessage;
/**
* https://discord.com/developers/docs/resources/webhook#get-webhook-message-query-string-params
*/
export interface RESTGetAPIWebhookWithTokenMessageQuery {
thread_id?: string;
}
/**
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
*/
export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>> & {
/**
* Attached files to keep
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
}
>;
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>>
> & {
/**
* Attached files to keep
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
};
/**
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
@@ -261,7 +268,7 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>);

View File

@@ -53,15 +53,15 @@ export interface APIAllowedMentionsSend {
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPatchAPIChannelJSONBody {
name?: string;
type?: ChannelType.GUILD_NEWS | ChannelType.GUILD_TEXT;
position?: number | null;
topic?: string | null;
nsfw?: boolean | null;
rate_limit_per_user?: number | null;
user_limit?: number | null;
permission_overwrites?: APIOverwrite[] | null;
parent_id?: string | null;
name?: string | undefined;
type?: ChannelType.GUILD_NEWS | ChannelType.GUILD_TEXT | undefined;
position?: number | null | undefined;
topic?: string | null | undefined;
nsfw?: boolean | null | undefined;
rate_limit_per_user?: number | null | undefined;
user_limit?: number | null | undefined;
permission_overwrites?: APIOverwrite[] | null | undefined;
parent_id?: string | null | undefined;
}
/**
@@ -100,12 +100,12 @@ export type RESTGetAPIChannelMessagesResult = APIMessage[];
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPostAPIChannelMessageJSONBody {
content?: string;
nonce?: number | string;
tts?: boolean;
embed?: APIEmbed;
allowed_mentions?: APIAllowedMentionsSend;
message_reference?: APIMessageReference;
content?: string | undefined;
nonce?: number | string | undefined;
tts?: boolean | undefined;
embed?: APIEmbed | undefined;
allowed_mentions?: APIAllowedMentionsSend | undefined;
message_reference?: APIMessageReference | undefined;
}
/**
@@ -117,19 +117,19 @@ export type RESTPostAPIChannelMessageFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
/**
* The file contents
*/
file: unknown;
}
| {
content?: string;
nonce?: number | string;
tts?: boolean;
embed?: APIEmbed;
allowed_mentions?: APIAllowedMentionsSend;
message_reference?: APIMessageReference;
content?: string | undefined;
nonce?: number | string | undefined;
tts?: boolean | undefined;
embed?: APIEmbed | undefined;
allowed_mentions?: APIAllowedMentionsSend | undefined;
message_reference?: APIMessageReference | undefined;
/**
* The file contents
*/
@@ -141,10 +141,10 @@ export type RESTPostAPIChannelMessageFormDataBody =
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPatchAPIChannelMessageJSONBody {
content?: string | null;
embed?: APIEmbed | null;
allowed_mentions?: APIAllowedMentionsSend | null;
flags?: MessageFlags | null;
content?: string | null | undefined;
embed?: APIEmbed | null | undefined;
allowed_mentions?: APIAllowedMentionsSend | null | undefined;
flags?: MessageFlags | null | undefined;
}
/**
@@ -240,12 +240,12 @@ export type RESTGetAPIChannelInvitesResult = APIInvite[];
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPostAPIChannelInviteJSONBody {
max_age?: number;
max_uses?: number;
temporary?: boolean;
unique?: boolean;
target_user_id?: string;
target_user_type?: InviteTargetUserType;
max_age?: number | undefined;
max_uses?: number | undefined;
temporary?: boolean | undefined;
unique?: boolean | undefined;
target_user_id?: string | undefined;
target_user_type?: InviteTargetUserType | undefined;
}
/**
@@ -277,7 +277,7 @@ export type RESTDeleteAPIChannelPinResult = never;
*/
export interface RESTPutAPIChannelRecipientJSONBody {
access_token: string;
nick?: string;
nick?: string | undefined;
}
/**

View File

@@ -22,7 +22,7 @@ export interface RESTPostAPIGuildEmojiJSONBody {
* The image data, read more [here](https://discord.com/developers/docs/reference#image-data)
*/
image: string;
roles?: string[];
roles?: string[] | undefined;
}
/**
@@ -35,8 +35,8 @@ export type RESTPostAPIGuildEmojiResult = APIEmoji;
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPatchAPIGuildEmojiJSONBody {
name?: string;
roles?: string[] | null;
name?: string | undefined;
roles?: string[] | null | undefined;
}
/**

View File

@@ -32,9 +32,9 @@ export type APIGuildCreatePartialChannel = Partial<
Pick<APIChannel, 'type' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user'>
> & {
name: string;
id?: number | string;
parent_id?: number | string;
permission_overwrites?: APIGuildCreateOverwrite[];
id?: number | string | undefined;
parent_id?: number | string | undefined;
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
};
/**
@@ -50,16 +50,16 @@ export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
*/
export interface RESTPostAPIGuildsJSONBody {
name: string;
region?: string;
icon?: string;
verification_level?: GuildVerificationLevel;
default_message_notifications?: GuildDefaultMessageNotifications;
explicit_content_filter?: GuildExplicitContentFilter;
roles?: APIGuildCreateRole[];
channels?: APIGuildCreatePartialChannel[];
afk_channel_id?: number | string;
afk_timeout?: number;
system_channel_id?: number | string;
region?: string | undefined;
icon?: string | undefined;
verification_level?: GuildVerificationLevel | undefined;
default_message_notifications?: GuildDefaultMessageNotifications | undefined;
explicit_content_filter?: GuildExplicitContentFilter | undefined;
roles?: APIGuildCreateRole[] | undefined;
channels?: APIGuildCreatePartialChannel[] | undefined;
afk_channel_id?: number | string | undefined;
afk_timeout?: number | undefined;
system_channel_id?: number | string | undefined;
}
/**
@@ -91,24 +91,24 @@ export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPatchAPIGuildJSONBody {
name?: string;
region?: string;
verification_level?: GuildVerificationLevel;
default_message_notifications?: GuildDefaultMessageNotifications;
explicit_content_filter?: GuildExplicitContentFilter;
afk_channel_id?: string | null;
afk_timeout?: number;
icon?: string | null;
owner_id?: string;
splash?: string | null;
discovery_splash?: string | null;
banner?: string | null;
system_channel_id?: string | null;
rules_channel_id?: string | null;
public_updates_channel_id?: string | null;
preferred_locale?: string;
features?: GuildFeature[];
description?: string | null;
name?: string | undefined;
region?: string | undefined;
verification_level?: GuildVerificationLevel | undefined;
default_message_notifications?: GuildDefaultMessageNotifications | undefined;
explicit_content_filter?: GuildExplicitContentFilter | undefined;
afk_channel_id?: string | null | undefined;
afk_timeout?: number | undefined;
icon?: string | null | undefined;
owner_id?: string | undefined;
splash?: string | null | undefined;
discovery_splash?: string | null | undefined;
banner?: string | null | undefined;
system_channel_id?: string | null | undefined;
rules_channel_id?: string | null | undefined;
public_updates_channel_id?: string | null | undefined;
preferred_locale?: string | undefined;
features?: GuildFeature[] | undefined;
description?: string | null | undefined;
}
/**
@@ -152,8 +152,8 @@ export type RESTPostAPIGuildChannelResult = APIChannel;
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
id: string;
position: number;
lock_permissions?: boolean;
parent_id?: string | null;
lock_permissions?: boolean | undefined;
parent_id?: string | null | undefined;
}>;
/**
@@ -200,10 +200,10 @@ export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
*/
export interface RESTPutAPIGuildMemberJSONBody {
access_token: string;
nick?: string;
roles?: string[];
mute?: boolean;
deaf?: boolean;
nick?: string | undefined;
roles?: string[] | undefined;
mute?: boolean | undefined;
deaf?: boolean | undefined;
}
/**
@@ -216,11 +216,11 @@ export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPatchAPIGuildMemberJSONBody {
nick?: string | null;
roles?: string[] | null;
mute?: boolean | null;
deaf?: boolean | null;
channel_id?: string | null;
nick?: string | null | undefined;
roles?: string[] | null | undefined;
mute?: boolean | null | undefined;
deaf?: boolean | null | undefined;
channel_id?: string | null | undefined;
}
/**
@@ -233,7 +233,7 @@ export type RESTPatchAPIGuildMemberResult = never;
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
nick?: string | null;
nick?: string | null | undefined;
}
/**
@@ -276,8 +276,8 @@ export type RESTGetAPIGuildBanResult = APIBan;
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPutAPIGuildBanJSONBody {
delete_message_days?: number;
reason?: string;
delete_message_days?: number | undefined;
reason?: string | undefined;
}
/**
@@ -302,11 +302,11 @@ export type RESTGetAPIGuildRolesResult = APIRole[];
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPostAPIGuildRoleJSONBody {
name?: string | null;
permissions?: number | string | null;
color?: number | null;
hoist?: boolean | null;
mentionable?: boolean | null;
name?: string | null | undefined;
permissions?: number | string | null | undefined;
color?: number | null | undefined;
hoist?: boolean | null | undefined;
mentionable?: boolean | null | undefined;
}
/**
@@ -320,7 +320,7 @@ export type RESTPostAPIGuildRoleResult = APIRole;
*/
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
id: string;
position?: number;
position?: number | undefined;
}>;
/**
@@ -333,11 +333,11 @@ export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPatchAPIGuildRoleJSONBody {
name?: string;
permissions?: number | string;
color?: number;
hoist?: boolean;
mentionable?: boolean;
name?: string | undefined;
permissions?: number | string | undefined;
color?: number | undefined;
hoist?: boolean | undefined;
mentionable?: boolean | undefined;
}
/**
@@ -378,9 +378,9 @@ export interface RESTGetAPIGuildPruneCountResult {
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPostAPIGuildPruneJSONBody {
days?: number;
compute_prune_count?: boolean;
include_roles?: string[];
days?: number | undefined;
compute_prune_count?: boolean | undefined;
include_roles?: string[] | undefined;
}
/**
@@ -434,9 +434,9 @@ export type RESTPostAPIGuildIntegrationResult = never;
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPatchAPIGuildIntegrationJSONBody {
expire_behavior?: IntegrationExpireBehavior | null;
expire_grace_period?: number | null;
enable_emoticons?: boolean | null;
expire_behavior?: IntegrationExpireBehavior | null | undefined;
expire_grace_period?: number | null | undefined;
enable_emoticons?: boolean | null | undefined;
}
/**

View File

@@ -17,8 +17,8 @@ export type RESTGetAPIUserResult = APIUser;
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPatchAPICurrentUserJSONBody {
username?: string;
avatar?: string | null;
username?: string | undefined;
avatar?: string | null | undefined;
}
/**

View File

@@ -7,7 +7,7 @@ import type { APIEmbed, APIMessage, APIWebhook } from '../../payloads/v6/mod.ts'
*/
export interface RESTPostAPIChannelWebhookJSONBody {
name: string;
avatar?: string | null;
avatar?: string | null | undefined;
}
/**
@@ -44,9 +44,9 @@ export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPatchAPIWebhookJSONBody {
name?: string;
avatar?: string | null;
channel_id?: string;
name?: string | undefined;
avatar?: string | null | undefined;
channel_id?: string | undefined;
}
/**
@@ -81,12 +81,12 @@ export type RESTDeleteAPIWebhookWithTokenResult = never;
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export interface RESTPostAPIWebhookWithTokenJSONBody {
content?: string;
username?: string;
avatar_url?: string;
tts?: boolean;
embeds?: APIEmbed[];
allowed_mentions?: APIAllowedMentionsSend;
content?: string | undefined;
username?: string | undefined;
avatar_url?: string | undefined;
tts?: boolean | undefined;
embeds?: APIEmbed[] | undefined;
allowed_mentions?: APIAllowedMentionsSend | undefined;
}
/**
@@ -98,7 +98,7 @@ export type RESTPostAPIWebhookWithTokenFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
/**
* The file contents
*/

View File

@@ -36,13 +36,13 @@ export type RESTGetAPIChannelResult = APIChannel;
* https://discord.com/developers/docs/resources/channel#modify-channel
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIChannelJSONBody {
/**
* 1-100 character channel name
*
* Channel types: all
*/
name?: string;
name?: string | undefined;
/**
* The type of channel; only conversion between `text` and `news`
@@ -50,25 +50,25 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*
* Channel types: text, news
*/
type?: ChannelType.GuildNews | ChannelType.GuildText;
type?: ChannelType.GuildNews | ChannelType.GuildText | undefined;
/**
* The position of the channel in the left-hand listing
*
* Channel types: all
*/
position?: number | null;
position?: number | null | undefined;
/**
* 0-1024 character channel topic
*
* Channel types: text, news
*/
topic?: string | null;
topic?: string | null | undefined;
/**
* Whether the channel is nsfw
*
* Channel types: text, news, store
*/
nsfw?: boolean | null;
nsfw?: boolean | null | undefined;
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
@@ -76,44 +76,44 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*
* Channel types: text
*/
rate_limit_per_user?: number | null;
rate_limit_per_user?: number | null | undefined;
/**
* The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers)
*
* Channel types: voice
*/
bitrate?: number | null;
bitrate?: number | null | undefined;
/**
* The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit
*
* Channel types: voice
*/
user_limit?: number | null;
user_limit?: number | null | undefined;
/**
* Channel or category-specific permissions
*
* Channel types: all
*/
permission_overwrites?: APIChannelPatchOverwrite[] | null;
permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined;
/**
* ID of the new parent category for a channel
*
* Channel types: text, news, store, voice
*/
parent_id?: Snowflake | null;
parent_id?: Snowflake | null | undefined;
/**
* Voice region id for the voice or stage channel, automatic when set to `null`
*
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
rtc_region?: string | null;
rtc_region?: string | null | undefined;
/**
* The camera video quality mode of the voice channel
*
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
*/
video_quality_mode?: VideoQualityMode | null;
}>;
video_quality_mode?: VideoQualityMode | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#modify-channel
@@ -169,79 +169,78 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
Required<Pick<APIMessageReference, 'message_id'>> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Required<Pick<APIMessageReference, 'message_id'>>> & {
/**
* Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message
*
* @default true
*/
fail_if_not_exists?: boolean;
}>;
fail_if_not_exists?: boolean | undefined;
};
/**
* https://discord.com/developers/docs/resources/channel#create-message
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIChannelMessageJSONBody {
/**
* The message contents (up to 2000 characters)
*/
content?: string;
content?: string | undefined;
/**
* A nonce that can be used for optimistic message sending
*/
nonce?: number | string;
nonce?: number | string | undefined;
/**
* `true` if this is a TTS message
*/
tts?: boolean;
tts?: boolean | undefined;
/**
* Embedded `rich` content (up to 6000 characters)
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*/
embeds?: APIEmbed[];
embeds?: APIEmbed[] | undefined;
/**
* Embedded `rich` content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
* @deprecated Use `embeds` instead
*/
embed?: APIEmbed;
embed?: APIEmbed | undefined;
/**
* Allowed mentions for a message
*
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
*/
allowed_mentions?: APIAllowedMentions;
allowed_mentions?: APIAllowedMentions | undefined;
/**
* Include to make your message a reply
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
*/
message_reference?: APIMessageReferenceSend;
message_reference?: APIMessageReferenceSend | undefined;
/**
* The components to include with the message
*
* See https://discord.com/developers/docs/interactions/message-components#component-object
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
/**
* IDs of up to 3 stickers in the server to send in the message
*
* See https://discord.com/developers/docs/resources/sticker#sticker-object
*/
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake];
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined;
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
/**
* Message flags combined as a bitfield
*/
flags?: MessageFlags;
}>;
flags?: MessageFlags | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#create-message
@@ -252,7 +251,7 @@ export type RESTPostAPIChannelMessageFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
@@ -325,24 +324,24 @@ export type RESTDeleteAPIChannelMessageReactionResult = never;
* https://discord.com/developers/docs/resources/channel#edit-message
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIChannelMessageJSONBody {
/**
* The new message contents (up to 2000 characters)
*/
content?: string | null;
content?: string | null | undefined;
/**
* Embedded `rich` content (up to 6000 characters)
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*/
embeds?: APIEmbed[] | null;
embeds?: APIEmbed[] | null | undefined;
/**
* Embedded `rich` content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
* @deprecated Use `embeds` instead
*/
embed?: APIEmbed | null;
embed?: APIEmbed | null | undefined;
/**
* Edit the flags of a message (only `SUPPRESS_EMBEDS` can currently be set/unset)
*
@@ -351,13 +350,13 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-flags
*/
flags?: MessageFlags | null;
flags?: MessageFlags | null | undefined;
/**
* Allowed mentions for the message
*
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
*/
allowed_mentions?: APIAllowedMentions | null;
allowed_mentions?: APIAllowedMentions | null | undefined;
/**
* Attached files to keep
*
@@ -365,14 +364,14 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
/**
* The components to include with the message
*
* See https://discord.com/developers/docs/interactions/message-components#component-object
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null;
}>;
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#edit-message
@@ -383,7 +382,7 @@ export type RESTPatchAPIChannelMessageFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
@@ -428,7 +427,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
*
* @default "0"
*/
allow?: Permissions | null;
allow?: Permissions | null | undefined;
/**
* The bitwise value of all disallowed permissions
*
@@ -436,7 +435,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
*
* @default "0"
*/
deny?: Permissions | null;
deny?: Permissions | null | undefined;
/**
* `0` for a role or `1` for a member
*/
@@ -459,51 +458,51 @@ export type RESTGetAPIChannelInvitesResult = APIExtendedInvite[];
* https://discord.com/developers/docs/resources/channel#create-channel-invite
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIChannelInviteJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIChannelInviteJSONBody {
/**
* Duration of invite in seconds before expiry, or 0 for never
*
* @default 86400 (24 hours)
*/
max_age?: number;
max_age?: number | undefined;
/**
* Max number of uses or 0 for unlimited
*
* @default 0
*/
max_uses?: number;
max_uses?: number | undefined;
/**
* Whether this invite only grants temporary membership
*
* @default false
*/
temporary?: boolean;
temporary?: boolean | undefined;
/**
* If true, don't try to reuse a similar invite
* (useful for creating many unique one time use invites)
*
* @default false
*/
unique?: boolean;
unique?: boolean | undefined;
/**
* The type of target for this voice channel invite
*
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
*/
target_type?: InviteTargetType;
target_type?: InviteTargetType | undefined;
/**
* The id of the user whose stream to display for this invite
* - Required if `target_type` is 1
* - The user must be streaming in the channel
*/
target_user_id?: Snowflake;
target_user_id?: Snowflake | undefined;
/**
* The id of the embedded application to open for this invite
* - Required if `target_type` is 2
* - The application must have the `EMBEDDED` flag
*/
target_application_id?: Snowflake;
}>;
target_application_id?: Snowflake | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#create-channel-invite
@@ -562,7 +561,7 @@ export type RESTDeleteAPIChannelPinResult = never;
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPutAPIChannelRecipientJSONBody {
/**
* Access token of a user that has granted your app the `gdm.join` scope
*/
@@ -570,8 +569,8 @@ export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefined
/**
* Nickname of the user being added
*/
nick?: string;
}>;
nick?: string | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient

View File

@@ -1,6 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { APIEmoji } from '../../payloads/v8/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/emoji#list-guild-emojis
@@ -18,7 +17,7 @@ export type RESTGetAPIGuildEmojiResult = APIEmoji;
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildEmojiJSONBody {
/**
* Name of the emoji
*/
@@ -32,8 +31,8 @@ export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPrope
/**
* Roles for which this emoji will be whitelisted
*/
roles?: Snowflake[];
}>;
roles?: Snowflake[] | undefined;
}
/**
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji
@@ -45,16 +44,16 @@ export type RESTPostAPIGuildEmojiResult = APIEmoji;
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildEmojiJSONBody {
/**
* Name of the emoji
*/
name?: string;
name?: string | undefined;
/**
* Roles for which this emoji will be whitelisted
*/
roles?: Snowflake[] | null;
}>;
roles?: Snowflake[] | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji

View File

@@ -23,13 +23,7 @@ import type {
GuildVerificationLevel,
GuildWidgetStyle,
} from '../../payloads/v8/mod.ts';
import type {
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
Nullable,
StrictPartial,
StrictRequired,
UnionToIntersection,
} from '../../utils/internals.ts';
import type { Nullable, StrictPartial, StrictRequired, UnionToIntersection } from '../../utils/internals.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
@@ -51,13 +45,12 @@ export type APIGuildCreatePartialChannel = StrictPartial<
UnionToIntersection<APIGuildChannelResolvable>,
'type' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user'
>
> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
name: string;
id?: number | string;
parent_id?: number | string | null;
permission_overwrites?: APIGuildCreateOverwrite[];
}>;
> & {
name: string;
id?: number | string | undefined;
parent_id?: number | string | null | undefined;
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
};
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
@@ -70,7 +63,7 @@ export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
* https://discord.com/developers/docs/resources/guild#create-guild
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildsJSONBody {
/**
* Name of the guild (2-100 characters)
*/
@@ -80,31 +73,31 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
region?: string;
region?: string | undefined;
/**
* base64 1024x1024 png/jpeg image for the guild icon
*
* See https://discord.com/developers/docs/reference#image-data
*/
icon?: string;
icon?: string | undefined;
/**
* Verification level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
*/
verification_level?: GuildVerificationLevel;
verification_level?: GuildVerificationLevel | undefined;
/**
* Default message notification level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
*/
default_message_notifications?: GuildDefaultMessageNotifications;
default_message_notifications?: GuildDefaultMessageNotifications | undefined;
/**
* Explicit content filter level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
*/
explicit_content_filter?: GuildExplicitContentFilter;
explicit_content_filter?: GuildExplicitContentFilter | undefined;
/**
* New guild roles
*
@@ -117,7 +110,7 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*
* See https://discord.com/developers/docs/topics/permissions#role-object
*/
roles?: APIGuildCreateRole[];
roles?: APIGuildCreateRole[] | undefined;
/**
* New guild's channels
*
@@ -130,30 +123,30 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
channels?: APIGuildCreatePartialChannel[];
channels?: APIGuildCreatePartialChannel[] | undefined;
/**
* ID for afk channel
*/
afk_channel_id?: number | Snowflake | null;
afk_channel_id?: number | Snowflake | null | undefined;
/**
* AFK timeout in seconds
*/
afk_timeout?: number;
afk_timeout?: number | undefined;
/**
* The id of the channel where guild notices such as welcome messages and boost events are posted
*/
system_channel_id?: number | Snowflake | null;
system_channel_id?: number | Snowflake | null | undefined;
/**
* System channel flags
*
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
*/
system_channel_flags?: GuildSystemChannelFlags;
system_channel_flags?: GuildSystemChannelFlags | undefined;
/**
* Whether the boosts progress bar should be enabled.
*/
premium_progress_bar_enabled?: boolean;
}>;
premium_progress_bar_enabled?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#create-guild
@@ -190,106 +183,106 @@ export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
* https://discord.com/developers/docs/resources/guild#modify-guild
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildJSONBody {
/**
* New name for the guild (2-100 characters)
*/
name?: string;
name?: string | undefined;
/**
* Voice region id
*
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
region?: string | null;
region?: string | null | undefined;
/**
* Verification level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
*/
verification_level?: GuildVerificationLevel | null;
verification_level?: GuildVerificationLevel | null | undefined;
/**
* Default message notification level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
*/
default_message_notifications?: GuildDefaultMessageNotifications | null;
default_message_notifications?: GuildDefaultMessageNotifications | null | undefined;
/**
* Explicit content filter level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
*/
explicit_content_filter?: GuildExplicitContentFilter | null;
explicit_content_filter?: GuildExplicitContentFilter | null | undefined;
/**
* ID for afk channel
*/
afk_channel_id?: Snowflake | null;
afk_channel_id?: Snowflake | null | undefined;
/**
* AFK timeout in seconds
*/
afk_timeout?: number;
afk_timeout?: number | undefined;
/**
* base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature)
*
* See https://discord.com/developers/docs/reference#image-data
*/
icon?: string | null;
icon?: string | null | undefined;
/**
* User id to transfer guild ownership to (must be owner)
*/
owner_id?: Snowflake;
owner_id?: Snowflake | undefined;
/**
* base64 16:9 png/jpeg image for the guild splash (when the guild has `INVITE_SPLASH` feature)
*
* See https://discord.com/developers/docs/reference#image-data
*/
splash?: string | null;
splash?: string | null | undefined;
/**
* base64 png/jpeg image for the guild discovery splash (when the guild has `DISCOVERABLE` feature)
*/
discovery_splash?: string | null;
discovery_splash?: string | null | undefined;
/**
* base64 16:9 png/jpeg image for the guild banner (when the server has the `BANNER` feature; can be animated gif when the server has the `ANIMATED_BANNER` feature)
*/
banner?: string | null;
banner?: string | null | undefined;
/**
* The id of the channel where guild notices such as welcome messages and boost events are posted
*/
system_channel_id?: Snowflake | null;
system_channel_id?: Snowflake | null | undefined;
/**
* System channel flags
*
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
*/
system_channel_flags?: GuildSystemChannelFlags;
system_channel_flags?: GuildSystemChannelFlags | undefined;
/**
* The id of the channel where Community guilds display rules and/or guidelines
*/
rules_channel_id?: Snowflake | null;
rules_channel_id?: Snowflake | null | undefined;
/**
* The id of the channel where admins and moderators of Community guilds receive notices from Discord
*/
public_updates_channel_id?: Snowflake | null;
public_updates_channel_id?: Snowflake | null | undefined;
/**
* The preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US"
*
* @default "en-US" (if the value is set to `null`)
*/
preferred_locale?: string | null;
preferred_locale?: string | null | undefined;
/**
* Enabled guild features
*
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
*/
features?: GuildFeature[];
features?: GuildFeature[] | undefined;
/**
* The description for the guild, if the guild is discoverable
*/
description?: string | null;
description?: string | null | undefined;
/**
* Whether the boosts progress bar should be enabled.
*/
premium_progress_bar_enabled?: boolean;
}>;
premium_progress_bar_enabled?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-guild
@@ -325,26 +318,24 @@ export type RESTPostAPIGuildChannelResult = APIChannel;
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Channel id
*/
id: Snowflake;
/**
* Sorting position of the channel
*/
position: number;
/**
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
*/
lock_permissions?: boolean;
/**
* The new parent id of this channel
*/
parent_id?: Snowflake | null;
}>
>;
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
/**
* Channel id
*/
id: Snowflake;
/**
* Sorting position of the channel
*/
position: number;
/**
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
*/
lock_permissions?: boolean | undefined;
/**
* The new parent id of this channel
*/
parent_id?: Snowflake | null | undefined;
}>;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
@@ -409,7 +400,7 @@ export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
* https://discord.com/developers/docs/resources/guild#add-guild-member
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPutAPIGuildMemberJSONBody {
/**
* An oauth2 access token granted with the `guilds.join` to the bot's application for the user you want to add to the guild
*/
@@ -419,26 +410,26 @@ export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPrope
*
* Requires `MANAGE_NICKNAMES` permission
*/
nick?: string;
nick?: string | undefined;
/**
* Array of role ids the member is assigned
*
* Requires `MANAGE_ROLES` permission
*/
roles?: Snowflake[];
roles?: Snowflake[] | undefined;
/**
* Whether the user is muted in voice channels
*
* Requires `MUTE_MEMBERS` permission
*/
mute?: boolean;
mute?: boolean | undefined;
/**
* Whether the user is deafened in voice channels
*
* Requires `DEAFEN_MEMBERS` permission
*/
deaf?: boolean;
}>;
deaf?: boolean | undefined;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
@@ -449,42 +440,42 @@ export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
* https://discord.com/developers/docs/resources/guild#modify-guild-member
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildMemberJSONBody {
/**
* Value to set users nickname to
*
* Requires `MANAGE_NICKNAMES` permission
*/
nick?: string | null;
nick?: string | null | undefined;
/**
* Array of role ids the member is assigned
*
* Requires `MANAGE_ROLES` permission
*/
roles?: Snowflake[] | null;
roles?: Snowflake[] | null | undefined;
/**
* Whether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channel
*
* Requires `MUTE_MEMBERS` permission
*/
mute?: boolean | null;
mute?: boolean | null | undefined;
/**
* Whether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channel
*
* Requires `DEAFEN_MEMBERS` permission
*/
deaf?: boolean | null;
deaf?: boolean | null | undefined;
/**
* ID of channel to move user to (if they are connected to voice)
*
* Requires `MOVE_MEMBERS` permission
*/
channel_id?: Snowflake | null;
channel_id?: Snowflake | null | undefined;
/**
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
*/
communication_disabled_until?: string | null;
}>;
communication_disabled_until?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#add-guild-member
@@ -498,27 +489,27 @@ export type RESTPatchAPIGuildMemberResult = APIGuildMember;
* @deprecated Use [Modify Current Member](https://discord.com/developers/docs/resources/guild#modify-current-member) instead.
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPICurrentGuildMemberNicknameJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
/**
* Value to set users nickname to
*
* Requires `CHANGE_NICKNAME` permission
*/
nick?: string | null;
}>;
nick?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-current-member
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPICurrentGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPICurrentGuildMemberJSONBody {
/**
* Value to set users nickname to
*
* Requires `CHANGE_NICKNAME` permission
*/
nick?: string | null;
}>;
nick?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-nick
@@ -563,18 +554,18 @@ export type RESTGetAPIGuildBanResult = APIBan;
* https://discord.com/developers/docs/resources/guild#create-guild-ban
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPutAPIGuildBanJSONBody {
/**
* Number of days to delete messages for (0-7)
*/
delete_message_days?: number;
delete_message_days?: number | undefined;
/**
* Reason for the ban
*
* @deprecated Removed in API v10, use the `X-Audit-Log-Reason` header instead.
*/
reason?: string;
}>;
reason?: string | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#create-guild-ban
@@ -598,46 +589,46 @@ export type RESTGetAPIGuildRolesResult = APIRole[];
* https://discord.com/developers/docs/resources/guild#create-guild-role
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildRoleJSONBody {
/**
* Name of the role
*
* @default "new role"
*/
name?: string | null;
name?: string | null | undefined;
/**
* Bitwise value of the enabled/disabled permissions
*
* @default "default role permissions in guild"
*/
permissions?: Permissions | null;
permissions?: Permissions | null | undefined;
/**
* RGB color value
*
* @default 0
*/
color?: number | null;
color?: number | null | undefined;
/**
* Whether the role should be displayed separately in the sidebar
*
* @default false
*/
hoist?: boolean | null;
hoist?: boolean | null | undefined;
/**
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
*/
icon?: string | null;
icon?: string | null | undefined;
/**
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
*/
unicode_emoji?: string | null;
unicode_emoji?: string | null | undefined;
/**
* Whether the role should be mentionable
*
* @default false
*/
mentionable?: boolean | null;
}>;
mentionable?: boolean | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#create-guild-role
@@ -649,18 +640,16 @@ export type RESTPostAPIGuildRoleResult = APIRole;
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Role id
*/
id: Snowflake;
/**
* Sorting position of the role
*/
position?: number;
}>
>;
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
/**
* Role id
*/
id: Snowflake;
/**
* Sorting position of the role
*/
position?: number | undefined;
}>;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
@@ -672,36 +661,36 @@ export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
* https://discord.com/developers/docs/resources/guild#modify-guild-role
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildRoleJSONBody {
/**
* Name of the role
*/
name?: string | null;
name?: string | null | undefined;
/**
* Bitwise value of the enabled/disabled permissions
*/
permissions?: Permissions | null;
permissions?: Permissions | null | undefined;
/**
* RGB color value
*/
color?: number | null;
color?: number | null | undefined;
/**
* Whether the role should be displayed separately in the sidebar
*/
hoist?: boolean | null;
hoist?: boolean | null | undefined;
/**
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
*/
icon?: string | null;
icon?: string | null | undefined;
/**
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
*/
unicode_emoji?: string | null;
unicode_emoji?: string | null | undefined;
/**
* Whether the role should be mentionable
*/
mentionable?: boolean | null;
}>;
mentionable?: boolean | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-role
@@ -749,24 +738,24 @@ export interface RESTGetAPIGuildPruneCountResult {
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIGuildPruneJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildPruneJSONBody {
/**
* Number of days to count prune for (1 or more)
*
* @default 7
*/
days?: number;
days?: number | undefined;
/**
* Whether `pruned is returned, discouraged for large guilds
*
* @default true
*/
compute_prune_count?: boolean;
compute_prune_count?: boolean | undefined;
/**
* Role(s) to include
*/
include_roles?: Snowflake[];
}>;
include_roles?: Snowflake[] | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
@@ -861,20 +850,20 @@ export type RESTGetAPIGuildMemberVerificationResult = APIGuildMembershipScreenin
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIGuildMemberVerificationJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildMemberVerificationJSONBody {
/**
* Whether Membership Screening is enabled
*/
enabled?: boolean;
enabled?: boolean | undefined;
/**
* Array of field objects serialized in a string
*/
form_fields?: string;
form_fields?: string | undefined;
/**
* The server description to show in the screening form
*/
description?: string | null;
}>;
description?: string | null | undefined;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
@@ -884,7 +873,7 @@ export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreen
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
/**
* The id of the channel the user is currently in
*/
@@ -892,17 +881,17 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPos
/**
* Toggles the user's suppress state
*/
suppress?: boolean;
suppress?: boolean | undefined;
/**
* Sets the user's request to speak
*/
request_to_speak_timestamp?: string | null;
}>;
request_to_speak_timestamp?: string | null | undefined;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
/**
* The id of the channel the user is currently in
*/
@@ -910,8 +899,8 @@ export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUnde
/**
* Toggles the user's suppress state
*/
suppress?: boolean;
}>;
suppress?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
@@ -923,10 +912,9 @@ export type RESTGetAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Whether the welcome screen is enabled
*/
enabled?: boolean | null;
}>;
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> & {
/**
* Whether the welcome screen is enabled
*/
enabled?: boolean | null | undefined;
};

View File

@@ -1,5 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
import type { StrictPartial } from '../../utils/internals.ts';
import type {
APIGuildScheduledEvent,
APIGuildScheduledEventEntityMetadata,
@@ -30,11 +30,11 @@ export type RESTGetAPIGuildScheduledEventsResult = APIGuildScheduledEvent[];
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildScheduledEventJSONBody {
/**
* The stage channel id of the guild event
*/
channel_id?: Snowflake;
channel_id?: Snowflake | undefined;
/**
* The name of the guild event
*/
@@ -50,24 +50,24 @@ export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndef
/**
* The time when the scheduled event is scheduled to end
*/
scheduled_end_time?: string;
scheduled_end_time?: string | undefined;
/**
* The description of the guild event
*/
description?: string;
description?: string | undefined;
/**
* The scheduled entity type of the guild event
*/
entity_type?: GuildScheduledEventEntityType;
entity_type?: GuildScheduledEventEntityType | undefined;
/**
* The entity metadata of the scheduled event
*/
entity_metadata?: APIGuildScheduledEventEntityMetadata;
entity_metadata?: APIGuildScheduledEventEntityMetadata | undefined;
/**
* The cover image of the scheduled event
*/
image?: string | null;
}>;
image?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
@@ -96,13 +96,12 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus;
}>;
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> & {
/**
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus | undefined;
};
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event

View File

@@ -36,11 +36,10 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefine
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIChatInputApplicationCommandsJSONBody = RESTPostAPIBaseApplicationCommandsJSONBody &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
type?: ApplicationCommandType.ChatInput;
description: string;
}>;
export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody {
type?: ApplicationCommandType.ChatInput | undefined;
description: string;
}
/**
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
@@ -151,7 +150,7 @@ export type RESTPostAPIInteractionCallbackFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>);
@@ -200,7 +199,7 @@ export type RESTPostAPIInteractionFollowupFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>);

View File

@@ -1,6 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { APIStageInstance, StageInstancePrivacyLevel } from '../../payloads/v8/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/stage-instance#create-stage-instance
@@ -20,7 +19,7 @@ export interface RESTPostAPIStageInstanceJSONBody {
*
* @default GuildOnly
*/
privacy_level?: StageInstancePrivacyLevel;
privacy_level?: StageInstancePrivacyLevel | undefined;
}
/**
@@ -39,16 +38,16 @@ export type RESTGetAPIStageInstanceResult = APIStageInstance;
* https://discord.com/developers/docs/resources/stage-instance#update-stage-instance
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIStageInstanceJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIStageInstanceJSONBody {
/**
* The topic of the stage instance (1-120 characters)
*/
topic?: string;
topic?: string | undefined;
/**
* The privacy level of the stage instance
*/
privacy_level?: StageInstancePrivacyLevel;
}>;
privacy_level?: StageInstancePrivacyLevel | undefined;
}
/**
* https://discord.com/developers/docs/resources/stage-instance#update-stage-instance

View File

@@ -1,5 +1,4 @@
import type { APISticker, APIStickerPack } from '../../payloads/v8/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
@@ -53,20 +52,20 @@ export type RESTPostAPIGuildStickerResult = APISticker;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIGuildStickerJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildStickerJSONBody {
/**
* Name of the sticker (2-30 characters)
*/
name?: string;
name?: string | undefined;
/**
* Description of the sticker (2-100 characters)
*/
description?: string | null;
description?: string | null | undefined;
/**
* The Discord name of a unicode emoji representing the sticker's expression (2-200 characters)
*/
tags?: string;
}>;
tags?: string | undefined;
}
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.

View File

@@ -1,5 +1,5 @@
import type { APIGuild, APITemplate } from '../../payloads/v8/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
import type { StrictPartial } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/template#get-template
@@ -11,7 +11,7 @@ export type RESTGetAPITemplateResult = APITemplate;
* https://discord.com/developers/docs/resources/template#create-guild-from-template
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPITemplateCreateGuildJSONBody {
/**
* Name of the guild (2-100 characters)
*/
@@ -21,8 +21,8 @@ export type RESTPostAPITemplateCreateGuildJSONBody = AddUndefinedToPossiblyUndef
*
* See https://discord.com/developers/docs/reference#image-data
*/
icon?: string;
}>;
icon?: string | undefined;
}
/**
* https://discord.com/developers/docs/resources/template#create-guild-from-template
@@ -40,7 +40,7 @@ export type RESTGetAPIGuildTemplatesResult = APITemplate[];
* https://discord.com/developers/docs/resources/template#create-guild-template
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildTemplatesJSONBody {
/**
* Name of the template (1-100 characters)
*/
@@ -48,8 +48,8 @@ export type RESTPostAPIGuildTemplatesJSONBody = AddUndefinedToPossiblyUndefinedP
/**
* Description for the template (0-120 characters)
*/
description?: string | null;
}>;
description?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/template#create-guild-template

View File

@@ -1,6 +1,5 @@
import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIChannel, APIConnection, APIGuildMember, APIUser, GuildFeature } from '../../payloads/v8/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/user#get-current-user
@@ -24,16 +23,16 @@ export type RESTGetCurrentUserGuildMemberResult = APIGuildMember;
* https://discord.com/developers/docs/resources/user#modify-current-user
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPICurrentUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPICurrentUserJSONBody {
/**
* User's username, if changed may cause the user's discriminator to be randomized
*/
username?: string;
username?: string | undefined;
/**
* If passed, modifies the user's avatar
*/
avatar?: string | null;
}>;
avatar?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/user#modify-current-user

View File

@@ -15,7 +15,7 @@ import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } f
* https://discord.com/developers/docs/resources/webhook#create-webhook
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIChannelWebhookJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIChannelWebhookJSONBody {
/**
* Name of the webhook (1-80 characters)
*/
@@ -25,8 +25,8 @@ export type RESTPostAPIChannelWebhookJSONBody = AddUndefinedToPossiblyUndefinedP
*
* See https://discord.com/developers/docs/reference#image-data
*/
avatar?: string | null;
}>;
avatar?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/webhook#create-webhook
@@ -62,22 +62,22 @@ export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
* https://discord.com/developers/docs/resources/webhook#modify-webhook
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIWebhookJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIWebhookJSONBody {
/**
* The default name of the webhook
*/
name?: string;
name?: string | undefined;
/**
* Image for the default webhook avatar
*
* See https://discord.com/developers/docs/reference#image-data
*/
avatar?: string | null;
avatar?: string | null | undefined;
/**
* The new channel id this webhook should be moved to
*/
channel_id?: Snowflake;
}>;
channel_id?: Snowflake | undefined;
}
/**
* https://discord.com/developers/docs/resources/webhook#modify-webhook
@@ -113,35 +113,35 @@ export type RESTDeleteAPIWebhookWithTokenResult = never;
* https://discord.com/developers/docs/resources/webhook#execute-webhook
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIWebhookWithTokenJSONBody {
/**
* The message contents (up to 2000 characters)
*/
content?: string;
content?: string | undefined;
/**
* Override the default username of the webhook
*/
username?: string;
username?: string | undefined;
/**
* Override the default avatar of the webhook
*/
avatar_url?: string;
avatar_url?: string | undefined;
/**
* `true` if this is a TTS message
*/
tts?: boolean;
tts?: boolean | undefined;
/**
* Embedded `rich` content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*/
embeds?: APIEmbed[];
embeds?: APIEmbed[] | undefined;
/**
* Allowed mentions for the message
*
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
*/
allowed_mentions?: APIAllowedMentions;
allowed_mentions?: APIAllowedMentions | undefined;
/**
* The components to include with the message
*
@@ -149,16 +149,16 @@ export type RESTPostAPIWebhookWithTokenJSONBody = AddUndefinedToPossiblyUndefine
*
* See https://discord.com/developers/docs/interactions/message-components#component-object
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
/**
* Message flags combined as a bitfield
*/
flags?: MessageFlags;
}>;
flags?: MessageFlags | undefined;
}
/**
* https://discord.com/developers/docs/resources/webhook#execute-webhook
@@ -169,7 +169,7 @@ export type RESTPostAPIWebhookWithTokenFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>);
@@ -259,17 +259,17 @@ export type RESTGetAPIWebhookWithTokenMessageResult = APIMessage;
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>> & {
/**
* Attached files to keep
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
}
>;
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>>
> & {
/**
* Attached files to keep
*
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
};
/**
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
@@ -280,7 +280,7 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>);

View File

@@ -0,0 +1,16 @@
import type { APIApplicationRoleConnectionMetadata } from '../../payloads/v9/application.ts';
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
*/
export type RESTGetAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
*/
export type RESTPutAPIApplicationRoleConnectionMetadataJSONBody = APIApplicationRoleConnectionMetadata[];
/**
* https://discord.com/developers/docs/resources/application-role-connection-metadata#update-application-role-connection-metadata-records
*/
export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRoleConnectionMetadata[];

View File

@@ -17,6 +17,10 @@ export interface RESTGetAPIAuditLogQuery {
* Filter the log before a certain entry ID
*/
before?: Snowflake;
/**
* Filter the log after a certain entry ID
*/
after?: Snowflake;
/**
* How many entries are returned (default 50, minimum 1, maximum 100)
*

View File

@@ -0,0 +1,83 @@
import type { Snowflake } from '../../globals.ts';
import type {
APIAutoModerationAction,
APIAutoModerationRule,
AutoModerationRuleEventType,
APIAutoModerationRuleTriggerMetadata,
AutoModerationRuleTriggerType,
} from '../../payloads/v9/mod.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 interface RESTPostAPIAutoModerationRuleJSONBody {
/**
* 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 | undefined;
/**
* The actions which will execute when this rule is triggered
*/
actions: APIAutoModerationAction[];
/**
* Whether this rule is enabled
*
* @default false
*/
enabled?: boolean | undefined;
/**
* The role ids that shouldn't be affected by this rule (Maximum of 20)
*/
exempt_roles?: Snowflake[] | undefined;
/**
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
*/
exempt_channels?: Snowflake[] | undefined;
}
/**
* 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,10 @@ import type {
OverwriteType,
ThreadAutoArchiveDuration,
VideoQualityMode,
APIGuildForumTag,
APIGuildForumDefaultReactionEmoji,
SortOrderType,
ForumLayoutType,
} from '../../payloads/v9/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
@@ -34,13 +38,13 @@ export type RESTGetAPIChannelResult = APIChannel;
/**
* https://discord.com/developers/docs/resources/channel#modify-channel
*/
export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIChannelJSONBody {
/**
* 1-100 character channel name
*
* Channel types: all
*/
name?: string;
name?: string | undefined;
/**
* The type of channel; only conversion between `text` and `news`
@@ -48,100 +52,131 @@ export type RESTPatchAPIChannelJSONBody = AddUndefinedToPossiblyUndefinedPropert
*
* Channel types: text, news
*/
type?: ChannelType.GuildNews | ChannelType.GuildText;
type?: ChannelType.GuildAnnouncement | ChannelType.GuildText | undefined;
/**
* The position of the channel in the left-hand listing
*
* Channel types: all excluding newsThread, publicThread, privateThread
*/
position?: number | null;
position?: number | null | undefined;
/**
* 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;
topic?: string | null | undefined;
/**
* Whether the channel is nsfw
*
* Channel types: text, voice, news
* Channel types: text, voice, news, forum
*/
nsfw?: boolean | null;
nsfw?: boolean | null | undefined;
/**
* Amount of seconds a user has to wait before sending another message (0-21600);
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
* are unaffected
*
* Channel types: text, newsThread, publicThread, privateThread
* Channel types: text, newsThread, publicThread, privateThread, forum
*/
rate_limit_per_user?: number | null;
rate_limit_per_user?: number | null | undefined;
/**
* The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers)
*
* Channel types: voice
*/
bitrate?: number | null;
bitrate?: number | null | undefined;
/**
* The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit
*
* Channel types: voice
*/
user_limit?: number | null;
user_limit?: number | null | undefined;
/**
* Channel or category-specific permissions
*
* Channel types: all excluding newsThread, publicThread, privateThread
*/
permission_overwrites?: APIChannelPatchOverwrite[] | null;
permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined;
/**
* ID of the new parent category for a channel
*
* Channel types: text, voice, news
*/
parent_id?: Snowflake | null;
parent_id?: Snowflake | null | undefined;
/**
* Voice region id for the voice or stage channel, automatic when set to `null`
*
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
rtc_region?: string | null;
rtc_region?: string | null | undefined;
/**
* The camera video quality mode of the voice channel
*
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
*/
video_quality_mode?: VideoQualityMode | null;
video_quality_mode?: VideoQualityMode | null | undefined;
/**
* Whether the thread should be archived
*
* Channel types: newsThread, publicThread, privateThread
*/
archived?: boolean;
archived?: boolean | undefined;
/**
* The amount of time in minutes to wait before automatically archiving the thread
*
* Channel types: newsThread, publicThread, privateThread
*/
auto_archive_duration?: ThreadAutoArchiveDuration;
auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
/**
* Whether the thread should be locked
*
* Channel types: newsThread, publicThread, privateThread
*/
locked?: boolean;
locked?: boolean | undefined;
/**
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
*
* Channel types: text, news
*/
default_auto_archive_duration?: ThreadAutoArchiveDuration;
default_auto_archive_duration?: ThreadAutoArchiveDuration | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread
*
* Channel types: privateThread
*/
invitable?: boolean;
}>;
invitable?: boolean | undefined;
/**
* The set of tags that can be used in a forum channel; limited to 20
*
* Channel types: forum
*/
available_tags?: APIGuildForumTag[] | undefined;
/**
* The emoji to show in the add reaction button on a thread in a forum channel
*
* Channel types: forum
*/
default_reaction_emoji?: APIGuildForumDefaultReactionEmoji | undefined;
/**
* The initial `rate_limit_per_user` to set on newly created threads in a channel.
* This field is copied to the thread at creation time and does not live update
*
* Channel types: forum
*/
default_thread_rate_limit_per_user?: number | null | undefined;
/**
* The default sort order type used to order posts in a forum channel
*
* Channel types: forum
*/
default_sort_order?: SortOrderType | null | undefined;
/**
* The default layout type used to display posts in a forum channel
*
* Channel types: forum
*/
default_forum_layout?: ForumLayoutType | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#modify-channel
@@ -191,78 +226,77 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
Required<Pick<APIMessageReference, 'message_id'>> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Required<Pick<APIMessageReference, 'message_id'>>> & {
/**
* Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message
*
* @default true
*/
fail_if_not_exists?: boolean;
}>;
fail_if_not_exists?: boolean | undefined;
};
/**
* https://discord.com/developers/docs/resources/channel#create-message
*/
export type RESTPostAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIChannelMessageJSONBody {
/**
* The message contents (up to 2000 characters)
*/
content?: string;
content?: string | undefined;
/**
* A nonce that can be used for optimistic message sending
*/
nonce?: number | string;
nonce?: number | string | undefined;
/**
* `true` if this is a TTS message
*/
tts?: boolean;
tts?: boolean | undefined;
/**
* Embedded `rich` content (up to 6000 characters)
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*/
embeds?: APIEmbed[];
embeds?: APIEmbed[] | undefined;
/**
* Embedded `rich` content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
* @deprecated Use `embeds` instead
*/
embed?: APIEmbed;
embed?: APIEmbed | undefined;
/**
* Allowed mentions for a message
*
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
*/
allowed_mentions?: APIAllowedMentions;
allowed_mentions?: APIAllowedMentions | undefined;
/**
* Include to make your message a reply
*
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
message_reference?: APIMessageReferenceSend;
message_reference?: APIMessageReferenceSend | undefined;
/**
* The components to include with the message
*
* See https://discord.com/developers/docs/interactions/message-components#component-object
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[];
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | undefined;
/**
* IDs of up to 3 stickers in the server to send in the message
*
* See https://discord.com/developers/docs/resources/sticker#sticker-object
*/
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake];
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined;
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
/**
* Message flags combined as a bitfield
*/
flags?: MessageFlags;
}>;
flags?: MessageFlags | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#create-message
@@ -272,7 +306,7 @@ export type RESTPostAPIChannelMessageFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
@@ -335,24 +369,24 @@ export type RESTDeleteAPIChannelMessageReactionResult = never;
/**
* https://discord.com/developers/docs/resources/channel#edit-message
*/
export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIChannelMessageJSONBody {
/**
* The new message contents (up to 2000 characters)
*/
content?: string | null;
content?: string | null | undefined;
/**
* Embedded `rich` content (up to 6000 characters)
*
* See https://discord.com/developers/docs/resources/channel#embed-object
*/
embeds?: APIEmbed[] | null;
embeds?: APIEmbed[] | null | undefined;
/**
* Embedded `rich` content
*
* See https://discord.com/developers/docs/resources/channel#embed-object
* @deprecated Use `embeds` instead
*/
embed?: APIEmbed | null;
embed?: APIEmbed | null | undefined;
/**
* Edit the flags of a message (only `SUPPRESS_EMBEDS` can currently be set/unset)
*
@@ -361,13 +395,13 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-flags
*/
flags?: MessageFlags | null;
flags?: MessageFlags | null | undefined;
/**
* Allowed mentions for the message
*
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
*/
allowed_mentions?: APIAllowedMentions | null;
allowed_mentions?: APIAllowedMentions | null | undefined;
/**
* Attached files to keep
*
@@ -375,14 +409,14 @@ export type RESTPatchAPIChannelMessageJSONBody = AddUndefinedToPossiblyUndefined
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[];
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
/**
* The components to include with the message
*
* See https://discord.com/developers/docs/interactions/message-components#component-object
*/
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null;
}>;
components?: APIActionRowComponent<APIMessageActionRowComponent>[] | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#edit-message
@@ -392,7 +426,7 @@ export type RESTPatchAPIChannelMessageFormDataBody =
/**
* JSON stringified message body
*/
payload_json?: string;
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
@@ -432,7 +466,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
*
* @default "0"
*/
allow?: Permissions | null;
allow?: Permissions | null | undefined;
/**
* The bitwise value of all disallowed permissions
*
@@ -440,7 +474,7 @@ export interface RESTPutAPIChannelPermissionJSONBody {
*
* @default "0"
*/
deny?: Permissions | null;
deny?: Permissions | null | undefined;
/**
* `0` for a role or `1` for a member
*/
@@ -460,51 +494,51 @@ export type RESTGetAPIChannelInvitesResult = APIExtendedInvite[];
/**
* https://discord.com/developers/docs/resources/channel#create-channel-invite
*/
export type RESTPostAPIChannelInviteJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIChannelInviteJSONBody {
/**
* Duration of invite in seconds before expiry, or 0 for never
*
* @default 86400 (24 hours)
*/
max_age?: number;
max_age?: number | undefined;
/**
* Max number of uses or 0 for unlimited
*
* @default 0
*/
max_uses?: number;
max_uses?: number | undefined;
/**
* Whether this invite only grants temporary membership
*
* @default false
*/
temporary?: boolean;
temporary?: boolean | undefined;
/**
* If true, don't try to reuse a similar invite
* (useful for creating many unique one time use invites)
*
* @default false
*/
unique?: boolean;
unique?: boolean | undefined;
/**
* The type of target for this voice channel invite
*
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
*/
target_type?: InviteTargetType;
target_type?: InviteTargetType | undefined;
/**
* The id of the user whose stream to display for this invite
* - Required if `target_type` is 1
* - The user must be streaming in the channel
*/
target_user_id?: Snowflake;
target_user_id?: Snowflake | undefined;
/**
* The id of the embedded application to open for this invite
* - Required if `target_type` is 2
* - The application must have the `EMBEDDED` flag
*/
target_application_id?: Snowflake;
}>;
target_application_id?: Snowflake | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#create-channel-invite
@@ -554,7 +588,7 @@ export type RESTDeleteAPIChannelPinResult = never;
/**
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
*/
export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPutAPIChannelRecipientJSONBody {
/**
* Access token of a user that has granted your app the `gdm.join` scope
*/
@@ -562,8 +596,8 @@ export type RESTPutAPIChannelRecipientJSONBody = AddUndefinedToPossiblyUndefined
/**
* Nickname of the user being added
*/
nick?: string;
}>;
nick?: string | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
@@ -578,7 +612,7 @@ export type RESTDeleteAPIChannelRecipientResult = unknown;
/**
* https://discord.com/developers/docs/resources/channel#start-thread-from-message
*/
export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIChannelMessagesThreadsJSONBody {
/**
* 1-100 character thread name
*/
@@ -592,8 +626,8 @@ export type RESTPostAPIChannelMessagesThreadsJSONBody = AddUndefinedToPossiblyUn
/**
* Amount of seconds a user has to wait before sending another message (0-21600)
*/
rate_limit_per_user?: number;
}>;
rate_limit_per_user?: number | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#start-thread-in-forum-channel
@@ -603,6 +637,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; limited to 5
*/
applied_tags?: Snowflake[] | undefined;
};
/**
@@ -623,24 +661,23 @@ export type RESTPostAPIChannelMessagesThreadsResult = APIChannel;
/**
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
*/
export type RESTPostAPIChannelThreadsJSONBody = RESTPostAPIChannelMessagesThreadsJSONBody &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* The type of thread to create
*
* In API v9, `type` defaults to `PRIVATE_THREAD`.
* In a future API version this will be changed to be a required field, with no default.
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*
* @default ChannelType.GuildPrivateThread
*/
type?: ChannelType.GuildNewsThread | ChannelType.GuildPublicThread | ChannelType.GuildPrivateThread;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/
invitable?: boolean;
}>;
export interface RESTPostAPIChannelThreadsJSONBody extends RESTPostAPIChannelMessagesThreadsJSONBody {
/**
* The type of thread to create
*
* In API v9, `type` defaults to `PRIVATE_THREAD`.
* In a future API version this will be changed to be a required field, with no default.
*
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
*
* @default ChannelType.PrivateThread
*/
type?: ChannelType.AnnouncementThread | ChannelType.PublicThread | ChannelType.PrivateThread | undefined;
/**
* Whether non-moderators can add other non-moderators to the thread; only available when creating a private thread
*/
invitable?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#start-thread-without-message
@@ -657,6 +694,39 @@ export type RESTPutAPIChannelThreadMembersResult = never;
*/
export type RESTDeleteAPIChannelThreadMembersResult = never;
/**
* https://discord.com/developers/docs/resources/channel#get-thread-member
*/
export interface RESTGetAPIChannelThreadMemberQuery {
/**
* Whether to include a guild member object for the thread member
*/
with_member?: boolean;
}
/**
* https://discord.com/developers/docs/resources/channel#get-thread-member
*/
export type RESTGetAPIChannelThreadMemberResult = APIThreadMember;
/**
* https://discord.com/developers/docs/resources/channel#list-thread-members
*/
export interface RESTGetAPIChannelThreadMembersQuery {
/**
* Whether to include a guild member object for each thread member
*/
with_member?: boolean;
/**
* Get thread members after this user ID
*/
after?: Snowflake;
/**
* Max number of thread members to return (1-100). Defaults to 100
*/
limit?: number;
}
/**
* https://discord.com/developers/docs/resources/channel#list-thread-members
*/
@@ -676,10 +746,20 @@ export interface RESTGetAPIChannelThreadsArchivedQuery {
limit?: number;
}
/**
* https://discord.com/developers/docs/resources/channel#list-public-archived-threads
*/
export type RESTGetAPIChannelThreadsArchivedPublicResult = RESTGetAPIChannelUsersThreadsArchivedResult;
/**
* https://discord.com/developers/docs/resources/channel#list-private-archived-threads
*/
export type RESTGetAPIChannelThreadsArchivedPrivateResult = RESTGetAPIChannelUsersThreadsArchivedResult;
/**
* https://discord.com/developers/docs/resources/channel#list-active-threads
*
* @deprecated Removed in API v10, use [List Active Guild Threads](https://discord.com/developers/docs/resources/guild#list-active-threads) instead.
* @deprecated Removed in API v10, use [List Active Guild Threads](https://discord.com/developers/docs/resources/guild#list-active-guild-threads) instead.
*/
export type RESTGetAPIChannelThreadsResult = APIThreadList;

View File

@@ -1,6 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { APIEmoji } from '../../payloads/v9/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface } from '../../utils/internals.ts';
/**
* https://discord.com/developers/docs/resources/emoji#list-guild-emojis
@@ -15,7 +14,7 @@ export type RESTGetAPIGuildEmojiResult = APIEmoji;
/**
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params
*/
export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildEmojiJSONBody {
/**
* Name of the emoji
*/
@@ -29,8 +28,8 @@ export type RESTPostAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPrope
/**
* Roles for which this emoji will be whitelisted
*/
roles?: Snowflake[];
}>;
roles?: Snowflake[] | undefined;
}
/**
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji
@@ -40,16 +39,16 @@ export type RESTPostAPIGuildEmojiResult = APIEmoji;
/**
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
*/
export type RESTPatchAPIGuildEmojiJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildEmojiJSONBody {
/**
* Name of the emoji
*/
name?: string;
name?: string | undefined;
/**
* Roles for which this emoji will be whitelisted
*/
roles?: Snowflake[] | null;
}>;
roles?: Snowflake[] | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji

View File

@@ -26,7 +26,6 @@ import type {
APIGroupDMChannel,
} from '../../payloads/v9/mod.ts';
import type {
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
DistributiveOmit,
DistributivePick,
Nullable,
@@ -53,14 +52,18 @@ export type APIGuildCreatePartialChannel = StrictPartial<
| 'rtc_region'
| 'video_quality_mode'
| 'flags'
| 'default_reaction_emoji'
| 'available_tags'
| 'default_sort_order'
| 'default_forum_layout'
| 'default_thread_rate_limit_per_user'
>
> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
name: string;
id?: number | string;
parent_id?: number | string | null;
permission_overwrites?: APIGuildCreateOverwrite[];
}>;
> & {
name: string;
id?: number | string | undefined;
parent_id?: number | string | null | undefined;
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
};
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
id: number | string;
@@ -69,7 +72,7 @@ export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
/**
* https://discord.com/developers/docs/resources/guild#create-guild
*/
export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildsJSONBody {
/**
* Name of the guild (2-100 characters)
*/
@@ -79,31 +82,31 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
region?: string;
region?: string | undefined;
/**
* base64 1024x1024 png/jpeg image for the guild icon
*
* See https://discord.com/developers/docs/reference#image-data
*/
icon?: string;
icon?: string | undefined;
/**
* Verification level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
*/
verification_level?: GuildVerificationLevel;
verification_level?: GuildVerificationLevel | undefined;
/**
* Default message notification level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
*/
default_message_notifications?: GuildDefaultMessageNotifications;
default_message_notifications?: GuildDefaultMessageNotifications | undefined;
/**
* Explicit content filter level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
*/
explicit_content_filter?: GuildExplicitContentFilter;
explicit_content_filter?: GuildExplicitContentFilter | undefined;
/**
* New guild roles
*
@@ -116,7 +119,7 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*
* See https://discord.com/developers/docs/topics/permissions#role-object
*/
roles?: APIGuildCreateRole[];
roles?: APIGuildCreateRole[] | undefined;
/**
* New guild's channels
*
@@ -129,30 +132,30 @@ export type RESTPostAPIGuildsJSONBody = AddUndefinedToPossiblyUndefinedPropertie
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
channels?: APIGuildCreatePartialChannel[];
channels?: APIGuildCreatePartialChannel[] | undefined;
/**
* ID for afk channel
*/
afk_channel_id?: number | Snowflake | null;
afk_channel_id?: number | Snowflake | null | undefined;
/**
* AFK timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: number;
afk_timeout?: 60 | 300 | 900 | 1800 | 3600 | undefined;
/**
* The id of the channel where guild notices such as welcome messages and boost events are posted
*/
system_channel_id?: number | Snowflake | null;
system_channel_id?: number | Snowflake | null | undefined;
/**
* System channel flags
*
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
*/
system_channel_flags?: GuildSystemChannelFlags;
system_channel_flags?: GuildSystemChannelFlags | undefined;
/**
* Whether the boosts progress bar should be enabled.
*/
premium_progress_bar_enabled?: boolean;
}>;
premium_progress_bar_enabled?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#create-guild
@@ -201,106 +204,106 @@ export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild
*/
export type RESTPatchAPIGuildJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildJSONBody {
/**
* New name for the guild (2-100 characters)
*/
name?: string;
name?: string | undefined;
/**
* Voice region id
*
* See https://discord.com/developers/docs/resources/voice#voice-region-object
*/
region?: string | null;
region?: string | null | undefined;
/**
* Verification level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
*/
verification_level?: GuildVerificationLevel | null;
verification_level?: GuildVerificationLevel | null | undefined;
/**
* Default message notification level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
*/
default_message_notifications?: GuildDefaultMessageNotifications | null;
default_message_notifications?: GuildDefaultMessageNotifications | null | undefined;
/**
* Explicit content filter level
*
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
*/
explicit_content_filter?: GuildExplicitContentFilter | null;
explicit_content_filter?: GuildExplicitContentFilter | null | undefined;
/**
* ID for afk channel
*/
afk_channel_id?: Snowflake | null;
afk_channel_id?: Snowflake | null | undefined;
/**
* AFK timeout in seconds
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: number;
afk_timeout?: 60 | 300 | 900 | 1800 | 3600 | undefined;
/**
* base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature)
*
* See https://discord.com/developers/docs/reference#image-data
*/
icon?: string | null;
icon?: string | null | undefined;
/**
* User id to transfer guild ownership to (must be owner)
*/
owner_id?: Snowflake;
owner_id?: Snowflake | undefined;
/**
* base64 16:9 png/jpeg image for the guild splash (when the guild has `INVITE_SPLASH` feature)
*
* See https://discord.com/developers/docs/reference#image-data
*/
splash?: string | null;
splash?: string | null | undefined;
/**
* base64 png/jpeg image for the guild discovery splash (when the guild has `DISCOVERABLE` feature)
*/
discovery_splash?: string | null;
discovery_splash?: string | null | undefined;
/**
* base64 16:9 png/jpeg image for the guild banner (when the server has the `BANNER` feature; can be animated gif when the server has the `ANIMATED_BANNER` feature)
*/
banner?: string | null;
banner?: string | null | undefined;
/**
* The id of the channel where guild notices such as welcome messages and boost events are posted
*/
system_channel_id?: Snowflake | null;
system_channel_id?: Snowflake | null | undefined;
/**
* System channel flags
*
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
*/
system_channel_flags?: GuildSystemChannelFlags;
system_channel_flags?: GuildSystemChannelFlags | undefined;
/**
* The id of the channel where Community guilds display rules and/or guidelines
*/
rules_channel_id?: Snowflake | null;
rules_channel_id?: Snowflake | null | undefined;
/**
* The id of the channel where admins and moderators of Community guilds receive notices from Discord
*/
public_updates_channel_id?: Snowflake | null;
public_updates_channel_id?: Snowflake | null | undefined;
/**
* The preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US"
*
* @default "en-US" (if the value is set to `null`)
*/
preferred_locale?: string | null;
preferred_locale?: string | null | undefined;
/**
* Enabled guild features
*
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
*/
features?: GuildFeature[];
features?: GuildFeature[] | undefined;
/**
* The description for the guild
*/
description?: string | null;
description?: string | null | undefined;
/**
* Whether the boosts progress bar should be enabled.
*/
premium_progress_bar_enabled?: boolean;
}>;
premium_progress_bar_enabled?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-guild
@@ -330,26 +333,24 @@ export type RESTPostAPIGuildChannelResult = APIChannel;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
*/
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Channel id
*/
id: Snowflake;
/**
* Sorting position of the channel
*/
position: number;
/**
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
*/
lock_permissions?: boolean;
/**
* The new parent id of this channel
*/
parent_id?: Snowflake | null;
}>
>;
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
/**
* Channel id
*/
id: Snowflake;
/**
* Sorting position of the channel
*/
position: number;
/**
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
*/
lock_permissions?: boolean | undefined;
/**
* The new parent id of this channel
*/
parent_id?: Snowflake | null | undefined;
}>;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
@@ -357,7 +358,7 @@ export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<
export type RESTPatchAPIGuildChannelPositionsResult = never;
/**
* https://discord.com/developers/docs/resources/guild#list-active-threads
* https://discord.com/developers/docs/resources/guild#list-active-guild-threads
*/
export type RESTGetAPIGuildThreadsResult = Omit<APIThreadList, 'has_more'>;
@@ -410,7 +411,7 @@ export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
/**
* https://discord.com/developers/docs/resources/guild#add-guild-member
*/
export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPutAPIGuildMemberJSONBody {
/**
* An oauth2 access token granted with the `guilds.join` to the bot's application for the user you want to add to the guild
*/
@@ -420,68 +421,68 @@ export type RESTPutAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPrope
*
* Requires `MANAGE_NICKNAMES` permission
*/
nick?: string;
nick?: string | undefined;
/**
* Array of role ids the member is assigned
*
* Requires `MANAGE_ROLES` permission
*/
roles?: Snowflake[];
roles?: Snowflake[] | undefined;
/**
* Whether the user is muted in voice channels
*
* Requires `MUTE_MEMBERS` permission
*/
mute?: boolean;
mute?: boolean | undefined;
/**
* Whether the user is deafened in voice channels
*
* Requires `DEAFEN_MEMBERS` permission
*/
deaf?: boolean;
}>;
deaf?: boolean | undefined;
}
export type RESTPutAPIGuildMemberResult = APIGuildMember | never;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-member
*/
export type RESTPatchAPIGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildMemberJSONBody {
/**
* Value to set users nickname to
*
* Requires `MANAGE_NICKNAMES` permission
*/
nick?: string | null;
nick?: string | null | undefined;
/**
* Array of role ids the member is assigned
*
* Requires `MANAGE_ROLES` permission
*/
roles?: Snowflake[] | null;
roles?: Snowflake[] | null | undefined;
/**
* Whether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channel
*
* Requires `MUTE_MEMBERS` permission
*/
mute?: boolean | null;
mute?: boolean | null | undefined;
/**
* Whether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channel
*
* Requires `DEAFEN_MEMBERS` permission
*/
deaf?: boolean | null;
deaf?: boolean | null | undefined;
/**
* ID of channel to move user to (if they are connected to voice)
*
* Requires `MOVE_MEMBERS` permission
*/
channel_id?: Snowflake | null;
channel_id?: Snowflake | null | undefined;
/**
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
*/
communication_disabled_until?: string | null;
}>;
communication_disabled_until?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#add-guild-member
@@ -493,26 +494,26 @@ export type RESTPatchAPIGuildMemberResult = APIGuildMember;
*
* @deprecated Use [Modify Current Member](https://discord.com/developers/docs/resources/guild#modify-current-member) instead.
*/
export type RESTPatchAPICurrentGuildMemberNicknameJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
/**
* Value to set users nickname to
*
* Requires `CHANGE_NICKNAME` permission
*/
nick?: string | null;
}>;
nick?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-current-member
*/
export type RESTPatchAPICurrentGuildMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPICurrentGuildMemberJSONBody {
/**
* Value to set users nickname to
*
* Requires `CHANGE_NICKNAME` permission
*/
nick?: string | null;
}>;
nick?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-nick
@@ -570,18 +571,24 @@ export type RESTGetAPIGuildBanResult = APIBan;
/**
* https://discord.com/developers/docs/resources/guild#create-guild-ban
*/
export type RESTPutAPIGuildBanJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPutAPIGuildBanJSONBody {
/**
* Number of days to delete messages for (0-7)
*
* @deprecated use `delete_message_seconds` instead
*/
delete_message_days?: number;
delete_message_days?: number | undefined;
/**
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
*/
delete_message_seconds?: number | undefined;
/**
* Reason for the ban
*
* @deprecated Removed in API v10, use the `X-Audit-Log-Reason` header instead.
*/
reason?: string;
}>;
reason?: string | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#create-guild-ban
@@ -601,46 +608,46 @@ export type RESTGetAPIGuildRolesResult = APIRole[];
/**
* https://discord.com/developers/docs/resources/guild#create-guild-role
*/
export type RESTPostAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildRoleJSONBody {
/**
* Name of the role
*
* @default "new role"
*/
name?: string | null;
name?: string | null | undefined;
/**
* Bitwise value of the enabled/disabled permissions
*
* @default "default role permissions in guild"
*/
permissions?: Permissions | null;
permissions?: Permissions | null | undefined;
/**
* RGB color value
*
* @default 0
*/
color?: number | null;
color?: number | null | undefined;
/**
* Whether the role should be displayed separately in the sidebar
*
* @default false
*/
hoist?: boolean | null;
hoist?: boolean | null | undefined;
/**
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
*/
icon?: string | null;
icon?: string | null | undefined;
/**
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
*/
unicode_emoji?: string | null;
unicode_emoji?: string | null | undefined;
/**
* Whether the role should be mentionable
*
* @default false
*/
mentionable?: boolean | null;
}>;
mentionable?: boolean | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#create-guild-role
@@ -650,18 +657,16 @@ export type RESTPostAPIGuildRoleResult = APIRole;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
*/
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Role id
*/
id: Snowflake;
/**
* Sorting position of the role
*/
position?: number;
}>
>;
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
/**
* Role id
*/
id: Snowflake;
/**
* Sorting position of the role
*/
position?: number | undefined;
}>;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
@@ -671,36 +676,36 @@ export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-role
*/
export type RESTPatchAPIGuildRoleJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildRoleJSONBody {
/**
* Name of the role
*/
name?: string | null;
name?: string | null | undefined;
/**
* Bitwise value of the enabled/disabled permissions
*/
permissions?: Permissions | null;
permissions?: Permissions | null | undefined;
/**
* RGB color value
*/
color?: number | null;
color?: number | null | undefined;
/**
* Whether the role should be displayed separately in the sidebar
*/
hoist?: boolean | null;
hoist?: boolean | null | undefined;
/**
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
*/
icon?: string | null;
icon?: string | null | undefined;
/**
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
*/
unicode_emoji?: string | null;
unicode_emoji?: string | null | undefined;
/**
* Whether the role should be mentionable
*/
mentionable?: boolean | null;
}>;
mentionable?: boolean | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-role
@@ -743,24 +748,24 @@ export interface RESTGetAPIGuildPruneCountResult {
/**
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
*/
export type RESTPostAPIGuildPruneJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildPruneJSONBody {
/**
* Number of days to count prune for (1 or more)
*
* @default 7
*/
days?: number;
days?: number | undefined;
/**
* Whether `pruned is returned, discouraged for large guilds
*
* @default true
*/
compute_prune_count?: boolean;
compute_prune_count?: boolean | undefined;
/**
* Role(s) to include
*/
include_roles?: Snowflake[];
}>;
include_roles?: Snowflake[] | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
@@ -837,40 +842,40 @@ export type RESTGetAPIGuildWidgetImageResult = ArrayBuffer;
export type RESTGetAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
export type RESTPatchAPIGuildMemberVerificationJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildMemberVerificationJSONBody {
/**
* Whether Membership Screening is enabled
*/
enabled?: boolean;
enabled?: boolean | undefined;
/**
* Array of field objects serialized in a string
*/
form_fields?: string;
form_fields?: string | undefined;
/**
* The server description to show in the screening form
*/
description?: string | null;
}>;
description?: string | null | undefined;
}
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
channel_id?: Snowflake | undefined;
/**
* Toggles the user's suppress state
*/
suppress?: boolean;
suppress?: boolean | undefined;
/**
* Sets the user's request to speak
*/
request_to_speak_timestamp?: string | null;
}>;
request_to_speak_timestamp?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
@@ -880,7 +885,7 @@ export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
/**
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
/**
* The id of the channel the user is currently in
*/
@@ -888,8 +893,13 @@ export type RESTPatchAPIGuildVoiceStateUserJSONBody = AddUndefinedToPossiblyUnde
/**
* Toggles the user's suppress state
*/
suppress?: boolean;
}>;
suppress?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateUserResult = never;
/**
* https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
@@ -899,13 +909,12 @@ export type RESTGetAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
*/
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* Whether the welcome screen is enabled
*/
enabled?: boolean | null;
}>;
export type RESTPatchAPIGuildWelcomeScreenJSONBody = Nullable<StrictPartial<APIGuildWelcomeScreen>> & {
/**
* Whether the welcome screen is enabled
*/
enabled?: boolean | null | undefined;
};
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen

View File

@@ -1,5 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
import type { StrictPartial } from '../../utils/internals.ts';
import type {
APIGuildScheduledEvent,
GuildScheduledEventEntityType,
@@ -27,11 +27,11 @@ export type RESTGetAPIGuildScheduledEventsResult = APIGuildScheduledEvent[];
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
*/
export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
export interface RESTPostAPIGuildScheduledEventJSONBody {
/**
* The stage channel id of the guild event
*/
channel_id?: Snowflake;
channel_id?: Snowflake | undefined;
/**
* The name of the guild event
*/
@@ -47,24 +47,24 @@ export type RESTPostAPIGuildScheduledEventJSONBody = AddUndefinedToPossiblyUndef
/**
* The time when the scheduled event is scheduled to end
*/
scheduled_end_time?: string;
scheduled_end_time?: string | undefined;
/**
* The description of the guild event
*/
description?: string;
description?: string | undefined;
/**
* The scheduled entity type of the guild event
*/
entity_type?: GuildScheduledEventEntityType;
entity_type?: GuildScheduledEventEntityType | undefined;
/**
* The entity metadata of the scheduled event
*/
entity_metadata?: APIGuildScheduledEventEntityMetadata;
entity_metadata?: APIGuildScheduledEventEntityMetadata | undefined;
/**
* The cover image of the scheduled event
*/
image?: string | null;
}>;
image?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
@@ -89,21 +89,20 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
*/
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<{
/**
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus;
/**
* The entity metadata of the scheduled event
*/
entity_metadata?: APIGuildScheduledEventEntityMetadata | null;
/**
* The description of the guild event
*/
description?: string | null;
}>;
export type RESTPatchAPIGuildScheduledEventJSONBody = StrictPartial<RESTPostAPIGuildScheduledEventJSONBody> & {
/**
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus | undefined;
/**
* The entity metadata of the scheduled event
*/
entity_metadata?: APIGuildScheduledEventEntityMetadata | null | undefined;
/**
* The description of the guild event
*/
description?: string | null | undefined;
};
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event

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