From a0e00ffaf7e160daa57edb96a8ba4a7a5076d272 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Wed, 6 Mar 2024 21:45:57 +0200 Subject: [PATCH] chore(deps): update actions/labeler action to v5 (#893) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Vlad Frangu --- .github/CODE_OF_CONDUCT.md | 26 ++++----- .github/COMMIT_CONVENTION.md | 6 +- .github/CONTRIBUTING.md | 44 +++++++-------- .github/labeler.yml | 88 +++++++++++++++++++---------- .github/workflows/pr-automation.yml | 2 +- .prettierignore | 2 + .prettierrc.json | 8 --- .prettierrc.mjs | 12 ++++ README.md | 20 +++---- deno/README.md | 20 +++---- deno/rest/v10/mod.ts | 4 +- deno/rest/v10/oauth2.ts | 3 +- deno/rest/v6/guild.ts | 9 ++- deno/rest/v6/oauth2.ts | 3 +- deno/rest/v8/oauth2.ts | 3 +- deno/rest/v9/mod.ts | 4 +- deno/rest/v9/oauth2.ts | 3 +- deno/utils/internals.ts | 22 ++++---- deno/utils/v10.ts | 3 +- deno/utils/v9.ts | 3 +- rest/v10/index.ts | 4 +- rest/v10/oauth2.ts | 3 +- rest/v6/guild.ts | 9 ++- rest/v6/oauth2.ts | 3 +- rest/v8/oauth2.ts | 3 +- rest/v9/index.ts | 4 +- rest/v9/oauth2.ts | 3 +- utils/internals.ts | 22 ++++---- utils/v10.ts | 3 +- utils/v9.ts | 3 +- 30 files changed, 204 insertions(+), 138 deletions(-) delete mode 100644 .prettierrc.json create mode 100644 .prettierrc.mjs diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md index 5b848073..ae9172f3 100644 --- a/.github/CODE_OF_CONDUCT.md +++ b/.github/CODE_OF_CONDUCT.md @@ -14,22 +14,22 @@ appearance, race, religion, or sexual identity and orientation. Examples of behavior that contributes to creating a positive environment include: -- Using welcoming and inclusive language -- Being respectful of differing viewpoints and experiences -- Gracefully accepting constructive criticism -- Focusing on what is best for the community -- Showing empathy towards other community members +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members Examples of unacceptable behavior by participants include: -- The use of sexualized language or imagery and unwelcome sexual attention or - advances -- Trolling, insulting/derogatory comments, and personal or political attacks -- Public or private harassment -- Publishing others' private information, such as a physical or electronic - address, without explicit permission -- Other conduct which could reasonably be considered inappropriate in a - professional setting +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting ## Our Responsibilities diff --git a/.github/COMMIT_CONVENTION.md b/.github/COMMIT_CONVENTION.md index 6dc0f1b6..8b3ac347 100644 --- a/.github/COMMIT_CONVENTION.md +++ b/.github/COMMIT_CONVENTION.md @@ -74,9 +74,9 @@ The scope could be anything specifying the place of the commit change. For examp The subject contains a succinct description of the change: -- use the imperative, present tense: "change" not "changed" nor "changes" -- don't capitalize the first letter -- no dot (.) at the end +- use the imperative, present tense: "change" not "changed" nor "changes" +- don't capitalize the first letter +- no dot (.) at the end ### Body diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 6a3238a6..0ee00b6a 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -2,39 +2,39 @@ **The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the [Discord server](https://discord.gg/djs) instead of opening an issue, or on [GitHub Discussions](https://github.com/discordjs/discord-api-types/discussions) – you will get redirected there anyway.** -- [Code of Conduct](https://github.com/discordjs/discord-api-types/blob/main/.github/CODE_OF_CONDUCT.md) -- [Pull Request Guidelines](#pull-request-guidelines) -- [Development Setup](#development-setup) -- [Project Structure](#project-structure) -- [Contributing Tests](#contributing-tests) +- [Code of Conduct](https://github.com/discordjs/discord-api-types/blob/main/.github/CODE_OF_CONDUCT.md) +- [Pull Request Guidelines](#pull-request-guidelines) +- [Development Setup](#development-setup) +- [Project Structure](#project-structure) +- [Contributing Tests](#contributing-tests) ## Pull Request Guidelines -- Checkout a topic branch from a base branch, e.g. `main`, and merge back against that branch. +- Checkout a topic branch from a base branch, e.g. `main`, and merge back against that branch. -- If adding a new feature: +- If adding a new feature: - - Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it. + - Provide a convincing reason to add this feature. Ideally, you should open a suggestion issue first and have it approved before working on it. -- If fixing a bug: +- If fixing a bug: - - If you are resolving a special issue, add `fix/close #xxxx[,#xxxx]` (#xxxx is the issue id) in your PR body for a better release log, e.g. + - If you are resolving a special issue, add `fix/close #xxxx[,#xxxx]` (#xxxx is the issue id) in your PR body for a better release log, e.g. - ``` - fix(Guild): handle events correctly + ``` + fix(Guild): handle events correctly - close #28 - ``` + close #28 + ``` - - Provide a detailed description of the bug in the PR. Live demo preferred. + - Provide a detailed description of the bug in the PR. Live demo preferred. -- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging. +- It's OK to have multiple small commits as you work on the PR - GitHub can automatically squash them before merging. -- Make sure tests pass! +- Make sure tests pass! -- Commit messages must follow the [commit message convention](./COMMIT_CONVENTION.md) so that changelogs can be automatically generated. Commit messages are automatically validated before commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)). +- Commit messages must follow the [commit message convention](./COMMIT_CONVENTION.md) so that changelogs can be automatically generated. Commit messages are automatically validated before commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)). -- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)). +- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [husky](https://github.com/typicode/husky)). ## Development Setup @@ -48,6 +48,6 @@ $ npm i # install the dependencies of the project A high level overview of tools used: -- [TypeScript](https://www.typescriptlang.org/) as the development language -- [ESLint](https://eslint.org/) for code-style -- [Prettier](https://prettier.io/) for code formatting +- [TypeScript](https://www.typescriptlang.org/) as the development language +- [ESLint](https://eslint.org/) for code-style +- [Prettier](https://prettier.io/) for code formatting diff --git a/.github/labeler.yml b/.github/labeler.yml index 63e0ac1b..0774fa7f 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,58 +1,84 @@ chore: - - any: ['*'] - all: - [ - '!deno/**/*', - '!gateway/**/*', - '!payloads/**/*', - '!rest/**/*', - '!rpc/**/*', - '!tests/**/*', - '!utils/**/*', - '!voice/**/*', - ] + - all: + - changed-files: + - all-globs-to-any-file: + - '*' + - '!deno/**/*' + - '!gateway/**/*' + - '!payloads/**/*' + - '!rest/**/*' + - '!rpc/**/*' + - '!tests/**/*' + - '!utils/**/*' + - '!voice/**/*' ci: - - .github/**/* - - .husky/**/* - - scripts/actions/**/* + - changed-files: + - any-glob-to-any-file: + - .github/**/* + - .husky/**/* + - scripts/actions/**/* dependencies: - - package.json - - package-lock.json - - website/package.json - - website/package-lock.json + - changed-files: + - any-glob-to-any-file: + - package.json + - package-lock.json + - website/package.json + - website/package-lock.json 'topic:deno': - - scripts/deno.mjs - - scripts/actions/report-deno-not-ran.mjs + - changed-files: + - any-glob-to-any-file: + - scripts/deno.mjs + - scripts/actions/report-deno-not-ran.mjs 'topic:gateway': - - gateway/**/* + - changed-files: + - any-glob-to-any-file: + - gateway/**/* 'topic:payloads': - - payloads/**/* + - changed-files: + - any-glob-to-any-file: + - payloads/**/* 'topic:rest': - - rest/**/* + - changed-files: + - any-glob-to-any-file: + - rest/**/* 'topic:rpc': - - rpc/**/* + - changed-files: + - any-glob-to-any-file: + - rpc/**/* 'topic:scripts': - - scripts/**/* + - changed-files: + - any-glob-to-any-file: + - scripts/**/* 'topic:tests': - - tests/**/* + - changed-files: + - any-glob-to-any-file: + - tests/**/* 'topic:utils': - - utils/**/* + - changed-files: + - any-glob-to-any-file: + - utils/**/* 'topic:voice': - - voice/**/* + - changed-files: + - any-glob-to-any-file: + - voice/**/* 'topic:globals': - - globals.ts + - changed-files: + - any-glob-to-any-file: + - globals.ts 'topic:website': - - website/**/* + - changed-files: + - any-glob-to-any-file: + - website/**/* diff --git a/.github/workflows/pr-automation.yml b/.github/workflows/pr-automation.yml index 447cbaf0..48a55985 100644 --- a/.github/workflows/pr-automation.yml +++ b/.github/workflows/pr-automation.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Automatically label PR - uses: actions/labeler@v4 + uses: actions/labeler@v5 with: repo-token: '${{ secrets.GITHUB_TOKEN }}' sync-labels: true diff --git a/.prettierignore b/.prettierignore index c01d295a..7cf7848c 100644 --- a/.prettierignore +++ b/.prettierignore @@ -19,6 +19,8 @@ website/build # Miscellaneous CODEOWNERS renovate.json +CHANGELOG.md # Format all of scripts !scripts/**/* +!.prettierrc.mjs diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index eba3f407..00000000 --- a/.prettierrc.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "printWidth": 120, - "useTabs": true, - "singleQuote": true, - "quoteProps": "as-needed", - "trailingComma": "all", - "endOfLine": "lf" -} diff --git a/.prettierrc.mjs b/.prettierrc.mjs new file mode 100644 index 00000000..ecb604be --- /dev/null +++ b/.prettierrc.mjs @@ -0,0 +1,12 @@ +import sapphirePrettierConfig from '@sapphire/prettier-config'; + +export default { + ...sapphirePrettierConfig, + printWidth: 120, + useTabs: true, + singleQuote: true, + quoteProps: 'as-needed', + trailingComma: 'all', + endOfLine: 'lf', + experimentalTernaries: true, +}; diff --git a/README.md b/README.md index f33c5df9..e05f9e45 100644 --- a/README.md +++ b/README.md @@ -77,25 +77,25 @@ import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts'; The exports of each API version is split into three main parts: -- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway. +- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway. -- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway. +- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway. -- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API. +- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API. - - For endpoint options, they will follow the following structure: `REST` where the type represents what it will return. + - For endpoint options, they will follow the following structure: `REST` where the type represents what it will return. - - For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`. + - For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`. - - Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `RESTOAuth2` + - Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `RESTOAuth2` - - If a type ends with `Result`, then it represents the expected result by calling its accompanying route. + - If a type ends with `Result`, then it represents the expected result by calling its accompanying route. - - Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors. + - Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors. -- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object). +- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object). -- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above. +- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above. **A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs), that are mentioned in an open pull request, or known through other means _and have received the green light to be used_. diff --git a/deno/README.md b/deno/README.md index f33c5df9..e05f9e45 100644 --- a/deno/README.md +++ b/deno/README.md @@ -77,25 +77,25 @@ import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts'; The exports of each API version is split into three main parts: -- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway. +- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway. -- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway. +- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway. -- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API. +- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API. - - For endpoint options, they will follow the following structure: `REST` where the type represents what it will return. + - For endpoint options, they will follow the following structure: `REST` where the type represents what it will return. - - For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`. + - For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`. - - Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `RESTOAuth2` + - Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `RESTOAuth2` - - If a type ends with `Result`, then it represents the expected result by calling its accompanying route. + - If a type ends with `Result`, then it represents the expected result by calling its accompanying route. - - Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors. + - Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors. -- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object). +- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object). -- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above. +- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above. **A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs), that are mentioned in an open pull request, or known through other means _and have received the green light to be used_. diff --git a/deno/rest/v10/mod.ts b/deno/rest/v10/mod.ts index 3f6bc6a5..7986093b 100644 --- a/deno/rest/v10/mod.ts +++ b/deno/rest/v10/mod.ts @@ -473,7 +473,9 @@ export const Routes = { parts.push('threads'); - return parts.join('/') as `/channels/${Snowflake}/messages/${Snowflake}/threads` | `/channels/${Snowflake}/threads`; + return parts.join('/') as + | `/channels/${Snowflake}/messages/${Snowflake}/threads` + | `/channels/${Snowflake}/threads`; }, /** diff --git a/deno/rest/v10/oauth2.ts b/deno/rest/v10/oauth2.ts index d3ccee2e..323ae312 100644 --- a/deno/rest/v10/oauth2.ts +++ b/deno/rest/v10/oauth2.ts @@ -196,4 +196,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult { } export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult = - RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; + RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & + RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; diff --git a/deno/rest/v6/guild.ts b/deno/rest/v6/guild.ts index 684b5cd5..2f54ac71 100644 --- a/deno/rest/v6/guild.ts +++ b/deno/rest/v6/guild.ts @@ -142,7 +142,14 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[]; export type RESTPostAPIGuildChannelJSONBody = Partial< Pick< APIChannel, - 'bitrate' | 'nsfw' | 'parent_id' | 'permission_overwrites' | 'rate_limit_per_user' | 'topic' | 'type' | 'user_limit' + | 'bitrate' + | 'nsfw' + | 'parent_id' + | 'permission_overwrites' + | 'rate_limit_per_user' + | 'topic' + | 'type' + | 'user_limit' > > & Required>; diff --git a/deno/rest/v6/oauth2.ts b/deno/rest/v6/oauth2.ts index 58c8bd17..6e68045e 100644 --- a/deno/rest/v6/oauth2.ts +++ b/deno/rest/v6/oauth2.ts @@ -191,4 +191,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult { * @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8. */ export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult = - RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; + RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & + RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; diff --git a/deno/rest/v8/oauth2.ts b/deno/rest/v8/oauth2.ts index f9652f3c..ea15bb57 100644 --- a/deno/rest/v8/oauth2.ts +++ b/deno/rest/v8/oauth2.ts @@ -236,4 +236,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult { * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult = - RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; + RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & + RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; diff --git a/deno/rest/v9/mod.ts b/deno/rest/v9/mod.ts index 7b843c1a..b5dc53c8 100644 --- a/deno/rest/v9/mod.ts +++ b/deno/rest/v9/mod.ts @@ -473,7 +473,9 @@ export const Routes = { parts.push('threads'); - return parts.join('/') as `/channels/${Snowflake}/messages/${Snowflake}/threads` | `/channels/${Snowflake}/threads`; + return parts.join('/') as + | `/channels/${Snowflake}/messages/${Snowflake}/threads` + | `/channels/${Snowflake}/threads`; }, /** diff --git a/deno/rest/v9/oauth2.ts b/deno/rest/v9/oauth2.ts index a2ea2124..22a7c063 100644 --- a/deno/rest/v9/oauth2.ts +++ b/deno/rest/v9/oauth2.ts @@ -196,4 +196,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult { } export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult = - RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; + RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & + RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; diff --git a/deno/utils/internals.ts b/deno/utils/internals.ts index 58c7cdb5..9e78f8b9 100644 --- a/deno/utils/internals.ts +++ b/deno/utils/internals.ts @@ -3,9 +3,9 @@ export type Nullable = { }; export type AddUndefinedToPossiblyUndefinedPropertiesOfInterface = { - [K in keyof Base]: Base[K] extends Exclude - ? AddUndefinedToPossiblyUndefinedPropertiesOfInterface - : AddUndefinedToPossiblyUndefinedPropertiesOfInterface | undefined; + [K in keyof Base]: Base[K] extends Exclude ? + AddUndefinedToPossiblyUndefinedPropertiesOfInterface + : AddUndefinedToPossiblyUndefinedPropertiesOfInterface | undefined; }; export type StrictPartial = AddUndefinedToPossiblyUndefinedPropertiesOfInterface>; @@ -19,19 +19,19 @@ type DistributiveKeys = T extends unknown ? Keys : never; /** * Allows picking of keys from unions that are disjoint */ -export type DistributivePick> = T extends unknown - ? keyof Pick_ extends never - ? never - : { [P in keyof Pick_]: Pick_[P] } - : never; +export type DistributivePick> = + T extends unknown ? + keyof Pick_ extends never ? + never + : { [P in keyof Pick_]: Pick_[P] } + : never; type Pick_ = Pick>; /** * Allows omitting of keys from unions that are disjoint */ -export type DistributiveOmit> = T extends unknown - ? { [P in keyof Omit_]: Omit_[P] } - : never; +export type DistributiveOmit> = + T extends unknown ? { [P in keyof Omit_]: Omit_[P] } : never; type Omit_ = Omit>; diff --git a/deno/utils/v10.ts b/deno/utils/v10.ts index 5cc5451a..bf08c519 100644 --- a/deno/utils/v10.ts +++ b/deno/utils/v10.ts @@ -182,6 +182,7 @@ export function isContextMenuApplicationCommandInteraction( interaction: APIApplicationCommandInteraction, ): interaction is APIContextMenuInteraction { return ( - interaction.data.type === ApplicationCommandType.Message || interaction.data.type === ApplicationCommandType.User + interaction.data.type === ApplicationCommandType.Message || + interaction.data.type === ApplicationCommandType.User ); } diff --git a/deno/utils/v9.ts b/deno/utils/v9.ts index 07701ccb..c791f2fd 100644 --- a/deno/utils/v9.ts +++ b/deno/utils/v9.ts @@ -182,6 +182,7 @@ export function isContextMenuApplicationCommandInteraction( interaction: APIApplicationCommandInteraction, ): interaction is APIContextMenuInteraction { return ( - interaction.data.type === ApplicationCommandType.Message || interaction.data.type === ApplicationCommandType.User + interaction.data.type === ApplicationCommandType.Message || + interaction.data.type === ApplicationCommandType.User ); } diff --git a/rest/v10/index.ts b/rest/v10/index.ts index e7e62a04..b3432e56 100644 --- a/rest/v10/index.ts +++ b/rest/v10/index.ts @@ -473,7 +473,9 @@ export const Routes = { parts.push('threads'); - return parts.join('/') as `/channels/${Snowflake}/messages/${Snowflake}/threads` | `/channels/${Snowflake}/threads`; + return parts.join('/') as + | `/channels/${Snowflake}/messages/${Snowflake}/threads` + | `/channels/${Snowflake}/threads`; }, /** diff --git a/rest/v10/oauth2.ts b/rest/v10/oauth2.ts index fb70aba1..e84c059a 100644 --- a/rest/v10/oauth2.ts +++ b/rest/v10/oauth2.ts @@ -196,4 +196,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult { } export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult = - RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; + RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & + RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; diff --git a/rest/v6/guild.ts b/rest/v6/guild.ts index 7da704fc..f2a51018 100644 --- a/rest/v6/guild.ts +++ b/rest/v6/guild.ts @@ -142,7 +142,14 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[]; export type RESTPostAPIGuildChannelJSONBody = Partial< Pick< APIChannel, - 'bitrate' | 'nsfw' | 'parent_id' | 'permission_overwrites' | 'rate_limit_per_user' | 'topic' | 'type' | 'user_limit' + | 'bitrate' + | 'nsfw' + | 'parent_id' + | 'permission_overwrites' + | 'rate_limit_per_user' + | 'topic' + | 'type' + | 'user_limit' > > & Required>; diff --git a/rest/v6/oauth2.ts b/rest/v6/oauth2.ts index e6f9d8a1..f1385fa1 100644 --- a/rest/v6/oauth2.ts +++ b/rest/v6/oauth2.ts @@ -191,4 +191,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult { * @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8. */ export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult = - RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; + RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & + RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; diff --git a/rest/v8/oauth2.ts b/rest/v8/oauth2.ts index 99131f91..ac969f16 100644 --- a/rest/v8/oauth2.ts +++ b/rest/v8/oauth2.ts @@ -236,4 +236,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult { * @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10. */ export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult = - RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; + RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & + RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; diff --git a/rest/v9/index.ts b/rest/v9/index.ts index 5964ab7a..4931517a 100644 --- a/rest/v9/index.ts +++ b/rest/v9/index.ts @@ -473,7 +473,9 @@ export const Routes = { parts.push('threads'); - return parts.join('/') as `/channels/${Snowflake}/messages/${Snowflake}/threads` | `/channels/${Snowflake}/threads`; + return parts.join('/') as + | `/channels/${Snowflake}/messages/${Snowflake}/threads` + | `/channels/${Snowflake}/threads`; }, /** diff --git a/rest/v9/oauth2.ts b/rest/v9/oauth2.ts index 8ad1fb75..97fd983b 100644 --- a/rest/v9/oauth2.ts +++ b/rest/v9/oauth2.ts @@ -196,4 +196,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult { } export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult = - RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; + RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & + RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult; diff --git a/utils/internals.ts b/utils/internals.ts index 58c7cdb5..9e78f8b9 100644 --- a/utils/internals.ts +++ b/utils/internals.ts @@ -3,9 +3,9 @@ export type Nullable = { }; export type AddUndefinedToPossiblyUndefinedPropertiesOfInterface = { - [K in keyof Base]: Base[K] extends Exclude - ? AddUndefinedToPossiblyUndefinedPropertiesOfInterface - : AddUndefinedToPossiblyUndefinedPropertiesOfInterface | undefined; + [K in keyof Base]: Base[K] extends Exclude ? + AddUndefinedToPossiblyUndefinedPropertiesOfInterface + : AddUndefinedToPossiblyUndefinedPropertiesOfInterface | undefined; }; export type StrictPartial = AddUndefinedToPossiblyUndefinedPropertiesOfInterface>; @@ -19,19 +19,19 @@ type DistributiveKeys = T extends unknown ? Keys : never; /** * Allows picking of keys from unions that are disjoint */ -export type DistributivePick> = T extends unknown - ? keyof Pick_ extends never - ? never - : { [P in keyof Pick_]: Pick_[P] } - : never; +export type DistributivePick> = + T extends unknown ? + keyof Pick_ extends never ? + never + : { [P in keyof Pick_]: Pick_[P] } + : never; type Pick_ = Pick>; /** * Allows omitting of keys from unions that are disjoint */ -export type DistributiveOmit> = T extends unknown - ? { [P in keyof Omit_]: Omit_[P] } - : never; +export type DistributiveOmit> = + T extends unknown ? { [P in keyof Omit_]: Omit_[P] } : never; type Omit_ = Omit>; diff --git a/utils/v10.ts b/utils/v10.ts index 6d2f22ce..bf990bf2 100644 --- a/utils/v10.ts +++ b/utils/v10.ts @@ -182,6 +182,7 @@ export function isContextMenuApplicationCommandInteraction( interaction: APIApplicationCommandInteraction, ): interaction is APIContextMenuInteraction { return ( - interaction.data.type === ApplicationCommandType.Message || interaction.data.type === ApplicationCommandType.User + interaction.data.type === ApplicationCommandType.Message || + interaction.data.type === ApplicationCommandType.User ); } diff --git a/utils/v9.ts b/utils/v9.ts index daf02e7a..80580f42 100644 --- a/utils/v9.ts +++ b/utils/v9.ts @@ -182,6 +182,7 @@ export function isContextMenuApplicationCommandInteraction( interaction: APIApplicationCommandInteraction, ): interaction is APIContextMenuInteraction { return ( - interaction.data.type === ApplicationCommandType.Message || interaction.data.type === ApplicationCommandType.User + interaction.data.type === ApplicationCommandType.Message || + interaction.data.type === ApplicationCommandType.User ); }