mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-22 11:20:10 +00:00
Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
52c91f8f73 | ||
|
|
47382b6183 | ||
|
|
51dee6e0e5 | ||
|
|
3ff85eede4 | ||
|
|
44c0f05cb2 | ||
|
|
68d5c08c93 | ||
|
|
d333962715 | ||
|
|
f2d62e3cdf | ||
|
|
faa8bf494b | ||
|
|
7379a345e8 | ||
|
|
fa54b9de55 | ||
|
|
1e52e0ceab | ||
|
|
691abb581f | ||
|
|
7a15c97863 | ||
|
|
bc1d03e527 | ||
|
|
0f51d8e83f | ||
|
|
4021dae44b | ||
|
|
d189e36c49 | ||
|
|
a015f96fcb | ||
|
|
3b9320dbf2 | ||
|
|
fdf133ef45 | ||
|
|
7c36a6cdf3 | ||
|
|
a507765bba | ||
|
|
9dd3446b64 | ||
|
|
24f658de38 | ||
|
|
329451c6c9 | ||
|
|
7db69531d8 | ||
|
|
77396b557c | ||
|
|
0331518c49 | ||
|
|
64e4e5246c | ||
|
|
b453d75e4d | ||
|
|
1076822b90 | ||
|
|
0c592a0950 | ||
|
|
68d97aed14 | ||
|
|
a787426082 | ||
|
|
2aee879600 | ||
|
|
4bbe1eaa86 | ||
|
|
6f6e6daccd | ||
|
|
43cc755e33 |
0
.husky/commit-msg
Normal file → Executable file
0
.husky/commit-msg
Normal file → Executable file
0
.husky/pre-commit
Normal file → Executable file
0
.husky/pre-commit
Normal file → Executable file
80
CHANGELOG.md
80
CHANGELOG.md
@@ -1,3 +1,83 @@
|
||||
## [0.25.2](https://github.com/discordjs/discord-api-types/compare/0.25.1...0.25.2) (2021-11-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APISelectMenuComponent:** `options` property is required ([#248](https://github.com/discordjs/discord-api-types/issues/248)) ([51dee6e](https://github.com/discordjs/discord-api-types/commit/51dee6e0e5bb4d749b9f0436e7ec9d4793e56567))
|
||||
|
||||
### Features
|
||||
|
||||
- **Guild:** boost progress bars ([#227](https://github.com/discordjs/discord-api-types/issues/227)) ([47382b6](https://github.com/discordjs/discord-api-types/commit/47382b6183a1d232053fef23691d423f8af88f88))
|
||||
|
||||
## [0.25.1](https://github.com/discordjs/discord-api-types/compare/0.25.0...0.25.1) (2021-11-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **deno:** faulty import paths for guild scheduled events ([#245](https://github.com/discordjs/discord-api-types/issues/245)) ([44c0f05](https://github.com/discordjs/discord-api-types/commit/44c0f05cb2fc2b9ea50745530ae94a669a839594))
|
||||
|
||||
# [0.25.0](https://github.com/discordjs/discord-api-types/compare/0.24.0...0.25.0) (2021-11-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIApplicationCommandOption:** remove `default` property ([#242](https://github.com/discordjs/discord-api-types/issues/242)) ([faa8bf4](https://github.com/discordjs/discord-api-types/commit/faa8bf494bc79b844ce73e1892461e8440dc7abc))
|
||||
- correct types for autocomplete interaction data ([#234](https://github.com/discordjs/discord-api-types/issues/234)) ([691abb5](https://github.com/discordjs/discord-api-types/commit/691abb581fb17093b5fa139f3ff53cbc0ad0b2a1))
|
||||
- correct types for REST attachments ([#238](https://github.com/discordjs/discord-api-types/issues/238)) ([fa54b9d](https://github.com/discordjs/discord-api-types/commit/fa54b9de5522b9fa9d5367650950f8b0e44f6e14))
|
||||
- make subcommand options optional ([#241](https://github.com/discordjs/discord-api-types/issues/241)) ([7379a34](https://github.com/discordjs/discord-api-types/commit/7379a345e820703a59a2d754c8ee7c0f0c710e09))
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **UserFlags:** update flag names ([#229](https://github.com/discordjs/discord-api-types/issues/229)) ([f2d62e3](https://github.com/discordjs/discord-api-types/commit/f2d62e3cdf6128357f65e946fe1926cf915a6395))
|
||||
|
||||
### Features
|
||||
|
||||
- add guild scheduled event ([#186](https://github.com/discordjs/discord-api-types/issues/186)) ([d333962](https://github.com/discordjs/discord-api-types/commit/d333962715a58bd5ac14ad80e900b43b02777794))
|
||||
- **RESTPostAPIChannelThreadsJSONBody:** add `rate_limit_per_user` ([#237](https://github.com/discordjs/discord-api-types/issues/237)) ([1e52e0c](https://github.com/discordjs/discord-api-types/commit/1e52e0ceab31465c7bbd820e332ef219ad715916))
|
||||
- add max/min option for number-based options ([#221](https://github.com/discordjs/discord-api-types/issues/221)) ([bc1d03e](https://github.com/discordjs/discord-api-types/commit/bc1d03e527b9d37fac6d76cfbb51f4eeb8238e7b))
|
||||
- add maze api error ([#228](https://github.com/discordjs/discord-api-types/issues/228)) ([7a15c97](https://github.com/discordjs/discord-api-types/commit/7a15c9786333fb6f2259f42536cfbf2cf0e43db8))
|
||||
- **ActivityFlags:** add new flags ([#207](https://github.com/discordjs/discord-api-types/issues/207)) ([0f51d8e](https://github.com/discordjs/discord-api-types/commit/0f51d8e83f8aa53efde5c01849aaf09b91d15cbd))
|
||||
- **ApplicationFlags:** add message content intent flags ([#226](https://github.com/discordjs/discord-api-types/issues/226)) ([d189e36](https://github.com/discordjs/discord-api-types/commit/d189e36c49cd230f98798ff57b668a6fe56df11b))
|
||||
- **Attachments:** multi uploads and alt text ([#223](https://github.com/discordjs/discord-api-types/issues/223)) ([fdf133e](https://github.com/discordjs/discord-api-types/commit/fdf133ef45d3871defb46e47079c2acdd65e69d7))
|
||||
- **GuildSystemChannelFlags:** add suppress member join sticker replies flag ([#222](https://github.com/discordjs/discord-api-types/issues/222)) ([4021dae](https://github.com/discordjs/discord-api-types/commit/4021dae44b331198d164a7c93dbc1242184efdf7))
|
||||
- **Interactions:** add autocomplete api types ([#205](https://github.com/discordjs/discord-api-types/issues/205)) ([3b9320d](https://github.com/discordjs/discord-api-types/commit/3b9320dbf2cbbae7db44f00e8deaf336ab052e8b))
|
||||
- **UserFlags:** add `BOT_HTTP_INTERACTIONS` flag ([#212](https://github.com/discordjs/discord-api-types/issues/212)) ([a015f96](https://github.com/discordjs/discord-api-types/commit/a015f96fcb4a74866f884db87732876095788111))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **UserFlags:** All user flags now follow the internal name, with descriptions added for what they represent. This means you'll have to do some minor renaming in your code if you check for flags.
|
||||
- **APIApplicationCommandOption:** If you were using the `default` property for ApplicationCommandOptions, it has been removed, as Discord wasn't even taking it into account anymore.
|
||||
- The types for autocomplete interactions have been corrected.
|
||||
|
||||
# [0.24.0](https://github.com/discordjs/discord-api-types/compare/0.23.1...0.24.0) (2021-10-16)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APISelectMenuComponent:** make options field optional ([#209](https://github.com/discordjs/discord-api-types/issues/209)) ([0c592a0](https://github.com/discordjs/discord-api-types/commit/0c592a0950431f43143bf1c32589bce2dd842b44))
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **APIVoiceRegion:** removed `vip` property ([#214](https://github.com/discordjs/discord-api-types/issues/214)) ([7db6953](https://github.com/discordjs/discord-api-types/commit/7db69531d86fe5bdd462747b1e1287ee6b2dc496))
|
||||
|
||||
### Features
|
||||
|
||||
- **APIApplicationCommand:** add `channel_types` field to channel options ([#198](https://github.com/discordjs/discord-api-types/issues/198)) ([77396b5](https://github.com/discordjs/discord-api-types/commit/77396b557c6f3d4f85cfc4cd3b253638bc5b449d))
|
||||
- **APIAttachment:** add ephemeral field ([#199](https://github.com/discordjs/discord-api-types/issues/199)) ([2aee879](https://github.com/discordjs/discord-api-types/commit/2aee87960070cb56979d3ced453c8cd64e81f150))
|
||||
- **APIGuildMember:** add per guild avatars ([#208](https://github.com/discordjs/discord-api-types/issues/208)) ([0331518](https://github.com/discordjs/discord-api-types/commit/0331518c49c4761f900bacd8ca8a92e38b36b6e9))
|
||||
- **APIRole:** add role icons ([#204](https://github.com/discordjs/discord-api-types/issues/204)) ([1076822](https://github.com/discordjs/discord-api-types/commit/1076822b90a1b6facf74aa3f2a6750566b3feb53))
|
||||
- **InteractionResolvedChannels:** add `parent_id` and `thread_metadata` fields to resolved channels ([#210](https://github.com/discordjs/discord-api-types/issues/210)) ([64e4e52](https://github.com/discordjs/discord-api-types/commit/64e4e5246cd61eadf35591b8afdf4c5922fd4086))
|
||||
- **PermissionFlagBits:** update thread permissions ([#181](https://github.com/discordjs/discord-api-types/issues/181)) ([68d97ae](https://github.com/discordjs/discord-api-types/commit/68d97aed1425002677acdf1d5444b36d3cfcc322))
|
||||
- **PermissionFlagsBits:** add `StartEmbeddedActivities` ([#197](https://github.com/discordjs/discord-api-types/issues/197)) ([4bbe1ea](https://github.com/discordjs/discord-api-types/commit/4bbe1eaa867da810a1d039b21c3fc78208a50801))
|
||||
- **RESTJSONErrorCodes:** add error 50101 ([#202](https://github.com/discordjs/discord-api-types/issues/202)) ([b453d75](https://github.com/discordjs/discord-api-types/commit/b453d75e4d13d34836247929be56c042cbc4b762))
|
||||
- **Routes:** add missing OAuth2 routes ([#218](https://github.com/discordjs/discord-api-types/issues/218)) ([9dd3446](https://github.com/discordjs/discord-api-types/commit/9dd3446b64f31ae0831944f5c608095d650142d7))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **APIVoiceRegion:** The `vip` property has been removed.
|
||||
|
||||
## [0.23.1](https://github.com/discordjs/discord-api-types/compare/0.23.0...0.23.1) (2021-09-08)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **RESTPostAPIBaseApplicationCommandsJSONBody:** omit `version` field ([#195](https://github.com/discordjs/discord-api-types/issues/195)) ([43cc755](https://github.com/discordjs/discord-api-types/commit/43cc755e3390437d11f7733477a2c86afd6daf23))
|
||||
|
||||
# [0.23.0](https://github.com/discordjs/discord-api-types/compare/0.22.0...0.23.0) (2021-09-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -1,3 +1,83 @@
|
||||
## [0.25.2](https://github.com/discordjs/discord-api-types/compare/0.25.1...0.25.2) (2021-11-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APISelectMenuComponent:** `options` property is required ([#248](https://github.com/discordjs/discord-api-types/issues/248)) ([51dee6e](https://github.com/discordjs/discord-api-types/commit/51dee6e0e5bb4d749b9f0436e7ec9d4793e56567))
|
||||
|
||||
### Features
|
||||
|
||||
- **Guild:** boost progress bars ([#227](https://github.com/discordjs/discord-api-types/issues/227)) ([47382b6](https://github.com/discordjs/discord-api-types/commit/47382b6183a1d232053fef23691d423f8af88f88))
|
||||
|
||||
## [0.25.1](https://github.com/discordjs/discord-api-types/compare/0.25.0...0.25.1) (2021-11-30)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **deno:** faulty import paths for guild scheduled events ([#245](https://github.com/discordjs/discord-api-types/issues/245)) ([44c0f05](https://github.com/discordjs/discord-api-types/commit/44c0f05cb2fc2b9ea50745530ae94a669a839594))
|
||||
|
||||
# [0.25.0](https://github.com/discordjs/discord-api-types/compare/0.24.0...0.25.0) (2021-11-29)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIApplicationCommandOption:** remove `default` property ([#242](https://github.com/discordjs/discord-api-types/issues/242)) ([faa8bf4](https://github.com/discordjs/discord-api-types/commit/faa8bf494bc79b844ce73e1892461e8440dc7abc))
|
||||
- correct types for autocomplete interaction data ([#234](https://github.com/discordjs/discord-api-types/issues/234)) ([691abb5](https://github.com/discordjs/discord-api-types/commit/691abb581fb17093b5fa139f3ff53cbc0ad0b2a1))
|
||||
- correct types for REST attachments ([#238](https://github.com/discordjs/discord-api-types/issues/238)) ([fa54b9d](https://github.com/discordjs/discord-api-types/commit/fa54b9de5522b9fa9d5367650950f8b0e44f6e14))
|
||||
- make subcommand options optional ([#241](https://github.com/discordjs/discord-api-types/issues/241)) ([7379a34](https://github.com/discordjs/discord-api-types/commit/7379a345e820703a59a2d754c8ee7c0f0c710e09))
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **UserFlags:** update flag names ([#229](https://github.com/discordjs/discord-api-types/issues/229)) ([f2d62e3](https://github.com/discordjs/discord-api-types/commit/f2d62e3cdf6128357f65e946fe1926cf915a6395))
|
||||
|
||||
### Features
|
||||
|
||||
- add guild scheduled event ([#186](https://github.com/discordjs/discord-api-types/issues/186)) ([d333962](https://github.com/discordjs/discord-api-types/commit/d333962715a58bd5ac14ad80e900b43b02777794))
|
||||
- **RESTPostAPIChannelThreadsJSONBody:** add `rate_limit_per_user` ([#237](https://github.com/discordjs/discord-api-types/issues/237)) ([1e52e0c](https://github.com/discordjs/discord-api-types/commit/1e52e0ceab31465c7bbd820e332ef219ad715916))
|
||||
- add max/min option for number-based options ([#221](https://github.com/discordjs/discord-api-types/issues/221)) ([bc1d03e](https://github.com/discordjs/discord-api-types/commit/bc1d03e527b9d37fac6d76cfbb51f4eeb8238e7b))
|
||||
- add maze api error ([#228](https://github.com/discordjs/discord-api-types/issues/228)) ([7a15c97](https://github.com/discordjs/discord-api-types/commit/7a15c9786333fb6f2259f42536cfbf2cf0e43db8))
|
||||
- **ActivityFlags:** add new flags ([#207](https://github.com/discordjs/discord-api-types/issues/207)) ([0f51d8e](https://github.com/discordjs/discord-api-types/commit/0f51d8e83f8aa53efde5c01849aaf09b91d15cbd))
|
||||
- **ApplicationFlags:** add message content intent flags ([#226](https://github.com/discordjs/discord-api-types/issues/226)) ([d189e36](https://github.com/discordjs/discord-api-types/commit/d189e36c49cd230f98798ff57b668a6fe56df11b))
|
||||
- **Attachments:** multi uploads and alt text ([#223](https://github.com/discordjs/discord-api-types/issues/223)) ([fdf133e](https://github.com/discordjs/discord-api-types/commit/fdf133ef45d3871defb46e47079c2acdd65e69d7))
|
||||
- **GuildSystemChannelFlags:** add suppress member join sticker replies flag ([#222](https://github.com/discordjs/discord-api-types/issues/222)) ([4021dae](https://github.com/discordjs/discord-api-types/commit/4021dae44b331198d164a7c93dbc1242184efdf7))
|
||||
- **Interactions:** add autocomplete api types ([#205](https://github.com/discordjs/discord-api-types/issues/205)) ([3b9320d](https://github.com/discordjs/discord-api-types/commit/3b9320dbf2cbbae7db44f00e8deaf336ab052e8b))
|
||||
- **UserFlags:** add `BOT_HTTP_INTERACTIONS` flag ([#212](https://github.com/discordjs/discord-api-types/issues/212)) ([a015f96](https://github.com/discordjs/discord-api-types/commit/a015f96fcb4a74866f884db87732876095788111))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **UserFlags:** All user flags now follow the internal name, with descriptions added for what they represent. This means you'll have to do some minor renaming in your code if you check for flags.
|
||||
- **APIApplicationCommandOption:** If you were using the `default` property for ApplicationCommandOptions, it has been removed, as Discord wasn't even taking it into account anymore.
|
||||
- The types for autocomplete interactions have been corrected.
|
||||
|
||||
# [0.24.0](https://github.com/discordjs/discord-api-types/compare/0.23.1...0.24.0) (2021-10-16)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APISelectMenuComponent:** make options field optional ([#209](https://github.com/discordjs/discord-api-types/issues/209)) ([0c592a0](https://github.com/discordjs/discord-api-types/commit/0c592a0950431f43143bf1c32589bce2dd842b44))
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- **APIVoiceRegion:** removed `vip` property ([#214](https://github.com/discordjs/discord-api-types/issues/214)) ([7db6953](https://github.com/discordjs/discord-api-types/commit/7db69531d86fe5bdd462747b1e1287ee6b2dc496))
|
||||
|
||||
### Features
|
||||
|
||||
- **APIApplicationCommand:** add `channel_types` field to channel options ([#198](https://github.com/discordjs/discord-api-types/issues/198)) ([77396b5](https://github.com/discordjs/discord-api-types/commit/77396b557c6f3d4f85cfc4cd3b253638bc5b449d))
|
||||
- **APIAttachment:** add ephemeral field ([#199](https://github.com/discordjs/discord-api-types/issues/199)) ([2aee879](https://github.com/discordjs/discord-api-types/commit/2aee87960070cb56979d3ced453c8cd64e81f150))
|
||||
- **APIGuildMember:** add per guild avatars ([#208](https://github.com/discordjs/discord-api-types/issues/208)) ([0331518](https://github.com/discordjs/discord-api-types/commit/0331518c49c4761f900bacd8ca8a92e38b36b6e9))
|
||||
- **APIRole:** add role icons ([#204](https://github.com/discordjs/discord-api-types/issues/204)) ([1076822](https://github.com/discordjs/discord-api-types/commit/1076822b90a1b6facf74aa3f2a6750566b3feb53))
|
||||
- **InteractionResolvedChannels:** add `parent_id` and `thread_metadata` fields to resolved channels ([#210](https://github.com/discordjs/discord-api-types/issues/210)) ([64e4e52](https://github.com/discordjs/discord-api-types/commit/64e4e5246cd61eadf35591b8afdf4c5922fd4086))
|
||||
- **PermissionFlagBits:** update thread permissions ([#181](https://github.com/discordjs/discord-api-types/issues/181)) ([68d97ae](https://github.com/discordjs/discord-api-types/commit/68d97aed1425002677acdf1d5444b36d3cfcc322))
|
||||
- **PermissionFlagsBits:** add `StartEmbeddedActivities` ([#197](https://github.com/discordjs/discord-api-types/issues/197)) ([4bbe1ea](https://github.com/discordjs/discord-api-types/commit/4bbe1eaa867da810a1d039b21c3fc78208a50801))
|
||||
- **RESTJSONErrorCodes:** add error 50101 ([#202](https://github.com/discordjs/discord-api-types/issues/202)) ([b453d75](https://github.com/discordjs/discord-api-types/commit/b453d75e4d13d34836247929be56c042cbc4b762))
|
||||
- **Routes:** add missing OAuth2 routes ([#218](https://github.com/discordjs/discord-api-types/issues/218)) ([9dd3446](https://github.com/discordjs/discord-api-types/commit/9dd3446b64f31ae0831944f5c608095d650142d7))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **APIVoiceRegion:** The `vip` property has been removed.
|
||||
|
||||
## [0.23.1](https://github.com/discordjs/discord-api-types/compare/0.23.0...0.23.1) (2021-09-08)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **RESTPostAPIBaseApplicationCommandsJSONBody:** omit `version` field ([#195](https://github.com/discordjs/discord-api-types/issues/195)) ([43cc755](https://github.com/discordjs/discord-api-types/commit/43cc755e3390437d11f7733477a2c86afd6daf23))
|
||||
|
||||
# [0.23.0](https://github.com/discordjs/discord-api-types/compare/0.22.0...0.23.0) (2021-09-07)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
@@ -9,6 +9,7 @@ import type {
|
||||
APIChannel,
|
||||
APIEmoji,
|
||||
APIGuild,
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildIntegration,
|
||||
APIGuildMember,
|
||||
APIMessage,
|
||||
@@ -183,6 +184,7 @@ export enum GatewayIntentBits {
|
||||
DirectMessages = 1 << 12,
|
||||
DirectMessageReactions = 1 << 13,
|
||||
DirectMessageTyping = 1 << 14,
|
||||
GuildScheduledEvents = 1 << 16,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,6 +235,11 @@ export enum GatewayDispatchEvents {
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
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',
|
||||
}
|
||||
|
||||
export type GatewaySendPayload =
|
||||
@@ -265,6 +272,11 @@ export type GatewayDispatchPayload =
|
||||
| GatewayGuildModifyDispatch
|
||||
| GatewayGuildRoleDeleteDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayGuildScheduledEventCreateDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventDeleteDispatch
|
||||
| GatewayGuildScheduledEventUserAddDispatch
|
||||
| GatewayGuildScheduledEventUserRemoveDispatch
|
||||
| GatewayGuildStickersUpdateDispatch
|
||||
| GatewayIntegrationCreateDispatch
|
||||
| GatewayIntegrationDeleteDispatch
|
||||
@@ -808,6 +820,49 @@ export interface GatewayGuildRoleDeleteDispatchData {
|
||||
role_id: Snowflake;
|
||||
}
|
||||
|
||||
export type GatewayGuildScheduledEventCreateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventCreate,
|
||||
GatewayGuildScheduledEventCreateDispatchData
|
||||
>;
|
||||
|
||||
export type GatewayGuildScheduledEventCreateDispatchData = APIGuildScheduledEvent;
|
||||
|
||||
export type GatewayGuildScheduledEventUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventUpdate,
|
||||
GatewayGuildScheduledEventUpdateDispatchData
|
||||
>;
|
||||
|
||||
export type GatewayGuildScheduledEventUpdateDispatchData = APIGuildScheduledEvent;
|
||||
|
||||
export type GatewayGuildScheduledEventDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventDelete,
|
||||
GatewayGuildScheduledEventDeleteDispatchData
|
||||
>;
|
||||
|
||||
export type GatewayGuildScheduledEventDeleteDispatchData = APIGuildScheduledEvent;
|
||||
|
||||
export type GatewayGuildScheduledEventUserAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventUserAdd,
|
||||
GatewayGuildScheduledEventUserAddDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayGuildScheduledEventUserAddDispatchData {
|
||||
guild_scheduled_event_id: Snowflake;
|
||||
user_id: Snowflake;
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
export type GatewayGuildScheduledEventUserRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventUserRemove,
|
||||
GatewayGuildScheduledEventUserAddDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayGuildScheduledEventUserRemoveDispatchData {
|
||||
guild_scheduled_event_id: Snowflake;
|
||||
user_id: Snowflake;
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#integration-create
|
||||
*/
|
||||
|
||||
@@ -9,6 +9,7 @@ import type {
|
||||
APIChannel,
|
||||
APIEmoji,
|
||||
APIGuild,
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildIntegration,
|
||||
APIGuildMember,
|
||||
APIMessage,
|
||||
@@ -186,6 +187,7 @@ export enum GatewayIntentBits {
|
||||
DirectMessages = 1 << 12,
|
||||
DirectMessageReactions = 1 << 13,
|
||||
DirectMessageTyping = 1 << 14,
|
||||
GuildScheduledEvents = 1 << 16,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -242,6 +244,11 @@ export enum GatewayDispatchEvents {
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
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',
|
||||
}
|
||||
|
||||
export type GatewaySendPayload =
|
||||
@@ -274,6 +281,11 @@ export type GatewayDispatchPayload =
|
||||
| GatewayGuildModifyDispatch
|
||||
| GatewayGuildRoleDeleteDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayGuildScheduledEventCreateDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventDeleteDispatch
|
||||
| GatewayGuildScheduledEventUserAddDispatch
|
||||
| GatewayGuildScheduledEventUserRemoveDispatch
|
||||
| GatewayGuildStickersUpdateDispatch
|
||||
| GatewayIntegrationCreateDispatch
|
||||
| GatewayIntegrationDeleteDispatch
|
||||
@@ -818,6 +830,49 @@ export interface GatewayGuildRoleDeleteDispatchData {
|
||||
role_id: Snowflake;
|
||||
}
|
||||
|
||||
export type GatewayGuildScheduledEventCreateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventCreate,
|
||||
GatewayGuildScheduledEventCreateDispatchData
|
||||
>;
|
||||
|
||||
export type GatewayGuildScheduledEventCreateDispatchData = APIGuildScheduledEvent;
|
||||
|
||||
export type GatewayGuildScheduledEventUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventUpdate,
|
||||
GatewayGuildScheduledEventUpdateDispatchData
|
||||
>;
|
||||
|
||||
export type GatewayGuildScheduledEventUpdateDispatchData = APIGuildScheduledEvent;
|
||||
|
||||
export type GatewayGuildScheduledEventDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventDelete,
|
||||
GatewayGuildScheduledEventDeleteDispatchData
|
||||
>;
|
||||
|
||||
export type GatewayGuildScheduledEventDeleteDispatchData = APIGuildScheduledEvent;
|
||||
|
||||
export type GatewayGuildScheduledEventUserAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventUserAdd,
|
||||
GatewayGuildScheduledEventUserAddDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayGuildScheduledEventUserAddDispatchData {
|
||||
guild_scheduled_event_id: Snowflake;
|
||||
user_id: Snowflake;
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
export type GatewayGuildScheduledEventUserRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventUserRemove,
|
||||
GatewayGuildScheduledEventUserAddDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayGuildScheduledEventUserRemoveDispatchData {
|
||||
guild_scheduled_event_id: Snowflake;
|
||||
user_id: Snowflake;
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#integration-create
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { APIRole, APIUser } from '../../mod.ts';
|
||||
import type { APIRole, APIUser, ChannelType } from '../../mod.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
import type {
|
||||
@@ -13,22 +13,26 @@ interface APIApplicationCommandOptionBase {
|
||||
type:
|
||||
| ApplicationCommandOptionType.Boolean
|
||||
| ApplicationCommandOptionType.User
|
||||
| ApplicationCommandOptionType.Channel
|
||||
| ApplicationCommandOptionType.Role
|
||||
| ApplicationCommandOptionType.Mentionable;
|
||||
name: string;
|
||||
description: string;
|
||||
default?: boolean;
|
||||
required?: boolean;
|
||||
autocomplete?: never;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
|
||||
*/
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandArgumentOptions
|
||||
| APIApplicationCommandStringArgumentOptions
|
||||
| APIApplicationCommandSubCommandOptions
|
||||
| APIApplicationCommandOptionBase;
|
||||
| APIApplicationCommandOptionBase
|
||||
| APIApplicationCommandChannelOptions
|
||||
| APIApplicationCommandOptionBase
|
||||
| APIApplicationCommandNumberArgumentOptions
|
||||
| APIApplicationCommandStringAutocompleteOptions
|
||||
| APIApplicationCommandNumericAutocompleteOptions;
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
@@ -46,12 +50,82 @@ export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicat
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions`, these types cannot have an `options` array,
|
||||
* but they can have a `choices` one
|
||||
*/
|
||||
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
export interface APIApplicationCommandStringArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.String;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions`, these types cannot have an `options` array,
|
||||
* but they can have a `choices`, a `min_value` and `max_value` field
|
||||
*/
|
||||
export interface APIApplicationCommandNumberArgumentOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* if the option is an `INTEGER` or `NUMBER` type, the maximum value permitted
|
||||
*/
|
||||
max_value?: number;
|
||||
autocomplete?: false;
|
||||
}
|
||||
export interface APIApplicationCommandArgumentOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type:
|
||||
| ApplicationCommandOptionType.String
|
||||
| ApplicationCommandOptionType.Integer
|
||||
| ApplicationCommandOptionType.Number;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
autocomplete?: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array,
|
||||
* but they can a `autocomplete` field where it's set to `true`
|
||||
*/
|
||||
export interface APIApplicationCommandStringAutocompleteOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type: ApplicationCommandOptionType.String;
|
||||
autocomplete: true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array,
|
||||
* but they can a `autocomplete` field where it's set to `true`
|
||||
*/
|
||||
export interface APIApplicationCommandNumericAutocompleteOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number;
|
||||
autocomplete: true;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions` and `APIApplicationCommandArgumentOptions`,
|
||||
* these types cannot have an `options` array, or a `choices` array, but they can have a `channel_types` one.
|
||||
*/
|
||||
export interface APIApplicationCommandChannelOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.Channel;
|
||||
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,7 +163,7 @@ export type APIApplicationCommandInteractionDataOption =
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommand {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.Subcommand;
|
||||
options: APIApplicationCommandInteractionDataOptionWithValues[];
|
||||
options?: APIApplicationCommandInteractionDataOptionWithValues[];
|
||||
}
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommandGroup {
|
||||
@@ -108,10 +182,10 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
|
||||
| ApplicationCommandInteractionDataOptionNumber
|
||||
| ApplicationCommandInteractionDataOptionBoolean;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionString = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.String,
|
||||
string
|
||||
>;
|
||||
export interface ApplicationCommandInteractionDataOptionString
|
||||
extends InteractionDataOptionBase<ApplicationCommandOptionType.String, string> {
|
||||
focused?: boolean;
|
||||
}
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionRole = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Role,
|
||||
@@ -133,15 +207,15 @@ export type ApplicationCommandInteractionDataOptionMentionable = InteractionData
|
||||
Snowflake
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Integer,
|
||||
number
|
||||
>;
|
||||
export interface ApplicationCommandInteractionDataOptionInteger
|
||||
extends InteractionDataOptionBase<ApplicationCommandOptionType.Integer, number> {
|
||||
focused?: boolean;
|
||||
}
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionNumber = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Number,
|
||||
number
|
||||
>;
|
||||
export interface ApplicationCommandInteractionDataOptionNumber
|
||||
extends InteractionDataOptionBase<ApplicationCommandOptionType.Number, number> {
|
||||
focused?: boolean;
|
||||
}
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionBoolean = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Boolean,
|
||||
|
||||
6
deno/payloads/v8/_interactions/autocomplete.ts
Normal file
6
deno/payloads/v8/_interactions/autocomplete.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { APIBaseInteraction, APIChatInputApplicationCommandInteractionData, InteractionType } from '../mod.ts';
|
||||
|
||||
export type APIApplicationCommandAutocompleteInteraction = APIBaseInteraction<
|
||||
InteractionType.ApplicationCommandAutocomplete,
|
||||
APIChatInputApplicationCommandInteractionData
|
||||
>;
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { MessageFlags } from '../mod.ts';
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v8.ts';
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
|
||||
@@ -8,6 +9,7 @@ export enum InteractionType {
|
||||
Ping = 1,
|
||||
ApplicationCommand,
|
||||
MessageComponent,
|
||||
ApplicationCommandAutocomplete,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -18,12 +20,18 @@ export type APIInteractionResponse =
|
||||
| APIInteractionResponseChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredMessageUpdate
|
||||
| APIInteractionResponseUpdateMessage;
|
||||
| APIInteractionResponseUpdateMessage
|
||||
| APIApplicationCommandAutocompleteResponse;
|
||||
|
||||
export interface APIInteractionResponsePong {
|
||||
type: InteractionResponseType.Pong;
|
||||
}
|
||||
|
||||
export interface APIApplicationCommandAutocompleteResponse {
|
||||
type: InteractionResponseType.ApplicationCommandAutocompleteResult;
|
||||
data: APICommandAutocompleteInteractionResponseCallbackData;
|
||||
}
|
||||
|
||||
export interface APIInteractionResponseChannelMessageWithSource {
|
||||
type: InteractionResponseType.ChannelMessageWithSource;
|
||||
data: APIInteractionResponseCallbackData;
|
||||
@@ -67,6 +75,10 @@ export enum InteractionResponseType {
|
||||
* ACK a button interaction and edit the message to which the button was attached
|
||||
*/
|
||||
UpdateMessage,
|
||||
/**
|
||||
* For autocomplete interactions
|
||||
*/
|
||||
ApplicationCommandAutocompleteResult,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,3 +88,7 @@ export type APIInteractionResponseCallbackData = Omit<
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
'username' | 'avatar_url'
|
||||
> & { flags?: MessageFlags };
|
||||
|
||||
export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
@@ -106,4 +106,6 @@ export enum ApplicationFlags {
|
||||
GatewayGuildMembersLimited = 1 << 15,
|
||||
VerificationPendingGuildLimit = 1 << 16,
|
||||
Embedded = 1 << 17,
|
||||
GatewayMessageContent = 1 << 18,
|
||||
GatewayMessageContentLimited = 1 << 19,
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import type { StickerFormatType } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIWebhook } from './webhook.ts';
|
||||
import type { StageInstancePrivacyLevel } from './stageInstance.ts';
|
||||
import type { GuildScheduledEventEntityType, GuildScheduledEventStatus } from './guildScheduledEvent.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
|
||||
@@ -144,6 +145,10 @@ export enum AuditLogEvent {
|
||||
StickerCreate = 90,
|
||||
StickerUpdate,
|
||||
StickerDelete,
|
||||
|
||||
GuildScheduledEventCreate = 100,
|
||||
GuildScheduledEventUpdate,
|
||||
GuildScheduledEventDelete,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -302,7 +307,10 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyGuildId;
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeyLocation;
|
||||
|
||||
/**
|
||||
* Returned when an entity's name is changed
|
||||
@@ -310,7 +318,7 @@ export type APIAuditLogChange =
|
||||
export type APIAuditLogChangeKeyName = AuditLogChangeData<'name', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's or sticker's description is changed
|
||||
* Returned when a guild's or sticker's or guild scheduled event's description is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDescription = AuditLogChangeData<'description', string>;
|
||||
|
||||
@@ -502,7 +510,7 @@ export type APIAuditLogChangeKeyDeny = AuditLogChangeData<'deny', string>;
|
||||
export type APIAuditLogChangeKeyCode = AuditLogChangeData<'code', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's channel_id is changed
|
||||
* Returned when an invite's or guild scheduled event's channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyChannelId = AuditLogChangeData<'channel_id', Snowflake>;
|
||||
|
||||
@@ -582,7 +590,7 @@ export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_g
|
||||
export type APIAuditLogChangeKeyUserLimit = AuditLogChangeData<'user_limit', number>;
|
||||
|
||||
/**
|
||||
* Returned when privacy level of a stage instance is changed
|
||||
* Returned when privacy level of a stage instance or guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPrivacyLevel = AuditLogChangeData<'privacy_level', StageInstancePrivacyLevel>;
|
||||
|
||||
@@ -611,6 +619,21 @@ export type APIAuditLogChangeKeyAvailable = AuditLogChangeData<'available', bool
|
||||
*/
|
||||
export type APIAuditLogChangeKeyGuildId = AuditLogChangeData<'guild_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when entity type of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEntityType = AuditLogChangeData<'entity_type', GuildScheduledEventEntityType>;
|
||||
|
||||
/**
|
||||
* Returned when status of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyStatus = AuditLogChangeData<'status', GuildScheduledEventStatus>;
|
||||
|
||||
/**
|
||||
* Returned when location of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D extends unknown> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -807,6 +807,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The attachment's media type
|
||||
*
|
||||
@@ -833,6 +837,10 @@ export interface APIAttachment {
|
||||
* Width of file (if image)
|
||||
*/
|
||||
width?: number | null;
|
||||
/**
|
||||
* Whether this attachment is ephemeral
|
||||
*/
|
||||
ephemeral?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -298,6 +298,9 @@ export enum ActivityFlags {
|
||||
JoinRequest = 1 << 3,
|
||||
Sync = 1 << 4,
|
||||
Play = 1 << 5,
|
||||
PartyPrivacyFriends = 1 << 6,
|
||||
PartyPrivacyVoiceChannel = 1 << 7,
|
||||
Embedded = 1 << 8,
|
||||
}
|
||||
|
||||
export interface GatewayActivityButton {
|
||||
|
||||
@@ -11,6 +11,7 @@ import type { APIStageInstance } from './stageInstance.ts';
|
||||
import type { APISticker } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { GatewayVoiceState } from './voice.ts';
|
||||
import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -325,6 +326,18 @@ export interface APIGuild extends APIPartialGuild {
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
stickers: APISticker[];
|
||||
/**
|
||||
* Whether the guild has the boost progress bar enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled: boolean;
|
||||
/**
|
||||
* The scheduled events in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
|
||||
*/
|
||||
guild_scheduled_events?: APIGuildScheduledEvent[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -414,6 +427,10 @@ export enum GuildSystemChannelFlags {
|
||||
* Suppress server setup tips
|
||||
*/
|
||||
SuppressGuildReminderNotifications = 1 << 2,
|
||||
/**
|
||||
* Hide member join sticker reply buttons
|
||||
*/
|
||||
SuppressJoinNotificationReplies = 1 << 3,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -448,6 +465,18 @@ export enum GuildFeature {
|
||||
* Guild has access to set an invite splash background
|
||||
*/
|
||||
InviteSplash = 'INVITE_SPLASH',
|
||||
/**
|
||||
* Guild has enabled Membership Screening
|
||||
*/
|
||||
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
|
||||
/**
|
||||
* Guild has enabled monetization
|
||||
*/
|
||||
MonetizationEnabled = 'MONETIZATION_ENABLED',
|
||||
/**
|
||||
* Guild has increased custom sticker slots
|
||||
*/
|
||||
MoreStickers = 'MORE_STICKERS',
|
||||
/**
|
||||
* Guild has access to create news channels
|
||||
*/
|
||||
@@ -456,7 +485,31 @@ export enum GuildFeature {
|
||||
* Guild is partnered
|
||||
*/
|
||||
Partnered = 'PARTNERED',
|
||||
/**
|
||||
* Guild can be previewed before joining via Membership Screening or the directory
|
||||
*/
|
||||
PreviewEnabled = 'PREVIEW_ENABLED',
|
||||
/**
|
||||
* Guild has access to create private threads
|
||||
*/
|
||||
PrivateThreads = 'PRIVATE_THREADS',
|
||||
RelayEnabled = 'RELAY_ENABLED',
|
||||
/**
|
||||
* Guild is able to set role icons
|
||||
*/
|
||||
RoleIcons = 'ROLE_ICONS',
|
||||
/**
|
||||
* Guild has access to the seven day archive time for threads
|
||||
*/
|
||||
SevenDayThreadArchive = 'SEVEN_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has access to the three day archive time for threads
|
||||
*/
|
||||
ThreeDayThreadArchive = 'THREE_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has enabled ticketed events
|
||||
*/
|
||||
TicketedEventsEnabled = 'TICKETED_EVENTS_ENABLED',
|
||||
/**
|
||||
* Guild has access to set a vanity URL
|
||||
*/
|
||||
@@ -473,38 +526,6 @@ export enum GuildFeature {
|
||||
* Guild has enabled the welcome screen
|
||||
*/
|
||||
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
|
||||
/**
|
||||
* Guild has enabled Membership Screening
|
||||
*/
|
||||
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
|
||||
/**
|
||||
* Guild can be previewed before joining via Membership Screening or the directory
|
||||
*/
|
||||
PreviewEnabled = 'PREVIEW_ENABLED',
|
||||
/**
|
||||
* Guild has enabled ticketed events
|
||||
*/
|
||||
TicketedEventsEnabled = 'TICKETED_EVENTS_ENABLED',
|
||||
/**
|
||||
* Guild has enabled monetization
|
||||
*/
|
||||
MonetizationEnabled = 'MONETIZATION_ENABLED',
|
||||
/**
|
||||
* Guild has increased custom sticker slots
|
||||
*/
|
||||
MoreStickers = 'MORE_STICKERS',
|
||||
/**
|
||||
* Guild has access to the three day archive time for threads
|
||||
*/
|
||||
ThreeDayThreadArchive = 'THREE_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has access to the seven day archive time for threads
|
||||
*/
|
||||
SevenDayThreadArchive = 'SEVEN_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has access to create private threads
|
||||
*/
|
||||
PrivateThreads = 'PRIVATE_THREADS',
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -593,6 +614,10 @@ export interface APIGuildMember {
|
||||
* This users guild nickname
|
||||
*/
|
||||
nick?: string | null;
|
||||
/**
|
||||
* The member's guild avatar hash
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* Array of role object ids
|
||||
*
|
||||
|
||||
104
deno/payloads/v8/guildScheduledEvent.ts
Normal file
104
deno/payloads/v8/guildScheduledEvent.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
export interface APIGuildScheduledEvent {
|
||||
/**
|
||||
* The id of the guild event
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The guild id which the scheduled event belongs to
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The channel id in which the scheduled event will be hosted, or `null` if entity type is `EXTERNAL`
|
||||
*/
|
||||
channel_id: Snowflake | null;
|
||||
/**
|
||||
* The id of the user that created the scheduled event
|
||||
*/
|
||||
creator_id: Snowflake | null;
|
||||
/**
|
||||
* The name of the scheduled event
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The description of the scheduled event
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The time the scheduled event will start
|
||||
*/
|
||||
scheduled_start_time: string;
|
||||
/**
|
||||
* The time at which the guild event will end, or `null` if the event does not have a scheduled time to end
|
||||
*/
|
||||
scheduled_end_time: string | null;
|
||||
/**
|
||||
* The privacy level of the scheduled event
|
||||
*/
|
||||
privacy_level: GuildScheduledEventPrivacyLevel;
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status: GuildScheduledEventStatus;
|
||||
/**
|
||||
* The type of hosting entity associated with the scheduled event
|
||||
*/
|
||||
entity_type: GuildScheduledEventEntityType;
|
||||
/**
|
||||
* The id of the hosting entity associated with the scheduled event
|
||||
*/
|
||||
entity_id: Snowflake | null;
|
||||
/**
|
||||
* The entity metadata for the scheduled event
|
||||
*/
|
||||
entity_metadata: APIGuildScheduledEventEntityMetadata;
|
||||
/**
|
||||
* The user that created the scheduled event
|
||||
*/
|
||||
creator?: APIUser;
|
||||
/**
|
||||
* The number of users subscribed to the scheduled event
|
||||
*/
|
||||
user_count?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
|
||||
*/
|
||||
export interface APIGuildScheduledEventEntityMetadata {
|
||||
/**
|
||||
* The location of the scheduled event
|
||||
*/
|
||||
location?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types
|
||||
*/
|
||||
export enum GuildScheduledEventEntityType {
|
||||
StageInstance = 1,
|
||||
Voice,
|
||||
External,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status
|
||||
*/
|
||||
export enum GuildScheduledEventStatus {
|
||||
Scheduled = 1,
|
||||
Active,
|
||||
Completed,
|
||||
Canceled,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level
|
||||
*/
|
||||
export enum GuildScheduledEventPrivacyLevel {
|
||||
/**
|
||||
* The scheduled event is only accessible to guild members
|
||||
*/
|
||||
GuildOnly = 2,
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import type {
|
||||
APIApplicationCommandGuildInteraction,
|
||||
APIApplicationCommandInteraction,
|
||||
} from './_interactions/applicationCommands.ts';
|
||||
import type { APIApplicationCommandAutocompleteInteraction } from './_interactions/autocomplete.ts';
|
||||
|
||||
export * from './_interactions/base.ts';
|
||||
export * from './_interactions/messageComponents.ts';
|
||||
@@ -19,7 +20,11 @@ export * from './_interactions/applicationCommands.ts';
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIInteraction = APIPingInteraction | APIApplicationCommandInteraction | APIMessageComponentInteraction;
|
||||
export type APIInteraction =
|
||||
| APIPingInteraction
|
||||
| APIApplicationCommandInteraction
|
||||
| APIMessageComponentInteraction
|
||||
| APIApplicationCommandAutocompleteInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
|
||||
@@ -7,6 +7,7 @@ import type { APIPartialGuild } from './guild.ts';
|
||||
import type { APIApplication } from './application.ts';
|
||||
import type { APIInviteStageInstance } from './stageInstance.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object
|
||||
@@ -68,6 +69,10 @@ export interface APIInvite {
|
||||
* The stage instance data if there is a public stage instance in the stage channel this invite is for
|
||||
*/
|
||||
stage_instance?: APIInviteStageInstance;
|
||||
/**
|
||||
* The guild scheduled event data, returned from the `GET /invites/<code>` endpoint when `guild_scheduled_event_id` is a valid guild scheduled event id
|
||||
*/
|
||||
guild_scheduled_event?: APIGuildScheduledEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,7 @@ export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
export * from './guild.ts';
|
||||
export * from './guildScheduledEvent.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
|
||||
@@ -45,7 +45,9 @@ export const PermissionFlagsBits = {
|
||||
ManageEmojisAndStickers: 1n << 30n,
|
||||
UseApplicationCommands: 1n << 31n,
|
||||
RequestToSpeak: 1n << 32n,
|
||||
ManageEvents: 1n << 33n,
|
||||
UseExternalStickers: 1n << 37n,
|
||||
StartEmbeddedActivities: 1n << 39n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
@@ -74,6 +76,14 @@ export interface APIRole {
|
||||
* If this role is pinned in the user listing
|
||||
*/
|
||||
hoist: boolean;
|
||||
/**
|
||||
* The role icon hash
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The role unicode emoji as a standard emoji
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
/**
|
||||
* Position of this role
|
||||
*/
|
||||
|
||||
@@ -85,20 +85,66 @@ export interface APIUser {
|
||||
* https://discord.com/developers/docs/resources/user#user-object-user-flags
|
||||
*/
|
||||
export enum UserFlags {
|
||||
/**
|
||||
* None
|
||||
*/
|
||||
None = 0,
|
||||
DiscordEmployee = 1 << 0,
|
||||
PartneredServerOwner = 1 << 1,
|
||||
DiscordHypeSquadEvents = 1 << 2,
|
||||
/**
|
||||
* Discord Employee
|
||||
*/
|
||||
Staff = 1 << 0,
|
||||
/**
|
||||
* Partnered Server Owner
|
||||
*/
|
||||
Partner = 1 << 1,
|
||||
/**
|
||||
* HypeSquad Events Coordinator
|
||||
*/
|
||||
Hypesquad = 1 << 2,
|
||||
/**
|
||||
* Bug Hunter Level 1
|
||||
*/
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
HypeSquadHouseBravery = 1 << 6,
|
||||
HypeSquadHouseBrilliance = 1 << 7,
|
||||
HypeSquadHouseBalance = 1 << 8,
|
||||
EarlySupporter = 1 << 9,
|
||||
TeamUser = 1 << 10,
|
||||
/**
|
||||
* House Bravery Member
|
||||
*/
|
||||
HypeSquadOnlineHouse1 = 1 << 6,
|
||||
/**
|
||||
* House Brilliance Member
|
||||
*/
|
||||
HypeSquadOnlineHouse2 = 1 << 7,
|
||||
/**
|
||||
* House Balance Member
|
||||
*/
|
||||
HypeSquadOnlineHouse3 = 1 << 8,
|
||||
/**
|
||||
* Early Nitro Supporter
|
||||
*/
|
||||
PremiumEarlySupporter = 1 << 9,
|
||||
/**
|
||||
* User is a [team](https://discord.com/developers/docs/topics/teams)
|
||||
*/
|
||||
TeamPseudoUser = 1 << 10,
|
||||
/**
|
||||
* Bug Hunter Level 2
|
||||
*/
|
||||
BugHunterLevel2 = 1 << 14,
|
||||
/**
|
||||
* Verified Bot
|
||||
*/
|
||||
VerifiedBot = 1 << 16,
|
||||
EarlyVerifiedBotDeveloper = 1 << 17,
|
||||
DiscordCertifiedModerator = 1 << 18,
|
||||
/**
|
||||
* Early Verified Bot Developer
|
||||
*/
|
||||
VerifiedDeveloper = 1 << 17,
|
||||
/**
|
||||
* Discord Certified Moderator
|
||||
*/
|
||||
CertifiedModerator = 1 << 18,
|
||||
/**
|
||||
* Bot uses only [HTTP interactions](https://discord.com/developers/docs/interactions/receiving-and-responding#receiving-an-interaction) and is shown in the online member list
|
||||
*/
|
||||
BotHTTPInteractions = 1 << 19,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,10 +77,6 @@ export interface APIVoiceRegion {
|
||||
* Name of the region
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* `true` if this is a vip-only server
|
||||
*/
|
||||
vip: boolean;
|
||||
/**
|
||||
* `true` for a single server that is closest to the current user's client
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { APIRole, APIUser } from '../../mod.ts';
|
||||
import type { APIRole, APIUser, ChannelType } from '../../mod.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
import type {
|
||||
@@ -13,22 +13,26 @@ interface APIApplicationCommandOptionBase {
|
||||
type:
|
||||
| ApplicationCommandOptionType.Boolean
|
||||
| ApplicationCommandOptionType.User
|
||||
| ApplicationCommandOptionType.Channel
|
||||
| ApplicationCommandOptionType.Role
|
||||
| ApplicationCommandOptionType.Mentionable;
|
||||
name: string;
|
||||
description: string;
|
||||
default?: boolean;
|
||||
required?: boolean;
|
||||
autocomplete?: never;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
|
||||
*/
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandArgumentOptions
|
||||
| APIApplicationCommandStringArgumentOptions
|
||||
| APIApplicationCommandSubCommandOptions
|
||||
| APIApplicationCommandOptionBase;
|
||||
| APIApplicationCommandOptionBase
|
||||
| APIApplicationCommandChannelOptions
|
||||
| APIApplicationCommandOptionBase
|
||||
| APIApplicationCommandNumberArgumentOptions
|
||||
| APIApplicationCommandStringAutocompleteOptions
|
||||
| APIApplicationCommandNumericAutocompleteOptions;
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
@@ -44,14 +48,80 @@ export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicat
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions`, these types cannot have an `options` array,
|
||||
* but they can have a `choices` one
|
||||
* but they can have a either a `choices` or a `autocomplete` field where it's set to false.
|
||||
*/
|
||||
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
export interface APIApplicationCommandStringArgumentOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type:
|
||||
| ApplicationCommandOptionType.String
|
||||
| ApplicationCommandOptionType.Integer
|
||||
| ApplicationCommandOptionType.Number;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
autocomplete?: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array,
|
||||
* but they can a `autocomplete` field where it's set to `true`
|
||||
*/
|
||||
export interface APIApplicationCommandStringAutocompleteOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type: ApplicationCommandOptionType.String;
|
||||
autocomplete: true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array,
|
||||
* but they can a `autocomplete` field where it's set to `true`
|
||||
*/
|
||||
export interface APIApplicationCommandNumericAutocompleteOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number;
|
||||
autocomplete: true;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions`, these types cannot have an `options` array,
|
||||
* but they can have a `choices`, a `min_value` and `max_value` field
|
||||
*/
|
||||
export interface APIApplicationCommandNumberArgumentOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* if the option is an `INTEGER` or `NUMBER` type, the maximum value permitted
|
||||
*/
|
||||
max_value?: number;
|
||||
autocomplete?: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions` and `APIApplicationCommandArgumentOptions`,
|
||||
* these types cannot have an `options` array, or a `choices` array, but they can have a `channel_types` one.
|
||||
*/
|
||||
export interface APIApplicationCommandChannelOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.Channel;
|
||||
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,7 +159,7 @@ export type APIApplicationCommandInteractionDataOption =
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommand {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.Subcommand;
|
||||
options: APIApplicationCommandInteractionDataOptionWithValues[];
|
||||
options?: APIApplicationCommandInteractionDataOptionWithValues[];
|
||||
}
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommandGroup {
|
||||
@@ -108,10 +178,10 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
|
||||
| ApplicationCommandInteractionDataOptionNumber
|
||||
| ApplicationCommandInteractionDataOptionBoolean;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionString = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.String,
|
||||
string
|
||||
>;
|
||||
export interface ApplicationCommandInteractionDataOptionString
|
||||
extends InteractionDataOptionBase<ApplicationCommandOptionType.String, string> {
|
||||
focused?: boolean;
|
||||
}
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionRole = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Role,
|
||||
@@ -133,15 +203,15 @@ export type ApplicationCommandInteractionDataOptionMentionable = InteractionData
|
||||
Snowflake
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Integer,
|
||||
number
|
||||
>;
|
||||
export interface ApplicationCommandInteractionDataOptionInteger
|
||||
extends InteractionDataOptionBase<ApplicationCommandOptionType.Integer, number> {
|
||||
focused?: boolean;
|
||||
}
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionNumber = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Number,
|
||||
number
|
||||
>;
|
||||
export interface ApplicationCommandInteractionDataOptionNumber
|
||||
extends InteractionDataOptionBase<ApplicationCommandOptionType.Number, number> {
|
||||
focused?: boolean;
|
||||
}
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionBoolean = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Boolean,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { APIPartialChannel } from '../channel.ts';
|
||||
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIBaseInteraction } from './base.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
@@ -85,7 +85,9 @@ export type APIApplicationCommandInteractionData =
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
|
||||
thread_metadata?: APIThreadMetadata | null;
|
||||
permissions: Permissions;
|
||||
parent_id?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
6
deno/payloads/v9/_interactions/autocomplete.ts
Normal file
6
deno/payloads/v9/_interactions/autocomplete.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { APIBaseInteraction, APIChatInputApplicationCommandInteractionData, InteractionType } from '../mod.ts';
|
||||
|
||||
export type APIApplicationCommandAutocompleteInteraction = APIBaseInteraction<
|
||||
InteractionType.ApplicationCommandAutocomplete,
|
||||
APIChatInputApplicationCommandInteractionData
|
||||
>;
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { MessageFlags } from '../mod.ts';
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v9.ts';
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
|
||||
@@ -8,6 +9,7 @@ export enum InteractionType {
|
||||
Ping = 1,
|
||||
ApplicationCommand,
|
||||
MessageComponent,
|
||||
ApplicationCommandAutocomplete,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -18,12 +20,18 @@ export type APIInteractionResponse =
|
||||
| APIInteractionResponseChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredMessageUpdate
|
||||
| APIInteractionResponseUpdateMessage;
|
||||
| APIInteractionResponseUpdateMessage
|
||||
| APIApplicationCommandAutocompleteResponse;
|
||||
|
||||
export interface APIInteractionResponsePong {
|
||||
type: InteractionResponseType.Pong;
|
||||
}
|
||||
|
||||
export interface APIApplicationCommandAutocompleteResponse {
|
||||
type: InteractionResponseType.ApplicationCommandAutocompleteResult;
|
||||
data: APICommandAutocompleteInteractionResponseCallbackData;
|
||||
}
|
||||
|
||||
export interface APIInteractionResponseChannelMessageWithSource {
|
||||
type: InteractionResponseType.ChannelMessageWithSource;
|
||||
data: APIInteractionResponseCallbackData;
|
||||
@@ -67,6 +75,10 @@ export enum InteractionResponseType {
|
||||
* ACK a button interaction and edit the message to which the button was attached
|
||||
*/
|
||||
UpdateMessage,
|
||||
/**
|
||||
* For autocomplete interactions
|
||||
*/
|
||||
ApplicationCommandAutocompleteResult,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,3 +88,7 @@ export type APIInteractionResponseCallbackData = Omit<
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
'username' | 'avatar_url'
|
||||
> & { flags?: MessageFlags };
|
||||
|
||||
export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
@@ -106,4 +106,6 @@ export enum ApplicationFlags {
|
||||
GatewayGuildMembersLimited = 1 << 15,
|
||||
VerificationPendingGuildLimit = 1 << 16,
|
||||
Embedded = 1 << 17,
|
||||
GatewayMessageContent = 1 << 18,
|
||||
GatewayMessageContentLimited = 1 << 19,
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import type { StickerFormatType } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIWebhook } from './webhook.ts';
|
||||
import type { StageInstancePrivacyLevel } from './stageInstance.ts';
|
||||
import type { GuildScheduledEventEntityType, GuildScheduledEventStatus } from './guildScheduledEvent.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
|
||||
@@ -153,6 +154,10 @@ export enum AuditLogEvent {
|
||||
StickerUpdate,
|
||||
StickerDelete,
|
||||
|
||||
GuildScheduledEventCreate = 100,
|
||||
GuildScheduledEventUpdate,
|
||||
GuildScheduledEventDelete,
|
||||
|
||||
ThreadCreate = 110,
|
||||
ThreadUpdate,
|
||||
ThreadDelete,
|
||||
@@ -318,7 +323,10 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration;
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeyLocation;
|
||||
|
||||
/**
|
||||
* Returned when an entity's name is changed
|
||||
@@ -326,7 +334,7 @@ export type APIAuditLogChange =
|
||||
export type APIAuditLogChangeKeyName = AuditLogChangeData<'name', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's or sticker's description is changed
|
||||
* Returned when a guild's or sticker's or guild scheduled event's description is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDescription = AuditLogChangeData<'description', string>;
|
||||
|
||||
@@ -518,7 +526,7 @@ export type APIAuditLogChangeKeyDeny = AuditLogChangeData<'deny', string>;
|
||||
export type APIAuditLogChangeKeyCode = AuditLogChangeData<'code', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's channel_id is changed
|
||||
* Returned when an invite's or guild scheduled event's channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyChannelId = AuditLogChangeData<'channel_id', Snowflake>;
|
||||
|
||||
@@ -598,7 +606,7 @@ export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_g
|
||||
export type APIAuditLogChangeKeyUserLimit = AuditLogChangeData<'user_limit', number>;
|
||||
|
||||
/**
|
||||
* Returned when privacy level of a stage instance is changed
|
||||
* Returned when privacy level of a stage instance or guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPrivacyLevel = AuditLogChangeData<'privacy_level', StageInstancePrivacyLevel>;
|
||||
|
||||
@@ -650,6 +658,21 @@ export type APIAuditLogChangeKeyDefaultAutoArchiveDuration = AuditLogChangeData<
|
||||
number
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when entity type of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEntityType = AuditLogChangeData<'entity_type', GuildScheduledEventEntityType>;
|
||||
|
||||
/**
|
||||
* Returned when status of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyStatus = AuditLogChangeData<'status', GuildScheduledEventStatus>;
|
||||
|
||||
/**
|
||||
* Returned when location of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D extends unknown> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -936,6 +936,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The attachment's media type
|
||||
*
|
||||
@@ -962,6 +966,10 @@ export interface APIAttachment {
|
||||
* Width of file (if image)
|
||||
*/
|
||||
width?: number | null;
|
||||
/**
|
||||
* Whether this attachment is ephemeral
|
||||
*/
|
||||
ephemeral?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -299,6 +299,9 @@ export enum ActivityFlags {
|
||||
JoinRequest = 1 << 3,
|
||||
Sync = 1 << 4,
|
||||
Play = 1 << 5,
|
||||
PartyPrivacyFriends = 1 << 6,
|
||||
PartyPrivacyVoiceChannel = 1 << 7,
|
||||
Embedded = 1 << 8,
|
||||
}
|
||||
|
||||
export interface GatewayActivityButton {
|
||||
|
||||
@@ -11,6 +11,7 @@ import type { APIStageInstance } from './stageInstance.ts';
|
||||
import type { APISticker } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { GatewayVoiceState } from './voice.ts';
|
||||
import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -333,6 +334,18 @@ export interface APIGuild extends APIPartialGuild {
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
stickers: APISticker[];
|
||||
/**
|
||||
* Whether the guild has the boost progress bar enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled: boolean;
|
||||
/**
|
||||
* The scheduled events in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
|
||||
*/
|
||||
guild_scheduled_events?: APIGuildScheduledEvent[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -422,6 +435,10 @@ export enum GuildSystemChannelFlags {
|
||||
* Suppress server setup tips
|
||||
*/
|
||||
SuppressGuildReminderNotifications = 1 << 2,
|
||||
/**
|
||||
* Hide member join sticker reply buttons
|
||||
*/
|
||||
SuppressJoinNotificationReplies = 1 << 3,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -456,6 +473,18 @@ export enum GuildFeature {
|
||||
* Guild has access to set an invite splash background
|
||||
*/
|
||||
InviteSplash = 'INVITE_SPLASH',
|
||||
/**
|
||||
* Guild has enabled Membership Screening
|
||||
*/
|
||||
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
|
||||
/**
|
||||
* Guild has enabled monetization
|
||||
*/
|
||||
MonetizationEnabled = 'MONETIZATION_ENABLED',
|
||||
/**
|
||||
* Guild has increased custom sticker slots
|
||||
*/
|
||||
MoreStickers = 'MORE_STICKERS',
|
||||
/**
|
||||
* Guild has access to create news channels
|
||||
*/
|
||||
@@ -464,7 +493,31 @@ export enum GuildFeature {
|
||||
* Guild is partnered
|
||||
*/
|
||||
Partnered = 'PARTNERED',
|
||||
/**
|
||||
* Guild can be previewed before joining via Membership Screening or the directory
|
||||
*/
|
||||
PreviewEnabled = 'PREVIEW_ENABLED',
|
||||
/**
|
||||
* Guild has access to create private threads
|
||||
*/
|
||||
PrivateThreads = 'PRIVATE_THREADS',
|
||||
RelayEnabled = 'RELAY_ENABLED',
|
||||
/**
|
||||
* Guild is able to set role icons
|
||||
*/
|
||||
RoleIcons = 'ROLE_ICONS',
|
||||
/**
|
||||
* Guild has access to the seven day archive time for threads
|
||||
*/
|
||||
SevenDayThreadArchive = 'SEVEN_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has access to the three day archive time for threads
|
||||
*/
|
||||
ThreeDayThreadArchive = 'THREE_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has enabled ticketed events
|
||||
*/
|
||||
TicketedEventsEnabled = 'TICKETED_EVENTS_ENABLED',
|
||||
/**
|
||||
* Guild has access to set a vanity URL
|
||||
*/
|
||||
@@ -481,38 +534,6 @@ export enum GuildFeature {
|
||||
* Guild has enabled the welcome screen
|
||||
*/
|
||||
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
|
||||
/**
|
||||
* Guild has enabled Membership Screening
|
||||
*/
|
||||
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
|
||||
/**
|
||||
* Guild can be previewed before joining via Membership Screening or the directory
|
||||
*/
|
||||
PreviewEnabled = 'PREVIEW_ENABLED',
|
||||
/**
|
||||
* Guild has enabled ticketed events
|
||||
*/
|
||||
TicketedEventsEnabled = 'TICKETED_EVENTS_ENABLED',
|
||||
/**
|
||||
* Guild has enabled monetization
|
||||
*/
|
||||
MonetizationEnabled = 'MONETIZATION_ENABLED',
|
||||
/**
|
||||
* Guild has increased custom sticker slots
|
||||
*/
|
||||
MoreStickers = 'MORE_STICKERS',
|
||||
/**
|
||||
* Guild has access to the three day archive time for threads
|
||||
*/
|
||||
ThreeDayThreadArchive = 'THREE_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has access to the seven day archive time for threads
|
||||
*/
|
||||
SevenDayThreadArchive = 'SEVEN_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has access to create private threads
|
||||
*/
|
||||
PrivateThreads = 'PRIVATE_THREADS',
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -601,6 +622,10 @@ export interface APIGuildMember {
|
||||
* This users guild nickname
|
||||
*/
|
||||
nick?: string | null;
|
||||
/**
|
||||
* The member's guild avatar hash
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* Array of role object ids
|
||||
*
|
||||
|
||||
104
deno/payloads/v9/guildScheduledEvent.ts
Normal file
104
deno/payloads/v9/guildScheduledEvent.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
export interface APIGuildScheduledEvent {
|
||||
/**
|
||||
* The id of the guild event
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The guild id which the scheduled event belongs to
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The channel id in which the scheduled event will be hosted, or `null` if entity type is `EXTERNAL`
|
||||
*/
|
||||
channel_id: Snowflake | null;
|
||||
/**
|
||||
* The id of the user that created the scheduled event
|
||||
*/
|
||||
creator_id: Snowflake | null;
|
||||
/**
|
||||
* The name of the scheduled event
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The description of the scheduled event
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The time the scheduled event will start
|
||||
*/
|
||||
scheduled_start_time: string;
|
||||
/**
|
||||
* The time at which the guild event will end, or `null` if the event does not have a scheduled time to end
|
||||
*/
|
||||
scheduled_end_time: string | null;
|
||||
/**
|
||||
* The privacy level of the scheduled event
|
||||
*/
|
||||
privacy_level: GuildScheduledEventPrivacyLevel;
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status: GuildScheduledEventStatus;
|
||||
/**
|
||||
* The type of hosting entity associated with the scheduled event
|
||||
*/
|
||||
entity_type: GuildScheduledEventEntityType;
|
||||
/**
|
||||
* The id of the hosting entity associated with the scheduled event
|
||||
*/
|
||||
entity_id: Snowflake | null;
|
||||
/**
|
||||
* The entity metadata for the scheduled event
|
||||
*/
|
||||
entity_metadata: APIGuildScheduledEventEntityMetadata;
|
||||
/**
|
||||
* The user that created the scheduled event
|
||||
*/
|
||||
creator?: APIUser;
|
||||
/**
|
||||
* The number of users subscribed to the scheduled event
|
||||
*/
|
||||
user_count?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
|
||||
*/
|
||||
export interface APIGuildScheduledEventEntityMetadata {
|
||||
/**
|
||||
* The location of the scheduled event
|
||||
*/
|
||||
location?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types
|
||||
*/
|
||||
export enum GuildScheduledEventEntityType {
|
||||
StageInstance = 1,
|
||||
Voice,
|
||||
External,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status
|
||||
*/
|
||||
export enum GuildScheduledEventStatus {
|
||||
Scheduled = 1,
|
||||
Active,
|
||||
Completed,
|
||||
Canceled,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level
|
||||
*/
|
||||
export enum GuildScheduledEventPrivacyLevel {
|
||||
/**
|
||||
* The scheduled event is only accessible to guild members
|
||||
*/
|
||||
GuildOnly = 2,
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import type {
|
||||
APIApplicationCommandGuildInteraction,
|
||||
APIApplicationCommandInteraction,
|
||||
} from './_interactions/applicationCommands.ts';
|
||||
import type { APIApplicationCommandAutocompleteInteraction } from './_interactions/autocomplete.ts';
|
||||
|
||||
export * from './_interactions/base.ts';
|
||||
export * from './_interactions/messageComponents.ts';
|
||||
@@ -19,7 +20,11 @@ export * from './_interactions/applicationCommands.ts';
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIInteraction = APIPingInteraction | APIApplicationCommandInteraction | APIMessageComponentInteraction;
|
||||
export type APIInteraction =
|
||||
| APIPingInteraction
|
||||
| APIApplicationCommandInteraction
|
||||
| APIMessageComponentInteraction
|
||||
| APIApplicationCommandAutocompleteInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
|
||||
@@ -7,6 +7,7 @@ import type { APIPartialGuild } from './guild.ts';
|
||||
import type { APIApplication } from './application.ts';
|
||||
import type { APIInviteStageInstance } from './stageInstance.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object
|
||||
@@ -68,6 +69,10 @@ export interface APIInvite {
|
||||
* The stage instance data if there is a public stage instance in the stage channel this invite is for
|
||||
*/
|
||||
stage_instance?: APIInviteStageInstance;
|
||||
/**
|
||||
* The guild scheduled event data, returned from the `GET /invites/<code>` endpoint when `guild_scheduled_event_id` is a valid guild scheduled event id
|
||||
*/
|
||||
guild_scheduled_event?: APIGuildScheduledEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -4,6 +4,7 @@ export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
export * from './guild.ts';
|
||||
export * from './guildScheduledEvent.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
|
||||
@@ -45,10 +45,13 @@ export const PermissionFlagsBits = {
|
||||
ManageEmojisAndStickers: 1n << 30n,
|
||||
UseApplicationCommands: 1n << 31n,
|
||||
RequestToSpeak: 1n << 32n,
|
||||
ManageEvents: 1n << 33n,
|
||||
ManageThreads: 1n << 34n,
|
||||
UsePublicThreads: 1n << 35n,
|
||||
UsePrivateThreads: 1n << 36n,
|
||||
CreatePublicThreads: 1n << 35n,
|
||||
CreatePrivateThreads: 1n << 36n,
|
||||
UseExternalStickers: 1n << 37n,
|
||||
SendMessagesInThreads: 1n << 38n,
|
||||
StartEmbeddedActivities: 1n << 39n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
@@ -77,6 +80,14 @@ export interface APIRole {
|
||||
* If this role is pinned in the user listing
|
||||
*/
|
||||
hoist: boolean;
|
||||
/**
|
||||
* The role icon hash
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The role unicode emoji as a standard emoji
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
/**
|
||||
* Position of this role
|
||||
*/
|
||||
|
||||
@@ -85,20 +85,66 @@ export interface APIUser {
|
||||
* https://discord.com/developers/docs/resources/user#user-object-user-flags
|
||||
*/
|
||||
export enum UserFlags {
|
||||
/**
|
||||
* None
|
||||
*/
|
||||
None = 0,
|
||||
DiscordEmployee = 1 << 0,
|
||||
PartneredServerOwner = 1 << 1,
|
||||
DiscordHypeSquadEvents = 1 << 2,
|
||||
/**
|
||||
* Discord Employee
|
||||
*/
|
||||
Staff = 1 << 0,
|
||||
/**
|
||||
* Partnered Server Owner
|
||||
*/
|
||||
Partner = 1 << 1,
|
||||
/**
|
||||
* HypeSquad Events Coordinator
|
||||
*/
|
||||
Hypesquad = 1 << 2,
|
||||
/**
|
||||
* Bug Hunter Level 1
|
||||
*/
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
HypeSquadHouseBravery = 1 << 6,
|
||||
HypeSquadHouseBrilliance = 1 << 7,
|
||||
HypeSquadHouseBalance = 1 << 8,
|
||||
EarlySupporter = 1 << 9,
|
||||
TeamUser = 1 << 10,
|
||||
/**
|
||||
* House Bravery Member
|
||||
*/
|
||||
HypeSquadOnlineHouse1 = 1 << 6,
|
||||
/**
|
||||
* House Brilliance Member
|
||||
*/
|
||||
HypeSquadOnlineHouse2 = 1 << 7,
|
||||
/**
|
||||
* House Balance Member
|
||||
*/
|
||||
HypeSquadOnlineHouse3 = 1 << 8,
|
||||
/**
|
||||
* Early Nitro Supporter
|
||||
*/
|
||||
PremiumEarlySupporter = 1 << 9,
|
||||
/**
|
||||
* User is a [team](https://discord.com/developers/docs/topics/teams)
|
||||
*/
|
||||
TeamPseudoUser = 1 << 10,
|
||||
/**
|
||||
* Bug Hunter Level 2
|
||||
*/
|
||||
BugHunterLevel2 = 1 << 14,
|
||||
/**
|
||||
* Verified Bot
|
||||
*/
|
||||
VerifiedBot = 1 << 16,
|
||||
EarlyVerifiedBotDeveloper = 1 << 17,
|
||||
DiscordCertifiedModerator = 1 << 18,
|
||||
/**
|
||||
* Early Verified Bot Developer
|
||||
*/
|
||||
VerifiedDeveloper = 1 << 17,
|
||||
/**
|
||||
* Discord Certified Moderator
|
||||
*/
|
||||
CertifiedModerator = 1 << 18,
|
||||
/**
|
||||
* Bot uses only [HTTP interactions](https://discord.com/developers/docs/interactions/receiving-and-responding#receiving-an-interaction) and is shown in the online member list
|
||||
*/
|
||||
BotHTTPInteractions = 1 << 19,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,10 +77,6 @@ export interface APIVoiceRegion {
|
||||
* Name of the region
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* `true` if this is a vip-only server
|
||||
*/
|
||||
vip: boolean;
|
||||
/**
|
||||
* `true` for a single server that is closest to the current user's client
|
||||
*/
|
||||
|
||||
@@ -62,8 +62,8 @@ export enum RESTJSONErrorCodes {
|
||||
NotAuthorizedToPerformThisActionOnThisApplication = 20012,
|
||||
|
||||
ActionCannotBePerformedDueToSlowmodeRateLimit = 20016,
|
||||
|
||||
OnlyTheOwnerOfThisAccountCanPerformThisAction = 20018,
|
||||
TheMazeIsntMeantForYou,
|
||||
OnlyTheOwnerOfThisAccountCanPerformThisAction,
|
||||
|
||||
AnnouncementEditLimitExceeded = 20022,
|
||||
|
||||
@@ -101,6 +101,7 @@ export enum RESTJSONErrorCodes {
|
||||
MaximumNumberOfNonGuildMemberBansHasBeenExceeded = 30035,
|
||||
|
||||
MaximumNumberOfBanFetchesHasBeenReached = 30037,
|
||||
MaximumNumberOfUncompletedGuildScheduledEventsReached,
|
||||
|
||||
MaximumNumberOfStickersReached = 30039,
|
||||
MaximumNumberOfPruneRequestsHasBeenReached,
|
||||
@@ -172,6 +173,8 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
ServerNeedsMonetizationEnabledToPerformThisAction = 50097,
|
||||
|
||||
ServerNeedsMoreBoostsToPerformThisAction = 50101,
|
||||
|
||||
TwoFactorAuthenticationIsRequired = 60003,
|
||||
|
||||
NoUsersWithDiscordTagExist = 80004,
|
||||
@@ -196,4 +199,8 @@ export enum RESTJSONErrorCodes {
|
||||
LottieAnimationMaximumDimensionsExceeded,
|
||||
StickerFramerateIsTooSmallOrTooLarge,
|
||||
StickerAnimationDurationExceedsMaximumOf5Seconds,
|
||||
|
||||
CannotUpdateAFinishedEvent = 180000,
|
||||
|
||||
FailedToCreateStageNeededForStageEvent = 180002,
|
||||
}
|
||||
|
||||
@@ -214,28 +214,23 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake];
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIChannelMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
@@ -332,6 +327,8 @@ export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: APIAttachment[] | null;
|
||||
@@ -347,22 +344,13 @@ export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPatchAPIChannelMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
|
||||
@@ -122,6 +122,10 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -249,6 +253,10 @@ export interface RESTPatchAPIGuildJSONBody {
|
||||
* The description for the guild, if the guild is discoverable
|
||||
*/
|
||||
description?: string | null;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -525,6 +533,14 @@ export interface RESTPostAPIGuildRoleJSONBody {
|
||||
* @default false
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*
|
||||
@@ -577,6 +593,14 @@ export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*/
|
||||
|
||||
150
deno/rest/v8/guildScheduledEvent.ts
Normal file
150
deno/rest/v8/guildScheduledEvent.ts
Normal file
@@ -0,0 +1,150 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
GuildScheduledEventEntityType,
|
||||
GuildScheduledEventPrivacyLevel,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
GuildScheduledEventStatus,
|
||||
APIGuildMember,
|
||||
APIUser,
|
||||
} from '../../v8.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
|
||||
*/
|
||||
export interface RESTGetAPIGuildScheduledEventsQuery {
|
||||
/**
|
||||
* Whether to include number of users subscribed to each event
|
||||
*/
|
||||
with_user_count?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
|
||||
*/
|
||||
export type RESTGetAPIGuildScheduledEventsResult = APIGuildScheduledEvent[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
*/
|
||||
export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
/**
|
||||
* The stage channel id of the guild event
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* The name of the guild event
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The privacy level of the guild event
|
||||
*/
|
||||
privacy_level: GuildScheduledEventPrivacyLevel;
|
||||
/**
|
||||
* The time to schedule the guild event at
|
||||
*/
|
||||
scheduled_start_time: string;
|
||||
/**
|
||||
* The time when the scheduled event is scheduled to end
|
||||
*/
|
||||
scheduled_end_time?: string;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The scheduled entity type of the guild event
|
||||
*/
|
||||
entity_type?: GuildScheduledEventEntityType;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPostAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event
|
||||
*/
|
||||
export interface RESTGetAPIGuildScheduledEventQuery {
|
||||
/**
|
||||
* Whether to include number of users subscribed to this event
|
||||
*/
|
||||
with_user_count?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event
|
||||
*/
|
||||
export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export interface RESTPatchAPIGuildScheduledEventJSONBody extends Partial<RESTPostAPIGuildScheduledEventJSONBody> {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event
|
||||
*/
|
||||
export type RESTDeleteAPIGuildScheduledEventResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
|
||||
*/
|
||||
export interface RESTGetAPIGuildScheduledEventUsersQuery {
|
||||
/**
|
||||
* Number of users to receive from the event
|
||||
*
|
||||
* @default 100
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Whether to include guild member data if it exists
|
||||
*/
|
||||
with_member?: boolean;
|
||||
/**
|
||||
* Consider only users before given user id
|
||||
*/
|
||||
before?: Snowflake;
|
||||
/**
|
||||
* Consider only users after given user id
|
||||
*/
|
||||
after?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
|
||||
*/
|
||||
export type RESTGetAPIGuildScheduledEventUsersResult = APIGuildScheduledEventUser[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-user-object-guild-scheduled-event-user-structure
|
||||
*/
|
||||
export interface APIGuildScheduledEventUser {
|
||||
/**
|
||||
* The scheduled event id which the user subscribed to
|
||||
*/
|
||||
guild_scheduled_event_id: Snowflake;
|
||||
/**
|
||||
* The user which subscribed to the event
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* The guild member data for this user for the guild which this event belongs to, if any
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
|
||||
|
||||
type RESTPostAPIBaseApplicationCommandsJSONBody = Omit<
|
||||
APIApplicationCommand,
|
||||
'id' | 'application_id' | 'description' | 'type'
|
||||
'id' | 'application_id' | 'description' | 'type' | 'version'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -35,6 +35,10 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = Omit<
|
||||
*/
|
||||
export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody {
|
||||
type?: ApplicationCommandType.ChatInput;
|
||||
/**
|
||||
* Whether this application command option should be autocompleted
|
||||
*/
|
||||
autocomplete?: boolean;
|
||||
description: string;
|
||||
}
|
||||
|
||||
@@ -126,22 +130,13 @@ export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse;
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
|
||||
*/
|
||||
export type RESTPostAPIInteractionCallbackFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response
|
||||
@@ -177,22 +172,13 @@ export type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallb
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
|
||||
*/
|
||||
export type RESTPostAPIInteractionFollowupFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIInteractionFollowupJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIInvite } from '../../payloads/v8/mod.ts';
|
||||
|
||||
/**
|
||||
@@ -12,6 +13,10 @@ export interface RESTGetAPIInviteQuery {
|
||||
* Whether the invite should contain the expiration date
|
||||
*/
|
||||
with_expiration?: boolean;
|
||||
/**
|
||||
* The guild scheduled event to include with the invite
|
||||
*/
|
||||
guild_scheduled_event_id?: Snowflake;
|
||||
}
|
||||
|
||||
export type RESTGetAPIInviteResult = APIInvite;
|
||||
|
||||
@@ -7,6 +7,7 @@ export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
export * from './guild.ts';
|
||||
export * from './guildScheduledEvent.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
@@ -569,6 +570,30 @@ export const Routes = {
|
||||
return `/oauth2/@me` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/authorize`
|
||||
*/
|
||||
oauth2Authorization() {
|
||||
return `/oauth2/authorize` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token`
|
||||
*/
|
||||
oauth2TokenExchange() {
|
||||
return `/oauth2/token` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token/revoke`
|
||||
*/
|
||||
oauth2TokenRevocation() {
|
||||
return `/oauth2/token/revoke` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/commands`
|
||||
@@ -714,6 +739,33 @@ export const Routes = {
|
||||
guildSticker(guildId: Snowflake, stickerId: Snowflake) {
|
||||
return `/guilds/${guildId}/stickers/${stickerId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/scheduled-events`
|
||||
* - POST `/guilds/{guild.id}/scheduled-events`
|
||||
*/
|
||||
guildScheduledEvents(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/scheduled-events`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}`
|
||||
* - PATCH `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}`
|
||||
* - DELETE `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}`
|
||||
*/
|
||||
guildScheduledEvent(guildId: Snowflake, guildScheduledEventId: Snowflake) {
|
||||
return `/guilds/${guildId}/scheduled-events/${guildScheduledEventId}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}/users`
|
||||
*/
|
||||
guildScheduledEventUsers(guildId: Snowflake, guildScheduledEventId: Snowflake) {
|
||||
return `/guilds/${guildId}/scheduled-events/${guildScheduledEventId}/users`;
|
||||
},
|
||||
};
|
||||
|
||||
export const RouteBases = {
|
||||
@@ -728,12 +780,12 @@ export const RouteBases = {
|
||||
Object.freeze(RouteBases);
|
||||
|
||||
export const OAuth2Routes = {
|
||||
authorizationURL: `https://discord.com/api/v${APIVersion}/oauth2/authorize`,
|
||||
tokenURL: `https://discord.com/api/v${APIVersion}/oauth2/token`,
|
||||
authorizationURL: `${RouteBases.api}${Routes.oauth2Authorization()}`,
|
||||
tokenURL: `${RouteBases.api}${Routes.oauth2TokenExchange()}`,
|
||||
/**
|
||||
* See https://tools.ietf.org/html/rfc7009
|
||||
*/
|
||||
tokenRevocationURL: `https://discord.com/api/v${APIVersion}/oauth2/token/revoke`,
|
||||
tokenRevocationURL: `${RouteBases.api}${Routes.oauth2TokenRevocation()}`,
|
||||
} as const;
|
||||
|
||||
// Freeze OAuth2 route object
|
||||
|
||||
@@ -135,28 +135,23 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent[];
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
|
||||
@@ -235,6 +230,8 @@ export interface RESTPatchAPIWebhookWithTokenMessageJSONBody
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: APIAttachment[] | null;
|
||||
@@ -244,22 +241,13 @@ export interface RESTPatchAPIWebhookWithTokenMessageJSONBody
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
|
||||
@@ -248,28 +248,23 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake];
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIChannelMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
@@ -366,6 +361,8 @@ export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: APIAttachment[] | null;
|
||||
@@ -381,22 +378,13 @@ export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPatchAPIChannelMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
@@ -587,6 +575,10 @@ export interface RESTPostAPIChannelMessagesThreadsJSONBody {
|
||||
* The 3 day and 7 day archive durations require the server to be boosted. The [guild features](https://discord.com/developers/docs/resources/guild#guild-object-guild-features) will indicate if a server is able to use those settings.
|
||||
*/
|
||||
auto_archive_duration: ThreadAutoArchiveDuration;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600)
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -123,6 +123,10 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,6 +254,10 @@ export interface RESTPatchAPIGuildJSONBody {
|
||||
* The description for the guild, if the guild is discoverable
|
||||
*/
|
||||
description?: string | null;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -531,6 +539,14 @@ export interface RESTPostAPIGuildRoleJSONBody {
|
||||
* @default false
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*
|
||||
@@ -583,6 +599,14 @@ export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*/
|
||||
|
||||
150
deno/rest/v9/guildScheduledEvent.ts
Normal file
150
deno/rest/v9/guildScheduledEvent.ts
Normal file
@@ -0,0 +1,150 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
GuildScheduledEventEntityType,
|
||||
GuildScheduledEventPrivacyLevel,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
GuildScheduledEventStatus,
|
||||
APIGuildMember,
|
||||
APIUser,
|
||||
} from '../../v9.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
|
||||
*/
|
||||
export interface RESTGetAPIGuildScheduledEventsQuery {
|
||||
/**
|
||||
* Whether to include number of users subscribed to each event
|
||||
*/
|
||||
with_user_count?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
|
||||
*/
|
||||
export type RESTGetAPIGuildScheduledEventsResult = APIGuildScheduledEvent[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
*/
|
||||
export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
/**
|
||||
* The stage channel id of the guild event
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* The name of the guild event
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The privacy level of the guild event
|
||||
*/
|
||||
privacy_level: GuildScheduledEventPrivacyLevel;
|
||||
/**
|
||||
* The time to schedule the guild event at
|
||||
*/
|
||||
scheduled_start_time: string;
|
||||
/**
|
||||
* The time when the scheduled event is scheduled to end
|
||||
*/
|
||||
scheduled_end_time?: string;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The scheduled entity type of the guild event
|
||||
*/
|
||||
entity_type?: GuildScheduledEventEntityType;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPostAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event
|
||||
*/
|
||||
export interface RESTGetAPIGuildScheduledEventQuery {
|
||||
/**
|
||||
* Whether to include number of users subscribed to this event
|
||||
*/
|
||||
with_user_count?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event
|
||||
*/
|
||||
export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export interface RESTPatchAPIGuildScheduledEventJSONBody extends Partial<RESTPostAPIGuildScheduledEventJSONBody> {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event
|
||||
*/
|
||||
export type RESTDeleteAPIGuildScheduledEventResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
|
||||
*/
|
||||
export interface RESTGetAPIGuildScheduledEventUsersQuery {
|
||||
/**
|
||||
* Number of users to receive from the event
|
||||
*
|
||||
* @default 100
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Whether to include guild member data if it exists
|
||||
*/
|
||||
with_member?: boolean;
|
||||
/**
|
||||
* Consider only users before given user id
|
||||
*/
|
||||
before?: Snowflake;
|
||||
/**
|
||||
* Consider only users after given user id
|
||||
*/
|
||||
after?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
|
||||
*/
|
||||
export type RESTGetAPIGuildScheduledEventUsersResult = APIGuildScheduledEventUser[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-user-object-guild-scheduled-event-user-structure
|
||||
*/
|
||||
export interface APIGuildScheduledEventUser {
|
||||
/**
|
||||
* The scheduled event id which the user subscribed to
|
||||
*/
|
||||
guild_scheduled_event_id: Snowflake;
|
||||
/**
|
||||
* The user which subscribed to the event
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* The guild member data for this user for the guild which this event belongs to, if any
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
@@ -27,7 +27,7 @@ export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
|
||||
|
||||
type RESTPostAPIBaseApplicationCommandsJSONBody = Omit<
|
||||
APIApplicationCommand,
|
||||
'id' | 'application_id' | 'description' | 'type'
|
||||
'id' | 'application_id' | 'description' | 'type' | 'version'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -35,6 +35,10 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = Omit<
|
||||
*/
|
||||
export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody {
|
||||
type?: ApplicationCommandType.ChatInput;
|
||||
/**
|
||||
* Whether this application command option should be autocompleted
|
||||
*/
|
||||
autocomplete?: boolean;
|
||||
description: string;
|
||||
}
|
||||
|
||||
@@ -126,22 +130,13 @@ export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse;
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
|
||||
*/
|
||||
export type RESTPostAPIInteractionCallbackFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response
|
||||
@@ -177,22 +172,13 @@ export type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallb
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
|
||||
*/
|
||||
export type RESTPostAPIInteractionFollowupFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIInteractionFollowupJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIInvite } from '../../payloads/v9/mod.ts';
|
||||
|
||||
/**
|
||||
@@ -12,6 +13,10 @@ export interface RESTGetAPIInviteQuery {
|
||||
* Whether the invite should contain the expiration date
|
||||
*/
|
||||
with_expiration?: boolean;
|
||||
/**
|
||||
* The guild scheduled event to include with the invite
|
||||
*/
|
||||
guild_scheduled_event_id?: Snowflake;
|
||||
}
|
||||
|
||||
export type RESTGetAPIInviteResult = APIInvite;
|
||||
|
||||
@@ -7,6 +7,7 @@ export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
export * from './guild.ts';
|
||||
export * from './guildScheduledEvent.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
@@ -473,6 +474,7 @@ export const Routes = {
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{thread.id}/thread-members`
|
||||
* - GET `/channels/{thread.id}/thread-members/{user.id}`
|
||||
* - PUT `/channels/{thread.id}/thread-members/@me`
|
||||
* - PUT `/channels/{thread.id}/thread-members/{user.id}`
|
||||
* - DELETE `/channels/{thread.id}/thread-members/@me`
|
||||
@@ -637,6 +639,30 @@ export const Routes = {
|
||||
return `/oauth2/@me` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/authorize`
|
||||
*/
|
||||
oauth2Authorization() {
|
||||
return `/oauth2/authorize` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token`
|
||||
*/
|
||||
oauth2TokenExchange() {
|
||||
return `/oauth2/token` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token/revoke`
|
||||
*/
|
||||
oauth2TokenRevocation() {
|
||||
return `/oauth2/token/revoke` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/commands`
|
||||
@@ -782,6 +808,33 @@ export const Routes = {
|
||||
guildSticker(guildId: Snowflake, stickerId: Snowflake) {
|
||||
return `/guilds/${guildId}/stickers/${stickerId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/scheduled-events`
|
||||
* - POST `/guilds/{guild.id}/scheduled-events`
|
||||
*/
|
||||
guildScheduledEvents(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/scheduled-events`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}`
|
||||
* - PATCH `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}`
|
||||
* - DELETE `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}`
|
||||
*/
|
||||
guildScheduledEvent(guildId: Snowflake, guildScheduledEventId: Snowflake) {
|
||||
return `/guilds/${guildId}/scheduled-events/${guildScheduledEventId}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}/users`
|
||||
*/
|
||||
guildScheduledEventUsers(guildId: Snowflake, guildScheduledEventId: Snowflake) {
|
||||
return `/guilds/${guildId}/scheduled-events/${guildScheduledEventId}/users`;
|
||||
},
|
||||
};
|
||||
|
||||
export const RouteBases = {
|
||||
@@ -796,12 +849,12 @@ export const RouteBases = {
|
||||
Object.freeze(RouteBases);
|
||||
|
||||
export const OAuth2Routes = {
|
||||
authorizationURL: `https://discord.com/api/v${APIVersion}/oauth2/authorize`,
|
||||
tokenURL: `https://discord.com/api/v${APIVersion}/oauth2/token`,
|
||||
authorizationURL: `${RouteBases.api}${Routes.oauth2Authorization()}`,
|
||||
tokenURL: `${RouteBases.api}${Routes.oauth2TokenExchange()}`,
|
||||
/**
|
||||
* See https://tools.ietf.org/html/rfc7009
|
||||
*/
|
||||
tokenRevocationURL: `https://discord.com/api/v${APIVersion}/oauth2/token/revoke`,
|
||||
tokenRevocationURL: `${RouteBases.api}${Routes.oauth2TokenRevocation()}`,
|
||||
} as const;
|
||||
|
||||
// Freeze OAuth2 route object
|
||||
|
||||
@@ -135,28 +135,23 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent[];
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
|
||||
@@ -239,6 +234,8 @@ export interface RESTPatchAPIWebhookWithTokenMessageJSONBody
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: APIAttachment[] | null;
|
||||
@@ -248,22 +245,13 @@ export interface RESTPatchAPIWebhookWithTokenMessageJSONBody
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
|
||||
@@ -9,6 +9,7 @@ import type {
|
||||
APIChannel,
|
||||
APIEmoji,
|
||||
APIGuild,
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildIntegration,
|
||||
APIGuildMember,
|
||||
APIMessage,
|
||||
@@ -183,6 +184,7 @@ export const enum GatewayIntentBits {
|
||||
DirectMessages = 1 << 12,
|
||||
DirectMessageReactions = 1 << 13,
|
||||
DirectMessageTyping = 1 << 14,
|
||||
GuildScheduledEvents = 1 << 16,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,6 +235,11 @@ export const enum GatewayDispatchEvents {
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
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',
|
||||
}
|
||||
|
||||
export type GatewaySendPayload =
|
||||
@@ -265,6 +272,11 @@ export type GatewayDispatchPayload =
|
||||
| GatewayGuildModifyDispatch
|
||||
| GatewayGuildRoleDeleteDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayGuildScheduledEventCreateDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventDeleteDispatch
|
||||
| GatewayGuildScheduledEventUserAddDispatch
|
||||
| GatewayGuildScheduledEventUserRemoveDispatch
|
||||
| GatewayGuildStickersUpdateDispatch
|
||||
| GatewayIntegrationCreateDispatch
|
||||
| GatewayIntegrationDeleteDispatch
|
||||
@@ -808,6 +820,49 @@ export interface GatewayGuildRoleDeleteDispatchData {
|
||||
role_id: Snowflake;
|
||||
}
|
||||
|
||||
export type GatewayGuildScheduledEventCreateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventCreate,
|
||||
GatewayGuildScheduledEventCreateDispatchData
|
||||
>;
|
||||
|
||||
export type GatewayGuildScheduledEventCreateDispatchData = APIGuildScheduledEvent;
|
||||
|
||||
export type GatewayGuildScheduledEventUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventUpdate,
|
||||
GatewayGuildScheduledEventUpdateDispatchData
|
||||
>;
|
||||
|
||||
export type GatewayGuildScheduledEventUpdateDispatchData = APIGuildScheduledEvent;
|
||||
|
||||
export type GatewayGuildScheduledEventDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventDelete,
|
||||
GatewayGuildScheduledEventDeleteDispatchData
|
||||
>;
|
||||
|
||||
export type GatewayGuildScheduledEventDeleteDispatchData = APIGuildScheduledEvent;
|
||||
|
||||
export type GatewayGuildScheduledEventUserAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventUserAdd,
|
||||
GatewayGuildScheduledEventUserAddDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayGuildScheduledEventUserAddDispatchData {
|
||||
guild_scheduled_event_id: Snowflake;
|
||||
user_id: Snowflake;
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
export type GatewayGuildScheduledEventUserRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventUserRemove,
|
||||
GatewayGuildScheduledEventUserAddDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayGuildScheduledEventUserRemoveDispatchData {
|
||||
guild_scheduled_event_id: Snowflake;
|
||||
user_id: Snowflake;
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#integration-create
|
||||
*/
|
||||
|
||||
@@ -9,6 +9,7 @@ import type {
|
||||
APIChannel,
|
||||
APIEmoji,
|
||||
APIGuild,
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildIntegration,
|
||||
APIGuildMember,
|
||||
APIMessage,
|
||||
@@ -186,6 +187,7 @@ export const enum GatewayIntentBits {
|
||||
DirectMessages = 1 << 12,
|
||||
DirectMessageReactions = 1 << 13,
|
||||
DirectMessageTyping = 1 << 14,
|
||||
GuildScheduledEvents = 1 << 16,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -242,6 +244,11 @@ export const enum GatewayDispatchEvents {
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
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',
|
||||
}
|
||||
|
||||
export type GatewaySendPayload =
|
||||
@@ -274,6 +281,11 @@ export type GatewayDispatchPayload =
|
||||
| GatewayGuildModifyDispatch
|
||||
| GatewayGuildRoleDeleteDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayGuildScheduledEventCreateDispatch
|
||||
| GatewayGuildScheduledEventUpdateDispatch
|
||||
| GatewayGuildScheduledEventDeleteDispatch
|
||||
| GatewayGuildScheduledEventUserAddDispatch
|
||||
| GatewayGuildScheduledEventUserRemoveDispatch
|
||||
| GatewayGuildStickersUpdateDispatch
|
||||
| GatewayIntegrationCreateDispatch
|
||||
| GatewayIntegrationDeleteDispatch
|
||||
@@ -818,6 +830,49 @@ export interface GatewayGuildRoleDeleteDispatchData {
|
||||
role_id: Snowflake;
|
||||
}
|
||||
|
||||
export type GatewayGuildScheduledEventCreateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventCreate,
|
||||
GatewayGuildScheduledEventCreateDispatchData
|
||||
>;
|
||||
|
||||
export type GatewayGuildScheduledEventCreateDispatchData = APIGuildScheduledEvent;
|
||||
|
||||
export type GatewayGuildScheduledEventUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventUpdate,
|
||||
GatewayGuildScheduledEventUpdateDispatchData
|
||||
>;
|
||||
|
||||
export type GatewayGuildScheduledEventUpdateDispatchData = APIGuildScheduledEvent;
|
||||
|
||||
export type GatewayGuildScheduledEventDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventDelete,
|
||||
GatewayGuildScheduledEventDeleteDispatchData
|
||||
>;
|
||||
|
||||
export type GatewayGuildScheduledEventDeleteDispatchData = APIGuildScheduledEvent;
|
||||
|
||||
export type GatewayGuildScheduledEventUserAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventUserAdd,
|
||||
GatewayGuildScheduledEventUserAddDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayGuildScheduledEventUserAddDispatchData {
|
||||
guild_scheduled_event_id: Snowflake;
|
||||
user_id: Snowflake;
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
export type GatewayGuildScheduledEventUserRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildScheduledEventUserRemove,
|
||||
GatewayGuildScheduledEventUserAddDispatchData
|
||||
>;
|
||||
|
||||
export interface GatewayGuildScheduledEventUserRemoveDispatchData {
|
||||
guild_scheduled_event_id: Snowflake;
|
||||
user_id: Snowflake;
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#integration-create
|
||||
*/
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.23.0",
|
||||
"version": "0.25.2",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"version": "0.23.0",
|
||||
"version": "0.25.2",
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.14.6",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.23.0",
|
||||
"version": "0.25.2",
|
||||
"description": "Discord API typings that are kept up to date for use in bot library creation.",
|
||||
"main": "./v9.js",
|
||||
"module": "./v9.mjs",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { APIRole, APIUser } from '../../index';
|
||||
import type { APIRole, APIUser, ChannelType } from '../../index';
|
||||
import type { Snowflake } from '../../../../globals';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base';
|
||||
import type {
|
||||
@@ -13,22 +13,26 @@ interface APIApplicationCommandOptionBase {
|
||||
type:
|
||||
| ApplicationCommandOptionType.Boolean
|
||||
| ApplicationCommandOptionType.User
|
||||
| ApplicationCommandOptionType.Channel
|
||||
| ApplicationCommandOptionType.Role
|
||||
| ApplicationCommandOptionType.Mentionable;
|
||||
name: string;
|
||||
description: string;
|
||||
default?: boolean;
|
||||
required?: boolean;
|
||||
autocomplete?: never;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
|
||||
*/
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandArgumentOptions
|
||||
| APIApplicationCommandStringArgumentOptions
|
||||
| APIApplicationCommandSubCommandOptions
|
||||
| APIApplicationCommandOptionBase;
|
||||
| APIApplicationCommandOptionBase
|
||||
| APIApplicationCommandChannelOptions
|
||||
| APIApplicationCommandOptionBase
|
||||
| APIApplicationCommandNumberArgumentOptions
|
||||
| APIApplicationCommandStringAutocompleteOptions
|
||||
| APIApplicationCommandNumericAutocompleteOptions;
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
@@ -46,12 +50,82 @@ export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicat
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions`, these types cannot have an `options` array,
|
||||
* but they can have a `choices` one
|
||||
*/
|
||||
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
export interface APIApplicationCommandStringArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.String;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions`, these types cannot have an `options` array,
|
||||
* but they can have a `choices`, a `min_value` and `max_value` field
|
||||
*/
|
||||
export interface APIApplicationCommandNumberArgumentOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* if the option is an `INTEGER` or `NUMBER` type, the maximum value permitted
|
||||
*/
|
||||
max_value?: number;
|
||||
autocomplete?: false;
|
||||
}
|
||||
export interface APIApplicationCommandArgumentOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type:
|
||||
| ApplicationCommandOptionType.String
|
||||
| ApplicationCommandOptionType.Integer
|
||||
| ApplicationCommandOptionType.Number;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
autocomplete?: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array,
|
||||
* but they can a `autocomplete` field where it's set to `true`
|
||||
*/
|
||||
export interface APIApplicationCommandStringAutocompleteOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type: ApplicationCommandOptionType.String;
|
||||
autocomplete: true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array,
|
||||
* but they can a `autocomplete` field where it's set to `true`
|
||||
*/
|
||||
export interface APIApplicationCommandNumericAutocompleteOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number;
|
||||
autocomplete: true;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions` and `APIApplicationCommandArgumentOptions`,
|
||||
* these types cannot have an `options` array, or a `choices` array, but they can have a `channel_types` one.
|
||||
*/
|
||||
export interface APIApplicationCommandChannelOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.Channel;
|
||||
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,7 +163,7 @@ export type APIApplicationCommandInteractionDataOption =
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommand {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.Subcommand;
|
||||
options: APIApplicationCommandInteractionDataOptionWithValues[];
|
||||
options?: APIApplicationCommandInteractionDataOptionWithValues[];
|
||||
}
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommandGroup {
|
||||
@@ -108,10 +182,10 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
|
||||
| ApplicationCommandInteractionDataOptionNumber
|
||||
| ApplicationCommandInteractionDataOptionBoolean;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionString = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.String,
|
||||
string
|
||||
>;
|
||||
export interface ApplicationCommandInteractionDataOptionString
|
||||
extends InteractionDataOptionBase<ApplicationCommandOptionType.String, string> {
|
||||
focused?: boolean;
|
||||
}
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionRole = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Role,
|
||||
@@ -133,15 +207,15 @@ export type ApplicationCommandInteractionDataOptionMentionable = InteractionData
|
||||
Snowflake
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Integer,
|
||||
number
|
||||
>;
|
||||
export interface ApplicationCommandInteractionDataOptionInteger
|
||||
extends InteractionDataOptionBase<ApplicationCommandOptionType.Integer, number> {
|
||||
focused?: boolean;
|
||||
}
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionNumber = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Number,
|
||||
number
|
||||
>;
|
||||
export interface ApplicationCommandInteractionDataOptionNumber
|
||||
extends InteractionDataOptionBase<ApplicationCommandOptionType.Number, number> {
|
||||
focused?: boolean;
|
||||
}
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionBoolean = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Boolean,
|
||||
|
||||
6
payloads/v8/_interactions/autocomplete.ts
Normal file
6
payloads/v8/_interactions/autocomplete.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { APIBaseInteraction, APIChatInputApplicationCommandInteractionData, InteractionType } from '../index';
|
||||
|
||||
export type APIApplicationCommandAutocompleteInteraction = APIBaseInteraction<
|
||||
InteractionType.ApplicationCommandAutocomplete,
|
||||
APIChatInputApplicationCommandInteractionData
|
||||
>;
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { MessageFlags } from '../index';
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v8';
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
|
||||
@@ -8,6 +9,7 @@ export const enum InteractionType {
|
||||
Ping = 1,
|
||||
ApplicationCommand,
|
||||
MessageComponent,
|
||||
ApplicationCommandAutocomplete,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -18,12 +20,18 @@ export type APIInteractionResponse =
|
||||
| APIInteractionResponseChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredMessageUpdate
|
||||
| APIInteractionResponseUpdateMessage;
|
||||
| APIInteractionResponseUpdateMessage
|
||||
| APIApplicationCommandAutocompleteResponse;
|
||||
|
||||
export interface APIInteractionResponsePong {
|
||||
type: InteractionResponseType.Pong;
|
||||
}
|
||||
|
||||
export interface APIApplicationCommandAutocompleteResponse {
|
||||
type: InteractionResponseType.ApplicationCommandAutocompleteResult;
|
||||
data: APICommandAutocompleteInteractionResponseCallbackData;
|
||||
}
|
||||
|
||||
export interface APIInteractionResponseChannelMessageWithSource {
|
||||
type: InteractionResponseType.ChannelMessageWithSource;
|
||||
data: APIInteractionResponseCallbackData;
|
||||
@@ -67,6 +75,10 @@ export const enum InteractionResponseType {
|
||||
* ACK a button interaction and edit the message to which the button was attached
|
||||
*/
|
||||
UpdateMessage,
|
||||
/**
|
||||
* For autocomplete interactions
|
||||
*/
|
||||
ApplicationCommandAutocompleteResult,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,3 +88,7 @@ export type APIInteractionResponseCallbackData = Omit<
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
'username' | 'avatar_url'
|
||||
> & { flags?: MessageFlags };
|
||||
|
||||
export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
@@ -106,4 +106,6 @@ export const enum ApplicationFlags {
|
||||
GatewayGuildMembersLimited = 1 << 15,
|
||||
VerificationPendingGuildLimit = 1 << 16,
|
||||
Embedded = 1 << 17,
|
||||
GatewayMessageContent = 1 << 18,
|
||||
GatewayMessageContentLimited = 1 << 19,
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import type { StickerFormatType } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
import type { APIWebhook } from './webhook';
|
||||
import type { StageInstancePrivacyLevel } from './stageInstance';
|
||||
import type { GuildScheduledEventEntityType, GuildScheduledEventStatus } from './guildScheduledEvent';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
|
||||
@@ -144,6 +145,10 @@ export const enum AuditLogEvent {
|
||||
StickerCreate = 90,
|
||||
StickerUpdate,
|
||||
StickerDelete,
|
||||
|
||||
GuildScheduledEventCreate = 100,
|
||||
GuildScheduledEventUpdate,
|
||||
GuildScheduledEventDelete,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -302,7 +307,10 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyGuildId;
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeyLocation;
|
||||
|
||||
/**
|
||||
* Returned when an entity's name is changed
|
||||
@@ -310,7 +318,7 @@ export type APIAuditLogChange =
|
||||
export type APIAuditLogChangeKeyName = AuditLogChangeData<'name', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's or sticker's description is changed
|
||||
* Returned when a guild's or sticker's or guild scheduled event's description is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDescription = AuditLogChangeData<'description', string>;
|
||||
|
||||
@@ -502,7 +510,7 @@ export type APIAuditLogChangeKeyDeny = AuditLogChangeData<'deny', string>;
|
||||
export type APIAuditLogChangeKeyCode = AuditLogChangeData<'code', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's channel_id is changed
|
||||
* Returned when an invite's or guild scheduled event's channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyChannelId = AuditLogChangeData<'channel_id', Snowflake>;
|
||||
|
||||
@@ -582,7 +590,7 @@ export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_g
|
||||
export type APIAuditLogChangeKeyUserLimit = AuditLogChangeData<'user_limit', number>;
|
||||
|
||||
/**
|
||||
* Returned when privacy level of a stage instance is changed
|
||||
* Returned when privacy level of a stage instance or guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPrivacyLevel = AuditLogChangeData<'privacy_level', StageInstancePrivacyLevel>;
|
||||
|
||||
@@ -611,6 +619,21 @@ export type APIAuditLogChangeKeyAvailable = AuditLogChangeData<'available', bool
|
||||
*/
|
||||
export type APIAuditLogChangeKeyGuildId = AuditLogChangeData<'guild_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when entity type of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEntityType = AuditLogChangeData<'entity_type', GuildScheduledEventEntityType>;
|
||||
|
||||
/**
|
||||
* Returned when status of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyStatus = AuditLogChangeData<'status', GuildScheduledEventStatus>;
|
||||
|
||||
/**
|
||||
* Returned when location of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D extends unknown> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -807,6 +807,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The attachment's media type
|
||||
*
|
||||
@@ -833,6 +837,10 @@ export interface APIAttachment {
|
||||
* Width of file (if image)
|
||||
*/
|
||||
width?: number | null;
|
||||
/**
|
||||
* Whether this attachment is ephemeral
|
||||
*/
|
||||
ephemeral?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -298,6 +298,9 @@ export const enum ActivityFlags {
|
||||
JoinRequest = 1 << 3,
|
||||
Sync = 1 << 4,
|
||||
Play = 1 << 5,
|
||||
PartyPrivacyFriends = 1 << 6,
|
||||
PartyPrivacyVoiceChannel = 1 << 7,
|
||||
Embedded = 1 << 8,
|
||||
}
|
||||
|
||||
export interface GatewayActivityButton {
|
||||
|
||||
@@ -11,6 +11,7 @@ import type { APIStageInstance } from './stageInstance';
|
||||
import type { APISticker } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
import type { GatewayVoiceState } from './voice';
|
||||
import type { APIGuildScheduledEvent } from './guildScheduledEvent';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -325,6 +326,18 @@ export interface APIGuild extends APIPartialGuild {
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
stickers: APISticker[];
|
||||
/**
|
||||
* Whether the guild has the boost progress bar enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled: boolean;
|
||||
/**
|
||||
* The scheduled events in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
|
||||
*/
|
||||
guild_scheduled_events?: APIGuildScheduledEvent[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -414,6 +427,10 @@ export const enum GuildSystemChannelFlags {
|
||||
* Suppress server setup tips
|
||||
*/
|
||||
SuppressGuildReminderNotifications = 1 << 2,
|
||||
/**
|
||||
* Hide member join sticker reply buttons
|
||||
*/
|
||||
SuppressJoinNotificationReplies = 1 << 3,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -448,6 +465,18 @@ export const enum GuildFeature {
|
||||
* Guild has access to set an invite splash background
|
||||
*/
|
||||
InviteSplash = 'INVITE_SPLASH',
|
||||
/**
|
||||
* Guild has enabled Membership Screening
|
||||
*/
|
||||
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
|
||||
/**
|
||||
* Guild has enabled monetization
|
||||
*/
|
||||
MonetizationEnabled = 'MONETIZATION_ENABLED',
|
||||
/**
|
||||
* Guild has increased custom sticker slots
|
||||
*/
|
||||
MoreStickers = 'MORE_STICKERS',
|
||||
/**
|
||||
* Guild has access to create news channels
|
||||
*/
|
||||
@@ -456,7 +485,31 @@ export const enum GuildFeature {
|
||||
* Guild is partnered
|
||||
*/
|
||||
Partnered = 'PARTNERED',
|
||||
/**
|
||||
* Guild can be previewed before joining via Membership Screening or the directory
|
||||
*/
|
||||
PreviewEnabled = 'PREVIEW_ENABLED',
|
||||
/**
|
||||
* Guild has access to create private threads
|
||||
*/
|
||||
PrivateThreads = 'PRIVATE_THREADS',
|
||||
RelayEnabled = 'RELAY_ENABLED',
|
||||
/**
|
||||
* Guild is able to set role icons
|
||||
*/
|
||||
RoleIcons = 'ROLE_ICONS',
|
||||
/**
|
||||
* Guild has access to the seven day archive time for threads
|
||||
*/
|
||||
SevenDayThreadArchive = 'SEVEN_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has access to the three day archive time for threads
|
||||
*/
|
||||
ThreeDayThreadArchive = 'THREE_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has enabled ticketed events
|
||||
*/
|
||||
TicketedEventsEnabled = 'TICKETED_EVENTS_ENABLED',
|
||||
/**
|
||||
* Guild has access to set a vanity URL
|
||||
*/
|
||||
@@ -473,38 +526,6 @@ export const enum GuildFeature {
|
||||
* Guild has enabled the welcome screen
|
||||
*/
|
||||
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
|
||||
/**
|
||||
* Guild has enabled Membership Screening
|
||||
*/
|
||||
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
|
||||
/**
|
||||
* Guild can be previewed before joining via Membership Screening or the directory
|
||||
*/
|
||||
PreviewEnabled = 'PREVIEW_ENABLED',
|
||||
/**
|
||||
* Guild has enabled ticketed events
|
||||
*/
|
||||
TicketedEventsEnabled = 'TICKETED_EVENTS_ENABLED',
|
||||
/**
|
||||
* Guild has enabled monetization
|
||||
*/
|
||||
MonetizationEnabled = 'MONETIZATION_ENABLED',
|
||||
/**
|
||||
* Guild has increased custom sticker slots
|
||||
*/
|
||||
MoreStickers = 'MORE_STICKERS',
|
||||
/**
|
||||
* Guild has access to the three day archive time for threads
|
||||
*/
|
||||
ThreeDayThreadArchive = 'THREE_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has access to the seven day archive time for threads
|
||||
*/
|
||||
SevenDayThreadArchive = 'SEVEN_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has access to create private threads
|
||||
*/
|
||||
PrivateThreads = 'PRIVATE_THREADS',
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -593,6 +614,10 @@ export interface APIGuildMember {
|
||||
* This users guild nickname
|
||||
*/
|
||||
nick?: string | null;
|
||||
/**
|
||||
* The member's guild avatar hash
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* Array of role object ids
|
||||
*
|
||||
|
||||
104
payloads/v8/guildScheduledEvent.ts
Normal file
104
payloads/v8/guildScheduledEvent.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
import type { APIUser } from './user';
|
||||
import type { Snowflake } from '../../globals';
|
||||
|
||||
export interface APIGuildScheduledEvent {
|
||||
/**
|
||||
* The id of the guild event
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The guild id which the scheduled event belongs to
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The channel id in which the scheduled event will be hosted, or `null` if entity type is `EXTERNAL`
|
||||
*/
|
||||
channel_id: Snowflake | null;
|
||||
/**
|
||||
* The id of the user that created the scheduled event
|
||||
*/
|
||||
creator_id: Snowflake | null;
|
||||
/**
|
||||
* The name of the scheduled event
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The description of the scheduled event
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The time the scheduled event will start
|
||||
*/
|
||||
scheduled_start_time: string;
|
||||
/**
|
||||
* The time at which the guild event will end, or `null` if the event does not have a scheduled time to end
|
||||
*/
|
||||
scheduled_end_time: string | null;
|
||||
/**
|
||||
* The privacy level of the scheduled event
|
||||
*/
|
||||
privacy_level: GuildScheduledEventPrivacyLevel;
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status: GuildScheduledEventStatus;
|
||||
/**
|
||||
* The type of hosting entity associated with the scheduled event
|
||||
*/
|
||||
entity_type: GuildScheduledEventEntityType;
|
||||
/**
|
||||
* The id of the hosting entity associated with the scheduled event
|
||||
*/
|
||||
entity_id: Snowflake | null;
|
||||
/**
|
||||
* The entity metadata for the scheduled event
|
||||
*/
|
||||
entity_metadata: APIGuildScheduledEventEntityMetadata;
|
||||
/**
|
||||
* The user that created the scheduled event
|
||||
*/
|
||||
creator?: APIUser;
|
||||
/**
|
||||
* The number of users subscribed to the scheduled event
|
||||
*/
|
||||
user_count?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
|
||||
*/
|
||||
export interface APIGuildScheduledEventEntityMetadata {
|
||||
/**
|
||||
* The location of the scheduled event
|
||||
*/
|
||||
location?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types
|
||||
*/
|
||||
export const enum GuildScheduledEventEntityType {
|
||||
StageInstance = 1,
|
||||
Voice,
|
||||
External,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status
|
||||
*/
|
||||
export const enum GuildScheduledEventStatus {
|
||||
Scheduled = 1,
|
||||
Active,
|
||||
Completed,
|
||||
Canceled,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level
|
||||
*/
|
||||
export const enum GuildScheduledEventPrivacyLevel {
|
||||
/**
|
||||
* The scheduled event is only accessible to guild members
|
||||
*/
|
||||
GuildOnly = 2,
|
||||
}
|
||||
@@ -4,6 +4,7 @@ export * from './channel';
|
||||
export * from './emoji';
|
||||
export * from './gateway';
|
||||
export * from './guild';
|
||||
export * from './guildScheduledEvent';
|
||||
export * from './interactions';
|
||||
export * from './invite';
|
||||
export * from './oauth2';
|
||||
|
||||
@@ -9,6 +9,7 @@ import type {
|
||||
APIApplicationCommandGuildInteraction,
|
||||
APIApplicationCommandInteraction,
|
||||
} from './_interactions/applicationCommands';
|
||||
import type { APIApplicationCommandAutocompleteInteraction } from './_interactions/autocomplete';
|
||||
|
||||
export * from './_interactions/base';
|
||||
export * from './_interactions/messageComponents';
|
||||
@@ -19,7 +20,11 @@ export * from './_interactions/applicationCommands';
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIInteraction = APIPingInteraction | APIApplicationCommandInteraction | APIMessageComponentInteraction;
|
||||
export type APIInteraction =
|
||||
| APIPingInteraction
|
||||
| APIApplicationCommandInteraction
|
||||
| APIMessageComponentInteraction
|
||||
| APIApplicationCommandAutocompleteInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
|
||||
@@ -7,6 +7,7 @@ import type { APIPartialGuild } from './guild';
|
||||
import type { APIApplication } from './application';
|
||||
import type { APIInviteStageInstance } from './stageInstance';
|
||||
import type { APIUser } from './user';
|
||||
import type { APIGuildScheduledEvent } from './guildScheduledEvent';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object
|
||||
@@ -68,6 +69,10 @@ export interface APIInvite {
|
||||
* The stage instance data if there is a public stage instance in the stage channel this invite is for
|
||||
*/
|
||||
stage_instance?: APIInviteStageInstance;
|
||||
/**
|
||||
* The guild scheduled event data, returned from the `GET /invites/<code>` endpoint when `guild_scheduled_event_id` is a valid guild scheduled event id
|
||||
*/
|
||||
guild_scheduled_event?: APIGuildScheduledEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,7 +45,9 @@ export const PermissionFlagsBits = {
|
||||
ManageEmojisAndStickers: 1n << 30n,
|
||||
UseApplicationCommands: 1n << 31n,
|
||||
RequestToSpeak: 1n << 32n,
|
||||
ManageEvents: 1n << 33n,
|
||||
UseExternalStickers: 1n << 37n,
|
||||
StartEmbeddedActivities: 1n << 39n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
@@ -74,6 +76,14 @@ export interface APIRole {
|
||||
* If this role is pinned in the user listing
|
||||
*/
|
||||
hoist: boolean;
|
||||
/**
|
||||
* The role icon hash
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The role unicode emoji as a standard emoji
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
/**
|
||||
* Position of this role
|
||||
*/
|
||||
|
||||
@@ -85,20 +85,66 @@ export interface APIUser {
|
||||
* https://discord.com/developers/docs/resources/user#user-object-user-flags
|
||||
*/
|
||||
export const enum UserFlags {
|
||||
/**
|
||||
* None
|
||||
*/
|
||||
None = 0,
|
||||
DiscordEmployee = 1 << 0,
|
||||
PartneredServerOwner = 1 << 1,
|
||||
DiscordHypeSquadEvents = 1 << 2,
|
||||
/**
|
||||
* Discord Employee
|
||||
*/
|
||||
Staff = 1 << 0,
|
||||
/**
|
||||
* Partnered Server Owner
|
||||
*/
|
||||
Partner = 1 << 1,
|
||||
/**
|
||||
* HypeSquad Events Coordinator
|
||||
*/
|
||||
Hypesquad = 1 << 2,
|
||||
/**
|
||||
* Bug Hunter Level 1
|
||||
*/
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
HypeSquadHouseBravery = 1 << 6,
|
||||
HypeSquadHouseBrilliance = 1 << 7,
|
||||
HypeSquadHouseBalance = 1 << 8,
|
||||
EarlySupporter = 1 << 9,
|
||||
TeamUser = 1 << 10,
|
||||
/**
|
||||
* House Bravery Member
|
||||
*/
|
||||
HypeSquadOnlineHouse1 = 1 << 6,
|
||||
/**
|
||||
* House Brilliance Member
|
||||
*/
|
||||
HypeSquadOnlineHouse2 = 1 << 7,
|
||||
/**
|
||||
* House Balance Member
|
||||
*/
|
||||
HypeSquadOnlineHouse3 = 1 << 8,
|
||||
/**
|
||||
* Early Nitro Supporter
|
||||
*/
|
||||
PremiumEarlySupporter = 1 << 9,
|
||||
/**
|
||||
* User is a [team](https://discord.com/developers/docs/topics/teams)
|
||||
*/
|
||||
TeamPseudoUser = 1 << 10,
|
||||
/**
|
||||
* Bug Hunter Level 2
|
||||
*/
|
||||
BugHunterLevel2 = 1 << 14,
|
||||
/**
|
||||
* Verified Bot
|
||||
*/
|
||||
VerifiedBot = 1 << 16,
|
||||
EarlyVerifiedBotDeveloper = 1 << 17,
|
||||
DiscordCertifiedModerator = 1 << 18,
|
||||
/**
|
||||
* Early Verified Bot Developer
|
||||
*/
|
||||
VerifiedDeveloper = 1 << 17,
|
||||
/**
|
||||
* Discord Certified Moderator
|
||||
*/
|
||||
CertifiedModerator = 1 << 18,
|
||||
/**
|
||||
* Bot uses only [HTTP interactions](https://discord.com/developers/docs/interactions/receiving-and-responding#receiving-an-interaction) and is shown in the online member list
|
||||
*/
|
||||
BotHTTPInteractions = 1 << 19,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,10 +77,6 @@ export interface APIVoiceRegion {
|
||||
* Name of the region
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* `true` if this is a vip-only server
|
||||
*/
|
||||
vip: boolean;
|
||||
/**
|
||||
* `true` for a single server that is closest to the current user's client
|
||||
*/
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { APIRole, APIUser } from '../../index';
|
||||
import type { APIRole, APIUser, ChannelType } from '../../index';
|
||||
import type { Snowflake } from '../../../../globals';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base';
|
||||
import type {
|
||||
@@ -13,22 +13,26 @@ interface APIApplicationCommandOptionBase {
|
||||
type:
|
||||
| ApplicationCommandOptionType.Boolean
|
||||
| ApplicationCommandOptionType.User
|
||||
| ApplicationCommandOptionType.Channel
|
||||
| ApplicationCommandOptionType.Role
|
||||
| ApplicationCommandOptionType.Mentionable;
|
||||
name: string;
|
||||
description: string;
|
||||
default?: boolean;
|
||||
required?: boolean;
|
||||
autocomplete?: never;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
|
||||
*/
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandArgumentOptions
|
||||
| APIApplicationCommandStringArgumentOptions
|
||||
| APIApplicationCommandSubCommandOptions
|
||||
| APIApplicationCommandOptionBase;
|
||||
| APIApplicationCommandOptionBase
|
||||
| APIApplicationCommandChannelOptions
|
||||
| APIApplicationCommandOptionBase
|
||||
| APIApplicationCommandNumberArgumentOptions
|
||||
| APIApplicationCommandStringAutocompleteOptions
|
||||
| APIApplicationCommandNumericAutocompleteOptions;
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
@@ -44,14 +48,80 @@ export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicat
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions`, these types cannot have an `options` array,
|
||||
* but they can have a `choices` one
|
||||
* but they can have a either a `choices` or a `autocomplete` field where it's set to false.
|
||||
*/
|
||||
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
export interface APIApplicationCommandStringArgumentOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type:
|
||||
| ApplicationCommandOptionType.String
|
||||
| ApplicationCommandOptionType.Integer
|
||||
| ApplicationCommandOptionType.Number;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
autocomplete?: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array,
|
||||
* but they can a `autocomplete` field where it's set to `true`
|
||||
*/
|
||||
export interface APIApplicationCommandStringAutocompleteOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type: ApplicationCommandOptionType.String;
|
||||
autocomplete: true;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandArgumentOptions`, these types cannot have an `choices` array,
|
||||
* but they can a `autocomplete` field where it's set to `true`
|
||||
*/
|
||||
export interface APIApplicationCommandNumericAutocompleteOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number;
|
||||
autocomplete: true;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions`, these types cannot have an `options` array,
|
||||
* but they can have a `choices`, a `min_value` and `max_value` field
|
||||
*/
|
||||
export interface APIApplicationCommandNumberArgumentOptions
|
||||
extends Omit<APIApplicationCommandOptionBase, 'type' | 'autocomplete'> {
|
||||
type: ApplicationCommandOptionType.Integer | ApplicationCommandOptionType.Number;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* if the option is an `INTEGER` or `NUMBER` type, the maximum value permitted
|
||||
*/
|
||||
max_value?: number;
|
||||
autocomplete?: false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions` and `APIApplicationCommandArgumentOptions`,
|
||||
* these types cannot have an `options` array, or a `choices` array, but they can have a `channel_types` one.
|
||||
*/
|
||||
export interface APIApplicationCommandChannelOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.Channel;
|
||||
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -89,7 +159,7 @@ export type APIApplicationCommandInteractionDataOption =
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommand {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.Subcommand;
|
||||
options: APIApplicationCommandInteractionDataOptionWithValues[];
|
||||
options?: APIApplicationCommandInteractionDataOptionWithValues[];
|
||||
}
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommandGroup {
|
||||
@@ -108,10 +178,10 @@ export type APIApplicationCommandInteractionDataOptionWithValues =
|
||||
| ApplicationCommandInteractionDataOptionNumber
|
||||
| ApplicationCommandInteractionDataOptionBoolean;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionString = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.String,
|
||||
string
|
||||
>;
|
||||
export interface ApplicationCommandInteractionDataOptionString
|
||||
extends InteractionDataOptionBase<ApplicationCommandOptionType.String, string> {
|
||||
focused?: boolean;
|
||||
}
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionRole = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Role,
|
||||
@@ -133,15 +203,15 @@ export type ApplicationCommandInteractionDataOptionMentionable = InteractionData
|
||||
Snowflake
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Integer,
|
||||
number
|
||||
>;
|
||||
export interface ApplicationCommandInteractionDataOptionInteger
|
||||
extends InteractionDataOptionBase<ApplicationCommandOptionType.Integer, number> {
|
||||
focused?: boolean;
|
||||
}
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionNumber = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Number,
|
||||
number
|
||||
>;
|
||||
export interface ApplicationCommandInteractionDataOptionNumber
|
||||
extends InteractionDataOptionBase<ApplicationCommandOptionType.Number, number> {
|
||||
focused?: boolean;
|
||||
}
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionBoolean = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Boolean,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals';
|
||||
import type { APIPartialChannel } from '../channel';
|
||||
import type { APIPartialChannel, APIThreadMetadata } from '../channel';
|
||||
import type { APIGuildMember } from '../guild';
|
||||
import type { APIBaseInteraction } from './base';
|
||||
import type { InteractionType } from './responses';
|
||||
@@ -85,7 +85,9 @@ export type APIApplicationCommandInteractionData =
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
|
||||
thread_metadata?: APIThreadMetadata | null;
|
||||
permissions: Permissions;
|
||||
parent_id?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
6
payloads/v9/_interactions/autocomplete.ts
Normal file
6
payloads/v9/_interactions/autocomplete.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { APIBaseInteraction, APIChatInputApplicationCommandInteractionData, InteractionType } from '../index';
|
||||
|
||||
export type APIApplicationCommandAutocompleteInteraction = APIBaseInteraction<
|
||||
InteractionType.ApplicationCommandAutocomplete,
|
||||
APIChatInputApplicationCommandInteractionData
|
||||
>;
|
||||
@@ -1,5 +1,6 @@
|
||||
import type { MessageFlags } from '../index';
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v9';
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
|
||||
@@ -8,6 +9,7 @@ export const enum InteractionType {
|
||||
Ping = 1,
|
||||
ApplicationCommand,
|
||||
MessageComponent,
|
||||
ApplicationCommandAutocomplete,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -18,12 +20,18 @@ export type APIInteractionResponse =
|
||||
| APIInteractionResponseChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredMessageUpdate
|
||||
| APIInteractionResponseUpdateMessage;
|
||||
| APIInteractionResponseUpdateMessage
|
||||
| APIApplicationCommandAutocompleteResponse;
|
||||
|
||||
export interface APIInteractionResponsePong {
|
||||
type: InteractionResponseType.Pong;
|
||||
}
|
||||
|
||||
export interface APIApplicationCommandAutocompleteResponse {
|
||||
type: InteractionResponseType.ApplicationCommandAutocompleteResult;
|
||||
data: APICommandAutocompleteInteractionResponseCallbackData;
|
||||
}
|
||||
|
||||
export interface APIInteractionResponseChannelMessageWithSource {
|
||||
type: InteractionResponseType.ChannelMessageWithSource;
|
||||
data: APIInteractionResponseCallbackData;
|
||||
@@ -67,6 +75,10 @@ export const enum InteractionResponseType {
|
||||
* ACK a button interaction and edit the message to which the button was attached
|
||||
*/
|
||||
UpdateMessage,
|
||||
/**
|
||||
* For autocomplete interactions
|
||||
*/
|
||||
ApplicationCommandAutocompleteResult,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -76,3 +88,7 @@ export type APIInteractionResponseCallbackData = Omit<
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
'username' | 'avatar_url'
|
||||
> & { flags?: MessageFlags };
|
||||
|
||||
export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
@@ -106,4 +106,6 @@ export const enum ApplicationFlags {
|
||||
GatewayGuildMembersLimited = 1 << 15,
|
||||
VerificationPendingGuildLimit = 1 << 16,
|
||||
Embedded = 1 << 17,
|
||||
GatewayMessageContent = 1 << 18,
|
||||
GatewayMessageContentLimited = 1 << 19,
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import type { StickerFormatType } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
import type { APIWebhook } from './webhook';
|
||||
import type { StageInstancePrivacyLevel } from './stageInstance';
|
||||
import type { GuildScheduledEventEntityType, GuildScheduledEventStatus } from './guildScheduledEvent';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
|
||||
@@ -153,6 +154,10 @@ export const enum AuditLogEvent {
|
||||
StickerUpdate,
|
||||
StickerDelete,
|
||||
|
||||
GuildScheduledEventCreate = 100,
|
||||
GuildScheduledEventUpdate,
|
||||
GuildScheduledEventDelete,
|
||||
|
||||
ThreadCreate = 110,
|
||||
ThreadUpdate,
|
||||
ThreadDelete,
|
||||
@@ -318,7 +323,10 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration;
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeyLocation;
|
||||
|
||||
/**
|
||||
* Returned when an entity's name is changed
|
||||
@@ -326,7 +334,7 @@ export type APIAuditLogChange =
|
||||
export type APIAuditLogChangeKeyName = AuditLogChangeData<'name', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's or sticker's description is changed
|
||||
* Returned when a guild's or sticker's or guild scheduled event's description is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDescription = AuditLogChangeData<'description', string>;
|
||||
|
||||
@@ -518,7 +526,7 @@ export type APIAuditLogChangeKeyDeny = AuditLogChangeData<'deny', string>;
|
||||
export type APIAuditLogChangeKeyCode = AuditLogChangeData<'code', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's channel_id is changed
|
||||
* Returned when an invite's or guild scheduled event's channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyChannelId = AuditLogChangeData<'channel_id', Snowflake>;
|
||||
|
||||
@@ -598,7 +606,7 @@ export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_g
|
||||
export type APIAuditLogChangeKeyUserLimit = AuditLogChangeData<'user_limit', number>;
|
||||
|
||||
/**
|
||||
* Returned when privacy level of a stage instance is changed
|
||||
* Returned when privacy level of a stage instance or guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPrivacyLevel = AuditLogChangeData<'privacy_level', StageInstancePrivacyLevel>;
|
||||
|
||||
@@ -650,6 +658,21 @@ export type APIAuditLogChangeKeyDefaultAutoArchiveDuration = AuditLogChangeData<
|
||||
number
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when entity type of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEntityType = AuditLogChangeData<'entity_type', GuildScheduledEventEntityType>;
|
||||
|
||||
/**
|
||||
* Returned when status of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyStatus = AuditLogChangeData<'status', GuildScheduledEventStatus>;
|
||||
|
||||
/**
|
||||
* Returned when location of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D extends unknown> {
|
||||
key: K;
|
||||
/**
|
||||
|
||||
@@ -936,6 +936,10 @@ export interface APIAttachment {
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* Description for the file
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The attachment's media type
|
||||
*
|
||||
@@ -962,6 +966,10 @@ export interface APIAttachment {
|
||||
* Width of file (if image)
|
||||
*/
|
||||
width?: number | null;
|
||||
/**
|
||||
* Whether this attachment is ephemeral
|
||||
*/
|
||||
ephemeral?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -299,6 +299,9 @@ export const enum ActivityFlags {
|
||||
JoinRequest = 1 << 3,
|
||||
Sync = 1 << 4,
|
||||
Play = 1 << 5,
|
||||
PartyPrivacyFriends = 1 << 6,
|
||||
PartyPrivacyVoiceChannel = 1 << 7,
|
||||
Embedded = 1 << 8,
|
||||
}
|
||||
|
||||
export interface GatewayActivityButton {
|
||||
|
||||
@@ -11,6 +11,7 @@ import type { APIStageInstance } from './stageInstance';
|
||||
import type { APISticker } from './sticker';
|
||||
import type { APIUser } from './user';
|
||||
import type { GatewayVoiceState } from './voice';
|
||||
import type { APIGuildScheduledEvent } from './guildScheduledEvent';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
@@ -333,6 +334,18 @@ export interface APIGuild extends APIPartialGuild {
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
stickers: APISticker[];
|
||||
/**
|
||||
* Whether the guild has the boost progress bar enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled: boolean;
|
||||
/**
|
||||
* The scheduled events in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
|
||||
*/
|
||||
guild_scheduled_events?: APIGuildScheduledEvent[];
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -422,6 +435,10 @@ export const enum GuildSystemChannelFlags {
|
||||
* Suppress server setup tips
|
||||
*/
|
||||
SuppressGuildReminderNotifications = 1 << 2,
|
||||
/**
|
||||
* Hide member join sticker reply buttons
|
||||
*/
|
||||
SuppressJoinNotificationReplies = 1 << 3,
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -456,6 +473,18 @@ export const enum GuildFeature {
|
||||
* Guild has access to set an invite splash background
|
||||
*/
|
||||
InviteSplash = 'INVITE_SPLASH',
|
||||
/**
|
||||
* Guild has enabled Membership Screening
|
||||
*/
|
||||
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
|
||||
/**
|
||||
* Guild has enabled monetization
|
||||
*/
|
||||
MonetizationEnabled = 'MONETIZATION_ENABLED',
|
||||
/**
|
||||
* Guild has increased custom sticker slots
|
||||
*/
|
||||
MoreStickers = 'MORE_STICKERS',
|
||||
/**
|
||||
* Guild has access to create news channels
|
||||
*/
|
||||
@@ -464,7 +493,31 @@ export const enum GuildFeature {
|
||||
* Guild is partnered
|
||||
*/
|
||||
Partnered = 'PARTNERED',
|
||||
/**
|
||||
* Guild can be previewed before joining via Membership Screening or the directory
|
||||
*/
|
||||
PreviewEnabled = 'PREVIEW_ENABLED',
|
||||
/**
|
||||
* Guild has access to create private threads
|
||||
*/
|
||||
PrivateThreads = 'PRIVATE_THREADS',
|
||||
RelayEnabled = 'RELAY_ENABLED',
|
||||
/**
|
||||
* Guild is able to set role icons
|
||||
*/
|
||||
RoleIcons = 'ROLE_ICONS',
|
||||
/**
|
||||
* Guild has access to the seven day archive time for threads
|
||||
*/
|
||||
SevenDayThreadArchive = 'SEVEN_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has access to the three day archive time for threads
|
||||
*/
|
||||
ThreeDayThreadArchive = 'THREE_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has enabled ticketed events
|
||||
*/
|
||||
TicketedEventsEnabled = 'TICKETED_EVENTS_ENABLED',
|
||||
/**
|
||||
* Guild has access to set a vanity URL
|
||||
*/
|
||||
@@ -481,38 +534,6 @@ export const enum GuildFeature {
|
||||
* Guild has enabled the welcome screen
|
||||
*/
|
||||
WelcomeScreenEnabled = 'WELCOME_SCREEN_ENABLED',
|
||||
/**
|
||||
* Guild has enabled Membership Screening
|
||||
*/
|
||||
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
|
||||
/**
|
||||
* Guild can be previewed before joining via Membership Screening or the directory
|
||||
*/
|
||||
PreviewEnabled = 'PREVIEW_ENABLED',
|
||||
/**
|
||||
* Guild has enabled ticketed events
|
||||
*/
|
||||
TicketedEventsEnabled = 'TICKETED_EVENTS_ENABLED',
|
||||
/**
|
||||
* Guild has enabled monetization
|
||||
*/
|
||||
MonetizationEnabled = 'MONETIZATION_ENABLED',
|
||||
/**
|
||||
* Guild has increased custom sticker slots
|
||||
*/
|
||||
MoreStickers = 'MORE_STICKERS',
|
||||
/**
|
||||
* Guild has access to the three day archive time for threads
|
||||
*/
|
||||
ThreeDayThreadArchive = 'THREE_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has access to the seven day archive time for threads
|
||||
*/
|
||||
SevenDayThreadArchive = 'SEVEN_DAY_THREAD_ARCHIVE',
|
||||
/**
|
||||
* Guild has access to create private threads
|
||||
*/
|
||||
PrivateThreads = 'PRIVATE_THREADS',
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -601,6 +622,10 @@ export interface APIGuildMember {
|
||||
* This users guild nickname
|
||||
*/
|
||||
nick?: string | null;
|
||||
/**
|
||||
* The member's guild avatar hash
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* Array of role object ids
|
||||
*
|
||||
|
||||
104
payloads/v9/guildScheduledEvent.ts
Normal file
104
payloads/v9/guildScheduledEvent.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
import type { APIUser } from './user';
|
||||
import type { Snowflake } from '../../globals';
|
||||
|
||||
export interface APIGuildScheduledEvent {
|
||||
/**
|
||||
* The id of the guild event
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The guild id which the scheduled event belongs to
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The channel id in which the scheduled event will be hosted, or `null` if entity type is `EXTERNAL`
|
||||
*/
|
||||
channel_id: Snowflake | null;
|
||||
/**
|
||||
* The id of the user that created the scheduled event
|
||||
*/
|
||||
creator_id: Snowflake | null;
|
||||
/**
|
||||
* The name of the scheduled event
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The description of the scheduled event
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The time the scheduled event will start
|
||||
*/
|
||||
scheduled_start_time: string;
|
||||
/**
|
||||
* The time at which the guild event will end, or `null` if the event does not have a scheduled time to end
|
||||
*/
|
||||
scheduled_end_time: string | null;
|
||||
/**
|
||||
* The privacy level of the scheduled event
|
||||
*/
|
||||
privacy_level: GuildScheduledEventPrivacyLevel;
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status: GuildScheduledEventStatus;
|
||||
/**
|
||||
* The type of hosting entity associated with the scheduled event
|
||||
*/
|
||||
entity_type: GuildScheduledEventEntityType;
|
||||
/**
|
||||
* The id of the hosting entity associated with the scheduled event
|
||||
*/
|
||||
entity_id: Snowflake | null;
|
||||
/**
|
||||
* The entity metadata for the scheduled event
|
||||
*/
|
||||
entity_metadata: APIGuildScheduledEventEntityMetadata;
|
||||
/**
|
||||
* The user that created the scheduled event
|
||||
*/
|
||||
creator?: APIUser;
|
||||
/**
|
||||
* The number of users subscribed to the scheduled event
|
||||
*/
|
||||
user_count?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
|
||||
*/
|
||||
export interface APIGuildScheduledEventEntityMetadata {
|
||||
/**
|
||||
* The location of the scheduled event
|
||||
*/
|
||||
location?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types
|
||||
*/
|
||||
export const enum GuildScheduledEventEntityType {
|
||||
StageInstance = 1,
|
||||
Voice,
|
||||
External,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status
|
||||
*/
|
||||
export const enum GuildScheduledEventStatus {
|
||||
Scheduled = 1,
|
||||
Active,
|
||||
Completed,
|
||||
Canceled,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level
|
||||
*/
|
||||
export const enum GuildScheduledEventPrivacyLevel {
|
||||
/**
|
||||
* The scheduled event is only accessible to guild members
|
||||
*/
|
||||
GuildOnly = 2,
|
||||
}
|
||||
@@ -4,6 +4,7 @@ export * from './channel';
|
||||
export * from './emoji';
|
||||
export * from './gateway';
|
||||
export * from './guild';
|
||||
export * from './guildScheduledEvent';
|
||||
export * from './interactions';
|
||||
export * from './invite';
|
||||
export * from './oauth2';
|
||||
|
||||
@@ -9,6 +9,7 @@ import type {
|
||||
APIApplicationCommandGuildInteraction,
|
||||
APIApplicationCommandInteraction,
|
||||
} from './_interactions/applicationCommands';
|
||||
import type { APIApplicationCommandAutocompleteInteraction } from './_interactions/autocomplete';
|
||||
|
||||
export * from './_interactions/base';
|
||||
export * from './_interactions/messageComponents';
|
||||
@@ -19,7 +20,11 @@ export * from './_interactions/applicationCommands';
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIInteraction = APIPingInteraction | APIApplicationCommandInteraction | APIMessageComponentInteraction;
|
||||
export type APIInteraction =
|
||||
| APIPingInteraction
|
||||
| APIApplicationCommandInteraction
|
||||
| APIMessageComponentInteraction
|
||||
| APIApplicationCommandAutocompleteInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
|
||||
@@ -7,6 +7,7 @@ import type { APIPartialGuild } from './guild';
|
||||
import type { APIApplication } from './application';
|
||||
import type { APIInviteStageInstance } from './stageInstance';
|
||||
import type { APIUser } from './user';
|
||||
import type { APIGuildScheduledEvent } from './guildScheduledEvent';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object
|
||||
@@ -68,6 +69,10 @@ export interface APIInvite {
|
||||
* The stage instance data if there is a public stage instance in the stage channel this invite is for
|
||||
*/
|
||||
stage_instance?: APIInviteStageInstance;
|
||||
/**
|
||||
* The guild scheduled event data, returned from the `GET /invites/<code>` endpoint when `guild_scheduled_event_id` is a valid guild scheduled event id
|
||||
*/
|
||||
guild_scheduled_event?: APIGuildScheduledEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -45,10 +45,13 @@ export const PermissionFlagsBits = {
|
||||
ManageEmojisAndStickers: 1n << 30n,
|
||||
UseApplicationCommands: 1n << 31n,
|
||||
RequestToSpeak: 1n << 32n,
|
||||
ManageEvents: 1n << 33n,
|
||||
ManageThreads: 1n << 34n,
|
||||
UsePublicThreads: 1n << 35n,
|
||||
UsePrivateThreads: 1n << 36n,
|
||||
CreatePublicThreads: 1n << 35n,
|
||||
CreatePrivateThreads: 1n << 36n,
|
||||
UseExternalStickers: 1n << 37n,
|
||||
SendMessagesInThreads: 1n << 38n,
|
||||
StartEmbeddedActivities: 1n << 39n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
@@ -77,6 +80,14 @@ export interface APIRole {
|
||||
* If this role is pinned in the user listing
|
||||
*/
|
||||
hoist: boolean;
|
||||
/**
|
||||
* The role icon hash
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The role unicode emoji as a standard emoji
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
/**
|
||||
* Position of this role
|
||||
*/
|
||||
|
||||
@@ -85,20 +85,66 @@ export interface APIUser {
|
||||
* https://discord.com/developers/docs/resources/user#user-object-user-flags
|
||||
*/
|
||||
export const enum UserFlags {
|
||||
/**
|
||||
* None
|
||||
*/
|
||||
None = 0,
|
||||
DiscordEmployee = 1 << 0,
|
||||
PartneredServerOwner = 1 << 1,
|
||||
DiscordHypeSquadEvents = 1 << 2,
|
||||
/**
|
||||
* Discord Employee
|
||||
*/
|
||||
Staff = 1 << 0,
|
||||
/**
|
||||
* Partnered Server Owner
|
||||
*/
|
||||
Partner = 1 << 1,
|
||||
/**
|
||||
* HypeSquad Events Coordinator
|
||||
*/
|
||||
Hypesquad = 1 << 2,
|
||||
/**
|
||||
* Bug Hunter Level 1
|
||||
*/
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
HypeSquadHouseBravery = 1 << 6,
|
||||
HypeSquadHouseBrilliance = 1 << 7,
|
||||
HypeSquadHouseBalance = 1 << 8,
|
||||
EarlySupporter = 1 << 9,
|
||||
TeamUser = 1 << 10,
|
||||
/**
|
||||
* House Bravery Member
|
||||
*/
|
||||
HypeSquadOnlineHouse1 = 1 << 6,
|
||||
/**
|
||||
* House Brilliance Member
|
||||
*/
|
||||
HypeSquadOnlineHouse2 = 1 << 7,
|
||||
/**
|
||||
* House Balance Member
|
||||
*/
|
||||
HypeSquadOnlineHouse3 = 1 << 8,
|
||||
/**
|
||||
* Early Nitro Supporter
|
||||
*/
|
||||
PremiumEarlySupporter = 1 << 9,
|
||||
/**
|
||||
* User is a [team](https://discord.com/developers/docs/topics/teams)
|
||||
*/
|
||||
TeamPseudoUser = 1 << 10,
|
||||
/**
|
||||
* Bug Hunter Level 2
|
||||
*/
|
||||
BugHunterLevel2 = 1 << 14,
|
||||
/**
|
||||
* Verified Bot
|
||||
*/
|
||||
VerifiedBot = 1 << 16,
|
||||
EarlyVerifiedBotDeveloper = 1 << 17,
|
||||
DiscordCertifiedModerator = 1 << 18,
|
||||
/**
|
||||
* Early Verified Bot Developer
|
||||
*/
|
||||
VerifiedDeveloper = 1 << 17,
|
||||
/**
|
||||
* Discord Certified Moderator
|
||||
*/
|
||||
CertifiedModerator = 1 << 18,
|
||||
/**
|
||||
* Bot uses only [HTTP interactions](https://discord.com/developers/docs/interactions/receiving-and-responding#receiving-an-interaction) and is shown in the online member list
|
||||
*/
|
||||
BotHTTPInteractions = 1 << 19,
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -77,10 +77,6 @@ export interface APIVoiceRegion {
|
||||
* Name of the region
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* `true` if this is a vip-only server
|
||||
*/
|
||||
vip: boolean;
|
||||
/**
|
||||
* `true` for a single server that is closest to the current user's client
|
||||
*/
|
||||
|
||||
@@ -62,8 +62,8 @@ export const enum RESTJSONErrorCodes {
|
||||
NotAuthorizedToPerformThisActionOnThisApplication = 20012,
|
||||
|
||||
ActionCannotBePerformedDueToSlowmodeRateLimit = 20016,
|
||||
|
||||
OnlyTheOwnerOfThisAccountCanPerformThisAction = 20018,
|
||||
TheMazeIsntMeantForYou,
|
||||
OnlyTheOwnerOfThisAccountCanPerformThisAction,
|
||||
|
||||
AnnouncementEditLimitExceeded = 20022,
|
||||
|
||||
@@ -101,6 +101,7 @@ export const enum RESTJSONErrorCodes {
|
||||
MaximumNumberOfNonGuildMemberBansHasBeenExceeded = 30035,
|
||||
|
||||
MaximumNumberOfBanFetchesHasBeenReached = 30037,
|
||||
MaximumNumberOfUncompletedGuildScheduledEventsReached,
|
||||
|
||||
MaximumNumberOfStickersReached = 30039,
|
||||
MaximumNumberOfPruneRequestsHasBeenReached,
|
||||
@@ -172,6 +173,8 @@ export const enum RESTJSONErrorCodes {
|
||||
|
||||
ServerNeedsMonetizationEnabledToPerformThisAction = 50097,
|
||||
|
||||
ServerNeedsMoreBoostsToPerformThisAction = 50101,
|
||||
|
||||
TwoFactorAuthenticationIsRequired = 60003,
|
||||
|
||||
NoUsersWithDiscordTagExist = 80004,
|
||||
@@ -196,4 +199,8 @@ export const enum RESTJSONErrorCodes {
|
||||
LottieAnimationMaximumDimensionsExceeded,
|
||||
StickerFramerateIsTooSmallOrTooLarge,
|
||||
StickerAnimationDurationExceedsMaximumOf5Seconds,
|
||||
|
||||
CannotUpdateAFinishedEvent = 180000,
|
||||
|
||||
FailedToCreateStageNeededForStageEvent = 180002,
|
||||
}
|
||||
|
||||
@@ -214,28 +214,23 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake];
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIChannelMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
@@ -332,6 +327,8 @@ export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: APIAttachment[] | null;
|
||||
@@ -347,22 +344,13 @@ export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPatchAPIChannelMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
|
||||
@@ -122,6 +122,10 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -249,6 +253,10 @@ export interface RESTPatchAPIGuildJSONBody {
|
||||
* The description for the guild, if the guild is discoverable
|
||||
*/
|
||||
description?: string | null;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -525,6 +533,14 @@ export interface RESTPostAPIGuildRoleJSONBody {
|
||||
* @default false
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*
|
||||
@@ -577,6 +593,14 @@ export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*/
|
||||
|
||||
150
rest/v8/guildScheduledEvent.ts
Normal file
150
rest/v8/guildScheduledEvent.ts
Normal file
@@ -0,0 +1,150 @@
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
GuildScheduledEventEntityType,
|
||||
GuildScheduledEventPrivacyLevel,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
GuildScheduledEventStatus,
|
||||
APIGuildMember,
|
||||
APIUser,
|
||||
} from '../../v8';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
|
||||
*/
|
||||
export interface RESTGetAPIGuildScheduledEventsQuery {
|
||||
/**
|
||||
* Whether to include number of users subscribed to each event
|
||||
*/
|
||||
with_user_count?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
|
||||
*/
|
||||
export type RESTGetAPIGuildScheduledEventsResult = APIGuildScheduledEvent[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
*/
|
||||
export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
/**
|
||||
* The stage channel id of the guild event
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* The name of the guild event
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The privacy level of the guild event
|
||||
*/
|
||||
privacy_level: GuildScheduledEventPrivacyLevel;
|
||||
/**
|
||||
* The time to schedule the guild event at
|
||||
*/
|
||||
scheduled_start_time: string;
|
||||
/**
|
||||
* The time when the scheduled event is scheduled to end
|
||||
*/
|
||||
scheduled_end_time?: string;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The scheduled entity type of the guild event
|
||||
*/
|
||||
entity_type?: GuildScheduledEventEntityType;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPostAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event
|
||||
*/
|
||||
export interface RESTGetAPIGuildScheduledEventQuery {
|
||||
/**
|
||||
* Whether to include number of users subscribed to this event
|
||||
*/
|
||||
with_user_count?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event
|
||||
*/
|
||||
export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export interface RESTPatchAPIGuildScheduledEventJSONBody extends Partial<RESTPostAPIGuildScheduledEventJSONBody> {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event
|
||||
*/
|
||||
export type RESTDeleteAPIGuildScheduledEventResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
|
||||
*/
|
||||
export interface RESTGetAPIGuildScheduledEventUsersQuery {
|
||||
/**
|
||||
* Number of users to receive from the event
|
||||
*
|
||||
* @default 100
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Whether to include guild member data if it exists
|
||||
*/
|
||||
with_member?: boolean;
|
||||
/**
|
||||
* Consider only users before given user id
|
||||
*/
|
||||
before?: Snowflake;
|
||||
/**
|
||||
* Consider only users after given user id
|
||||
*/
|
||||
after?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
|
||||
*/
|
||||
export type RESTGetAPIGuildScheduledEventUsersResult = APIGuildScheduledEventUser[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-user-object-guild-scheduled-event-user-structure
|
||||
*/
|
||||
export interface APIGuildScheduledEventUser {
|
||||
/**
|
||||
* The scheduled event id which the user subscribed to
|
||||
*/
|
||||
guild_scheduled_event_id: Snowflake;
|
||||
/**
|
||||
* The user which subscribed to the event
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* The guild member data for this user for the guild which this event belongs to, if any
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
@@ -7,6 +7,7 @@ export * from './channel';
|
||||
export * from './emoji';
|
||||
export * from './gateway';
|
||||
export * from './guild';
|
||||
export * from './guildScheduledEvent';
|
||||
export * from './interactions';
|
||||
export * from './invite';
|
||||
export * from './oauth2';
|
||||
@@ -569,6 +570,30 @@ export const Routes = {
|
||||
return `/oauth2/@me` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/authorize`
|
||||
*/
|
||||
oauth2Authorization() {
|
||||
return `/oauth2/authorize` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token`
|
||||
*/
|
||||
oauth2TokenExchange() {
|
||||
return `/oauth2/token` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token/revoke`
|
||||
*/
|
||||
oauth2TokenRevocation() {
|
||||
return `/oauth2/token/revoke` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/commands`
|
||||
@@ -714,6 +739,33 @@ export const Routes = {
|
||||
guildSticker(guildId: Snowflake, stickerId: Snowflake) {
|
||||
return `/guilds/${guildId}/stickers/${stickerId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/scheduled-events`
|
||||
* - POST `/guilds/{guild.id}/scheduled-events`
|
||||
*/
|
||||
guildScheduledEvents(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/scheduled-events`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}`
|
||||
* - PATCH `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}`
|
||||
* - DELETE `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}`
|
||||
*/
|
||||
guildScheduledEvent(guildId: Snowflake, guildScheduledEventId: Snowflake) {
|
||||
return `/guilds/${guildId}/scheduled-events/${guildScheduledEventId}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}/users`
|
||||
*/
|
||||
guildScheduledEventUsers(guildId: Snowflake, guildScheduledEventId: Snowflake) {
|
||||
return `/guilds/${guildId}/scheduled-events/${guildScheduledEventId}/users`;
|
||||
},
|
||||
};
|
||||
|
||||
export const RouteBases = {
|
||||
@@ -728,12 +780,12 @@ export const RouteBases = {
|
||||
Object.freeze(RouteBases);
|
||||
|
||||
export const OAuth2Routes = {
|
||||
authorizationURL: `https://discord.com/api/v${APIVersion}/oauth2/authorize`,
|
||||
tokenURL: `https://discord.com/api/v${APIVersion}/oauth2/token`,
|
||||
authorizationURL: `${RouteBases.api}${Routes.oauth2Authorization()}`,
|
||||
tokenURL: `${RouteBases.api}${Routes.oauth2TokenExchange()}`,
|
||||
/**
|
||||
* See https://tools.ietf.org/html/rfc7009
|
||||
*/
|
||||
tokenRevocationURL: `https://discord.com/api/v${APIVersion}/oauth2/token/revoke`,
|
||||
tokenRevocationURL: `${RouteBases.api}${Routes.oauth2TokenRevocation()}`,
|
||||
} as const;
|
||||
|
||||
// Freeze OAuth2 route object
|
||||
|
||||
@@ -27,7 +27,7 @@ export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
|
||||
|
||||
type RESTPostAPIBaseApplicationCommandsJSONBody = Omit<
|
||||
APIApplicationCommand,
|
||||
'id' | 'application_id' | 'description' | 'type'
|
||||
'id' | 'application_id' | 'description' | 'type' | 'version'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -35,6 +35,10 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = Omit<
|
||||
*/
|
||||
export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody {
|
||||
type?: ApplicationCommandType.ChatInput;
|
||||
/**
|
||||
* Whether this application command option should be autocompleted
|
||||
*/
|
||||
autocomplete?: boolean;
|
||||
description: string;
|
||||
}
|
||||
|
||||
@@ -126,22 +130,13 @@ export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse;
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
|
||||
*/
|
||||
export type RESTPostAPIInteractionCallbackFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response
|
||||
@@ -177,22 +172,13 @@ export type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallb
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
|
||||
*/
|
||||
export type RESTPostAPIInteractionFollowupFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIInteractionFollowupJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type { APIInvite } from '../../payloads/v8/index';
|
||||
|
||||
/**
|
||||
@@ -12,6 +13,10 @@ export interface RESTGetAPIInviteQuery {
|
||||
* Whether the invite should contain the expiration date
|
||||
*/
|
||||
with_expiration?: boolean;
|
||||
/**
|
||||
* The guild scheduled event to include with the invite
|
||||
*/
|
||||
guild_scheduled_event_id?: Snowflake;
|
||||
}
|
||||
|
||||
export type RESTGetAPIInviteResult = APIInvite;
|
||||
|
||||
@@ -135,28 +135,23 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
* See https://discord.com/developers/docs/interactions/message-components#component-object
|
||||
*/
|
||||
components?: APIActionRowComponent[];
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
|
||||
@@ -235,6 +230,8 @@ export interface RESTPatchAPIWebhookWithTokenMessageJSONBody
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: APIAttachment[] | null;
|
||||
@@ -244,22 +241,13 @@ export interface RESTPatchAPIWebhookWithTokenMessageJSONBody
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
|
||||
@@ -248,28 +248,23 @@ export interface RESTPostAPIChannelMessageJSONBody {
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake];
|
||||
/**
|
||||
* Attachment objects with filename and description
|
||||
*/
|
||||
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIChannelMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
@@ -366,6 +361,8 @@ export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* Attached files to keep
|
||||
*
|
||||
* Starting with API v10, the `attachments` array must contain all attachments that should be present after edit, including **retained and new** attachments provided in the request body.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments?: APIAttachment[] | null;
|
||||
@@ -381,22 +378,13 @@ export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPatchAPIChannelMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
@@ -587,6 +575,10 @@ export interface RESTPostAPIChannelMessagesThreadsJSONBody {
|
||||
* The 3 day and 7 day archive durations require the server to be boosted. The [guild features](https://discord.com/developers/docs/resources/guild#guild-object-guild-features) will indicate if a server is able to use those settings.
|
||||
*/
|
||||
auto_archive_duration: ThreadAutoArchiveDuration;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600)
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -123,6 +123,10 @@ export interface RESTPostAPIGuildsJSONBody {
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,6 +254,10 @@ export interface RESTPatchAPIGuildJSONBody {
|
||||
* The description for the guild, if the guild is discoverable
|
||||
*/
|
||||
description?: string | null;
|
||||
/**
|
||||
* Whether the boosts progress bar should be enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -531,6 +539,14 @@ export interface RESTPostAPIGuildRoleJSONBody {
|
||||
* @default false
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*
|
||||
@@ -583,6 +599,14 @@ export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
/**
|
||||
* The role's icon image (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The role's unicode emoji as a standard emoji (if the guild has the `ROLE_ICONS` feature)
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*/
|
||||
|
||||
150
rest/v9/guildScheduledEvent.ts
Normal file
150
rest/v9/guildScheduledEvent.ts
Normal file
@@ -0,0 +1,150 @@
|
||||
import type { Snowflake } from '../../globals';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
GuildScheduledEventEntityType,
|
||||
GuildScheduledEventPrivacyLevel,
|
||||
APIGuildScheduledEventEntityMetadata,
|
||||
GuildScheduledEventStatus,
|
||||
APIGuildMember,
|
||||
APIUser,
|
||||
} from '../../v9';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
|
||||
*/
|
||||
export interface RESTGetAPIGuildScheduledEventsQuery {
|
||||
/**
|
||||
* Whether to include number of users subscribed to each event
|
||||
*/
|
||||
with_user_count?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#list-scheduled-events-for-guild
|
||||
*/
|
||||
export type RESTGetAPIGuildScheduledEventsResult = APIGuildScheduledEvent[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
*/
|
||||
export interface RESTPostAPIGuildScheduledEventJSONBody {
|
||||
/**
|
||||
* The stage channel id of the guild event
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* The name of the guild event
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The privacy level of the guild event
|
||||
*/
|
||||
privacy_level: GuildScheduledEventPrivacyLevel;
|
||||
/**
|
||||
* The time to schedule the guild event at
|
||||
*/
|
||||
scheduled_start_time: string;
|
||||
/**
|
||||
* The time when the scheduled event is scheduled to end
|
||||
*/
|
||||
scheduled_end_time?: string;
|
||||
/**
|
||||
* The description of the guild event
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* The scheduled entity type of the guild event
|
||||
*/
|
||||
entity_type?: GuildScheduledEventEntityType;
|
||||
/**
|
||||
* The entity metadata of the scheduled event
|
||||
*/
|
||||
entity_metadata?: APIGuildScheduledEventEntityMetadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#create-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPostAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event
|
||||
*/
|
||||
export interface RESTGetAPIGuildScheduledEventQuery {
|
||||
/**
|
||||
* Whether to include number of users subscribed to this event
|
||||
*/
|
||||
with_user_count?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event
|
||||
*/
|
||||
export type RESTGetAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export interface RESTPatchAPIGuildScheduledEventJSONBody extends Partial<RESTPostAPIGuildScheduledEventJSONBody> {
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status?: GuildScheduledEventStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#modify-guild-scheduled-event
|
||||
*/
|
||||
export type RESTPatchAPIGuildScheduledEventResult = APIGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#delete-guild-scheduled-event
|
||||
*/
|
||||
export type RESTDeleteAPIGuildScheduledEventResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
|
||||
*/
|
||||
export interface RESTGetAPIGuildScheduledEventUsersQuery {
|
||||
/**
|
||||
* Number of users to receive from the event
|
||||
*
|
||||
* @default 100
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* Whether to include guild member data if it exists
|
||||
*/
|
||||
with_member?: boolean;
|
||||
/**
|
||||
* Consider only users before given user id
|
||||
*/
|
||||
before?: Snowflake;
|
||||
/**
|
||||
* Consider only users after given user id
|
||||
*/
|
||||
after?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#get-guild-scheduled-event-users
|
||||
*/
|
||||
export type RESTGetAPIGuildScheduledEventUsersResult = APIGuildScheduledEventUser[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-user-object-guild-scheduled-event-user-structure
|
||||
*/
|
||||
export interface APIGuildScheduledEventUser {
|
||||
/**
|
||||
* The scheduled event id which the user subscribed to
|
||||
*/
|
||||
guild_scheduled_event_id: Snowflake;
|
||||
/**
|
||||
* The user which subscribed to the event
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* The guild member data for this user for the guild which this event belongs to, if any
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
@@ -7,6 +7,7 @@ export * from './channel';
|
||||
export * from './emoji';
|
||||
export * from './gateway';
|
||||
export * from './guild';
|
||||
export * from './guildScheduledEvent';
|
||||
export * from './interactions';
|
||||
export * from './invite';
|
||||
export * from './oauth2';
|
||||
@@ -473,6 +474,7 @@ export const Routes = {
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{thread.id}/thread-members`
|
||||
* - GET `/channels/{thread.id}/thread-members/{user.id}`
|
||||
* - PUT `/channels/{thread.id}/thread-members/@me`
|
||||
* - PUT `/channels/{thread.id}/thread-members/{user.id}`
|
||||
* - DELETE `/channels/{thread.id}/thread-members/@me`
|
||||
@@ -637,6 +639,30 @@ export const Routes = {
|
||||
return `/oauth2/@me` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/authorize`
|
||||
*/
|
||||
oauth2Authorization() {
|
||||
return `/oauth2/authorize` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token`
|
||||
*/
|
||||
oauth2TokenExchange() {
|
||||
return `/oauth2/token` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/oauth2/token/revoke`
|
||||
*/
|
||||
oauth2TokenRevocation() {
|
||||
return `/oauth2/token/revoke` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/commands`
|
||||
@@ -782,6 +808,33 @@ export const Routes = {
|
||||
guildSticker(guildId: Snowflake, stickerId: Snowflake) {
|
||||
return `/guilds/${guildId}/stickers/${stickerId}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/scheduled-events`
|
||||
* - POST `/guilds/{guild.id}/scheduled-events`
|
||||
*/
|
||||
guildScheduledEvents(guildId: Snowflake) {
|
||||
return `/guilds/${guildId}/scheduled-events`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}`
|
||||
* - PATCH `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}`
|
||||
* - DELETE `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}`
|
||||
*/
|
||||
guildScheduledEvent(guildId: Snowflake, guildScheduledEventId: Snowflake) {
|
||||
return `/guilds/${guildId}/scheduled-events/${guildScheduledEventId}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/scheduled-events/{guildScheduledEvent.id}/users`
|
||||
*/
|
||||
guildScheduledEventUsers(guildId: Snowflake, guildScheduledEventId: Snowflake) {
|
||||
return `/guilds/${guildId}/scheduled-events/${guildScheduledEventId}/users`;
|
||||
},
|
||||
};
|
||||
|
||||
export const RouteBases = {
|
||||
@@ -796,12 +849,12 @@ export const RouteBases = {
|
||||
Object.freeze(RouteBases);
|
||||
|
||||
export const OAuth2Routes = {
|
||||
authorizationURL: `https://discord.com/api/v${APIVersion}/oauth2/authorize`,
|
||||
tokenURL: `https://discord.com/api/v${APIVersion}/oauth2/token`,
|
||||
authorizationURL: `${RouteBases.api}${Routes.oauth2Authorization()}`,
|
||||
tokenURL: `${RouteBases.api}${Routes.oauth2TokenExchange()}`,
|
||||
/**
|
||||
* See https://tools.ietf.org/html/rfc7009
|
||||
*/
|
||||
tokenRevocationURL: `https://discord.com/api/v${APIVersion}/oauth2/token/revoke`,
|
||||
tokenRevocationURL: `${RouteBases.api}${Routes.oauth2TokenRevocation()}`,
|
||||
} as const;
|
||||
|
||||
// Freeze OAuth2 route object
|
||||
|
||||
@@ -27,7 +27,7 @@ export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
|
||||
|
||||
type RESTPostAPIBaseApplicationCommandsJSONBody = Omit<
|
||||
APIApplicationCommand,
|
||||
'id' | 'application_id' | 'description' | 'type'
|
||||
'id' | 'application_id' | 'description' | 'type' | 'version'
|
||||
>;
|
||||
|
||||
/**
|
||||
@@ -35,6 +35,10 @@ type RESTPostAPIBaseApplicationCommandsJSONBody = Omit<
|
||||
*/
|
||||
export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody {
|
||||
type?: ApplicationCommandType.ChatInput;
|
||||
/**
|
||||
* Whether this application command option should be autocompleted
|
||||
*/
|
||||
autocomplete?: boolean;
|
||||
description: string;
|
||||
}
|
||||
|
||||
@@ -126,22 +130,13 @@ export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse;
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
|
||||
*/
|
||||
export type RESTPostAPIInteractionCallbackFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response
|
||||
@@ -177,22 +172,13 @@ export type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallb
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
|
||||
*/
|
||||
export type RESTPostAPIInteractionFollowupFormDataBody =
|
||||
| {
|
||||
| ({
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIInteractionFollowupJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
} & Record<`files[${bigint}]`, unknown>)
|
||||
| (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user