Compare commits

..

50 Commits

Author SHA1 Message Date
github-actions[bot]
1cd9b53ea8 chore(release): 0.31.2 🎉 (#403)
Build ran for 4cbb5fa894

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-18 15:47:08 +02:00
Vitor Lopes
4cbb5fa894 docs: fix links from DDevs portal (#402) 2022-04-17 15:54:28 +03:00
Suneet Tipirneni
6a192b132c feat(RESTPostAPIGuildChannelJSONBody): add default_auto_archive prop (#400) 2022-04-15 22:26:06 +03:00
github-actions[bot]
e4280853ae chore(release): 0.31.1 🎉 (#401)
Build ran for bf08484988

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-11 19:01:33 +02:00
Suneet Tipirneni
bf08484988 feat(APIGuildForum): add support for forums, part 1 (#398)
Co-authored-by: Vitor <milagre.vitor@gmail.com>
2022-04-10 20:48:13 +03:00
advaith
69079ee132 feat: student hubs (#215)
With extra documentation because sometimes Discord doesn't wanna document crucial things -.-
2022-04-07 14:58:01 +03:00
Vlad Frangu
bc6e97f309 feat(APIApplicationCommandInteractionData): add guild_id (#396) 2022-04-04 20:55:03 +03:00
Vitor
279bf67aa8 docs(FormattingPatterns): mark UserWithNickname and UserWithOptionalNickname as deprecated (#392) 2022-04-04 18:21:39 +03:00
github-actions[bot]
d703a6645a chore(release): 0.31.0 🎉 (#395)
Build ran for b1bf7bf0f9

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-04-04 15:57:38 +02:00
Almeida
b1bf7bf0f9 feat: add RESTGetAPIGuildBansQuery (#391) 2022-04-01 00:05:23 +03:00
Vitor
fffd9f9088 docs(APIApplicationCommand): use the new regex (#390) 2022-03-31 20:34:12 +03:00
Vlad Frangu
6900b74865 ci: correctly delete the head branch (#388) 2022-03-31 16:17:34 +03:00
Almeida
f0ab4e8c48 refactor: remove summary from applications (#386)
BREAKING CHANGE: The deprecated `summary` field has been removed
2022-03-29 21:48:53 +03:00
Suneet Tipirneni
9c12718163 feat(APIApplicationCommand): add missing localization props (#383) 2022-03-29 21:31:09 +03:00
Almeida
25677fff43 refactor: remove store channels (#364)
BREAKING CHANGE: Store channels have been removed, alongside their types
2022-03-29 21:29:46 +03:00
Vitor
6b0f662f0e refactor(APIApplicationCommand): nullable localization fields (#382) 2022-03-29 21:28:49 +03:00
Vitor
b764e8dc1a feat(RESTPostAPIStageInstanceJSONBody): add send_start_notification (#378) 2022-03-29 21:28:25 +03:00
Suneet Tipirneni
93eab113cd feat(APIApplication): app authorization links and tags (#239)
Co-authored-by: Rodry <38259440+ImRodry@users.noreply.github.com>
2022-03-29 21:27:55 +03:00
Suneet Tipirneni
c23f2accf9 feat(GuildFeatures): add animated banners (#219) 2022-03-29 20:39:53 +03:00
Almeida
feba5b743b docs(UserFlags): update misleading Hypesquad description (#374) 2022-03-29 20:38:37 +03:00
Almeida
ed0049b78f refactor(APIGroupDMChannel): make name nullable (#347)
BREAKING CHANGE: The `name` field is now also nullable for Group DM Channels
2022-03-29 20:38:05 +03:00
Vitor
16a996d77d docs(APIGuild): any guild can have description (#384) 2022-03-29 20:36:16 +03:00
Vlad Frangu
f173b18312 chore(deno): give deno the v10 exports they desire (#380) 2022-03-26 11:52:28 +02:00
Vlad Frangu
c9838220ce ci: automatic PR triage (#381) 2022-03-26 11:52:09 +02:00
Vitor
f532002574 feat(APIAuditLogChange): add APIAuditLogChangeKeyImageHash (#379) 2022-03-26 01:15:58 +02:00
dependabot[bot]
f75c632565 chore(deps): bump minimist from 1.2.5 to 1.2.6 (#377)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-26 01:15:36 +02:00
github-actions[bot]
dad9eea547 chore(release): 0.30.0 🎉 (#376)
Build ran for f702988112

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-24 14:16:36 +01:00
Suneet Tipirneni
f702988112 feat(APIApplicationCommand): add command localization (#370) 2022-03-24 01:04:17 +02:00
Parbez
e822e45b3b revert: fix(GatewayVoiceState): some fields are optional instead of nullable (#367) 2022-03-12 13:53:07 +02:00
Jiralite
fa740eb16c fix(APIGuildIntegrationType): correct name of type (#366)
BREAKING CHANGE: `APIGuildInteractionType` is now correctly named `APIGuildIntegrationType`
2022-03-12 00:53:08 +02:00
KinectTheUnknown
8cb629befe chore(.gitignore): fix capitalization error for DS_Store (#365)
The correct capitalization used by macOS is `.DS_Store`, not `.DS_store`
2022-03-11 01:59:04 +02:00
github-actions[bot]
b0443a02ec chore(release): 0.29.0 🎉 (#363)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-10 13:43:14 +01:00
Suneet Tipirneni
cb92843991 feat(APIInviteGuild): add boost count (#323) 2022-03-09 23:49:07 +02:00
Suneet Tipirneni
d06d2d6a9a feat(APIStageInstance): add guild_scheduled_event_id (#350) 2022-03-09 23:46:13 +02:00
Almeida
854aa3691c fix(RESTJSONErrorCodes): typo in error 30046 (#362)
BREAKING CHANGE: `MaximumNumberOfEditsToMessagesOlderThanOneHourReached` is no longer mistyped as `MaxmimumNumberOfEditsToMessagesOlderThanOneHourReached`
2022-03-09 22:10:05 +02:00
Almeida
e5710d0e42 refactor(APIGuildScheduledEventBase): make description nullable (#359)
BREAKING CHANGE: The type for `description` can also be null, not just optional
2022-03-09 21:12:51 +02:00
Almeida
9a578489ad refactor(RESTJSONErrorCodes): update error 50008 key (#338)
BREAKING CHANGE: The error code `50008` has been renamed from `CannotSendMessagesInVoiceChannel` to `CannotSendMessagesInNonTextChannel`
2022-03-09 21:12:00 +02:00
Almeida
10fdeaa68d refactor: make things optional and nullable where applicable (#361)
BREAKING CHANGE: The deprecated `asset` field for stickers is correctly marked as optional now. The `image` field for Guild Scheduled Events is now correctly typed as optional.
2022-03-09 21:11:08 +02:00
Almeida
fddff2167c fix(GatewayVoiceState): some fields are optional instead of nullable (#345)
BREAKING CHANGE: `channel_id` and `request_to_speak_timestamp` are correctly typed as optional, not nullable now.
2022-03-09 20:45:54 +02:00
Almeida
e8127b89f8 feat(RESTJSONErrorCodes): add error 10065 (#336) 2022-03-09 20:44:24 +02:00
Almeida
ab2598441a docs(APISelectMenuComponent): update placeholder max to 150 (#346) 2022-03-09 20:44:01 +02:00
github-actions[bot]
95f3e175b1 chore(release): 0.28.0 🎉 (#360)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-03-07 13:19:39 +01:00
Ian Mitchell
a3b1006c87 chore: export APIButtonComponentBase<T> interface (#357) 2022-03-05 20:31:49 +02:00
Ian Mitchell
dec7717bc7 feat(Utils): add more typeguard functions to determine the interaction types (#355) 2022-03-05 20:30:41 +02:00
Vlad Frangu
e9ee6966c3 feat: add support for TS module: NodeNext (#356) 2022-03-05 20:29:37 +02:00
Ian Mitchell
3503a4fd38 feat(MessageComponentInteraction): export specific interaction aliases (#353) 2022-03-03 04:47:50 +02:00
Jeroen Claassens
1eba8a3a34 ci: remove deprecate regular versions (#349)
Because its more annoying than useful so 🧹
2022-02-27 21:21:05 +02:00
Suneet Tipirneni
3e3acb5297 refactor(PermissionFlagsBits): rename StartEmbeddedActivities to UseEmbeddedActivities (#342)
BREAKING CHANGE: The `StartEmbeddedActivities` permission flag has been renamed to `UseEmbeddedActivities`
2022-02-25 23:05:07 +02:00
github-actions[bot]
a6aa5b3907 chore(release): 0.27.3 🎉 (#344)
Build ran for 8d432f2ebe

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2022-02-24 13:29:20 +01:00
andre4ik3
8d432f2ebe fix(APIApplicationCommandAutocompleteInteraction): make options field required for v10 (PR #332 redo) (#339) 2022-02-18 19:57:17 +02:00
254 changed files with 4064 additions and 2923 deletions

7
.github/auto_assign.yml vendored Normal file
View File

@@ -0,0 +1,7 @@
addReviewers: true
reviewers:
- iCrawl
- SpaceEEC
- kyranet
- vladfrangu
numberOfReviewers: 0

56
.github/labeler.yml vendored Normal file
View File

@@ -0,0 +1,56 @@
chore:
- any: ['*']
all:
[
'!deno/**/*',
'!gateway/**/*',
'!payloads/**/*',
'!rest/**/*',
'!rpc/**/*',
'!tests/**/*',
'!utils/**/*',
'!voice/**/*',
]
ci:
- .github/**/*
- .husky/**/*
- scripts/actions/**/*
dependencies:
- package.json
- package-lock.json
'topic:deno':
- scripts/deno.mjs
- scripts/actions/report-deno-not-ran.mjs
'topic:gateway':
- gateway/**/*
'topic:payloads':
- payloads/**/*
'topic:rest':
- rest/**/*
'topic:rpc':
- rpc/**/*
'topic:scripts':
- scripts/**/*
'topic:tests':
- tests/**/*
'topic:utils':
- utils/**/*
'topic:voice':
- voice/**/*
'topic:globals':
- globals.ts
'topic:website':
- website/**/*

4
.github/labels.yml vendored
View File

@@ -51,3 +51,7 @@
color: 'aed5fc'
- name: 'topic:voice'
color: 'aed5fc'
- name: 'topic:globals'
color: 'aed5fc'
- name: 'topic:website'
color: 'aed5fc'

View File

@@ -77,11 +77,6 @@ jobs:
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Deprecate old versions
run: npx npm-deprecate --name "*" --package discord-api-types --message "No longer supported. Install the latest release!" || true
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
- name: Publish release to npm
run: npm publish
env:

18
.github/workflows/pr-automation.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: 'PR Automation'
on:
pull_request_target:
jobs:
triage:
runs-on: ubuntu-latest
steps:
- name: Automatically label PR
uses: actions/labeler@v3
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
sync-labels: true
- name: Automatically assign reviewers
if: ${{ github.event.action == 'opened' }}
uses: kentaro-m/auto-assign-action@v1.1.2

2
.gitignore vendored
View File

@@ -47,4 +47,4 @@ voice/**/*.d.ts
voice/**/*.mjs
# macOS files
.DS_store
.DS_Store

View File

@@ -1,4 +1,9 @@
{
"files.eol": "\n",
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"editor.codeActionsOnSave": {
"source.organizeImports": false,
"source.fixAll": true,
"source.fixAll.eslint": true
}
}

View File

@@ -1,3 +1,107 @@
## [0.31.2](https://github.com/discordjs/discord-api-types/compare/0.31.1...0.31.2) (2022-04-18)
### Features
- **RESTPostAPIGuildChannelJSONBody:** add `default_auto_archive` prop ([#400](https://github.com/discordjs/discord-api-types/issues/400)) ([6a192b1](https://github.com/discordjs/discord-api-types/commit/6a192b132c11f13d95ea3e7ed1eb556600f2f415))
## [0.31.1](https://github.com/discordjs/discord-api-types/compare/0.31.0...0.31.1) (2022-04-11)
### Features
- **APIApplicationCommandInteractionData:** add `guild_id` ([#396](https://github.com/discordjs/discord-api-types/issues/396)) ([bc6e97f](https://github.com/discordjs/discord-api-types/commit/bc6e97f309b1f5e0bc0063ada3aed77f34214e9f))
- **APIGuildForum:** add support for forums, part 1 ([#398](https://github.com/discordjs/discord-api-types/issues/398)) ([bf08484](https://github.com/discordjs/discord-api-types/commit/bf084849885dd15b19f4f46aa260815037131600))
- student hubs ([#215](https://github.com/discordjs/discord-api-types/issues/215)) ([69079ee](https://github.com/discordjs/discord-api-types/commit/69079ee132777977e9a9e163696ffdc8db82fe38))
# [0.31.0](https://github.com/discordjs/discord-api-types/compare/0.30.0...0.31.0) (2022-04-04)
### Code Refactoring
- **APIGroupDMChannel:** make `name` nullable ([#347](https://github.com/discordjs/discord-api-types/issues/347)) ([ed0049b](https://github.com/discordjs/discord-api-types/commit/ed0049b78f4008460b0c7a2ec68eb38f018be3bd))
- remove `summary` from applications ([#386](https://github.com/discordjs/discord-api-types/issues/386)) ([f0ab4e8](https://github.com/discordjs/discord-api-types/commit/f0ab4e8c48895f8daee7fa296b8319a98fb7d4e1))
- remove store channels ([#364](https://github.com/discordjs/discord-api-types/issues/364)) ([25677ff](https://github.com/discordjs/discord-api-types/commit/25677fff43533b3b11b88f01efe98f0875014cb5))
### Features
- add `RESTGetAPIGuildBansQuery` ([#391](https://github.com/discordjs/discord-api-types/issues/391)) ([b1bf7bf](https://github.com/discordjs/discord-api-types/commit/b1bf7bf0f9a37fa391a67e4b5b1dd288821d0ebb))
- **APIApplication:** app authorization links and tags ([#239](https://github.com/discordjs/discord-api-types/issues/239)) ([93eab11](https://github.com/discordjs/discord-api-types/commit/93eab113cdcfd3bdd868f1d86bb4bc2a5247d844))
- **APIApplicationCommand:** add missing localization props ([#383](https://github.com/discordjs/discord-api-types/issues/383)) ([9c12718](https://github.com/discordjs/discord-api-types/commit/9c1271816312382be3471cb2fdbb6260e973b4f6))
- **APIAuditLogChange:** add `APIAuditLogChangeKeyImageHash` ([#379](https://github.com/discordjs/discord-api-types/issues/379)) ([f532002](https://github.com/discordjs/discord-api-types/commit/f532002574b655d87151c325be6c02fe6f65bbe0))
- **GuildFeatures:** add animated banners ([#219](https://github.com/discordjs/discord-api-types/issues/219)) ([c23f2ac](https://github.com/discordjs/discord-api-types/commit/c23f2accf998ffa0c068d222fd9f34228a86a699))
- **RESTPostAPIStageInstanceJSONBody:** add `send_start_notification` ([#378](https://github.com/discordjs/discord-api-types/issues/378)) ([b764e8d](https://github.com/discordjs/discord-api-types/commit/b764e8dc1a92e254161f3a443e17148a81240b66))
### BREAKING CHANGES
- The deprecated `summary` field has been removed
- Store channels have been removed, alongside their types
- **APIGroupDMChannel:** The `name` field is now also nullable for Group DM Channels
# [0.30.0](https://github.com/discordjs/discord-api-types/compare/0.29.0...0.30.0) (2022-03-24)
### Bug Fixes
- **APIGuildIntegrationType:** correct name of type ([#366](https://github.com/discordjs/discord-api-types/issues/366)) ([fa740eb](https://github.com/discordjs/discord-api-types/commit/fa740eb16c8bba9d2c9c915d2e0139e5e1211040))
### Features
- **APIApplicationCommand:** add command localization ([#370](https://github.com/discordjs/discord-api-types/issues/370)) ([f702988](https://github.com/discordjs/discord-api-types/commit/f70298811242d946cee01b112c34382f0e54cb78))
### Reverts
- fix(GatewayVoiceState): some fields are optional instead of nullable ([#367](https://github.com/discordjs/discord-api-types/issues/367)) ([e822e45](https://github.com/discordjs/discord-api-types/commit/e822e45b3b6e07eb85a45039975cb33636765f5e))
### BREAKING CHANGES
- **APIGuildIntegrationType:** `APIGuildInteractionType` is now correctly named `APIGuildIntegrationType`
# [0.29.0](https://github.com/discordjs/discord-api-types/compare/0.28.0...0.29.0) (2022-03-10)
### Bug Fixes
- **GatewayVoiceState:** some fields are optional instead of nullable ([#345](https://github.com/discordjs/discord-api-types/issues/345)) ([fddff21](https://github.com/discordjs/discord-api-types/commit/fddff2167c858832d6c61f3efca8d944fd356a85))
- **RESTJSONErrorCodes:** typo in error `30046` ([#362](https://github.com/discordjs/discord-api-types/issues/362)) ([854aa36](https://github.com/discordjs/discord-api-types/commit/854aa3691c4d16a2c7fec7421cf25ea03a030e55))
### Code Refactoring
- **APIGuildScheduledEventBase:** make `description` nullable ([#359](https://github.com/discordjs/discord-api-types/issues/359)) ([e5710d0](https://github.com/discordjs/discord-api-types/commit/e5710d0e42d4f597bc9ed5594619a5032bf59bcb))
- make things optional and nullable where applicable ([#361](https://github.com/discordjs/discord-api-types/issues/361)) ([10fdeaa](https://github.com/discordjs/discord-api-types/commit/10fdeaa68df9b3b61b20b8d90b9587d03d95a450))
- **RESTJSONErrorCodes:** update error `50008` key ([#338](https://github.com/discordjs/discord-api-types/issues/338)) ([9a57848](https://github.com/discordjs/discord-api-types/commit/9a578489ad05b2ba8ed8d496db19cb86fa572ef7))
### Features
- **APIInviteGuild:** add boost count ([#323](https://github.com/discordjs/discord-api-types/issues/323)) ([cb92843](https://github.com/discordjs/discord-api-types/commit/cb92843991307d59c61d017d8ab1adcd469b4512))
- **APIStageInstance:** add `guild_scheduled_event_id` ([#350](https://github.com/discordjs/discord-api-types/issues/350)) ([d06d2d6](https://github.com/discordjs/discord-api-types/commit/d06d2d6a9a8ccc84337b2ce9c59430694ae93e8a))
- **RESTJSONErrorCodes:** add error `10065` ([#336](https://github.com/discordjs/discord-api-types/issues/336)) ([e8127b8](https://github.com/discordjs/discord-api-types/commit/e8127b89f89c4612fab0d3702ce512e41ab75b6e))
### BREAKING CHANGES
- **RESTJSONErrorCodes:** `MaximumNumberOfEditsToMessagesOlderThanOneHourReached` is no longer mistyped as `MaxmimumNumberOfEditsToMessagesOlderThanOneHourReached`
- **APIGuildScheduledEventBase:** The type for `description` can also be null, not just optional
- **RESTJSONErrorCodes:** The error code `50008` has been renamed from `CannotSendMessagesInVoiceChannel` to `CannotSendMessagesInNonTextChannel`
- The deprecated `asset` field for stickers is correctly marked as optional now. The `image` field for Guild Scheduled Events is now correctly typed as optional.
- **GatewayVoiceState:** `channel_id` and `request_to_speak_timestamp` are correctly typed as optional, not nullable now.
# [0.28.0](https://github.com/discordjs/discord-api-types/compare/0.27.3...0.28.0) (2022-03-07)
### Code Refactoring
- **PermissionFlagsBits:** rename `StartEmbeddedActivities` to `UseEmbeddedActivities` ([#342](https://github.com/discordjs/discord-api-types/issues/342)) ([3e3acb5](https://github.com/discordjs/discord-api-types/commit/3e3acb5297e3e546fbb7fc82acddb50170ffc1de))
### Features
- add support for TS module: NodeNext ([#356](https://github.com/discordjs/discord-api-types/issues/356)) ([e9ee696](https://github.com/discordjs/discord-api-types/commit/e9ee6966c38c82544536ece85af0c1b3bd592bfc))
- **MessageComponentInteraction:** export specific interaction aliases ([#353](https://github.com/discordjs/discord-api-types/issues/353)) ([3503a4f](https://github.com/discordjs/discord-api-types/commit/3503a4fd384be8459a1628a6f019a1bc164c0386))
- **Utils:** add more typeguard functions to determine the interaction types ([#355](https://github.com/discordjs/discord-api-types/issues/355)) ([dec7717](https://github.com/discordjs/discord-api-types/commit/dec7717bc76ac86c8b7d45ed4e0b506e532f7cb9))
### BREAKING CHANGES
- **PermissionFlagsBits:** The `StartEmbeddedActivities` permission flag has been renamed to `UseEmbeddedActivities`
## [0.27.3](https://github.com/discordjs/discord-api-types/compare/0.27.2...0.27.3) (2022-02-24)
### Bug Fixes
- **APIApplicationCommandAutocompleteInteraction:** make `options` field required for v10 (PR [#332](https://github.com/discordjs/discord-api-types/issues/332) redo) ([#339](https://github.com/discordjs/discord-api-types/issues/339)) ([8d432f2](https://github.com/discordjs/discord-api-types/commit/8d432f2ebe54904cc0285b1e05706ca105ece7b8))
## [0.27.2](https://github.com/discordjs/discord-api-types/compare/0.27.1...0.27.2) (2022-02-17)
### Bug Fixes

View File

@@ -1,3 +1,107 @@
## [0.31.2](https://github.com/discordjs/discord-api-types/compare/0.31.1...0.31.2) (2022-04-18)
### Features
- **RESTPostAPIGuildChannelJSONBody:** add `default_auto_archive` prop ([#400](https://github.com/discordjs/discord-api-types/issues/400)) ([6a192b1](https://github.com/discordjs/discord-api-types/commit/6a192b132c11f13d95ea3e7ed1eb556600f2f415))
## [0.31.1](https://github.com/discordjs/discord-api-types/compare/0.31.0...0.31.1) (2022-04-11)
### Features
- **APIApplicationCommandInteractionData:** add `guild_id` ([#396](https://github.com/discordjs/discord-api-types/issues/396)) ([bc6e97f](https://github.com/discordjs/discord-api-types/commit/bc6e97f309b1f5e0bc0063ada3aed77f34214e9f))
- **APIGuildForum:** add support for forums, part 1 ([#398](https://github.com/discordjs/discord-api-types/issues/398)) ([bf08484](https://github.com/discordjs/discord-api-types/commit/bf084849885dd15b19f4f46aa260815037131600))
- student hubs ([#215](https://github.com/discordjs/discord-api-types/issues/215)) ([69079ee](https://github.com/discordjs/discord-api-types/commit/69079ee132777977e9a9e163696ffdc8db82fe38))
# [0.31.0](https://github.com/discordjs/discord-api-types/compare/0.30.0...0.31.0) (2022-04-04)
### Code Refactoring
- **APIGroupDMChannel:** make `name` nullable ([#347](https://github.com/discordjs/discord-api-types/issues/347)) ([ed0049b](https://github.com/discordjs/discord-api-types/commit/ed0049b78f4008460b0c7a2ec68eb38f018be3bd))
- remove `summary` from applications ([#386](https://github.com/discordjs/discord-api-types/issues/386)) ([f0ab4e8](https://github.com/discordjs/discord-api-types/commit/f0ab4e8c48895f8daee7fa296b8319a98fb7d4e1))
- remove store channels ([#364](https://github.com/discordjs/discord-api-types/issues/364)) ([25677ff](https://github.com/discordjs/discord-api-types/commit/25677fff43533b3b11b88f01efe98f0875014cb5))
### Features
- add `RESTGetAPIGuildBansQuery` ([#391](https://github.com/discordjs/discord-api-types/issues/391)) ([b1bf7bf](https://github.com/discordjs/discord-api-types/commit/b1bf7bf0f9a37fa391a67e4b5b1dd288821d0ebb))
- **APIApplication:** app authorization links and tags ([#239](https://github.com/discordjs/discord-api-types/issues/239)) ([93eab11](https://github.com/discordjs/discord-api-types/commit/93eab113cdcfd3bdd868f1d86bb4bc2a5247d844))
- **APIApplicationCommand:** add missing localization props ([#383](https://github.com/discordjs/discord-api-types/issues/383)) ([9c12718](https://github.com/discordjs/discord-api-types/commit/9c1271816312382be3471cb2fdbb6260e973b4f6))
- **APIAuditLogChange:** add `APIAuditLogChangeKeyImageHash` ([#379](https://github.com/discordjs/discord-api-types/issues/379)) ([f532002](https://github.com/discordjs/discord-api-types/commit/f532002574b655d87151c325be6c02fe6f65bbe0))
- **GuildFeatures:** add animated banners ([#219](https://github.com/discordjs/discord-api-types/issues/219)) ([c23f2ac](https://github.com/discordjs/discord-api-types/commit/c23f2accf998ffa0c068d222fd9f34228a86a699))
- **RESTPostAPIStageInstanceJSONBody:** add `send_start_notification` ([#378](https://github.com/discordjs/discord-api-types/issues/378)) ([b764e8d](https://github.com/discordjs/discord-api-types/commit/b764e8dc1a92e254161f3a443e17148a81240b66))
### BREAKING CHANGES
- The deprecated `summary` field has been removed
- Store channels have been removed, alongside their types
- **APIGroupDMChannel:** The `name` field is now also nullable for Group DM Channels
# [0.30.0](https://github.com/discordjs/discord-api-types/compare/0.29.0...0.30.0) (2022-03-24)
### Bug Fixes
- **APIGuildIntegrationType:** correct name of type ([#366](https://github.com/discordjs/discord-api-types/issues/366)) ([fa740eb](https://github.com/discordjs/discord-api-types/commit/fa740eb16c8bba9d2c9c915d2e0139e5e1211040))
### Features
- **APIApplicationCommand:** add command localization ([#370](https://github.com/discordjs/discord-api-types/issues/370)) ([f702988](https://github.com/discordjs/discord-api-types/commit/f70298811242d946cee01b112c34382f0e54cb78))
### Reverts
- fix(GatewayVoiceState): some fields are optional instead of nullable ([#367](https://github.com/discordjs/discord-api-types/issues/367)) ([e822e45](https://github.com/discordjs/discord-api-types/commit/e822e45b3b6e07eb85a45039975cb33636765f5e))
### BREAKING CHANGES
- **APIGuildIntegrationType:** `APIGuildInteractionType` is now correctly named `APIGuildIntegrationType`
# [0.29.0](https://github.com/discordjs/discord-api-types/compare/0.28.0...0.29.0) (2022-03-10)
### Bug Fixes
- **GatewayVoiceState:** some fields are optional instead of nullable ([#345](https://github.com/discordjs/discord-api-types/issues/345)) ([fddff21](https://github.com/discordjs/discord-api-types/commit/fddff2167c858832d6c61f3efca8d944fd356a85))
- **RESTJSONErrorCodes:** typo in error `30046` ([#362](https://github.com/discordjs/discord-api-types/issues/362)) ([854aa36](https://github.com/discordjs/discord-api-types/commit/854aa3691c4d16a2c7fec7421cf25ea03a030e55))
### Code Refactoring
- **APIGuildScheduledEventBase:** make `description` nullable ([#359](https://github.com/discordjs/discord-api-types/issues/359)) ([e5710d0](https://github.com/discordjs/discord-api-types/commit/e5710d0e42d4f597bc9ed5594619a5032bf59bcb))
- make things optional and nullable where applicable ([#361](https://github.com/discordjs/discord-api-types/issues/361)) ([10fdeaa](https://github.com/discordjs/discord-api-types/commit/10fdeaa68df9b3b61b20b8d90b9587d03d95a450))
- **RESTJSONErrorCodes:** update error `50008` key ([#338](https://github.com/discordjs/discord-api-types/issues/338)) ([9a57848](https://github.com/discordjs/discord-api-types/commit/9a578489ad05b2ba8ed8d496db19cb86fa572ef7))
### Features
- **APIInviteGuild:** add boost count ([#323](https://github.com/discordjs/discord-api-types/issues/323)) ([cb92843](https://github.com/discordjs/discord-api-types/commit/cb92843991307d59c61d017d8ab1adcd469b4512))
- **APIStageInstance:** add `guild_scheduled_event_id` ([#350](https://github.com/discordjs/discord-api-types/issues/350)) ([d06d2d6](https://github.com/discordjs/discord-api-types/commit/d06d2d6a9a8ccc84337b2ce9c59430694ae93e8a))
- **RESTJSONErrorCodes:** add error `10065` ([#336](https://github.com/discordjs/discord-api-types/issues/336)) ([e8127b8](https://github.com/discordjs/discord-api-types/commit/e8127b89f89c4612fab0d3702ce512e41ab75b6e))
### BREAKING CHANGES
- **RESTJSONErrorCodes:** `MaximumNumberOfEditsToMessagesOlderThanOneHourReached` is no longer mistyped as `MaxmimumNumberOfEditsToMessagesOlderThanOneHourReached`
- **APIGuildScheduledEventBase:** The type for `description` can also be null, not just optional
- **RESTJSONErrorCodes:** The error code `50008` has been renamed from `CannotSendMessagesInVoiceChannel` to `CannotSendMessagesInNonTextChannel`
- The deprecated `asset` field for stickers is correctly marked as optional now. The `image` field for Guild Scheduled Events is now correctly typed as optional.
- **GatewayVoiceState:** `channel_id` and `request_to_speak_timestamp` are correctly typed as optional, not nullable now.
# [0.28.0](https://github.com/discordjs/discord-api-types/compare/0.27.3...0.28.0) (2022-03-07)
### Code Refactoring
- **PermissionFlagsBits:** rename `StartEmbeddedActivities` to `UseEmbeddedActivities` ([#342](https://github.com/discordjs/discord-api-types/issues/342)) ([3e3acb5](https://github.com/discordjs/discord-api-types/commit/3e3acb5297e3e546fbb7fc82acddb50170ffc1de))
### Features
- add support for TS module: NodeNext ([#356](https://github.com/discordjs/discord-api-types/issues/356)) ([e9ee696](https://github.com/discordjs/discord-api-types/commit/e9ee6966c38c82544536ece85af0c1b3bd592bfc))
- **MessageComponentInteraction:** export specific interaction aliases ([#353](https://github.com/discordjs/discord-api-types/issues/353)) ([3503a4f](https://github.com/discordjs/discord-api-types/commit/3503a4fd384be8459a1628a6f019a1bc164c0386))
- **Utils:** add more typeguard functions to determine the interaction types ([#355](https://github.com/discordjs/discord-api-types/issues/355)) ([dec7717](https://github.com/discordjs/discord-api-types/commit/dec7717bc76ac86c8b7d45ed4e0b506e532f7cb9))
### BREAKING CHANGES
- **PermissionFlagsBits:** The `StartEmbeddedActivities` permission flag has been renamed to `UseEmbeddedActivities`
## [0.27.3](https://github.com/discordjs/discord-api-types/compare/0.27.2...0.27.3) (2022-02-24)
### Bug Fixes
- **APIApplicationCommandAutocompleteInteraction:** make `options` field required for v10 (PR [#332](https://github.com/discordjs/discord-api-types/issues/332) redo) ([#339](https://github.com/discordjs/discord-api-types/issues/339)) ([8d432f2](https://github.com/discordjs/discord-api-types/commit/8d432f2ebe54904cc0285b1e05706ca105ece7b8))
## [0.27.2](https://github.com/discordjs/discord-api-types/compare/0.27.1...0.27.2) (2022-02-17)
### Bug Fixes

View File

@@ -23,12 +23,14 @@ export const FormattingPatterns = {
* Regular expression for matching a user mention, strictly with a nickname
*
* The `id` group property is present on the `exec` result of this expression
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
*/
UserWithNickname: /<@!(?<id>\d{17,20})>/,
/**
* Regular expression for matching a user mention, with or without a nickname
*
* The `id` group property is present on the `exec` result of this expression
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
*/
UserWithOptionalNickname: /<@!?(?<id>\d{17,20})>/,
/**

View File

@@ -1,3 +1,5 @@
import type { LocaleString } from '../v10.ts';
/**
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
*
@@ -45,7 +47,7 @@ export const PermissionFlagsBits = {
CreatePrivateThreads: 1n << 36n,
UseExternalStickers: 1n << 37n,
SendMessagesInThreads: 1n << 38n,
StartEmbeddedActivities: 1n << 39n,
UseEmbeddedActivities: 1n << 39n,
ModerateMembers: 1n << 40n,
} as const;
@@ -54,3 +56,5 @@ export const PermissionFlagsBits = {
* @internal
*/
Object.freeze(PermissionFlagsBits);
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
export type APIApplicationCommandAttachmentOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;

View File

@@ -1,9 +1,12 @@
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
import type { LocalizationMap } from '../../../../../v10.ts';
export interface APIApplicationCommandOptionBase<Type extends ApplicationCommandOptionType> {
type: Type;
name: string;
name_localizations?: LocalizationMap | null;
description: string;
description_localizations?: LocalizationMap | null;
required?: boolean;
}

View File

@@ -1,7 +1,7 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';
export interface APIApplicationCommandChannelOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
export type APIApplicationCommandMentionableOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Mentionable>;

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
export type APIApplicationCommandRoleOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Role>;

View File

@@ -1,3 +1,5 @@
import type { LocalizationMap } from '../../../../../v10.ts';
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type
*/
@@ -20,5 +22,6 @@ export enum ApplicationCommandOptionType {
*/
export interface APIApplicationCommandOptionChoice<ValueType = string | number> {
name: string;
name_localizations?: LocalizationMap | null;
value: ValueType;
}

View File

@@ -1,6 +1,6 @@
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
import type { APIApplicationCommandOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
export interface APIApplicationCommandSubcommandOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Subcommand> {

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
export type APIApplicationCommandUserOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.User>;

View File

@@ -1,13 +1,3 @@
import type { Snowflake } from '../../../../globals.ts';
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type {
APIApplicationCommandAttachmentOption,
APIApplicationCommandInteractionDataAttachmentOption,
@@ -52,6 +42,16 @@ import type {
APIApplicationCommandInteractionDataUserOption,
APIApplicationCommandUserOption,
} from './_chatInput/user.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/boolean.ts';

View File

@@ -1,3 +1,4 @@
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIMessage } from '../../channel.ts';
import type { APIUser } from '../../user.ts';
@@ -7,7 +8,6 @@ import type {
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure

View File

@@ -5,4 +5,5 @@ export interface APIBaseApplicationCommandInteractionData<Type extends Applicati
id: Snowflake;
type: Type;
name: string;
guild_id?: Snowflake;
}

View File

@@ -1,8 +1,3 @@
import type { Permissions, Snowflake } from '../../../globals.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';
import type {
APIApplicationCommandOption,
APIChatInputApplicationCommandDMInteraction,
@@ -16,6 +11,12 @@ import type {
APIContextMenuInteraction,
APIContextMenuInteractionData,
} from './_applicationCommands/contextMenu.ts';
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocalizationMap } from '../../../v10.ts';
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
export * from './_applicationCommands/chatInput.ts';
export * from './_applicationCommands/contextMenu.ts';
@@ -42,13 +43,29 @@ export interface APIApplicationCommand {
*/
guild_id?: Snowflake;
/**
* 1-32 character name; `CHAT_INPUT` command names must be all lowercase matching `^[\w-]{1,32}$`
* 1-32 character name; `CHAT_INPUT` command names must be all lowercase matching `^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$`
*/
name: string;
/**
* Localization dictionary for the name field. Values follow the same restrictions as name
*/
name_localizations?: LocalizationMap | null;
/**
* The localized name
*/
name_localized?: string;
/**
* 1-100 character description for `CHAT_INPUT` commands, empty string for `USER` and `MESSAGE` commands
*/
description: string;
/**
* Localization dictionary for the description field. Values follow the same restrictions as description
*/
description_localizations?: LocalizationMap | null;
/**
* The localized description
*/
description_localized?: string;
/**
* The parameters for the `CHAT_INPUT` command, max 25
*/

View File

@@ -12,7 +12,10 @@ export type APIApplicationCommandAutocompleteInteraction = APIBaseInteraction<
> &
Required<
Pick<
APIBaseInteraction<InteractionType.ApplicationCommandAutocomplete, APIChatInputApplicationCommandInteractionData>,
APIBaseInteraction<
InteractionType.ApplicationCommandAutocomplete,
Required<Pick<APIChatInputApplicationCommandInteractionData, 'options'>>
>,
'data'
>
>;

View File

@@ -1,9 +1,9 @@
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocaleString } from '../../../v10.ts';
import type { APIMessage } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIUser } from '../user.ts';
import type { InteractionType } from './responses.ts';
export type PartialAPIMessageInteractionGuildMember = Pick<
APIGuildMember,

View File

@@ -1,6 +1,6 @@
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
import type { ComponentType } from '../channel.ts';
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
export type APIMessageComponentInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
@@ -13,6 +13,28 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
>
>;
export type APIMessageComponentButtonInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
APIMessageButtonInteractionData
> &
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
'channel_id' | 'data' | 'message'
>
>;
export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
APIMessageSelectMenuInteractionData
> &
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
'channel_id' | 'data' | 'message'
>
>;
export type APIMessageComponentInteractionData = APIMessageButtonInteractionData | APIMessageSelectMenuInteractionData;
export interface APIMessageComponentBaseInteractionData<CType extends ComponentType> {

View File

@@ -1,7 +1,7 @@
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v10.ts';
import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts';
import type { MessageFlags } from '../mod.ts';
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type

View File

@@ -2,9 +2,10 @@
* Types extracted from https://discord.com/developers/docs/resources/application
*/
import type { Snowflake } from '../../globals.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
import type { Permissions, Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/application#application-object
@@ -52,13 +53,6 @@ export interface APIApplication {
* See https://discord.com/developers/docs/resources/user#user-object
*/
owner?: APIUser;
/**
* If this application is a game sold on Discord, this field will be the summary field for the store page
* of its primary sku
*
* @deprecated Always an empty string, will be removed in v11
*/
summary: '';
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
@@ -93,6 +87,23 @@ export interface APIApplication {
* See https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
flags: ApplicationFlags;
/**
* Up to 5 tags describing the content and functionality of the application
*/
tags?: [string, string?, string?, string?, string?];
/**
* Settings for the application's default in-app authorization link, if enabled
*/
install_params?: APIApplicationInstallParams;
/**
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
}
export interface APIApplicationInstallParams {
scopes: OAuth2Scopes[];
permissions: Permissions;
}
/**

View File

@@ -2,7 +2,6 @@
* Types extracted from https://discord.com/developers/docs/resources/audit-log
*/
import type { Snowflake } from '../../globals.ts';
import type { APIChannel, APIOverwrite } from './channel.ts';
import type {
APIGuildIntegration,
@@ -22,6 +21,7 @@ import type { StageInstancePrivacyLevel } from './stageInstance.ts';
import type { StickerFormatType } from './sticker.ts';
import type { APIUser } from './user.ts';
import type { APIWebhook } from './webhook.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
@@ -273,6 +273,7 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyName
| APIAuditLogChangeKeyDescription
| APIAuditLogChangeKeyIconHash
| APIAuditLogChangeKeyImageHash
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeyDiscoverySplashHash
| APIAuditLogChangeKeyBannerHash
@@ -354,6 +355,11 @@ export type APIAuditLogChangeKeyDescription = AuditLogChangeData<'description',
*/
export type APIAuditLogChangeKeyIconHash = AuditLogChangeData<'icon_hash', string>;
/**
* Returned when a guild's scheduled event's cover image is changed
*/
export type APIAuditLogChangeKeyImageHash = AuditLogChangeData<'image_hash', string>;
/**
* Returned when a guild's splash is changed
*/

View File

@@ -2,7 +2,6 @@
* Types extracted from https://discord.com/developers/docs/resources/channel
*/
import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIApplication } from './application.ts';
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
@@ -10,6 +9,7 @@ import type { APIMessageInteraction } from './interactions.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker, APIStickerItem } from './sticker.ts';
import type { APIUser } from './user.ts';
import type { Permissions, Snowflake } from '../../globals.ts';
/**
* Not documented, but partial only includes id, name, and type
@@ -37,6 +37,7 @@ export interface APIPartialChannel {
*/
export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel {
type: T;
flags?: ChannelFlags;
}
// TODO: update when text in voice is released
@@ -47,14 +48,11 @@ export type TextChannelType =
| ChannelType.GuildPublicThread
| ChannelType.GuildPrivateThread
| ChannelType.GuildNewsThread
| ChannelType.GuildText;
| ChannelType.GuildText
| ChannelType.GuildForum;
export type GuildChannelType = Exclude<
| TextChannelType
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice
| ChannelType.GuildNews
| ChannelType.GuildStore,
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
ChannelType.DM | ChannelType.GroupDM
>;
@@ -129,7 +127,6 @@ export interface APITextChannel extends APIGuildTextChannel<ChannelType.GuildTex
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export type APIGuildStoreChannel = APIGuildChannel<ChannelType.GuildStore>;
export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageVoice | ChannelType.GuildVoice> {
/**
@@ -165,7 +162,7 @@ interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>
export type APIDMChannel = APIDMChannelBase<ChannelType.DM>;
export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
/**
* Application id of the group DM creator if it is bot-created
*/
@@ -174,6 +171,10 @@ export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM>
* Icon hash
*/
icon?: string | null;
/**
* The name of the channel (2-100 characters)
*/
name?: string | null;
/**
* ID of the DM creator
*/
@@ -224,6 +225,8 @@ export interface APIThreadChannel
last_message_id?: Snowflake | null;
}
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
*/
@@ -232,11 +235,11 @@ export type APIChannel =
| APIDMChannel
| APITextChannel
| APINewsChannel
| APIGuildStoreChannel
| APIVoiceChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APINewsChannel;
| APINewsChannel
| APIGuildForumChannel;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
@@ -270,12 +273,6 @@ export enum ChannelType {
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews,
/**
* A channel in which game developers can sell their game on Discord
*
* See https://discord.com/developers/docs/game-and-server-management/special-channels
*/
GuildStore,
/**
* A thread channel (public) within a Guild News channel
*/
@@ -294,6 +291,16 @@ export enum ChannelType {
* See https://support.discord.com/hc/en-us/articles/1500005513722
*/
GuildStageVoice,
/**
* The channel in a Student Hub containing the listed servers
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
*/
GuildDirectory,
/**
* A channel that can only contain threads
*/
GuildForum,
}
export enum VideoQualityMode {
@@ -447,7 +454,7 @@ export interface APIMessage {
/**
* Reference data sent with crossposted messages, replies, pins, and thread starter messages
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
message_reference?: APIMessageReference;
/**
@@ -547,7 +554,7 @@ export interface APIMessageActivity {
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
export interface APIMessageReference {
/**
@@ -1188,7 +1195,7 @@ export interface APIActionRowComponent<T extends APIActionRowComponentTypes>
/**
* https://discord.com/developers/docs/interactions/message-components#buttons
*/
interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
/**
* The label to be displayed on the button
*/
@@ -1273,7 +1280,7 @@ export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.S
*/
options: APISelectMenuOption[];
/**
* Custom placeholder text if nothing is selected, max 100 characters
* Custom placeholder text if nothing is selected, max 150 characters
*/
placeholder?: string;
/**
@@ -1360,6 +1367,13 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
required?: boolean;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
*/
export enum ChannelFlags {
Pinned = 1 << 1,
}
/**
* https://discord.com/developers/docs/interactions/message-components#message-components
*/

View File

@@ -2,9 +2,9 @@
* Types extracted from https://discord.com/developers/docs/resources/emoji
*/
import type { Snowflake } from '../../globals.ts';
import type { APIRole } from './permissions.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* Not documented but mentioned

View File

@@ -2,10 +2,10 @@
* Types extracted from https://discord.com/developers/docs/topics/gateway
*/
import type { Snowflake } from '../../globals.ts';
import type { APIChannel, APIThreadMember } from './channel.ts';
import type { APIEmoji } from './emoji.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/topics/gateway#get-gateway

View File

@@ -2,7 +2,6 @@
* Types extracted from https://discord.com/developers/docs/resources/guild
*/
import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIChannel } from './channel.ts';
import type { APIEmoji } from './emoji.ts';
import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway.ts';
@@ -12,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 { Permissions, Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
@@ -54,7 +54,7 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
*/
banner?: string | null;
/**
* The description for the guild, if the guild is discoverable
* The description for the guild
*/
description?: string | null;
/**
@@ -267,7 +267,7 @@ export interface APIGuild extends APIPartialGuild {
*/
vanity_url_code: string | null;
/**
* The description for the guild, if the guild is discoverable
* The description for the guild
*/
description: string | null;
/**
@@ -346,6 +346,10 @@ export interface APIGuild extends APIPartialGuild {
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
*/
guild_scheduled_events?: APIGuildScheduledEvent[];
/**
* The type of Student Hub the guild is
*/
hub_type: GuildHubType | null;
}
/**
@@ -419,6 +423,12 @@ export enum GuildPremiumTier {
Tier3,
}
export enum GuildHubType {
Default,
HighSchool,
College,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
*/
@@ -445,6 +455,10 @@ export enum GuildSystemChannelFlags {
* https://discord.com/developers/docs/resources/guild#guild-object-guild-features
*/
export enum GuildFeature {
/**
* Guild has access to set an animated guild banner image
*/
AnimatedBanner = 'ANIMATED_BANNER',
/**
* Guild has access to set an animated guild icon
*/
@@ -469,10 +483,26 @@ export enum GuildFeature {
* Guild is able to be featured in the directory
*/
Featurable = 'FEATURABLE',
/**
* Guild is listed in a directory channel
*/
HasDirectoryEntry = 'HAS_DIRECTORY_ENTRY',
/**
* Guild is a Student Hub
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
*/
Hub = 'HUB',
/**
* Guild has access to set an invite splash background
*/
InviteSplash = 'INVITE_SPLASH',
/**
* Guild is in a Student Hub
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
*/
LinkedToHub = 'LINKED_TO_HUB',
/**
* Guild has enabled Membership Screening
*/
@@ -681,7 +711,7 @@ export interface APIGuildIntegration {
/**
* Integration type
*/
type: APIGuildInteractionType;
type: APIGuildIntegrationType;
/**
* Is this integration enabled
*/
@@ -760,7 +790,7 @@ export interface APIGuildIntegration {
application?: APIGuildIntegrationApplication;
}
export type APIGuildInteractionType = 'twitch' | 'youtube' | 'discord';
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord';
/**
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
@@ -806,12 +836,6 @@ export interface APIGuildIntegrationApplication {
* The description of the app
*/
description: string;
/**
* The summary of the app
*
* @deprecated Always an empty string, will be removed in v11
*/
summary: '';
/**
* The bot associated with this application
*

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../globals.ts';
import type { APIGuildMember } from './guild.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType> {
/**
@@ -26,7 +26,7 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
/**
* The description of the scheduled event
*/
description?: string;
description?: string | null;
/**
* The time the scheduled event will start
*/
@@ -66,7 +66,7 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
/**
* The cover image of the scheduled event
*/
image: string | null;
image?: string | null;
}
export interface APIStageInstanceGuildScheduledEvent

View File

@@ -4,11 +4,26 @@
import type { APIApplication } from './application.ts';
import type { APIPartialChannel } from './channel.ts';
import type { APIPartialGuild } from './guild.ts';
import type { APIGuild } from './guild.ts';
import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts';
import type { APIInviteStageInstance } from './stageInstance.ts';
import type { APIUser } from './user.ts';
export type APIInviteGuild = Pick<
APIGuild,
| 'id'
| 'name'
| 'splash'
| 'banner'
| 'icon'
| 'vanity_url_code'
| 'description'
| 'features'
| 'verification_level'
| 'nsfw_level'
| 'premium_subscription_count'
>;
/**
* https://discord.com/developers/docs/resources/invite#invite-object
*/
@@ -22,7 +37,7 @@ export interface APIInvite {
*
* See https://discord.com/developers/docs/resources/guild#guild-object
*/
guild?: APIPartialGuild;
guild?: APIInviteGuild;
/**
* The channel this invite is for
*

View File

@@ -43,7 +43,7 @@ export enum OAuth2Scopes {
/**
* Allows /users/@me/guilds/{guild.id}/member to return a user's member information in a guild
*
* See https://discord.com/developers/docs/resources/guild#get-current-user-guild-member
* See https://discord.com/developers/docs/resources/user#get-current-user-guild-member
*/
GuildsMembersRead = 'guilds.members.read',
/**

View File

@@ -1,5 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { APIGuildMember } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/stage-instance#stage-instance-object
@@ -32,6 +32,10 @@ export interface APIStageInstance {
* @deprecated
*/
discoverable_disabled: boolean;
/**
* The id of the scheduled event for this stage instance
*/
guild_scheduled_event_id?: Snowflake;
}
/**

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/sticker
*/
import type { Snowflake } from '../../globals.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/sticker#sticker-object
@@ -33,7 +33,7 @@ export interface APISticker {
* Previously the sticker asset hash, now an empty string
* @deprecated
*/
asset: '';
asset?: '';
/**
* Type of sticker
*

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/topics/teams
*/
import type { Snowflake } from '../../globals.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/topics/teams#data-models-team-object

View File

@@ -2,9 +2,9 @@
* Types extracted from https://discord.com/developers/docs/resources/template
*/
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v10/mod.ts';
import type { APIUser } from './user.ts';
/**
* https://discord.com/developers/docs/resources/template#template-object

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/user
*/
import type { Snowflake } from '../../globals.ts';
import type { APIGuildIntegration } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/user#user-object
@@ -94,7 +94,7 @@ export enum UserFlags {
*/
Partner = 1 << 1,
/**
* HypeSquad Events Coordinator
* HypeSquad Events Member
*/
Hypesquad = 1 << 2,
/**

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/voice
*/
import type { Snowflake } from '../../globals.ts';
import type { APIGuildMember } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/voice#voice-state-object

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/webhook
*/
import type { Snowflake } from '../../globals.ts';
import type { APIPartialChannel, APIPartialGuild, APIUser } from './mod.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/webhook#webhook-object

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.

View File

@@ -1,7 +1,7 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.

View File

@@ -1,6 +1,6 @@
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
import type { APIApplicationCommandOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.

View File

@@ -1,13 +1,3 @@
import type { Snowflake } from '../../../../globals.ts';
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type {
APIApplicationCommandAttachmentOption,
APIApplicationCommandInteractionDataAttachmentOption,
@@ -52,6 +42,16 @@ import type {
APIApplicationCommandInteractionDataUserOption,
APIApplicationCommandUserOption,
} from './_chatInput/user.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/boolean.ts';

View File

@@ -1,3 +1,4 @@
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIMessage } from '../../channel.ts';
import type { APIUser } from '../../user.ts';
@@ -7,7 +8,6 @@ import type {
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure

View File

@@ -1,8 +1,3 @@
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { APIPartialChannel } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
import type {
APIApplicationCommandOption,
APIChatInputApplicationCommandDMInteraction,
@@ -16,6 +11,11 @@ import type {
APIContextMenuInteraction,
APIContextMenuInteractionData,
} from './_applicationCommands/contextMenu.ts';
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { APIPartialChannel } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
export * from './_applicationCommands/chatInput.ts';
export * from './_applicationCommands/contextMenu.ts';

View File

@@ -1,9 +1,9 @@
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocaleString } from '../../../v8.ts';
import type { APIMessage } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIUser } from '../user.ts';
import type { InteractionType } from './responses.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.

View File

@@ -1,6 +1,6 @@
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
import type { ComponentType } from '../channel.ts';
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.

View File

@@ -1,7 +1,7 @@
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v8.ts';
import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts';
import type { MessageFlags } from '../mod.ts';
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type

View File

@@ -2,9 +2,10 @@
* Types extracted from https://discord.com/developers/docs/resources/application
*/
import type { Snowflake } from '../../globals.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
import type { Permissions, Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/application#application-object
@@ -94,6 +95,23 @@ export interface APIApplication {
* See https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
flags: ApplicationFlags;
/**
* Up to 5 tags describing the content and functionality of the application
*/
tags?: [string, string?, string?, string?, string?];
/**
* Settings for the application's default in-app authorization link, if enabled
*/
install_params?: APIApplicationInstallParams;
/**
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
}
export interface APIApplicationInstallParams {
scopes: OAuth2Scopes[];
permissions: Permissions;
}
/**

View File

@@ -2,7 +2,6 @@
* Types extracted from https://discord.com/developers/docs/resources/audit-log
*/
import type { Snowflake } from '../../globals.ts';
import type { APIOverwrite } from './channel.ts';
import type {
APIGuildIntegration,
@@ -22,6 +21,7 @@ import type { StageInstancePrivacyLevel } from './stageInstance.ts';
import type { StickerFormatType } from './sticker.ts';
import type { APIUser } from './user.ts';
import type { APIWebhook } from './webhook.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure

View File

@@ -2,7 +2,6 @@
* Types extracted from https://discord.com/developers/docs/resources/channel
*/
import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIApplication } from './application.ts';
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
@@ -10,6 +9,7 @@ import type { APIMessageInteraction } from './interactions.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker, APIStickerItem } from './sticker.ts';
import type { APIUser } from './user.ts';
import type { Permissions, Snowflake } from '../../globals.ts';
/**
* Not documented, but partial only includes id, name, and type

View File

@@ -2,9 +2,9 @@
* Types extracted from https://discord.com/developers/docs/resources/emoji
*/
import type { Snowflake } from '../../globals.ts';
import type { APIRole } from './permissions.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* Not documented but mentioned

View File

@@ -2,9 +2,9 @@
* Types extracted from https://discord.com/developers/docs/topics/gateway
*/
import type { Snowflake } from '../../globals.ts';
import type { APIEmoji } from './emoji.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/topics/gateway#get-gateway

View File

@@ -2,7 +2,6 @@
* Types extracted from https://discord.com/developers/docs/resources/guild
*/
import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIChannel } from './channel.ts';
import type { APIEmoji } from './emoji.ts';
import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway.ts';
@@ -12,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 { Permissions, Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
@@ -448,6 +448,10 @@ export enum GuildSystemChannelFlags {
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export enum GuildFeature {
/**
* Guild has access to set an animated guild banner image
*/
AnimatedBanner = 'ANIMATED_BANNER',
/**
* Guild has access to set an animated guild icon
*/

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../globals.ts';
import type { APIGuildMember } from './guild.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.

View File

@@ -4,11 +4,26 @@
import type { APIApplication } from './application.ts';
import type { APIPartialChannel } from './channel.ts';
import type { APIPartialGuild } from './guild.ts';
import type { APIGuild } from './guild.ts';
import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts';
import type { APIInviteStageInstance } from './stageInstance.ts';
import type { APIUser } from './user.ts';
export type APIInviteGuild = Pick<
APIGuild,
| 'id'
| 'name'
| 'splash'
| 'banner'
| 'icon'
| 'vanity_url_code'
| 'description'
| 'features'
| 'verification_level'
| 'nsfw_level'
| 'premium_subscription_count'
>;
/**
* https://discord.com/developers/docs/resources/invite#invite-object
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
@@ -23,7 +38,7 @@ export interface APIInvite {
*
* See https://discord.com/developers/docs/resources/guild#guild-object
*/
guild?: APIPartialGuild;
guild?: APIInviteGuild;
/**
* The channel this invite is for
*

View File

@@ -1,5 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { APIGuildMember } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/stage-instance#stage-instance-object

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/sticker
*/
import type { Snowflake } from '../../globals.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/sticker#sticker-object

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/topics/teams
*/
import type { Snowflake } from '../../globals.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/topics/teams#data-models-team-object

View File

@@ -2,9 +2,9 @@
* Types extracted from https://discord.com/developers/docs/resources/template
*/
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v8/mod.ts';
import type { APIUser } from './user.ts';
/**
* https://discord.com/developers/docs/resources/template#template-object

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/user
*/
import type { Snowflake } from '../../globals.ts';
import type { APIGuildIntegration } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/user#user-object

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/voice
*/
import type { Snowflake } from '../../globals.ts';
import type { APIGuildMember } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/voice#voice-state-object

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/webhook
*/
import type { Snowflake } from '../../globals.ts';
import type { APIPartialChannel, APIPartialGuild, APIUser } from './mod.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/webhook#webhook-object

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
export type APIApplicationCommandAttachmentOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;

View File

@@ -1,9 +1,12 @@
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
import type { LocalizationMap } from '../../../../../v9.ts';
export interface APIApplicationCommandOptionBase<Type extends ApplicationCommandOptionType> {
type: Type;
name: string;
name_localizations?: LocalizationMap | null;
description: string;
description_localizations?: LocalizationMap | null;
required?: boolean;
}

View File

@@ -1,7 +1,7 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
import type { ChannelType } from '../../../channel.ts';
export interface APIApplicationCommandChannelOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
export type APIApplicationCommandMentionableOption =
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Mentionable>;

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
export type APIApplicationCommandRoleOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Role>;

View File

@@ -1,3 +1,5 @@
import type { LocalizationMap } from '../../../../../v9.ts';
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type
*/
@@ -20,5 +22,6 @@ export enum ApplicationCommandOptionType {
*/
export interface APIApplicationCommandOptionChoice<ValueType = string | number> {
name: string;
name_localizations?: LocalizationMap | null;
value: ValueType;
}

View File

@@ -1,6 +1,6 @@
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
import type { APIApplicationCommandOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
export interface APIApplicationCommandSubcommandOption
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Subcommand> {

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../../../../globals.ts';
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
import type { ApplicationCommandOptionType } from './shared.ts';
import type { Snowflake } from '../../../../../globals.ts';
export type APIApplicationCommandUserOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.User>;

View File

@@ -1,13 +1,3 @@
import type { Snowflake } from '../../../../globals.ts';
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type {
APIApplicationCommandAttachmentOption,
APIApplicationCommandInteractionDataAttachmentOption,
@@ -52,6 +42,16 @@ import type {
APIApplicationCommandInteractionDataUserOption,
APIApplicationCommandUserOption,
} from './_chatInput/user.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIAttachment, APIRole, APIUser } from '../../mod.ts';
import type {
APIApplicationCommandInteractionWrapper,
APIInteractionDataResolvedChannel,
APIInteractionDataResolvedGuildMember,
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
export * from './_chatInput/attachment.ts';
export * from './_chatInput/boolean.ts';

View File

@@ -1,3 +1,4 @@
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
import type { Snowflake } from '../../../../globals.ts';
import type { APIMessage } from '../../channel.ts';
import type { APIUser } from '../../user.ts';
@@ -7,7 +8,6 @@ import type {
ApplicationCommandType,
} from '../applicationCommands.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure

View File

@@ -5,4 +5,5 @@ export interface APIBaseApplicationCommandInteractionData<Type extends Applicati
id: Snowflake;
type: Type;
name: string;
guild_id?: Snowflake;
}

View File

@@ -1,8 +1,3 @@
import type { Permissions, Snowflake } from '../../../globals.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';
import type {
APIApplicationCommandOption,
APIChatInputApplicationCommandDMInteraction,
@@ -16,6 +11,12 @@ import type {
APIContextMenuInteraction,
APIContextMenuInteractionData,
} from './_applicationCommands/contextMenu.ts';
import type { APIBaseInteraction } from './base.ts';
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocalizationMap } from '../../../v9.ts';
import type { APIPartialChannel, APIThreadMetadata } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
export * from './_applicationCommands/chatInput.ts';
export * from './_applicationCommands/contextMenu.ts';
@@ -42,13 +43,29 @@ export interface APIApplicationCommand {
*/
guild_id?: Snowflake;
/**
* 1-32 character name; `CHAT_INPUT` command names must be all lowercase matching `^[\w-]{1,32}$`
* 1-32 character name; `CHAT_INPUT` command names must be all lowercase matching `^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$`
*/
name: string;
/**
* Localization dictionary for the name field. Values follow the same restrictions as name
*/
name_localizations?: LocalizationMap | null;
/**
* The localized name
*/
name_localized?: string;
/**
* 1-100 character description for `CHAT_INPUT` commands, empty string for `USER` and `MESSAGE` commands
*/
description: string;
/**
* Localization dictionary for the description field. Values follow the same restrictions as description
*/
description_localizations?: LocalizationMap | null;
/**
* The localized description
*/
description_localized?: string;
/**
* The parameters for the `CHAT_INPUT` command, max 25
*/

View File

@@ -1,9 +1,9 @@
import type { InteractionType } from './responses.ts';
import type { Permissions, Snowflake } from '../../../globals.ts';
import type { LocaleString } from '../../../v9.ts';
import type { APIMessage } from '../channel.ts';
import type { APIGuildMember } from '../guild.ts';
import type { APIUser } from '../user.ts';
import type { InteractionType } from './responses.ts';
export type PartialAPIMessageInteractionGuildMember = Pick<
APIGuildMember,

View File

@@ -1,6 +1,6 @@
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
import type { ComponentType } from '../channel.ts';
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from './base.ts';
export type APIMessageComponentInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
@@ -13,6 +13,28 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
>
>;
export type APIMessageComponentButtonInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
APIMessageButtonInteractionData
> &
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
'channel_id' | 'data' | 'message'
>
>;
export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
InteractionType.MessageComponent,
APIMessageSelectMenuInteractionData
> &
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
'channel_id' | 'data' | 'message'
>
>;
export type APIMessageComponentInteractionData = APIMessageButtonInteractionData | APIMessageSelectMenuInteractionData;
export interface APIMessageComponentBaseInteractionData<CType extends ComponentType> {

View File

@@ -1,7 +1,7 @@
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v9.ts';
import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts';
import type { MessageFlags } from '../mod.ts';
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type

View File

@@ -2,9 +2,10 @@
* Types extracted from https://discord.com/developers/docs/resources/application
*/
import type { Snowflake } from '../../globals.ts';
import type { OAuth2Scopes } from './oauth2.ts';
import type { APITeam } from './teams.ts';
import type { APIUser } from './user.ts';
import type { Permissions, Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/application#application-object
@@ -52,13 +53,6 @@ export interface APIApplication {
* See https://discord.com/developers/docs/resources/user#user-object
*/
owner?: APIUser;
/**
* If this application is a game sold on Discord, this field will be the summary field for the store page
* of its primary sku
*
* @deprecated Always an empty string, will be removed in v11
*/
summary: '';
/**
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
*
@@ -93,6 +87,23 @@ export interface APIApplication {
* See https://discord.com/developers/docs/resources/application#application-object-application-flags
*/
flags: ApplicationFlags;
/**
* Up to 5 tags describing the content and functionality of the application
*/
tags?: [string, string?, string?, string?, string?];
/**
* Settings for the application's default in-app authorization link, if enabled
*/
install_params?: APIApplicationInstallParams;
/**
* The application's default custom authorization link, if enabled
*/
custom_install_url?: string;
}
export interface APIApplicationInstallParams {
scopes: OAuth2Scopes[];
permissions: Permissions;
}
/**

View File

@@ -2,7 +2,6 @@
* Types extracted from https://discord.com/developers/docs/resources/audit-log
*/
import type { Snowflake } from '../../globals.ts';
import type { APIChannel, APIOverwrite } from './channel.ts';
import type {
APIGuildIntegration,
@@ -22,6 +21,7 @@ import type { StageInstancePrivacyLevel } from './stageInstance.ts';
import type { StickerFormatType } from './sticker.ts';
import type { APIUser } from './user.ts';
import type { APIWebhook } from './webhook.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
@@ -273,6 +273,7 @@ export type APIAuditLogChange =
| APIAuditLogChangeKeyName
| APIAuditLogChangeKeyDescription
| APIAuditLogChangeKeyIconHash
| APIAuditLogChangeKeyImageHash
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeyDiscoverySplashHash
| APIAuditLogChangeKeyBannerHash
@@ -354,6 +355,11 @@ export type APIAuditLogChangeKeyDescription = AuditLogChangeData<'description',
*/
export type APIAuditLogChangeKeyIconHash = AuditLogChangeData<'icon_hash', string>;
/**
* Returned when a guild's scheduled event's cover image is changed
*/
export type APIAuditLogChangeKeyImageHash = AuditLogChangeData<'image_hash', string>;
/**
* Returned when a guild's splash is changed
*/

View File

@@ -2,7 +2,6 @@
* Types extracted from https://discord.com/developers/docs/resources/channel
*/
import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIApplication } from './application.ts';
import type { APIPartialEmoji } from './emoji.ts';
import type { APIGuildMember } from './guild.ts';
@@ -10,6 +9,7 @@ import type { APIMessageInteraction } from './interactions.ts';
import type { APIRole } from './permissions.ts';
import type { APISticker, APIStickerItem } from './sticker.ts';
import type { APIUser } from './user.ts';
import type { Permissions, Snowflake } from '../../globals.ts';
/**
* Not documented, but partial only includes id, name, and type
@@ -37,6 +37,7 @@ export interface APIPartialChannel {
*/
export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel {
type: T;
flags?: ChannelFlags;
}
// TODO: update when text in voice is released
@@ -47,14 +48,11 @@ export type TextChannelType =
| ChannelType.GuildPublicThread
| ChannelType.GuildPrivateThread
| ChannelType.GuildNewsThread
| ChannelType.GuildText;
| ChannelType.GuildText
| ChannelType.GuildForum;
export type GuildChannelType = Exclude<
| TextChannelType
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice
| ChannelType.GuildNews
| ChannelType.GuildStore,
TextChannelType | ChannelType.GuildVoice | ChannelType.GuildStageVoice | ChannelType.GuildNews,
ChannelType.DM | ChannelType.GroupDM
>;
@@ -129,7 +127,6 @@ export interface APITextChannel extends APIGuildTextChannel<ChannelType.GuildTex
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildNews>;
export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>;
export type APIGuildStoreChannel = APIGuildChannel<ChannelType.GuildStore>;
export interface APIVoiceChannel extends APIGuildChannel<ChannelType.GuildStageVoice | ChannelType.GuildVoice> {
/**
@@ -165,7 +162,7 @@ interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>
export type APIDMChannel = APIDMChannelBase<ChannelType.DM>;
export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.GroupDM>, 'name'> {
/**
* Application id of the group DM creator if it is bot-created
*/
@@ -174,6 +171,10 @@ export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM>
* Icon hash
*/
icon?: string | null;
/**
* The name of the channel (2-100 characters)
*/
name?: string | null;
/**
* ID of the DM creator
*/
@@ -224,6 +225,8 @@ export interface APIThreadChannel
last_message_id?: Snowflake | null;
}
export type APIGuildForumChannel = APIGuildTextChannel<ChannelType.GuildForum>;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
*/
@@ -232,11 +235,11 @@ export type APIChannel =
| APIDMChannel
| APITextChannel
| APINewsChannel
| APIGuildStoreChannel
| APIVoiceChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APINewsChannel;
| APINewsChannel
| APIGuildForumChannel;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
@@ -270,12 +273,6 @@ export enum ChannelType {
* See https://support.discord.com/hc/en-us/articles/360032008192
*/
GuildNews,
/**
* A channel in which game developers can sell their game on Discord
*
* See https://discord.com/developers/docs/game-and-server-management/special-channels
*/
GuildStore,
/**
* A thread channel (public) within a Guild News channel
*/
@@ -294,6 +291,16 @@ export enum ChannelType {
* See https://support.discord.com/hc/en-us/articles/1500005513722
*/
GuildStageVoice,
/**
* The channel in a Student Hub containing the listed servers
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
*/
GuildDirectory,
/**
* A channel that can only contain threads
*/
GuildForum,
}
export enum VideoQualityMode {
@@ -447,7 +454,7 @@ export interface APIMessage {
/**
* Reference data sent with crossposted messages, replies, pins, and thread starter messages
*
* See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
* See https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
message_reference?: APIMessageReference;
/**
@@ -547,7 +554,7 @@ export interface APIMessageActivity {
}
/**
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
export interface APIMessageReference {
/**
@@ -1188,7 +1195,7 @@ export interface APIActionRowComponent<T extends APIActionRowComponentTypes>
/**
* https://discord.com/developers/docs/interactions/message-components#buttons
*/
interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
export interface APIButtonComponentBase<Style extends ButtonStyle> extends APIBaseComponent<ComponentType.Button> {
/**
* The label to be displayed on the button
*/
@@ -1273,7 +1280,7 @@ export interface APISelectMenuComponent extends APIBaseComponent<ComponentType.S
*/
options: APISelectMenuOption[];
/**
* Custom placeholder text if nothing is selected, max 100 characters
* Custom placeholder text if nothing is selected, max 150 characters
*/
placeholder?: string;
/**
@@ -1360,6 +1367,13 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
required?: boolean;
}
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-flags
*/
export enum ChannelFlags {
Pinned = 1 << 1,
}
/**
* https://discord.com/developers/docs/interactions/message-components#message-components
*/

View File

@@ -2,9 +2,9 @@
* Types extracted from https://discord.com/developers/docs/resources/emoji
*/
import type { Snowflake } from '../../globals.ts';
import type { APIRole } from './permissions.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* Not documented but mentioned

View File

@@ -2,10 +2,10 @@
* Types extracted from https://discord.com/developers/docs/topics/gateway
*/
import type { Snowflake } from '../../globals.ts';
import type { APIChannel, APIThreadMember } from './channel.ts';
import type { APIEmoji } from './emoji.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/topics/gateway#get-gateway

View File

@@ -2,7 +2,6 @@
* Types extracted from https://discord.com/developers/docs/resources/guild
*/
import type { Permissions, Snowflake } from '../../globals.ts';
import type { APIChannel } from './channel.ts';
import type { APIEmoji } from './emoji.ts';
import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway.ts';
@@ -12,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 { Permissions, Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
@@ -54,7 +54,7 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
*/
banner?: string | null;
/**
* The description for the guild, if the guild is discoverable
* The description for the guild
*/
description?: string | null;
/**
@@ -267,7 +267,7 @@ export interface APIGuild extends APIPartialGuild {
*/
vanity_url_code: string | null;
/**
* The description for the guild, if the guild is discoverable
* The description for the guild
*/
description: string | null;
/**
@@ -346,6 +346,10 @@ export interface APIGuild extends APIPartialGuild {
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
*/
guild_scheduled_events?: APIGuildScheduledEvent[];
/**
* The type of Student Hub the guild is
*/
hub_type: GuildHubType | null;
}
/**
@@ -419,6 +423,12 @@ export enum GuildPremiumTier {
Tier3,
}
export enum GuildHubType {
Default,
HighSchool,
College,
}
/**
* https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
*/
@@ -445,6 +455,10 @@ export enum GuildSystemChannelFlags {
* https://discord.com/developers/docs/resources/guild#guild-object-guild-features
*/
export enum GuildFeature {
/**
* Guild has access to set an animated guild banner image
*/
AnimatedBanner = 'ANIMATED_BANNER',
/**
* Guild has access to set an animated guild icon
*/
@@ -469,10 +483,26 @@ export enum GuildFeature {
* Guild is able to be featured in the directory
*/
Featurable = 'FEATURABLE',
/**
* Guild is listed in a directory channel
*/
HasDirectoryEntry = 'HAS_DIRECTORY_ENTRY',
/**
* Guild is a Student Hub
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
*/
Hub = 'HUB',
/**
* Guild has access to set an invite splash background
*/
InviteSplash = 'INVITE_SPLASH',
/**
* Guild is in a Student Hub
*
* See https://support.discord.com/hc/en-us/articles/4406046651927-Discord-Student-Hubs-FAQ
*/
LinkedToHub = 'LINKED_TO_HUB',
/**
* Guild has enabled Membership Screening
*/
@@ -681,7 +711,7 @@ export interface APIGuildIntegration {
/**
* Integration type
*/
type: APIGuildInteractionType;
type: APIGuildIntegrationType;
/**
* Is this integration enabled
*/
@@ -760,7 +790,7 @@ export interface APIGuildIntegration {
application?: APIGuildIntegrationApplication;
}
export type APIGuildInteractionType = 'twitch' | 'youtube' | 'discord';
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord';
/**
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
@@ -806,12 +836,6 @@ export interface APIGuildIntegrationApplication {
* The description of the app
*/
description: string;
/**
* The summary of the app
*
* @deprecated Always an empty string, will be removed in v11
*/
summary: '';
/**
* The bot associated with this application
*

View File

@@ -1,6 +1,6 @@
import type { Snowflake } from '../../globals.ts';
import type { APIGuildMember } from './guild.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType> {
/**
@@ -26,7 +26,7 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
/**
* The description of the scheduled event
*/
description?: string;
description?: string | null;
/**
* The time the scheduled event will start
*/
@@ -66,7 +66,7 @@ interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType>
/**
* The cover image of the scheduled event
*/
image: string | null;
image?: string | null;
}
export interface APIStageInstanceGuildScheduledEvent

View File

@@ -4,11 +4,26 @@
import type { APIApplication } from './application.ts';
import type { APIPartialChannel } from './channel.ts';
import type { APIPartialGuild } from './guild.ts';
import type { APIGuild } from './guild.ts';
import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts';
import type { APIInviteStageInstance } from './stageInstance.ts';
import type { APIUser } from './user.ts';
export type APIInviteGuild = Pick<
APIGuild,
| 'id'
| 'name'
| 'splash'
| 'banner'
| 'icon'
| 'vanity_url_code'
| 'description'
| 'features'
| 'verification_level'
| 'nsfw_level'
| 'premium_subscription_count'
>;
/**
* https://discord.com/developers/docs/resources/invite#invite-object
*/
@@ -22,7 +37,7 @@ export interface APIInvite {
*
* See https://discord.com/developers/docs/resources/guild#guild-object
*/
guild?: APIPartialGuild;
guild?: APIInviteGuild;
/**
* The channel this invite is for
*

View File

@@ -43,7 +43,7 @@ export enum OAuth2Scopes {
/**
* Allows /users/@me/guilds/{guild.id}/member to return a user's member information in a guild
*
* See https://discord.com/developers/docs/resources/guild#get-current-user-guild-member
* See https://discord.com/developers/docs/resources/user#get-current-user-guild-member
*/
GuildsMembersRead = 'guilds.members.read',
/**

View File

@@ -1,5 +1,5 @@
import type { Snowflake } from '../../globals.ts';
import type { APIGuildMember } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/stage-instance#stage-instance-object
@@ -32,6 +32,10 @@ export interface APIStageInstance {
* @deprecated
*/
discoverable_disabled: boolean;
/**
* The id of the scheduled event for this stage instance
*/
guild_scheduled_event_id?: Snowflake;
}
/**

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/sticker
*/
import type { Snowflake } from '../../globals.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/sticker#sticker-object
@@ -33,7 +33,7 @@ export interface APISticker {
* Previously the sticker asset hash, now an empty string
* @deprecated
*/
asset: '';
asset?: '';
/**
* Type of sticker
*

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/topics/teams
*/
import type { Snowflake } from '../../globals.ts';
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/topics/teams#data-models-team-object

View File

@@ -2,9 +2,9 @@
* Types extracted from https://discord.com/developers/docs/resources/template
*/
import type { APIUser } from './user.ts';
import type { Snowflake } from '../../globals.ts';
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v9/mod.ts';
import type { APIUser } from './user.ts';
/**
* https://discord.com/developers/docs/resources/template#template-object

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/user
*/
import type { Snowflake } from '../../globals.ts';
import type { APIGuildIntegration } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/user#user-object
@@ -94,7 +94,7 @@ export enum UserFlags {
*/
Partner = 1 << 1,
/**
* HypeSquad Events Coordinator
* HypeSquad Events Member
*/
Hypesquad = 1 << 2,
/**

View File

@@ -2,8 +2,8 @@
* Types extracted from https://discord.com/developers/docs/resources/voice
*/
import type { Snowflake } from '../../globals.ts';
import type { APIGuildMember } from './guild.ts';
import type { Snowflake } from '../../globals.ts';
/**
* https://discord.com/developers/docs/resources/voice#voice-state-object

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