Compare commits

...

44 Commits

Author SHA1 Message Date
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
104 changed files with 5002 additions and 1456 deletions

View File

@@ -35,6 +35,9 @@
"RESTAPIGuildCreateRole",
"RESTAPIGuildOnboardingPrompt",
"RESTAPIGuildOnboardingPromptOption",
"RESTAPIInteractionCallbackActivityInstanceResource",
"RESTAPIInteractionCallbackObject",
"RESTAPIInteractionCallbackResourceObject",
"RESTAPIMessageReference",
"RESTAPIPartialCurrentUserGuild",
"RESTAPIPoll",

View File

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

View File

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

View File

@@ -35,6 +35,8 @@ import type {
APIAuditLogEntry,
APIEntitlement,
ChannelType,
APISubscription,
APISoundboardSound,
} from '../payloads/v10/mod.ts';
import type { ReactionType } from '../rest/v10/mod.ts';
import type { Nullable } from '../utils/internals.ts';
@@ -92,6 +94,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,
}
/**
@@ -213,10 +219,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 +244,15 @@ 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',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
@@ -241,17 +264,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 +288,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 +338,10 @@ export type GatewayDispatchPayload =
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildSoundboardSoundCreateDispatch
| GatewayGuildSoundboardSoundDeleteDispatch
| GatewayGuildSoundboardSoundsUpdateDispatch
| GatewayGuildSoundboardSoundUpdateDispatch
| GatewayGuildStickersUpdateDispatch
| GatewayIntegrationCreateDispatch
| GatewayIntegrationDeleteDispatch
@@ -346,6 +365,7 @@ export type GatewayDispatchPayload =
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewaySubscriptionModifyDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
@@ -354,6 +374,7 @@ export type GatewayDispatchPayload =
| GatewayThreadUpdateDispatch
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceChannelEffectSendDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
@@ -614,6 +635,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
@@ -709,7 +779,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 +809,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>;
@@ -854,7 +926,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
@@ -1152,49 +1231,149 @@ 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/topics/gateway-events#integration-create
*/
@@ -1394,6 +1573,9 @@ export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields &
channel_id: Snowflake;
};
/**
* 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
@@ -1737,6 +1919,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
*/
@@ -1836,6 +2078,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 +2229,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 +2251,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 +2261,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 +2283,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

@@ -34,6 +34,8 @@ import type {
AutoModerationRuleTriggerType,
APIAuditLogEntry,
ChannelType,
APISubscription,
APISoundboardSound,
} from '../payloads/v9/mod.ts';
import type { ReactionType } from '../rest/v9/mod.ts';
import type { Nullable } from '../utils/internals.ts';
@@ -92,6 +94,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,
}
/**
@@ -212,10 +218,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 +243,15 @@ 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',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
@@ -240,17 +263,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 +287,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 +337,10 @@ export type GatewayDispatchPayload =
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildSoundboardSoundCreateDispatch
| GatewayGuildSoundboardSoundDeleteDispatch
| GatewayGuildSoundboardSoundsUpdateDispatch
| GatewayGuildSoundboardSoundUpdateDispatch
| GatewayGuildStickersUpdateDispatch
| GatewayIntegrationCreateDispatch
| GatewayIntegrationDeleteDispatch
@@ -345,6 +364,7 @@ export type GatewayDispatchPayload =
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewaySubscriptionModifyDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
@@ -353,6 +373,7 @@ export type GatewayDispatchPayload =
| GatewayThreadUpdateDispatch
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceChannelEffectSendDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
@@ -613,6 +634,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
@@ -708,7 +778,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
@@ -853,7 +925,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
@@ -1151,49 +1230,149 @@ 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/topics/gateway-events#integration-create
*/
@@ -1393,6 +1572,9 @@ export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields &
channel_id: Snowflake;
};
/**
* 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
@@ -1736,6 +1918,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
*/
@@ -1835,6 +2077,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 +2228,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 +2250,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 +2260,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 +2282,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

@@ -92,29 +92,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 +140,11 @@ export enum ApplicationIntegrationType {
/**
* App is installable to servers
*/
GuildInstall = 0,
GuildInstall,
/**
* App is installable to users
*/
UserInstall = 1,
UserInstall,
}
/**
@@ -138,15 +154,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,
}
/**

View File

@@ -102,6 +102,14 @@ export enum InteractionResponseType {
* @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

@@ -64,6 +64,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: '';
/**
@@ -119,12 +120,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
*/
@@ -135,8 +136,6 @@ 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;
/**

View File

@@ -23,6 +23,7 @@ import type {
} from './guild.ts';
import type {
APIGuildScheduledEvent,
APIGuildScheduledEventRecurrenceRule,
GuildScheduledEventEntityType,
GuildScheduledEventStatus,
} from './guildScheduledEvent.ts';
@@ -408,6 +409,7 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyPublicUpdatesChannelId
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyRecurrenceRule
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyRulesChannelId
| APIAuditLogChangeKeySplashHash
@@ -607,6 +609,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
*/

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;
/**
@@ -790,6 +788,10 @@ export enum MessageType {
GuildIncidentAlertModeDisabled,
GuildIncidentReportRaid,
GuildIncidentReportFalseAlarm,
PurchaseNotification = 44,
PollResult = 46,
}
/**
@@ -849,11 +851,11 @@ export enum MessageReferenceType {
/**
* A standard reference used by replies
*/
Default = 0,
Default,
/**
* Reference used to point to a message at a point in time
*/
Forward = 1,
Forward,
}
/**
@@ -1266,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',
}
/**
@@ -1415,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 {
/**
@@ -1916,6 +1922,13 @@ export interface APIMessageSnapshot {
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;
}
@@ -1982,12 +1995,15 @@ 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

@@ -534,6 +534,10 @@ export enum GuildFeature {
* Guild has enabled the welcome screen
*/
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
}
/**
@@ -689,7 +693,7 @@ export enum GuildMemberFlags {
*/
CompletedOnboarding = 1 << 1,
/**
* Member bypasses guild verification requirements
* Member is exempt from guild verification requirements
*/
BypassesVerification = 1 << 2,
/**
@@ -697,21 +701,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

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

@@ -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,63 @@ 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[];
/**
* 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

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

@@ -273,6 +273,7 @@ export interface APIConnection {
}
export enum ConnectionService {
AmazonMusic = 'amazon-music',
BattleNet = 'battlenet',
BungieNet = 'bungie',
Domain = 'domain',

View File

@@ -92,29 +92,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 +140,11 @@ export enum ApplicationIntegrationType {
/**
* App is installable to servers
*/
GuildInstall = 0,
GuildInstall,
/**
* App is installable to users
*/
UserInstall = 1,
UserInstall,
}
/**
@@ -138,15 +154,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,
}
/**

View File

@@ -102,6 +102,14 @@ export enum InteractionResponseType {
* @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

@@ -64,6 +64,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: '';
/**
@@ -119,12 +120,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
*/
@@ -135,8 +136,6 @@ 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;
/**

View File

@@ -23,6 +23,7 @@ import type {
} from './guild.ts';
import type {
APIGuildScheduledEvent,
APIGuildScheduledEventRecurrenceRule,
GuildScheduledEventEntityType,
GuildScheduledEventStatus,
} from './guildScheduledEvent.ts';
@@ -408,6 +409,7 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyPublicUpdatesChannelId
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyRecurrenceRule
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyRulesChannelId
| APIAuditLogChangeKeySplashHash
@@ -607,6 +609,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
*/

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;
/**
@@ -775,6 +773,10 @@ export enum MessageType {
GuildIncidentAlertModeDisabled,
GuildIncidentReportRaid,
GuildIncidentReportFalseAlarm,
PurchaseNotification = 44,
PollResult = 46,
}
/**
@@ -834,11 +836,11 @@ export enum MessageReferenceType {
/**
* A standard reference used by replies
*/
Default = 0,
Default,
/**
* Reference used to point to a message at a point in time
*/
Forward = 1,
Forward,
}
/**
@@ -1233,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',
}
/**
@@ -1382,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 {
/**
@@ -1883,6 +1889,13 @@ export interface APIMessageSnapshot {
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;
}
@@ -1949,12 +1962,15 @@ 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

@@ -526,6 +526,10 @@ export enum GuildFeature {
* Guild has enabled the welcome screen
*/
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
}
/**
@@ -681,7 +685,7 @@ export enum GuildMemberFlags {
*/
CompletedOnboarding = 1 << 1,
/**
* Member bypasses guild verification requirements
* Member is exempt from guild verification requirements
*/
BypassesVerification = 1 << 2,
/**
@@ -689,21 +693,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

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

@@ -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,63 @@ 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[];
/**
* 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

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

@@ -273,6 +273,7 @@ export interface APIConnection {
}
export enum ConnectionService {
AmazonMusic = 'amazon-music',
BattleNet = 'battlenet',
BungieNet = 'bungie',
Domain = 'domain',

View File

@@ -22,6 +22,7 @@ export enum RESTJSONErrorCodes {
UnknownWebhookService,
UnknownSession = 10_020,
UnknownAsset,
UnknownBan = 10_026,
UnknownSKU,
@@ -138,6 +139,9 @@ export enum RESTJSONErrorCodes {
ConnectionHasBeenRevoked = 40_012,
OnlyConsumableSKUsCanBeConsumed = 40_018,
YouCanOnlyDeleteSandboxEntitlements,
TargetUserIsNotConnectedToVoice = 40_032,
ThisMessageWasAlreadyCrossposted,
@@ -156,6 +160,8 @@ export enum RESTJSONErrorCodes {
AnEntitlementHasAlreadyBeenGrantedForThisResource = 40_074,
ThisInteractionHasHitTheMaximumNumberOfFollowUpMessages = 40_094,
CloudflareIsBlockingYourRequest = 40_333,
MissingAccess = 50_001,
@@ -229,6 +235,9 @@ export enum RESTJSONErrorCodes {
ServerNeedsMoreBoostsToPerformThisAction = 50_101,
RequestBodyContainsInvalidJSON = 50_109,
ProvidedFileIsInvalid,
ProvidedFileDurationExceedsMaximumLength = 50_124,
OwnerCannotBePendingMember = 50_131,
OwnershipCannotBeMovedToABotUser,

View File

@@ -24,6 +24,7 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} from '../../payloads/v10/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
import type { RESTAPIPoll } from './poll.ts';
@@ -260,22 +261,16 @@ export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesO
export type APIMessageReferenceSend = RESTAPIMessageReference;
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface RESTAPIAttachment {
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
@@ -461,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

@@ -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,
@@ -171,6 +175,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 +197,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

@@ -11,15 +11,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';
@@ -999,6 +1000,57 @@ export const Routes = {
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;
},
};
export const StickerPackApplicationId = '710982414301790216';
@@ -1288,6 +1340,14 @@ 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;
},
};
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;

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 {
/**
@@ -39,12 +39,12 @@ export interface RESTGetAPIEntitlementsQuery {
}
/**
* 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#create-test-entitlement
*/
export interface RESTPostAPIEntitlementJSONBody {
/**
@@ -67,12 +67,12 @@ export interface RESTPostAPIEntitlementJSONBody {
export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody;
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
* 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,
@@ -80,16 +80,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

@@ -134,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
*
@@ -163,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
*/

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

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

@@ -24,6 +24,7 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} from '../../payloads/v9/mod.ts';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals.ts';
import type { RESTAPIPoll } from './poll.ts';
@@ -260,22 +261,16 @@ export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesO
export type APIMessageReferenceSend = RESTAPIMessageReference;
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface RESTAPIAttachment {
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
@@ -477,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

@@ -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,
@@ -171,6 +175,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 +197,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

@@ -11,15 +11,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';
@@ -1008,6 +1009,57 @@ export const Routes = {
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;
},
};
export const StickerPackApplicationId = '710982414301790216';
@@ -1297,6 +1349,14 @@ 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;
},
};
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;

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 {
/**
@@ -39,12 +39,12 @@ export interface RESTGetAPIEntitlementsQuery {
}
/**
* 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#create-test-entitlement
*/
export interface RESTPostAPIEntitlementJSONBody {
/**
@@ -67,12 +67,12 @@ export interface RESTPostAPIEntitlementJSONBody {
export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody;
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
* 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,
@@ -80,16 +80,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

@@ -134,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
*
@@ -163,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
*/

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

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

@@ -35,6 +35,8 @@ import type {
APIAuditLogEntry,
APIEntitlement,
ChannelType,
APISubscription,
APISoundboardSound,
} from '../payloads/v10/index';
import type { ReactionType } from '../rest/v10/index';
import type { Nullable } from '../utils/internals';
@@ -92,6 +94,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,
}
/**
@@ -213,10 +219,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 +244,15 @@ 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',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
@@ -241,17 +264,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 +288,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 +338,10 @@ export type GatewayDispatchPayload =
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildSoundboardSoundCreateDispatch
| GatewayGuildSoundboardSoundDeleteDispatch
| GatewayGuildSoundboardSoundsUpdateDispatch
| GatewayGuildSoundboardSoundUpdateDispatch
| GatewayGuildStickersUpdateDispatch
| GatewayIntegrationCreateDispatch
| GatewayIntegrationDeleteDispatch
@@ -346,6 +365,7 @@ export type GatewayDispatchPayload =
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewaySubscriptionModifyDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
@@ -354,6 +374,7 @@ export type GatewayDispatchPayload =
| GatewayThreadUpdateDispatch
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceChannelEffectSendDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
@@ -614,6 +635,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
@@ -709,7 +779,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 +809,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>;
@@ -854,7 +926,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
@@ -1152,49 +1231,149 @@ 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/topics/gateway-events#integration-create
*/
@@ -1394,6 +1573,9 @@ export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields &
channel_id: Snowflake;
};
/**
* 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
@@ -1737,6 +1919,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
*/
@@ -1836,6 +2078,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 +2229,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 +2251,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 +2261,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 +2283,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

@@ -34,6 +34,8 @@ import type {
AutoModerationRuleTriggerType,
APIAuditLogEntry,
ChannelType,
APISubscription,
APISoundboardSound,
} from '../payloads/v9/index';
import type { ReactionType } from '../rest/v9/index';
import type { Nullable } from '../utils/internals';
@@ -92,6 +94,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,
}
/**
@@ -212,10 +218,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 +243,15 @@ 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',
GuildStickersUpdate = 'GUILD_STICKERS_UPDATE',
GuildUpdate = 'GUILD_UPDATE',
IntegrationCreate = 'INTEGRATION_CREATE',
@@ -240,17 +263,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 +287,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 +337,10 @@ export type GatewayDispatchPayload =
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildSoundboardSoundCreateDispatch
| GatewayGuildSoundboardSoundDeleteDispatch
| GatewayGuildSoundboardSoundsUpdateDispatch
| GatewayGuildSoundboardSoundUpdateDispatch
| GatewayGuildStickersUpdateDispatch
| GatewayIntegrationCreateDispatch
| GatewayIntegrationDeleteDispatch
@@ -345,6 +364,7 @@ export type GatewayDispatchPayload =
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewaySubscriptionModifyDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
@@ -353,6 +373,7 @@ export type GatewayDispatchPayload =
| GatewayThreadUpdateDispatch
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceChannelEffectSendDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
@@ -613,6 +634,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
@@ -708,7 +778,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
@@ -853,7 +925,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
@@ -1151,49 +1230,149 @@ 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/topics/gateway-events#integration-create
*/
@@ -1393,6 +1572,9 @@ export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields &
channel_id: Snowflake;
};
/**
* 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
@@ -1736,6 +1918,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
*/
@@ -1835,6 +2077,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 +2228,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 +2250,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 +2260,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 +2282,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;
/**

968
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.97",
"version": "0.37.102",
"description": "Discord API typings that are kept up to date for use in bot library creation.",
"homepage": "https://discord-api-types.dev",
"exports": {

View File

@@ -92,29 +92,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 +140,11 @@ export enum ApplicationIntegrationType {
/**
* App is installable to servers
*/
GuildInstall = 0,
GuildInstall,
/**
* App is installable to users
*/
UserInstall = 1,
UserInstall,
}
/**
@@ -138,15 +154,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,
}
/**

View File

@@ -102,6 +102,14 @@ export enum InteractionResponseType {
* @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

@@ -64,6 +64,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: '';
/**
@@ -119,12 +120,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
*/
@@ -135,8 +136,6 @@ 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;
/**

View File

@@ -23,6 +23,7 @@ import type {
} from './guild';
import type {
APIGuildScheduledEvent,
APIGuildScheduledEventRecurrenceRule,
GuildScheduledEventEntityType,
GuildScheduledEventStatus,
} from './guildScheduledEvent';
@@ -408,6 +409,7 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyPublicUpdatesChannelId
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyRecurrenceRule
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyRulesChannelId
| APIAuditLogChangeKeySplashHash
@@ -607,6 +609,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
*/

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;
/**
@@ -790,6 +788,10 @@ export enum MessageType {
GuildIncidentAlertModeDisabled,
GuildIncidentReportRaid,
GuildIncidentReportFalseAlarm,
PurchaseNotification = 44,
PollResult = 46,
}
/**
@@ -849,11 +851,11 @@ export enum MessageReferenceType {
/**
* A standard reference used by replies
*/
Default = 0,
Default,
/**
* Reference used to point to a message at a point in time
*/
Forward = 1,
Forward,
}
/**
@@ -1266,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',
}
/**
@@ -1415,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 {
/**
@@ -1916,6 +1922,13 @@ export interface APIMessageSnapshot {
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;
}
@@ -1982,12 +1995,15 @@ 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

@@ -534,6 +534,10 @@ export enum GuildFeature {
* Guild has enabled the welcome screen
*/
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
}
/**
@@ -689,7 +693,7 @@ export enum GuildMemberFlags {
*/
CompletedOnboarding = 1 << 1,
/**
* Member bypasses guild verification requirements
* Member is exempt from guild verification requirements
*/
BypassesVerification = 1 << 2,
/**
@@ -697,21 +701,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

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

View File

@@ -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,63 @@ 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[];
/**
* 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

@@ -0,0 +1,44 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/soundboard
*/
import type { Snowflake } from '../../globals';
import type { APIUser } from './user';
/**
* 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

@@ -273,6 +273,7 @@ export interface APIConnection {
}
export enum ConnectionService {
AmazonMusic = 'amazon-music',
BattleNet = 'battlenet',
BungieNet = 'bungie',
Domain = 'domain',

View File

@@ -92,29 +92,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 +140,11 @@ export enum ApplicationIntegrationType {
/**
* App is installable to servers
*/
GuildInstall = 0,
GuildInstall,
/**
* App is installable to users
*/
UserInstall = 1,
UserInstall,
}
/**
@@ -138,15 +154,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,
}
/**

View File

@@ -102,6 +102,14 @@ export enum InteractionResponseType {
* @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

@@ -64,6 +64,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: '';
/**
@@ -119,12 +120,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
*/
@@ -135,8 +136,6 @@ 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;
/**

View File

@@ -23,6 +23,7 @@ import type {
} from './guild';
import type {
APIGuildScheduledEvent,
APIGuildScheduledEventRecurrenceRule,
GuildScheduledEventEntityType,
GuildScheduledEventStatus,
} from './guildScheduledEvent';
@@ -408,6 +409,7 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyPublicUpdatesChannelId
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyRecurrenceRule
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyRulesChannelId
| APIAuditLogChangeKeySplashHash
@@ -607,6 +609,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
*/

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;
/**
@@ -775,6 +773,10 @@ export enum MessageType {
GuildIncidentAlertModeDisabled,
GuildIncidentReportRaid,
GuildIncidentReportFalseAlarm,
PurchaseNotification = 44,
PollResult = 46,
}
/**
@@ -834,11 +836,11 @@ export enum MessageReferenceType {
/**
* A standard reference used by replies
*/
Default = 0,
Default,
/**
* Reference used to point to a message at a point in time
*/
Forward = 1,
Forward,
}
/**
@@ -1233,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',
}
/**
@@ -1382,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 {
/**
@@ -1883,6 +1889,13 @@ export interface APIMessageSnapshot {
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;
}
@@ -1949,12 +1962,15 @@ 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

@@ -526,6 +526,10 @@ export enum GuildFeature {
* Guild has enabled the welcome screen
*/
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
/**
* Guild has created soundboard sounds
*/
Soundboard = 'SOUNDBOARD',
}
/**
@@ -681,7 +685,7 @@ export enum GuildMemberFlags {
*/
CompletedOnboarding = 1 << 1,
/**
* Member bypasses guild verification requirements
* Member is exempt from guild verification requirements
*/
BypassesVerification = 1 << 2,
/**
@@ -689,21 +693,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

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

View File

@@ -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,63 @@ 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[];
/**
* 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,
}

44
payloads/v9/soundboard.ts Normal file
View File

@@ -0,0 +1,44 @@
/**
* Types extracted from https://discord.com/developers/docs/resources/soundboard
*/
import type { Snowflake } from '../../globals';
import type { APIUser } from './user';
/**
* 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

@@ -273,6 +273,7 @@ export interface APIConnection {
}
export enum ConnectionService {
AmazonMusic = 'amazon-music',
BattleNet = 'battlenet',
BungieNet = 'bungie',
Domain = 'domain',

View File

@@ -22,6 +22,7 @@ export enum RESTJSONErrorCodes {
UnknownWebhookService,
UnknownSession = 10_020,
UnknownAsset,
UnknownBan = 10_026,
UnknownSKU,
@@ -138,6 +139,9 @@ export enum RESTJSONErrorCodes {
ConnectionHasBeenRevoked = 40_012,
OnlyConsumableSKUsCanBeConsumed = 40_018,
YouCanOnlyDeleteSandboxEntitlements,
TargetUserIsNotConnectedToVoice = 40_032,
ThisMessageWasAlreadyCrossposted,
@@ -156,6 +160,8 @@ export enum RESTJSONErrorCodes {
AnEntitlementHasAlreadyBeenGrantedForThisResource = 40_074,
ThisInteractionHasHitTheMaximumNumberOfFollowUpMessages = 40_094,
CloudflareIsBlockingYourRequest = 40_333,
MissingAccess = 50_001,
@@ -229,6 +235,9 @@ export enum RESTJSONErrorCodes {
ServerNeedsMoreBoostsToPerformThisAction = 50_101,
RequestBodyContainsInvalidJSON = 50_109,
ProvidedFileIsInvalid,
ProvidedFileDurationExceedsMaximumLength = 50_124,
OwnerCannotBePendingMember = 50_131,
OwnershipCannotBeMovedToABotUser,

View File

@@ -24,6 +24,7 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} from '../../payloads/v10/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
import type { RESTAPIPoll } from './poll';
@@ -260,22 +261,16 @@ export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesO
export type APIMessageReferenceSend = RESTAPIMessageReference;
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface RESTAPIAttachment {
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
@@ -461,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

@@ -11,15 +11,16 @@ export * from './guild';
export * from './guildScheduledEvent';
export * from './interactions';
export * from './invite';
export * from './monetization';
export * from './oauth2';
export * from './poll';
export * from './soundboard';
export * from './stageInstance';
export * from './sticker';
export * from './template';
export * from './user';
export * from './voice';
export * from './webhook';
export * from './monetization';
export const APIVersion = '10';
@@ -999,6 +1000,57 @@ export const Routes = {
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;
},
};
export const StickerPackApplicationId = '710982414301790216';
@@ -1288,6 +1340,14 @@ 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;
},
};
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;

View File

@@ -1,3 +1,4 @@
import type { Snowflake } from '../../globals';
import type {
APIApplicationCommand,
APIApplicationCommandPermission,
@@ -5,6 +6,9 @@ import type {
APIInteractionResponse,
APIInteractionResponseCallbackData,
ApplicationCommandType,
InteractionResponseType,
APIMessage,
InteractionType,
} from '../../payloads/v10/index';
import type {
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
@@ -171,6 +175,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 +197,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,8 +1,8 @@
import type { Snowflake } from '../../globals';
import type { APIEntitlement, APISKU } from '../../v10';
import type { APIEntitlement, APISKU, APISubscription } from '../../v10';
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
* https://discord.com/developers/docs/resources/entitlement#list-entitlements
*/
export interface RESTGetAPIEntitlementsQuery {
/**
@@ -39,12 +39,12 @@ export interface RESTGetAPIEntitlementsQuery {
}
/**
* 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#create-test-entitlement
*/
export interface RESTPostAPIEntitlementJSONBody {
/**
@@ -67,12 +67,12 @@ export interface RESTPostAPIEntitlementJSONBody {
export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody;
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
* 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,
@@ -80,16 +80,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

@@ -134,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
*
@@ -163,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
*/

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

@@ -0,0 +1,107 @@
import type { Snowflake } from '../../globals';
import type { APISoundboardSound } from '../../payloads/v10/index';
/**
* 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

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

@@ -24,6 +24,7 @@ import type {
SortOrderType,
ForumLayoutType,
ChannelFlags,
APIAttachment,
} from '../../payloads/v9/index';
import type { AddUndefinedToPossiblyUndefinedPropertiesOfInterface, StrictPartial } from '../../utils/internals';
import type { RESTAPIPoll } from './poll';
@@ -260,22 +261,16 @@ export type RESTAPIMessageReference = AddUndefinedToPossiblyUndefinedPropertiesO
export type APIMessageReferenceSend = RESTAPIMessageReference;
/**
* https://discord.com/developers/docs/resources/channel#attachment-object
* https://discord.com/developers/docs/resources/message#attachment-object-attachment-structure
*/
export interface RESTAPIAttachment {
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
@@ -477,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

@@ -11,15 +11,16 @@ export * from './guild';
export * from './guildScheduledEvent';
export * from './interactions';
export * from './invite';
export * from './monetization';
export * from './oauth2';
export * from './poll';
export * from './soundboard';
export * from './stageInstance';
export * from './sticker';
export * from './template';
export * from './user';
export * from './voice';
export * from './webhook';
export * from './monetization';
export const APIVersion = '9';
@@ -1008,6 +1009,57 @@ export const Routes = {
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;
},
};
export const StickerPackApplicationId = '710982414301790216';
@@ -1297,6 +1349,14 @@ 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;
},
};
export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;

View File

@@ -1,3 +1,4 @@
import type { Snowflake } from '../../globals';
import type {
APIApplicationCommand,
APIApplicationCommandPermission,
@@ -5,6 +6,9 @@ import type {
APIInteractionResponse,
APIInteractionResponseCallbackData,
ApplicationCommandType,
InteractionResponseType,
APIMessage,
InteractionType,
} from '../../payloads/v9/index';
import type {
AddUndefinedToPossiblyUndefinedPropertiesOfInterface,
@@ -171,6 +175,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 +197,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,8 +1,8 @@
import type { Snowflake } from '../../globals';
import type { APIEntitlement, APISKU } from '../../v10';
import type { APIEntitlement, APISKU, APISubscription } from '../../v9';
/**
* https://discord.com/developers/docs/monetization/entitlements#list-entitlements
* https://discord.com/developers/docs/resources/entitlement#list-entitlements
*/
export interface RESTGetAPIEntitlementsQuery {
/**
@@ -39,12 +39,12 @@ export interface RESTGetAPIEntitlementsQuery {
}
/**
* 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#create-test-entitlement
*/
export interface RESTPostAPIEntitlementJSONBody {
/**
@@ -67,12 +67,12 @@ export interface RESTPostAPIEntitlementJSONBody {
export type RESTPostAPIEntitlementBody = RESTPostAPIEntitlementJSONBody;
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
* 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,
@@ -80,16 +80,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

@@ -134,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
*
@@ -163,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
*/

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

@@ -0,0 +1,107 @@
import type { Snowflake } from '../../globals';
import type { APISoundboardSound } from '../../payloads/v10/index';
/**
* 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

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

@@ -0,0 +1,21 @@
import { expectAssignable, expectNotAssignable } from 'tsd';
import type { OAuth2Scopes, RESTOAuth2BotAuthorizationQuery, RESTOAuth2AdvancedBotAuthorizationQuery } from '../../v10';
declare const validBotScope:
| OAuth2Scopes.Bot
| 'bot'
| 'bot identify'
| 'applications.commands bot'
| 'applications.commands bot identify';
declare const invalidBotScope:
| OAuth2Scopes.ApplicationsCommands
| 'applications.commands'
| 'applications.commands identify'
| 'bot%20identify'
| '';
expectAssignable<RESTOAuth2BotAuthorizationQuery['scope']>(validBotScope);
expectNotAssignable<RESTOAuth2BotAuthorizationQuery['scope']>(invalidBotScope);
expectAssignable<RESTOAuth2AdvancedBotAuthorizationQuery['scope']>(validBotScope);
expectNotAssignable<RESTOAuth2AdvancedBotAuthorizationQuery['scope']>(invalidBotScope);

20
tests/v9/oauth2.test-d.ts Normal file
View File

@@ -0,0 +1,20 @@
import { expectAssignable, expectNotAssignable } from 'tsd';
import type { OAuth2Scopes, RESTOAuth2BotAuthorizationQuery, RESTOAuth2AdvancedBotAuthorizationQuery } from '../../v9';
declare const validBotScope:
| OAuth2Scopes.Bot
| 'bot'
| 'bot identify'
| 'applications.commands bot'
| 'applications.commands bot identify';
declare const invalidBotScope:
| OAuth2Scopes.ApplicationsCommands
| 'applications.commands'
| 'applications.commands identify'
| '';
expectAssignable<RESTOAuth2BotAuthorizationQuery['scope']>(validBotScope);
expectNotAssignable<RESTOAuth2BotAuthorizationQuery['scope']>(invalidBotScope);
expectAssignable<RESTOAuth2AdvancedBotAuthorizationQuery['scope']>(validBotScope);
expectNotAssignable<RESTOAuth2AdvancedBotAuthorizationQuery['scope']>(invalidBotScope);

1602
website/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -63,7 +63,7 @@
"eslint-config-neon": "^0.1.42",
"lint-staged": "^13.0.1",
"markdownlint": "^0.25.1",
"markdownlint-cli2": "^0.4.0",
"markdownlint-cli2": "^0.14.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.6.2",
"pretty-quick": "^3.1.3",

View File

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

File diff suppressed because one or more lines are too long

View File

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

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