Compare commits

...

177 Commits

Author SHA1 Message Date
github-actions[bot]
907c1685a3 chore(release): 0.37.115 🎉 (#1189)
Build ran for 3f61ce43e9

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-01-02 14:42:09 +02:00
Vlad Frangu
3f61ce43e9 chore: revert for now and make the script fail in CI 2024-12-28 21:47:37 +02:00
Vlad Frangu
92d0ef46d9 ci: use correct on target 2024-12-28 21:35:36 +02:00
Vlad Frangu
b648c89b5e ci: assert the token used for the flow 2024-12-28 21:28:58 +02:00
Vlad Frangu
6ace234311 ci: use custom token for automatic deno reviews 2024-12-28 21:23:24 +02:00
github-actions[bot]
a9ba1e18bc chore(release): 0.37.114 🎉 (#1183)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-23 08:22:09 +02:00
Vlad Frangu
ee53ef7306 fix: reset pattern index after testing an input
Otherwise, we flip flop between validations
See https://github.com/discordjs/discord-api-types/issues/1181#issuecomment-2558971449
2024-12-23 08:17:44 +02:00
github-actions[bot]
cddd038a8b chore(release): 0.37.113 🎉 (#1182)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-22 22:13:56 +02:00
Vlad Frangu
fc4e7bebc5 fix: skip encoded url parts from re-encoding
DJS or other users may already do a sanity encoding, so we dont need to re-encode
2024-12-22 22:11:26 +02:00
renovate[bot]
a81f31178f chore(deps): lock file maintenance (#1180)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-20 12:17:28 +02:00
renovate[bot]
5c6e5ca7bb chore(deps): update dependency is-ci to v4 (#1168)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-20 12:16:07 +02:00
renovate[bot]
6c13d341a6 chore(deps): update patch/minor dependencies (#1164)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-20 12:15:19 +02:00
renovate[bot]
a7d019eab9 chore(deps): lock file maintenance (#1177)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-20 12:14:58 +02:00
dependabot[bot]
936a03982b chore(deps): bump nanoid from 3.3.6 to 3.3.8 in /website (#1169)
Bumps [nanoid](https://github.com/ai/nanoid) from 3.3.6 to 3.3.8.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.3.6...3.3.8)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-20 12:14:46 +02:00
dependabot[bot]
6d8fd9f3d8 chore(deps): bump path-to-regexp and express in /website (#1178)
Bumps [path-to-regexp](https://github.com/pillarjs/path-to-regexp) and [express](https://github.com/expressjs/express). These dependencies needed to be updated together.

Updates `path-to-regexp` from 1.8.0 to 1.9.0
- [Release notes](https://github.com/pillarjs/path-to-regexp/releases)
- [Changelog](https://github.com/pillarjs/path-to-regexp/blob/master/History.md)
- [Commits](https://github.com/pillarjs/path-to-regexp/compare/v1.8.0...v1.9.0)

Updates `express` from 4.21.1 to 4.21.2
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.21.1...4.21.2)

---
updated-dependencies:
- dependency-name: path-to-regexp
  dependency-type: indirect
- dependency-name: express
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-20 12:14:14 +02:00
dependabot[bot]
d222c61e0a chore(deps): bump ws from 7.5.8 to 7.5.10 in /website (#1179)
Bumps [ws](https://github.com/websockets/ws) from 7.5.8 to 7.5.10.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.5.8...7.5.10)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-20 12:13:23 +02:00
Vlad Frangu
9f327dd999 chore: docusaurus upgrade (#1163)
* chore: docusaurus upgrade

* chore: lock my file

* fix: oi

* chore: drop broken links to a warn

* chore: screw it, no direct link

* chore: doing it live

* chore: bring it back

* chore: remove client redirect as its needless

* chore: deno install bc why not

* chore: tabs
2024-12-20 12:09:23 +02:00
renovate[bot]
5d472cbfba chore(deps): lock file maintenance (#1165)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-12-20 01:04:56 +02:00
Naiyar
bcb13de75b feat(payloads): add entrypoint command payloads (#1166)
* feat: add entrypoint command payloads

* fix: data is present for entry point command interactions

* fix: missed export

* fix: lint

* fix: deno
2024-12-19 21:43:27 +02:00
Almeida
61592d6a85 feat(ConnectionService): Bluesky and Mastodon (#1174) 2024-12-19 21:40:25 +02:00
Jiralite
b3e818fd33 chore: use feature request label for feature requests (#1176) 2024-12-19 21:32:20 +02:00
github-actions[bot]
3faaf75970 chore(release): 0.37.112 🎉 (#1173)
Build ran for fb7c6b8903

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-19 14:29:49 +02:00
Danial Raza
fb7c6b8903 feat(APISubscription): add renewal_sku_ids (#1172) 2024-12-18 17:35:29 +02:00
github-actions[bot]
20f44ac7d9 chore(release): 0.37.111 🎉 (#1167)
Build ran for 68e19d38e4

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-12-09 13:29:27 +01:00
Danial Raza
68e19d38e4 chore(APIEntitlement): update ends_at and starts_at to be nullable (#1158) 2024-12-05 16:15:44 +00:00
renovate[bot]
534dc2f1be chore(deps): lock file maintenance (#1162)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-29 08:39:27 +02:00
github-actions[bot]
5c48554c8d chore(release): 0.37.110 🎉 (#1160)
Build ran for 92b1ce2fae

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-29 08:23:12 +02:00
renovate[bot]
c69bb52384 chore(deps): update patch/minor dependencies (#1161)
* chore(deps): update patch/minor dependencies

* chore: lint

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vlad Frangu <me@vladfrangu.dev>
2024-11-29 08:22:51 +02:00
Jiralite
92b1ce2fae feat: add Chrunchyroll (#1159) 2024-11-27 22:01:56 +02:00
github-actions[bot]
4a47ef8c83 chore(release): 0.37.109 🎉 (#1157)
Build ran for c52a3f6721

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-26 23:37:12 +02:00
Vlad Frangu
c52a3f6721 chore: trim down the website 2024-11-26 23:20:21 +02:00
Jiralite
079fcd6c00 feat: New entitlement endpoint behaviour (#1145)
* feat: new entitlement endpoint behaviour

* fix: correct `RESTGetAPIEntitlementResult`

* docs: update changes
2024-11-26 08:34:36 +02:00
github-actions[bot]
566ae49c74 chore(release): 0.37.108 🎉 (#1156)
Build ran for 2d22f2fcef

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-25 19:25:46 +02:00
Jiralite
2d22f2fcef refactor(GatewayThreadListSync): narrow threads (#1155) 2024-11-22 20:40:14 +02:00
Vlad Frangu
9b47ba562f chore(ci): unify flow in one 2024-11-22 19:34:49 +02:00
Vlad Frangu
2e6ad68151 chore: bye tsd 2024-11-22 19:33:17 +02:00
Vlad Frangu
9f1fa8c722 chore: bump tsd and ts 2024-11-22 19:05:35 +02:00
Vlad Frangu
ace02e2b9b chore: try to fix CI 2024-11-22 18:59:17 +02:00
Jiralite
e7f0caabaa refactor(APIThreadMetadata): locked is always present (#1154) 2024-11-22 18:55:35 +02:00
renovate[bot]
5350806773 chore(deps): lock file maintenance (#1153)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-22 08:09:29 +02:00
Danial Raza
ced86e4b42 feat: webhook events (#1128)
* feat: webhook events

* chore: fix naming because someone was high at Discord

* chore: fix build errors

* chore: woops

* chore: and now consistent

* docs: remove `.`

---------

Co-authored-by: Vlad Frangu <me@vladfrangu.dev>
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
2024-11-22 08:03:15 +02:00
Jiralite
8659ac8b8d refactor: narrow channel gateway events types (#1148) 2024-11-22 08:03:01 +02:00
renovate[bot]
029002b171 chore(deps): lock file maintenance (#1152)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-22 08:01:41 +02:00
renovate[bot]
68273caf10 chore(deps): update patch/minor dependencies (#1151)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-22 08:01:09 +02:00
github-actions[bot]
f65246f8fd chore(release): 0.37.107 🎉 (#1150)
Build ran for 1ba3472938

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-21 22:43:38 +02:00
Vlad Frangu
1ba3472938 fix(security): escape path parameters 2024-11-21 22:40:24 +02:00
github-actions[bot]
00954701e8 chore(release): 0.37.106 🎉 (#1149)
Build ran for 7debb55f03

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-21 14:27:54 +02:00
Danial Raza
7debb55f03 refactor: split interaction metadata objects (#1129) 2024-11-19 14:56:47 +02:00
Jiralite
f5ebb2088b refactor(GatewayGuildCreateDispatchData): Narrow channels and threads types (#1146)
* refactor: narrow guild create types

* refactor: use `GuildChannelType` and `ThreadChannelType`
2024-11-19 14:49:25 +02:00
renovate[bot]
999e48fae0 chore(deps): lock file maintenance (#1144)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-19 14:18:29 +02:00
github-actions[bot]
b3b4eb66c0 chore(release): 0.37.105 🎉 (#1143)
Build ran for 408165e96f

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-14 14:26:40 +02:00
Jiralite
408165e96f feat(_interactions): Support partial guild objects (#1142)
* feat: support partial guild objects

* docs: use `@unstable`
2024-11-13 17:09:19 +02:00
Almeida
3f489f18dc feat: guild member banners (#1057) 2024-11-13 08:03:59 +02:00
Jiralite
df0d390303 docs(RESTPostAPIChannelMessageJSONBody): Make message reference generic (#1139)
* docs: make message reference generic

* docs: keep 1:1 with Discord
2024-11-12 20:49:52 +02:00
renovate[bot]
7fa0e159d0 chore(deps): update dependency @typescript-eslint/utils to v8.14.0 (#1130)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-12 20:48:22 +02:00
Jiralite
f6984045f1 refactor: use Locale only (#1138) 2024-11-12 20:48:09 +02:00
renovate[bot]
092cf01f45 chore(deps): lock file maintenance (#1137)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-12 20:47:00 +02:00
Jiralite
3512262194 feat: full message object on message update (#1140) 2024-11-12 20:45:11 +02:00
github-actions[bot]
8ada51ac6d chore(release): 0.37.104 🎉 (#1136)
Build ran for 6813c62e9e

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-11-07 14:24:46 +02:00
renovate[bot]
6813c62e9e chore(deps): update dependency @types/node to v22 (#1131)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-05 23:38:15 +02:00
Danial Raza
88d8bed1ca fix: add missing soundboard types (#1134) 2024-11-05 23:38:00 +02:00
Danial Raza
736479cab3 fix(isInteractionButton): handle ButtonStyle.Premium (#1135) 2024-11-05 23:36:46 +02:00
dependabot[bot]
d673e5f9bb chore(deps): bump http-proxy-middleware from 2.0.6 to 2.0.7 in /website (#1126)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-01 08:02:34 +02:00
renovate[bot]
7af532c383 chore(deps): lock file maintenance (#1132)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-01 08:00:45 +02:00
renovate[bot]
76b393a7e4 chore(deps): lock file maintenance (#1127)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-25 08:07:47 +03:00
renovate[bot]
daacd2d1b5 chore(deps): update patch/minor dependencies (#1117)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-25 08:05:04 +03:00
renovate[bot]
756658ba85 chore(deps): lock file maintenance (#1118)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-25 08:02:00 +03:00
renovate[bot]
cc6121c2c0 chore(deps): update dependency @favware/npm-deprecate to v2 (#1124)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-25 08:01:42 +03:00
renovate[bot]
bfeaaae9a8 chore(deps): update dependency npm-run-all2 to v7 (#1125)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-25 08:01:26 +03:00
github-actions[bot]
82d02a487f chore(release): 0.37.103 🎉 (#1123)
Build ran for 76fc8f035b

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-21 15:26:21 +03:00
Pablo
76fc8f035b feat: soundboard audit log events (#1122) 2024-10-21 12:17:24 +03:00
Pablo
0fe6059753 feat: audit log change key for boost bar (#1120) 2024-10-21 09:27:52 +03:00
github-actions[bot]
122ddcb6b1 chore(release): 0.37.102 🎉 (#1116)
Build ran for 32cabcfcb3

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-10-14 15:26:32 +03:00
dependabot[bot]
32cabcfcb3 chore(deps): bump rollup from 2.75.4 to 2.79.2 in /website (#1110)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-13 19:04:35 +03:00
dependabot[bot]
6962103023 chore(deps): bump micromatch and markdownlint-cli2 in /website (#1115)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-13 19:04:24 +03:00
Pablo
4746e8d486 feat: recurrence rule change key on audit logs (#1112)
Co-authored-by: Vlad Frangu <me@vladfrangu.dev>
2024-10-13 19:04:02 +03:00
dependabot[bot]
ecf1a17b73 chore(deps): bump cookie and express in /website (#1114)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-13 19:03:33 +03:00
renovate[bot]
a0b7487a09 chore(deps): lock file maintenance (#1109)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-13 19:03:21 +03:00
Danial Raza
8d46830046 feat: soundboard (#1113)
Co-authored-by: Micah Benac <OfficialSirH@users.noreply.github.com>
2024-10-13 19:03:05 +03:00
renovate[bot]
ec9819bb2d chore(deps): update patch/minor dependencies (#1108)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-10-09 19:34:35 +03:00
github-actions[bot]
21e9732d85 chore(release): 0.37.101 🎉 (#1107)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-23 15:27:58 +03:00
advaith
240226f3d2 feat: add VoiceChannelEffectSend event (#739)
Co-authored-by: Almeida <almeidx@pm.me>
Co-authored-by: almeidx <github@almeidx.dev>
2024-09-23 14:15:59 +03:00
Almeida
57ee8db3b1 docs: missing gateway documentation links (#1106) 2024-09-22 17:56:52 +03:00
Almeida
2b653a00b3 feat: missing subscription dispatch types (#1105) 2024-09-22 16:02:23 +03:00
René
2ae232477a fix(rest/oauth2): correct string literal types containing bot scope (#1101) 2024-09-22 16:01:27 +03:00
renovate[bot]
5d95d970cf chore(deps): lock file maintenance (#1104)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-22 15:59:03 +03:00
renovate[bot]
2cc5730d32 chore(deps): lock file maintenance (#1103)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-20 03:56:29 +03:00
dependabot[bot]
b30a016db3 chore(deps): bump webpack from 5.73.0 to 5.94.0 in /website (#1087)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-18 07:18:58 +03:00
renovate[bot]
a620bb9f70 chore(deps): lock file maintenance (#1097)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-18 07:18:21 +03:00
renovate[bot]
087d682c3b chore(deps): update dependency tsd to v0.31.2 (#1095)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-18 07:06:25 +03:00
renovate[bot]
29944fee29 chore(deps): update patch/minor dependencies (#1096)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-09-18 07:05:34 +03:00
dependabot[bot]
a47eca9cb5 chore(deps): bump send and express in /website (#1100)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-18 07:05:02 +03:00
github-actions[bot]
7fe434114e chore(release): 0.37.100 🎉 (#1093)
Build ran for 258fb72f38

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-06 00:12:32 +03:00
Danial Raza
258fb72f38 fix(GatewayGuildDeleteDispatchData): make unavailable optional (#1092) 2024-09-05 23:24:48 +03:00
Almeida
93e649a20d feat(RESTJSONErrorCodes): add 40018, 40019, and 40094 (#1056) 2024-09-05 21:43:00 +03:00
Danial Raza
d3b5187c77 fix: replace deprecated RESTAPIPollCreate with RESTAPIPoll (#1091) 2024-09-05 19:01:05 +03:00
Almeida
344274b56c feat(MessageType): PurchaseNotification and PollResult (#1040) 2024-09-05 18:30:06 +03:00
Almeida
f770290717 feat(RESTPatchAPIWebhookWithTokenMessageJSONBody): poll (#1067) 2024-09-05 18:29:38 +03:00
Almeida
b4b70d8bdc feat: entry point commands and interaction callback response (#1077) 2024-09-05 18:29:23 +03:00
Almeida
3de4ca8933 feat(APIMessageSnapshotFields): add more fields (#1085) 2024-09-05 18:26:22 +03:00
Danial Raza
8f781909f1 feat: add subscriptions (#1078)
Co-authored-by: TÆMBØ <TAEMBO@users.noreply.github.com>
2024-09-05 18:26:11 +03:00
Danial Raza
3f3fe21e15 fix(APIMessageSnapshot): mark guild_id as deprecated (#1084) 2024-09-05 18:25:51 +03:00
Naiyar
011d439971 feat(ConnectionService): add Amazon Music connection (#1074) 2024-09-05 18:25:21 +03:00
Almeida
0938b664ce feat(FormattingPatterns): GuildNavigation and LinkedRole (#1089) 2024-09-05 18:25:01 +03:00
Naiyar
d1e64eea8d refactor(APIApplication): mark role_connections_verification_url and interactions_endpoint_url as nullable (#1090) 2024-09-05 18:23:26 +03:00
github-actions[bot]
557c534b67 chore(release): 0.37.99 🎉 (#1088)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-09-02 15:25:08 +03:00
renovate[bot]
8054f50230 chore(deps): update patch/minor dependencies (#1081)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-31 04:00:52 +03:00
renovate[bot]
74d80b1e77 chore(deps): lock file maintenance (#1082)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-31 04:00:40 +03:00
Danial Raza
a9c6985d63 docs: mark APIApplication#summary and APISticker#asset as unstable (#1080) 2024-08-31 04:00:22 +03:00
Almeida
4b64f84ddf feat: remove unstable from stable fields (#1086) 2024-08-31 03:59:52 +03:00
Almeida
2803e8df2f feat(GuildMemberFlags): IsGuest and DmSettingsUpsellAcknowledged (#1079) 2024-08-29 22:50:15 +03:00
github-actions[bot]
58848bed54 chore(release): 0.37.98 🎉 (#1076)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-26 15:23:06 +03:00
Almeida
f019f0fe97 feat(RESTAPIAttachment): add more properties (#1073) 2024-08-23 12:09:08 +03:00
renovate[bot]
e09ded64b3 chore(deps): lock file maintenance (#1072)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-23 12:08:21 +03:00
renovate[bot]
3aee5c4a0d chore(deps): lock file maintenance (#1071)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-23 11:46:22 +03:00
renovate[bot]
3455ed4cce chore(deps): update patch/minor dependencies (#1070)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-23 03:58:15 +03:00
github-actions[bot]
4ef182d009 chore(release): 0.37.97 🎉 (#1068)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-22 15:22:57 +03:00
Almeida
86a9f965dd refactor(rest): ensure types follow naming pattern (#1065)
Co-authored-by: Synbulat Biishev <signin@syjalo.dev>
2024-08-22 14:41:56 +03:00
github-actions[bot]
b90fddc285 chore(release): 0.37.96 🎉 (#1066)
Build ran for f67043b3f4

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-20 11:22:06 +03:00
Almeida
f67043b3f4 fix: nullable fields for scheduled event editing (#1064) 2024-08-19 17:48:33 +03:00
Almeida
19d2aeb4a8 fix: nullable recurrence_rule on patch (#1063) 2024-08-19 17:39:07 +03:00
github-actions[bot]
31b3766b19 chore(release): 0.37.95 🎉 (#1062)
Build ran for 1b1a865efe

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-19 15:23:04 +03:00
Naiyar
1b1a865efe feat(Routes): voice state endpoint (#1046) 2024-08-16 15:33:15 +03:00
renovate[bot]
a85521aa8b chore(deps): lock file maintenance (#1061)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-16 15:30:44 +03:00
renovate[bot]
8b00031c51 chore(deps): lock file maintenance (#1060)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-16 03:34:11 +03:00
Almeida
147e459a16 fix: interface name (#1059) 2024-08-15 21:16:59 +03:00
Almeida
fbfbc6b23f feat: recurring scheduled events (#1058) 2024-08-15 20:43:55 +03:00
Almeida
906dd8e241 feat(RESTJSONErrorCodes): UnknownStickerPack (#1055) 2024-08-15 20:02:28 +03:00
github-actions[bot]
25efb9c403 chore(release): 0.37.94 🎉 (#1054)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-08-15 15:32:12 +03:00
Almeida
822956fe78 feat: add Get Sticker Pack endpoint (#1053) 2024-08-15 01:58:20 +03:00
Almeida
d5047639e6 feat(APIApplication): approximate_user_install_count (#1052) 2024-08-15 01:54:52 +03:00
renovate[bot]
cbd8d108ee chore(deps): lock file maintenance (#1049)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-14 23:56:11 +03:00
renovate[bot]
d816bf31ab chore(deps): update dependency eslint-plugin-local to v6 (#1048)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-14 23:46:49 +03:00
renovate[bot]
71602b5c49 chore(deps): update patch/minor dependencies (#1047)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-14 23:46:07 +03:00
Lars_und_so
6ead98b782 feat(RESTOAuth2): add RESTPostOAuth2TokenRevocationQuery (#1050) 2024-08-14 23:45:29 +03:00
TÆMBØ
ea1a6c3c86 feat(Routes): get method on role endpoint (#1051) 2024-08-14 19:03:52 +01:00
renovate[bot]
a59f9f002f chore(deps): lock file maintenance (#1045)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-02 13:22:10 +03:00
renovate[bot]
ace41f38e4 chore(deps): lock file maintenance (#1044)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-02 13:12:14 +03:00
renovate[bot]
25a6f5330f chore(deps): update dependency @typescript-eslint/utils to v8 (#1042)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-02 12:59:39 +03:00
renovate[bot]
4409fc24c1 chore(deps): update dependency @types/node to v20.14.14 (#1041)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-02 12:59:29 +03:00
renovate[bot]
1178c23389 chore(deps): lock file maintenance (#1043)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-08-02 12:54:09 +03:00
renovate[bot]
34b0ddd105 chore(deps): lock file maintenance (#1039)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-26 09:40:44 +03:00
renovate[bot]
9c1fc9bdee chore(deps): update patch/minor dependencies (#1038)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-26 09:08:53 +03:00
github-actions[bot]
472fe5f837 chore(release): 0.37.93 🎉 (#1037)
Build ran for 588140c0a9

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-22 16:31:52 +04:00
Vlad Frangu
588140c0a9 chore: test for this in tsd land not ts land 2024-07-20 17:18:54 +04:00
Vlad Frangu
799044d3f0 chore: ensure routes definitions emit correct paths
to prevent a repeat of a bug
2024-07-20 17:07:37 +04:00
Back
eb7b3d90dd fix(CDNRoutes): inconsistency in route and wrong JSDoc (#1033) 2024-07-20 12:13:31 +03:00
Suneet Tipirneni
2c1ff0ea34 feat: add support for message forwarding (#971) 2024-07-20 12:11:45 +03:00
Danial Raza
5f22a6baca feat: application emojis (#1036) 2024-07-20 12:07:31 +03:00
renovate[bot]
cbcd51d093 chore(deps): lock file maintenance (#1035)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-20 12:07:01 +03:00
Almeida
4f66b4dd04 feat(ConnectionService): add Roblox (#1032) 2024-07-20 12:05:47 +03:00
Almeida
da9496f291 feat(RESTAPIPartialCurrentUserGuild): add banner (#1028) 2024-07-20 12:05:30 +03:00
renovate[bot]
b1e1c60a07 chore(deps): update patch/minor dependencies (#1034)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-20 12:04:12 +03:00
renovate[bot]
4fdc6db296 chore(deps): update dependency rimraf to v6 (#1030)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-15 01:23:09 +03:00
renovate[bot]
608f0fa8cd chore(deps): lock file maintenance (#1031)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-15 01:15:25 +03:00
renovate[bot]
0e8b624c3e chore(deps): update patch/minor dependencies (#1029)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-15 01:15:04 +03:00
renovate[bot]
1301b3417c chore(deps): update patch/minor dependencies (#1025)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-08 22:19:52 +03:00
renovate[bot]
e098870a08 chore(deps): lock file maintenance (#1026)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-07-06 13:58:10 +03:00
github-actions[bot]
2049dde09a chore(release): 0.37.92 🎉 (#1024)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-07-04 15:21:59 +03:00
Almeida
ea7cafaafa chore: ignore deprecated versions on linters (#1023) 2024-07-02 23:55:34 +03:00
Almeida
c05998de27 fix(RESTAPIPollCreate): optional properties (#1022) 2024-07-02 23:34:48 +03:00
renovate[bot]
f50ae60ea9 chore(deps): lock file maintenance (#1021)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-28 15:57:19 +03:00
renovate[bot]
0ebf2afb58 chore(deps): lock file maintenance (#1020)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-28 14:26:19 +03:00
renovate[bot]
ee09eafb76 chore(deps): lock file maintenance (#1019)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-28 04:38:05 +03:00
renovate[bot]
a7fac3dc04 chore(deps): update dependency eslint-plugin-local to v5 (#1018)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-28 04:12:39 +03:00
renovate[bot]
1fd407f481 chore(deps): update patch/minor dependencies (#1017)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-28 04:08:44 +03:00
github-actions[bot]
aa8e307f4d chore(release): 0.37.91 🎉 (#1016)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-27 15:21:42 +03:00
Danial Raza
897fd90bf2 feat(APIAttachment): add title (#1015) 2024-06-26 00:59:23 +03:00
Vlad Frangu
666f0e79bc chore: update my email 2024-06-24 16:07:34 +03:00
renovate[bot]
c9117a7bcc chore(deps): lock file maintenance (#1014)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-21 13:23:43 +03:00
renovate[bot]
fe7ba16e3c chore(deps): lock file maintenance (#1013)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-21 03:42:18 +03:00
renovate[bot]
643bf747be chore(deps): update patch/minor dependencies (#1012)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-21 03:42:04 +03:00
github-actions[bot]
0340b3c3a1 chore(release): 0.37.90 🎉 (#1011)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-06-18 21:09:32 +03:00
renovate[bot]
45ef182b79 chore(deps): lock file maintenance (#1009)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-18 21:07:00 +03:00
renovate[bot]
17c19750ae chore(deps): update patch/minor dependencies (#1008)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-06-18 15:51:20 +03:00
TÆMBØ
088dbe016f feat: add premium buttons (#1010) 2024-06-18 11:30:44 +03:00
dependabot[bot]
e3eb86936e chore(deps): bump braces from 3.0.2 to 3.0.3 in /website (#1007)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 15:23:12 +03:00
213 changed files with 35114 additions and 21223 deletions

View File

@@ -37,6 +37,9 @@ const schema = [
},
] as const;
const REST_TYPE_NAME_REGEX =
/^REST(?:Get|Patch|Post|Put|Delete)[a-zA-Z0-9]+(?:JSONBody|FormDataBody|URLEncodedData|Result|Query)$/;
export = {
rules: {
'explicitly-optional-undefined-properties': ESLintUtils.RuleCreator.withoutDocs<Options, 'missingOptional'>({
@@ -131,5 +134,54 @@ export = {
},
defaultOptions: [{ interfaceEndings: [] }],
}),
'rest-type-naming-convention': ESLintUtils.RuleCreator.withoutDocs<[{ whitelist: string[] }], 'invalidName'>({
create: (context) => {
const { whitelist } = context.options[0];
const whitelistSet = new Set(whitelist);
return {
'TSTypeAliasDeclaration, TSInterfaceDeclaration': (
node: TSESTree.TSTypeAliasDeclaration | TSESTree.TSInterfaceDeclaration,
) => {
if (node.id.type !== AST_NODE_TYPES.Identifier) {
return;
}
const { name } = node.id;
if (whitelistSet.has(name)) {
return;
}
if (!REST_TYPE_NAME_REGEX.test(name)) {
context.report({
node: node.id,
messageId: 'invalidName',
data: { name },
});
}
},
};
},
meta: {
messages: {
invalidName: `{{ name }} does not match REST type naming convention. Must match ${REST_TYPE_NAME_REGEX.source}.`,
},
type: 'problem',
schema: [
{
type: 'object',
properties: {
whitelist: {
type: 'array',
items: {
type: 'string',
},
},
},
},
] as const,
},
defaultOptions: [{ whitelist: [] }],
}),
},
};

View File

@@ -1 +1,12 @@
deno/
gateway/v6/*
payloads/v6/*
rest/v6/*
v6.ts
gateway/v8/*
payloads/v8/*
rest/v8/*
utils/v8.ts
v8.ts

View File

@@ -17,5 +17,57 @@
"typescript-sort-keys/string-enum": "off",
"unicorn/prefer-math-trunc": "off",
"jsdoc/no-undefined-types": "off"
}
},
"overrides": [
{
"files": ["rest/v10/*.ts", "rest/v9/*.ts"],
"excludedFiles": ["rest/v10/index.ts", "rest/v9/index.ts"],
"rules": {
"local/rest-type-naming-convention": [
"error",
{
"whitelist": [
"RESTAPIAttachment",
"RESTAPIChannelPatchOverwrite",
"RESTAPIGuildChannelResolvable",
"RESTAPIGuildCreateOverwrite",
"RESTAPIGuildCreatePartialChannel",
"RESTAPIGuildCreateRole",
"RESTAPIGuildOnboardingPrompt",
"RESTAPIGuildOnboardingPromptOption",
"RESTAPIInteractionCallbackActivityInstanceResource",
"RESTAPIInteractionCallbackObject",
"RESTAPIInteractionCallbackResourceObject",
"RESTAPIMessageReference",
"RESTAPIPartialCurrentUserGuild",
"RESTAPIPoll",
"RESTOAuth2AdvancedBotAuthorizationQuery",
"RESTOAuth2AdvancedBotAuthorizationQueryResult",
"RESTOAuth2AuthorizationQuery",
"RESTOAuth2BotAuthorizationQuery",
"RESTOAuth2ImplicitAuthorizationQuery",
"RESTOAuth2ImplicitAuthorizationURLFragmentResult",
// Deprecated types
"APIChannelPatchOverwrite",
"APIGuildChannelResolvable",
"APIGuildCreateOverwrite",
"APIGuildCreatePartialChannel",
"APIGuildCreateRole",
"APIMessageReferenceSend",
"GetAPIVoiceRegionsResult",
"RESTAPIModifyGuildOnboardingPromptData",
"RESTAPIModifyGuildOnboardingPromptOptionData",
"RESTAPIPollCreate",
"RESTDeleteAPIChannelMessageOwnReaction",
"RESTGetAPIStickerPack",
"RESTOAuth2AuthorizationQueryResult",
"RESTPostAPIEntitlementBody"
]
}
]
}
}
]
}

View File

@@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation.
Examples of behavior that contributes to creating a positive environment
include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
## Our Responsibilities

View File

@@ -74,9 +74,9 @@ The scope could be anything specifying the place of the commit change. For examp
The subject contains a succinct description of the change:
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize the first letter
- no dot (.) at the end
- use the imperative, present tense: "change" not "changed" nor "changes"
- don't capitalize the first letter
- no dot (.) at the end
### Body

View File

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

View File

@@ -1,6 +1,6 @@
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]
labels: [feature request]
body:
- type: markdown
attributes:

View File

@@ -33,24 +33,5 @@ jobs:
- name: Run TSC
run: npm run build:ci
tsd:
name: TSD checks
runs-on: ubuntu-latest
needs: testing
if: needs.testing.result == 'success'
steps:
- name: Checkout Project
uses: actions/checkout@v4
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install Dependencies
run: npm ci
- name: Run TSD
- name: Run Type Tests
run: npm run test:types

View File

@@ -24,3 +24,15 @@ CHANGELOG.md
# Format all of scripts
!scripts/**/*
!.prettierrc.mjs
# Deprecated versions
gateway/v6/*
payloads/v6/*
rest/v6/*
v6.ts
gateway/v8/*
payloads/v8/*
rest/v8/*
utils/v8.ts
v8.ts

View File

@@ -1,3 +1,268 @@
## [0.37.115](https://github.com/discordjs/discord-api-types/compare/0.37.114...0.37.115) (2025-01-02)
## [0.37.114](https://github.com/discordjs/discord-api-types/compare/0.37.113...0.37.114) (2024-12-23)
### Bug Fixes
* reset pattern index after testing an input ([ee53ef7](https://github.com/discordjs/discord-api-types/commit/ee53ef7306e73d6b9bf341503231186ef27403fb)), closes [/github.com/discordjs/discord-api-types/issues/1181#issuecomment-2558971449](https://github.com//github.com/discordjs/discord-api-types/issues/1181/issues/issuecomment-2558971449)
## [0.37.113](https://github.com/discordjs/discord-api-types/compare/0.37.112...0.37.113) (2024-12-22)
### Bug Fixes
* skip encoded url parts from re-encoding ([fc4e7be](https://github.com/discordjs/discord-api-types/commit/fc4e7bebc50fe67a0aa5c49a95793e53d3ff0da9))
### Features
* **ConnectionService:** `Bluesky` and `Mastodon` ([#1174](https://github.com/discordjs/discord-api-types/issues/1174)) ([61592d6](https://github.com/discordjs/discord-api-types/commit/61592d6a85232a6d675a6faeddc096ae3467df6a))
* **payloads:** add entrypoint command payloads ([#1166](https://github.com/discordjs/discord-api-types/issues/1166)) ([bcb13de](https://github.com/discordjs/discord-api-types/commit/bcb13de75b6b45e2a5c1ebde5fa77719123b7993))
## [0.37.112](https://github.com/discordjs/discord-api-types/compare/0.37.111...0.37.112) (2024-12-19)
### Features
* **APISubscription:** add `renewal_sku_ids` ([#1172](https://github.com/discordjs/discord-api-types/issues/1172)) ([fb7c6b8](https://github.com/discordjs/discord-api-types/commit/fb7c6b8903bded49c379ba61a520818ba5ab15ba))
## [0.37.111](https://github.com/discordjs/discord-api-types/compare/0.37.110...0.37.111) (2024-12-09)
## [0.37.110](https://github.com/discordjs/discord-api-types/compare/0.37.109...0.37.110) (2024-11-28)
### Features
* add Chrunchyroll ([#1159](https://github.com/discordjs/discord-api-types/issues/1159)) ([92b1ce2](https://github.com/discordjs/discord-api-types/commit/92b1ce2faee4c4b43bfe524e78cfde1fbbfa5792))
## [0.37.109](https://github.com/discordjs/discord-api-types/compare/0.37.108...0.37.109) (2024-11-26)
### Features
* New entitlement endpoint behaviour ([#1145](https://github.com/discordjs/discord-api-types/issues/1145)) ([079fcd6](https://github.com/discordjs/discord-api-types/commit/079fcd6c006759193ea0b4b97d0d5a34c0459041))
## [0.37.108](https://github.com/discordjs/discord-api-types/compare/0.37.107...0.37.108) (2024-11-25)
### Features
* webhook events ([#1128](https://github.com/discordjs/discord-api-types/issues/1128)) ([ced86e4](https://github.com/discordjs/discord-api-types/commit/ced86e4b42c170c855ee148fb9bdb699ddf1a15b))
## [0.37.107](https://github.com/discordjs/discord-api-types/compare/0.37.106...0.37.107) (2024-11-21)
### Bug Fixes
* **security:** escape path parameters ([1ba3472](https://github.com/discordjs/discord-api-types/commit/1ba34729386c9b9dece237e761114f6d1ef11143))
## [0.37.106](https://github.com/discordjs/discord-api-types/compare/0.37.105...0.37.106) (2024-11-21)
## [0.37.105](https://github.com/discordjs/discord-api-types/compare/0.37.104...0.37.105) (2024-11-14)
### Features
* **_interactions:** Support partial guild objects ([#1142](https://github.com/discordjs/discord-api-types/issues/1142)) ([408165e](https://github.com/discordjs/discord-api-types/commit/408165e96fdd08d56183cf3c5348ee08e8aec056))
* full message object on message update ([#1140](https://github.com/discordjs/discord-api-types/issues/1140)) ([3512262](https://github.com/discordjs/discord-api-types/commit/35122621946ab797d4c0b83cecdec1c3df05b6e0))
* guild member banners ([#1057](https://github.com/discordjs/discord-api-types/issues/1057)) ([3f489f1](https://github.com/discordjs/discord-api-types/commit/3f489f18dccf5efe9e4983e66606998fafffc4dd))
## [0.37.104](https://github.com/discordjs/discord-api-types/compare/0.37.103...0.37.104) (2024-11-07)
### Bug Fixes
* add missing soundboard types ([#1134](https://github.com/discordjs/discord-api-types/issues/1134)) ([88d8bed](https://github.com/discordjs/discord-api-types/commit/88d8bed1caa88b604fec8f60ae1450f556c26c8e))
* **isInteractionButton:** handle `ButtonStyle.Premium` ([#1135](https://github.com/discordjs/discord-api-types/issues/1135)) ([736479c](https://github.com/discordjs/discord-api-types/commit/736479cab3332f6be122965963d37c8d4c99fc7f))
## [0.37.103](https://github.com/discordjs/discord-api-types/compare/0.37.102...0.37.103) (2024-10-21)
### Features
* audit log change key for boost bar ([#1120](https://github.com/discordjs/discord-api-types/issues/1120)) ([0fe6059](https://github.com/discordjs/discord-api-types/commit/0fe605975312829702df02b6432fce6d58a00e1f))
* soundboard audit log events ([#1122](https://github.com/discordjs/discord-api-types/issues/1122)) ([76fc8f0](https://github.com/discordjs/discord-api-types/commit/76fc8f035b4c92329896eb8110eaa8d640bf8ec8))
## [0.37.102](https://github.com/discordjs/discord-api-types/compare/0.37.101...0.37.102) (2024-10-14)
### Features
* recurrence rule change key on audit logs ([#1112](https://github.com/discordjs/discord-api-types/issues/1112)) ([4746e8d](https://github.com/discordjs/discord-api-types/commit/4746e8d48600edf905037a9cb9507884876d9508))
* soundboard ([#1113](https://github.com/discordjs/discord-api-types/issues/1113)) ([8d46830](https://github.com/discordjs/discord-api-types/commit/8d468300467db1c0a1726b4dfc6e92018e40e800))
## [0.37.101](https://github.com/discordjs/discord-api-types/compare/0.37.100...0.37.101) (2024-09-23)
### Bug Fixes
* **rest/oauth2:** correct string literal types containing bot scope ([#1101](https://github.com/discordjs/discord-api-types/issues/1101)) ([2ae2324](https://github.com/discordjs/discord-api-types/commit/2ae232477a1362eb0bd5c4aeee4a97bfbca7b2a2))
### Features
* add `VoiceChannelEffectSend` event ([#739](https://github.com/discordjs/discord-api-types/issues/739)) ([240226f](https://github.com/discordjs/discord-api-types/commit/240226f3d2d32df378400671a6bf31ceb2468a3c))
* missing subscription dispatch types ([#1105](https://github.com/discordjs/discord-api-types/issues/1105)) ([2b653a0](https://github.com/discordjs/discord-api-types/commit/2b653a00b3acb04979b7656142f3d8ef986fd561))
## [0.37.100](https://github.com/discordjs/discord-api-types/compare/0.37.99...0.37.100) (2024-09-05)
### Bug Fixes
* **APIMessageSnapshot:** mark `guild_id` as deprecated ([#1084](https://github.com/discordjs/discord-api-types/issues/1084)) ([3f3fe21](https://github.com/discordjs/discord-api-types/commit/3f3fe21e153f2fbe6c76ba1cc916367551b175b6))
* **GatewayGuildDeleteDispatchData:** make `unavailable` optional ([#1092](https://github.com/discordjs/discord-api-types/issues/1092)) ([258fb72](https://github.com/discordjs/discord-api-types/commit/258fb72f38c0513030dc5e1ae60e34fc3f83006d))
* replace deprecated `RESTAPIPollCreate` with `RESTAPIPoll` ([#1091](https://github.com/discordjs/discord-api-types/issues/1091)) ([d3b5187](https://github.com/discordjs/discord-api-types/commit/d3b5187c77f845eba29ab56de41408bcea7e9cb4))
### Features
* add subscriptions ([#1078](https://github.com/discordjs/discord-api-types/issues/1078)) ([8f78190](https://github.com/discordjs/discord-api-types/commit/8f781909f1f5a0d1db8c3e134f4e9e1e22837277))
* **APIMessageSnapshotFields:** add more fields ([#1085](https://github.com/discordjs/discord-api-types/issues/1085)) ([3de4ca8](https://github.com/discordjs/discord-api-types/commit/3de4ca8933be23ac05bf780957aea99e4a70c2fe))
* **ConnectionService:** add Amazon Music connection ([#1074](https://github.com/discordjs/discord-api-types/issues/1074)) ([011d439](https://github.com/discordjs/discord-api-types/commit/011d439971e1f5ee11ba7caea5ed10131cafd6a6))
* entry point commands and interaction callback response ([#1077](https://github.com/discordjs/discord-api-types/issues/1077)) ([b4b70d8](https://github.com/discordjs/discord-api-types/commit/b4b70d8bdcdbc175497366e6bb74dd3bc22c6738))
* **FormattingPatterns:** `GuildNavigation` and `LinkedRole` ([#1089](https://github.com/discordjs/discord-api-types/issues/1089)) ([0938b66](https://github.com/discordjs/discord-api-types/commit/0938b664cef8fd3758506a2f689bb20ead616bb4))
* **MessageType:** `PurchaseNotification` and `PollResult` ([#1040](https://github.com/discordjs/discord-api-types/issues/1040)) ([344274b](https://github.com/discordjs/discord-api-types/commit/344274b56c25b9a35a64fc61b170c177ee702e95))
* **RESTJSONErrorCodes:** add `40018`, `40019`, and `40094` ([#1056](https://github.com/discordjs/discord-api-types/issues/1056)) ([93e649a](https://github.com/discordjs/discord-api-types/commit/93e649a20de0fda31b3276f8affb3cf6890ea693))
* **RESTPatchAPIWebhookWithTokenMessageJSONBody:** `poll` ([#1067](https://github.com/discordjs/discord-api-types/issues/1067)) ([f770290](https://github.com/discordjs/discord-api-types/commit/f7702907172f84b57175b6f6c80eb2de210f6a7b))
## [0.37.99](https://github.com/discordjs/discord-api-types/compare/0.37.98...0.37.99) (2024-09-02)
### Features
* **GuildMemberFlags:** `IsGuest` and `DmSettingsUpsellAcknowledged` ([#1079](https://github.com/discordjs/discord-api-types/issues/1079)) ([2803e8d](https://github.com/discordjs/discord-api-types/commit/2803e8df2f2105099a1dc6e04193355a926718b9))
* remove unstable from stable fields ([#1086](https://github.com/discordjs/discord-api-types/issues/1086)) ([4b64f84](https://github.com/discordjs/discord-api-types/commit/4b64f84ddf0390f0a8979f57623c5f8c9051484d))
## [0.37.98](https://github.com/discordjs/discord-api-types/compare/0.37.97...0.37.98) (2024-08-26)
### Features
* **RESTAPIAttachment:** add more properties ([#1073](https://github.com/discordjs/discord-api-types/issues/1073)) ([f019f0f](https://github.com/discordjs/discord-api-types/commit/f019f0fe97ad47471dd6656e5fb148dc5761e1e0))
## [0.37.97](https://github.com/discordjs/discord-api-types/compare/0.37.96...0.37.97) (2024-08-22)
## [0.37.96](https://github.com/discordjs/discord-api-types/compare/0.37.95...0.37.96) (2024-08-20)
### Bug Fixes
* nullable `recurrence_rule` on patch ([#1063](https://github.com/discordjs/discord-api-types/issues/1063)) ([19d2aeb](https://github.com/discordjs/discord-api-types/commit/19d2aeb4a82dc781558240a674c36eadce270abf))
* nullable fields for scheduled event editing ([#1064](https://github.com/discordjs/discord-api-types/issues/1064)) ([f67043b](https://github.com/discordjs/discord-api-types/commit/f67043b3f46eea7286e959d223b78d140deac318))
## [0.37.95](https://github.com/discordjs/discord-api-types/compare/0.37.94...0.37.95) (2024-08-19)
### Bug Fixes
* interface name ([#1059](https://github.com/discordjs/discord-api-types/issues/1059)) ([147e459](https://github.com/discordjs/discord-api-types/commit/147e459a16c8b0e15a0dd50f75d62c6dd9098815))
### Features
* recurring scheduled events ([#1058](https://github.com/discordjs/discord-api-types/issues/1058)) ([fbfbc6b](https://github.com/discordjs/discord-api-types/commit/fbfbc6b23f2696f6db5fad8ea1543327d5b3cf07))
* **RESTJSONErrorCodes:** `UnknownStickerPack` ([#1055](https://github.com/discordjs/discord-api-types/issues/1055)) ([906dd8e](https://github.com/discordjs/discord-api-types/commit/906dd8e241be6acdf4d6d7b10ce4e7c139b0fd8b))
* **Routes:** voice state endpoint ([#1046](https://github.com/discordjs/discord-api-types/issues/1046)) ([1b1a865](https://github.com/discordjs/discord-api-types/commit/1b1a865efe4d95b34055616ed18dc3613b58f317))
## [0.37.94](https://github.com/discordjs/discord-api-types/compare/0.37.93...0.37.94) (2024-08-15)
### Features
* add Get Sticker Pack endpoint ([#1053](https://github.com/discordjs/discord-api-types/issues/1053)) ([822956f](https://github.com/discordjs/discord-api-types/commit/822956fe788f8eeda5da683189973bd6667cbc96))
* **APIApplication:** `approximate_user_install_count` ([#1052](https://github.com/discordjs/discord-api-types/issues/1052)) ([d504763](https://github.com/discordjs/discord-api-types/commit/d5047639e691cc26e865cc6c06a312e09f0fb4c7))
* **RESTOAuth2:** add RESTPostOAuth2TokenRevocationQuery ([#1050](https://github.com/discordjs/discord-api-types/issues/1050)) ([6ead98b](https://github.com/discordjs/discord-api-types/commit/6ead98b78218830fee308a0425d9078957a662b2))
* **Routes:** get method on role endpoint ([#1051](https://github.com/discordjs/discord-api-types/issues/1051)) ([ea1a6c3](https://github.com/discordjs/discord-api-types/commit/ea1a6c3c86ec0d4c663e2191a488a3716ecdd7cc))
## [0.37.93](https://github.com/discordjs/discord-api-types/compare/0.37.92...0.37.93) (2024-07-22)
### Bug Fixes
* **CDNRoutes:** inconsistency in route and wrong JSDoc ([#1033](https://github.com/discordjs/discord-api-types/issues/1033)) ([eb7b3d9](https://github.com/discordjs/discord-api-types/commit/eb7b3d90dd6a847b80d051006a597e77d70caab2))
### Features
* add support for message forwarding ([#971](https://github.com/discordjs/discord-api-types/issues/971)) ([2c1ff0e](https://github.com/discordjs/discord-api-types/commit/2c1ff0ea3443fb500315d6c69674a875a11addf6))
* application emojis ([#1036](https://github.com/discordjs/discord-api-types/issues/1036)) ([5f22a6b](https://github.com/discordjs/discord-api-types/commit/5f22a6bacabef6b11e170a6f67694359bb3180e8))
* **ConnectionService:** add `Roblox` ([#1032](https://github.com/discordjs/discord-api-types/issues/1032)) ([4f66b4d](https://github.com/discordjs/discord-api-types/commit/4f66b4dd049d2ace638374c09a06272bd517ad3a))
* **RESTAPIPartialCurrentUserGuild:** add `banner` ([#1028](https://github.com/discordjs/discord-api-types/issues/1028)) ([da9496f](https://github.com/discordjs/discord-api-types/commit/da9496f291fff364b8d35b02363b93933c19823a))
## [0.37.92](https://github.com/discordjs/discord-api-types/compare/0.37.91...0.37.92) (2024-07-04)
### Bug Fixes
* **RESTAPIPollCreate:** optional properties ([#1022](https://github.com/discordjs/discord-api-types/issues/1022)) ([c05998d](https://github.com/discordjs/discord-api-types/commit/c05998de274ef7a8d570db9d23c9ad9c228eeccc))
## [0.37.91](https://github.com/discordjs/discord-api-types/compare/0.37.90...0.37.91) (2024-06-27)
### Features
* **APIAttachment:** add `title` ([#1015](https://github.com/discordjs/discord-api-types/issues/1015)) ([897fd90](https://github.com/discordjs/discord-api-types/commit/897fd90bf2705d6ff5eebbb21fa8e735fc1e1e22))
## [0.37.90](https://github.com/discordjs/discord-api-types/compare/0.37.89...0.37.90) (2024-06-18)
### Features
* add premium buttons ([#1010](https://github.com/discordjs/discord-api-types/issues/1010)) ([088dbe0](https://github.com/discordjs/discord-api-types/commit/088dbe016fdb72fb751931938bf7240c34fa64c0))
## [0.37.89](https://github.com/discordjs/discord-api-types/compare/0.37.88...0.37.89) (2024-06-13)

View File

@@ -77,25 +77,25 @@ import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
The exports of each API version is split into three main parts:
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
**A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs),
that are mentioned in an open pull request, or known through other means _and have received the green light to be used_.

View File

@@ -1,3 +1,268 @@
## [0.37.115](https://github.com/discordjs/discord-api-types/compare/0.37.114...0.37.115) (2025-01-02)
## [0.37.114](https://github.com/discordjs/discord-api-types/compare/0.37.113...0.37.114) (2024-12-23)
### Bug Fixes
* reset pattern index after testing an input ([ee53ef7](https://github.com/discordjs/discord-api-types/commit/ee53ef7306e73d6b9bf341503231186ef27403fb)), closes [/github.com/discordjs/discord-api-types/issues/1181#issuecomment-2558971449](https://github.com//github.com/discordjs/discord-api-types/issues/1181/issues/issuecomment-2558971449)
## [0.37.113](https://github.com/discordjs/discord-api-types/compare/0.37.112...0.37.113) (2024-12-22)
### Bug Fixes
* skip encoded url parts from re-encoding ([fc4e7be](https://github.com/discordjs/discord-api-types/commit/fc4e7bebc50fe67a0aa5c49a95793e53d3ff0da9))
### Features
* **ConnectionService:** `Bluesky` and `Mastodon` ([#1174](https://github.com/discordjs/discord-api-types/issues/1174)) ([61592d6](https://github.com/discordjs/discord-api-types/commit/61592d6a85232a6d675a6faeddc096ae3467df6a))
* **payloads:** add entrypoint command payloads ([#1166](https://github.com/discordjs/discord-api-types/issues/1166)) ([bcb13de](https://github.com/discordjs/discord-api-types/commit/bcb13de75b6b45e2a5c1ebde5fa77719123b7993))
## [0.37.112](https://github.com/discordjs/discord-api-types/compare/0.37.111...0.37.112) (2024-12-19)
### Features
* **APISubscription:** add `renewal_sku_ids` ([#1172](https://github.com/discordjs/discord-api-types/issues/1172)) ([fb7c6b8](https://github.com/discordjs/discord-api-types/commit/fb7c6b8903bded49c379ba61a520818ba5ab15ba))
## [0.37.111](https://github.com/discordjs/discord-api-types/compare/0.37.110...0.37.111) (2024-12-09)
## [0.37.110](https://github.com/discordjs/discord-api-types/compare/0.37.109...0.37.110) (2024-11-28)
### Features
* add Chrunchyroll ([#1159](https://github.com/discordjs/discord-api-types/issues/1159)) ([92b1ce2](https://github.com/discordjs/discord-api-types/commit/92b1ce2faee4c4b43bfe524e78cfde1fbbfa5792))
## [0.37.109](https://github.com/discordjs/discord-api-types/compare/0.37.108...0.37.109) (2024-11-26)
### Features
* New entitlement endpoint behaviour ([#1145](https://github.com/discordjs/discord-api-types/issues/1145)) ([079fcd6](https://github.com/discordjs/discord-api-types/commit/079fcd6c006759193ea0b4b97d0d5a34c0459041))
## [0.37.108](https://github.com/discordjs/discord-api-types/compare/0.37.107...0.37.108) (2024-11-25)
### Features
* webhook events ([#1128](https://github.com/discordjs/discord-api-types/issues/1128)) ([ced86e4](https://github.com/discordjs/discord-api-types/commit/ced86e4b42c170c855ee148fb9bdb699ddf1a15b))
## [0.37.107](https://github.com/discordjs/discord-api-types/compare/0.37.106...0.37.107) (2024-11-21)
### Bug Fixes
* **security:** escape path parameters ([1ba3472](https://github.com/discordjs/discord-api-types/commit/1ba34729386c9b9dece237e761114f6d1ef11143))
## [0.37.106](https://github.com/discordjs/discord-api-types/compare/0.37.105...0.37.106) (2024-11-21)
## [0.37.105](https://github.com/discordjs/discord-api-types/compare/0.37.104...0.37.105) (2024-11-14)
### Features
* **_interactions:** Support partial guild objects ([#1142](https://github.com/discordjs/discord-api-types/issues/1142)) ([408165e](https://github.com/discordjs/discord-api-types/commit/408165e96fdd08d56183cf3c5348ee08e8aec056))
* full message object on message update ([#1140](https://github.com/discordjs/discord-api-types/issues/1140)) ([3512262](https://github.com/discordjs/discord-api-types/commit/35122621946ab797d4c0b83cecdec1c3df05b6e0))
* guild member banners ([#1057](https://github.com/discordjs/discord-api-types/issues/1057)) ([3f489f1](https://github.com/discordjs/discord-api-types/commit/3f489f18dccf5efe9e4983e66606998fafffc4dd))
## [0.37.104](https://github.com/discordjs/discord-api-types/compare/0.37.103...0.37.104) (2024-11-07)
### Bug Fixes
* add missing soundboard types ([#1134](https://github.com/discordjs/discord-api-types/issues/1134)) ([88d8bed](https://github.com/discordjs/discord-api-types/commit/88d8bed1caa88b604fec8f60ae1450f556c26c8e))
* **isInteractionButton:** handle `ButtonStyle.Premium` ([#1135](https://github.com/discordjs/discord-api-types/issues/1135)) ([736479c](https://github.com/discordjs/discord-api-types/commit/736479cab3332f6be122965963d37c8d4c99fc7f))
## [0.37.103](https://github.com/discordjs/discord-api-types/compare/0.37.102...0.37.103) (2024-10-21)
### Features
* audit log change key for boost bar ([#1120](https://github.com/discordjs/discord-api-types/issues/1120)) ([0fe6059](https://github.com/discordjs/discord-api-types/commit/0fe605975312829702df02b6432fce6d58a00e1f))
* soundboard audit log events ([#1122](https://github.com/discordjs/discord-api-types/issues/1122)) ([76fc8f0](https://github.com/discordjs/discord-api-types/commit/76fc8f035b4c92329896eb8110eaa8d640bf8ec8))
## [0.37.102](https://github.com/discordjs/discord-api-types/compare/0.37.101...0.37.102) (2024-10-14)
### Features
* recurrence rule change key on audit logs ([#1112](https://github.com/discordjs/discord-api-types/issues/1112)) ([4746e8d](https://github.com/discordjs/discord-api-types/commit/4746e8d48600edf905037a9cb9507884876d9508))
* soundboard ([#1113](https://github.com/discordjs/discord-api-types/issues/1113)) ([8d46830](https://github.com/discordjs/discord-api-types/commit/8d468300467db1c0a1726b4dfc6e92018e40e800))
## [0.37.101](https://github.com/discordjs/discord-api-types/compare/0.37.100...0.37.101) (2024-09-23)
### Bug Fixes
* **rest/oauth2:** correct string literal types containing bot scope ([#1101](https://github.com/discordjs/discord-api-types/issues/1101)) ([2ae2324](https://github.com/discordjs/discord-api-types/commit/2ae232477a1362eb0bd5c4aeee4a97bfbca7b2a2))
### Features
* add `VoiceChannelEffectSend` event ([#739](https://github.com/discordjs/discord-api-types/issues/739)) ([240226f](https://github.com/discordjs/discord-api-types/commit/240226f3d2d32df378400671a6bf31ceb2468a3c))
* missing subscription dispatch types ([#1105](https://github.com/discordjs/discord-api-types/issues/1105)) ([2b653a0](https://github.com/discordjs/discord-api-types/commit/2b653a00b3acb04979b7656142f3d8ef986fd561))
## [0.37.100](https://github.com/discordjs/discord-api-types/compare/0.37.99...0.37.100) (2024-09-05)
### Bug Fixes
* **APIMessageSnapshot:** mark `guild_id` as deprecated ([#1084](https://github.com/discordjs/discord-api-types/issues/1084)) ([3f3fe21](https://github.com/discordjs/discord-api-types/commit/3f3fe21e153f2fbe6c76ba1cc916367551b175b6))
* **GatewayGuildDeleteDispatchData:** make `unavailable` optional ([#1092](https://github.com/discordjs/discord-api-types/issues/1092)) ([258fb72](https://github.com/discordjs/discord-api-types/commit/258fb72f38c0513030dc5e1ae60e34fc3f83006d))
* replace deprecated `RESTAPIPollCreate` with `RESTAPIPoll` ([#1091](https://github.com/discordjs/discord-api-types/issues/1091)) ([d3b5187](https://github.com/discordjs/discord-api-types/commit/d3b5187c77f845eba29ab56de41408bcea7e9cb4))
### Features
* add subscriptions ([#1078](https://github.com/discordjs/discord-api-types/issues/1078)) ([8f78190](https://github.com/discordjs/discord-api-types/commit/8f781909f1f5a0d1db8c3e134f4e9e1e22837277))
* **APIMessageSnapshotFields:** add more fields ([#1085](https://github.com/discordjs/discord-api-types/issues/1085)) ([3de4ca8](https://github.com/discordjs/discord-api-types/commit/3de4ca8933be23ac05bf780957aea99e4a70c2fe))
* **ConnectionService:** add Amazon Music connection ([#1074](https://github.com/discordjs/discord-api-types/issues/1074)) ([011d439](https://github.com/discordjs/discord-api-types/commit/011d439971e1f5ee11ba7caea5ed10131cafd6a6))
* entry point commands and interaction callback response ([#1077](https://github.com/discordjs/discord-api-types/issues/1077)) ([b4b70d8](https://github.com/discordjs/discord-api-types/commit/b4b70d8bdcdbc175497366e6bb74dd3bc22c6738))
* **FormattingPatterns:** `GuildNavigation` and `LinkedRole` ([#1089](https://github.com/discordjs/discord-api-types/issues/1089)) ([0938b66](https://github.com/discordjs/discord-api-types/commit/0938b664cef8fd3758506a2f689bb20ead616bb4))
* **MessageType:** `PurchaseNotification` and `PollResult` ([#1040](https://github.com/discordjs/discord-api-types/issues/1040)) ([344274b](https://github.com/discordjs/discord-api-types/commit/344274b56c25b9a35a64fc61b170c177ee702e95))
* **RESTJSONErrorCodes:** add `40018`, `40019`, and `40094` ([#1056](https://github.com/discordjs/discord-api-types/issues/1056)) ([93e649a](https://github.com/discordjs/discord-api-types/commit/93e649a20de0fda31b3276f8affb3cf6890ea693))
* **RESTPatchAPIWebhookWithTokenMessageJSONBody:** `poll` ([#1067](https://github.com/discordjs/discord-api-types/issues/1067)) ([f770290](https://github.com/discordjs/discord-api-types/commit/f7702907172f84b57175b6f6c80eb2de210f6a7b))
## [0.37.99](https://github.com/discordjs/discord-api-types/compare/0.37.98...0.37.99) (2024-09-02)
### Features
* **GuildMemberFlags:** `IsGuest` and `DmSettingsUpsellAcknowledged` ([#1079](https://github.com/discordjs/discord-api-types/issues/1079)) ([2803e8d](https://github.com/discordjs/discord-api-types/commit/2803e8df2f2105099a1dc6e04193355a926718b9))
* remove unstable from stable fields ([#1086](https://github.com/discordjs/discord-api-types/issues/1086)) ([4b64f84](https://github.com/discordjs/discord-api-types/commit/4b64f84ddf0390f0a8979f57623c5f8c9051484d))
## [0.37.98](https://github.com/discordjs/discord-api-types/compare/0.37.97...0.37.98) (2024-08-26)
### Features
* **RESTAPIAttachment:** add more properties ([#1073](https://github.com/discordjs/discord-api-types/issues/1073)) ([f019f0f](https://github.com/discordjs/discord-api-types/commit/f019f0fe97ad47471dd6656e5fb148dc5761e1e0))
## [0.37.97](https://github.com/discordjs/discord-api-types/compare/0.37.96...0.37.97) (2024-08-22)
## [0.37.96](https://github.com/discordjs/discord-api-types/compare/0.37.95...0.37.96) (2024-08-20)
### Bug Fixes
* nullable `recurrence_rule` on patch ([#1063](https://github.com/discordjs/discord-api-types/issues/1063)) ([19d2aeb](https://github.com/discordjs/discord-api-types/commit/19d2aeb4a82dc781558240a674c36eadce270abf))
* nullable fields for scheduled event editing ([#1064](https://github.com/discordjs/discord-api-types/issues/1064)) ([f67043b](https://github.com/discordjs/discord-api-types/commit/f67043b3f46eea7286e959d223b78d140deac318))
## [0.37.95](https://github.com/discordjs/discord-api-types/compare/0.37.94...0.37.95) (2024-08-19)
### Bug Fixes
* interface name ([#1059](https://github.com/discordjs/discord-api-types/issues/1059)) ([147e459](https://github.com/discordjs/discord-api-types/commit/147e459a16c8b0e15a0dd50f75d62c6dd9098815))
### Features
* recurring scheduled events ([#1058](https://github.com/discordjs/discord-api-types/issues/1058)) ([fbfbc6b](https://github.com/discordjs/discord-api-types/commit/fbfbc6b23f2696f6db5fad8ea1543327d5b3cf07))
* **RESTJSONErrorCodes:** `UnknownStickerPack` ([#1055](https://github.com/discordjs/discord-api-types/issues/1055)) ([906dd8e](https://github.com/discordjs/discord-api-types/commit/906dd8e241be6acdf4d6d7b10ce4e7c139b0fd8b))
* **Routes:** voice state endpoint ([#1046](https://github.com/discordjs/discord-api-types/issues/1046)) ([1b1a865](https://github.com/discordjs/discord-api-types/commit/1b1a865efe4d95b34055616ed18dc3613b58f317))
## [0.37.94](https://github.com/discordjs/discord-api-types/compare/0.37.93...0.37.94) (2024-08-15)
### Features
* add Get Sticker Pack endpoint ([#1053](https://github.com/discordjs/discord-api-types/issues/1053)) ([822956f](https://github.com/discordjs/discord-api-types/commit/822956fe788f8eeda5da683189973bd6667cbc96))
* **APIApplication:** `approximate_user_install_count` ([#1052](https://github.com/discordjs/discord-api-types/issues/1052)) ([d504763](https://github.com/discordjs/discord-api-types/commit/d5047639e691cc26e865cc6c06a312e09f0fb4c7))
* **RESTOAuth2:** add RESTPostOAuth2TokenRevocationQuery ([#1050](https://github.com/discordjs/discord-api-types/issues/1050)) ([6ead98b](https://github.com/discordjs/discord-api-types/commit/6ead98b78218830fee308a0425d9078957a662b2))
* **Routes:** get method on role endpoint ([#1051](https://github.com/discordjs/discord-api-types/issues/1051)) ([ea1a6c3](https://github.com/discordjs/discord-api-types/commit/ea1a6c3c86ec0d4c663e2191a488a3716ecdd7cc))
## [0.37.93](https://github.com/discordjs/discord-api-types/compare/0.37.92...0.37.93) (2024-07-22)
### Bug Fixes
* **CDNRoutes:** inconsistency in route and wrong JSDoc ([#1033](https://github.com/discordjs/discord-api-types/issues/1033)) ([eb7b3d9](https://github.com/discordjs/discord-api-types/commit/eb7b3d90dd6a847b80d051006a597e77d70caab2))
### Features
* add support for message forwarding ([#971](https://github.com/discordjs/discord-api-types/issues/971)) ([2c1ff0e](https://github.com/discordjs/discord-api-types/commit/2c1ff0ea3443fb500315d6c69674a875a11addf6))
* application emojis ([#1036](https://github.com/discordjs/discord-api-types/issues/1036)) ([5f22a6b](https://github.com/discordjs/discord-api-types/commit/5f22a6bacabef6b11e170a6f67694359bb3180e8))
* **ConnectionService:** add `Roblox` ([#1032](https://github.com/discordjs/discord-api-types/issues/1032)) ([4f66b4d](https://github.com/discordjs/discord-api-types/commit/4f66b4dd049d2ace638374c09a06272bd517ad3a))
* **RESTAPIPartialCurrentUserGuild:** add `banner` ([#1028](https://github.com/discordjs/discord-api-types/issues/1028)) ([da9496f](https://github.com/discordjs/discord-api-types/commit/da9496f291fff364b8d35b02363b93933c19823a))
## [0.37.92](https://github.com/discordjs/discord-api-types/compare/0.37.91...0.37.92) (2024-07-04)
### Bug Fixes
* **RESTAPIPollCreate:** optional properties ([#1022](https://github.com/discordjs/discord-api-types/issues/1022)) ([c05998d](https://github.com/discordjs/discord-api-types/commit/c05998de274ef7a8d570db9d23c9ad9c228eeccc))
## [0.37.91](https://github.com/discordjs/discord-api-types/compare/0.37.90...0.37.91) (2024-06-27)
### Features
* **APIAttachment:** add `title` ([#1015](https://github.com/discordjs/discord-api-types/issues/1015)) ([897fd90](https://github.com/discordjs/discord-api-types/commit/897fd90bf2705d6ff5eebbb21fa8e735fc1e1e22))
## [0.37.90](https://github.com/discordjs/discord-api-types/compare/0.37.89...0.37.90) (2024-06-18)
### Features
* add premium buttons ([#1010](https://github.com/discordjs/discord-api-types/issues/1010)) ([088dbe0](https://github.com/discordjs/discord-api-types/commit/088dbe016fdb72fb751931938bf7240c34fa64c0))
## [0.37.89](https://github.com/discordjs/discord-api-types/compare/0.37.88...0.37.89) (2024-06-13)

View File

@@ -77,25 +77,25 @@ import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
The exports of each API version is split into three main parts:
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
**A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs),
that are mentioned in an open pull request, or known through other means _and have received the green light to be used_.

View File

@@ -28,13 +28,17 @@ import type {
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
GatewayThreadListSync as RawGatewayThreadListSync,
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
GatewayVoiceState,
APIVoiceState,
InviteTargetType,
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
APIAuditLogEntry,
APIEntitlement,
ChannelType,
APISubscription,
APISoundboardSound,
GuildChannelType,
ThreadChannelType,
} from '../payloads/v10/mod.ts';
import type { ReactionType } from '../rest/v10/mod.ts';
import type { Nullable } from '../utils/internals.ts';
@@ -92,6 +96,10 @@ export enum GatewayOpcodes {
* Sent in response to receiving a heartbeat to acknowledge that it has been received
*/
HeartbeatAck,
/**
* Request information about soundboard sounds in a set of guilds
*/
RequestSoundboardSounds = 31,
}
/**
@@ -188,7 +196,11 @@ export enum GatewayIntentBits {
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
*/
GuildBans = GuildModeration,
GuildEmojisAndStickers = 1 << 3,
GuildExpressions = 1 << 3,
/**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildExpressions}
*/
GuildEmojisAndStickers = GuildExpressions,
GuildIntegrations = 1 << 4,
GuildWebhooks = 1 << 5,
GuildInvites = 1 << 6,
@@ -213,10 +225,18 @@ export enum GatewayIntentBits {
*/
export enum GatewayDispatchEvents {
ApplicationCommandPermissionsUpdate = 'APPLICATION_COMMAND_PERMISSIONS_UPDATE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
ChannelUpdate = 'CHANNEL_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
GuildBanAdd = 'GUILD_BAN_ADD',
GuildBanRemove = 'GUILD_BAN_REMOVE',
GuildCreate = 'GUILD_CREATE',
@@ -230,6 +250,16 @@ export enum GatewayDispatchEvents {
GuildRoleCreate = 'GUILD_ROLE_CREATE',
GuildRoleDelete = 'GUILD_ROLE_DELETE',
GuildRoleUpdate = 'GUILD_ROLE_UPDATE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
GuildSoundboardSoundCreate = 'GUILD_SOUNDBOARD_SOUND_CREATE',
GuildSoundboardSoundDelete = 'GUILD_SOUNDBOARD_SOUND_DELETE',
GuildSoundboardSoundsUpdate = 'GUILD_SOUNDBOARD_SOUNDS_UPDATE',
GuildSoundboardSoundUpdate = 'GUILD_SOUNDBOARD_SOUND_UPDATE',
SoundboardSounds = 'SOUNDBOARD_SOUNDS',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
@@ -241,17 +271,22 @@ export enum GatewayDispatchEvents {
MessageCreate = 'MESSAGE_CREATE',
MessageDelete = 'MESSAGE_DELETE',
MessageDeleteBulk = 'MESSAGE_DELETE_BULK',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
MessageReactionAdd = 'MESSAGE_REACTION_ADD',
MessageReactionRemove = 'MESSAGE_REACTION_REMOVE',
MessageReactionRemoveAll = 'MESSAGE_REACTION_REMOVE_ALL',
MessageReactionRemoveEmoji = 'MESSAGE_REACTION_REMOVE_EMOJI',
MessageUpdate = 'MESSAGE_UPDATE',
PresenceUpdate = 'PRESENCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
StageInstanceCreate = 'STAGE_INSTANCE_CREATE',
StageInstanceDelete = 'STAGE_INSTANCE_DELETE',
StageInstanceUpdate = 'STAGE_INSTANCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
SubscriptionCreate = 'SUBSCRIPTION_CREATE',
SubscriptionDelete = 'SUBSCRIPTION_DELETE',
SubscriptionUpdate = 'SUBSCRIPTION_UPDATE',
ThreadCreate = 'THREAD_CREATE',
ThreadDelete = 'THREAD_DELETE',
ThreadListSync = 'THREAD_LIST_SYNC',
@@ -260,30 +295,17 @@ export enum GatewayDispatchEvents {
ThreadUpdate = 'THREAD_UPDATE',
TypingStart = 'TYPING_START',
UserUpdate = 'USER_UPDATE',
VoiceChannelEffectSend = 'VOICE_CHANNEL_EFFECT_SEND',
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
WebhooksUpdate = 'WEBHOOKS_UPDATE',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
}
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayRequestGuildMembers
| GatewayRequestSoundboardSounds
| GatewayResume
| GatewayUpdatePresence
| GatewayVoiceStateUpdate;
@@ -323,6 +345,10 @@ export type GatewayDispatchPayload =
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildSoundboardSoundCreateDispatch
| GatewayGuildSoundboardSoundDeleteDispatch
| GatewayGuildSoundboardSoundsUpdateDispatch
| GatewayGuildSoundboardSoundUpdateDispatch
| GatewayGuildStickersUpdateDispatch
| GatewayIntegrationCreateDispatch
| GatewayIntegrationDeleteDispatch
@@ -343,9 +369,11 @@ export type GatewayDispatchPayload =
| GatewayPresenceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewaySoundboardSoundsDispatch
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewaySubscriptionModifyDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
@@ -354,6 +382,7 @@ export type GatewayDispatchPayload =
| GatewayThreadUpdateDispatch
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceChannelEffectSendDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
@@ -614,6 +643,55 @@ export interface GatewayApplicationCommandPermissionsUpdateDispatchData {
permissions: APIApplicationCommandPermission[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatch = DataPayload<
| GatewayDispatchEvents.SubscriptionCreate
| GatewayDispatchEvents.SubscriptionDelete
| GatewayDispatchEvents.SubscriptionUpdate,
GatewaySubscriptionModifyDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatchData = APISubscription;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatch = GatewaySubscriptionModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatchData = GatewaySubscriptionModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatch = GatewaySubscriptionModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatchData = GatewaySubscriptionModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatch = GatewaySubscriptionModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatchData = GatewaySubscriptionModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#channel-create
* https://discord.com/developers/docs/topics/gateway-events#channel-update
@@ -629,7 +707,10 @@ export type GatewayChannelModifyDispatch = DataPayload<
* https://discord.com/developers/docs/topics/gateway-events#channel-update
* https://discord.com/developers/docs/topics/gateway-events#channel-delete
*/
export type GatewayChannelModifyDispatchData = APIChannel;
export type GatewayChannelModifyDispatchData = APIChannel & {
type: Exclude<GuildChannelType, ThreadChannelType>;
guild_id: Snowflake;
};
/**
* https://discord.com/developers/docs/topics/gateway-events#channel-create
@@ -709,7 +790,9 @@ export type GatewayEntitlementModifyDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
*/
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
export type GatewayEntitlementCreateDispatchData = Omit<GatewayEntitlementModifyDispatchData, 'ends_at'> & {
ends_at: GatewayEntitlementModifyDispatchData['ends_at'] | null;
};
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
@@ -737,7 +820,7 @@ export type GatewayEntitlementDeleteDispatchData = GatewayEntitlementModifyDispa
export type GatewayEntitlementDeleteDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-create
* https://discord.com/developers/docs/topics/gateway-events#guild-update
*/
export type GatewayGuildModifyDispatch = DataPayload<GatewayDispatchEvents.GuildUpdate, GatewayGuildModifyDispatchData>;
@@ -785,7 +868,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* See https://discord.com/developers/docs/resources/voice#voice-state-object
*/
voice_states: Omit<GatewayVoiceState, 'guild_id'>[];
voice_states: Omit<APIVoiceState, 'guild_id'>[];
/**
* Users in the guild
*
@@ -801,7 +884,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
channels: APIChannel[];
channels: (APIChannel & { type: Exclude<GuildChannelType, ThreadChannelType> })[];
/**
* Threads in the guild
*
@@ -809,7 +892,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
threads: APIChannel[];
threads: (APIChannel & { type: ThreadChannelType })[];
/**
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
*
@@ -831,9 +914,17 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
* See https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
*/
guild_scheduled_events: APIGuildScheduledEvent[];
/**
* The soundboard sounds in the guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* See https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object
*/
soundboard_sounds: APISoundboardSound[];
}
/**
@@ -854,7 +945,14 @@ export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.Guild
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-delete
*/
export type GatewayGuildDeleteDispatchData = APIUnavailableGuild;
export interface GatewayGuildDeleteDispatchData extends Omit<APIUnavailableGuild, 'unavailable'> {
/**
* `true` if this guild is unavailable due to an outage
*
* If the field is not set, the user was removed from the guild.
*/
unavailable?: true;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-ban-add
@@ -1022,9 +1120,9 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
* https://discord.com/developers/docs/topics/gateway-events#guild-member-update
*/
export type GatewayGuildMemberUpdateDispatchData = Nullable<Pick<APIGuildMember, 'joined_at'>> &
Omit<APIGuildMember, 'deaf' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'mute'>> &
Required<Pick<APIGuildMember, 'user'>> & {
Omit<APIGuildMember, 'deaf' | 'flags' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'flags' | 'mute'>> &
Required<Pick<APIGuildMember, 'avatar' | 'banner' | 'user'>> & {
/**
* The id of the guild
*/
@@ -1152,49 +1250,171 @@ export interface GatewayGuildRoleDeleteDispatchData {
role_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create
*/
export type GatewayGuildScheduledEventCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventCreate,
GatewayGuildScheduledEventCreateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create
*/
export type GatewayGuildScheduledEventCreateDispatchData = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update
*/
export type GatewayGuildScheduledEventUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUpdate,
GatewayGuildScheduledEventUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update
*/
export type GatewayGuildScheduledEventUpdateDispatchData = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete
*/
export type GatewayGuildScheduledEventDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventDelete,
GatewayGuildScheduledEventDeleteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete
*/
export type GatewayGuildScheduledEventDeleteDispatchData = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add
*/
export type GatewayGuildScheduledEventUserAddDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUserAdd,
GatewayGuildScheduledEventUserAddDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add
*/
export interface GatewayGuildScheduledEventUserAddDispatchData {
guild_scheduled_event_id: Snowflake;
user_id: Snowflake;
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove
*/
export type GatewayGuildScheduledEventUserRemoveDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUserRemove,
GatewayGuildScheduledEventUserAddDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove
*/
export interface GatewayGuildScheduledEventUserRemoveDispatchData {
guild_scheduled_event_id: Snowflake;
user_id: Snowflake;
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundCreate,
GatewayGuildSoundboardSoundCreateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundUpdate,
GatewayGuildSoundboardSoundUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export type GatewayGuildSoundboardSoundDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundDelete,
GatewayGuildSoundboardSoundDeleteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export interface GatewayGuildSoundboardSoundDeleteDispatchData {
/**
* The id of the sound that was deleted
*/
sound_id: Snowflake;
/**
* The id of the guild the sound was in
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export type GatewayGuildSoundboardSoundsUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundsUpdate,
GatewayGuildSoundboardSoundsUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
/**
* The guild's soundboard sounds
*/
soundboard_sounds: APISoundboardSound[];
/**
* The id of the guild
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export type GatewaySoundboardSoundsDispatch = DataPayload<
GatewayDispatchEvents.SoundboardSounds,
GatewaySoundboardSoundsDispatchData
>;
/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export interface GatewaySoundboardSoundsDispatchData {
/**
* The guild's soundboard sounds
*/
soundboard_sounds: APISoundboardSound[];
/**
* The id of the guild
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#integration-create
*/
@@ -1382,18 +1602,11 @@ export type GatewayMessageUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#message-update
*/
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields &
Omit<Partial<APIMessage>, 'mentions'> & {
/**
* ID of the message
*/
id: Snowflake;
/**
* ID of the channel the message was sent in
*/
channel_id: Snowflake;
};
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields
*/
export interface GatewayMessageEventExtraFields {
/**
* ID of the guild the message was sent in
@@ -1628,7 +1841,7 @@ export type GatewayThreadMemberUpdateDispatchData = APIThreadMember & { guild_id
*/
export type GatewayThreadModifyDispatch = DataPayload<
GatewayDispatchEvents.ThreadCreate | GatewayDispatchEvents.ThreadDelete | GatewayDispatchEvents.ThreadUpdate,
GatewayChannelModifyDispatchData
APIThreadChannel
>;
/**
@@ -1737,6 +1950,66 @@ export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUp
*/
export type GatewayUserUpdateDispatchData = APIUser;
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send
*/
export type GatewayVoiceChannelEffectSendDispatch = DataPayload<
GatewayDispatchEvents.VoiceChannelEffectSend,
GatewayVoiceChannelEffectSendDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send
*/
export interface GatewayVoiceChannelEffectSendDispatchData {
/**
* ID of the channel the effect was sent in
*/
channel_id: Snowflake;
/**
* ID of the guild the effect was sent in
*/
guild_id: Snowflake;
/**
* ID of the user who sent the effect
*/
user_id: Snowflake;
/**
* The emoji sent, for emoji reaction and soundboard effects
*/
emoji?: APIEmoji | null;
/**
* The type of emoji animation, for emoji reaction and soundboard effects
*/
animation_type?: VoiceChannelEffectSendAnimationType | null;
/**
* The ID of the emoji animation, for emoji reaction and soundboard effects
*/
animation_id?: number;
/**
* The ID of the soundboard sound, for soundboard effects
*/
sound_id?: Snowflake | number;
/**
* The volume of the soundboard sound, from 0 to 1, for soundboard effects
*/
sound_volume?: number;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types
*/
export enum VoiceChannelEffectSendAnimationType {
/**
* A fun animation, sent by a Nitro subscriber
*/
Premium,
/**
* The standard animation
*/
Basic,
}
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
*/
@@ -1748,7 +2021,7 @@ export type GatewayVoiceStateUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
*/
export type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState;
export type GatewayVoiceStateUpdateDispatchData = APIVoiceState;
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-server-update
@@ -1836,6 +2109,10 @@ export type GatewayMessagePollVoteRemoveDispatch = DataPayload<
GatewayMessagePollVoteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove
*/
export interface GatewayMessagePollVoteDispatchData {
/**
* ID of the user
@@ -1983,6 +2260,9 @@ export interface GatewayRequestGuildMembers {
d: GatewayRequestGuildMembersData;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export interface GatewayRequestGuildMembersDataBase {
/**
* ID of the guild to get members for
@@ -2002,6 +2282,9 @@ export interface GatewayRequestGuildMembersDataBase {
nonce?: string;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayRequestGuildMembersDataBase {
/**
* Used to specify which users you wish to fetch
@@ -2009,6 +2292,9 @@ export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayReques
user_ids: Snowflake | Snowflake[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestGuildMembersDataBase {
/**
* String that username starts with, or an empty string to return all members
@@ -2028,6 +2314,24 @@ export type GatewayRequestGuildMembersData =
| GatewayRequestGuildMembersDataWithQuery
| GatewayRequestGuildMembersDataWithUserIds;
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSounds {
op: GatewayOpcodes.RequestSoundboardSounds;
d: GatewayRequestSoundboardSoundsData;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSoundsData {
/**
* The ids of the guilds to get soundboard sounds for
*/
guild_ids: Snowflake[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
*/

View File

@@ -28,12 +28,16 @@ import type {
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
GatewayThreadListSync as RawGatewayThreadListSync,
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
GatewayVoiceState,
APIVoiceState,
InviteTargetType,
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
APIAuditLogEntry,
ChannelType,
APISubscription,
APISoundboardSound,
GuildChannelType,
ThreadChannelType,
} from '../payloads/v9/mod.ts';
import type { ReactionType } from '../rest/v9/mod.ts';
import type { Nullable } from '../utils/internals.ts';
@@ -92,6 +96,10 @@ export enum GatewayOpcodes {
* Sent in response to receiving a heartbeat to acknowledge that it has been received
*/
HeartbeatAck,
/**
* Request information about soundboard sounds in a set of guilds
*/
RequestSoundboardSounds = 31,
}
/**
@@ -188,7 +196,11 @@ export enum GatewayIntentBits {
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
*/
GuildBans = GuildModeration,
GuildEmojisAndStickers = 1 << 3,
GuildExpressions = 1 << 3,
/**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildExpressions}
*/
GuildEmojisAndStickers = GuildExpressions,
GuildIntegrations = 1 << 4,
GuildWebhooks = 1 << 5,
GuildInvites = 1 << 6,
@@ -212,10 +224,18 @@ export enum GatewayIntentBits {
*/
export enum GatewayDispatchEvents {
ApplicationCommandPermissionsUpdate = 'APPLICATION_COMMAND_PERMISSIONS_UPDATE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
ChannelUpdate = 'CHANNEL_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
GuildBanAdd = 'GUILD_BAN_ADD',
GuildBanRemove = 'GUILD_BAN_REMOVE',
GuildCreate = 'GUILD_CREATE',
@@ -229,6 +249,16 @@ export enum GatewayDispatchEvents {
GuildRoleCreate = 'GUILD_ROLE_CREATE',
GuildRoleDelete = 'GUILD_ROLE_DELETE',
GuildRoleUpdate = 'GUILD_ROLE_UPDATE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
GuildSoundboardSoundCreate = 'GUILD_SOUNDBOARD_SOUND_CREATE',
GuildSoundboardSoundDelete = 'GUILD_SOUNDBOARD_SOUND_DELETE',
GuildSoundboardSoundsUpdate = 'GUILD_SOUNDBOARD_SOUNDS_UPDATE',
GuildSoundboardSoundUpdate = 'GUILD_SOUNDBOARD_SOUND_UPDATE',
SoundboardSounds = 'SOUNDBOARD_SOUNDS',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
@@ -240,17 +270,22 @@ export enum GatewayDispatchEvents {
MessageCreate = 'MESSAGE_CREATE',
MessageDelete = 'MESSAGE_DELETE',
MessageDeleteBulk = 'MESSAGE_DELETE_BULK',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
MessageReactionAdd = 'MESSAGE_REACTION_ADD',
MessageReactionRemove = 'MESSAGE_REACTION_REMOVE',
MessageReactionRemoveAll = 'MESSAGE_REACTION_REMOVE_ALL',
MessageReactionRemoveEmoji = 'MESSAGE_REACTION_REMOVE_EMOJI',
MessageUpdate = 'MESSAGE_UPDATE',
PresenceUpdate = 'PRESENCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
StageInstanceCreate = 'STAGE_INSTANCE_CREATE',
StageInstanceDelete = 'STAGE_INSTANCE_DELETE',
StageInstanceUpdate = 'STAGE_INSTANCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
SubscriptionCreate = 'SUBSCRIPTION_CREATE',
SubscriptionDelete = 'SUBSCRIPTION_DELETE',
SubscriptionUpdate = 'SUBSCRIPTION_UPDATE',
ThreadCreate = 'THREAD_CREATE',
ThreadDelete = 'THREAD_DELETE',
ThreadListSync = 'THREAD_LIST_SYNC',
@@ -259,30 +294,17 @@ export enum GatewayDispatchEvents {
ThreadUpdate = 'THREAD_UPDATE',
TypingStart = 'TYPING_START',
UserUpdate = 'USER_UPDATE',
VoiceChannelEffectSend = 'VOICE_CHANNEL_EFFECT_SEND',
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
WebhooksUpdate = 'WEBHOOKS_UPDATE',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
}
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayRequestGuildMembers
| GatewayRequestSoundboardSounds
| GatewayResume
| GatewayUpdatePresence
| GatewayVoiceStateUpdate;
@@ -322,6 +344,10 @@ export type GatewayDispatchPayload =
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildSoundboardSoundCreateDispatch
| GatewayGuildSoundboardSoundDeleteDispatch
| GatewayGuildSoundboardSoundsUpdateDispatch
| GatewayGuildSoundboardSoundUpdateDispatch
| GatewayGuildStickersUpdateDispatch
| GatewayIntegrationCreateDispatch
| GatewayIntegrationDeleteDispatch
@@ -342,9 +368,11 @@ export type GatewayDispatchPayload =
| GatewayPresenceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewaySoundboardSoundsDispatch
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewaySubscriptionModifyDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
@@ -353,6 +381,7 @@ export type GatewayDispatchPayload =
| GatewayThreadUpdateDispatch
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceChannelEffectSendDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
@@ -613,6 +642,55 @@ export interface GatewayApplicationCommandPermissionsUpdateDispatchData {
permissions: APIApplicationCommandPermission[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatch = DataPayload<
| GatewayDispatchEvents.SubscriptionCreate
| GatewayDispatchEvents.SubscriptionDelete
| GatewayDispatchEvents.SubscriptionUpdate,
GatewaySubscriptionModifyDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatchData = APISubscription;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatch = GatewaySubscriptionModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatchData = GatewaySubscriptionModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatch = GatewaySubscriptionModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatchData = GatewaySubscriptionModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatch = GatewaySubscriptionModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatchData = GatewaySubscriptionModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#channel-create
* https://discord.com/developers/docs/topics/gateway-events#channel-update
@@ -628,7 +706,10 @@ export type GatewayChannelModifyDispatch = DataPayload<
* https://discord.com/developers/docs/topics/gateway-events#channel-update
* https://discord.com/developers/docs/topics/gateway-events#channel-delete
*/
export type GatewayChannelModifyDispatchData = APIChannel;
export type GatewayChannelModifyDispatchData = APIChannel & {
type: Exclude<GuildChannelType, ThreadChannelType>;
guild_id: Snowflake;
};
/**
* https://discord.com/developers/docs/topics/gateway-events#channel-create
@@ -708,7 +789,9 @@ export type GatewayEntitlementModifyDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
*/
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
export type GatewayEntitlementCreateDispatchData = Omit<GatewayEntitlementModifyDispatchData, 'ends_at'> & {
ends_at: GatewayEntitlementModifyDispatchData['ends_at'] | null;
};
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
@@ -784,7 +867,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* See https://discord.com/developers/docs/resources/voice#voice-state-object
*/
voice_states: Omit<GatewayVoiceState, 'guild_id'>[];
voice_states: Omit<APIVoiceState, 'guild_id'>[];
/**
* Users in the guild
*
@@ -800,7 +883,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
channels: APIChannel[];
channels: (APIChannel & { type: Exclude<GuildChannelType, ThreadChannelType> })[];
/**
* Threads in the guild
*
@@ -808,7 +891,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
threads: APIChannel[];
threads: (APIChannel & { type: ThreadChannelType })[];
/**
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
*
@@ -830,9 +913,17 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
* See https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
*/
guild_scheduled_events: APIGuildScheduledEvent[];
/**
* The soundboard sounds in the guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* See https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object
*/
soundboard_sounds: APISoundboardSound[];
}
/**
@@ -853,7 +944,14 @@ export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.Guild
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-delete
*/
export type GatewayGuildDeleteDispatchData = APIUnavailableGuild;
export interface GatewayGuildDeleteDispatchData extends Omit<APIUnavailableGuild, 'unavailable'> {
/**
* `true` if this guild is unavailable due to an outage
*
* If the field is not set, the user was removed from the guild.
*/
unavailable?: true;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-ban-add
@@ -1021,9 +1119,9 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
* https://discord.com/developers/docs/topics/gateway-events#guild-member-update
*/
export type GatewayGuildMemberUpdateDispatchData = Nullable<Pick<APIGuildMember, 'joined_at'>> &
Omit<APIGuildMember, 'deaf' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'mute'>> &
Required<Pick<APIGuildMember, 'user'>> & {
Omit<APIGuildMember, 'deaf' | 'flags' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'flags' | 'mute'>> &
Required<Pick<APIGuildMember, 'avatar' | 'banner' | 'user'>> & {
/**
* The id of the guild
*/
@@ -1151,49 +1249,171 @@ export interface GatewayGuildRoleDeleteDispatchData {
role_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create
*/
export type GatewayGuildScheduledEventCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventCreate,
GatewayGuildScheduledEventCreateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create
*/
export type GatewayGuildScheduledEventCreateDispatchData = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update
*/
export type GatewayGuildScheduledEventUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUpdate,
GatewayGuildScheduledEventUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update
*/
export type GatewayGuildScheduledEventUpdateDispatchData = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete
*/
export type GatewayGuildScheduledEventDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventDelete,
GatewayGuildScheduledEventDeleteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete
*/
export type GatewayGuildScheduledEventDeleteDispatchData = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add
*/
export type GatewayGuildScheduledEventUserAddDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUserAdd,
GatewayGuildScheduledEventUserAddDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add
*/
export interface GatewayGuildScheduledEventUserAddDispatchData {
guild_scheduled_event_id: Snowflake;
user_id: Snowflake;
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove
*/
export type GatewayGuildScheduledEventUserRemoveDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUserRemove,
GatewayGuildScheduledEventUserAddDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove
*/
export interface GatewayGuildScheduledEventUserRemoveDispatchData {
guild_scheduled_event_id: Snowflake;
user_id: Snowflake;
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundCreate,
GatewayGuildSoundboardSoundCreateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundUpdate,
GatewayGuildSoundboardSoundUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export type GatewayGuildSoundboardSoundDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundDelete,
GatewayGuildSoundboardSoundDeleteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export interface GatewayGuildSoundboardSoundDeleteDispatchData {
/**
* The id of the sound that was deleted
*/
sound_id: Snowflake;
/**
* The id of the guild the sound was in
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export type GatewayGuildSoundboardSoundsUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundsUpdate,
GatewayGuildSoundboardSoundsUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
/**
* The guild's soundboard sounds
*/
soundboard_sounds: APISoundboardSound[];
/**
* The id of the guild
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export type GatewaySoundboardSoundsDispatch = DataPayload<
GatewayDispatchEvents.SoundboardSounds,
GatewaySoundboardSoundsDispatchData
>;
/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export interface GatewaySoundboardSoundsDispatchData {
/**
* The guild's soundboard sounds
*/
soundboard_sounds: APISoundboardSound[];
/**
* The id of the guild
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#integration-create
*/
@@ -1381,18 +1601,11 @@ export type GatewayMessageUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#message-update
*/
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields &
Omit<Partial<APIMessage>, 'mentions'> & {
/**
* ID of the message
*/
id: Snowflake;
/**
* ID of the channel the message was sent in
*/
channel_id: Snowflake;
};
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields
*/
export interface GatewayMessageEventExtraFields {
/**
* ID of the guild the message was sent in
@@ -1627,7 +1840,7 @@ export type GatewayThreadMemberUpdateDispatchData = APIThreadMember & { guild_id
*/
export type GatewayThreadModifyDispatch = DataPayload<
GatewayDispatchEvents.ThreadCreate | GatewayDispatchEvents.ThreadDelete | GatewayDispatchEvents.ThreadUpdate,
GatewayChannelModifyDispatchData
APIThreadChannel
>;
/**
@@ -1736,6 +1949,66 @@ export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUp
*/
export type GatewayUserUpdateDispatchData = APIUser;
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send
*/
export type GatewayVoiceChannelEffectSendDispatch = DataPayload<
GatewayDispatchEvents.VoiceChannelEffectSend,
GatewayVoiceChannelEffectSendDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send
*/
export interface GatewayVoiceChannelEffectSendDispatchData {
/**
* ID of the channel the effect was sent in
*/
channel_id: Snowflake;
/**
* ID of the guild the effect was sent in
*/
guild_id: Snowflake;
/**
* ID of the user who sent the effect
*/
user_id: Snowflake;
/**
* The emoji sent, for emoji reaction and soundboard effects
*/
emoji?: APIEmoji | null;
/**
* The type of emoji animation, for emoji reaction and soundboard effects
*/
animation_type?: VoiceChannelEffectSendAnimationType | null;
/**
* The ID of the emoji animation, for emoji reaction and soundboard effects
*/
animation_id?: number;
/**
* The ID of the soundboard sound, for soundboard effects
*/
sound_id?: Snowflake | number;
/**
* The volume of the soundboard sound, from 0 to 1, for soundboard effects
*/
sound_volume?: number;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types
*/
export enum VoiceChannelEffectSendAnimationType {
/**
* A fun animation, sent by a Nitro subscriber
*/
Premium,
/**
* The standard animation
*/
Basic,
}
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
*/
@@ -1747,7 +2020,7 @@ export type GatewayVoiceStateUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
*/
export type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState;
export type GatewayVoiceStateUpdateDispatchData = APIVoiceState;
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-server-update
@@ -1835,6 +2108,10 @@ export type GatewayMessagePollVoteRemoveDispatch = DataPayload<
GatewayMessagePollVoteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove
*/
export interface GatewayMessagePollVoteDispatchData {
/**
* ID of the user
@@ -1982,6 +2259,9 @@ export interface GatewayRequestGuildMembers {
d: GatewayRequestGuildMembersData;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export interface GatewayRequestGuildMembersDataBase {
/**
* ID of the guild to get members for
@@ -2001,6 +2281,9 @@ export interface GatewayRequestGuildMembersDataBase {
nonce?: string;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayRequestGuildMembersDataBase {
/**
* Used to specify which users you wish to fetch
@@ -2008,6 +2291,9 @@ export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayReques
user_ids: Snowflake | Snowflake[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestGuildMembersDataBase {
/**
* String that username starts with, or an empty string to return all members
@@ -2027,6 +2313,24 @@ export type GatewayRequestGuildMembersData =
| GatewayRequestGuildMembersDataWithQuery
| GatewayRequestGuildMembersDataWithUserIds;
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSounds {
op: GatewayOpcodes.RequestSoundboardSounds;
d: GatewayRequestSoundboardSoundsData;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSoundsData {
/**
* The ids of the guilds to get soundboard sounds for
*/
guild_ids: Snowflake[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
*/

View File

@@ -93,6 +93,18 @@ export const FormattingPatterns = {
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
*/
StyledTimestamp: /<t:(?<timestamp>-?\d{1,13}):(?<style>[DFRTdft])>/,
/**
* Regular expression for matching a guild navigation mention
*
* The `type` group property is present on the `exec` result of this expression
*/
GuildNavigation: /<id:(?<type>customize|browse|guide|linked-roles)>/,
/**
* Regular expression for matching a linked role mention
*
* The `id` group property is present on the `exec` result of this expression
*/
LinkedRole: /<id:linked-roles:(?<id>\d{17,20})>/,
} as const;
/**

View File

@@ -1,4 +1,4 @@
import type { LocaleString } from '../rest/common.ts';
import type { Locale } from '../rest/common.ts';
/**
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
@@ -297,7 +297,7 @@ export const PermissionFlagsBits = {
*/
Object.freeze(PermissionFlagsBits);
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
export type LocalizationMap = Partial<Record<Locale, string | null>>;
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json

View File

@@ -0,0 +1,26 @@
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIPrimaryEntryPointCommandInteractionData =
APIBaseApplicationCommandInteractionData<ApplicationCommandType.PrimaryEntryPoint>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIPrimaryEntryPointCommandInteraction =
APIApplicationCommandInteractionWrapper<APIPrimaryEntryPointCommandInteractionData>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIPrimaryEntryPointCommandDMInteraction = APIDMInteractionWrapper<APIPrimaryEntryPointCommandInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIPrimaryEntryPointCommandGuildInteraction =
APIGuildInteractionWrapper<APIPrimaryEntryPointCommandInteraction>;

View File

@@ -13,12 +13,19 @@ import type {
APIContextMenuInteraction,
APIContextMenuInteractionData,
} from './_applicationCommands/contextMenu.ts';
import type {
APIPrimaryEntryPointCommandDMInteraction,
APIPrimaryEntryPointCommandGuildInteraction,
APIPrimaryEntryPointCommandInteraction,
APIPrimaryEntryPointCommandInteractionData,
} from './_applicationCommands/entryPoint.ts';
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
export * from './_applicationCommands/chatInput.ts';
export * from './_applicationCommands/contextMenu.ts';
export * from './_applicationCommands/permissions.ts';
export * from './_applicationCommands/entryPoint.ts';
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object
@@ -92,29 +99,45 @@ export interface APIApplicationCommand {
nsfw?: boolean;
/**
* Installation context(s) where the command is available, only for globally-scoped commands. Defaults to `GUILD_INSTALL ([0])`
*
* @unstable
*/
integration_types?: ApplicationIntegrationType[];
/**
* Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands `[0,1,2]`.
*
* @unstable
*/
contexts?: InteractionContextType[] | null;
/**
* Autoincrementing version identifier updated during substantial record changes
*/
version: Snowflake;
/**
* Determines whether the interaction is handled by the app's interactions handler or by Discord
*
* @remarks
* This is only available for {@link ApplicationCommandType.PrimaryEntryPoint} commands
*/
handler?: EntryPointCommandHandlerType;
}
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types
*/
export enum ApplicationCommandType {
/**
* Slash commands; a text-based command that shows up when a user types `/`
*/
ChatInput = 1,
/**
* A UI-based command that shows up when you right click or tap on a user
*/
User,
/**
* A UI-based command that shows up when you right click or tap on a message
*/
Message,
/**
* A UI-based command that represents the primary way to invoke an app's Activity
*/
PrimaryEntryPoint,
}
/**
@@ -124,11 +147,11 @@ export enum ApplicationIntegrationType {
/**
* App is installable to servers
*/
GuildInstall = 0,
GuildInstall,
/**
* App is installable to users
*/
UserInstall = 1,
UserInstall,
}
/**
@@ -138,15 +161,30 @@ export enum InteractionContextType {
/**
* Interaction can be used within servers
*/
Guild = 0,
Guild,
/**
* Interaction can be used within DMs with the app's bot user
*/
BotDM = 1,
BotDM,
/**
* Interaction can be used within Group DMs and DMs other than the app's bot user
*/
PrivateChannel = 2,
PrivateChannel,
}
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-entry-point-command-handler-types
*/
export enum EntryPointCommandHandlerType {
/**
* The app handles the interaction using an interaction token
*/
AppHandler = 1,
/**
* Discord handles the interaction by launching an Activity and sending a follow-up message without coordinating with
* the app
*/
DiscordLaunchActivity,
}
/**
@@ -154,7 +192,8 @@ export enum InteractionContextType {
*/
export type APIApplicationCommandInteractionData =
| APIChatInputApplicationCommandInteractionData
| APIContextMenuInteractionData;
| APIContextMenuInteractionData
| APIPrimaryEntryPointCommandInteractionData;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
@@ -171,18 +210,23 @@ export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationC
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandInteraction = APIChatInputApplicationCommandInteraction | APIContextMenuInteraction;
export type APIApplicationCommandInteraction =
| APIChatInputApplicationCommandInteraction
| APIContextMenuInteraction
| APIPrimaryEntryPointCommandInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandDMInteraction =
| APIChatInputApplicationCommandDMInteraction
| APIContextMenuDMInteraction;
| APIContextMenuDMInteraction
| APIPrimaryEntryPointCommandDMInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandGuildInteraction =
| APIChatInputApplicationCommandGuildInteraction
| APIContextMenuGuildInteraction;
| APIContextMenuGuildInteraction
| APIPrimaryEntryPointCommandGuildInteraction;

View File

@@ -1,5 +1,5 @@
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { APIRole, ApplicationIntegrationType, InteractionContextType, LocaleString } from '../../../v10.ts';
import type { APIRole, ApplicationIntegrationType, InteractionContextType, Locale } from '../../../v10.ts';
import type {
APIAttachment,
APIChannel,
@@ -9,7 +9,7 @@ import type {
ChannelType,
ThreadChannelType,
} from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIGuildMember, APIPartialInteractionGuild } from '../guild.ts';
import type { APIEntitlement } from '../monetization.ts';
import type { APIUser } from '../user.ts';
import type { InteractionType } from './responses.ts';
@@ -17,7 +17,12 @@ import type { InteractionType } from './responses.ts';
/**
* https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object
*/
export interface APIMessageInteractionMetadata {
export type APIMessageInteractionMetadata =
| APIApplicationCommandInteractionMetadata
| APIMessageComponentInteractionMetadata
| APIModalSubmitInteractionMetadata;
interface APIBaseInteractionMetadata<Type extends InteractionType> {
/**
* ID of the interaction
*/
@@ -25,27 +30,56 @@ export interface APIMessageInteractionMetadata {
/**
* Type of interaction
*/
type: InteractionType;
type: Type;
/**
* User who triggered the interaction
*/
user: APIUser;
/**
* IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object
* IDs for installation context(s) related to an interaction
*/
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
/**
* ID of the original response message, present only on follow-up messages
*/
original_response_message_id?: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-application-command-interaction-metadata-structure
*/
export interface APIApplicationCommandInteractionMetadata
extends APIBaseInteractionMetadata<InteractionType.ApplicationCommand> {
/**
* ID of the message that contained interactive component, present only on messages created from component interactions
* The user the command was run on, present only on user commands interactions
*/
interacted_message_id?: Snowflake;
target_user?: APIUser;
/**
* Metadata for the interaction that was used to open the modal, present only on modal submit interactions
* The ID of the message the command was run on, present only on message command interactions.
* The original response message will also have `message_reference` and `referenced_message` pointing to this message.
*/
triggering_interaction_metadata?: APIMessageInteractionMetadata;
target_message_id?: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-message-command-interaction-metadata-structure
*/
export interface APIMessageComponentInteractionMetadata
extends APIBaseInteractionMetadata<InteractionType.MessageComponent> {
/**
* ID of the message that contained the interactive component
*/
interacted_message_id: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-modal-submit-interaction-metadata-structure
*/
export interface APIModalSubmitInteractionMetadata extends APIBaseInteractionMetadata<InteractionType.ModalSubmit> {
/**
* Metadata for the interaction that was used to open the modal
*/
triggering_interaction_metadata: APIApplicationCommandInteractionMetadata | APIMessageComponentInteractionMetadata;
}
export type PartialAPIMessageInteractionGuildMember = Pick<
@@ -118,7 +152,11 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
*/
data?: Data;
/**
* The guild it was sent from
* Guild that the interaction was sent from
*/
guild?: APIPartialInteractionGuild;
/**
* Guild that the interaction was sent from
*/
guild_id?: Snowflake;
/**
@@ -160,11 +198,11 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
/**
* The selected language of the invoking user
*/
locale: LocaleString;
locale: Locale;
/**
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: LocaleString;
guild_locale?: Locale;
/**
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
*/

View File

@@ -22,6 +22,7 @@ export type APIInteractionResponse =
| APIInteractionResponseChannelMessageWithSource
| APIInteractionResponseDeferredChannelMessageWithSource
| APIInteractionResponseDeferredMessageUpdate
| APIInteractionResponseLaunchActivity
| APIInteractionResponsePong
| APIInteractionResponseUpdateMessage
| APIModalInteractionResponse
@@ -64,6 +65,10 @@ export interface APIInteractionResponseUpdateMessage {
data?: APIInteractionResponseCallbackData;
}
export interface APIInteractionResponseLaunchActivity {
type: InteractionResponseType.LaunchActivity;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type
*/
@@ -98,8 +103,18 @@ export enum InteractionResponseType {
Modal,
/**
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
*
* @deprecated See https://discord.com/developers/docs/change-log#premium-apps-new-premium-button-style-deep-linking-url-schemes
*/
PremiumRequired,
/**
* Launch the Activity associated with the app.
*
* @remarks
* Only available for apps with Activities enabled
*/
LaunchActivity = 12,
}
/**

View File

@@ -9,6 +9,7 @@ import type { ApplicationIntegrationType } from './interactions.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
import type { ApplicationWebhookEventType } from './webhook.ts';
/**
* https://discord.com/developers/docs/resources/application#application-object
@@ -64,6 +65,7 @@ export interface APIApplication {
* An empty string
*
* @deprecated This field will be removed in v11
* @unstable This field is no longer documented by Discord and will be removed in v11
*/
summary: '';
/**
@@ -108,6 +110,10 @@ export interface APIApplication {
* Approximate count of guilds the application has been added to
*/
approximate_guild_count?: number;
/**
* Approximate count of users that have installed the app
*/
approximate_user_install_count?: number;
/**
* Array of redirect URIs for the application
*/
@@ -115,12 +121,12 @@ export interface APIApplication {
/**
* The interactions endpoint URL for the application
*/
interactions_endpoint_url?: string;
interactions_endpoint_url?: string | null;
/**
* 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;
role_connections_verification_url?: string | null;
/**
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
*/
@@ -131,14 +137,24 @@ export interface APIApplication {
install_params?: APIApplicationInstallParams;
/**
* Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object
*
* @unstable
*/
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
/**
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
/**
* Event webhook URL for the app to receive webhook events
*/
event_webhooks_url?: string | null;
/**
* If webhook events are enabled for the app
*/
event_webhooks_status: ApplicationWebhookEventStatus;
/**
* List of webhook event types the app subscribes to
*/
event_webhooks_types?: ApplicationWebhookEventType[];
}
export interface APIApplicationInstallParams {
@@ -294,3 +310,21 @@ export enum ApplicationRoleConnectionMetadataType {
*/
BooleanNotEqual,
}
/**
* https://discord.com/developers/docs/resources/application#application-object-application-event-webhook-status
*/
export enum ApplicationWebhookEventStatus {
/**
* Webhook events are disabled by developer
*/
Disabled = 1,
/**
* Webhook events are enabled by developer
*/
Enabled,
/**
* Webhook events are disabled by Discord, usually due to inactivity
*/
DisabledByDiscord,
}

View File

@@ -23,6 +23,7 @@ import type {
} from './guild.ts';
import type {
APIGuildScheduledEvent,
APIGuildScheduledEventRecurrenceRule,
GuildScheduledEventEntityType,
GuildScheduledEventStatus,
} from './guildScheduledEvent.ts';
@@ -196,6 +197,10 @@ export enum AuditLogEvent {
ApplicationCommandPermissionUpdate = 121,
SoundboardSoundCreate = 130,
SoundboardSoundUpdate,
SoundboardSoundDelete,
AutoModerationRuleCreate = 140,
AutoModerationRuleUpdate,
AutoModerationRuleDelete,
@@ -372,6 +377,8 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyDeny
| APIAuditLogChangeKeyDescription
| APIAuditLogChangeKeyDiscoverySplashHash
| APIAuditLogChangeKeyEmojiId
| APIAuditLogChangeKeyEmojiName
| APIAuditLogChangeKeyEnabled
| APIAuditLogChangeKeyEnableEmoticons
| APIAuditLogChangeKeyEntityType
@@ -404,12 +411,15 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyPermissions
| APIAuditLogChangeKeyPosition
| APIAuditLogChangeKeyPreferredLocale
| APIAuditLogChangeKeyPremiumProgressBarEnabled
| APIAuditLogChangeKeyPrivacyLevel
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyPublicUpdatesChannelId
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyRecurrenceRule
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyRulesChannelId
| APIAuditLogChangeKeySoundId
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeySystemChannelFlags
@@ -420,10 +430,12 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyTriggerMetadata
| APIAuditLogChangeKeyTriggerType
| APIAuditLogChangeKeyType
| APIAuditLogChangeKeyUserId
| APIAuditLogChangeKeyUserLimit
| APIAuditLogChangeKeyUses
| APIAuditLogChangeKeyVanityURLCode
| APIAuditLogChangeKeyVerificationLevel
| APIAuditLogChangeKeyVolume
| APIAuditLogChangeKeyWidgetChannelId
| APIAuditLogChangeKeyWidgetEnabled;
@@ -533,6 +545,11 @@ export type APIAuditLogChangeKeyDefaultMessageNotifications = AuditLogChangeData
*/
export type APIAuditLogChangeKeyVanityURLCode = AuditLogChangeData<'vanity_url_code', string>;
/**
* Returned when a guild's boost progress bar is enabled
*/
export type APIAuditLogChangeKeyPremiumProgressBarEnabled = AuditLogChangeData<'premium_progress_bar_enabled', boolean>;
/**
* Returned when new role(s) are added
*/
@@ -607,6 +624,14 @@ export type APIAuditLogChangeKeyApplicationId = AuditLogChangeData<'application_
*/
export type APIAuditLogChangeKeyRateLimitPerUser = AuditLogChangeData<'rate_limit_per_user', number>;
/**
* Returned when a guild scheduled event's recurrence_rule is changed
*/
export type APIAuditLogChangeKeyRecurrenceRule = AuditLogChangeData<
'recurrence_rule',
APIGuildScheduledEventRecurrenceRule
>;
/**
* Returned when a permission bitfield is changed
*/
@@ -866,6 +891,31 @@ export type APIAuditLogChangeKeyDefaultThreadRateLimitPerUser = AuditLogChangeDa
number
>;
/**
* Returned when a soundboard is create or deleted
*/
export type APIAuditLogChangeKeySoundId = AuditLogChangeData<'sound_id', Snowflake>;
/**
* Returned when a soundboard's volume is changed
*/
export type APIAuditLogChangeKeyVolume = AuditLogChangeData<'volume', number>;
/**
* Returned when a soundboard's custom emoji is changed
*/
export type APIAuditLogChangeKeyEmojiId = AuditLogChangeData<'emoji_id', Snowflake>;
/**
* Returned when a soundboard's unicode emoji is changed
*/
export type APIAuditLogChangeKeyEmojiName = AuditLogChangeData<'emoji_name', string>;
/**
* Returned when a sounboard is created
*/
export type APIAuditLogChangeKeyUserId = AuditLogChangeData<'user_id', Snowflake>;
interface AuditLogChangeData<K extends string, D> {
key: K;
/**

View File

@@ -573,7 +573,7 @@ export interface APIMessage {
/**
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*
* The `MESSAGE_CONTENT` privileged gateway intent is required for verified applications to receive a non-empty value from this field
*
@@ -669,8 +669,6 @@ export interface APIMessage {
referenced_message?: APIMessage | null;
/**
* Sent if the message is sent as a result of an interaction
*
* @unstable
*/
interaction_metadata?: APIMessageInteractionMetadata;
/**
@@ -735,6 +733,10 @@ export interface APIMessage {
* See https://support-dev.discord.com/hc/articles/4404772028055
*/
poll?: APIPoll;
/**
* The message associated with the message_reference. This is a minimal subset of fields in a message (e.g. author is excluded.)
*/
message_snapshots?: APIMessageSnapshot[];
/**
* The call associated with the message
*/
@@ -786,6 +788,10 @@ export enum MessageType {
GuildIncidentAlertModeDisabled,
GuildIncidentReportRaid,
GuildIncidentReportFalseAlarm,
PurchaseNotification = 44,
PollResult = 46,
}
/**
@@ -810,6 +816,10 @@ export interface APIMessageActivity {
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
export interface APIMessageReference {
/**
* Type of reference
*/
type?: MessageReferenceType;
/**
* ID of the originating message
*/
@@ -834,6 +844,20 @@ export enum MessageActivityType {
JoinRequest = 5,
}
/**
* https://discord.com/developers/docs/resources/channel#message-reference-types
*/
export enum MessageReferenceType {
/**
* A standard reference used by replies
*/
Default,
/**
* Reference used to point to a message at a point in time
*/
Forward,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
*/
@@ -1040,7 +1064,7 @@ export interface APIThreadMetadata {
/**
* Whether the thread is locked; when a thread is locked, only users with `MANAGE_THREADS` can unarchive it
*/
locked?: boolean;
locked: boolean;
/**
* Whether non-moderators can add other non-moderators to the thread; only available on private threads
*/
@@ -1244,6 +1268,10 @@ export enum EmbedType {
* @unstable This embed type is currently not documented by Discord, but it is returned in the auto moderation system messages.
*/
AutoModerationMessage = 'auto_moderation_message',
/**
* Poll result embed
*/
PollResult = 'poll_result',
}
/**
@@ -1393,7 +1421,7 @@ export interface APIEmbedField {
}
/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface APIAttachment {
/**
@@ -1404,6 +1432,10 @@ export interface APIAttachment {
* Name of file attached
*/
filename: string;
/**
* The title of the file
*/
title?: string;
/**
* Description for the file
*/
@@ -1652,7 +1684,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
url: string;
}
export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
export interface APIButtonComponentWithSKUId
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
/**
* The id for a purchasable SKU
*/
sku_id: Snowflake;
}
export type APIButtonComponent =
| APIButtonComponentWithCustomId
| APIButtonComponentWithSKUId
| APIButtonComponentWithURL;
/**
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
@@ -1663,6 +1706,7 @@ export enum ButtonStyle {
Success,
Danger,
Link,
Premium,
}
/**
@@ -1868,6 +1912,27 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
required?: boolean;
}
/**
* https://discord.com/developers/docs/resources/channel#message-snapshot-object
*/
export interface APIMessageSnapshot {
/**
* Subset of the message object fields
*/
message: APIMessageSnapshotFields;
/**
* Id of the origin message's guild
*
* @deprecated This field doesn't accurately reflect the Discord API as it doesn't exist nor is documented and will
* be removed in the next major version.
*
* It was added in {@link https://github.com/discord/discord-api-docs/pull/6833/commits/d18f72d06d62e6b1d51ca2c1ef308ddc29ff3348 | d18f72d}
* but was later removed before the PR ({@link https://github.com/discord/discord-api-docs/pull/6833 | discord-api-docs#6833}) was merged.
* See {@link https://github.com/discordjs/discord-api-types/pull/1084 | discord-api-types#1084} for more information.
*/
guild_id?: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
*/
@@ -1926,3 +1991,19 @@ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuCom
// Modal components
export type APIModalActionRowComponent = APITextInputComponent;
export type APIMessageSnapshotFields = Pick<
APIMessage,
| 'attachments'
| 'components'
| 'content'
| 'edited_timestamp'
| 'embeds'
| 'flags'
| 'mention_roles'
| 'mentions'
| 'sticker_items'
| 'stickers'
| 'timestamp'
| 'type'
>;

View File

@@ -5,7 +5,7 @@
*/
import type { Snowflake } from '../../globals.ts';
import type { APIChannel, APIThreadMember } from './channel.ts';
import type { APIThreadChannel, APIThreadMember } from './channel.ts';
import type { APIEmoji } from './emoji.ts';
import type { APIUser } from './user.ts';
@@ -361,7 +361,7 @@ export interface GatewayThreadListSync {
/**
* Array of the synced threads
*/
threads: APIChannel[];
threads: APIThreadChannel[];
/**
* The member objects for the client user in each joined thread that was synced
*/

View File

@@ -3,6 +3,7 @@
*/
import type { Permissions, Snowflake } from '../../globals.ts';
import type { Locale } from '../../rest/common.ts';
import type { APIEmoji, APIPartialEmoji } from './emoji.ts';
import type { PresenceUpdateReceiveStatus } from './gateway.ts';
import type { OAuth2Scopes } from './oauth2.ts';
@@ -227,7 +228,7 @@ export interface APIGuild extends APIPartialGuild {
*
* @default "en-US"
*/
preferred_locale: string;
preferred_locale: Locale;
/**
* The id of the channel where admins and moderators of Community guilds receive notices from Discord
*/
@@ -282,6 +283,19 @@ export interface APIGuild extends APIPartialGuild {
safety_alerts_channel_id: Snowflake | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-guild-structure
*/
export interface APIPartialInteractionGuild extends Pick<APIGuild, 'features' | 'id'> {
/**
* The preferred locale of a Community guild; used in guild discovery and notices from Discord; defaults to "en-US"
*
* @unstable https://github.com/discord/discord-api-docs/issues/6938
* @default "en-US"
*/
locale: Locale;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
*/
@@ -471,6 +485,10 @@ export enum GuildFeature {
* Guild has enabled Membership Screening
*/
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
/**
* Guild has increased custom soundboard sound slots
*/
MoreSoundboard = 'MORE_SOUNDBOARD',
/**
* Guild has enabled monetization
*
@@ -514,6 +532,10 @@ export enum GuildFeature {
* Guild has enabled role subscriptions
*/
RoleSubscriptionsEnabled = 'ROLE_SUBSCRIPTIONS_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
/**
* Guild has enabled ticketed events
*/
@@ -630,6 +652,10 @@ export interface APIGuildMember {
* The member's guild avatar hash
*/
avatar?: string | null;
/**
* The member's guild banner hash
*/
banner?: string | null;
/**
* Array of role object ids
*
@@ -689,7 +715,7 @@ export enum GuildMemberFlags {
*/
CompletedOnboarding = 1 << 1,
/**
* Member bypasses guild verification requirements
* Member is exempt from guild verification requirements
*/
BypassesVerification = 1 << 2,
/**
@@ -697,21 +723,29 @@ export enum GuildMemberFlags {
*/
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.
* Member is a guest and can only access the voice channel they were invited to
*/
IsGuest = 1 << 4,
/**
* Member has started Server Guide new member actions
*/
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.
* Member has completed Server Guide new member actions
*/
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.
* Member's username, display name, or nickname is blocked by AutoMod
*/
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.
* @deprecated
*/
AutomodQuarantinedBio = 1 << 8,
/**
* Member has dismissed the DM settings upsell
*/
DmSettingsUpsellAcknowledged = 1 << 9,
}
/**

View File

@@ -67,6 +67,113 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
* The cover image of the scheduled event
*/
image?: string | null;
/**
* The definition for how often this event should recur
*/
recurrence_rule: APIGuildScheduledEventRecurrenceRule | null;
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-structure
*/
export interface APIGuildScheduledEventRecurrenceRule {
/**
* Starting time of the recurrence interval
*/
start: string;
/**
* Ending time of the recurrence interval
*/
end: string | null;
/**
* How often the event occurs
*/
frequency: GuildScheduledEventRecurrenceRuleFrequency;
/**
* The spacing between the events, defined by `frequency`.
* For example, `frequency` of {@apilink GuildScheduledEventRecurrenceRuleFrequency#Weekly} and an `interval` of `2`
* would be "every-other week"
*/
interval: number;
/**
* Set of specific days within a week for the event to recur on
*/
by_weekday: GuildScheduledEventRecurrenceRuleWeekday[] | null;
/**
* List of specific days within a specific week (1-5) to recur on
*/
by_n_weekday: GuildScheduledEventRecurrenceRuleNWeekday[] | null;
/**
* Set of specific months to recur on
*/
by_month: GuildScheduledEventRecurrenceRuleMonth[] | null;
/**
* Set of specific dates within a month to recur on
*/
by_month_day: number[] | null;
/**
* Set of days within a year to recur on (1-364)
*/
by_year_day: number[] | null;
/**
* The total amount of times that the event is allowed to recur before stopping
*/
count: number | null;
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-frequency
*/
export enum GuildScheduledEventRecurrenceRuleFrequency {
Yearly,
Monthly,
Weekly,
Daily,
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-weekday
*/
export enum GuildScheduledEventRecurrenceRuleWeekday {
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday,
Sunday,
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-month
*/
export enum GuildScheduledEventRecurrenceRuleMonth {
January = 1,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December,
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-nweekday-structure
*/
export interface GuildScheduledEventRecurrenceRuleNWeekday {
/**
* The week to reoccur on.
*/
n: 1 | 2 | 3 | 4 | 5;
/**
* The day within the week to reoccur on
*/
day: GuildScheduledEventRecurrenceRuleWeekday;
}
export interface APIStageInstanceGuildScheduledEvent

View File

@@ -9,9 +9,11 @@ export * from './guild.ts';
export * from './guildScheduledEvent.ts';
export * from './interactions.ts';
export * from './invite.ts';
export * from './monetization.ts';
export * from './oauth2.ts';
export * from './poll.ts';
export * from './permissions.ts';
export * from './poll.ts';
export * from './soundboard.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './teams.ts';
@@ -19,4 +21,3 @@ export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export * from './monetization.ts';

View File

@@ -33,13 +33,13 @@ export interface APIEntitlement {
*/
deleted: boolean;
/**
* Start date at which the entitlement is valid. Not present when using test entitlements.
* Start date at which the entitlement is valid.
*/
starts_at?: string;
starts_at: string | null;
/**
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
* Date at which the entitlement is no longer valid.
*/
ends_at?: string;
ends_at: string | null;
/**
* For consumable items, whether or not the entitlement has been consumed
*/
@@ -135,6 +135,9 @@ export enum SKUFlags {
UserSubscription = 1 << 8,
}
/**
* https://discord.com/developers/docs/resources/sku#sku-object-sku-types
*/
export enum SKUType {
/**
* Durable one-time purchase
@@ -153,3 +156,67 @@ export enum SKUType {
*/
SubscriptionGroup = 6,
}
/**
* https://discord.com/developers/docs/resources/subscription#subscription-object
*/
export interface APISubscription {
/**
* ID of the subscription
*/
id: Snowflake;
/**
* ID of the user who is subscribed
*/
user_id: Snowflake;
/**
* List of SKUs subscribed to
*/
sku_ids: Snowflake[];
/**
* List of entitlements granted for this subscription
*/
entitlement_ids: Snowflake[];
/**
* List of SKUs that this user will be subscribed to at renewal
*/
renewal_sku_ids: Snowflake[] | null;
/**
* Start of the current subscription period
*/
current_period_start: string;
/**
* End of the current subscription period
*/
current_period_end: string;
/**
* Current status of the subscription
*/
status: SubscriptionStatus;
/**
* When the subscription was canceled
*/
canceled_at: string | null;
/**
* ISO3166-1 alpha-2 country code of the payment source used to purchase the subscription. Missing unless queried with a private OAuth scope.
*/
country?: string;
}
/**
* https://discord.com/developers/docs/resources/subscription#subscription-statuses
*/
export enum SubscriptionStatus {
/**
* Subscription is active and scheduled to renew.
*/
Active,
/**
* Subscription is active but will not renew.
*/
Ending,
/**
* Subscription is inactive and not being charged.
*/
Inactive,
}

View File

@@ -22,10 +22,14 @@ export interface APIPoll {
expiry: string;
/**
* Whether a user can select multiple answers
*
* @default false
*/
allow_multiselect: boolean;
/**
* The layout type of the poll
*
* @default PollLayoutType.Default
*/
layout_type: PollLayoutType;
/**

View File

@@ -0,0 +1,44 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/soundboard
*/
import type { Snowflake } from '../../globals.ts';
import type { APIUser } from './user.ts';
/**
* https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object
*/
export interface APISoundboardSound {
/**
* The name of this sound
*/
name: string;
/**
* The id of this sound
*/
sound_id: Snowflake;
/**
* The volume of this sound, from 0 to 1
*/
volume: number;
/**
* The id of this sound's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of this sound's standard emoji
*/
emoji_name: string | null;
/**
* The id of the guild that this sound is in
*/
guild_id?: Snowflake;
/**
* Whether this sound can be used (for guild sounds), may be false due to loss of Server Boosts
*/
available: boolean;
/**
* The user who created this sound
*/
user?: APIUser;
}

View File

@@ -33,6 +33,7 @@ export interface APISticker {
* Previously the sticker asset hash, now an empty string
*
* @deprecated
* @unstable This field is no longer documented by Discord and will be removed in v11
*/
asset?: '';
/**

View File

@@ -3,6 +3,7 @@
*/
import type { Snowflake } from '../../globals.ts';
import type { Locale } from '../../rest/common.ts';
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v10/mod.ts';
import type { APIUser } from './user.ts';
@@ -60,6 +61,6 @@ export interface APITemplate {
export interface APITemplateSerializedSourceGuild extends Omit<RESTPostAPIGuildsJSONBody, 'icon'> {
description: string | null;
preferred_locale: string;
preferred_locale: Locale;
icon_hash: string | null;
}

View File

@@ -273,8 +273,11 @@ export interface APIConnection {
}
export enum ConnectionService {
AmazonMusic = 'amazon-music',
BattleNet = 'battlenet',
Bluesky = 'bluesky',
BungieNet = 'bungie',
Crunchyroll = 'crunchyroll',
Domain = 'domain',
eBay = 'ebay',
EpicGames = 'epicgames',
@@ -282,10 +285,12 @@ export enum ConnectionService {
GitHub = 'github',
Instagram = 'instagram',
LeagueOfLegends = 'leagueoflegends',
Mastodon = 'mastodon',
PayPal = 'paypal',
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
RiotGames = 'riotgames',
Roblox = 'roblox',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',

View File

@@ -7,8 +7,15 @@ import type { APIGuildMember } from './guild.ts';
/**
* https://discord.com/developers/docs/resources/voice#voice-state-object
*
* @deprecated This is deprecated, use {@apilink APIVoiceState}
*/
export interface GatewayVoiceState {
export type GatewayVoiceState = APIVoiceState;
/**
* https://discord.com/developers/docs/resources/voice#voice-state-object
*/
export interface APIVoiceState {
/**
* The guild id this voice state is for
*/

View File

@@ -3,7 +3,15 @@
*/
import type { Snowflake } from '../../globals.ts';
import type { APIPartialChannel, APIPartialGuild, APIUser } from './mod.ts';
import type {
APIEntitlement,
APIGuild,
APIPartialChannel,
APIPartialGuild,
APIUser,
ApplicationIntegrationType,
OAuth2Scopes,
} from './mod.ts';
/**
* https://discord.com/developers/docs/resources/webhook#webhook-object
@@ -63,6 +71,116 @@ export interface APIWebhook {
url?: string;
}
/**
* https://discord.com/developers/docs/events/webhook-events#webhook-event-payloads
*/
export type APIWebhookEvent =
| APIWebhookEventBase<ApplicationWebhookType.Event, APIWebhookEventBody>
| APIWebhookEventBase<ApplicationWebhookType.Ping, never>;
/**
* https://discord.com/developers/docs/events/webhook-events#event-body-object
*/
export type APIWebhookEventBody =
| APIWebhookEventEventBase<
ApplicationWebhookEventType.ApplicationAuthorized,
APIWebhookEventApplicationAuthorizedData
>
| APIWebhookEventEventBase<ApplicationWebhookEventType.EntitlementCreate, APIWebhookEventEntitlementCreateData>
| APIWebhookEventEventBase<ApplicationWebhookEventType.QuestUserEnrollment, APIWebhookEventQuestUserEnrollmentData>;
export interface APIWebhookEventApplicationAuthorizedData {
/**
* Installation context for the authorization. Either guild (`0`) if installed to a server or user (`1`) if installed to a user's account
*/
integration_type?: ApplicationIntegrationType;
/**
* User who authorized the app
*/
user: APIUser;
/**
* List of scopes the user authorized
*/
scopes: OAuth2Scopes[];
/**
* Server which app was authorized for (when integration type is `0`)
*/
guild?: APIGuild;
}
export type APIWebhookEventEntitlementCreateData = APIEntitlement;
export type APIWebhookEventQuestUserEnrollmentData = never;
interface APIWebhookEventBase<Type extends ApplicationWebhookType, Event> {
/**
* Version scheme for the webhook event. Currently always `1`
*/
version: 1;
/**
* ID of your app
*/
application_id: Snowflake;
/**
* Type of webhook
*/
type: Type;
/**
* Event data payload
*/
event: Event;
}
/**
* https://discord.com/developers/docs/events/webhook-events#webhook-types
*/
export enum ApplicationWebhookType {
/**
* PING event sent to verify your Webhook Event URL is active
*/
Ping,
/**
* Webhook event (details for event in event body object)
*/
Event,
}
interface APIWebhookEventEventBase<Type extends ApplicationWebhookEventType, Data> {
/**
* Event type
*/
type: Type;
/**
* Timestamp of when the event occurred in ISO8601 format
*/
timestamp: string;
/**
* Data for the event. The shape depends on the event type
*/
data: Data;
}
/**
* https://discord.com/developers/docs/events/webhook-events#event-types
*/
export enum ApplicationWebhookEventType {
/**
* Sent when an app was authorized by a user to a server or their account
*/
ApplicationAuthorized = 'APPLICATION_AUTHORIZED',
/**
* Entitlement was created
*/
EntitlementCreate = 'ENTITLEMENT_CREATE',
/**
* User was added to a Quest (currently unavailable)
*/
QuestUserEnrollment = 'QUEST_USER_ENROLLMENT',
}
/**
* https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types
*/
export enum WebhookType {
/**
* Incoming Webhooks can post messages to channels with a generated token

View File

@@ -0,0 +1,26 @@
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIPrimaryEntryPointCommandInteractionData =
APIBaseApplicationCommandInteractionData<ApplicationCommandType.PrimaryEntryPoint>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIPrimaryEntryPointCommandInteraction =
APIApplicationCommandInteractionWrapper<APIPrimaryEntryPointCommandInteractionData>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIPrimaryEntryPointCommandDMInteraction = APIDMInteractionWrapper<APIPrimaryEntryPointCommandInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIPrimaryEntryPointCommandGuildInteraction =
APIGuildInteractionWrapper<APIPrimaryEntryPointCommandInteraction>;

View File

@@ -13,12 +13,19 @@ import type {
APIContextMenuInteraction,
APIContextMenuInteractionData,
} from './_applicationCommands/contextMenu.ts';
import type {
APIPrimaryEntryPointCommandDMInteraction,
APIPrimaryEntryPointCommandGuildInteraction,
APIPrimaryEntryPointCommandInteraction,
APIPrimaryEntryPointCommandInteractionData,
} from './_applicationCommands/entryPoint.ts';
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
export * from './_applicationCommands/chatInput.ts';
export * from './_applicationCommands/contextMenu.ts';
export * from './_applicationCommands/permissions.ts';
export * from './_applicationCommands/entryPoint.ts';
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object
@@ -92,29 +99,45 @@ export interface APIApplicationCommand {
nsfw?: boolean;
/**
* Installation context(s) where the command is available, only for globally-scoped commands. Defaults to `GUILD_INSTALL ([0])`
*
* @unstable
*/
integration_types?: ApplicationIntegrationType[];
/**
* Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands `[0,1,2]`.
*
* @unstable
*/
contexts?: InteractionContextType[] | null;
/**
* Autoincrementing version identifier updated during substantial record changes
*/
version: Snowflake;
/**
* Determines whether the interaction is handled by the app's interactions handler or by Discord
*
* @remarks
* This is only available for {@link ApplicationCommandType.PrimaryEntryPoint} commands
*/
handler?: EntryPointCommandHandlerType;
}
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types
*/
export enum ApplicationCommandType {
/**
* Slash commands; a text-based command that shows up when a user types `/`
*/
ChatInput = 1,
/**
* A UI-based command that shows up when you right click or tap on a user
*/
User,
/**
* A UI-based command that shows up when you right click or tap on a message
*/
Message,
/**
* A UI-based command that represents the primary way to invoke an app's Activity
*/
PrimaryEntryPoint,
}
/**
@@ -124,11 +147,11 @@ export enum ApplicationIntegrationType {
/**
* App is installable to servers
*/
GuildInstall = 0,
GuildInstall,
/**
* App is installable to users
*/
UserInstall = 1,
UserInstall,
}
/**
@@ -138,15 +161,30 @@ export enum InteractionContextType {
/**
* Interaction can be used within servers
*/
Guild = 0,
Guild,
/**
* Interaction can be used within DMs with the app's bot user
*/
BotDM = 1,
BotDM,
/**
* Interaction can be used within Group DMs and DMs other than the app's bot user
*/
PrivateChannel = 2,
PrivateChannel,
}
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-entry-point-command-handler-types
*/
export enum EntryPointCommandHandlerType {
/**
* The app handles the interaction using an interaction token
*/
AppHandler = 1,
/**
* Discord handles the interaction by launching an Activity and sending a follow-up message without coordinating with
* the app
*/
DiscordLaunchActivity,
}
/**
@@ -154,7 +192,8 @@ export enum InteractionContextType {
*/
export type APIApplicationCommandInteractionData =
| APIChatInputApplicationCommandInteractionData
| APIContextMenuInteractionData;
| APIContextMenuInteractionData
| APIPrimaryEntryPointCommandInteractionData;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
@@ -171,18 +210,23 @@ export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationC
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandInteraction = APIChatInputApplicationCommandInteraction | APIContextMenuInteraction;
export type APIApplicationCommandInteraction =
| APIChatInputApplicationCommandInteraction
| APIContextMenuInteraction
| APIPrimaryEntryPointCommandInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandDMInteraction =
| APIChatInputApplicationCommandDMInteraction
| APIContextMenuDMInteraction;
| APIContextMenuDMInteraction
| APIPrimaryEntryPointCommandDMInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandGuildInteraction =
| APIChatInputApplicationCommandGuildInteraction
| APIContextMenuGuildInteraction;
| APIContextMenuGuildInteraction
| APIPrimaryEntryPointCommandGuildInteraction;

View File

@@ -1,5 +1,5 @@
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { APIRole, ApplicationIntegrationType, InteractionContextType, LocaleString } from '../../../v9.ts';
import type { APIRole, ApplicationIntegrationType, InteractionContextType, Locale } from '../../../v9.ts';
import type {
APIAttachment,
APIChannel,
@@ -9,7 +9,7 @@ import type {
ChannelType,
ThreadChannelType,
} from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIGuildMember, APIPartialInteractionGuild } from '../guild.ts';
import type { APIEntitlement } from '../monetization.ts';
import type { APIUser } from '../user.ts';
import type { InteractionType } from './responses.ts';
@@ -17,7 +17,15 @@ import type { InteractionType } from './responses.ts';
/**
* https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object
*/
export interface APIMessageInteractionMetadata {
export type APIMessageInteractionMetadata =
| APIApplicationCommandInteractionMetadata
| APIMessageComponentInteractionMetadata
| APIModalSubmitInteractionMetadata;
/**
* https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object
*/
interface APIBaseInteractionMetadata<Type extends InteractionType> {
/**
* ID of the interaction
*/
@@ -25,27 +33,56 @@ export interface APIMessageInteractionMetadata {
/**
* Type of interaction
*/
type: InteractionType;
type: Type;
/**
* User who triggered the interaction
*/
user: APIUser;
/**
* IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object
* IDs for installation context(s) related to an interaction
*/
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
/**
* ID of the original response message, present only on follow-up messages
*/
original_response_message_id?: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-application-command-interaction-metadata-structure
*/
export interface APIApplicationCommandInteractionMetadata
extends APIBaseInteractionMetadata<InteractionType.ApplicationCommand> {
/**
* ID of the message that contained interactive component, present only on messages created from component interactions
* The user the command was run on, present only on user commands interactions
*/
interacted_message_id?: Snowflake;
target_user?: APIUser;
/**
* Metadata for the interaction that was used to open the modal, present only on modal submit interactions
* The ID of the message the command was run on, present only on message command interactions.
* The original response message will also have `message_reference` and `referenced_message` pointing to this message.
*/
triggering_interaction_metadata?: APIMessageInteractionMetadata;
target_message_id?: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-message-command-interaction-metadata-structure
*/
export interface APIMessageComponentInteractionMetadata
extends APIBaseInteractionMetadata<InteractionType.MessageComponent> {
/**
* ID of the message that contained the interactive component
*/
interacted_message_id: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-modal-submit-interaction-metadata-structure
*/
export interface APIModalSubmitInteractionMetadata extends APIBaseInteractionMetadata<InteractionType.ModalSubmit> {
/**
* Metadata for the interaction that was used to open the modal
*/
triggering_interaction_metadata: APIApplicationCommandInteractionMetadata | APIMessageComponentInteractionMetadata;
}
export type PartialAPIMessageInteractionGuildMember = Pick<
@@ -118,7 +155,11 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
*/
data?: Data;
/**
* The guild it was sent from
* Guild that the interaction was sent from
*/
guild?: APIPartialInteractionGuild;
/**
* Guild that the interaction was sent from
*/
guild_id?: Snowflake;
/**
@@ -160,11 +201,11 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
/**
* The selected language of the invoking user
*/
locale: LocaleString;
locale: Locale;
/**
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: LocaleString;
guild_locale?: Locale;
/**
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
*/

View File

@@ -22,6 +22,7 @@ export type APIInteractionResponse =
| APIInteractionResponseChannelMessageWithSource
| APIInteractionResponseDeferredChannelMessageWithSource
| APIInteractionResponseDeferredMessageUpdate
| APIInteractionResponseLaunchActivity
| APIInteractionResponsePong
| APIInteractionResponseUpdateMessage
| APIModalInteractionResponse
@@ -64,6 +65,10 @@ export interface APIInteractionResponseUpdateMessage {
data?: APIInteractionResponseCallbackData;
}
export interface APIInteractionResponseLaunchActivity {
type: InteractionResponseType.LaunchActivity;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type
*/
@@ -98,8 +103,18 @@ export enum InteractionResponseType {
Modal,
/**
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
*
* @deprecated See https://discord.com/developers/docs/change-log#premium-apps-new-premium-button-style-deep-linking-url-schemes
*/
PremiumRequired,
/**
* Launch the Activity associated with the app.
*
* @remarks
* Only available for apps with Activities enabled
*/
LaunchActivity = 12,
}
/**

View File

@@ -9,6 +9,7 @@ import type { ApplicationIntegrationType } from './interactions.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
import type { ApplicationWebhookEventType } from './webhook.ts';
/**
* https://discord.com/developers/docs/resources/application#application-object
@@ -64,6 +65,7 @@ export interface APIApplication {
* An empty string
*
* @deprecated This field will be removed in v11
* @unstable This field is no longer documented by Discord and will be removed in v11
*/
summary: '';
/**
@@ -108,6 +110,10 @@ export interface APIApplication {
* Approximate count of guilds the application has been added to
*/
approximate_guild_count?: number;
/**
* Approximate count of users that have installed the app
*/
approximate_user_install_count?: number;
/**
* Array of redirect URIs for the application
*/
@@ -115,12 +121,12 @@ export interface APIApplication {
/**
* The interactions endpoint URL for the application
*/
interactions_endpoint_url?: string;
interactions_endpoint_url?: string | null;
/**
* 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;
role_connections_verification_url?: string | null;
/**
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
*/
@@ -131,14 +137,24 @@ export interface APIApplication {
install_params?: APIApplicationInstallParams;
/**
* Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object
*
* @unstable
*/
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
/**
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
/**
* Event webhook URL for the app to receive webhook events
*/
event_webhooks_url?: string | null;
/**
* If webhook events are enabled for the app
*/
event_webhooks_status: ApplicationWebhookEventStatus;
/**
* List of webhook event types the app subscribes to
*/
event_webhooks_types?: ApplicationWebhookEventType[];
}
export interface APIApplicationInstallParams {
@@ -294,3 +310,21 @@ export enum ApplicationRoleConnectionMetadataType {
*/
BooleanNotEqual,
}
/**
* https://discord.com/developers/docs/resources/application#application-object-application-event-webhook-status
*/
export enum ApplicationWebhookEventStatus {
/**
* Webhook events are disabled by developer
*/
Disabled = 1,
/**
* Webhook events are enabled by developer
*/
Enabled,
/**
* Webhook events are disabled by Discord, usually due to inactivity
*/
DisabledByDiscord,
}

View File

@@ -23,6 +23,7 @@ import type {
} from './guild.ts';
import type {
APIGuildScheduledEvent,
APIGuildScheduledEventRecurrenceRule,
GuildScheduledEventEntityType,
GuildScheduledEventStatus,
} from './guildScheduledEvent.ts';
@@ -196,6 +197,10 @@ export enum AuditLogEvent {
ApplicationCommandPermissionUpdate = 121,
SoundboardSoundCreate = 130,
SoundboardSoundUpdate,
SoundboardSoundDelete,
AutoModerationRuleCreate = 140,
AutoModerationRuleUpdate,
AutoModerationRuleDelete,
@@ -372,6 +377,8 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyDeny
| APIAuditLogChangeKeyDescription
| APIAuditLogChangeKeyDiscoverySplashHash
| APIAuditLogChangeKeyEmojiId
| APIAuditLogChangeKeyEmojiName
| APIAuditLogChangeKeyEnabled
| APIAuditLogChangeKeyEnableEmoticons
| APIAuditLogChangeKeyEntityType
@@ -404,12 +411,15 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyPermissions
| APIAuditLogChangeKeyPosition
| APIAuditLogChangeKeyPreferredLocale
| APIAuditLogChangeKeyPremiumProgressBarEnabled
| APIAuditLogChangeKeyPrivacyLevel
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyPublicUpdatesChannelId
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyRecurrenceRule
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyRulesChannelId
| APIAuditLogChangeKeySoundId
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeySystemChannelFlags
@@ -420,10 +430,12 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyTriggerMetadata
| APIAuditLogChangeKeyTriggerType
| APIAuditLogChangeKeyType
| APIAuditLogChangeKeyUserId
| APIAuditLogChangeKeyUserLimit
| APIAuditLogChangeKeyUses
| APIAuditLogChangeKeyVanityURLCode
| APIAuditLogChangeKeyVerificationLevel
| APIAuditLogChangeKeyVolume
| APIAuditLogChangeKeyWidgetChannelId
| APIAuditLogChangeKeyWidgetEnabled;
@@ -533,6 +545,11 @@ export type APIAuditLogChangeKeyDefaultMessageNotifications = AuditLogChangeData
*/
export type APIAuditLogChangeKeyVanityURLCode = AuditLogChangeData<'vanity_url_code', string>;
/**
* Returned when a guild's boost progress bar is enabled
*/
export type APIAuditLogChangeKeyPremiumProgressBarEnabled = AuditLogChangeData<'premium_progress_bar_enabled', boolean>;
/**
* Returned when new role(s) are added
*/
@@ -607,6 +624,14 @@ export type APIAuditLogChangeKeyApplicationId = AuditLogChangeData<'application_
*/
export type APIAuditLogChangeKeyRateLimitPerUser = AuditLogChangeData<'rate_limit_per_user', number>;
/**
* Returned when a guild scheduled event's recurrence_rule is changed
*/
export type APIAuditLogChangeKeyRecurrenceRule = AuditLogChangeData<
'recurrence_rule',
APIGuildScheduledEventRecurrenceRule
>;
/**
* Returned when a permission bitfield is changed
*/
@@ -866,6 +891,31 @@ export type APIAuditLogChangeKeyDefaultThreadRateLimitPerUser = AuditLogChangeDa
number
>;
/**
* Returned when a soundboard is create or deleted
*/
export type APIAuditLogChangeKeySoundId = AuditLogChangeData<'sound_id', Snowflake>;
/**
* Returned when a soundboard's volume is changed
*/
export type APIAuditLogChangeKeyVolume = AuditLogChangeData<'volume', number>;
/**
* Returned when a soundboard's custom emoji is changed
*/
export type APIAuditLogChangeKeyEmojiId = AuditLogChangeData<'emoji_id', Snowflake>;
/**
* Returned when a soundboard's unicode emoji is changed
*/
export type APIAuditLogChangeKeyEmojiName = AuditLogChangeData<'emoji_name', string>;
/**
* Returned when a sounboard is created
*/
export type APIAuditLogChangeKeyUserId = AuditLogChangeData<'user_id', Snowflake>;
interface AuditLogChangeData<K extends string, D> {
key: K;
/**

View File

@@ -567,7 +567,7 @@ export interface APIMessage {
/**
* Any attached files
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*
* 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
*
@@ -661,8 +661,6 @@ export interface APIMessage {
referenced_message?: APIMessage | null;
/**
* Sent if the message is sent as a result of an interaction
*
* @unstable
*/
interaction_metadata?: APIMessageInteractionMetadata;
/**
@@ -720,6 +718,10 @@ export interface APIMessage {
* See https://support-dev.discord.com/hc/articles/4404772028055
*/
poll?: APIPoll;
/**
* The message associated with the message_reference. This is a minimal subset of fields in a message (e.g. author is excluded.)
*/
message_snapshots?: APIMessageSnapshot[];
/**
* The call associated with the message
*/
@@ -771,6 +773,10 @@ export enum MessageType {
GuildIncidentAlertModeDisabled,
GuildIncidentReportRaid,
GuildIncidentReportFalseAlarm,
PurchaseNotification = 44,
PollResult = 46,
}
/**
@@ -795,6 +801,10 @@ export interface APIMessageActivity {
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
export interface APIMessageReference {
/**
* Type of reference
*/
type?: MessageReferenceType;
/**
* ID of the originating message
*/
@@ -819,6 +829,20 @@ export enum MessageActivityType {
JoinRequest = 5,
}
/**
* https://discord.com/developers/docs/resources/channel#message-reference-types
*/
export enum MessageReferenceType {
/**
* A standard reference used by replies
*/
Default,
/**
* Reference used to point to a message at a point in time
*/
Forward,
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
*/
@@ -1003,7 +1027,7 @@ export interface APIThreadMetadata {
/**
* Whether the thread is locked; when a thread is locked, only users with `MANAGE_THREADS` can unarchive it
*/
locked?: boolean;
locked: boolean;
/**
* Whether non-moderators can add other non-moderators to the thread; only available on private threads
*/
@@ -1211,6 +1235,10 @@ export enum EmbedType {
* @unstable This embed type is currently not documented by Discord, but it is returned in the auto moderation system messages.
*/
AutoModerationMessage = 'auto_moderation_message',
/**
* Poll result embed
*/
PollResult = 'poll_result',
}
/**
@@ -1360,7 +1388,7 @@ export interface APIEmbedField {
}
/**
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface APIAttachment {
/**
@@ -1371,6 +1399,10 @@ export interface APIAttachment {
* Name of file attached
*/
filename: string;
/**
* The title of the file
*/
title?: string;
/**
* Description for the file
*/
@@ -1619,7 +1651,18 @@ export interface APIButtonComponentWithURL extends APIButtonComponentBase<Button
url: string;
}
export type APIButtonComponent = APIButtonComponentWithCustomId | APIButtonComponentWithURL;
export interface APIButtonComponentWithSKUId
extends Omit<APIButtonComponentBase<ButtonStyle.Premium>, 'custom_id' | 'emoji' | 'label'> {
/**
* The id for a purchasable SKU
*/
sku_id: Snowflake;
}
export type APIButtonComponent =
| APIButtonComponentWithCustomId
| APIButtonComponentWithSKUId
| APIButtonComponentWithURL;
/**
* https://discord.com/developers/docs/interactions/message-components#button-object-button-styles
@@ -1630,6 +1673,7 @@ export enum ButtonStyle {
Success,
Danger,
Link,
Premium,
}
/**
@@ -1835,6 +1879,27 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
required?: boolean;
}
/**
* https://discord.com/developers/docs/resources/channel#message-snapshot-object
*/
export interface APIMessageSnapshot {
/**
* Subset of the message object fields
*/
message: APIMessageSnapshotFields;
/**
* Id of the origin message's guild
*
* @deprecated This field doesn't accurately reflect the Discord API as it doesn't exist nor is documented and will
* be removed in the next major version.
*
* It was added in {@link https://github.com/discord/discord-api-docs/pull/6833/commits/d18f72d06d62e6b1d51ca2c1ef308ddc29ff3348 | d18f72d}
* but was later removed before the PR ({@link https://github.com/discord/discord-api-docs/pull/6833 | discord-api-docs#6833}) was merged.
* See {@link https://github.com/discordjs/discord-api-types/pull/1084 | discord-api-types#1084} for more information.
*/
guild_id?: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
*/
@@ -1893,3 +1958,19 @@ export type APIMessageActionRowComponent = APIButtonComponent | APISelectMenuCom
// Modal components
export type APIModalActionRowComponent = APITextInputComponent;
export type APIMessageSnapshotFields = Pick<
APIMessage,
| 'attachments'
| 'components'
| 'content'
| 'edited_timestamp'
| 'embeds'
| 'flags'
| 'mention_roles'
| 'mentions'
| 'sticker_items'
| 'stickers'
| 'timestamp'
| 'type'
>;

View File

@@ -5,7 +5,7 @@
*/
import type { Snowflake } from '../../globals.ts';
import type { APIChannel, APIThreadMember } from './channel.ts';
import type { APIThreadChannel, APIThreadMember } from './channel.ts';
import type { APIEmoji } from './emoji.ts';
import type { APIUser } from './user.ts';
@@ -349,7 +349,7 @@ export interface GatewayThreadListSync {
/**
* Array of the synced threads
*/
threads: APIChannel[];
threads: APIThreadChannel[];
/**
* The member objects for the client user in each joined thread that was synced
*/

View File

@@ -3,6 +3,7 @@
*/
import type { Permissions, Snowflake } from '../../globals.ts';
import type { Locale } from '../../rest/common.ts';
import type { APIEmoji, APIPartialEmoji } from './emoji.ts';
import type { PresenceUpdateReceiveStatus } from './gateway.ts';
import type { OAuth2Scopes } from './oauth2.ts';
@@ -227,7 +228,7 @@ export interface APIGuild extends APIPartialGuild {
*
* @default "en-US"
*/
preferred_locale: string;
preferred_locale: Locale;
/**
* The id of the channel where admins and moderators of Community guilds receive notices from Discord
*/
@@ -282,6 +283,19 @@ export interface APIGuild extends APIPartialGuild {
safety_alerts_channel_id: Snowflake | null;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-guild-structure
*/
export interface APIPartialInteractionGuild extends Pick<APIGuild, 'features' | 'id'> {
/**
* The preferred locale of a Community guild; used in guild discovery and notices from Discord; defaults to "en-US"
*
* @unstable https://github.com/discord/discord-api-docs/issues/6938
* @default "en-US"
*/
locale: Locale;
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
*/
@@ -463,6 +477,10 @@ export enum GuildFeature {
* Guild has enabled Membership Screening
*/
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
/**
* Guild has increased custom soundboard sound slots
*/
MoreSoundboard = 'MORE_SOUNDBOARD',
/**
* Guild has enabled monetization
*
@@ -506,6 +524,10 @@ export enum GuildFeature {
* Guild has enabled role subscriptions
*/
RoleSubscriptionsEnabled = 'ROLE_SUBSCRIPTIONS_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
/**
* Guild has enabled ticketed events
*/
@@ -622,6 +644,10 @@ export interface APIGuildMember {
* The member's guild avatar hash
*/
avatar?: string | null;
/**
* The member's guild banner hash
*/
banner?: string | null;
/**
* Array of role object ids
*
@@ -681,7 +707,7 @@ export enum GuildMemberFlags {
*/
CompletedOnboarding = 1 << 1,
/**
* Member bypasses guild verification requirements
* Member is exempt from guild verification requirements
*/
BypassesVerification = 1 << 2,
/**
@@ -689,21 +715,29 @@ export enum GuildMemberFlags {
*/
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.
* Member is a guest and can only access the voice channel they were invited to
*/
IsGuest = 1 << 4,
/**
* Member has started Server Guide new member actions
*/
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.
* Member has completed Server Guide new member actions
*/
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.
* Member's username, display name, or nickname is blocked by AutoMod
*/
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.
* @deprecated
*/
AutomodQuarantinedBio = 1 << 8,
/**
* Member has dismissed the DM settings upsell
*/
DmSettingsUpsellAcknowledged = 1 << 9,
}
/**

View File

@@ -67,6 +67,113 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
* The cover image of the scheduled event
*/
image?: string | null;
/**
* The definition for how often this event should recur
*/
recurrence_rule: APIGuildScheduledEventRecurrenceRule | null;
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-structure
*/
export interface APIGuildScheduledEventRecurrenceRule {
/**
* Starting time of the recurrence interval
*/
start: string;
/**
* Ending time of the recurrence interval
*/
end: string | null;
/**
* How often the event occurs
*/
frequency: GuildScheduledEventRecurrenceRuleFrequency;
/**
* The spacing between the events, defined by `frequency`.
* For example, `frequency` of {@apilink GuildScheduledEventRecurrenceRuleFrequency#Weekly} and an `interval` of `2`
* would be "every-other week"
*/
interval: number;
/**
* Set of specific days within a week for the event to recur on
*/
by_weekday: GuildScheduledEventRecurrenceRuleWeekday[] | null;
/**
* List of specific days within a specific week (1-5) to recur on
*/
by_n_weekday: GuildScheduledEventRecurrenceRuleNWeekday[] | null;
/**
* Set of specific months to recur on
*/
by_month: GuildScheduledEventRecurrenceRuleMonth[] | null;
/**
* Set of specific dates within a month to recur on
*/
by_month_day: number[] | null;
/**
* Set of days within a year to recur on (1-364)
*/
by_year_day: number[] | null;
/**
* The total amount of times that the event is allowed to recur before stopping
*/
count: number | null;
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-frequency
*/
export enum GuildScheduledEventRecurrenceRuleFrequency {
Yearly,
Monthly,
Weekly,
Daily,
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-weekday
*/
export enum GuildScheduledEventRecurrenceRuleWeekday {
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday,
Sunday,
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-month
*/
export enum GuildScheduledEventRecurrenceRuleMonth {
January = 1,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December,
}
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-nweekday-structure
*/
export interface GuildScheduledEventRecurrenceRuleNWeekday {
/**
* The week to reoccur on.
*/
n: 1 | 2 | 3 | 4 | 5;
/**
* The day within the week to reoccur on
*/
day: GuildScheduledEventRecurrenceRuleWeekday;
}
export interface APIStageInstanceGuildScheduledEvent

View File

@@ -9,9 +9,11 @@ export * from './guild.ts';
export * from './guildScheduledEvent.ts';
export * from './interactions.ts';
export * from './invite.ts';
export * from './monetization.ts';
export * from './oauth2.ts';
export * from './poll.ts';
export * from './permissions.ts';
export * from './poll.ts';
export * from './soundboard.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './teams.ts';
@@ -19,4 +21,3 @@ export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export * from './monetization.ts';

View File

@@ -33,13 +33,13 @@ export interface APIEntitlement {
*/
deleted: boolean;
/**
* Start date at which the entitlement is valid. Not present when using test entitlements.
* Start date at which the entitlement is valid.
*/
starts_at?: string;
starts_at: string | null;
/**
* Date at which the entitlement is no longer valid. Not present when using test entitlements.
* Date at which the entitlement is no longer valid.
*/
ends_at?: string;
ends_at: string | null;
/**
* For consumable items, whether or not the entitlement has been consumed
*/
@@ -135,6 +135,9 @@ export enum SKUFlags {
UserSubscription = 1 << 8,
}
/**
* https://discord.com/developers/docs/resources/sku#sku-object-sku-types
*/
export enum SKUType {
/**
* Durable one-time purchase
@@ -153,3 +156,67 @@ export enum SKUType {
*/
SubscriptionGroup = 6,
}
/**
* https://discord.com/developers/docs/resources/subscription#subscription-object
*/
export interface APISubscription {
/**
* ID of the subscription
*/
id: Snowflake;
/**
* ID of the user who is subscribed
*/
user_id: Snowflake;
/**
* List of SKUs subscribed to
*/
sku_ids: Snowflake[];
/**
* List of entitlements granted for this subscription
*/
entitlement_ids: Snowflake[];
/**
* List of SKUs that this user will be subscribed to at renewal
*/
renewal_sku_ids: Snowflake[] | null;
/**
* Start of the current subscription period
*/
current_period_start: string;
/**
* End of the current subscription period
*/
current_period_end: string;
/**
* Current status of the subscription
*/
status: SubscriptionStatus;
/**
* When the subscription was canceled
*/
canceled_at: string | null;
/**
* ISO3166-1 alpha-2 country code of the payment source used to purchase the subscription. Missing unless queried with a private OAuth scope.
*/
country?: string;
}
/**
* https://discord.com/developers/docs/resources/subscription#subscription-statuses
*/
export enum SubscriptionStatus {
/**
* Subscription is active and scheduled to renew.
*/
Active,
/**
* Subscription is active but will not renew.
*/
Ending,
/**
* Subscription is inactive and not being charged.
*/
Inactive,
}

View File

@@ -22,10 +22,14 @@ export interface APIPoll {
expiry: string;
/**
* Whether a user can select multiple answers
*
* @default false
*/
allow_multiselect: boolean;
/**
* The layout type of the poll
*
* @default PollLayoutType.Default
*/
layout_type: PollLayoutType;
/**

View File

@@ -0,0 +1,44 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/soundboard
*/
import type { Snowflake } from '../../globals.ts';
import type { APIUser } from './user.ts';
/**
* https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object
*/
export interface APISoundboardSound {
/**
* The name of this sound
*/
name: string;
/**
* The id of this sound
*/
sound_id: Snowflake;
/**
* The volume of this sound, from 0 to 1
*/
volume: number;
/**
* The id of this sound's custom emoji
*/
emoji_id: Snowflake | null;
/**
* The unicode character of this sound's standard emoji
*/
emoji_name: string | null;
/**
* The id of the guild that this sound is in
*/
guild_id?: Snowflake;
/**
* Whether this sound can be used (for guild sounds), may be false due to loss of Server Boosts
*/
available: boolean;
/**
* The user who created this sound
*/
user?: APIUser;
}

View File

@@ -33,6 +33,7 @@ export interface APISticker {
* Previously the sticker asset hash, now an empty string
*
* @deprecated
* @unstable This field is no longer documented by Discord and will be removed in v11
*/
asset?: '';
/**

View File

@@ -3,6 +3,7 @@
*/
import type { Snowflake } from '../../globals.ts';
import type { Locale } from '../../rest/common.ts';
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v9/mod.ts';
import type { APIUser } from './user.ts';
@@ -60,6 +61,6 @@ export interface APITemplate {
export interface APITemplateSerializedSourceGuild extends Omit<RESTPostAPIGuildsJSONBody, 'icon'> {
description: string | null;
preferred_locale: string;
preferred_locale: Locale;
icon_hash: string | null;
}

View File

@@ -273,8 +273,11 @@ export interface APIConnection {
}
export enum ConnectionService {
AmazonMusic = 'amazon-music',
BattleNet = 'battlenet',
Bluesky = 'bluesky',
BungieNet = 'bungie',
Crunchyroll = 'crunchyroll',
Domain = 'domain',
eBay = 'ebay',
EpicGames = 'epicgames',
@@ -282,10 +285,12 @@ export enum ConnectionService {
GitHub = 'github',
Instagram = 'instagram',
LeagueOfLegends = 'leagueoflegends',
Mastodon = 'mastodon',
PayPal = 'paypal',
PlayStationNetwork = 'playstation',
Reddit = 'reddit',
RiotGames = 'riotgames',
PayPal = 'paypal',
Roblox = 'roblox',
Spotify = 'spotify',
Skype = 'skype',
Steam = 'steam',

View File

@@ -7,8 +7,15 @@ import type { APIGuildMember } from './guild.ts';
/**
* https://discord.com/developers/docs/resources/voice#voice-state-object
*
* @deprecated This is deprecated, use {@apilink APIVoiceState}
*/
export interface GatewayVoiceState {
export type GatewayVoiceState = APIVoiceState;
/**
* https://discord.com/developers/docs/resources/voice#voice-state-object
*/
export interface APIVoiceState {
/**
* The guild id this voice state is for
*/

View File

@@ -3,7 +3,15 @@
*/
import type { Snowflake } from '../../globals.ts';
import type { APIPartialChannel, APIPartialGuild, APIUser } from './mod.ts';
import type {
APIEntitlement,
APIGuild,
APIPartialChannel,
APIPartialGuild,
APIUser,
ApplicationIntegrationType,
OAuth2Scopes,
} from './mod.ts';
/**
* https://discord.com/developers/docs/resources/webhook#webhook-object
@@ -63,6 +71,116 @@ export interface APIWebhook {
url?: string;
}
/**
* https://discord.com/developers/docs/events/webhook-events#webhook-event-payloads
*/
export type APIWebhookEvent =
| APIWebhookEventBase<ApplicationWebhookType.Event, APIWebhookEventBody>
| APIWebhookEventBase<ApplicationWebhookType.Ping, never>;
/**
* https://discord.com/developers/docs/events/webhook-events#event-body-object
*/
export type APIWebhookEventBody =
| APIWebhookEventEventBase<
ApplicationWebhookEventType.ApplicationAuthorized,
APIWebhookEventApplicationAuthorizedData
>
| APIWebhookEventEventBase<ApplicationWebhookEventType.EntitlementCreate, APIWebhookEventEntitlementCreateData>
| APIWebhookEventEventBase<ApplicationWebhookEventType.QuestUserEnrollment, APIWebhookEventQuestUserEnrollmentData>;
export interface APIWebhookEventApplicationAuthorizedData {
/**
* Installation context for the authorization. Either guild (`0`) if installed to a server or user (`1`) if installed to a user's account
*/
integration_type?: ApplicationIntegrationType;
/**
* User who authorized the app
*/
user: APIUser;
/**
* List of scopes the user authorized
*/
scopes: OAuth2Scopes[];
/**
* Server which app was authorized for (when integration type is `0`)
*/
guild?: APIGuild;
}
export type APIWebhookEventEntitlementCreateData = APIEntitlement;
export type APIWebhookEventQuestUserEnrollmentData = never;
interface APIWebhookEventBase<Type extends ApplicationWebhookType, Event> {
/**
* Version scheme for the webhook event. Currently always `1`
*/
version: 1;
/**
* ID of your app
*/
application_id: Snowflake;
/**
* Type of webhook
*/
type: Type;
/**
* Event data payload
*/
event: Event;
}
/**
* https://discord.com/developers/docs/events/webhook-events#webhook-types
*/
export enum ApplicationWebhookType {
/**
* PING event sent to verify your Webhook Event URL is active
*/
Ping,
/**
* Webhook event (details for event in event body object)
*/
Event,
}
interface APIWebhookEventEventBase<Type extends ApplicationWebhookEventType, Data> {
/**
* Event type
*/
type: Type;
/**
* Timestamp of when the event occurred in ISO8601 format
*/
timestamp: string;
/**
* Data for the event. The shape depends on the event type
*/
data: Data;
}
/**
* https://discord.com/developers/docs/events/webhook-events#event-types
*/
export enum ApplicationWebhookEventType {
/**
* Sent when an app was authorized by a user to a server or their account
*/
ApplicationAuthorized = 'APPLICATION_AUTHORIZED',
/**
* Entitlement was created
*/
EntitlementCreate = 'ENTITLEMENT_CREATE',
/**
* User was added to a Quest (currently unavailable)
*/
QuestUserEnrollment = 'QUEST_USER_ENROLLMENT',
}
/**
* https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types
*/
export enum WebhookType {
/**
* Incoming Webhooks can post messages to channels with a generated token

View File

@@ -22,6 +22,7 @@ export enum RESTJSONErrorCodes {
UnknownWebhookService,
UnknownSession = 10_020,
UnknownAsset,
UnknownBan = 10_026,
UnknownSKU,
@@ -43,8 +44,8 @@ export enum RESTJSONErrorCodes {
UnknownDiscoverableServerCategory = 10_059,
UnknownSticker,
UnknownInteraction = 10_062,
UnknownStickerPack,
UnknownInteraction,
UnknownApplicationCommand,
UnknownVoiceState = 10_065,
@@ -57,6 +58,8 @@ export enum RESTJSONErrorCodes {
UnknownTag = 10_087,
UnknownSound = 10_097,
BotsCannotUseThisEndpoint = 20_001,
OnlyBotsCanUseThisEndpoint,
@@ -115,7 +118,8 @@ export enum RESTJSONErrorCodes {
MaximumNumberOfGuildWidgetSettingsUpdatesHasBeenReached = 30_042,
MaximumNumberOfEditsToMessagesOlderThanOneHourReached = 30_046,
MaximumNumberOfSoundboardSoundsReached = 30_045,
MaximumNumberOfEditsToMessagesOlderThanOneHourReached,
MaximumNumberOfPinnedThreadsInForumHasBeenReached,
MaximumNumberOfTagsInForumHasBeenReached,
@@ -138,6 +142,9 @@ export enum RESTJSONErrorCodes {
ConnectionHasBeenRevoked = 40_012,
OnlyConsumableSKUsCanBeConsumed = 40_018,
YouCanOnlyDeleteSandboxEntitlements,
TargetUserIsNotConnectedToVoice = 40_032,
ThisMessageWasAlreadyCrossposted,
@@ -156,6 +163,8 @@ export enum RESTJSONErrorCodes {
AnEntitlementHasAlreadyBeenGrantedForThisResource = 40_074,
ThisInteractionHasHitTheMaximumNumberOfFollowUpMessages = 40_094,
CloudflareIsBlockingYourRequest = 40_333,
MissingAccess = 50_001,
@@ -229,6 +238,10 @@ export enum RESTJSONErrorCodes {
ServerNeedsMoreBoostsToPerformThisAction = 50_101,
RequestBodyContainsInvalidJSON = 50_109,
ProvidedFileIsInvalid,
ProvidedFileTypeIsInvalid = 50_123,
ProvidedFileDurationExceedsMaximumLength,
OwnerCannotBePendingMember = 50_131,
OwnershipCannotBeMovedToABotUser,
@@ -239,6 +252,8 @@ export enum RESTJSONErrorCodes {
CannotConvertBetweenPremiumEmojiAndNormalEmoji,
UploadedFileNotFound,
SpecifiedEmojiIsInvalid = 50_151,
VoiceMessagesDoNotSupportAdditionalContent = 50_159,
VoiceMessagesMustHaveASingleAudioAttachment,
VoiceMessagesMustHaveSupportingMetadata,
@@ -249,6 +264,8 @@ export enum RESTJSONErrorCodes {
TheUserAccountMustFirstBeVerified = 50_178,
ProvidedFileDoesNotHaveAValidDuration = 50_192,
YouDoNotHavePermissionToSendThisSticker = 50_600,
TwoFactorAuthenticationIsRequired = 60_003,
@@ -345,4 +362,7 @@ export enum Locale {
Vietnamese = 'vi',
}
/**
* @deprecated Use {@apilink Locale} instead.
*/
export type LocaleString = `${Locale}`;

View File

@@ -24,14 +24,20 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
import type { RESTAPIPollCreate } from './poll.ts';
import type { RESTAPIPoll } from './poll.ts';
export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
id: Snowflake;
}
/**
* @deprecated Use {@link RESTAPIChannelPatchOverwrite} instead
*/
export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite;
/**
* https://discord.com/developers/docs/resources/channel#get-channel
*/
@@ -98,7 +104,7 @@ export interface RESTPatchAPIChannelJSONBody {
*
* Channel types: all excluding newsThread, publicThread, privateThread
*/
permission_overwrites?: APIChannelPatchOverwrite[] | null | undefined;
permission_overwrites?: RESTAPIChannelPatchOverwrite[] | null | undefined;
/**
* ID of the new parent category for a channel
*
@@ -237,7 +243,7 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
/**
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Required<Pick<APIMessageReference, 'message_id'>>
> &
StrictPartial<APIMessageReference> & {
@@ -250,22 +256,21 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO
};
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* @deprecated Use {@link RESTAPIMessageReference} instead
*/
export interface RESTAPIAttachment {
export type APIMessageReferenceSend = RESTAPIMessageReference;
/**
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export type RESTAPIAttachment = Partial<
Pick<APIAttachment, 'description' | 'duration_secs' | 'filename' | 'title' | 'waveform'>
> & {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
};
/**
* https://discord.com/developers/docs/resources/channel#create-message
@@ -296,11 +301,11 @@ export interface RESTPostAPIChannelMessageJSONBody {
*/
allowed_mentions?: APIAllowedMentions | undefined;
/**
* Include to make your message a reply
* Include to make your message a reply or a forward
*
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
message_reference?: APIMessageReferenceSend | undefined;
message_reference?: RESTAPIMessageReference | undefined;
/**
* The components to include with the message
*
@@ -329,7 +334,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
/**
* A poll!
*/
poll?: RESTAPIPollCreate | undefined;
poll?: RESTAPIPoll | undefined;
}
/**
@@ -362,7 +367,12 @@ export type RESTPutAPIChannelMessageReactionResult = never;
/**
* https://discord.com/developers/docs/resources/channel#delete-own-reaction
*/
export type RESTDeleteAPIChannelMessageOwnReaction = never;
export type RESTDeleteAPIChannelMessageOwnReactionResult = never;
/**
* @deprecated Use {@link RESTDeleteAPIChannelMessageOwnReactionResult} instead
*/
export type RESTDeleteAPIChannelMessageOwnReaction = RESTDeleteAPIChannelMessageOwnReactionResult;
/**
* https://discord.com/developers/docs/resources/channel#delete-user-reaction
@@ -446,7 +456,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* 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
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
/**

View File

@@ -59,3 +59,40 @@ export type RESTPatchAPIGuildEmojiResult = APIEmoji;
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
*/
export type RESTDeleteAPIGuildEmojiResult = never;
/**
* https://discord.com/developers/docs/resources/emoji#list-application-emojis
*/
export interface RESTGetAPIApplicationEmojisResult {
items: APIEmoji[];
}
/**
* https://discord.com/developers/docs/resources/emoji#get-application-emoji
*/
export type RESTGetAPIApplicationEmojiResult = APIEmoji;
/**
* https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params
*/
export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSONBody, 'image' | 'name'>;
/**
* https://discord.com/developers/docs/resources/emoji#create-application-emoji
*/
export type RESTPostAPIApplicationEmojiResult = APIEmoji;
/**
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
*/
export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJSONBody, 'name'>;
/**
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
*/
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;
/**
* https://discord.com/developers/docs/resources/emoji#delete-application-emoji
*/
export type RESTDeleteAPIApplicationEmojiResult = never;

View File

@@ -35,16 +35,28 @@ import type {
StrictPartial,
StrictRequired,
} from '../../utils/internals.ts';
import type { Locale } from '../common.ts';
import type { RESTPutAPIChannelPermissionJSONBody } from './channel.ts';
export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
id: number | string;
}
export type APIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
export type APIGuildCreatePartialChannel = StrictPartial<
/**
* @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead
*/
export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite;
export type RESTAPIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
/**
* @deprecated Use {@link RESTAPIGuildChannelResolvable} instead
*/
export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable;
export type RESTAPIGuildCreatePartialChannel = StrictPartial<
DistributivePick<
APIGuildChannelResolvable,
RESTAPIGuildChannelResolvable,
| 'available_tags'
| 'bitrate'
| 'default_auto_archive_duration'
@@ -66,13 +78,23 @@ export type APIGuildCreatePartialChannel = StrictPartial<
name: string;
id?: number | string | undefined;
parent_id?: number | string | null | undefined;
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined;
};
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
/**
* @deprecated Use {@link RESTAPIGuildCreatePartialChannel} instead
*/
export type APIGuildCreatePartialChannel = RESTAPIGuildCreatePartialChannel;
export interface RESTAPIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
id: number | string;
}
/**
* @deprecated Use {@link RESTAPIGuildCreateRole} instead
*/
export type APIGuildCreateRole = RESTAPIGuildCreateRole;
/**
* https://discord.com/developers/docs/resources/guild#create-guild
*/
@@ -124,7 +146,7 @@ export interface RESTPostAPIGuildsJSONBody {
*
* See https://discord.com/developers/docs/topics/permissions#role-object
*/
roles?: APIGuildCreateRole[] | undefined;
roles?: RESTAPIGuildCreateRole[] | undefined;
/**
* New guild's channels
*
@@ -138,7 +160,7 @@ export interface RESTPostAPIGuildsJSONBody {
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
channels?: APIGuildCreatePartialChannel[] | undefined;
channels?: RESTAPIGuildCreatePartialChannel[] | undefined;
/**
* ID for afk channel
*/
@@ -294,7 +316,7 @@ export interface RESTPatchAPIGuildJSONBody {
*
* @default "en-US" (if the value is set to `null`)
*/
preferred_locale?: string | null | undefined;
preferred_locale?: Locale | null | undefined;
/**
* Enabled guild features
*
@@ -333,7 +355,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[];
/**
* https://discord.com/developers/docs/resources/guild#create-guild-channel
*/
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<APIGuildCreatePartialChannel, 'id'>;
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<RESTAPIGuildCreatePartialChannel, 'id'>;
/**
* https://discord.com/developers/docs/resources/guild#create-guild-channel
@@ -739,6 +761,11 @@ export interface RESTPatchAPIGuildRoleJSONBody {
mentionable?: boolean | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-role
*/
export type RESTGetAPIGuildRoleResult = APIRole;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-role
*/
@@ -891,48 +918,6 @@ export interface RESTPatchAPIGuildMemberVerificationJSONBody {
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
*/
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id?: Snowflake | undefined;
/**
* Toggles the user's suppress state
*/
suppress?: boolean | undefined;
/**
* Sets the user's request to speak
*/
request_to_speak_timestamp?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
/**
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
*/
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
/**
* Toggles the user's suppress state
*/
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
*/
@@ -967,20 +952,25 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP
/**
* Prompts shown during onboarding and in customize community
*/
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
};
export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
export type RESTAPIGuildOnboardingPrompt = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
> &
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
/**
* Options available within the prompt
*/
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
options: RESTAPIGuildOnboardingPromptOption[];
};
export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
/**
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
*/
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
export type RESTAPIGuildOnboardingPromptOption = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
> &
Pick<APIGuildOnboardingPromptOption, 'title'> & {
@@ -998,6 +988,11 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossibl
emoji_animated?: boolean | null | undefined;
};
/**
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.
*/
export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardingPromptOption;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
*/

View File

@@ -1,8 +1,9 @@
import type { Snowflake } from '../../globals.ts';
import type { StrictPartial } from '../../utils/internals.ts';
import type { Nullable, StrictPartial } from '../../utils/internals.ts';
import type {
APIGuildScheduledEvent,
APIGuildScheduledEventEntityMetadata,
APIGuildScheduledEventRecurrenceRule,
APIGuildScheduledEventUser,
GuildScheduledEventEntityType,
GuildScheduledEventPrivacyLevel,
@@ -64,6 +65,10 @@ export interface RESTPostAPIGuildScheduledEventJSONBody {
* The cover image of the scheduled event
*/
image?: string | null | undefined;
/**
* The definition for how often this event should recur
*/
recurrence_rule?: APIGuildScheduledEventRecurrenceRule | undefined;
}
/**
@@ -89,20 +94,17 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
*/
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;
};
export type RESTPatchAPIGuildScheduledEventJSONBody = Nullable<
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
> &
StrictPartial<
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
> & {
/**
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus | undefined;
};
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event

View File

@@ -1,3 +1,4 @@
import type { Snowflake } from '../../globals.ts';
import type {
APIApplicationCommand,
APIApplicationCommandPermission,
@@ -5,6 +6,9 @@ import type {
APIInteractionResponse,
APIInteractionResponseCallbackData,
ApplicationCommandType,
InteractionResponseType,
APIMessage,
InteractionType,
} from '../../payloads/v10/mod.ts';
import type {
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
@@ -79,12 +83,21 @@ export interface RESTPostAPIContextMenuApplicationCommandsJSONBody extends RESTP
type: ApplicationCommandType.Message | ApplicationCommandType.User;
}
/**
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
*/
export interface RESTPostAPIPrimaryEntryPointApplicationCommandJSONBody
extends RESTPostAPIBaseApplicationCommandsJSONBody {
type: ApplicationCommandType.PrimaryEntryPoint;
}
/**
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
*/
export type RESTPostAPIApplicationCommandsJSONBody =
| RESTPostAPIChatInputApplicationCommandsJSONBody
| RESTPostAPIContextMenuApplicationCommandsJSONBody;
| RESTPostAPIContextMenuApplicationCommandsJSONBody
| RESTPostAPIPrimaryEntryPointApplicationCommandJSONBody;
/**
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
@@ -171,6 +184,16 @@ export type RESTPutAPIApplicationGuildCommandsResult = Omit<APIApplicationComman
*/
export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
*/
export interface RESTPostAPIInteractionCallbackQuery {
/**
* Whether to include a interaction callback response as the response instead of a 204
*/
with_response?: boolean;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
*/
@@ -183,6 +206,90 @@ export type RESTPostAPIInteractionCallbackFormDataBody =
})
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionCallbackJSONBody);
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
*/
export type RESTPostAPIInteractionCallbackResult = never;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-response-object
*/
export interface RESTPostAPIInteractionCallbackWithResponseResult {
/**
* The interaction object associated with the interaction
*/
interaction: RESTAPIInteractionCallbackObject;
/**
* The resource that was created by the interaction response
*/
resource?: RESTAPIInteractionCallbackResourceObject;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-object
*/
export interface RESTAPIInteractionCallbackObject {
/**
* ID of the interaction
*/
id: Snowflake;
/**
* Interaction type
*/
type: InteractionType;
/**
* Instance ID of the Activity if one was launched or joined
*/
activity_instance_id?: string;
/**
* ID of the message that was created by the interaction
*/
response_message_id?: Snowflake;
/**
* Whether or not the message is in a loading state
*/
response_message_loading?: boolean;
/**
* Whether or not the response message was ephemeral
*/
response_message_ephemeral?: boolean;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-resource-object
*/
export interface RESTAPIInteractionCallbackResourceObject {
/**
* Interaction callback type
*/
type: InteractionResponseType;
/**
* Represents the Activity launched by this interaction
*
* @remarks
* Only present if `type` is {@link InteractionResponseType.LaunchActivity}
*/
activity_instance?: RESTAPIInteractionCallbackActivityInstanceResource;
/**
* Message created by the interaction
*
* @remarks
* Only present if `type` is {@link InteractionResponseType.ChannelMessageWithSource}
* or {@link InteractionResponseType.UpdateMessage}
*/
message?: APIMessage;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-activity-instance-resource
*/
export interface RESTAPIInteractionCallbackActivityInstanceResource {
/**
* Instance ID of the Activity if one was launched or joined.
*/
id: string;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response
*/

View File

@@ -1,4 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import { urlSafeCharacters } from '../../utils/internals.ts';
export * from '../common.ts';
export * from './application.ts';
@@ -11,15 +12,16 @@ export * from './guild.ts';
export * from './guildScheduledEvent.ts';
export * from './interactions.ts';
export * from './invite.ts';
export * from './monetization.ts';
export * from './oauth2.ts';
export * from './poll.ts';
export * from './soundboard.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export * from './monetization.ts';
export const APIVersion = '10';
@@ -32,6 +34,7 @@ export const Routes = {
applicationRoleConnectionMetadata(applicationId: Snowflake) {
return `/applications/${applicationId}/role-connections/metadata` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/auto-moderation/rules`
@@ -344,6 +347,7 @@ export const Routes = {
/**
* Route for:
* - GET `/guilds/{guild.id}/roles/{role.id}`
* - PATCH `/guilds/{guild.id}/roles/{role.id}`
* - DELETE `/guilds/{guild.id}/roles/{role.id}`
*/
@@ -786,6 +790,8 @@ export const Routes = {
/**
* Route for:
* - GET `/guilds/{guild.id}/voice-states/@me`
* - GET `/guilds/{guild.id}/voice-states/{user.id}`
* - PATCH `/guilds/{guild.id}/voice-states/@me`
* - PATCH `/guilds/{guild.id}/voice-states/{user.id}`
*/
@@ -854,6 +860,14 @@ export const Routes = {
return '/sticker-packs' as const;
},
/**
* Route for:
* - GET `/sticker-packs/{pack.id}`
*/
stickerPack(packId: Snowflake) {
return `/sticker-packs/${packId}` as const;
},
/**
* Route for:
* - GET `/sticker-packs`
@@ -912,8 +926,8 @@ export const Routes = {
/**
* Route for:
* - GET `/guilds/${guild.id}/onboarding`
* - PUT `/guilds/${guild.id}/onboarding`
* - GET `/guilds/{guild.id}/onboarding`
* - PUT `/guilds/{guild.id}/onboarding`
*/
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
@@ -939,6 +953,7 @@ export const Routes = {
/**
* Route for:
* - GET `/applications/{application.id}/entitlements/{entitlement.id}`
* - DELETE `/applications/{application.id}/entitlements/{entitlement.id}`
*/
entitlement(applicationId: Snowflake, entitlementId: Snowflake) {
@@ -963,13 +978,105 @@ export const Routes = {
/**
* Route for:
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
* - POST `/applications/{application.id}/entitlements/{entitlement.id}/consume`
*/
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/emojis`
* - POST `/applications/{application.id}/emojis`
*/
applicationEmojis(applicationId: Snowflake) {
return `/applications/${applicationId}/emojis` as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/emojis/{emoji.id}`
* - PATCH `/applications/{application.id}/emojis/{emoji.id}`
* - DELETE `/applications/{application.id}/emojis/{emoji.id}`
*/
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
return `/applications/${applicationId}/emojis/${emojiId}` as const;
},
/**
* Route for:
* - GET `/skus/{sku.id}/subscriptions`
*/
skuSubscriptions(skuId: Snowflake) {
return `/skus/${skuId}/subscriptions` as const;
},
/**
* Route for:
* - GET `/skus/{sku.id}/subscriptions/{subscription.id}`
*/
skuSubscription(skuId: Snowflake, subscriptionId: Snowflake) {
return `/skus/${skuId}/subscriptions/${subscriptionId}` as const;
},
/**
* Route for:
* - POST `/channels/{channel.id}/send-soundboard-sound`
*/
sendSoundboardSound(channelId: Snowflake) {
return `/channels/${channelId}/send-soundboard-sound` as const;
},
/**
* Route for:
* - GET `/soundboard-default-sounds`
*/
soundboardDefaultSounds() {
return '/soundboard-default-sounds' as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/soundboard-sounds`
* - POST `/guilds/{guild.id}/soundboard-sounds`
*/
guildSoundboardSounds(guildId: Snowflake) {
return `/guilds/${guildId}/soundboard-sounds` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
* - PATCH `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
* - DELETE `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
*/
guildSoundboardSound(guildId: Snowflake, soundId: Snowflake) {
return `/guilds/${guildId}/soundboard-sounds/${soundId}` as const;
},
};
for (const [key, fn] of Object.entries(Routes)) {
Routes[key as keyof typeof Routes] = (...args: (boolean | number | string | undefined)[]) => {
const escaped = args.map((arg) => {
if (arg) {
// Skip already "safe" urls
if (urlSafeCharacters.test(String(arg))) {
return arg;
}
return encodeURIComponent(arg);
}
return arg;
});
// eslint-disable-next-line no-useless-call
return fn.call(null, ...escaped);
};
}
// Freeze the object so it can't be changed
Object.freeze(Routes);
export const StickerPackApplicationId = '710982414301790216';
export enum ImageFormat {
@@ -995,14 +1102,14 @@ export const CDNRoutes = {
/**
* Route for:
* - GET `/guilds/{guild.id}/icons/{guild.id}.{png|jpeg|webp|gif}`
* - GET `/icons/{guild.id}/{guild.icon}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
guildIcon<Format extends GuildIconFormat>(guildId: Snowflake, guildIcon: string, format: Format) {
return `icons/${guildId}/${guildIcon}.${format}` as const;
return `/icons/${guildId}/${guildIcon}.${format}` as const;
},
/**
@@ -1081,7 +1188,7 @@ export const CDNRoutes = {
/**
* Route for:
* - GET `/guilds/{guild.id}/users/{user.id}/{guild_member.avatar}.{png|jpeg|webp|gif}`
* - GET `/guilds/{guild.id}/users/{user.id}/avatars/{guild_member.avatar}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
@@ -1201,7 +1308,7 @@ export const CDNRoutes = {
/**
* Route for:
* - GET `team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
* - GET `/team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
@@ -1257,8 +1364,38 @@ export const CDNRoutes = {
) {
return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const;
},
/**
* Route for:
* - GET `/soundboard-sounds/${sound.id}`
*/
soundboardSound(soundId: Snowflake) {
return `/soundboard-sounds/${soundId}` as const;
},
};
for (const [key, fn] of Object.entries(CDNRoutes)) {
CDNRoutes[key as keyof typeof CDNRoutes] = (...args: (boolean | number | string | undefined)[]) => {
const escaped = args.map((arg) => {
if (arg) {
// Skip already "safe" urls
if (urlSafeCharacters.test(String(arg))) {
return arg;
}
return encodeURIComponent(arg);
}
return arg;
});
// eslint-disable-next-line no-useless-call
return fn.call(null, ...escaped);
};
}
// Freeze the object so it can't be changed
Object.freeze(CDNRoutes);
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;
export type EmojiFormat = Exclude<ImageFormat, ImageFormat.Lottie>;

View File

@@ -1,8 +1,8 @@
import type { Snowflake } from '../../globals.ts';
import type { APIEntitlement, APISKU } from '../../v10.ts';
import type { APIEntitlement, APISKU, APISubscription } from '../../v10.ts';
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
* https://discord.com/developers/docs/resources/entitlement#list-entitlements
*/
export interface RESTGetAPIEntitlementsQuery {
/**
@@ -33,20 +33,29 @@ export interface RESTGetAPIEntitlementsQuery {
*/
guild_id?: Snowflake | undefined;
/**
* Whether ended entitlements should be omitted
* Whether ended entitlements should be omitted. Defaults to `false`, ended entitlements are included by default
*/
exclude_ended?: boolean | undefined;
/**
* Whether deleted entitlements should be omitted. Defaults to `true`, deleted entitlements are not included by default
*/
exclude_deleted?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
* https://discord.com/developers/docs/resources/entitlement#list-entitlements
*/
export type RESTGetAPIEntitlementsResult = APIEntitlement[];
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
* https://discord.com/developers/docs/resources/entitlement#get-entitlement
*/
export interface RESTPostAPIEntitlementBody {
export type RESTGetAPIEntitlementResult = APIEntitlement;
/**
* https://discord.com/developers/docs/resources/entitlement#create-test-entitlement
*/
export interface RESTPostAPIEntitlementJSONBody {
/**
* ID of the SKU to grant the entitlement to
*/
@@ -62,12 +71,17 @@ export interface RESTPostAPIEntitlementBody {
}
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
* @deprecated Use {@link RESTPostAPIEntitlementJSONBody} instead
*/
export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody;
/**
* https://discord.com/developers/docs/resources/entitlement#create-test-entitlement
*/
export type RESTPostAPIEntitlementResult = Partial<Omit<APIEntitlement, 'ends_at' | 'starts_at'>>;
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
* https://discord.com/developers/docs/resources/entitlement#create-test-entitlement
*/
export enum EntitlementOwnerType {
Guild = 1,
@@ -75,16 +89,50 @@ export enum EntitlementOwnerType {
}
/**
* https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement
* https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement
*/
export type RESTDeleteAPIEntitlementResult = never;
/**
* https://discord.com/developers/docs/monetization/skus#list-skus
* https://discord.com/developers/docs/resources/sku#list-skus
*/
export type RESTGetAPISKUsResult = APISKU[];
/**
* https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement
* https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement
*/
export type RESTPostAPIEntitlementConsumeResult = never;
/**
* https://discord.com/developers/docs/resources/subscription#query-string-params
*/
export interface RESTGetAPISKUSubscriptionsQuery {
/**
* List subscriptions before this ID
*/
before?: Snowflake | undefined;
/**
* List subscriptions after this ID
*/
after?: Snowflake | undefined;
/**
* Number of subscriptions to return (1-100)
*
* @default 50
*/
limit?: number | undefined;
/**
* User ID for which to return subscriptions. Required except for OAuth queries.
*/
user_id?: Snowflake | undefined;
}
/**
* https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions
*/
export type RESTGetAPISKUSubscriptionsResult = APISubscription[];
/**
* https://discord.com/developers/docs/resources/subscription#get-sku-subscription
*/
export type RESTGetAPISKUSubscriptionResult = APISubscription;

View File

@@ -40,14 +40,27 @@ export interface RESTOAuth2AuthorizationQuery {
prompt?: 'consent' | 'none';
}
/**
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-token-revocation-example
*/
export interface RESTPostOAuth2TokenRevocationQuery {
token: string;
token_type_hint?: 'access_token' | 'refresh_token';
}
/**
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
*/
export interface RESTOAuth2AuthorizationQueryResult {
export interface RESTPostOAuth2AuthorizationQueryResult {
code: string;
state?: string;
}
/**
* @deprecated Use {@link RESTPostOAuth2AuthorizationQueryResult} instead
*/
export type RESTOAuth2AuthorizationQueryResult = RESTPostOAuth2AuthorizationQueryResult;
/**
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
*/
@@ -121,10 +134,10 @@ export interface RESTOAuth2BotAuthorizationQuery {
* Needs to include bot for the bot flow
*/
scope:
| OAuth2Scopes.Bot
| `${OAuth2Scopes.Bot}${' ' | '%20'}${string}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`;
| `${OAuth2Scopes.Bot} ${string}`
| `${OAuth2Scopes.Bot}`
| `${string} ${OAuth2Scopes.Bot} ${string}`
| `${string} ${OAuth2Scopes.Bot}`;
/**
* The permissions you're requesting
*
@@ -150,10 +163,10 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery {
* This assumes you include the `bot` scope alongside others (like `identify` for example)
*/
scope:
| OAuth2Scopes.Bot
| `${OAuth2Scopes.Bot}${' ' | '%20'}${string}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`;
| `${OAuth2Scopes.Bot} ${string}`
| `${OAuth2Scopes.Bot}`
| `${string} ${OAuth2Scopes.Bot} ${string}`
| `${string} ${OAuth2Scopes.Bot}`;
/**
* The required permissions bitfield, stringified
*/

View File

@@ -20,17 +20,26 @@ export interface RESTGetAPIPollAnswerVotersQuery {
/**
* https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure
*/
export interface RESTAPIPollCreate extends Omit<APIPoll, 'answers' | 'expiry' | 'results'> {
/**
* Number of hours the poll should be open for, up to 7 days
*/
duration: number;
export interface RESTAPIPoll
extends Omit<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
/**
* Each of the answers available in the poll, up to 10
*/
answers: Omit<APIPollAnswer, 'answer_id'>[];
/**
* Number of hours the poll should be open for, up to 32 days
*
* @default 24
*/
duration?: number;
}
/**
* @deprecated Use {@link RESTAPIPoll} instead
*/
export type RESTAPIPollCreate = RESTAPIPoll;
/**
* https://discord.com/developers/docs/resources/poll#get-answer-voters
*/

107
deno/rest/v10/soundboard.ts Normal file
View File

@@ -0,0 +1,107 @@
import type { Snowflake } from '../../globals.ts';
import type { APISoundboardSound } from '../../payloads/v10/mod.ts';
/**
* https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound
*/
export type RESTPostAPISendSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound-json-params
*/
export interface RESTPostAPISoundboardSendSoundJSONBody {
/**
* The id of the soundboard sound to play
*/
sound_id: Snowflake;
/**
* The id of the guild the soundboard sound is from, required to play sounds from different servers
*/
source_guild_id?: Snowflake | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#list-soundboard-default-sounds
*/
export type RESTGetAPISoundboardDefaultSoundsResult = APISoundboardSound[];
/**
* https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds
*/
export interface RESTGetAPIGuildSoundboardSoundsResult {
items: APISoundboardSound[];
}
/**
* https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound
*/
export type RESTGetAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound-json-params
*/
export interface RESTPostAPIGuildSoundboardSoundJSONBody {
/**
* The name of the soundboard sound (2-32 characters)
*/
name: string;
/**
* The data uri of the mp3 or ogg sound data, base64 encoded, similar to image data
*
* See https://discord.com/developers/docs/reference#image-data
*/
sound: string;
/**
* The volume of the soundboard sound, from 0 to 1
*
* @default 1
*/
volume?: number | null | undefined;
/**
* The id of the custom emoji for the soundboard sound
*/
emoji_id?: Snowflake | null | undefined;
/**
* The unicode character of a standard emoji for the soundboard sound
*/
emoji_name?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound
*/
export type RESTPostAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound-json-params
*/
export interface RESTPatchAPIGuildSoundboardSoundJSONBody {
/**
* The name of the soundboard sound (2-32 characters)
*/
name?: string | undefined;
/**
* The volume of the soundboard sound, from 0 to 1
*
* @default 1
*/
volume?: number | null | undefined;
/**
* The id of the custom emoji for the soundboard sound
*/
emoji_id?: Snowflake | null | undefined;
/**
* The unicode character of a standard emoji for the soundboard sound
*/
emoji_name?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound
*/
export type RESTPatchAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound
*/
export type RESTDeleteAPIGuildSoundboardSoundResult = never;

View File

@@ -12,6 +12,16 @@ export interface RESTGetStickerPacksResult {
sticker_packs: APIStickerPack[];
}
/**
* https://discord.com/developers/docs/resources/sticker#get-sticker-pack
*/
export type RESTGetAPIStickerPackResult = APIStickerPack;
/**
* @deprecated Use {@link RESTGetAPIStickerPackResult} instead
*/
export type RESTGetAPIStickerPack = RESTGetAPIStickerPackResult;
/**
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
*

View File

@@ -76,6 +76,7 @@ export interface RESTAPIPartialCurrentUserGuild {
id: Snowflake;
name: string;
icon: string | null;
banner: string | null;
owner: boolean;
features: GuildFeature[];
permissions: Permissions;

View File

@@ -1,4 +1,5 @@
import type { APIVoiceRegion } from '../../payloads/v10/mod.ts';
import type { Snowflake } from '../../globals.ts';
import type { APIVoiceRegion, APIVoiceState } from '../../payloads/v10/mod.ts';
/**
* https://discord.com/developers/docs/resources/voice#list-voice-regions
@@ -9,3 +10,55 @@ export type RESTGetAPIVoiceRegionsResult = APIVoiceRegion[];
* @deprecated This was exported with the wrong name, use `RESTGetAPIVoiceRegionsResult` instead
*/
export type GetAPIVoiceRegionsResult = RESTGetAPIVoiceRegionsResult;
/**
* https://discord.com/developers/docs/resources/voice#get-current-user-voice-state
*/
export type RESTGetAPIGuildVoiceStateCurrentMemberResult = APIVoiceState;
/**
* https://discord.com/developers/docs/resources/voice#get-user-voice-state
*/
export type RESTGetAPIGuildVoiceStateUserResult = APIVoiceState;
/**
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
*/
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id?: Snowflake | undefined;
/**
* Toggles the user's suppress state
*/
suppress?: boolean | undefined;
/**
* Sets the user's request to speak
*/
request_to_speak_timestamp?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
/**
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
*/
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
/**
* Toggles the user's suppress state
*/
suppress?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateUserResult = never;

View File

@@ -10,7 +10,7 @@ import type {
} from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals.ts';
import type { RESTAPIAttachment } from './channel.ts';
import type { RESTAPIPollCreate } from './poll.ts';
import type { RESTAPIPoll } from './poll.ts';
/**
* https://discord.com/developers/docs/resources/webhook#create-webhook
*/
@@ -158,7 +158,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
/**
* A poll!
*/
poll?: RESTAPIPollCreate | undefined;
poll?: RESTAPIPoll | undefined;
}
/**
@@ -264,9 +264,16 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* 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
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
/**
* A poll!
*
* @remarks
* Polls can only be added when editing a deferred interaction response.
*/
poll?: RESTAPIPoll | undefined;
};
/**

View File

@@ -1,3 +1,5 @@
import { urlSafeCharacters } from '../../utils/internals.ts';
export * from '../common.ts';
export * from './auditLog.ts';
@@ -519,3 +521,25 @@ export const Routes = {
return `/oauth2/applications/@me`;
},
};
for (const [key, fn] of Object.entries(Routes)) {
Routes[key] = (...args: (boolean | number | string | undefined)[]) => {
const escaped = args.map((arg) => {
if (arg) {
// Skip already "safe" urls
if (urlSafeCharacters.test(String(arg))) {
return arg;
}
return encodeURIComponent(arg);
}
return arg;
});
// eslint-disable-next-line no-useless-call
return fn.call(null, ...escaped);
};
}
// Freeze the object so it can't be changed
Object.freeze(Routes);

View File

@@ -1,4 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import { urlSafeCharacters } from '../../utils/internals.ts';
export * from '../common.ts';
@@ -777,6 +778,28 @@ export const Routes = {
},
};
for (const [key, fn] of Object.entries(Routes)) {
Routes[key] = (...args: (boolean | number | string | undefined)[]) => {
const escaped = args.map((arg) => {
if (arg) {
// Skip already "safe" urls
if (urlSafeCharacters.test(String(arg))) {
return arg;
}
return encodeURIComponent(arg);
}
return arg;
});
// eslint-disable-next-line no-useless-call
return fn.call(null, ...escaped);
};
}
// Freeze the object so it can't be changed
Object.freeze(Routes);
export const RouteBases = {
api: `https://discord.com/api/v${APIVersion}`,
cdn: 'https://cdn.discordapp.com',

View File

@@ -24,14 +24,20 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} from '../../payloads/v9/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
import type { RESTAPIPollCreate } from './poll.ts';
import type { RESTAPIPoll } from './poll.ts';
export interface APIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
export interface RESTAPIChannelPatchOverwrite extends RESTPutAPIChannelPermissionJSONBody {
id: Snowflake;
}
/**
* @deprecated Use {@link RESTAPIChannelPatchOverwrite} instead
*/
export type APIChannelPatchOverwrite = RESTAPIChannelPatchOverwrite;
/**
* https://discord.com/developers/docs/resources/channel#get-channel
*/
@@ -237,7 +243,7 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
/**
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Required<Pick<APIMessageReference, 'message_id'>>
> &
StrictPartial<APIMessageReference> & {
@@ -250,22 +256,21 @@ export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesO
};
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* @deprecated Use {@link RESTAPIMessageReference} instead
*/
export interface RESTAPIAttachment {
export type APIMessageReferenceSend = RESTAPIMessageReference;
/**
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export type RESTAPIAttachment = Partial<
Pick<APIAttachment, 'description' | 'duration_secs' | 'filename' | 'title' | 'waveform'>
> & {
/**
* Attachment id or a number that matches `n` in `files[n]`
*/
id: Snowflake | number;
/**
* Name of the file
*/
filename?: string | undefined;
/**
* Description of the file
*/
description?: string | undefined;
}
};
/**
* https://discord.com/developers/docs/resources/channel#create-message
@@ -304,11 +309,11 @@ export interface RESTPostAPIChannelMessageJSONBody {
*/
allowed_mentions?: APIAllowedMentions | undefined;
/**
* Include to make your message a reply
* Include to make your message a reply or a forward
*
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
message_reference?: APIMessageReferenceSend | undefined;
message_reference?: RESTAPIMessageReference | undefined;
/**
* The components to include with the message
*
@@ -337,7 +342,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
/**
* A poll!
*/
poll?: RESTAPIPollCreate | undefined;
poll?: RESTAPIPoll | undefined;
}
/**
@@ -370,7 +375,12 @@ export type RESTPutAPIChannelMessageReactionResult = never;
/**
* https://discord.com/developers/docs/resources/channel#delete-own-reaction
*/
export type RESTDeleteAPIChannelMessageOwnReaction = never;
export type RESTDeleteAPIChannelMessageOwnReactionResult = never;
/**
* @deprecated Use {@link RESTDeleteAPIChannelMessageOwnReactionResult} instead
*/
export type RESTDeleteAPIChannelMessageOwnReaction = RESTDeleteAPIChannelMessageOwnReactionResult;
/**
* https://discord.com/developers/docs/resources/channel#delete-user-reaction
@@ -462,7 +472,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* 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
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
/**

View File

@@ -59,3 +59,40 @@ export type RESTPatchAPIGuildEmojiResult = APIEmoji;
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
*/
export type RESTDeleteAPIGuildEmojiResult = never;
/**
* https://discord.com/developers/docs/resources/emoji#list-application-emojis
*/
export interface RESTGetAPIApplicationEmojisResult {
items: APIEmoji[];
}
/**
* https://discord.com/developers/docs/resources/emoji#get-application-emoji
*/
export type RESTGetAPIApplicationEmojiResult = APIEmoji;
/**
* https://discord.com/developers/docs/resources/emoji#create-application-emoji-json-params
*/
export type RESTPostAPIApplicationEmojiJSONBody = Pick<RESTPostAPIGuildEmojiJSONBody, 'image' | 'name'>;
/**
* https://discord.com/developers/docs/resources/emoji#create-application-emoji
*/
export type RESTPostAPIApplicationEmojiResult = APIEmoji;
/**
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
*/
export type RESTPatchAPIApplicationEmojiJSONBody = Pick<RESTPatchAPIGuildEmojiJSONBody, 'name'>;
/**
* https://discord.com/developers/docs/resources/emoji#modify-application-emoji
*/
export type RESTPatchAPIApplicationEmojiResult = APIEmoji;
/**
* https://discord.com/developers/docs/resources/emoji#delete-application-emoji
*/
export type RESTDeleteAPIApplicationEmojiResult = never;

View File

@@ -35,16 +35,28 @@ import type {
StrictPartial,
StrictRequired,
} from '../../utils/internals.ts';
import type { Locale } from '../common.ts';
import type { RESTPutAPIChannelPermissionJSONBody } from './channel.ts';
export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
export interface RESTAPIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
id: number | string;
}
export type APIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
export type APIGuildCreatePartialChannel = StrictPartial<
/**
* @deprecated Use {@link RESTAPIGuildCreateOverwrite} instead
*/
export type APIGuildCreateOverwrite = RESTAPIGuildCreateOverwrite;
export type RESTAPIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGroupDMChannel>;
/**
* @deprecated Use {@link RESTAPIGuildChannelResolvable} instead
*/
export type APIGuildChannelResolvable = RESTAPIGuildChannelResolvable;
export type RESTAPIGuildCreatePartialChannel = StrictPartial<
DistributivePick<
APIGuildChannelResolvable,
RESTAPIGuildChannelResolvable,
| 'available_tags'
| 'bitrate'
| 'default_auto_archive_duration'
@@ -66,13 +78,23 @@ export type APIGuildCreatePartialChannel = StrictPartial<
name: string;
id?: number | string | undefined;
parent_id?: number | string | null | undefined;
permission_overwrites?: APIGuildCreateOverwrite[] | undefined;
permission_overwrites?: RESTAPIGuildCreateOverwrite[] | undefined;
};
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
/**
* @deprecated Use {@link RESTAPIGuildCreatePartialChannel} instead
*/
export type APIGuildCreatePartialChannel = RESTAPIGuildCreatePartialChannel;
export interface RESTAPIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
id: number | string;
}
/**
* @deprecated Use {@link RESTAPIGuildCreateRole} instead
*/
export type APIGuildCreateRole = RESTAPIGuildCreateRole;
/**
* https://discord.com/developers/docs/resources/guild#create-guild
*/
@@ -124,7 +146,7 @@ export interface RESTPostAPIGuildsJSONBody {
*
* See https://discord.com/developers/docs/topics/permissions#role-object
*/
roles?: APIGuildCreateRole[] | undefined;
roles?: RESTAPIGuildCreateRole[] | undefined;
/**
* New guild's channels
*
@@ -138,7 +160,7 @@ export interface RESTPostAPIGuildsJSONBody {
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
channels?: APIGuildCreatePartialChannel[] | undefined;
channels?: RESTAPIGuildCreatePartialChannel[] | undefined;
/**
* ID for afk channel
*/
@@ -294,7 +316,7 @@ export interface RESTPatchAPIGuildJSONBody {
*
* @default "en-US" (if the value is set to `null`)
*/
preferred_locale?: string | null | undefined;
preferred_locale?: Locale | null | undefined;
/**
* Enabled guild features
*
@@ -333,7 +355,7 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[];
/**
* https://discord.com/developers/docs/resources/guild#create-guild-channel
*/
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<APIGuildCreatePartialChannel, 'id'>;
export type RESTPostAPIGuildChannelJSONBody = DistributiveOmit<RESTAPIGuildCreatePartialChannel, 'id'>;
/**
* https://discord.com/developers/docs/resources/guild#create-guild-channel
@@ -745,6 +767,11 @@ export interface RESTPatchAPIGuildRoleJSONBody {
mentionable?: boolean | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-role
*/
export type RESTGetAPIGuildRoleResult = APIRole;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-role
*/
@@ -897,48 +924,6 @@ export interface RESTPatchAPIGuildMemberVerificationJSONBody {
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
*/
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id?: Snowflake | undefined;
/**
* Toggles the user's suppress state
*/
suppress?: boolean | undefined;
/**
* Sets the user's request to speak
*/
request_to_speak_timestamp?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#modify-current-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
/**
* https://discord.com/developers/docs/resources/guild#modify-user-voice-state
*/
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
/**
* Toggles the user's suppress state
*/
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
*/
@@ -973,20 +958,25 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP
/**
* Prompts shown during onboarding and in customize community
*/
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
prompts?: RESTAPIGuildOnboardingPrompt[] | undefined;
};
export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
export type RESTAPIGuildOnboardingPrompt = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
> &
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
/**
* Options available within the prompt
*/
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
options: RESTAPIGuildOnboardingPromptOption[];
};
export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
/**
* @deprecated Use {@link RESTAPIGuildOnboardingPrompt} instead.
*/
export type RESTAPIModifyGuildOnboardingPromptData = RESTAPIGuildOnboardingPrompt;
export type RESTAPIGuildOnboardingPromptOption = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
> &
Pick<APIGuildOnboardingPromptOption, 'title'> & {
@@ -1004,6 +994,11 @@ export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossibl
emoji_animated?: boolean | null | undefined;
};
/**
* @deprecated Use {@link RESTAPIGuildOnboardingPromptOption} instead.
*/
export type RESTAPIModifyGuildOnboardingPromptOptionData = RESTAPIGuildOnboardingPromptOption;
/**
* https://discord.com/developers/docs/resources/guild#modify-guild-onboarding
*/

View File

@@ -1,12 +1,13 @@
import type { Snowflake } from '../../globals.ts';
import type { StrictPartial } from '../../utils/internals.ts';
import type { Nullable, StrictPartial } from '../../utils/internals.ts';
import type {
APIGuildScheduledEvent,
APIGuildScheduledEventEntityMetadata,
APIGuildScheduledEventRecurrenceRule,
APIGuildScheduledEventUser,
GuildScheduledEventEntityType,
GuildScheduledEventPrivacyLevel,
APIGuildScheduledEventEntityMetadata,
GuildScheduledEventStatus,
APIGuildScheduledEventUser,
} from '../../v9.ts';
/**
@@ -64,6 +65,10 @@ export interface RESTPostAPIGuildScheduledEventJSONBody {
* The cover image of the scheduled event
*/
image?: string | null | undefined;
/**
* The definition for how often this event should recur
*/
recurrence_rule?: APIGuildScheduledEventRecurrenceRule | undefined;
}
/**
@@ -89,20 +94,17 @@ export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
*/
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;
};
export type RESTPatchAPIGuildScheduledEventJSONBody = Nullable<
Pick<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
> &
StrictPartial<
Omit<RESTPostAPIGuildScheduledEventJSONBody, 'description' | 'entity_metadata' | 'recurrence_rule'>
> & {
/**
* The status of the scheduled event
*/
status?: GuildScheduledEventStatus | undefined;
};
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event

View File

@@ -1,3 +1,4 @@
import type { Snowflake } from '../../globals.ts';
import type {
APIApplicationCommand,
APIApplicationCommandPermission,
@@ -5,6 +6,9 @@ import type {
APIInteractionResponse,
APIInteractionResponseCallbackData,
ApplicationCommandType,
InteractionResponseType,
APIMessage,
InteractionType,
} from '../../payloads/v9/mod.ts';
import type {
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
@@ -79,12 +83,21 @@ export interface RESTPostAPIContextMenuApplicationCommandsJSONBody extends RESTP
type: ApplicationCommandType.Message | ApplicationCommandType.User;
}
/**
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
*/
export interface RESTPostAPIPrimaryEntryPointApplicationCommandJSONBody
extends RESTPostAPIBaseApplicationCommandsJSONBody {
type: ApplicationCommandType.PrimaryEntryPoint;
}
/**
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
*/
export type RESTPostAPIApplicationCommandsJSONBody =
| RESTPostAPIChatInputApplicationCommandsJSONBody
| RESTPostAPIContextMenuApplicationCommandsJSONBody;
| RESTPostAPIContextMenuApplicationCommandsJSONBody
| RESTPostAPIPrimaryEntryPointApplicationCommandJSONBody;
/**
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
@@ -171,6 +184,16 @@ export type RESTPutAPIApplicationGuildCommandsResult = Omit<APIApplicationComman
*/
export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
*/
export interface RESTPostAPIInteractionCallbackQuery {
/**
* Whether to include a interaction callback response as the response instead of a 204
*/
with_response?: boolean;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
*/
@@ -183,6 +206,90 @@ export type RESTPostAPIInteractionCallbackFormDataBody =
})
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionCallbackJSONBody);
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
*/
export type RESTPostAPIInteractionCallbackResult = never;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-response-object
*/
export interface RESTPostAPIInteractionCallbackWithResponseResult {
/**
* The interaction object associated with the interaction
*/
interaction: RESTAPIInteractionCallbackObject;
/**
* The resource that was created by the interaction response
*/
resource?: RESTAPIInteractionCallbackResourceObject;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-object
*/
export interface RESTAPIInteractionCallbackObject {
/**
* ID of the interaction
*/
id: Snowflake;
/**
* Interaction type
*/
type: InteractionType;
/**
* Instance ID of the Activity if one was launched or joined
*/
activity_instance_id?: string;
/**
* ID of the message that was created by the interaction
*/
response_message_id?: Snowflake;
/**
* Whether or not the message is in a loading state
*/
response_message_loading?: boolean;
/**
* Whether or not the response message was ephemeral
*/
response_message_ephemeral?: boolean;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-resource-object
*/
export interface RESTAPIInteractionCallbackResourceObject {
/**
* Interaction callback type
*/
type: InteractionResponseType;
/**
* Represents the Activity launched by this interaction
*
* @remarks
* Only present if `type` is {@link InteractionResponseType.LaunchActivity}
*/
activity_instance?: RESTAPIInteractionCallbackActivityInstanceResource;
/**
* Message created by the interaction
*
* @remarks
* Only present if `type` is {@link InteractionResponseType.ChannelMessageWithSource}
* or {@link InteractionResponseType.UpdateMessage}
*/
message?: APIMessage;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-callback-interaction-callback-activity-instance-resource
*/
export interface RESTAPIInteractionCallbackActivityInstanceResource {
/**
* Instance ID of the Activity if one was launched or joined.
*/
id: string;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response
*/

View File

@@ -1,4 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import { urlSafeCharacters } from '../../utils/internals.ts';
export * from '../common.ts';
export * from './application.ts';
@@ -11,15 +12,16 @@ export * from './guild.ts';
export * from './guildScheduledEvent.ts';
export * from './interactions.ts';
export * from './invite.ts';
export * from './monetization.ts';
export * from './oauth2.ts';
export * from './poll.ts';
export * from './soundboard.ts';
export * from './stageInstance.ts';
export * from './sticker.ts';
export * from './template.ts';
export * from './user.ts';
export * from './voice.ts';
export * from './webhook.ts';
export * from './monetization.ts';
export const APIVersion = '9';
@@ -32,6 +34,7 @@ export const Routes = {
applicationRoleConnectionMetadata(applicationId: Snowflake) {
return `/applications/${applicationId}/role-connections/metadata` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/auto-moderation/rules`
@@ -344,6 +347,7 @@ export const Routes = {
/**
* Route for:
* - GET `/guilds/{guild.id}/roles/{role.id}`
* - PATCH `/guilds/{guild.id}/roles/{role.id}`
* - DELETE `/guilds/{guild.id}/roles/{role.id}`
*/
@@ -795,6 +799,8 @@ export const Routes = {
/**
* Route for:
* - GET `/guilds/{guild.id}/voice-states/@me`
* - GET `/guilds/{guild.id}/voice-states/{user.id}`
* - PATCH `/guilds/{guild.id}/voice-states/@me`
* - PATCH `/guilds/{guild.id}/voice-states/{user.id}`
*/
@@ -863,6 +869,14 @@ export const Routes = {
return '/sticker-packs' as const;
},
/**
* Route for:
* - GET `/sticker-packs/{pack.id}`
*/
stickerPack(packId: Snowflake) {
return `/sticker-packs/${packId}` as const;
},
/**
* Route for:
* - GET `/sticker-packs`
@@ -921,8 +935,8 @@ export const Routes = {
/**
* Route for:
* - GET `/guilds/${guild.id}/onboarding`
* - PUT `/guilds/${guild.id}/onboarding`
* - GET `/guilds/{guild.id}/onboarding`
* - PUT `/guilds/{guild.id}/onboarding`
*/
guildOnboarding(guildId: Snowflake) {
return `/guilds/${guildId}/onboarding` as const;
@@ -948,6 +962,7 @@ export const Routes = {
/**
* Route for:
* - GET `/applications/{application.id}/entitlements/{entitlement.id}`
* - DELETE `/applications/{application.id}/entitlements/{entitlement.id}`
*/
entitlement(applicationId: Snowflake, entitlementId: Snowflake) {
@@ -972,13 +987,105 @@ export const Routes = {
/**
* Route for:
* - POST `/applications/${application.id}/entitlements/${entitlement.id}/consume`
* - POST `/applications/{application.id}/entitlements/{entitlement.id}/consume`
*/
consumeEntitlement(applicationId: Snowflake, entitlementId: Snowflake) {
return `/applications/${applicationId}/entitlements/${entitlementId}/consume` as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/emojis`
* - POST `/applications/{application.id}/emojis`
*/
applicationEmojis(applicationId: Snowflake) {
return `/applications/${applicationId}/emojis` as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/emojis/{emoji.id}`
* - PATCH `/applications/{application.id}/emojis/{emoji.id}`
* - DELETE `/applications/{application.id}/emojis/{emoji.id}`
*/
applicationEmoji(applicationId: Snowflake, emojiId: Snowflake) {
return `/applications/${applicationId}/emojis/${emojiId}` as const;
},
/**
* Route for:
* - GET `/skus/{sku.id}/subscriptions`
*/
skuSubscriptions(skuId: Snowflake) {
return `/skus/${skuId}/subscriptions` as const;
},
/**
* Route for:
* - GET `/skus/{sku.id}/subscriptions/{subscription.id}`
*/
skuSubscription(skuId: Snowflake, subscriptionId: Snowflake) {
return `/skus/${skuId}/subscriptions/${subscriptionId}` as const;
},
/**
* Route for:
* - POST `/channels/{channel.id}/send-soundboard-sound`
*/
sendSoundboardSound(channelId: Snowflake) {
return `/channels/${channelId}/send-soundboard-sound` as const;
},
/**
* Route for:
* - GET `/soundboard-default-sounds`
*/
soundboardDefaultSounds() {
return '/soundboard-default-sounds' as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/soundboard-sounds`
* - POST `/guilds/{guild.id}/soundboard-sounds`
*/
guildSoundboardSounds(guildId: Snowflake) {
return `/guilds/${guildId}/soundboard-sounds` as const;
},
/**
* Route for:
* - GET `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
* - PATCH `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
* - DELETE `/guilds/{guild.id}/soundboard-sounds/{sound.id}`
*/
guildSoundboardSound(guildId: Snowflake, soundId: Snowflake) {
return `/guilds/${guildId}/soundboard-sounds/${soundId}` as const;
},
};
for (const [key, fn] of Object.entries(Routes)) {
Routes[key as keyof typeof Routes] = (...args: (boolean | number | string | undefined)[]) => {
const escaped = args.map((arg) => {
if (arg) {
// Skip already "safe" urls
if (urlSafeCharacters.test(String(arg))) {
return arg;
}
return encodeURIComponent(arg);
}
return arg;
});
// eslint-disable-next-line no-useless-call
return fn.call(null, ...escaped);
};
}
// Freeze the object so it can't be changed
Object.freeze(Routes);
export const StickerPackApplicationId = '710982414301790216';
export enum ImageFormat {
@@ -1004,14 +1111,14 @@ export const CDNRoutes = {
/**
* Route for:
* - GET `/guilds/{guild.id}/icons/{guild.id}.{png|jpeg|webp|gif}`
* - GET `/icons/{guild.id}/{guild.icon}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
* This route supports the extensions: PNG, JPEG, WebP, GIF
*/
guildIcon<Format extends GuildIconFormat>(guildId: Snowflake, guildIcon: string, format: Format) {
return `icons/${guildId}/${guildIcon}.${format}` as const;
return `/icons/${guildId}/${guildIcon}.${format}` as const;
},
/**
@@ -1090,7 +1197,7 @@ export const CDNRoutes = {
/**
* Route for:
* - GET `/guilds/{guild.id}/users/{user.id}/{guild_member.avatar}.{png|jpeg|webp|gif}`
* - GET `/guilds/{guild.id}/users/{user.id}/avatars/{guild_member.avatar}.{png|jpeg|webp|gif}`
*
* As this route supports GIFs, the hash will begin with `a_` if it is available in GIF format
*
@@ -1210,7 +1317,7 @@ export const CDNRoutes = {
/**
* Route for:
* - GET `team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
* - GET `/team-icons/{team.id}/{team.icon}.{png|jpeg|webp}`
*
* This route supports the extensions: PNG, JPEG, WebP
*/
@@ -1266,8 +1373,38 @@ export const CDNRoutes = {
) {
return `/guilds/${guildId}/users/${userId}/banners/${guildMemberBanner}.${format}` as const;
},
/**
* Route for:
* - GET `/soundboard-sounds/${sound.id}`
*/
soundboardSound(soundId: Snowflake) {
return `/soundboard-sounds/${soundId}` as const;
},
};
for (const [key, fn] of Object.entries(CDNRoutes)) {
CDNRoutes[key as keyof typeof CDNRoutes] = (...args: (boolean | number | string | undefined)[]) => {
const escaped = args.map((arg) => {
if (arg) {
// Skip already "safe" urls
if (urlSafeCharacters.test(String(arg))) {
return arg;
}
return encodeURIComponent(arg);
}
return arg;
});
// eslint-disable-next-line no-useless-call
return fn.call(null, ...escaped);
};
}
// Freeze the object so it can't be changed
Object.freeze(CDNRoutes);
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;
export type EmojiFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
@@ -1284,8 +1421,8 @@ export type ApplicationCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | Imag
export type ApplicationAssetFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type AchievementIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type StickerPackBannerFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type StorePageAssetFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type TeamIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type StorePageAssetFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type StickerFormat = Extract<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie | ImageFormat.PNG>;
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
@@ -1303,6 +1440,7 @@ export interface CDNQuery {
export const RouteBases = {
api: `https://discord.com/api/v${APIVersion}`,
cdn: 'https://cdn.discordapp.com',
media: 'https://media.discordapp.net',
invite: 'https://discord.gg',
template: 'https://discord.new',
gift: 'https://discord.gift',

View File

@@ -1,8 +1,8 @@
import type { Snowflake } from '../../globals.ts';
import type { APIEntitlement, APISKU } from '../../v10.ts';
import type { APIEntitlement, APISKU, APISubscription } from '../../v9.ts';
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
* https://discord.com/developers/docs/resources/entitlement#list-entitlements
*/
export interface RESTGetAPIEntitlementsQuery {
/**
@@ -33,20 +33,29 @@ export interface RESTGetAPIEntitlementsQuery {
*/
guild_id?: Snowflake | undefined;
/**
* Whether ended entitlements should be omitted
* Whether ended entitlements should be omitted. Defaults to `false`, ended entitlements are included by default
*/
exclude_ended?: boolean | undefined;
/**
* Whether deleted entitlements should be omitted. Defaults to `true`, deleted entitlements are not included by default
*/
exclude_deleted?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
* https://discord.com/developers/docs/resources/entitlement#list-entitlements
*/
export type RESTGetAPIEntitlementsResult = APIEntitlement[];
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
* https://discord.com/developers/docs/resources/entitlement#get-entitlement
*/
export interface RESTPostAPIEntitlementBody {
export type RESTGetAPIEntitlementResult = APIEntitlement;
/**
* https://discord.com/developers/docs/resources/entitlement#create-test-entitlement
*/
export interface RESTPostAPIEntitlementJSONBody {
/**
* ID of the SKU to grant the entitlement to
*/
@@ -62,12 +71,17 @@ export interface RESTPostAPIEntitlementBody {
}
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
* @deprecated Use {@link RESTPostAPIEntitlementJSONBody} instead
*/
export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody;
/**
* https://discord.com/developers/docs/resources/entitlement#create-test-entitlement
*/
export type RESTPostAPIEntitlementResult = Partial<Omit<APIEntitlement, 'ends_at' | 'starts_at'>>;
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
* https://discord.com/developers/docs/resources/entitlement#create-test-entitlement
*/
export enum EntitlementOwnerType {
Guild = 1,
@@ -75,16 +89,50 @@ export enum EntitlementOwnerType {
}
/**
* https://discord.com/developers/docs/monetization/entitlements#delete-test-entitlement
* https://discord.com/developers/docs/resources/entitlement#delete-test-entitlement
*/
export type RESTDeleteAPIEntitlementResult = never;
/**
* https://discord.com/developers/docs/monetization/skus#list-skus
* https://discord.com/developers/docs/resources/sku#list-skus
*/
export type RESTGetAPISKUsResult = APISKU[];
/**
* https://discord.com/developers/docs/monetization/entitlements#consume-an-entitlement
* https://discord.com/developers/docs/resources/entitlement#consume-an-entitlement
*/
export type RESTPostAPIEntitlementConsumeResult = never;
/**
* https://discord.com/developers/docs/resources/subscription#query-string-params
*/
export interface RESTGetAPISKUSubscriptionsQuery {
/**
* List subscriptions before this ID
*/
before?: Snowflake | undefined;
/**
* List subscriptions after this ID
*/
after?: Snowflake | undefined;
/**
* Number of subscriptions to return (1-100)
*
* @default 50
*/
limit?: number | undefined;
/**
* User ID for which to return subscriptions. Required except for OAuth queries.
*/
user_id?: Snowflake | undefined;
}
/**
* https://discord.com/developers/docs/resources/subscription#list-sku-subscriptions
*/
export type RESTGetAPISKUSubscriptionsResult = APISubscription[];
/**
* https://discord.com/developers/docs/resources/subscription#get-sku-subscription
*/
export type RESTGetAPISKUSubscriptionResult = APISubscription;

View File

@@ -40,14 +40,27 @@ export interface RESTOAuth2AuthorizationQuery {
prompt?: 'consent' | 'none';
}
/**
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-token-revocation-example
*/
export interface RESTPostOAuth2TokenRevocationQuery {
token: string;
token_type_hint?: 'access_token' | 'refresh_token';
}
/**
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
*/
export interface RESTOAuth2AuthorizationQueryResult {
export interface RESTPostOAuth2AuthorizationQueryResult {
code: string;
state?: string;
}
/**
* @deprecated Use {@link RESTPostOAuth2AuthorizationQueryResult} instead
*/
export type RESTOAuth2AuthorizationQueryResult = RESTPostOAuth2AuthorizationQueryResult;
/**
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
*/
@@ -121,10 +134,10 @@ export interface RESTOAuth2BotAuthorizationQuery {
* Needs to include bot for the bot flow
*/
scope:
| OAuth2Scopes.Bot
| `${OAuth2Scopes.Bot}${' ' | '%20'}${string}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`;
| `${OAuth2Scopes.Bot} ${string}`
| `${OAuth2Scopes.Bot}`
| `${string} ${OAuth2Scopes.Bot} ${string}`
| `${string} ${OAuth2Scopes.Bot}`;
/**
* The permissions you're requesting
*
@@ -150,10 +163,10 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery {
* This assumes you include the `bot` scope alongside others (like `identify` for example)
*/
scope:
| OAuth2Scopes.Bot
| `${OAuth2Scopes.Bot}${' ' | '%20'}${string}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`;
| `${OAuth2Scopes.Bot} ${string}`
| `${OAuth2Scopes.Bot}`
| `${string} ${OAuth2Scopes.Bot} ${string}`
| `${string} ${OAuth2Scopes.Bot}`;
/**
* The required permissions bitfield, stringified
*/

View File

@@ -20,17 +20,26 @@ export interface RESTGetAPIPollAnswerVotersQuery {
/**
* https://discord.com/developers/docs/resources/poll#poll-create-request-object-poll-create-request-object-structure
*/
export interface RESTAPIPollCreate extends Omit<APIPoll, 'answers' | 'expiry' | 'results'> {
/**
* Number of hours the poll should be open for, up to 7 days
*/
duration: number;
export interface RESTAPIPoll
extends Omit<APIPoll, 'allow_multiselect' | 'answers' | 'expiry' | 'layout_type' | 'results'>,
Partial<Pick<APIPoll, 'allow_multiselect' | 'layout_type'>> {
/**
* Each of the answers available in the poll, up to 10
*/
answers: Omit<APIPollAnswer, 'answer_id'>[];
/**
* Number of hours the poll should be open for, up to 32 days
*
* @default 24
*/
duration?: number;
}
/**
* @deprecated Use {@link RESTAPIPoll} instead
*/
export type RESTAPIPollCreate = RESTAPIPoll;
/**
* https://discord.com/developers/docs/resources/poll#get-answer-voters
*/

107
deno/rest/v9/soundboard.ts Normal file
View File

@@ -0,0 +1,107 @@
import type { Snowflake } from '../../globals.ts';
import type { APISoundboardSound } from '../../payloads/v10/mod.ts';
/**
* https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound
*/
export type RESTPostAPISendSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#send-soundboard-sound-json-params
*/
export interface RESTPostAPISoundboardSendSoundJSONBody {
/**
* The id of the soundboard sound to play
*/
sound_id: Snowflake;
/**
* The id of the guild the soundboard sound is from, required to play sounds from different servers
*/
source_guild_id?: Snowflake | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#list-soundboard-default-sounds
*/
export type RESTGetAPISoundboardDefaultSoundsResult = APISoundboardSound[];
/**
* https://discord.com/developers/docs/resources/soundboard#list-guild-soundboard-sounds
*/
export interface RESTGetAPIGuildSoundboardSoundsResult {
items: APISoundboardSound[];
}
/**
* https://discord.com/developers/docs/resources/soundboard#get-guild-soundboard-sound
*/
export type RESTGetAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound-json-params
*/
export interface RESTPostAPIGuildSoundboardSoundJSONBody {
/**
* The name of the soundboard sound (2-32 characters)
*/
name: string;
/**
* The data uri of the mp3 or ogg sound data, base64 encoded, similar to image data
*
* See https://discord.com/developers/docs/reference#image-data
*/
sound: string;
/**
* The volume of the soundboard sound, from 0 to 1
*
* @default 1
*/
volume?: number | null | undefined;
/**
* The id of the custom emoji for the soundboard sound
*/
emoji_id?: Snowflake | null | undefined;
/**
* The unicode character of a standard emoji for the soundboard sound
*/
emoji_name?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#create-guild-soundboard-sound
*/
export type RESTPostAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound-json-params
*/
export interface RESTPatchAPIGuildSoundboardSoundJSONBody {
/**
* The name of the soundboard sound (2-32 characters)
*/
name?: string | undefined;
/**
* The volume of the soundboard sound, from 0 to 1
*
* @default 1
*/
volume?: number | null | undefined;
/**
* The id of the custom emoji for the soundboard sound
*/
emoji_id?: Snowflake | null | undefined;
/**
* The unicode character of a standard emoji for the soundboard sound
*/
emoji_name?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/soundboard#modify-guild-soundboard-sound
*/
export type RESTPatchAPIGuildSoundboardSoundResult = APISoundboardSound;
/**
* https://discord.com/developers/docs/resources/soundboard#delete-guild-soundboard-sound
*/
export type RESTDeleteAPIGuildSoundboardSoundResult = never;

View File

@@ -12,6 +12,16 @@ export interface RESTGetStickerPacksResult {
sticker_packs: APIStickerPack[];
}
/**
* https://discord.com/developers/docs/resources/sticker#get-sticker-pack
*/
export type RESTGetAPIStickerPackResult = APIStickerPack;
/**
* @deprecated Use {@link RESTGetAPIStickerPackResult} instead
*/
export type RESTGetAPIStickerPack = RESTGetAPIStickerPackResult;
/**
* https://discord.com/developers/docs/resources/sticker#list-sticker-packs
*

View File

@@ -76,6 +76,7 @@ export interface RESTAPIPartialCurrentUserGuild {
id: Snowflake;
name: string;
icon: string | null;
banner: string | null;
owner: boolean;
features: GuildFeature[];
permissions: Permissions;

View File

@@ -1,4 +1,5 @@
import type { APIVoiceRegion } from '../../payloads/v9/mod.ts';
import type { Snowflake } from '../../globals.ts';
import type { APIVoiceRegion, APIVoiceState } from '../../payloads/v9/mod.ts';
/**
* https://discord.com/developers/docs/resources/voice#list-voice-regions
@@ -9,3 +10,55 @@ export type RESTGetAPIVoiceRegionsResult = APIVoiceRegion[];
* @deprecated This was exported with the wrong name, use `RESTGetAPIVoiceRegionsResult` instead
*/
export type GetAPIVoiceRegionsResult = RESTGetAPIVoiceRegionsResult;
/**
* https://discord.com/developers/docs/resources/voice#get-current-user-voice-state
*/
export type RESTGetAPIGuildVoiceStateCurrentMemberResult = APIVoiceState;
/**
* https://discord.com/developers/docs/resources/voice#get-user-voice-state
*/
export type RESTGetAPIGuildVoiceStateUserResult = APIVoiceState;
/**
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
*/
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id?: Snowflake | undefined;
/**
* Toggles the user's suppress state
*/
suppress?: boolean | undefined;
/**
* Sets the user's request to speak
*/
request_to_speak_timestamp?: string | null | undefined;
}
/**
* https://discord.com/developers/docs/resources/voice#modify-current-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateCurrentMemberResult = never;
/**
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
*/
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
/**
* The id of the channel the user is currently in
*/
channel_id: Snowflake;
/**
* Toggles the user's suppress state
*/
suppress?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/voice#modify-user-voice-state
*/
export type RESTPatchAPIGuildVoiceStateUserResult = never;

View File

@@ -10,7 +10,7 @@ import type {
} from '../../payloads/v9/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, Nullable } from '../../utils/internals.ts';
import type { RESTAPIAttachment } from './channel.ts';
import type { RESTAPIPollCreate } from './poll.ts';
import type { RESTAPIPoll } from './poll.ts';
/**
* https://discord.com/developers/docs/resources/webhook#create-webhook
*/
@@ -158,7 +158,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
/**
* A poll!
*/
poll?: RESTAPIPollCreate | undefined;
poll?: RESTAPIPoll | undefined;
}
/**
@@ -264,9 +264,16 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* 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
* See https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
attachments?: RESTAPIAttachment[] | undefined;
/**
* A poll!
*
* @remarks
* Polls can only be added when editing a deferred interaction response.
*/
poll?: RESTAPIPoll | undefined;
};
/**

View File

@@ -39,3 +39,15 @@ export type DistributiveOmit<T, K extends DistributiveKeys<T>> =
T extends unknown ? { [P in keyof Omit_<T, K>]: Omit_<T, K>[P] } : never;
type Omit_<T, K> = Omit<T, Extract<keyof T, K>>;
const pattern = /^[\d%A-Za-z-]+$/g;
export const urlSafeCharacters = {
test(input: string) {
const result = pattern.test(input);
pattern.lastIndex = 0;
return result;
},
};

View File

@@ -111,7 +111,7 @@ export function isLinkButton(component: APIButtonComponent): component is APIBut
* @returns A boolean that indicates if the button has a `custom_id` attached to it
*/
export function isInteractionButton(component: APIButtonComponent): component is APIButtonComponentWithCustomId {
return component.style !== ButtonStyle.Link;
return ![ButtonStyle.Link, ButtonStyle.Premium].includes(component.style);
}
// Message Components

View File

@@ -111,7 +111,7 @@ export function isLinkButton(component: APIButtonComponent): component is APIBut
* @returns A boolean that indicates if the button has a `custom_id` attached to it
*/
export function isInteractionButton(component: APIButtonComponent): component is APIButtonComponentWithCustomId {
return component.style !== ButtonStyle.Link;
return ![ButtonStyle.Link, ButtonStyle.Premium].includes(component.style);
}
// Message Components

View File

@@ -28,13 +28,17 @@ import type {
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
GatewayThreadListSync as RawGatewayThreadListSync,
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
GatewayVoiceState,
APIVoiceState,
InviteTargetType,
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
APIAuditLogEntry,
APIEntitlement,
ChannelType,
APISubscription,
APISoundboardSound,
GuildChannelType,
ThreadChannelType,
} from '../payloads/v10/index';
import type { ReactionType } from '../rest/v10/index';
import type { Nullable } from '../utils/internals';
@@ -92,6 +96,10 @@ export enum GatewayOpcodes {
* Sent in response to receiving a heartbeat to acknowledge that it has been received
*/
HeartbeatAck,
/**
* Request information about soundboard sounds in a set of guilds
*/
RequestSoundboardSounds = 31,
}
/**
@@ -188,7 +196,11 @@ export enum GatewayIntentBits {
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
*/
GuildBans = GuildModeration,
GuildEmojisAndStickers = 1 << 3,
GuildExpressions = 1 << 3,
/**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildExpressions}
*/
GuildEmojisAndStickers = GuildExpressions,
GuildIntegrations = 1 << 4,
GuildWebhooks = 1 << 5,
GuildInvites = 1 << 6,
@@ -213,10 +225,18 @@ export enum GatewayIntentBits {
*/
export enum GatewayDispatchEvents {
ApplicationCommandPermissionsUpdate = 'APPLICATION_COMMAND_PERMISSIONS_UPDATE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
ChannelUpdate = 'CHANNEL_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
GuildBanAdd = 'GUILD_BAN_ADD',
GuildBanRemove = 'GUILD_BAN_REMOVE',
GuildCreate = 'GUILD_CREATE',
@@ -230,6 +250,16 @@ export enum GatewayDispatchEvents {
GuildRoleCreate = 'GUILD_ROLE_CREATE',
GuildRoleDelete = 'GUILD_ROLE_DELETE',
GuildRoleUpdate = 'GUILD_ROLE_UPDATE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
GuildSoundboardSoundCreate = 'GUILD_SOUNDBOARD_SOUND_CREATE',
GuildSoundboardSoundDelete = 'GUILD_SOUNDBOARD_SOUND_DELETE',
GuildSoundboardSoundsUpdate = 'GUILD_SOUNDBOARD_SOUNDS_UPDATE',
GuildSoundboardSoundUpdate = 'GUILD_SOUNDBOARD_SOUND_UPDATE',
SoundboardSounds = 'SOUNDBOARD_SOUNDS',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
@@ -241,17 +271,22 @@ export enum GatewayDispatchEvents {
MessageCreate = 'MESSAGE_CREATE',
MessageDelete = 'MESSAGE_DELETE',
MessageDeleteBulk = 'MESSAGE_DELETE_BULK',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
MessageReactionAdd = 'MESSAGE_REACTION_ADD',
MessageReactionRemove = 'MESSAGE_REACTION_REMOVE',
MessageReactionRemoveAll = 'MESSAGE_REACTION_REMOVE_ALL',
MessageReactionRemoveEmoji = 'MESSAGE_REACTION_REMOVE_EMOJI',
MessageUpdate = 'MESSAGE_UPDATE',
PresenceUpdate = 'PRESENCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
StageInstanceCreate = 'STAGE_INSTANCE_CREATE',
StageInstanceDelete = 'STAGE_INSTANCE_DELETE',
StageInstanceUpdate = 'STAGE_INSTANCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
SubscriptionCreate = 'SUBSCRIPTION_CREATE',
SubscriptionDelete = 'SUBSCRIPTION_DELETE',
SubscriptionUpdate = 'SUBSCRIPTION_UPDATE',
ThreadCreate = 'THREAD_CREATE',
ThreadDelete = 'THREAD_DELETE',
ThreadListSync = 'THREAD_LIST_SYNC',
@@ -260,30 +295,17 @@ export enum GatewayDispatchEvents {
ThreadUpdate = 'THREAD_UPDATE',
TypingStart = 'TYPING_START',
UserUpdate = 'USER_UPDATE',
VoiceChannelEffectSend = 'VOICE_CHANNEL_EFFECT_SEND',
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
WebhooksUpdate = 'WEBHOOKS_UPDATE',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
}
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayRequestGuildMembers
| GatewayRequestSoundboardSounds
| GatewayResume
| GatewayUpdatePresence
| GatewayVoiceStateUpdate;
@@ -323,6 +345,10 @@ export type GatewayDispatchPayload =
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildSoundboardSoundCreateDispatch
| GatewayGuildSoundboardSoundDeleteDispatch
| GatewayGuildSoundboardSoundsUpdateDispatch
| GatewayGuildSoundboardSoundUpdateDispatch
| GatewayGuildStickersUpdateDispatch
| GatewayIntegrationCreateDispatch
| GatewayIntegrationDeleteDispatch
@@ -343,9 +369,11 @@ export type GatewayDispatchPayload =
| GatewayPresenceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewaySoundboardSoundsDispatch
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewaySubscriptionModifyDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
@@ -354,6 +382,7 @@ export type GatewayDispatchPayload =
| GatewayThreadUpdateDispatch
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceChannelEffectSendDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
@@ -614,6 +643,55 @@ export interface GatewayApplicationCommandPermissionsUpdateDispatchData {
permissions: APIApplicationCommandPermission[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatch = DataPayload<
| GatewayDispatchEvents.SubscriptionCreate
| GatewayDispatchEvents.SubscriptionDelete
| GatewayDispatchEvents.SubscriptionUpdate,
GatewaySubscriptionModifyDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatchData = APISubscription;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatch = GatewaySubscriptionModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatchData = GatewaySubscriptionModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatch = GatewaySubscriptionModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatchData = GatewaySubscriptionModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatch = GatewaySubscriptionModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatchData = GatewaySubscriptionModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#channel-create
* https://discord.com/developers/docs/topics/gateway-events#channel-update
@@ -629,7 +707,10 @@ export type GatewayChannelModifyDispatch = DataPayload<
* https://discord.com/developers/docs/topics/gateway-events#channel-update
* https://discord.com/developers/docs/topics/gateway-events#channel-delete
*/
export type GatewayChannelModifyDispatchData = APIChannel;
export type GatewayChannelModifyDispatchData = APIChannel & {
type: Exclude<GuildChannelType, ThreadChannelType>;
guild_id: Snowflake;
};
/**
* https://discord.com/developers/docs/topics/gateway-events#channel-create
@@ -709,7 +790,9 @@ export type GatewayEntitlementModifyDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
*/
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
export type GatewayEntitlementCreateDispatchData = Omit<GatewayEntitlementModifyDispatchData, 'ends_at'> & {
ends_at: GatewayEntitlementModifyDispatchData['ends_at'] | null;
};
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
@@ -737,7 +820,7 @@ export type GatewayEntitlementDeleteDispatchData = GatewayEntitlementModifyDispa
export type GatewayEntitlementDeleteDispatch = GatewayEntitlementModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-create
* https://discord.com/developers/docs/topics/gateway-events#guild-update
*/
export type GatewayGuildModifyDispatch = DataPayload<GatewayDispatchEvents.GuildUpdate, GatewayGuildModifyDispatchData>;
@@ -785,7 +868,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* See https://discord.com/developers/docs/resources/voice#voice-state-object
*/
voice_states: Omit<GatewayVoiceState, 'guild_id'>[];
voice_states: Omit<APIVoiceState, 'guild_id'>[];
/**
* Users in the guild
*
@@ -801,7 +884,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
channels: APIChannel[];
channels: (APIChannel & { type: Exclude<GuildChannelType, ThreadChannelType> })[];
/**
* Threads in the guild
*
@@ -809,7 +892,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
threads: APIChannel[];
threads: (APIChannel & { type: ThreadChannelType })[];
/**
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
*
@@ -831,9 +914,17 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
* See https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
*/
guild_scheduled_events: APIGuildScheduledEvent[];
/**
* The soundboard sounds in the guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* See https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object
*/
soundboard_sounds: APISoundboardSound[];
}
/**
@@ -854,7 +945,14 @@ export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.Guild
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-delete
*/
export type GatewayGuildDeleteDispatchData = APIUnavailableGuild;
export interface GatewayGuildDeleteDispatchData extends Omit<APIUnavailableGuild, 'unavailable'> {
/**
* `true` if this guild is unavailable due to an outage
*
* If the field is not set, the user was removed from the guild.
*/
unavailable?: true;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-ban-add
@@ -1022,9 +1120,9 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
* https://discord.com/developers/docs/topics/gateway-events#guild-member-update
*/
export type GatewayGuildMemberUpdateDispatchData = Nullable<Pick<APIGuildMember, 'joined_at'>> &
Omit<APIGuildMember, 'deaf' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'mute'>> &
Required<Pick<APIGuildMember, 'user'>> & {
Omit<APIGuildMember, 'deaf' | 'flags' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'flags' | 'mute'>> &
Required<Pick<APIGuildMember, 'avatar' | 'banner' | 'user'>> & {
/**
* The id of the guild
*/
@@ -1152,49 +1250,171 @@ export interface GatewayGuildRoleDeleteDispatchData {
role_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create
*/
export type GatewayGuildScheduledEventCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventCreate,
GatewayGuildScheduledEventCreateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create
*/
export type GatewayGuildScheduledEventCreateDispatchData = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update
*/
export type GatewayGuildScheduledEventUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUpdate,
GatewayGuildScheduledEventUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update
*/
export type GatewayGuildScheduledEventUpdateDispatchData = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete
*/
export type GatewayGuildScheduledEventDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventDelete,
GatewayGuildScheduledEventDeleteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete
*/
export type GatewayGuildScheduledEventDeleteDispatchData = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add
*/
export type GatewayGuildScheduledEventUserAddDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUserAdd,
GatewayGuildScheduledEventUserAddDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add
*/
export interface GatewayGuildScheduledEventUserAddDispatchData {
guild_scheduled_event_id: Snowflake;
user_id: Snowflake;
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove
*/
export type GatewayGuildScheduledEventUserRemoveDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUserRemove,
GatewayGuildScheduledEventUserAddDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove
*/
export interface GatewayGuildScheduledEventUserRemoveDispatchData {
guild_scheduled_event_id: Snowflake;
user_id: Snowflake;
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundCreate,
GatewayGuildSoundboardSoundCreateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundUpdate,
GatewayGuildSoundboardSoundUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export type GatewayGuildSoundboardSoundDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundDelete,
GatewayGuildSoundboardSoundDeleteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export interface GatewayGuildSoundboardSoundDeleteDispatchData {
/**
* The id of the sound that was deleted
*/
sound_id: Snowflake;
/**
* The id of the guild the sound was in
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export type GatewayGuildSoundboardSoundsUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundsUpdate,
GatewayGuildSoundboardSoundsUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
/**
* The guild's soundboard sounds
*/
soundboard_sounds: APISoundboardSound[];
/**
* The id of the guild
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export type GatewaySoundboardSoundsDispatch = DataPayload<
GatewayDispatchEvents.SoundboardSounds,
GatewaySoundboardSoundsDispatchData
>;
/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export interface GatewaySoundboardSoundsDispatchData {
/**
* The guild's soundboard sounds
*/
soundboard_sounds: APISoundboardSound[];
/**
* The id of the guild
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#integration-create
*/
@@ -1382,18 +1602,11 @@ export type GatewayMessageUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#message-update
*/
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields &
Omit<Partial<APIMessage>, 'mentions'> & {
/**
* ID of the message
*/
id: Snowflake;
/**
* ID of the channel the message was sent in
*/
channel_id: Snowflake;
};
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields
*/
export interface GatewayMessageEventExtraFields {
/**
* ID of the guild the message was sent in
@@ -1628,7 +1841,7 @@ export type GatewayThreadMemberUpdateDispatchData = APIThreadMember & { guild_id
*/
export type GatewayThreadModifyDispatch = DataPayload<
GatewayDispatchEvents.ThreadCreate | GatewayDispatchEvents.ThreadDelete | GatewayDispatchEvents.ThreadUpdate,
GatewayChannelModifyDispatchData
APIThreadChannel
>;
/**
@@ -1737,6 +1950,66 @@ export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUp
*/
export type GatewayUserUpdateDispatchData = APIUser;
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send
*/
export type GatewayVoiceChannelEffectSendDispatch = DataPayload<
GatewayDispatchEvents.VoiceChannelEffectSend,
GatewayVoiceChannelEffectSendDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send
*/
export interface GatewayVoiceChannelEffectSendDispatchData {
/**
* ID of the channel the effect was sent in
*/
channel_id: Snowflake;
/**
* ID of the guild the effect was sent in
*/
guild_id: Snowflake;
/**
* ID of the user who sent the effect
*/
user_id: Snowflake;
/**
* The emoji sent, for emoji reaction and soundboard effects
*/
emoji?: APIEmoji | null;
/**
* The type of emoji animation, for emoji reaction and soundboard effects
*/
animation_type?: VoiceChannelEffectSendAnimationType | null;
/**
* The ID of the emoji animation, for emoji reaction and soundboard effects
*/
animation_id?: number;
/**
* The ID of the soundboard sound, for soundboard effects
*/
sound_id?: Snowflake | number;
/**
* The volume of the soundboard sound, from 0 to 1, for soundboard effects
*/
sound_volume?: number;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types
*/
export enum VoiceChannelEffectSendAnimationType {
/**
* A fun animation, sent by a Nitro subscriber
*/
Premium,
/**
* The standard animation
*/
Basic,
}
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
*/
@@ -1748,7 +2021,7 @@ export type GatewayVoiceStateUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
*/
export type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState;
export type GatewayVoiceStateUpdateDispatchData = APIVoiceState;
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-server-update
@@ -1836,6 +2109,10 @@ export type GatewayMessagePollVoteRemoveDispatch = DataPayload<
GatewayMessagePollVoteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove
*/
export interface GatewayMessagePollVoteDispatchData {
/**
* ID of the user
@@ -1983,6 +2260,9 @@ export interface GatewayRequestGuildMembers {
d: GatewayRequestGuildMembersData;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export interface GatewayRequestGuildMembersDataBase {
/**
* ID of the guild to get members for
@@ -2002,6 +2282,9 @@ export interface GatewayRequestGuildMembersDataBase {
nonce?: string;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayRequestGuildMembersDataBase {
/**
* Used to specify which users you wish to fetch
@@ -2009,6 +2292,9 @@ export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayReques
user_ids: Snowflake | Snowflake[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestGuildMembersDataBase {
/**
* String that username starts with, or an empty string to return all members
@@ -2028,6 +2314,24 @@ export type GatewayRequestGuildMembersData =
| GatewayRequestGuildMembersDataWithQuery
| GatewayRequestGuildMembersDataWithUserIds;
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSounds {
op: GatewayOpcodes.RequestSoundboardSounds;
d: GatewayRequestSoundboardSoundsData;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSoundsData {
/**
* The ids of the guilds to get soundboard sounds for
*/
guild_ids: Snowflake[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
*/

View File

@@ -28,12 +28,16 @@ import type {
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
GatewayThreadListSync as RawGatewayThreadListSync,
GatewayThreadMembersUpdate as RawGatewayThreadMembersUpdate,
GatewayVoiceState,
APIVoiceState,
InviteTargetType,
PresenceUpdateStatus,
AutoModerationRuleTriggerType,
APIAuditLogEntry,
ChannelType,
APISubscription,
APISoundboardSound,
GuildChannelType,
ThreadChannelType,
} from '../payloads/v9/index';
import type { ReactionType } from '../rest/v9/index';
import type { Nullable } from '../utils/internals';
@@ -92,6 +96,10 @@ export enum GatewayOpcodes {
* Sent in response to receiving a heartbeat to acknowledge that it has been received
*/
HeartbeatAck,
/**
* Request information about soundboard sounds in a set of guilds
*/
RequestSoundboardSounds = 31,
}
/**
@@ -188,7 +196,11 @@ export enum GatewayIntentBits {
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
*/
GuildBans = GuildModeration,
GuildEmojisAndStickers = 1 << 3,
GuildExpressions = 1 << 3,
/**
* @deprecated This is the old name for {@apilink GatewayIntentBits#GuildExpressions}
*/
GuildEmojisAndStickers = GuildExpressions,
GuildIntegrations = 1 << 4,
GuildWebhooks = 1 << 5,
GuildInvites = 1 << 6,
@@ -212,10 +224,18 @@ export enum GatewayIntentBits {
*/
export enum GatewayDispatchEvents {
ApplicationCommandPermissionsUpdate = 'APPLICATION_COMMAND_PERMISSIONS_UPDATE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
ChannelCreate = 'CHANNEL_CREATE',
ChannelDelete = 'CHANNEL_DELETE',
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
ChannelUpdate = 'CHANNEL_UPDATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
GuildBanAdd = 'GUILD_BAN_ADD',
GuildBanRemove = 'GUILD_BAN_REMOVE',
GuildCreate = 'GUILD_CREATE',
@@ -229,6 +249,16 @@ export enum GatewayDispatchEvents {
GuildRoleCreate = 'GUILD_ROLE_CREATE',
GuildRoleDelete = 'GUILD_ROLE_DELETE',
GuildRoleUpdate = 'GUILD_ROLE_UPDATE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
GuildSoundboardSoundCreate = 'GUILD_SOUNDBOARD_SOUND_CREATE',
GuildSoundboardSoundDelete = 'GUILD_SOUNDBOARD_SOUND_DELETE',
GuildSoundboardSoundsUpdate = 'GUILD_SOUNDBOARD_SOUNDS_UPDATE',
GuildSoundboardSoundUpdate = 'GUILD_SOUNDBOARD_SOUND_UPDATE',
SoundboardSounds = 'SOUNDBOARD_SOUNDS',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
@@ -240,17 +270,22 @@ export enum GatewayDispatchEvents {
MessageCreate = 'MESSAGE_CREATE',
MessageDelete = 'MESSAGE_DELETE',
MessageDeleteBulk = 'MESSAGE_DELETE_BULK',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
MessageReactionAdd = 'MESSAGE_REACTION_ADD',
MessageReactionRemove = 'MESSAGE_REACTION_REMOVE',
MessageReactionRemoveAll = 'MESSAGE_REACTION_REMOVE_ALL',
MessageReactionRemoveEmoji = 'MESSAGE_REACTION_REMOVE_EMOJI',
MessageUpdate = 'MESSAGE_UPDATE',
PresenceUpdate = 'PRESENCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
StageInstanceCreate = 'STAGE_INSTANCE_CREATE',
StageInstanceDelete = 'STAGE_INSTANCE_DELETE',
StageInstanceUpdate = 'STAGE_INSTANCE_UPDATE',
Ready = 'READY',
Resumed = 'RESUMED',
SubscriptionCreate = 'SUBSCRIPTION_CREATE',
SubscriptionDelete = 'SUBSCRIPTION_DELETE',
SubscriptionUpdate = 'SUBSCRIPTION_UPDATE',
ThreadCreate = 'THREAD_CREATE',
ThreadDelete = 'THREAD_DELETE',
ThreadListSync = 'THREAD_LIST_SYNC',
@@ -259,30 +294,17 @@ export enum GatewayDispatchEvents {
ThreadUpdate = 'THREAD_UPDATE',
TypingStart = 'TYPING_START',
UserUpdate = 'USER_UPDATE',
VoiceChannelEffectSend = 'VOICE_CHANNEL_EFFECT_SEND',
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
WebhooksUpdate = 'WEBHOOKS_UPDATE',
MessagePollVoteAdd = 'MESSAGE_POLL_VOTE_ADD',
MessagePollVoteRemove = 'MESSAGE_POLL_VOTE_REMOVE',
GuildScheduledEventCreate = 'GUILD_SCHEDULED_EVENT_CREATE',
GuildScheduledEventUpdate = 'GUILD_SCHEDULED_EVENT_UPDATE',
GuildScheduledEventDelete = 'GUILD_SCHEDULED_EVENT_DELETE',
GuildScheduledEventUserAdd = 'GUILD_SCHEDULED_EVENT_USER_ADD',
GuildScheduledEventUserRemove = 'GUILD_SCHEDULED_EVENT_USER_REMOVE',
AutoModerationRuleCreate = 'AUTO_MODERATION_RULE_CREATE',
AutoModerationRuleUpdate = 'AUTO_MODERATION_RULE_UPDATE',
AutoModerationRuleDelete = 'AUTO_MODERATION_RULE_DELETE',
AutoModerationActionExecution = 'AUTO_MODERATION_ACTION_EXECUTION',
GuildAuditLogEntryCreate = 'GUILD_AUDIT_LOG_ENTRY_CREATE',
EntitlementCreate = 'ENTITLEMENT_CREATE',
EntitlementUpdate = 'ENTITLEMENT_UPDATE',
EntitlementDelete = 'ENTITLEMENT_DELETE',
}
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayRequestGuildMembers
| GatewayRequestSoundboardSounds
| GatewayResume
| GatewayUpdatePresence
| GatewayVoiceStateUpdate;
@@ -322,6 +344,10 @@ export type GatewayDispatchPayload =
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildSoundboardSoundCreateDispatch
| GatewayGuildSoundboardSoundDeleteDispatch
| GatewayGuildSoundboardSoundsUpdateDispatch
| GatewayGuildSoundboardSoundUpdateDispatch
| GatewayGuildStickersUpdateDispatch
| GatewayIntegrationCreateDispatch
| GatewayIntegrationDeleteDispatch
@@ -342,9 +368,11 @@ export type GatewayDispatchPayload =
| GatewayPresenceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewaySoundboardSoundsDispatch
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewaySubscriptionModifyDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
@@ -353,6 +381,7 @@ export type GatewayDispatchPayload =
| GatewayThreadUpdateDispatch
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceChannelEffectSendDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
@@ -613,6 +642,55 @@ export interface GatewayApplicationCommandPermissionsUpdateDispatchData {
permissions: APIApplicationCommandPermission[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatch = DataPayload<
| GatewayDispatchEvents.SubscriptionCreate
| GatewayDispatchEvents.SubscriptionDelete
| GatewayDispatchEvents.SubscriptionUpdate,
GatewaySubscriptionModifyDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionModifyDispatchData = APISubscription;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatch = GatewaySubscriptionModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-create
*/
export type GatewaySubscriptionCreateDispatchData = GatewaySubscriptionModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatch = GatewaySubscriptionModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-update
*/
export type GatewaySubscriptionUpdateDispatchData = GatewaySubscriptionModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatch = GatewaySubscriptionModifyDispatch;
/**
* https://discord.com/developers/docs/topics/gateway-events#subscription-delete
*/
export type GatewaySubscriptionDeleteDispatchData = GatewaySubscriptionModifyDispatchData;
/**
* https://discord.com/developers/docs/topics/gateway-events#channel-create
* https://discord.com/developers/docs/topics/gateway-events#channel-update
@@ -628,7 +706,10 @@ export type GatewayChannelModifyDispatch = DataPayload<
* https://discord.com/developers/docs/topics/gateway-events#channel-update
* https://discord.com/developers/docs/topics/gateway-events#channel-delete
*/
export type GatewayChannelModifyDispatchData = APIChannel;
export type GatewayChannelModifyDispatchData = APIChannel & {
type: Exclude<GuildChannelType, ThreadChannelType>;
guild_id: Snowflake;
};
/**
* https://discord.com/developers/docs/topics/gateway-events#channel-create
@@ -708,7 +789,9 @@ export type GatewayEntitlementModifyDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
*/
export type GatewayEntitlementCreateDispatchData = GatewayEntitlementModifyDispatchData;
export type GatewayEntitlementCreateDispatchData = Omit<GatewayEntitlementModifyDispatchData, 'ends_at'> & {
ends_at: GatewayEntitlementModifyDispatchData['ends_at'] | null;
};
/**
* https://discord.com/developers/docs/topics/gateway-events#entitlement-create
@@ -784,7 +867,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* See https://discord.com/developers/docs/resources/voice#voice-state-object
*/
voice_states: Omit<GatewayVoiceState, 'guild_id'>[];
voice_states: Omit<APIVoiceState, 'guild_id'>[];
/**
* Users in the guild
*
@@ -800,7 +883,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
channels: APIChannel[];
channels: (APIChannel & { type: Exclude<GuildChannelType, ThreadChannelType> })[];
/**
* Threads in the guild
*
@@ -808,7 +891,7 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* See https://discord.com/developers/docs/resources/channel#channel-object
*/
threads: APIChannel[];
threads: (APIChannel & { type: ThreadChannelType })[];
/**
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
*
@@ -830,9 +913,17 @@ export interface GatewayGuildCreateDispatchData extends APIGuild {
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
* See https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
*/
guild_scheduled_events: APIGuildScheduledEvent[];
/**
* The soundboard sounds in the guild
*
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway-events#guild-create) event**
*
* See https://discord.com/developers/docs/resources/soundboard#soundboard-sound-object
*/
soundboard_sounds: APISoundboardSound[];
}
/**
@@ -853,7 +944,14 @@ export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.Guild
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-delete
*/
export type GatewayGuildDeleteDispatchData = APIUnavailableGuild;
export interface GatewayGuildDeleteDispatchData extends Omit<APIUnavailableGuild, 'unavailable'> {
/**
* `true` if this guild is unavailable due to an outage
*
* If the field is not set, the user was removed from the guild.
*/
unavailable?: true;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-ban-add
@@ -1021,9 +1119,9 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
* https://discord.com/developers/docs/topics/gateway-events#guild-member-update
*/
export type GatewayGuildMemberUpdateDispatchData = Nullable<Pick<APIGuildMember, 'joined_at'>> &
Omit<APIGuildMember, 'deaf' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'mute'>> &
Required<Pick<APIGuildMember, 'user'>> & {
Omit<APIGuildMember, 'deaf' | 'flags' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'flags' | 'mute'>> &
Required<Pick<APIGuildMember, 'avatar' | 'banner' | 'user'>> & {
/**
* The id of the guild
*/
@@ -1151,49 +1249,171 @@ export interface GatewayGuildRoleDeleteDispatchData {
role_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create
*/
export type GatewayGuildScheduledEventCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventCreate,
GatewayGuildScheduledEventCreateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-create
*/
export type GatewayGuildScheduledEventCreateDispatchData = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update
*/
export type GatewayGuildScheduledEventUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUpdate,
GatewayGuildScheduledEventUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-update
*/
export type GatewayGuildScheduledEventUpdateDispatchData = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete
*/
export type GatewayGuildScheduledEventDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventDelete,
GatewayGuildScheduledEventDeleteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-delete
*/
export type GatewayGuildScheduledEventDeleteDispatchData = APIGuildScheduledEvent;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add
*/
export type GatewayGuildScheduledEventUserAddDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUserAdd,
GatewayGuildScheduledEventUserAddDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-add
*/
export interface GatewayGuildScheduledEventUserAddDispatchData {
guild_scheduled_event_id: Snowflake;
user_id: Snowflake;
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove
*/
export type GatewayGuildScheduledEventUserRemoveDispatch = DataPayload<
GatewayDispatchEvents.GuildScheduledEventUserRemove,
GatewayGuildScheduledEventUserAddDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-scheduled-event-user-remove
*/
export interface GatewayGuildScheduledEventUserRemoveDispatchData {
guild_scheduled_event_id: Snowflake;
user_id: Snowflake;
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundCreate,
GatewayGuildSoundboardSoundCreateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-create
*/
export type GatewayGuildSoundboardSoundCreateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundUpdate,
GatewayGuildSoundboardSoundUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-update
*/
export type GatewayGuildSoundboardSoundUpdateDispatchData = APISoundboardSound;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export type GatewayGuildSoundboardSoundDeleteDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundDelete,
GatewayGuildSoundboardSoundDeleteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sound-delete
*/
export interface GatewayGuildSoundboardSoundDeleteDispatchData {
/**
* The id of the sound that was deleted
*/
sound_id: Snowflake;
/**
* The id of the guild the sound was in
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export type GatewayGuildSoundboardSoundsUpdateDispatch = DataPayload<
GatewayDispatchEvents.GuildSoundboardSoundsUpdate,
GatewayGuildSoundboardSoundsUpdateDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-soundboard-sounds-update
*/
export interface GatewayGuildSoundboardSoundsUpdateDispatchData {
/**
* The guild's soundboard sounds
*/
soundboard_sounds: APISoundboardSound[];
/**
* The id of the guild
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export type GatewaySoundboardSoundsDispatch = DataPayload<
GatewayDispatchEvents.SoundboardSounds,
GatewaySoundboardSoundsDispatchData
>;
/**
* https://discord.com/developers/docs/events/gateway-events#soundboard-sounds
*/
export interface GatewaySoundboardSoundsDispatchData {
/**
* The guild's soundboard sounds
*/
soundboard_sounds: APISoundboardSound[];
/**
* The id of the guild
*/
guild_id: Snowflake;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#integration-create
*/
@@ -1381,18 +1601,11 @@ export type GatewayMessageUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#message-update
*/
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields &
Omit<Partial<APIMessage>, 'mentions'> & {
/**
* ID of the message
*/
id: Snowflake;
/**
* ID of the channel the message was sent in
*/
channel_id: Snowflake;
};
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-create-message-create-extra-fields
*/
export interface GatewayMessageEventExtraFields {
/**
* ID of the guild the message was sent in
@@ -1627,7 +1840,7 @@ export type GatewayThreadMemberUpdateDispatchData = APIThreadMember & { guild_id
*/
export type GatewayThreadModifyDispatch = DataPayload<
GatewayDispatchEvents.ThreadCreate | GatewayDispatchEvents.ThreadDelete | GatewayDispatchEvents.ThreadUpdate,
GatewayChannelModifyDispatchData
APIThreadChannel
>;
/**
@@ -1736,6 +1949,66 @@ export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUp
*/
export type GatewayUserUpdateDispatchData = APIUser;
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send
*/
export type GatewayVoiceChannelEffectSendDispatch = DataPayload<
GatewayDispatchEvents.VoiceChannelEffectSend,
GatewayVoiceChannelEffectSendDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send
*/
export interface GatewayVoiceChannelEffectSendDispatchData {
/**
* ID of the channel the effect was sent in
*/
channel_id: Snowflake;
/**
* ID of the guild the effect was sent in
*/
guild_id: Snowflake;
/**
* ID of the user who sent the effect
*/
user_id: Snowflake;
/**
* The emoji sent, for emoji reaction and soundboard effects
*/
emoji?: APIEmoji | null;
/**
* The type of emoji animation, for emoji reaction and soundboard effects
*/
animation_type?: VoiceChannelEffectSendAnimationType | null;
/**
* The ID of the emoji animation, for emoji reaction and soundboard effects
*/
animation_id?: number;
/**
* The ID of the soundboard sound, for soundboard effects
*/
sound_id?: Snowflake | number;
/**
* The volume of the soundboard sound, from 0 to 1, for soundboard effects
*/
sound_volume?: number;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-channel-effect-send-animation-types
*/
export enum VoiceChannelEffectSendAnimationType {
/**
* A fun animation, sent by a Nitro subscriber
*/
Premium,
/**
* The standard animation
*/
Basic,
}
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
*/
@@ -1747,7 +2020,7 @@ export type GatewayVoiceStateUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-state-update
*/
export type GatewayVoiceStateUpdateDispatchData = GatewayVoiceState;
export type GatewayVoiceStateUpdateDispatchData = APIVoiceState;
/**
* https://discord.com/developers/docs/topics/gateway-events#voice-server-update
@@ -1835,6 +2108,10 @@ export type GatewayMessagePollVoteRemoveDispatch = DataPayload<
GatewayMessagePollVoteDispatchData
>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-add
* https://discord.com/developers/docs/topics/gateway-events#message-poll-vote-remove
*/
export interface GatewayMessagePollVoteDispatchData {
/**
* ID of the user
@@ -1982,6 +2259,9 @@ export interface GatewayRequestGuildMembers {
d: GatewayRequestGuildMembersData;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export interface GatewayRequestGuildMembersDataBase {
/**
* ID of the guild to get members for
@@ -2001,6 +2281,9 @@ export interface GatewayRequestGuildMembersDataBase {
nonce?: string;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayRequestGuildMembersDataBase {
/**
* Used to specify which users you wish to fetch
@@ -2008,6 +2291,9 @@ export interface GatewayRequestGuildMembersDataWithUserIds extends GatewayReques
user_ids: Snowflake | Snowflake[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestGuildMembersDataBase {
/**
* String that username starts with, or an empty string to return all members
@@ -2027,6 +2313,24 @@ export type GatewayRequestGuildMembersData =
| GatewayRequestGuildMembersDataWithQuery
| GatewayRequestGuildMembersDataWithUserIds;
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSounds {
op: GatewayOpcodes.RequestSoundboardSounds;
d: GatewayRequestSoundboardSoundsData;
}
/**
* https://discord.com/developers/docs/topics/gateway-events#request-soundboard-sounds
*/
export interface GatewayRequestSoundboardSoundsData {
/**
* The ids of the guilds to get soundboard sounds for
*/
guild_ids: Snowflake[];
}
/**
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
*/

View File

@@ -93,6 +93,18 @@ export const FormattingPatterns = {
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
*/
StyledTimestamp: /<t:(?<timestamp>-?\d{1,13}):(?<style>[DFRTdft])>/,
/**
* Regular expression for matching a guild navigation mention
*
* The `type` group property is present on the `exec` result of this expression
*/
GuildNavigation: /<id:(?<type>customize|browse|guide|linked-roles)>/,
/**
* Regular expression for matching a linked role mention
*
* The `id` group property is present on the `exec` result of this expression
*/
LinkedRole: /<id:linked-roles:(?<id>\d{17,20})>/,
} as const;
/**

5335
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "discord-api-types",
"version": "0.37.89",
"version": "0.37.115",
"description": "Discord API typings that are kept up to date for use in bot library creation.",
"homepage": "https://discord-api-types.dev",
"exports": {
@@ -112,9 +112,7 @@
"prepare": "tsc -p ./.eslint-plugin-local && (is-ci || husky)",
"prepublishOnly": "run-s clean test:lint build:node",
"test:lint": "prettier --check . && eslint --ext mjs,ts \"{gateway,payloads,rest,rpc,voice,utils}/**/*.ts\" \"{globals,v*}.ts\" \"scripts/**/*.mjs\"",
"pretest:types": "tsc",
"test:types": "tsd -t ./v10.d.ts",
"posttest:types": "npm run clean:node"
"test:types": "tsc -p tests"
},
"keywords": [
"discord",
@@ -122,7 +120,7 @@
"types",
"discordjs"
],
"author": "Vlad Frangu <kingdgrizzle@gmail.com>",
"author": "Vlad Frangu <me@vladfrangu.dev>",
"license": "MIT",
"files": [
"{gateway,payloads,rest,rpc,voice,utils}/**/*.{js,js.map,d.ts,d.ts.map,mjs}",
@@ -131,30 +129,29 @@
"devDependencies": {
"@commitlint/cli": "^19.0.3",
"@commitlint/config-angular": "^19.0.3",
"@favware/npm-deprecate": "^1.0.7",
"@favware/npm-deprecate": "^2.0.0",
"@octokit/action": "^7.0.0",
"@octokit/webhooks-types": "^7.3.2",
"@sapphire/prettier-config": "^2.0.0",
"@types/conventional-recommended-bump": "^9.0.3",
"@types/node": "^20.11.24",
"@typescript-eslint/utils": "^7.1.1",
"@types/node": "^22.0.0",
"@typescript-eslint/utils": "^8.0.0",
"conventional-changelog-cli": "^4.1.0",
"conventional-recommended-bump": "^9.0.0",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.59",
"eslint-import-resolver-typescript": "^3.6.1",
"eslint-plugin-local": "^4.2.1",
"eslint-plugin-local": "^6.0.0",
"gen-esm-wrapper": "^1.1.3",
"husky": "^9.0.11",
"is-ci": "^3.0.1",
"is-ci": "^4.0.0",
"lint-staged": "^15.2.2",
"npm-run-all2": "^6.0.0",
"npm-run-all2": "^7.0.0",
"prettier": "^3.2.5",
"pretty-quick": "^4.0.0",
"rimraf": "^5.0.5",
"tsd": "^0.31.0",
"rimraf": "^6.0.0",
"tsutils": "^3.21.0",
"typescript": "^5.3.3"
"typescript": "^5.6.3"
},
"publishConfig": {
"provenance": true
@@ -197,8 +194,5 @@
"pascal-case"
]
}
},
"tsd": {
"directory": "tests"
}
}

View File

@@ -1,4 +1,4 @@
import type { LocaleString } from '../rest/common';
import type { Locale } from '../rest/common';
/**
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
@@ -297,7 +297,7 @@ export const PermissionFlagsBits = {
*/
Object.freeze(PermissionFlagsBits);
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
export type LocalizationMap = Partial<Record<Locale, string | null>>;
/**
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json

View File

@@ -0,0 +1,26 @@
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base';
import type { APIBaseApplicationCommandInteractionData } from './internals';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIPrimaryEntryPointCommandInteractionData =
APIBaseApplicationCommandInteractionData<ApplicationCommandType.PrimaryEntryPoint>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIPrimaryEntryPointCommandInteraction =
APIApplicationCommandInteractionWrapper<APIPrimaryEntryPointCommandInteractionData>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIPrimaryEntryPointCommandDMInteraction = APIDMInteractionWrapper<APIPrimaryEntryPointCommandInteraction>;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIPrimaryEntryPointCommandGuildInteraction =
APIGuildInteractionWrapper<APIPrimaryEntryPointCommandInteraction>;

View File

@@ -13,12 +13,19 @@ import type {
APIContextMenuInteraction,
APIContextMenuInteractionData,
} from './_applicationCommands/contextMenu';
import type {
APIPrimaryEntryPointCommandDMInteraction,
APIPrimaryEntryPointCommandGuildInteraction,
APIPrimaryEntryPointCommandInteraction,
APIPrimaryEntryPointCommandInteractionData,
} from './_applicationCommands/entryPoint';
import type { APIBaseInteraction } from './base';
import type { InteractionType } from './responses';
export * from './_applicationCommands/chatInput';
export * from './_applicationCommands/contextMenu';
export * from './_applicationCommands/permissions';
export * from './_applicationCommands/entryPoint';
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object
@@ -92,29 +99,45 @@ export interface APIApplicationCommand {
nsfw?: boolean;
/**
* Installation context(s) where the command is available, only for globally-scoped commands. Defaults to `GUILD_INSTALL ([0])`
*
* @unstable
*/
integration_types?: ApplicationIntegrationType[];
/**
* Interaction context(s) where the command can be used, only for globally-scoped commands. By default, all interaction context types included for new commands `[0,1,2]`.
*
* @unstable
*/
contexts?: InteractionContextType[] | null;
/**
* Autoincrementing version identifier updated during substantial record changes
*/
version: Snowflake;
/**
* Determines whether the interaction is handled by the app's interactions handler or by Discord
*
* @remarks
* This is only available for {@link ApplicationCommandType.PrimaryEntryPoint} commands
*/
handler?: EntryPointCommandHandlerType;
}
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types
*/
export enum ApplicationCommandType {
/**
* Slash commands; a text-based command that shows up when a user types `/`
*/
ChatInput = 1,
/**
* A UI-based command that shows up when you right click or tap on a user
*/
User,
/**
* A UI-based command that shows up when you right click or tap on a message
*/
Message,
/**
* A UI-based command that represents the primary way to invoke an app's Activity
*/
PrimaryEntryPoint,
}
/**
@@ -124,11 +147,11 @@ export enum ApplicationIntegrationType {
/**
* App is installable to servers
*/
GuildInstall = 0,
GuildInstall,
/**
* App is installable to users
*/
UserInstall = 1,
UserInstall,
}
/**
@@ -138,15 +161,30 @@ export enum InteractionContextType {
/**
* Interaction can be used within servers
*/
Guild = 0,
Guild,
/**
* Interaction can be used within DMs with the app's bot user
*/
BotDM = 1,
BotDM,
/**
* Interaction can be used within Group DMs and DMs other than the app's bot user
*/
PrivateChannel = 2,
PrivateChannel,
}
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-entry-point-command-handler-types
*/
export enum EntryPointCommandHandlerType {
/**
* The app handles the interaction using an interaction token
*/
AppHandler = 1,
/**
* Discord handles the interaction by launching an Activity and sending a follow-up message without coordinating with
* the app
*/
DiscordLaunchActivity,
}
/**
@@ -154,7 +192,8 @@ export enum InteractionContextType {
*/
export type APIApplicationCommandInteractionData =
| APIChatInputApplicationCommandInteractionData
| APIContextMenuInteractionData;
| APIContextMenuInteractionData
| APIPrimaryEntryPointCommandInteractionData;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
@@ -171,18 +210,23 @@ export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationC
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandInteraction = APIChatInputApplicationCommandInteraction | APIContextMenuInteraction;
export type APIApplicationCommandInteraction =
| APIChatInputApplicationCommandInteraction
| APIContextMenuInteraction
| APIPrimaryEntryPointCommandInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandDMInteraction =
| APIChatInputApplicationCommandDMInteraction
| APIContextMenuDMInteraction;
| APIContextMenuDMInteraction
| APIPrimaryEntryPointCommandDMInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIApplicationCommandGuildInteraction =
| APIChatInputApplicationCommandGuildInteraction
| APIContextMenuGuildInteraction;
| APIContextMenuGuildInteraction
| APIPrimaryEntryPointCommandGuildInteraction;

View File

@@ -1,5 +1,5 @@
import type { Permissions, Snowflake } from '../../../globals';
import type { APIRole, ApplicationIntegrationType, InteractionContextType, LocaleString } from '../../../v10';
import type { APIRole, ApplicationIntegrationType, InteractionContextType, Locale } from '../../../v10';
import type {
APIAttachment,
APIChannel,
@@ -9,7 +9,7 @@ import type {
ChannelType,
ThreadChannelType,
} from '../channel';
import type { APIGuildMember } from '../guild';
import type { APIGuildMember, APIPartialInteractionGuild } from '../guild';
import type { APIEntitlement } from '../monetization';
import type { APIUser } from '../user';
import type { InteractionType } from './responses';
@@ -17,7 +17,12 @@ import type { InteractionType } from './responses';
/**
* https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object
*/
export interface APIMessageInteractionMetadata {
export type APIMessageInteractionMetadata =
| APIApplicationCommandInteractionMetadata
| APIMessageComponentInteractionMetadata
| APIModalSubmitInteractionMetadata;
interface APIBaseInteractionMetadata<Type extends InteractionType> {
/**
* ID of the interaction
*/
@@ -25,27 +30,56 @@ export interface APIMessageInteractionMetadata {
/**
* Type of interaction
*/
type: InteractionType;
type: Type;
/**
* User who triggered the interaction
*/
user: APIUser;
/**
* IDs for installation context(s) related to an interaction. Details in Authorizing Integration Owners Object
* IDs for installation context(s) related to an interaction
*/
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
/**
* ID of the original response message, present only on follow-up messages
*/
original_response_message_id?: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-application-command-interaction-metadata-structure
*/
export interface APIApplicationCommandInteractionMetadata
extends APIBaseInteractionMetadata<InteractionType.ApplicationCommand> {
/**
* ID of the message that contained interactive component, present only on messages created from component interactions
* The user the command was run on, present only on user commands interactions
*/
interacted_message_id?: Snowflake;
target_user?: APIUser;
/**
* Metadata for the interaction that was used to open the modal, present only on modal submit interactions
* The ID of the message the command was run on, present only on message command interactions.
* The original response message will also have `message_reference` and `referenced_message` pointing to this message.
*/
triggering_interaction_metadata?: APIMessageInteractionMetadata;
target_message_id?: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-message-command-interaction-metadata-structure
*/
export interface APIMessageComponentInteractionMetadata
extends APIBaseInteractionMetadata<InteractionType.MessageComponent> {
/**
* ID of the message that contained the interactive component
*/
interacted_message_id: Snowflake;
}
/**
* https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-modal-submit-interaction-metadata-structure
*/
export interface APIModalSubmitInteractionMetadata extends APIBaseInteractionMetadata<InteractionType.ModalSubmit> {
/**
* Metadata for the interaction that was used to open the modal
*/
triggering_interaction_metadata: APIApplicationCommandInteractionMetadata | APIMessageComponentInteractionMetadata;
}
export type PartialAPIMessageInteractionGuildMember = Pick<
@@ -118,7 +152,11 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
*/
data?: Data;
/**
* The guild it was sent from
* Guild that the interaction was sent from
*/
guild?: APIPartialInteractionGuild;
/**
* Guild that the interaction was sent from
*/
guild_id?: Snowflake;
/**
@@ -160,11 +198,11 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
/**
* The selected language of the invoking user
*/
locale: LocaleString;
locale: Locale;
/**
* The guild's preferred locale, if invoked in a guild
*/
guild_locale?: LocaleString;
guild_locale?: Locale;
/**
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
*/

View File

@@ -22,6 +22,7 @@ export type APIInteractionResponse =
| APIInteractionResponseChannelMessageWithSource
| APIInteractionResponseDeferredChannelMessageWithSource
| APIInteractionResponseDeferredMessageUpdate
| APIInteractionResponseLaunchActivity
| APIInteractionResponsePong
| APIInteractionResponseUpdateMessage
| APIModalInteractionResponse
@@ -64,6 +65,10 @@ export interface APIInteractionResponseUpdateMessage {
data?: APIInteractionResponseCallbackData;
}
export interface APIInteractionResponseLaunchActivity {
type: InteractionResponseType.LaunchActivity;
}
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type
*/
@@ -98,8 +103,18 @@ export enum InteractionResponseType {
Modal,
/**
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
*
* @deprecated See https://discord.com/developers/docs/change-log#premium-apps-new-premium-button-style-deep-linking-url-schemes
*/
PremiumRequired,
/**
* Launch the Activity associated with the app.
*
* @remarks
* Only available for apps with Activities enabled
*/
LaunchActivity = 12,
}
/**

View File

@@ -9,6 +9,7 @@ import type { ApplicationIntegrationType } from './interactions';
import type { OAuth2Scopes } from './oauth2';
import type { APITeam } from './teams';
import type { APIUser } from './user';
import type { ApplicationWebhookEventType } from './webhook';
/**
* https://discord.com/developers/docs/resources/application#application-object
@@ -64,6 +65,7 @@ export interface APIApplication {
* An empty string
*
* @deprecated This field will be removed in v11
* @unstable This field is no longer documented by Discord and will be removed in v11
*/
summary: '';
/**
@@ -108,6 +110,10 @@ export interface APIApplication {
* Approximate count of guilds the application has been added to
*/
approximate_guild_count?: number;
/**
* Approximate count of users that have installed the app
*/
approximate_user_install_count?: number;
/**
* Array of redirect URIs for the application
*/
@@ -115,12 +121,12 @@ export interface APIApplication {
/**
* The interactions endpoint URL for the application
*/
interactions_endpoint_url?: string;
interactions_endpoint_url?: string | null;
/**
* 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;
role_connections_verification_url?: string | null;
/**
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
*/
@@ -131,14 +137,24 @@ export interface APIApplication {
install_params?: APIApplicationInstallParams;
/**
* Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object
*
* @unstable
*/
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
/**
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
/**
* Event webhook URL for the app to receive webhook events
*/
event_webhooks_url?: string | null;
/**
* If webhook events are enabled for the app
*/
event_webhooks_status: ApplicationWebhookEventStatus;
/**
* List of webhook event types the app subscribes to
*/
event_webhooks_types?: ApplicationWebhookEventType[];
}
export interface APIApplicationInstallParams {
@@ -294,3 +310,21 @@ export enum ApplicationRoleConnectionMetadataType {
*/
BooleanNotEqual,
}
/**
* https://discord.com/developers/docs/resources/application#application-object-application-event-webhook-status
*/
export enum ApplicationWebhookEventStatus {
/**
* Webhook events are disabled by developer
*/
Disabled = 1,
/**
* Webhook events are enabled by developer
*/
Enabled,
/**
* Webhook events are disabled by Discord, usually due to inactivity
*/
DisabledByDiscord,
}

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