mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-21 02:40:08 +00:00
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 <me@vladfrangu.dev>
This commit is contained in:
26
.github/CODE_OF_CONDUCT.md
vendored
26
.github/CODE_OF_CONDUCT.md
vendored
@@ -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
|
||||
|
||||
|
||||
6
.github/COMMIT_CONVENTION.md
vendored
6
.github/COMMIT_CONVENTION.md
vendored
@@ -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
|
||||
|
||||
|
||||
44
.github/CONTRIBUTING.md
vendored
44
.github/CONTRIBUTING.md
vendored
@@ -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
|
||||
|
||||
88
.github/labeler.yml
vendored
88
.github/labeler.yml
vendored
@@ -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/**/*
|
||||
|
||||
2
.github/workflows/pr-automation.yml
vendored
2
.github/workflows/pr-automation.yml
vendored
@@ -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
|
||||
|
||||
@@ -19,6 +19,8 @@ website/build
|
||||
# Miscellaneous
|
||||
CODEOWNERS
|
||||
renovate.json
|
||||
CHANGELOG.md
|
||||
|
||||
# Format all of scripts
|
||||
!scripts/**/*
|
||||
!.prettierrc.mjs
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"printWidth": 120,
|
||||
"useTabs": true,
|
||||
"singleQuote": true,
|
||||
"quoteProps": "as-needed",
|
||||
"trailingComma": "all",
|
||||
"endOfLine": "lf"
|
||||
}
|
||||
12
.prettierrc.mjs
Normal file
12
.prettierrc.mjs
Normal file
@@ -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,
|
||||
};
|
||||
20
README.md
20
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<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
|
||||
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
|
||||
|
||||
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
|
||||
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
|
||||
|
||||
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
|
||||
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
|
||||
|
||||
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
|
||||
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
|
||||
|
||||
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
|
||||
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
|
||||
|
||||
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
|
||||
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
|
||||
|
||||
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
|
||||
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
|
||||
|
||||
**A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs),
|
||||
that are mentioned in an open pull request, or known through other means _and have received the green light to be used_.
|
||||
|
||||
@@ -77,25 +77,25 @@ import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
|
||||
|
||||
The exports of each API version is split into three main parts:
|
||||
|
||||
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
|
||||
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
|
||||
|
||||
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
|
||||
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
|
||||
|
||||
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
|
||||
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
|
||||
|
||||
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
|
||||
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
|
||||
|
||||
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
|
||||
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
|
||||
|
||||
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
|
||||
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
|
||||
|
||||
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
|
||||
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
|
||||
|
||||
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
|
||||
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
|
||||
|
||||
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
|
||||
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
|
||||
|
||||
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
|
||||
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `globals` file. They will still be prefixed accordingly as described above.
|
||||
|
||||
**A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs),
|
||||
that are mentioned in an open pull request, or known through other means _and have received the green light to be used_.
|
||||
|
||||
@@ -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`;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -196,4 +196,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult {
|
||||
}
|
||||
|
||||
export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult =
|
||||
RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;
|
||||
RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult &
|
||||
RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;
|
||||
|
||||
@@ -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<Pick<APIChannel, 'name'>>;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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`;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -196,4 +196,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult {
|
||||
}
|
||||
|
||||
export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult =
|
||||
RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;
|
||||
RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult &
|
||||
RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;
|
||||
|
||||
@@ -3,9 +3,9 @@ export type Nullable<T> = {
|
||||
};
|
||||
|
||||
export type AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base> = {
|
||||
[K in keyof Base]: Base[K] extends Exclude<Base[K], undefined>
|
||||
? AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]>
|
||||
: AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]> | undefined;
|
||||
[K in keyof Base]: Base[K] extends Exclude<Base[K], undefined> ?
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]>
|
||||
: AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]> | undefined;
|
||||
};
|
||||
|
||||
export type StrictPartial<Base> = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Partial<Base>>;
|
||||
@@ -19,19 +19,19 @@ type DistributiveKeys<T> = T extends unknown ? Keys<T> : never;
|
||||
/**
|
||||
* Allows picking of keys from unions that are disjoint
|
||||
*/
|
||||
export type DistributivePick<T, K extends DistributiveKeys<T>> = T extends unknown
|
||||
? keyof Pick_<T, K> extends never
|
||||
? never
|
||||
: { [P in keyof Pick_<T, K>]: Pick_<T, K>[P] }
|
||||
: never;
|
||||
export type DistributivePick<T, K extends DistributiveKeys<T>> =
|
||||
T extends unknown ?
|
||||
keyof Pick_<T, K> extends never ?
|
||||
never
|
||||
: { [P in keyof Pick_<T, K>]: Pick_<T, K>[P] }
|
||||
: never;
|
||||
|
||||
type Pick_<T, K> = Pick<T, Extract<keyof T, K>>;
|
||||
|
||||
/**
|
||||
* Allows omitting of keys from unions that are disjoint
|
||||
*/
|
||||
export type DistributiveOmit<T, K extends DistributiveKeys<T>> = T extends unknown
|
||||
? { [P in keyof Omit_<T, K>]: Omit_<T, K>[P] }
|
||||
: never;
|
||||
export type DistributiveOmit<T, K extends DistributiveKeys<T>> =
|
||||
T extends unknown ? { [P in keyof Omit_<T, K>]: Omit_<T, K>[P] } : never;
|
||||
|
||||
type Omit_<T, K> = Omit<T, Extract<keyof T, K>>;
|
||||
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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`;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -196,4 +196,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult {
|
||||
}
|
||||
|
||||
export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult =
|
||||
RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;
|
||||
RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult &
|
||||
RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;
|
||||
|
||||
@@ -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<Pick<APIChannel, 'name'>>;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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`;
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -196,4 +196,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult {
|
||||
}
|
||||
|
||||
export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult =
|
||||
RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;
|
||||
RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult &
|
||||
RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;
|
||||
|
||||
@@ -3,9 +3,9 @@ export type Nullable<T> = {
|
||||
};
|
||||
|
||||
export type AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base> = {
|
||||
[K in keyof Base]: Base[K] extends Exclude<Base[K], undefined>
|
||||
? AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]>
|
||||
: AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]> | undefined;
|
||||
[K in keyof Base]: Base[K] extends Exclude<Base[K], undefined> ?
|
||||
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]>
|
||||
: AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Base[K]> | undefined;
|
||||
};
|
||||
|
||||
export type StrictPartial<Base> = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Partial<Base>>;
|
||||
@@ -19,19 +19,19 @@ type DistributiveKeys<T> = T extends unknown ? Keys<T> : never;
|
||||
/**
|
||||
* Allows picking of keys from unions that are disjoint
|
||||
*/
|
||||
export type DistributivePick<T, K extends DistributiveKeys<T>> = T extends unknown
|
||||
? keyof Pick_<T, K> extends never
|
||||
? never
|
||||
: { [P in keyof Pick_<T, K>]: Pick_<T, K>[P] }
|
||||
: never;
|
||||
export type DistributivePick<T, K extends DistributiveKeys<T>> =
|
||||
T extends unknown ?
|
||||
keyof Pick_<T, K> extends never ?
|
||||
never
|
||||
: { [P in keyof Pick_<T, K>]: Pick_<T, K>[P] }
|
||||
: never;
|
||||
|
||||
type Pick_<T, K> = Pick<T, Extract<keyof T, K>>;
|
||||
|
||||
/**
|
||||
* Allows omitting of keys from unions that are disjoint
|
||||
*/
|
||||
export type DistributiveOmit<T, K extends DistributiveKeys<T>> = T extends unknown
|
||||
? { [P in keyof Omit_<T, K>]: Omit_<T, K>[P] }
|
||||
: never;
|
||||
export type DistributiveOmit<T, K extends DistributiveKeys<T>> =
|
||||
T extends unknown ? { [P in keyof Omit_<T, K>]: Omit_<T, K>[P] } : never;
|
||||
|
||||
type Omit_<T, K> = Omit<T, Extract<keyof T, K>>;
|
||||
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user