Compare commits

...

68 Commits

Author SHA1 Message Date
github-actions[bot]
3442d5657a chore(release): 0.37.78 🎉 (#938)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-04-01 15:20:36 +03:00
renovate[bot]
43803d6c52 chore(deps): lock file maintenance (#937)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-01 05:53:54 +03:00
renovate[bot]
0c3383558d chore(deps): update dependency @types/node to v20.12.2 (#935)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-01 05:52:28 +03:00
renovate[bot]
e030fe2ab7 chore(deps): update dependency tsd to ^0.31.0 (#936)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-04-01 05:49:56 +03:00
renovate[bot]
634df000c6 chore(deps): lock file maintenance (#926)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-31 21:28:05 +03:00
Jaw0r3k
495148dc46 feat: bot banners (#906) 2024-03-31 21:24:03 +03:00
codershiba
61ce329f61 feat(Guild): add RESTPostAPIGuildBulkBan result and json body (#910) 2024-03-31 21:18:51 +03:00
codershiba
7dcad582ce feat(Routes): Add guildBulkBan() route (#909) 2024-03-31 21:16:59 +03:00
codershiba
4db44b553d feat(RESTJSONErrorCodes): Add 500_000 (#908) 2024-03-31 21:15:48 +03:00
github-actions[bot]
ccb7ef479c chore(release): 0.37.77 🎉 (#934)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-28 14:20:13 +02:00
renovate[bot]
37b08a293f chore(deps): update dependency eslint-config-neon to v0.1.60 (#932)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-27 10:48:18 +02:00
Vlad Frangu
db89f0ef66 chore: vlad merged too fast, forgot to lint 2024-03-27 10:46:57 +02:00
Dmytro
47c9ad0e70 feat(APIAuditLogChange): add APIAuditLogChangeKeySystemChannelFlags (#933) 2024-03-27 10:34:11 +02:00
dependabot[bot]
eaaa8254b9 chore(deps): bump express from 4.18.1 to 4.19.2 in /website (#931)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-25 23:46:31 +02:00
renovate[bot]
1d5646e5a0 chore(deps): update dependency @typescript-eslint/utils to v7.4.0 (#930)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-25 23:41:00 +02:00
Almeida
b7ae342faa ci: ignore commits by dependabot (#929) 2024-03-25 14:39:11 +02:00
dependabot[bot]
698282f4b0 chore(deps): bump webpack-dev-middleware from 5.3.3 to 5.3.4 in /website (#927)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-23 11:30:47 +02:00
renovate[bot]
19327a5d66 chore(deps): lock file maintenance (#924)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-21 14:21:07 +02:00
github-actions[bot]
66958cb67e chore(release): 0.37.76 🎉 (#923)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-21 14:18:44 +02:00
renovate[bot]
bd7e1e7b4f chore(deps): lock file maintenance (#922)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-21 12:51:39 +02:00
renovate[bot]
6ce581c0db chore(deps): lock file maintenance (#918)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-21 12:30:05 +02:00
renovate[bot]
7f22d4da37 chore(deps): update dependency typescript to v5.4.3 (#920)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-20 21:53:55 +02:00
renovate[bot]
d6d2fb69c9 chore(deps): update dependency @types/node to v20.11.30 (#919)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-19 15:05:35 +02:00
renovate[bot]
dfc109f3f1 chore(deps): update patch/minor dependencies (#917)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-19 10:59:04 +02:00
Almeida
1377730766 ci: ignore new releases triggered only by renovate (#916) 2024-03-18 22:52:38 +02:00
renovate[bot]
22e6bafd39 chore(deps): lock file maintenance (#915)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-18 22:12:47 +02:00
renovate[bot]
5e175e1595 chore(deps): update dependency @typescript-eslint/utils to v7.3.0 (#914)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-18 22:09:02 +02:00
Vlad Frangu
fcf14c3ea2 chore: make renovate be less spamy 2024-03-18 22:06:09 +02:00
renovate[bot]
8640cdd360 chore(deps): update dependency @types/node to v20.11.29 (#912)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-18 22:03:03 +02:00
github-actions[bot]
1f83534ccb chore(release): 0.37.75 🎉 (#911)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-18 14:28:55 +02:00
dependabot[bot]
affc669a73 chore(deps): bump follow-redirects from 1.15.4 to 1.15.6 in /website (#905)
Bumps [follow-redirects](https://github.com/follow-redirects/follow-redirects) from 1.15.4 to 1.15.6.
- [Release notes](https://github.com/follow-redirects/follow-redirects/releases)
- [Commits](https://github.com/follow-redirects/follow-redirects/compare/v1.15.4...v1.15.6)

---
updated-dependencies:
- dependency-name: follow-redirects
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-03-15 12:55:36 +02:00
renovate[bot]
15fe19b39d chore(deps): update dependency @commitlint/cli to v19.2.0 (#903)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-15 12:55:20 +02:00
renovate[bot]
c83a604076 chore(deps): update dependency @types/node to v20.11.28 (#904)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-15 12:52:31 +02:00
github-actions[bot]
6887b8fc46 chore(release): 0.37.74 🎉 (#902)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-14 14:20:15 +02:00
renovate[bot]
f509930e00 chore(deps): update dependency @types/node to v20.11.27 (#901)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-13 17:01:31 +02:00
renovate[bot]
597b7f7fb0 chore(deps): update commitlint monorepo to v19.1.0 (#900)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-12 10:52:13 +02:00
renovate[bot]
badf590103 chore(deps): update dependency @types/node to v20.11.26 (#898)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-12 01:01:04 +02:00
renovate[bot]
d7d089e3cd chore(deps): update dependency @octokit/webhooks-types to v7.4.0 (#899)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-12 00:55:37 +02:00
renovate[bot]
36e8d3caed chore(deps): update dependency @typescript-eslint/utils to v7.2.0 (#897)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-11 21:26:47 +02:00
github-actions[bot]
9fc46f8ecb chore(release): 0.37.73 🎉 (#895)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-07 14:26:22 +02:00
Vlad Frangu
930162c7a6 chore: fix release flow 2024-03-07 14:24:26 +02:00
github-actions[bot]
1cf1a57365 chore(release): 0.37.72 🎉 (#894)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-03-07 14:18:44 +02:00
Vlad Frangu
a39a5d9d41 chore: remove useless all matcher for labeler 2024-03-06 21:48:17 +02:00
renovate[bot]
a0e00ffaf7 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>
2024-03-06 21:45:57 +02:00
renovate[bot]
45e2d17c65 chore(deps): update dependency typescript to v5.4.2 (#892)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-06 21:22:01 +02:00
renovate[bot]
8691b992e0 chore(deps): update dependency @types/node to v20.11.25 (#891)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-06 21:21:37 +02:00
renovate[bot]
36d1b4ba50 chore(deps): update actions/setup-node action to v4 (#889)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-05 10:00:31 +02:00
renovate[bot]
de02125eec chore(deps): update dependency npm-run-all2 to v6 (#890)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-05 10:00:19 +02:00
Vlad Frangu
8acc356d27 chore: use github provided concurrency to prevent multiple publish nexts 2024-03-05 00:12:53 +02:00
renovate[bot]
803e5b31b9 chore(deps): update styfle/cancel-workflow-action action to v0.12.1 (#886)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-05 00:01:43 +02:00
renovate[bot]
c7e0e32aa5 chore(deps): replace dependency npm-run-all with npm-run-all2 ^5.0.0 (#885)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-03-05 00:01:21 +02:00
renovate[bot]
5aec2d293e chore: Configure Renovate (#884)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vlad Frangu <kingdgrizzle@gmail.com>
Co-authored-by: Vlad Frangu <me@vladfrangu.dev>
2024-03-04 23:59:04 +02:00
Vlad Frangu
5e09570716 chore: woopsie daisy 2024-03-04 23:13:50 +02:00
Vlad Frangu
d98c991c35 chore: my bad boo 2024-03-04 21:45:48 +02:00
Vlad Frangu
2814d7e2f5 chore: wowzah 2024-03-04 21:41:06 +02:00
Vlad Frangu
23f87a8ff2 chore: fix rimraf and build script 2024-03-04 21:29:45 +02:00
Vlad Frangu
1d39612329 chore: give this repo some LOVE 2024-03-04 21:17:19 +02:00
René
ef31e116b6 chore: remove deprecated importsNotUsedAsValues from tsconfig (#831) 2024-03-04 21:12:01 +02:00
Superchupu
abbd4b2e21 ci: enable npm provenance (#882) 2024-03-04 21:04:22 +02:00
Isidro Casiano
5e295706b8 docs(APISelectMenuOption): correct character limit (#881) 2024-03-04 20:59:49 +02:00
github-actions[bot]
803dcd7bdd chore(release): 0.37.71 🎉 (#880)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-26 14:19:12 +02:00
dependabot[bot]
62de95fd6f chore(deps): bump follow-redirects from 1.15.1 to 1.15.4 in /website (#865)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-23 02:17:45 +02:00
dependabot[bot]
4f46175c3c chore(deps-dev): bump ip from 1.1.5 to 1.1.9 (#876)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-02-23 02:17:36 +02:00
MateoDeveloper
150dc46b87 feat: add initial support for super reactions (#744)
Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
2024-02-23 02:16:59 +02:00
github-actions[bot]
c008413a8a chore(release): 0.37.70 🎉 (#875)
Build ran for 9564941b3a

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-15 14:18:10 +02:00
n1ck_pro
9564941b3a feat(RESTPostAPIChannelMessageJSONBody): add enforce_nonce (#874) 2024-02-12 23:13:34 +02:00
github-actions[bot]
f329a80a6b chore(release): 0.37.69 🎉 (#873)
Build ran for 0cfe05dad8

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2024-02-08 14:19:06 +02:00
MateoDeveloper
0cfe05dad8 feat(Locale): add SpanishLATAM (#859) 2024-02-07 21:38:22 +02:00
228 changed files with 10130 additions and 6007 deletions

View File

@@ -35,7 +35,7 @@ const schema = [
},
},
},
];
] as const;
export = {
rules: {

View File

@@ -0,0 +1,9 @@
{
"extends": "../tsconfig.json",
"compilerOptions": {
"declaration": false,
"declarationMap": false,
"skipLibCheck": true
},
"include": ["./index.ts"]
}

View File

@@ -1,20 +0,0 @@
{
"compileOnSave": true,
"compilerOptions": {
"alwaysStrict": true,
"lib": ["esnext"],
"module": "commonjs",
"noUnusedParameters": true,
"sourceMap": true,
"declaration": false,
"noUnusedLocals": true,
"removeComments": false,
"target": "ES2020",
"importsNotUsedAsValues": "error",
"strictNullChecks": true,
"preserveConstEnums": true,
"exactOptionalPropertyTypes": true,
"skipLibCheck": true
},
"include": ["./index.ts"]
}

View File

@@ -15,6 +15,7 @@
"tsdoc/syntax": "off",
"typescript-sort-keys/interface": "off",
"typescript-sort-keys/string-enum": "off",
"unicorn/prefer-math-trunc": "off"
"unicorn/prefer-math-trunc": "off",
"jsdoc/no-undefined-types": "off"
}
}

View File

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

View File

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

View File

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

87
.github/labeler.yml vendored
View File

@@ -1,58 +1,83 @@
chore:
- any: ['*']
all:
[
'!deno/**/*',
'!gateway/**/*',
'!payloads/**/*',
'!rest/**/*',
'!rpc/**/*',
'!tests/**/*',
'!utils/**/*',
'!voice/**/*',
]
- 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/**/*

View File

@@ -12,12 +12,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Use Node.js v16
uses: actions/setup-node@v2
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- name: Install Dependencies
run: npm ci

View File

@@ -12,15 +12,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Add problem matcher
run: echo "::add-matcher::.github/problemMatchers/eslint.json" && echo "::add-matcher::.github/problemMatchers/tsc.json"
- name: Use Node.js v16
uses: actions/setup-node@v2
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
cache: npm
registry-url: https://registry.npmjs.org/
@@ -42,12 +42,12 @@ jobs:
steps:
- name: Checkout Project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Use Node.js v16
uses: actions/setup-node@v2
- name: Use Node.js v20
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
- name: Install Dependencies
run: npm ci

View File

@@ -17,14 +17,14 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Node v16
uses: actions/setup-node@v2
- name: Install Node v20
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install dependencies
@@ -65,18 +65,22 @@ jobs:
create_release:
name: Create release and publish
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
if: github.repository_owner == 'discordjs' && github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release)') && !contains(github.event.head_commit.message, '[skip ci]')
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Node v16
uses: actions/setup-node@v2
- name: Install Node v20
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install dependencies

View File

@@ -14,9 +14,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Label sync
uses: crazy-max/ghaction-github-labeler@v3
uses: crazy-max/ghaction-github-labeler@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -5,10 +5,13 @@ on:
jobs:
triage:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Automatically label PR
uses: actions/labeler@v3
uses: actions/labeler@v5
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
sync-labels: true

View File

@@ -8,28 +8,34 @@ on:
jobs:
publish:
concurrency:
group: publish-next
cancel-in-progress: true
name: Publish @next release to npm
runs-on: ubuntu-latest
permissions:
id-token: write
if: github.repository_owner == 'discordjs' && !(github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release)'))
steps:
- name: Cancel previous publish attempts
uses: styfle/cancel-workflow-action@0.9.1
with:
access_token: ${{ github.token }}
# - name: Cancel previous publish attempts
# uses: styfle/cancel-workflow-action@0.12.1
# with:
# access_token: ${{ github.token }}
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Node v16
uses: actions/setup-node@v2
- name: Install Node v20
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: npm ci --ignore-scripts
run: npm ci
- name: Bump version
run: node ./scripts/bump-version.mjs
@@ -42,6 +48,6 @@ jobs:
- name: Publish new @next version
run: |
npm version $(jq --raw-output '.version' package.json)-next.$(git rev-parse --short HEAD).$(date +%s)
npm publish --tag next || true
npm publish --tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}

6
.gitignore vendored
View File

@@ -1,9 +1,9 @@
node_modules/
# Custom ESLint rules
.eslintplugin/*
!.eslintplugin/index.ts
!.eslintplugin/tsconfig.json
.eslint-plugin-local/*
!.eslint-plugin-local/index.ts
!.eslint-plugin-local/tsconfig.json
# Don't commit build outputs
globals.js

1
.husky/.gitignore vendored
View File

@@ -1 +0,0 @@
_

View File

@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install commitlint --edit $1

View File

@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx --no-install pretty-quick --staged && npx --no-install lint-staged && npm run build:deno && git add deno

View File

@@ -18,3 +18,9 @@ website/build
# Miscellaneous
CODEOWNERS
renovate.json
CHANGELOG.md
# Format all of scripts
!scripts/**/*
!.prettierrc.mjs

View File

@@ -1,8 +0,0 @@
{
"printWidth": 120,
"useTabs": true,
"singleQuote": true,
"quoteProps": "as-needed",
"trailingComma": "all",
"endOfLine": "lf"
}

12
.prettierrc.mjs Normal file
View 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,
};

View File

@@ -1,3 +1,62 @@
## [0.37.78](https://github.com/discordjs/discord-api-types/compare/0.37.77...0.37.78) (2024-04-01)
### Features
* bot banners ([#906](https://github.com/discordjs/discord-api-types/issues/906)) ([495148d](https://github.com/discordjs/discord-api-types/commit/495148dc466fcc3cd47ff62377369a97a9cec13d))
* **Guild:** add `RESTPostAPIGuildBulkBan` result and json body ([#910](https://github.com/discordjs/discord-api-types/issues/910)) ([61ce329](https://github.com/discordjs/discord-api-types/commit/61ce329f614d5bc923c3ab4d2b318aa2e66c767b))
* **RESTJSONErrorCodes:** Add `500_000` ([#908](https://github.com/discordjs/discord-api-types/issues/908)) ([4db44b5](https://github.com/discordjs/discord-api-types/commit/4db44b553d7164415b9f20468716beb5223fcec0))
* **Routes:** Add `guildBulkBan()` route ([#909](https://github.com/discordjs/discord-api-types/issues/909)) ([7dcad58](https://github.com/discordjs/discord-api-types/commit/7dcad582ce2fa16ac7bde35f5b158648c2c7c9bf))
## [0.37.77](https://github.com/discordjs/discord-api-types/compare/0.37.76...0.37.77) (2024-03-28)
### Features
* **APIAuditLogChange:** add `APIAuditLogChangeKeySystemChannelFlags` ([#933](https://github.com/discordjs/discord-api-types/issues/933)) ([47c9ad0](https://github.com/discordjs/discord-api-types/commit/47c9ad0e7043c098d103107e95f8a97e67ad3eb4))
## [0.37.76](https://github.com/discordjs/discord-api-types/compare/0.37.75...0.37.76) (2024-03-21)
## [0.37.75](https://github.com/discordjs/discord-api-types/compare/0.37.74...0.37.75) (2024-03-18)
## [0.37.74](https://github.com/discordjs/discord-api-types/compare/0.37.73...0.37.74) (2024-03-14)
## [0.37.73](https://github.com/discordjs/discord-api-types/compare/0.37.71...0.37.73) (2024-03-07)
## [0.37.72](https://github.com/discordjs/discord-api-types/compare/0.37.71...0.37.72) (2024-03-07)
## [0.37.71](https://github.com/discordjs/discord-api-types/compare/0.37.70...0.37.71) (2024-02-26)
### Features
- add initial support for super reactions ([#744](https://github.com/discordjs/discord-api-types/issues/744)) ([150dc46](https://github.com/discordjs/discord-api-types/commit/150dc46b8739ca9cf10a46bb48d390f70c679b6e))
## [0.37.70](https://github.com/discordjs/discord-api-types/compare/0.37.69...0.37.70) (2024-02-15)
### Features
- **RESTPostAPIChannelMessageJSONBody:** add enforce_nonce ([#874](https://github.com/discordjs/discord-api-types/issues/874)) ([9564941](https://github.com/discordjs/discord-api-types/commit/9564941b3ae51c8bc9b1f915d66b43775089db18))
## [0.37.69](https://github.com/discordjs/discord-api-types/compare/0.37.68...0.37.69) (2024-02-08)
### Features
- **Locale:** add `SpanishLATAM` ([#859](https://github.com/discordjs/discord-api-types/issues/859)) ([0cfe05d](https://github.com/discordjs/discord-api-types/commit/0cfe05dad8271513a2ef58e4f183c530555c7c2d))
## [0.37.68](https://github.com/discordjs/discord-api-types/compare/0.37.67...0.37.68) (2024-02-05)
### Bug Fixes

View File

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

View File

@@ -1,3 +1,62 @@
## [0.37.78](https://github.com/discordjs/discord-api-types/compare/0.37.77...0.37.78) (2024-04-01)
### Features
* bot banners ([#906](https://github.com/discordjs/discord-api-types/issues/906)) ([495148d](https://github.com/discordjs/discord-api-types/commit/495148dc466fcc3cd47ff62377369a97a9cec13d))
* **Guild:** add `RESTPostAPIGuildBulkBan` result and json body ([#910](https://github.com/discordjs/discord-api-types/issues/910)) ([61ce329](https://github.com/discordjs/discord-api-types/commit/61ce329f614d5bc923c3ab4d2b318aa2e66c767b))
* **RESTJSONErrorCodes:** Add `500_000` ([#908](https://github.com/discordjs/discord-api-types/issues/908)) ([4db44b5](https://github.com/discordjs/discord-api-types/commit/4db44b553d7164415b9f20468716beb5223fcec0))
* **Routes:** Add `guildBulkBan()` route ([#909](https://github.com/discordjs/discord-api-types/issues/909)) ([7dcad58](https://github.com/discordjs/discord-api-types/commit/7dcad582ce2fa16ac7bde35f5b158648c2c7c9bf))
## [0.37.77](https://github.com/discordjs/discord-api-types/compare/0.37.76...0.37.77) (2024-03-28)
### Features
* **APIAuditLogChange:** add `APIAuditLogChangeKeySystemChannelFlags` ([#933](https://github.com/discordjs/discord-api-types/issues/933)) ([47c9ad0](https://github.com/discordjs/discord-api-types/commit/47c9ad0e7043c098d103107e95f8a97e67ad3eb4))
## [0.37.76](https://github.com/discordjs/discord-api-types/compare/0.37.75...0.37.76) (2024-03-21)
## [0.37.75](https://github.com/discordjs/discord-api-types/compare/0.37.74...0.37.75) (2024-03-18)
## [0.37.74](https://github.com/discordjs/discord-api-types/compare/0.37.73...0.37.74) (2024-03-14)
## [0.37.73](https://github.com/discordjs/discord-api-types/compare/0.37.71...0.37.73) (2024-03-07)
## [0.37.72](https://github.com/discordjs/discord-api-types/compare/0.37.71...0.37.72) (2024-03-07)
## [0.37.71](https://github.com/discordjs/discord-api-types/compare/0.37.70...0.37.71) (2024-02-26)
### Features
- add initial support for super reactions ([#744](https://github.com/discordjs/discord-api-types/issues/744)) ([150dc46](https://github.com/discordjs/discord-api-types/commit/150dc46b8739ca9cf10a46bb48d390f70c679b6e))
## [0.37.70](https://github.com/discordjs/discord-api-types/compare/0.37.69...0.37.70) (2024-02-15)
### Features
- **RESTPostAPIChannelMessageJSONBody:** add enforce_nonce ([#874](https://github.com/discordjs/discord-api-types/issues/874)) ([9564941](https://github.com/discordjs/discord-api-types/commit/9564941b3ae51c8bc9b1f915d66b43775089db18))
## [0.37.69](https://github.com/discordjs/discord-api-types/compare/0.37.68...0.37.69) (2024-02-08)
### Features
- **Locale:** add `SpanishLATAM` ([#859](https://github.com/discordjs/discord-api-types/issues/859)) ([0cfe05d](https://github.com/discordjs/discord-api-types/commit/0cfe05dad8271513a2ef58e4f183c530555c7c2d))
## [0.37.68](https://github.com/discordjs/discord-api-types/compare/0.37.67...0.37.68) (2024-02-05)
### Bug Fixes

View File

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

View File

@@ -3,6 +3,6 @@
*/
export interface GatewayURLQuery {
v: string;
encoding: 'json' | 'etf';
encoding: 'etf' | 'json';
compress?: 'zlib-stream';
}

View File

@@ -278,27 +278,29 @@ export enum GatewayDispatchEvents {
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayUpdatePresence
| GatewayVoiceStateUpdate
| GatewayRequestGuildMembers
| GatewayResume
| GatewayRequestGuildMembers;
| GatewayUpdatePresence
| GatewayVoiceStateUpdate;
export type GatewayReceivePayload =
| GatewayHello
| GatewayHeartbeatRequest
| GatewayDispatchPayload
| GatewayHeartbeatAck
| GatewayHeartbeatRequest
| GatewayHello
| GatewayInvalidSession
| GatewayReconnect
| GatewayDispatchPayload;
| GatewayReconnect;
export type GatewayDispatchPayload =
| GatewayAutoModerationRuleModifyDispatch
| GatewayApplicationCommandPermissionsUpdateDispatch
| GatewayAutoModerationActionExecutionDispatch
| GatewayAutoModerationRuleCreateDispatch
| GatewayAutoModerationRuleDeleteDispatch
| GatewayAutoModerationActionExecutionDispatch
| GatewayApplicationCommandPermissionsUpdateDispatch
| GatewayAutoModerationRuleModifyDispatch
| GatewayChannelModifyDispatch
| GatewayChannelPinsUpdateDispatch
| GatewayEntitlementModifyDispatch
| GatewayGuildAuditLogEntryCreateDispatch
| GatewayGuildBanModifyDispatch
| GatewayGuildCreateDispatch
| GatewayGuildDeleteDispatch
@@ -312,8 +314,8 @@ export type GatewayDispatchPayload =
| GatewayGuildRoleDeleteDispatch
| GatewayGuildRoleModifyDispatch
| GatewayGuildScheduledEventCreateDispatch
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventDeleteDispatch
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildStickersUpdateDispatch
@@ -332,24 +334,22 @@ export type GatewayDispatchPayload =
| GatewayMessageReactionRemoveEmojiDispatch
| GatewayMessageUpdateDispatch
| GatewayPresenceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
| GatewayThreadMembersUpdateDispatch
| GatewayThreadMemberUpdateDispatch
| GatewayThreadCreateDispatch
| GatewayThreadUpdateDispatch
| GatewayThreadDeleteDispatch
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch
| GatewayGuildAuditLogEntryCreateDispatch
| GatewayEntitlementModifyDispatch;
| GatewayWebhooksUpdateDispatch;
// #region Dispatch Payloads
@@ -454,7 +454,7 @@ export interface GatewayReadyDispatchData {
*
* See https://discord.com/developers/docs/resources/application#application-object
*/
application: Pick<APIApplication, 'id' | 'flags'>;
application: Pick<APIApplication, 'flags' | 'id'>;
}
/**
@@ -469,8 +469,8 @@ export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed,
*/
export type GatewayAutoModerationRuleModifyDispatch = DataPayload<
| GatewayDispatchEvents.AutoModerationRuleCreate
| GatewayDispatchEvents.AutoModerationRuleUpdate
| GatewayDispatchEvents.AutoModerationRuleDelete,
| GatewayDispatchEvents.AutoModerationRuleDelete
| GatewayDispatchEvents.AutoModerationRuleUpdate,
GatewayAutoModerationRuleModifyDispatchData
>;
@@ -694,8 +694,8 @@ export type GatewayEntitlementModifyDispatchData = APIEntitlement;
*/
export type GatewayEntitlementModifyDispatch = DataPayload<
| GatewayDispatchEvents.EntitlementCreate
| GatewayDispatchEvents.EntitlementUpdate
| GatewayDispatchEvents.EntitlementDelete,
| GatewayDispatchEvents.EntitlementDelete
| GatewayDispatchEvents.EntitlementUpdate,
GatewayEntitlementModifyDispatchData
>;
@@ -1014,10 +1014,10 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-member-update
*/
export type GatewayGuildMemberUpdateDispatchData = Omit<APIGuildMember, 'deaf' | 'mute' | 'user' | 'joined_at'> &
export type GatewayGuildMemberUpdateDispatchData = Nullable<Pick<APIGuildMember, 'joined_at'>> &
Omit<APIGuildMember, 'deaf' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'mute'>> &
Required<Pick<APIGuildMember, 'user'>> &
Nullable<Pick<APIGuildMember, 'joined_at'>> & {
Required<Pick<APIGuildMember, 'user'>> & {
/**
* The id of the guild
*/
@@ -1362,7 +1362,7 @@ export type GatewayMessageCreateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#message-create
*/
export type GatewayMessageCreateDispatchData = Omit<APIMessage, 'mentions'> & GatewayMessageEventExtraFields;
export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-update
@@ -1375,8 +1375,8 @@ export type GatewayMessageUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#message-update
*/
export type GatewayMessageUpdateDispatchData = Omit<Partial<APIMessage>, 'mentions'> &
GatewayMessageEventExtraFields & {
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields &
Omit<Partial<APIMessage>, 'mentions'> & {
/**
* ID of the message
*/
@@ -1979,8 +1979,8 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export type GatewayRequestGuildMembersData =
| GatewayRequestGuildMembersDataWithUserIds
| GatewayRequestGuildMembersDataWithQuery;
| GatewayRequestGuildMembersDataWithQuery
| GatewayRequestGuildMembersDataWithUserIds;
/**
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
@@ -2073,7 +2073,7 @@ interface BasePayload {
t?: string;
}
type NonDispatchPayload = Omit<BasePayload, 't' | 's'> & {
type NonDispatchPayload = Omit<BasePayload, 's' | 't'> & {
t: null;
s: null;
};

View File

@@ -184,56 +184,56 @@ export enum GatewayDispatchEvents {
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayUpdatePresence
| GatewayVoiceStateUpdate
| GatewayRequestGuildMembers
| GatewayResume
| GatewayRequestGuildMembers;
| GatewayUpdatePresence
| GatewayVoiceStateUpdate;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayReceivePayload =
| GatewayHello
| GatewayHeartbeatRequest
| GatewayDispatchPayload
| GatewayHeartbeatAck
| GatewayHeartbeatRequest
| GatewayHello
| GatewayInvalidSession
| GatewayReconnect
| GatewayDispatchPayload;
| GatewayReconnect;
/**
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayDispatchPayload =
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewayChannelModifyDispatch
| GatewayChannelPinsUpdateDispatch
| GatewayGuildModifyDispatch
| GatewayGuildDeleteDispatch
| GatewayGuildBanModifyDispatch
| GatewayGuildDeleteDispatch
| GatewayGuildEmojisUpdateDispatch
| GatewayGuildIntegrationsUpdateDispatch
| GatewayGuildMemberAddDispatch
| GatewayGuildMemberRemoveDispatch
| GatewayGuildMemberUpdateDispatch
| GatewayGuildMembersChunkDispatch
| GatewayGuildRoleModifyDispatch
| GatewayGuildMemberUpdateDispatch
| GatewayGuildModifyDispatch
| GatewayGuildRoleDeleteDispatch
| GatewayGuildRoleModifyDispatch
| GatewayInviteCreateDispatch
| GatewayInviteDeleteDispatch
| GatewayMessageCreateDispatch
| GatewayMessageUpdateDispatch
| GatewayMessageDeleteDispatch
| GatewayMessageDeleteBulkDispatch
| GatewayMessageDeleteDispatch
| GatewayMessageReactionAddDispatch
| GatewayMessageReactionRemoveDispatch
| GatewayMessageReactionRemoveAllDispatch
| GatewayMessageReactionRemoveDispatch
| GatewayMessageReactionRemoveEmojiDispatch
| GatewayMessageUpdateDispatch
| GatewayPresenceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch;
// #region Dispatch Payloads
@@ -571,7 +571,7 @@ export type GatewayMessageCreateDispatch = DataPayload<GatewayDispatchEvents.Mes
*/
export type GatewayMessageUpdateDispatch = DataPayload<
GatewayDispatchEvents.MessageUpdate,
{ id: string; channel_id: string } & Partial<APIMessage>
Partial<APIMessage> & { id: string; channel_id: string }
>;
/**
@@ -768,11 +768,11 @@ export interface GatewayResume {
export interface GatewayRequestGuildMembers {
op: GatewayOPCodes.RequestGuildMembers;
d: {
guild_id: string | string[];
guild_id: string[] | string;
query?: string;
limit: number;
presences?: boolean;
user_ids?: string | string[];
user_ids?: string[] | string;
nonce?: string;
};
}

View File

@@ -258,21 +258,21 @@ export enum GatewayDispatchEvents {
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayUpdatePresence
| GatewayVoiceStateUpdate
| GatewayRequestGuildMembers
| GatewayResume
| GatewayRequestGuildMembers;
| GatewayUpdatePresence
| GatewayVoiceStateUpdate;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayReceivePayload =
| GatewayHello
| GatewayHeartbeatRequest
| GatewayDispatchPayload
| GatewayHeartbeatAck
| GatewayHeartbeatRequest
| GatewayHello
| GatewayInvalidSession
| GatewayReconnect
| GatewayDispatchPayload;
| GatewayReconnect;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
@@ -292,8 +292,8 @@ export type GatewayDispatchPayload =
| GatewayGuildRoleDeleteDispatch
| GatewayGuildRoleModifyDispatch
| GatewayGuildScheduledEventCreateDispatch
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventDeleteDispatch
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildStickersUpdateDispatch
@@ -312,11 +312,11 @@ export type GatewayDispatchPayload =
| GatewayMessageReactionRemoveEmojiDispatch
| GatewayMessageUpdateDispatch
| GatewayPresenceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceServerUpdateDispatch
@@ -440,7 +440,7 @@ export interface GatewayReadyDispatchData {
*
* See https://discord.com/developers/docs/resources/application#application-object
*/
application: Pick<APIApplication, 'id' | 'flags'>;
application: Pick<APIApplication, 'flags' | 'id'>;
}
/**
@@ -805,10 +805,10 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayGuildMemberUpdateDispatchData = Omit<APIGuildMember, 'deaf' | 'mute' | 'user' | 'joined_at'> &
export type GatewayGuildMemberUpdateDispatchData = Nullable<Pick<APIGuildMember, 'joined_at'>> &
Omit<APIGuildMember, 'deaf' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'mute'>> &
Required<Pick<APIGuildMember, 'user'>> &
Nullable<Pick<APIGuildMember, 'joined_at'>> & {
Required<Pick<APIGuildMember, 'user'>> & {
/**
* The id of the guild
*/
@@ -1243,10 +1243,10 @@ export type GatewayMessageUpdateDispatch = DataPayload<
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayMessageUpdateDispatchData = {
export type GatewayMessageUpdateDispatchData = Partial<APIMessage> & {
id: Snowflake;
channel_id: Snowflake;
} & Partial<APIMessage>;
};
/**
* https://discord.com/developers/docs/topics/gateway#message-delete
@@ -1849,7 +1849,7 @@ interface BasePayload {
t?: string;
}
type NonDispatchPayload = Omit<BasePayload, 't' | 's'> & {
type NonDispatchPayload = Omit<BasePayload, 's' | 't'> & {
t: null;
s: null;
};

View File

@@ -277,27 +277,29 @@ export enum GatewayDispatchEvents {
export type GatewaySendPayload =
| GatewayHeartbeat
| GatewayIdentify
| GatewayUpdatePresence
| GatewayVoiceStateUpdate
| GatewayRequestGuildMembers
| GatewayResume
| GatewayRequestGuildMembers;
| GatewayUpdatePresence
| GatewayVoiceStateUpdate;
export type GatewayReceivePayload =
| GatewayHello
| GatewayHeartbeatRequest
| GatewayDispatchPayload
| GatewayHeartbeatAck
| GatewayHeartbeatRequest
| GatewayHello
| GatewayInvalidSession
| GatewayReconnect
| GatewayDispatchPayload;
| GatewayReconnect;
export type GatewayDispatchPayload =
| GatewayApplicationCommandPermissionsUpdateDispatch
| GatewayAutoModerationRuleModifyDispatch
| GatewayAutoModerationActionExecutionDispatch
| GatewayAutoModerationRuleCreateDispatch
| GatewayAutoModerationRuleDeleteDispatch
| GatewayAutoModerationActionExecutionDispatch
| GatewayAutoModerationRuleModifyDispatch
| GatewayChannelModifyDispatch
| GatewayChannelPinsUpdateDispatch
| GatewayEntitlementModifyDispatch
| GatewayGuildAuditLogEntryCreateDispatch
| GatewayGuildBanModifyDispatch
| GatewayGuildCreateDispatch
| GatewayGuildDeleteDispatch
@@ -311,8 +313,8 @@ export type GatewayDispatchPayload =
| GatewayGuildRoleDeleteDispatch
| GatewayGuildRoleModifyDispatch
| GatewayGuildScheduledEventCreateDispatch
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventDeleteDispatch
| GatewayGuildScheduledEventUpdateDispatch
| GatewayGuildScheduledEventUserAddDispatch
| GatewayGuildScheduledEventUserRemoveDispatch
| GatewayGuildStickersUpdateDispatch
@@ -331,24 +333,22 @@ export type GatewayDispatchPayload =
| GatewayMessageReactionRemoveEmojiDispatch
| GatewayMessageUpdateDispatch
| GatewayPresenceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewayStageInstanceCreateDispatch
| GatewayStageInstanceDeleteDispatch
| GatewayStageInstanceUpdateDispatch
| GatewayReadyDispatch
| GatewayResumedDispatch
| GatewayThreadCreateDispatch
| GatewayThreadDeleteDispatch
| GatewayThreadListSyncDispatch
| GatewayThreadMembersUpdateDispatch
| GatewayThreadMemberUpdateDispatch
| GatewayThreadCreateDispatch
| GatewayThreadUpdateDispatch
| GatewayThreadDeleteDispatch
| GatewayTypingStartDispatch
| GatewayUserUpdateDispatch
| GatewayVoiceServerUpdateDispatch
| GatewayVoiceStateUpdateDispatch
| GatewayWebhooksUpdateDispatch
| GatewayGuildAuditLogEntryCreateDispatch
| GatewayEntitlementModifyDispatch;
| GatewayWebhooksUpdateDispatch;
// #region Dispatch Payloads
@@ -453,7 +453,7 @@ export interface GatewayReadyDispatchData {
*
* See https://discord.com/developers/docs/resources/application#application-object
*/
application: Pick<APIApplication, 'id' | 'flags'>;
application: Pick<APIApplication, 'flags' | 'id'>;
}
/**
@@ -468,8 +468,8 @@ export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed,
*/
export type GatewayAutoModerationRuleModifyDispatch = DataPayload<
| GatewayDispatchEvents.AutoModerationRuleCreate
| GatewayDispatchEvents.AutoModerationRuleUpdate
| GatewayDispatchEvents.AutoModerationRuleDelete,
| GatewayDispatchEvents.AutoModerationRuleDelete
| GatewayDispatchEvents.AutoModerationRuleUpdate,
GatewayAutoModerationRuleModifyDispatchData
>;
@@ -693,8 +693,8 @@ export type GatewayEntitlementModifyDispatchData = APIEntitlement;
*/
export type GatewayEntitlementModifyDispatch = DataPayload<
| GatewayDispatchEvents.EntitlementCreate
| GatewayDispatchEvents.EntitlementUpdate
| GatewayDispatchEvents.EntitlementDelete,
| GatewayDispatchEvents.EntitlementDelete
| GatewayDispatchEvents.EntitlementUpdate,
GatewayEntitlementModifyDispatchData
>;
@@ -1013,10 +1013,10 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#guild-member-update
*/
export type GatewayGuildMemberUpdateDispatchData = Omit<APIGuildMember, 'deaf' | 'mute' | 'user' | 'joined_at'> &
export type GatewayGuildMemberUpdateDispatchData = Nullable<Pick<APIGuildMember, 'joined_at'>> &
Omit<APIGuildMember, 'deaf' | 'joined_at' | 'mute' | 'user'> &
Partial<Pick<APIGuildMember, 'deaf' | 'mute'>> &
Required<Pick<APIGuildMember, 'user'>> &
Nullable<Pick<APIGuildMember, 'joined_at'>> & {
Required<Pick<APIGuildMember, 'user'>> & {
/**
* The id of the guild
*/
@@ -1361,7 +1361,7 @@ export type GatewayMessageCreateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#message-create
*/
export type GatewayMessageCreateDispatchData = Omit<APIMessage, 'mentions'> & GatewayMessageEventExtraFields;
export type GatewayMessageCreateDispatchData = GatewayMessageEventExtraFields & Omit<APIMessage, 'mentions'>;
/**
* https://discord.com/developers/docs/topics/gateway-events#message-update
@@ -1374,8 +1374,8 @@ export type GatewayMessageUpdateDispatch = DataPayload<
/**
* https://discord.com/developers/docs/topics/gateway-events#message-update
*/
export type GatewayMessageUpdateDispatchData = Omit<Partial<APIMessage>, 'mentions'> &
GatewayMessageEventExtraFields & {
export type GatewayMessageUpdateDispatchData = GatewayMessageEventExtraFields &
Omit<Partial<APIMessage>, 'mentions'> & {
/**
* ID of the message
*/
@@ -1978,8 +1978,8 @@ export interface GatewayRequestGuildMembersDataWithQuery extends GatewayRequestG
* https://discord.com/developers/docs/topics/gateway-events#request-guild-members
*/
export type GatewayRequestGuildMembersData =
| GatewayRequestGuildMembersDataWithUserIds
| GatewayRequestGuildMembersDataWithQuery;
| GatewayRequestGuildMembersDataWithQuery
| GatewayRequestGuildMembersDataWithUserIds;
/**
* https://discord.com/developers/docs/topics/gateway-events#update-voice-state
@@ -2072,7 +2072,7 @@ interface BasePayload {
t?: string;
}
type NonDispatchPayload = Omit<BasePayload, 't' | 's'> & {
type NonDispatchPayload = Omit<BasePayload, 's' | 't'> & {
t: null;
s: null;
};

View File

@@ -305,7 +305,7 @@ export interface RESTErrorGroupWrapper {
_errors: RESTErrorData[];
}
export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation | { [k: string]: RESTErrorData } | string;
export type RESTErrorData = RESTErrorFieldInformation | RESTErrorGroupWrapper | string | { [k: string]: RESTErrorData };
/**
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure

View File

@@ -20,7 +20,7 @@ export enum ApplicationCommandOptionType {
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure
*/
export interface APIApplicationCommandOptionChoice<ValueType = string | number> {
export interface APIApplicationCommandOptionChoice<ValueType = number | string> {
name: string;
name_localizations?: LocalizationMap | null;
value: ValueType;

View File

@@ -65,42 +65,42 @@ export * from './_chatInput/user.ts';
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
*/
export type APIApplicationCommandBasicOption =
| APIApplicationCommandStringOption
| APIApplicationCommandIntegerOption
| APIApplicationCommandAttachmentOption
| APIApplicationCommandBooleanOption
| APIApplicationCommandUserOption
| APIApplicationCommandChannelOption
| APIApplicationCommandRoleOption
| APIApplicationCommandIntegerOption
| APIApplicationCommandMentionableOption
| APIApplicationCommandNumberOption
| APIApplicationCommandAttachmentOption;
| APIApplicationCommandRoleOption
| APIApplicationCommandStringOption
| APIApplicationCommandUserOption;
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
*/
export type APIApplicationCommandOption =
| APIApplicationCommandSubcommandOption
| APIApplicationCommandBasicOption
| APIApplicationCommandSubcommandGroupOption
| APIApplicationCommandBasicOption;
| APIApplicationCommandSubcommandOption;
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure
*/
export type APIApplicationCommandInteractionDataOption =
| APIApplicationCommandInteractionDataSubcommandOption
| APIApplicationCommandInteractionDataBasicOption
| APIApplicationCommandInteractionDataSubcommandGroupOption
| APIApplicationCommandInteractionDataBasicOption;
| APIApplicationCommandInteractionDataSubcommandOption;
export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataStringOption
| APIApplicationCommandInteractionDataIntegerOption
| APIApplicationCommandInteractionDataAttachmentOption
| APIApplicationCommandInteractionDataBooleanOption
| APIApplicationCommandInteractionDataUserOption
| APIApplicationCommandInteractionDataChannelOption
| APIApplicationCommandInteractionDataRoleOption
| APIApplicationCommandInteractionDataIntegerOption
| APIApplicationCommandInteractionDataMentionableOption
| APIApplicationCommandInteractionDataNumberOption
| APIApplicationCommandInteractionDataAttachmentOption;
| APIApplicationCommandInteractionDataRoleOption
| APIApplicationCommandInteractionDataStringOption
| APIApplicationCommandInteractionDataUserOption;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data

View File

@@ -33,8 +33,8 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIContextMenuInteractionData =
| APIUserApplicationCommandInteractionData
| APIMessageApplicationCommandInteractionData;
| APIMessageApplicationCommandInteractionData
| APIUserApplicationCommandInteractionData;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
@@ -74,18 +74,18 @@ export type APIMessageApplicationCommandGuildInteraction =
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIContextMenuInteraction = APIUserApplicationCommandInteraction | APIMessageApplicationCommandInteraction;
export type APIContextMenuInteraction = APIMessageApplicationCommandInteraction | APIUserApplicationCommandInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIContextMenuDMInteraction =
| APIUserApplicationCommandDMInteraction
| APIMessageApplicationCommandDMInteraction;
| APIMessageApplicationCommandDMInteraction
| APIUserApplicationCommandDMInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIContextMenuGuildInteraction =
| APIUserApplicationCommandGuildInteraction
| APIMessageApplicationCommandGuildInteraction;
| APIMessageApplicationCommandGuildInteraction
| APIUserApplicationCommandGuildInteraction;

View File

@@ -54,6 +54,6 @@ export enum ApplicationCommandPermissionType {
*/
export const APIApplicationCommandPermissionsConstant = {
// eslint-disable-next-line unicorn/prefer-native-coercion-functions
Everyone: (guildId: string | bigint): Snowflake => String(guildId),
AllChannels: (guildId: string | bigint): Snowflake => String(BigInt(guildId) - 1n),
Everyone: (guildId: bigint | string): Snowflake => String(guildId),
AllChannels: (guildId: bigint | string): Snowflake => String(BigInt(guildId) - 1n),
};

View File

@@ -118,7 +118,7 @@ export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationC
Required<
Pick<
APIBaseInteraction<InteractionType.ApplicationCommand, Data>,
'channel' | 'channel_id' | 'data' | 'app_permissions'
'app_permissions' | 'channel_id' | 'channel' | 'data'
>
>;

View File

@@ -16,15 +16,15 @@ import type { InteractionType } from './responses.ts';
export type PartialAPIMessageInteractionGuildMember = Pick<
APIGuildMember,
| 'roles'
| 'premium_since'
| 'pending'
| 'nick'
| 'mute'
| 'joined_at'
| 'deaf'
| 'communication_disabled_until'
| 'avatar'
| 'communication_disabled_until'
| 'deaf'
| 'joined_at'
| 'mute'
| 'nick'
| 'pending'
| 'premium_since'
| 'roles'
>;
/**
@@ -139,7 +139,7 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
Original,
'member' | 'guild_id'
'guild_id' | 'member'
> &
Required<Pick<Original, 'user'>>;
@@ -147,7 +147,7 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
Original,
'user'
> &
Required<Pick<Original, 'member' | 'guild_id'>>;
Required<Pick<Original, 'guild_id' | 'member'>>;
export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> extends Required<APIPartialChannel> {
type: T;
@@ -160,12 +160,12 @@ export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> ex
export type APIInteractionDataResolvedChannel =
| APIInteractionDataResolvedChannelBase<Exclude<ChannelType, ThreadChannelType>>
| (APIInteractionDataResolvedChannelBase<ThreadChannelType> &
Pick<APIThreadChannel, 'thread_metadata' | 'parent_id'>);
Pick<APIThreadChannel, 'parent_id' | 'thread_metadata'>);
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'deaf' | 'mute' | 'user'> {
permissions: Permissions;
}
@@ -188,8 +188,8 @@ export type APIChatInputApplicationCommandInteractionDataResolved = APIInteracti
/**
* `users` and optional `members` from APIInteractionDataResolved, for user commands and user selects
*/
export type APIUserInteractionDataResolved = Required<Pick<APIInteractionDataResolved, 'users'>> &
Pick<APIInteractionDataResolved, 'members'>;
export type APIUserInteractionDataResolved = Pick<APIInteractionDataResolved, 'members'> &
Required<Pick<APIInteractionDataResolved, 'users'>>;
/**
* @deprecated Renamed to `APIUserInteractionDataResolved`

View File

@@ -15,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
>
>;
@@ -26,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
>
>;
@@ -37,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
>
>;
@@ -76,7 +76,7 @@ export interface APIMessageRoleSelectInteractionData
export interface APIMessageMentionableSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.MentionableSelect> {
values: Snowflake[];
resolved: Pick<APIInteractionDataResolved, 'users' | 'members' | 'roles'>;
resolved: Pick<APIInteractionDataResolved, 'members' | 'roles' | 'users'>;
}
export interface APIMessageChannelSelectInteractionData
@@ -86,11 +86,11 @@ export interface APIMessageChannelSelectInteractionData
}
export type APIMessageSelectMenuInteractionData =
| APIMessageStringSelectInteractionData
| APIMessageUserSelectInteractionData
| APIMessageRoleSelectInteractionData
| APIMessageChannelSelectInteractionData
| APIMessageMentionableSelectInteractionData
| APIMessageChannelSelectInteractionData;
| APIMessageRoleSelectInteractionData
| APIMessageStringSelectInteractionData
| APIMessageUserSelectInteractionData;
export type APIMessageComponentDMInteraction = APIDMInteractionWrapper<APIMessageComponentInteraction>;

View File

@@ -18,12 +18,12 @@ export enum InteractionType {
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object
*/
export type APIInteractionResponse =
| APIInteractionResponsePong
| APIApplicationCommandAutocompleteResponse
| APIInteractionResponseChannelMessageWithSource
| APIInteractionResponseDeferredChannelMessageWithSource
| APIInteractionResponseDeferredMessageUpdate
| APIInteractionResponsePong
| APIInteractionResponseUpdateMessage
| APIApplicationCommandAutocompleteResponse
| APIModalInteractionResponse
| APIPremiumRequiredInteractionResponse;
@@ -107,7 +107,7 @@ export enum InteractionResponseType {
*/
export type APIInteractionResponseCallbackData = Omit<
RESTPostAPIWebhookWithTokenJSONBody,
'username' | 'avatar_url'
'avatar_url' | 'username'
> & { flags?: MessageFlags };
export interface APICommandAutocompleteInteractionResponseCallbackData {

View File

@@ -17,6 +17,7 @@ import type {
GuildDefaultMessageNotifications,
GuildExplicitContentFilter,
GuildMFALevel,
GuildSystemChannelFlags,
GuildVerificationLevel,
IntegrationExpireBehavior,
} from './guild.ts';
@@ -335,82 +336,83 @@ export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
*/
export type APIAuditLogChange =
| APIAuditLogChangeKeyName
| APIAuditLogChangeKeyDescription
| APIAuditLogChangeKeyIconHash
| APIAuditLogChangeKeyImageHash
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeyDiscoverySplashHash
| APIAuditLogChangeKeyBannerHash
| APIAuditLogChangeKeyOwnerId
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyPreferredLocale
| APIAuditLogChangeKeyAFKChannelId
| APIAuditLogChangeKeyAFKTimeout
| APIAuditLogChangeKeyRulesChannelId
| APIAuditLogChangeKeyPublicUpdatesChannelId
| APIAuditLogChangeKeyMFALevel
| APIAuditLogChangeKeyVerificationLevel
| APIAuditLogChangeKeyExplicitContentFilter
| APIAuditLogChangeKeyDefaultMessageNotifications
| APIAuditLogChangeKeyVanityURLCode
| APIAuditLogChangeKey$Add
| APIAuditLogChangeKey$Remove
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyWidgetEnabled
| APIAuditLogChangeKeyWidgetChannelId
| APIAuditLogChangeKeySystemChannelId
| APIAuditLogChangeKeyPosition
| APIAuditLogChangeKeyTopic
| APIAuditLogChangeKeyBitrate
| APIAuditLogChangeKeyPermissionOverwrites
| APIAuditLogChangeKeyNSFW
| APIAuditLogChangeKeyApplicationId
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyPermissions
| APIAuditLogChangeKeyColor
| APIAuditLogChangeKeyHoist
| APIAuditLogChangeKeyMentionable
| APIAuditLogChangeKeyActions
| APIAuditLogChangeKeyAFKChannelId
| APIAuditLogChangeKeyAFKTimeout
| APIAuditLogChangeKeyAllow
| APIAuditLogChangeKeyDeny
| APIAuditLogChangeKeyCode
| APIAuditLogChangeKeyChannelId
| APIAuditLogChangeKeyInviterId
| APIAuditLogChangeKeyMaxUses
| APIAuditLogChangeKeyUses
| APIAuditLogChangeKeyMaxAge
| APIAuditLogChangeKeyTemporary
| APIAuditLogChangeKeyDeaf
| APIAuditLogChangeKeyMute
| APIAuditLogChangeKeyNick
| APIAuditLogChangeKeyApplicationId
| APIAuditLogChangeKeyArchived
| APIAuditLogChangeKeyAsset
| APIAuditLogChangeKeyAutoArchiveDuration
| APIAuditLogChangeKeyAvailable
| APIAuditLogChangeKeyAvatarHash
| APIAuditLogChangeKeyId
| APIAuditLogChangeKeyType
| APIAuditLogChangeKeyBannerHash
| APIAuditLogChangeKeyBitrate
| APIAuditLogChangeKeyChannelId
| APIAuditLogChangeKeyCode
| APIAuditLogChangeKeyColor
| APIAuditLogChangeKeyCommunicationDisabledUntil
| APIAuditLogChangeKeyDeaf
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
| APIAuditLogChangeKeyDefaultMessageNotifications
| APIAuditLogChangeKeyDeny
| APIAuditLogChangeKeyDescription
| APIAuditLogChangeKeyDiscoverySplashHash
| APIAuditLogChangeKeyEnabled
| APIAuditLogChangeKeyEnableEmoticons
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyEventType
| APIAuditLogChangeKeyExemptChannels
| APIAuditLogChangeKeyExemptRoles
| APIAuditLogChangeKeyExpireBehavior
| APIAuditLogChangeKeyExpireGracePeriod
| APIAuditLogChangeKeyUserLimit
| APIAuditLogChangeKeyPrivacyLevel
| APIAuditLogChangeKeyTags
| APIAuditLogChangeKeyExplicitContentFilter
| APIAuditLogChangeKeyFormatType
| APIAuditLogChangeKeyAsset
| APIAuditLogChangeKeyAvailable
| APIAuditLogChangeKeyGuildId
| APIAuditLogChangeKeyArchived
| APIAuditLogChangeKeyLocked
| APIAuditLogChangeKeyAutoArchiveDuration
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeyHoist
| APIAuditLogChangeKeyIconHash
| APIAuditLogChangeKeyId
| APIAuditLogChangeKeyImageHash
| APIAuditLogChangeKeyInviterId
| APIAuditLogChangeKeyLocation
| APIAuditLogChangeKeyCommunicationDisabledUntil
| APIAuditLogChangeKeyTriggerType
| APIAuditLogChangeKeyEventType
| APIAuditLogChangeKeyLocked
| APIAuditLogChangeKeyMaxAge
| APIAuditLogChangeKeyMaxUses
| APIAuditLogChangeKeyMentionable
| APIAuditLogChangeKeyMFALevel
| APIAuditLogChangeKeyMute
| APIAuditLogChangeKeyName
| APIAuditLogChangeKeyNick
| APIAuditLogChangeKeyNSFW
| APIAuditLogChangeKeyOwnerId
| APIAuditLogChangeKeyPermissionOverwrites
| APIAuditLogChangeKeyPermissions
| APIAuditLogChangeKeyPosition
| APIAuditLogChangeKeyPreferredLocale
| APIAuditLogChangeKeyPrivacyLevel
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyPublicUpdatesChannelId
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyRulesChannelId
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeySystemChannelFlags
| APIAuditLogChangeKeySystemChannelId
| APIAuditLogChangeKeyTags
| APIAuditLogChangeKeyTemporary
| APIAuditLogChangeKeyTopic
| APIAuditLogChangeKeyTriggerMetadata
| APIAuditLogChangeKeyActions
| APIAuditLogChangeKeyEnabled
| APIAuditLogChangeKeyExemptRoles
| APIAuditLogChangeKeyExemptChannels;
| APIAuditLogChangeKeyTriggerType
| APIAuditLogChangeKeyType
| APIAuditLogChangeKeyUserLimit
| APIAuditLogChangeKeyUses
| APIAuditLogChangeKeyVanityURLCode
| APIAuditLogChangeKeyVerificationLevel
| APIAuditLogChangeKeyWidgetChannelId
| APIAuditLogChangeKeyWidgetEnabled;
/**
* Returned when an entity's name is changed
@@ -543,6 +545,14 @@ export type APIAuditLogChangeKeyWidgetEnabled = AuditLogChangeData<'widget_enabl
*/
export type APIAuditLogChangeKeyWidgetChannelId = AuditLogChangeData<'widget_channel_id', Snowflake>;
/**
* Returned when a guild's system_channel_flags is changed
*/
export type APIAuditLogChangeKeySystemChannelFlags = AuditLogChangeData<
'system_channel_flags',
GuildSystemChannelFlags
>;
/**
* Returned when a guild's system_channel_id is changed
*/

View File

@@ -41,15 +41,15 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
}
export type TextChannelType =
| ChannelType.AnnouncementThread
| ChannelType.DM
| ChannelType.GroupDM
| ChannelType.GuildAnnouncement
| ChannelType.PublicThread
| ChannelType.PrivateThread
| ChannelType.AnnouncementThread
| ChannelType.GuildStageVoice
| ChannelType.GuildText
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice;
| ChannelType.PrivateThread
| ChannelType.PublicThread;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
@@ -110,7 +110,7 @@ export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelB
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APIGuildTextChannel<T extends GuildTextChannelType | ChannelType.GuildForum | ChannelType.GuildMedia>
export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType>
extends Omit<APITextBasedChannel<T>, 'name'>,
APIGuildChannel<T> {
/**
@@ -134,7 +134,7 @@ export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
Omit<APITextBasedChannel<T>, 'last_pin_timestamp' | 'name'> {
/**
* The bitrate (in bits) of the voice or stage channel
*/
@@ -204,7 +204,7 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
managed?: boolean;
}
export type ThreadChannelType = ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread;
export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
export interface APIThreadChannel
extends Omit<APITextBasedChannel<ThreadChannelType>, 'name'>,
@@ -373,16 +373,16 @@ export type APIGuildMediaChannel = APIThreadOnlyChannel<ChannelType.GuildMedia>;
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
*/
export type APIChannel =
| APIGroupDMChannel
| APIDMChannel
| APITextChannel
| APINewsChannel
| APIGuildVoiceChannel
| APIGuildStageVoiceChannel
| APIGroupDMChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APIGuildForumChannel
| APIGuildMediaChannel;
| APIGuildMediaChannel
| APIGuildStageVoiceChannel
| APIGuildVoiceChannel
| APINewsChannel
| APITextChannel
| APIThreadChannel;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
@@ -607,7 +607,7 @@ export interface APIMessage {
* **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE`
* event to ensure it got sent**
*/
nonce?: string | number;
nonce?: number | string;
/**
* Whether this message is pinned
*/
@@ -900,19 +900,45 @@ export interface APIFollowedChannel {
*/
export interface APIReaction {
/**
* Times this emoji has been used to react
* Total number of times this emoji has been used to react (including super reacts)
*/
count: number;
/**
* An object detailing the individual reaction counts for different types of reactions
*/
count_details: APIReactionCountDetails;
/**
* Whether the current user reacted using this emoji
*/
me: boolean;
/**
* Whether the current user super-reacted using this emoji
*/
me_burst: boolean;
/**
* Emoji information
*
* See https://discord.com/developers/docs/resources/emoji#emoji-object
*/
emoji: APIPartialEmoji;
/**
* Hexadecimal colors used for this super reaction
*/
burst_colors: string[];
}
/**
* https://discord.com/developers/docs/resources/channel#reaction-count-details-object-reaction-count-details-structure
*/
export interface APIReactionCountDetails {
/**
* Count of super reactions
*/
burst: number;
/**
* Count of normal reactions
*/
normal: number;
}
/**
@@ -1568,7 +1594,7 @@ export interface APIMessageComponentEmoji {
export interface APIButtonComponentWithCustomId
extends APIButtonComponentBase<
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success
> {
/**
* The custom_id to be sent in the interaction when clicked
@@ -1609,11 +1635,11 @@ export enum TextInputStyle {
*/
export interface APIBaseSelectMenuComponent<
T extends
| ComponentType.StringSelect
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.ChannelSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect,
| ComponentType.RoleSelect
| ComponentType.StringSelect
| ComponentType.UserSelect,
> extends APIBaseComponent<T> {
/**
* A developer-defined identifier for the select menu, max 100 characters
@@ -1645,10 +1671,10 @@ export interface APIBaseSelectMenuComponent<
export interface APIBaseAutoPopulatedSelectMenuComponent<
T extends
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.ChannelSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect,
| ComponentType.RoleSelect
| ComponentType.UserSelect,
D extends SelectMenuDefaultValueType,
> extends APIBaseSelectMenuComponent<T> {
/**
@@ -1688,7 +1714,7 @@ export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
*/
export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.MentionableSelect,
SelectMenuDefaultValueType.User | SelectMenuDefaultValueType.Role
SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User
>;
/**
@@ -1729,18 +1755,18 @@ export type APIAutoPopulatedSelectMenuComponent =
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APISelectMenuComponent =
| APIStringSelectComponent
| APIUserSelectComponent
| APIRoleSelectComponent
| APIChannelSelectComponent
| APIMentionableSelectComponent
| APIChannelSelectComponent;
| APIRoleSelectComponent
| APIStringSelectComponent
| APIUserSelectComponent;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
*/
export interface APISelectMenuOption {
/**
* The user-facing name of the option (max 25 chars)
* The user-facing name of the option (max 100 chars)
*/
label: string;
/**
@@ -1748,7 +1774,7 @@ export interface APISelectMenuOption {
*/
value: string;
/**
* An additional description of the option (max 50 chars)
* An additional description of the option (max 100 chars)
*/
description?: string;
/**
@@ -1845,8 +1871,8 @@ export enum ChannelFlags {
/**
* https://discord.com/developers/docs/interactions/message-components#message-components
*/
export type APIMessageComponent = APIMessageActionRowComponent | APIActionRowComponent<APIMessageActionRowComponent>;
export type APIModalComponent = APIModalActionRowComponent | APIActionRowComponent<APIModalActionRowComponent>;
export type APIMessageComponent = APIActionRowComponent<APIMessageActionRowComponent> | APIMessageActionRowComponent;
export type APIModalComponent = APIActionRowComponent<APIModalActionRowComponent> | APIModalActionRowComponent;
export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent;

View File

@@ -227,7 +227,7 @@ export interface GatewayActivity {
/**
* The custom buttons shown in the Rich Presence (max 2)
*/
buttons?: string[] | GatewayActivityButton[];
buttons?: GatewayActivityButton[] | string[];
}
/**
@@ -292,7 +292,7 @@ export interface GatewayActivityTimestamps {
/**
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji
*/
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'id' | 'animated'>> & Pick<APIEmoji, 'name'>;
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'animated' | 'id'>> & Pick<APIEmoji, 'name'>;
/**
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
@@ -318,7 +318,7 @@ export type GatewayActivityAssets = Partial<
/**
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets
*/
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
export type GatewayActivitySecrets = Partial<Record<'join' | 'match' | 'spectate', string>>;
/**
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags

View File

@@ -121,7 +121,7 @@ export interface APIGuild extends APIPartialGuild {
/**
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout: 60 | 300 | 900 | 1_800 | 3_600;
afk_timeout: 1_800 | 3_600 | 60 | 300 | 900;
/**
* `true` if the guild widget is enabled
*/
@@ -806,7 +806,7 @@ export interface APIGuildIntegration {
scopes?: OAuth2Scopes[];
}
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription';
export type APIGuildIntegrationType = 'discord' | 'guild_subscription' | 'twitch' | 'youtube';
/**
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors

View File

@@ -90,9 +90,9 @@ export interface APIExternalGuildScheduledEvent
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
*/
export type APIGuildScheduledEvent =
| APIExternalGuildScheduledEvent
| APIStageInstanceGuildScheduledEvent
| APIVoiceGuildScheduledEvent
| APIExternalGuildScheduledEvent;
| APIVoiceGuildScheduledEvent;
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata

View File

@@ -32,26 +32,26 @@ export * from './_interactions/responses.ts';
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIInteraction =
| APIPingInteraction
| APIApplicationCommandAutocompleteInteraction
| APIApplicationCommandInteraction
| APIMessageComponentInteraction
| APIApplicationCommandAutocompleteInteraction
| APIModalSubmitInteraction;
| APIModalSubmitInteraction
| APIPingInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIDMInteraction =
| APIApplicationCommandAutocompleteDMInteraction
| APIApplicationCommandDMInteraction
| APIMessageComponentDMInteraction
| APIApplicationCommandAutocompleteDMInteraction
| APIModalSubmitDMInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIGuildInteraction =
| APIApplicationCommandAutocompleteGuildInteraction
| APIApplicationCommandGuildInteraction
| APIMessageComponentGuildInteraction
| APIApplicationCommandAutocompleteGuildInteraction
| APIModalSubmitGuildInteraction;

View File

@@ -11,17 +11,17 @@ import type { APIUser } from './user.ts';
export type APIInviteGuild = Pick<
APIGuild,
| 'id'
| 'name'
| 'splash'
| 'banner'
| 'icon'
| 'vanity_url_code'
| 'description'
| 'features'
| 'verification_level'
| 'icon'
| 'id'
| 'name'
| 'nsfw_level'
| 'premium_subscription_count'
| 'splash'
| 'vanity_url_code'
| 'verification_level'
>;
/**

View File

@@ -92,7 +92,7 @@ export enum StickerFormatType {
/**
* https://discord.com/developers/docs/resources/sticker#sticker-item-object
*/
export type APIStickerItem = Pick<APISticker, 'id' | 'name' | 'format_type'>;
export type APIStickerItem = Pick<APISticker, 'format_type' | 'id' | 'name'>;
/**
* https://discord.com/developers/docs/resources/sticker#sticker-pack-object

View File

@@ -316,5 +316,5 @@ export interface APIApplicationRoleConnection {
/**
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
*/
metadata: Record<string, string | number>;
metadata: Record<string, number | string>;
}

View File

@@ -176,56 +176,56 @@ export enum AuditLogOptionsType {
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export type APIAuditLogChange =
| APIAuditLogChangeKeyName
| APIAuditLogChangeKeyIconHash
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeyOwnerID
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyAFKChannelID
| APIAuditLogChangeKeyAFKTimeout
| APIAuditLogChangeKeyMFALevel
| APIAuditLogChangeKeyVerificationLevel
| APIAuditLogChangeKeyExplicitContentFilter
| APIAuditLogChangeKeyDefaultMessageNotifications
| APIAuditLogChangeKeyVanityURLCode
| APIAuditLogChangeKey$Add
| APIAuditLogChangeKey$Remove
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyWidgetEnabled
| APIAuditLogChangeKeyWidgetChannelID
| APIAuditLogChangeKeySystemChannelID
| APIAuditLogChangeKeyPosition
| APIAuditLogChangeKeyTopic
| APIAuditLogChangeKeyBitrate
| APIAuditLogChangeKeyPermissionOverwrites
| APIAuditLogChangeKeyNSFW
| APIAuditLogChangeKeyApplicationID
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyPermissions
| APIAuditLogChangeKeyPermissionsNew
| APIAuditLogChangeKeyColor
| APIAuditLogChangeKeyHoist
| APIAuditLogChangeKeyMentionable
| APIAuditLogChangeKeyAFKChannelID
| APIAuditLogChangeKeyAFKTimeout
| APIAuditLogChangeKeyAllow
| APIAuditLogChangeKeyAllowNew
| APIAuditLogChangeKeyApplicationID
| APIAuditLogChangeKeyAvatarHash
| APIAuditLogChangeKeyBitrate
| APIAuditLogChangeKeyChannelID
| APIAuditLogChangeKeyCode
| APIAuditLogChangeKeyColor
| APIAuditLogChangeKeyDeaf
| APIAuditLogChangeKeyDefaultMessageNotifications
| APIAuditLogChangeKeyDeny
| APIAuditLogChangeKeyDenyNew
| APIAuditLogChangeKeyCode
| APIAuditLogChangeKeyChannelID
| APIAuditLogChangeKeyInviterID
| APIAuditLogChangeKeyMaxUses
| APIAuditLogChangeKeyUses
| APIAuditLogChangeKeyMaxAge
| APIAuditLogChangeKeyTemporary
| APIAuditLogChangeKeyDeaf
| APIAuditLogChangeKeyMute
| APIAuditLogChangeKeyNick
| APIAuditLogChangeKeyAvatarHash
| APIAuditLogChangeKeyID
| APIAuditLogChangeKeyType
| APIAuditLogChangeKeyEnableEmoticons
| APIAuditLogChangeKeyExpireBehavior
| APIAuditLogChangeKeyExpireGracePeriod;
| APIAuditLogChangeKeyExpireGracePeriod
| APIAuditLogChangeKeyExplicitContentFilter
| APIAuditLogChangeKeyHoist
| APIAuditLogChangeKeyIconHash
| APIAuditLogChangeKeyID
| APIAuditLogChangeKeyInviterID
| APIAuditLogChangeKeyMaxAge
| APIAuditLogChangeKeyMaxUses
| APIAuditLogChangeKeyMentionable
| APIAuditLogChangeKeyMFALevel
| APIAuditLogChangeKeyMute
| APIAuditLogChangeKeyName
| APIAuditLogChangeKeyNick
| APIAuditLogChangeKeyNSFW
| APIAuditLogChangeKeyOwnerID
| APIAuditLogChangeKeyPermissionOverwrites
| APIAuditLogChangeKeyPermissions
| APIAuditLogChangeKeyPermissionsNew
| APIAuditLogChangeKeyPosition
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeySystemChannelID
| APIAuditLogChangeKeyTemporary
| APIAuditLogChangeKeyTopic
| APIAuditLogChangeKeyType
| APIAuditLogChangeKeyUses
| APIAuditLogChangeKeyVanityURLCode
| APIAuditLogChangeKeyVerificationLevel
| APIAuditLogChangeKeyWidgetChannelID
| APIAuditLogChangeKeyWidgetEnabled;
/**
* Returned when a guild's name is changed

View File

@@ -78,7 +78,7 @@ export interface APIMessage {
attachments: APIAttachment[];
embeds: APIEmbed[];
reactions?: APIReaction[];
nonce?: string | number;
nonce?: number | string;
pinned: boolean;
webhook_id?: string;
type: MessageType;

View File

@@ -123,7 +123,7 @@ export interface GatewayActivityTimestamps {
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'name' | 'animated'>> & Pick<APIEmoji, 'id'>;
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'animated' | 'name'>> & Pick<APIEmoji, 'id'>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
@@ -149,7 +149,7 @@ export type GatewayActivityAssets = Partial<
*
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
*/
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
export type GatewayActivitySecrets = Partial<Record<'join' | 'match' | 'spectate', string>>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags

View File

@@ -22,7 +22,7 @@ export enum ApplicationCommandOptionType {
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIApplicationCommandOptionChoice<ValueType = string | number> {
export interface APIApplicationCommandOptionChoice<ValueType = number | string> {
name: string;
value: ValueType;
}

View File

@@ -72,15 +72,15 @@ export * from './_chatInput/user.ts';
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandBasicOption =
| APIApplicationCommandStringOption
| APIApplicationCommandIntegerOption
| APIApplicationCommandAttachmentOption
| APIApplicationCommandBooleanOption
| APIApplicationCommandUserOption
| APIApplicationCommandChannelOption
| APIApplicationCommandRoleOption
| APIApplicationCommandIntegerOption
| APIApplicationCommandMentionableOption
| APIApplicationCommandNumberOption
| APIApplicationCommandAttachmentOption;
| APIApplicationCommandRoleOption
| APIApplicationCommandStringOption
| APIApplicationCommandUserOption;
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
@@ -88,9 +88,9 @@ export type APIApplicationCommandBasicOption =
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandOption =
| APIApplicationCommandSubcommandOption
| APIApplicationCommandBasicOption
| APIApplicationCommandSubcommandGroupOption
| APIApplicationCommandBasicOption;
| APIApplicationCommandSubcommandOption;
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure
@@ -98,23 +98,23 @@ export type APIApplicationCommandOption =
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandInteractionDataOption =
| APIApplicationCommandInteractionDataSubcommandOption
| APIApplicationCommandInteractionDataBasicOption
| APIApplicationCommandInteractionDataSubcommandGroupOption
| APIApplicationCommandInteractionDataBasicOption;
| APIApplicationCommandInteractionDataSubcommandOption;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataStringOption
| APIApplicationCommandInteractionDataIntegerOption
| APIApplicationCommandInteractionDataAttachmentOption
| APIApplicationCommandInteractionDataBooleanOption
| APIApplicationCommandInteractionDataUserOption
| APIApplicationCommandInteractionDataChannelOption
| APIApplicationCommandInteractionDataRoleOption
| APIApplicationCommandInteractionDataIntegerOption
| APIApplicationCommandInteractionDataMentionableOption
| APIApplicationCommandInteractionDataNumberOption
| APIApplicationCommandInteractionDataAttachmentOption;
| APIApplicationCommandInteractionDataRoleOption
| APIApplicationCommandInteractionDataStringOption
| APIApplicationCommandInteractionDataUserOption;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data-structure

View File

@@ -56,8 +56,8 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIContextMenuInteractionData =
| APIUserApplicationCommandInteractionData
| APIMessageApplicationCommandInteractionData;
| APIMessageApplicationCommandInteractionData
| APIUserApplicationCommandInteractionData;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
@@ -111,7 +111,7 @@ export type APIMessageApplicationCommandGuildInteraction =
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIContextMenuInteraction = APIUserApplicationCommandInteraction | APIMessageApplicationCommandInteraction;
export type APIContextMenuInteraction = APIMessageApplicationCommandInteraction | APIUserApplicationCommandInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
@@ -119,8 +119,8 @@ export type APIContextMenuInteraction = APIUserApplicationCommandInteraction | A
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIContextMenuDMInteraction =
| APIUserApplicationCommandDMInteraction
| APIMessageApplicationCommandDMInteraction;
| APIMessageApplicationCommandDMInteraction
| APIUserApplicationCommandDMInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
@@ -128,5 +128,5 @@ export type APIContextMenuDMInteraction =
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIContextMenuGuildInteraction =
| APIUserApplicationCommandGuildInteraction
| APIMessageApplicationCommandGuildInteraction;
| APIMessageApplicationCommandGuildInteraction
| APIUserApplicationCommandGuildInteraction;

View File

@@ -101,7 +101,7 @@ export interface APIInteractionDataResolvedChannel extends Required<APIPartialCh
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'deaf' | 'mute' | 'user'> {
permissions: Permissions;
}

View File

@@ -10,15 +10,15 @@ import type { InteractionType } from './responses.ts';
*/
export type PartialAPIMessageInteractionGuildMember = Pick<
APIGuildMember,
| 'roles'
| 'premium_since'
| 'pending'
| 'nick'
| 'mute'
| 'joined_at'
| 'deaf'
| 'communication_disabled_until'
| 'avatar'
| 'communication_disabled_until'
| 'deaf'
| 'joined_at'
| 'mute'
| 'nick'
| 'pending'
| 'premium_since'
| 'roles'
>;
/**
@@ -128,7 +128,7 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
*/
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
Original,
'member' | 'guild_id'
'guild_id' | 'member'
> &
Required<Pick<Original, 'user'>>;
@@ -139,4 +139,4 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
Original,
'user'
> &
Required<Pick<Original, 'member' | 'guild_id'>>;
Required<Pick<Original, 'guild_id' | 'member'>>;

View File

@@ -22,12 +22,12 @@ export enum InteractionType {
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIInteractionResponse =
| APIInteractionResponsePong
| APIApplicationCommandAutocompleteResponse
| APIInteractionResponseChannelMessageWithSource
| APIInteractionResponseDeferredChannelMessageWithSource
| APIInteractionResponseDeferredMessageUpdate
| APIInteractionResponsePong
| APIInteractionResponseUpdateMessage
| APIApplicationCommandAutocompleteResponse
| APIModalInteractionResponse;
/**
@@ -127,7 +127,7 @@ export enum InteractionResponseType {
*/
export type APIInteractionResponseCallbackData = Omit<
RESTPostAPIWebhookWithTokenJSONBody,
'username' | 'avatar_url'
'avatar_url' | 'username'
> & { flags?: MessageFlags };
/**

View File

@@ -271,70 +271,70 @@ export enum AuditLogOptionsType {
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIAuditLogChange =
| APIAuditLogChangeKeyName
| APIAuditLogChangeKeyDescription
| APIAuditLogChangeKeyIconHash
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeyDiscoverySplashHash
| APIAuditLogChangeKeyBannerHash
| APIAuditLogChangeKeyOwnerId
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyPreferredLocale
| APIAuditLogChangeKeyAFKChannelId
| APIAuditLogChangeKeyAFKTimeout
| APIAuditLogChangeKeyRulesChannelId
| APIAuditLogChangeKeyPublicUpdatesChannelId
| APIAuditLogChangeKeyMFALevel
| APIAuditLogChangeKeyVerificationLevel
| APIAuditLogChangeKeyExplicitContentFilter
| APIAuditLogChangeKeyDefaultMessageNotifications
| APIAuditLogChangeKeyVanityURLCode
| APIAuditLogChangeKey$Add
| APIAuditLogChangeKey$Remove
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyWidgetEnabled
| APIAuditLogChangeKeyWidgetChannelId
| APIAuditLogChangeKeySystemChannelId
| APIAuditLogChangeKeyPosition
| APIAuditLogChangeKeyTopic
| APIAuditLogChangeKeyBitrate
| APIAuditLogChangeKeyPermissionOverwrites
| APIAuditLogChangeKeyNSFW
| APIAuditLogChangeKeyApplicationId
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyPermissions
| APIAuditLogChangeKeyColor
| APIAuditLogChangeKeyHoist
| APIAuditLogChangeKeyMentionable
| APIAuditLogChangeKeyAFKChannelId
| APIAuditLogChangeKeyAFKTimeout
| APIAuditLogChangeKeyAllow
| APIAuditLogChangeKeyDeny
| APIAuditLogChangeKeyCode
| APIAuditLogChangeKeyChannelId
| APIAuditLogChangeKeyInviterId
| APIAuditLogChangeKeyMaxUses
| APIAuditLogChangeKeyUses
| APIAuditLogChangeKeyMaxAge
| APIAuditLogChangeKeyTemporary
| APIAuditLogChangeKeyDeaf
| APIAuditLogChangeKeyMute
| APIAuditLogChangeKeyNick
| APIAuditLogChangeKeyAvatarHash
| APIAuditLogChangeKeyId
| APIAuditLogChangeKeyType
| APIAuditLogChangeKeyEnableEmoticons
| APIAuditLogChangeKeyExpireBehavior
| APIAuditLogChangeKeyExpireGracePeriod
| APIAuditLogChangeKeyUserLimit
| APIAuditLogChangeKeyPrivacyLevel
| APIAuditLogChangeKeyTags
| APIAuditLogChangeKeyFormatType
| APIAuditLogChangeKeyApplicationId
| APIAuditLogChangeKeyAsset
| APIAuditLogChangeKeyAvailable
| APIAuditLogChangeKeyGuildId
| APIAuditLogChangeKeyAvatarHash
| APIAuditLogChangeKeyBannerHash
| APIAuditLogChangeKeyBitrate
| APIAuditLogChangeKeyChannelId
| APIAuditLogChangeKeyCode
| APIAuditLogChangeKeyColor
| APIAuditLogChangeKeyCommunicationDisabledUntil
| APIAuditLogChangeKeyDeaf
| APIAuditLogChangeKeyDefaultMessageNotifications
| APIAuditLogChangeKeyDeny
| APIAuditLogChangeKeyDescription
| APIAuditLogChangeKeyDiscoverySplashHash
| APIAuditLogChangeKeyEnableEmoticons
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeyExpireBehavior
| APIAuditLogChangeKeyExpireGracePeriod
| APIAuditLogChangeKeyExplicitContentFilter
| APIAuditLogChangeKeyFormatType
| APIAuditLogChangeKeyGuildId
| APIAuditLogChangeKeyHoist
| APIAuditLogChangeKeyIconHash
| APIAuditLogChangeKeyId
| APIAuditLogChangeKeyInviterId
| APIAuditLogChangeKeyLocation
| APIAuditLogChangeKeyCommunicationDisabledUntil;
| APIAuditLogChangeKeyMaxAge
| APIAuditLogChangeKeyMaxUses
| APIAuditLogChangeKeyMentionable
| APIAuditLogChangeKeyMFALevel
| APIAuditLogChangeKeyMute
| APIAuditLogChangeKeyName
| APIAuditLogChangeKeyNick
| APIAuditLogChangeKeyNSFW
| APIAuditLogChangeKeyOwnerId
| APIAuditLogChangeKeyPermissionOverwrites
| APIAuditLogChangeKeyPermissions
| APIAuditLogChangeKeyPosition
| APIAuditLogChangeKeyPreferredLocale
| APIAuditLogChangeKeyPrivacyLevel
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyPublicUpdatesChannelId
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyRulesChannelId
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeySystemChannelId
| APIAuditLogChangeKeyTags
| APIAuditLogChangeKeyTemporary
| APIAuditLogChangeKeyTopic
| APIAuditLogChangeKeyType
| APIAuditLogChangeKeyUserLimit
| APIAuditLogChangeKeyUses
| APIAuditLogChangeKeyVanityURLCode
| APIAuditLogChangeKeyVerificationLevel
| APIAuditLogChangeKeyWidgetChannelId
| APIAuditLogChangeKeyWidgetEnabled;
/**
* Returned when an entity's name is changed

View File

@@ -53,11 +53,11 @@ export type TextChannelType = ChannelType.DM | ChannelType.GroupDM | ChannelType
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GuildChannelType = Exclude<
| TextChannelType
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice
| ChannelType.GuildNews
| ChannelType.GuildStore,
| ChannelType.GuildStageVoice
| ChannelType.GuildStore
| ChannelType.GuildVoice
| TextChannelType,
ChannelType.DM | ChannelType.GroupDM
>;
@@ -218,14 +218,14 @@ export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM>
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIChannel =
| APIGroupDMChannel
| APIDMChannel
| APITextChannel
| APINewsChannel
| APIGuildStoreChannel
| APIVoiceChannel
| APIGroupDMChannel
| APIGuildCategoryChannel
| APINewsChannel;
| APIGuildStoreChannel
| APINewsChannel
| APINewsChannel
| APITextChannel
| APIVoiceChannel;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
@@ -397,7 +397,7 @@ export interface APIMessage {
* **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE`
* event to ensure it got sent**
*/
nonce?: string | number;
nonce?: number | string;
/**
* Whether this message is pinned
*/
@@ -1170,7 +1170,7 @@ export interface APIMessageComponentEmoji {
*/
export interface APIButtonComponentWithCustomId
extends APIButtonComponentBase<
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success
> {
/**
* The custom_id to be sent in the interaction when clicked
@@ -1327,11 +1327,11 @@ export interface APITextInputComponent extends APIBaseComponent<ComponentType.Te
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIMessageComponent = APIMessageActionRowComponent | APIActionRowComponent<APIMessageActionRowComponent>;
export type APIMessageComponent = APIActionRowComponent<APIMessageActionRowComponent> | APIMessageActionRowComponent;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIModalComponent = APIModalActionRowComponent | APIActionRowComponent<APIModalActionRowComponent>;
export type APIModalComponent = APIActionRowComponent<APIModalActionRowComponent> | APIModalActionRowComponent;
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.

View File

@@ -219,7 +219,7 @@ export interface GatewayActivity {
/**
* The custom buttons shown in the Rich Presence (max 2)
*/
buttons?: string[] | GatewayActivityButton[];
buttons?: GatewayActivityButton[] | string[];
}
/**
@@ -284,7 +284,7 @@ export interface GatewayActivityTimestamps {
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'id' | 'animated'>> & Pick<APIEmoji, 'name'>;
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'animated' | 'id'>> & Pick<APIEmoji, 'name'>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
@@ -316,7 +316,7 @@ export type GatewayActivityAssets = Partial<
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
export type GatewayActivitySecrets = Partial<Record<'join' | 'match' | 'spectate', string>>;
/**
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags

View File

@@ -790,7 +790,7 @@ export interface APIGuildIntegration {
/**
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIGuildInteractionType = 'twitch' | 'youtube' | 'discord';
export type APIGuildInteractionType = 'discord' | 'twitch' | 'youtube';
/**
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors

View File

@@ -104,9 +104,9 @@ export interface APIExternalGuildScheduledEvent
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIGuildScheduledEvent =
| APIExternalGuildScheduledEvent
| APIStageInstanceGuildScheduledEvent
| APIVoiceGuildScheduledEvent
| APIExternalGuildScheduledEvent;
| APIVoiceGuildScheduledEvent;
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata

View File

@@ -34,11 +34,11 @@ export * from './_interactions/responses.ts';
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIInteraction =
| APIPingInteraction
| APIApplicationCommandAutocompleteInteraction
| APIApplicationCommandInteraction
| APIMessageComponentInteraction
| APIApplicationCommandAutocompleteInteraction
| APIModalSubmitInteraction;
| APIModalSubmitInteraction
| APIPingInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
@@ -46,9 +46,9 @@ export type APIInteraction =
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIDMInteraction =
| APIApplicationCommandAutocompleteDMInteraction
| APIApplicationCommandDMInteraction
| APIMessageComponentDMInteraction
| APIApplicationCommandAutocompleteDMInteraction
| APIModalSubmitDMInteraction;
/**
@@ -57,7 +57,7 @@ export type APIDMInteraction =
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIGuildInteraction =
| APIApplicationCommandAutocompleteGuildInteraction
| APIApplicationCommandGuildInteraction
| APIMessageComponentGuildInteraction
| APIApplicationCommandAutocompleteGuildInteraction
| APIModalSubmitGuildInteraction;

View File

@@ -11,17 +11,17 @@ import type { APIUser } from './user.ts';
export type APIInviteGuild = Pick<
APIGuild,
| 'id'
| 'name'
| 'splash'
| 'banner'
| 'icon'
| 'vanity_url_code'
| 'description'
| 'features'
| 'verification_level'
| 'icon'
| 'id'
| 'name'
| 'nsfw_level'
| 'premium_subscription_count'
| 'splash'
| 'vanity_url_code'
| 'verification_level'
>;
/**

View File

@@ -99,7 +99,7 @@ export enum StickerFormatType {
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIStickerItem = Pick<APISticker, 'id' | 'name' | 'format_type'>;
export type APIStickerItem = Pick<APISticker, 'format_type' | 'id' | 'name'>;
/**
* https://discord.com/developers/docs/resources/sticker#sticker-pack-object

View File

@@ -20,7 +20,7 @@ export enum ApplicationCommandOptionType {
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure
*/
export interface APIApplicationCommandOptionChoice<ValueType = string | number> {
export interface APIApplicationCommandOptionChoice<ValueType = number | string> {
name: string;
name_localizations?: LocalizationMap | null;
value: ValueType;

View File

@@ -65,42 +65,42 @@ export * from './_chatInput/user.ts';
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
*/
export type APIApplicationCommandBasicOption =
| APIApplicationCommandStringOption
| APIApplicationCommandIntegerOption
| APIApplicationCommandAttachmentOption
| APIApplicationCommandBooleanOption
| APIApplicationCommandUserOption
| APIApplicationCommandChannelOption
| APIApplicationCommandRoleOption
| APIApplicationCommandIntegerOption
| APIApplicationCommandMentionableOption
| APIApplicationCommandNumberOption
| APIApplicationCommandAttachmentOption;
| APIApplicationCommandRoleOption
| APIApplicationCommandStringOption
| APIApplicationCommandUserOption;
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
*/
export type APIApplicationCommandOption =
| APIApplicationCommandSubcommandOption
| APIApplicationCommandBasicOption
| APIApplicationCommandSubcommandGroupOption
| APIApplicationCommandBasicOption;
| APIApplicationCommandSubcommandOption;
/**
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure
*/
export type APIApplicationCommandInteractionDataOption =
| APIApplicationCommandInteractionDataSubcommandOption
| APIApplicationCommandInteractionDataBasicOption
| APIApplicationCommandInteractionDataSubcommandGroupOption
| APIApplicationCommandInteractionDataBasicOption;
| APIApplicationCommandInteractionDataSubcommandOption;
export type APIApplicationCommandInteractionDataBasicOption =
| APIApplicationCommandInteractionDataStringOption
| APIApplicationCommandInteractionDataIntegerOption
| APIApplicationCommandInteractionDataAttachmentOption
| APIApplicationCommandInteractionDataBooleanOption
| APIApplicationCommandInteractionDataUserOption
| APIApplicationCommandInteractionDataChannelOption
| APIApplicationCommandInteractionDataRoleOption
| APIApplicationCommandInteractionDataIntegerOption
| APIApplicationCommandInteractionDataMentionableOption
| APIApplicationCommandInteractionDataNumberOption
| APIApplicationCommandInteractionDataAttachmentOption;
| APIApplicationCommandInteractionDataRoleOption
| APIApplicationCommandInteractionDataStringOption
| APIApplicationCommandInteractionDataUserOption;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data

View File

@@ -33,8 +33,8 @@ export interface APIMessageApplicationCommandInteractionDataResolved {
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
*/
export type APIContextMenuInteractionData =
| APIUserApplicationCommandInteractionData
| APIMessageApplicationCommandInteractionData;
| APIMessageApplicationCommandInteractionData
| APIUserApplicationCommandInteractionData;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
@@ -74,18 +74,18 @@ export type APIMessageApplicationCommandGuildInteraction =
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIContextMenuInteraction = APIUserApplicationCommandInteraction | APIMessageApplicationCommandInteraction;
export type APIContextMenuInteraction = APIMessageApplicationCommandInteraction | APIUserApplicationCommandInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIContextMenuDMInteraction =
| APIUserApplicationCommandDMInteraction
| APIMessageApplicationCommandDMInteraction;
| APIMessageApplicationCommandDMInteraction
| APIUserApplicationCommandDMInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIContextMenuGuildInteraction =
| APIUserApplicationCommandGuildInteraction
| APIMessageApplicationCommandGuildInteraction;
| APIMessageApplicationCommandGuildInteraction
| APIUserApplicationCommandGuildInteraction;

View File

@@ -54,6 +54,6 @@ export enum ApplicationCommandPermissionType {
*/
export const APIApplicationCommandPermissionsConstant = {
// eslint-disable-next-line unicorn/prefer-native-coercion-functions
Everyone: (guildId: string | bigint): Snowflake => String(guildId),
AllChannels: (guildId: string | bigint): Snowflake => String(BigInt(guildId) - 1n),
Everyone: (guildId: bigint | string): Snowflake => String(guildId),
AllChannels: (guildId: bigint | string): Snowflake => String(BigInt(guildId) - 1n),
};

View File

@@ -118,7 +118,7 @@ export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationC
Required<
Pick<
APIBaseInteraction<InteractionType.ApplicationCommand, Data>,
'channel' | 'channel_id' | 'data' | 'app_permissions'
'app_permissions' | 'channel_id' | 'channel' | 'data'
>
>;

View File

@@ -16,15 +16,15 @@ import type { InteractionType } from './responses.ts';
export type PartialAPIMessageInteractionGuildMember = Pick<
APIGuildMember,
| 'roles'
| 'premium_since'
| 'pending'
| 'nick'
| 'mute'
| 'joined_at'
| 'deaf'
| 'communication_disabled_until'
| 'avatar'
| 'communication_disabled_until'
| 'deaf'
| 'joined_at'
| 'mute'
| 'nick'
| 'pending'
| 'premium_since'
| 'roles'
>;
/**
@@ -139,7 +139,7 @@ export interface APIBaseInteraction<Type extends InteractionType, Data> {
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
Original,
'member' | 'guild_id'
'guild_id' | 'member'
> &
Required<Pick<Original, 'user'>>;
@@ -147,7 +147,7 @@ export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<Inter
Original,
'user'
> &
Required<Pick<Original, 'member' | 'guild_id'>>;
Required<Pick<Original, 'guild_id' | 'member'>>;
export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> extends Required<APIPartialChannel> {
type: T;
@@ -160,12 +160,12 @@ export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> ex
export type APIInteractionDataResolvedChannel =
| APIInteractionDataResolvedChannelBase<Exclude<ChannelType, ThreadChannelType>>
| (APIInteractionDataResolvedChannelBase<ThreadChannelType> &
Pick<APIThreadChannel, 'thread_metadata' | 'parent_id'>);
Pick<APIThreadChannel, 'parent_id' | 'thread_metadata'>);
/**
* https://discord.com/developers/docs/resources/guild#guild-member-object
*/
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'deaf' | 'mute' | 'user'> {
permissions: Permissions;
}
@@ -188,8 +188,8 @@ export type APIChatInputApplicationCommandInteractionDataResolved = APIInteracti
/**
* `users` and optional `members` from APIInteractionDataResolved, for user commands and user selects
*/
export type APIUserInteractionDataResolved = Required<Pick<APIInteractionDataResolved, 'users'>> &
Pick<APIInteractionDataResolved, 'members'>;
export type APIUserInteractionDataResolved = Pick<APIInteractionDataResolved, 'members'> &
Required<Pick<APIInteractionDataResolved, 'users'>>;
/**
* @deprecated Renamed to `APIUserInteractionDataResolved`

View File

@@ -15,7 +15,7 @@ export type APIMessageComponentInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
>
>;
@@ -26,7 +26,7 @@ export type APIMessageComponentButtonInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
>
>;
@@ -37,7 +37,7 @@ export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
Required<
Pick<
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
'channel' | 'channel_id' | 'data' | 'app_permissions' | 'message'
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
>
>;
@@ -76,7 +76,7 @@ export interface APIMessageRoleSelectInteractionData
export interface APIMessageMentionableSelectInteractionData
extends APIMessageComponentBaseInteractionData<ComponentType.MentionableSelect> {
values: Snowflake[];
resolved: Pick<APIInteractionDataResolved, 'users' | 'members' | 'roles'>;
resolved: Pick<APIInteractionDataResolved, 'members' | 'roles' | 'users'>;
}
export interface APIMessageChannelSelectInteractionData
@@ -86,11 +86,11 @@ export interface APIMessageChannelSelectInteractionData
}
export type APIMessageSelectMenuInteractionData =
| APIMessageStringSelectInteractionData
| APIMessageUserSelectInteractionData
| APIMessageRoleSelectInteractionData
| APIMessageChannelSelectInteractionData
| APIMessageMentionableSelectInteractionData
| APIMessageChannelSelectInteractionData;
| APIMessageRoleSelectInteractionData
| APIMessageStringSelectInteractionData
| APIMessageUserSelectInteractionData;
export type APIMessageComponentDMInteraction = APIDMInteractionWrapper<APIMessageComponentInteraction>;

View File

@@ -18,12 +18,12 @@ export enum InteractionType {
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object
*/
export type APIInteractionResponse =
| APIInteractionResponsePong
| APIApplicationCommandAutocompleteResponse
| APIInteractionResponseChannelMessageWithSource
| APIInteractionResponseDeferredChannelMessageWithSource
| APIInteractionResponseDeferredMessageUpdate
| APIInteractionResponsePong
| APIInteractionResponseUpdateMessage
| APIApplicationCommandAutocompleteResponse
| APIModalInteractionResponse
| APIPremiumRequiredInteractionResponse;
@@ -107,7 +107,7 @@ export enum InteractionResponseType {
*/
export type APIInteractionResponseCallbackData = Omit<
RESTPostAPIWebhookWithTokenJSONBody,
'username' | 'avatar_url'
'avatar_url' | 'username'
> & { flags?: MessageFlags };
export interface APICommandAutocompleteInteractionResponseCallbackData {

View File

@@ -17,6 +17,7 @@ import type {
GuildDefaultMessageNotifications,
GuildExplicitContentFilter,
GuildMFALevel,
GuildSystemChannelFlags,
GuildVerificationLevel,
IntegrationExpireBehavior,
} from './guild.ts';
@@ -335,82 +336,83 @@ export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
*/
export type APIAuditLogChange =
| APIAuditLogChangeKeyName
| APIAuditLogChangeKeyDescription
| APIAuditLogChangeKeyIconHash
| APIAuditLogChangeKeyImageHash
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeyDiscoverySplashHash
| APIAuditLogChangeKeyBannerHash
| APIAuditLogChangeKeyOwnerId
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyPreferredLocale
| APIAuditLogChangeKeyAFKChannelId
| APIAuditLogChangeKeyAFKTimeout
| APIAuditLogChangeKeyRulesChannelId
| APIAuditLogChangeKeyPublicUpdatesChannelId
| APIAuditLogChangeKeyMFALevel
| APIAuditLogChangeKeyVerificationLevel
| APIAuditLogChangeKeyExplicitContentFilter
| APIAuditLogChangeKeyDefaultMessageNotifications
| APIAuditLogChangeKeyVanityURLCode
| APIAuditLogChangeKey$Add
| APIAuditLogChangeKey$Remove
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyWidgetEnabled
| APIAuditLogChangeKeyWidgetChannelId
| APIAuditLogChangeKeySystemChannelId
| APIAuditLogChangeKeyPosition
| APIAuditLogChangeKeyTopic
| APIAuditLogChangeKeyBitrate
| APIAuditLogChangeKeyPermissionOverwrites
| APIAuditLogChangeKeyNSFW
| APIAuditLogChangeKeyApplicationId
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyPermissions
| APIAuditLogChangeKeyColor
| APIAuditLogChangeKeyHoist
| APIAuditLogChangeKeyMentionable
| APIAuditLogChangeKeyActions
| APIAuditLogChangeKeyAFKChannelId
| APIAuditLogChangeKeyAFKTimeout
| APIAuditLogChangeKeyAllow
| APIAuditLogChangeKeyDeny
| APIAuditLogChangeKeyCode
| APIAuditLogChangeKeyChannelId
| APIAuditLogChangeKeyInviterId
| APIAuditLogChangeKeyMaxUses
| APIAuditLogChangeKeyUses
| APIAuditLogChangeKeyMaxAge
| APIAuditLogChangeKeyTemporary
| APIAuditLogChangeKeyDeaf
| APIAuditLogChangeKeyMute
| APIAuditLogChangeKeyNick
| APIAuditLogChangeKeyApplicationId
| APIAuditLogChangeKeyArchived
| APIAuditLogChangeKeyAsset
| APIAuditLogChangeKeyAutoArchiveDuration
| APIAuditLogChangeKeyAvailable
| APIAuditLogChangeKeyAvatarHash
| APIAuditLogChangeKeyId
| APIAuditLogChangeKeyType
| APIAuditLogChangeKeyBannerHash
| APIAuditLogChangeKeyBitrate
| APIAuditLogChangeKeyChannelId
| APIAuditLogChangeKeyCode
| APIAuditLogChangeKeyColor
| APIAuditLogChangeKeyCommunicationDisabledUntil
| APIAuditLogChangeKeyDeaf
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
| APIAuditLogChangeKeyDefaultMessageNotifications
| APIAuditLogChangeKeyDeny
| APIAuditLogChangeKeyDescription
| APIAuditLogChangeKeyDiscoverySplashHash
| APIAuditLogChangeKeyEnabled
| APIAuditLogChangeKeyEnableEmoticons
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyEventType
| APIAuditLogChangeKeyExemptChannels
| APIAuditLogChangeKeyExemptRoles
| APIAuditLogChangeKeyExpireBehavior
| APIAuditLogChangeKeyExpireGracePeriod
| APIAuditLogChangeKeyUserLimit
| APIAuditLogChangeKeyPrivacyLevel
| APIAuditLogChangeKeyTags
| APIAuditLogChangeKeyExplicitContentFilter
| APIAuditLogChangeKeyFormatType
| APIAuditLogChangeKeyAsset
| APIAuditLogChangeKeyAvailable
| APIAuditLogChangeKeyGuildId
| APIAuditLogChangeKeyArchived
| APIAuditLogChangeKeyLocked
| APIAuditLogChangeKeyAutoArchiveDuration
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
| APIAuditLogChangeKeyEntityType
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeyHoist
| APIAuditLogChangeKeyIconHash
| APIAuditLogChangeKeyId
| APIAuditLogChangeKeyImageHash
| APIAuditLogChangeKeyInviterId
| APIAuditLogChangeKeyLocation
| APIAuditLogChangeKeyCommunicationDisabledUntil
| APIAuditLogChangeKeyTriggerType
| APIAuditLogChangeKeyEventType
| APIAuditLogChangeKeyLocked
| APIAuditLogChangeKeyMaxAge
| APIAuditLogChangeKeyMaxUses
| APIAuditLogChangeKeyMentionable
| APIAuditLogChangeKeyMFALevel
| APIAuditLogChangeKeyMute
| APIAuditLogChangeKeyName
| APIAuditLogChangeKeyNick
| APIAuditLogChangeKeyNSFW
| APIAuditLogChangeKeyOwnerId
| APIAuditLogChangeKeyPermissionOverwrites
| APIAuditLogChangeKeyPermissions
| APIAuditLogChangeKeyPosition
| APIAuditLogChangeKeyPreferredLocale
| APIAuditLogChangeKeyPrivacyLevel
| APIAuditLogChangeKeyPruneDeleteDays
| APIAuditLogChangeKeyPublicUpdatesChannelId
| APIAuditLogChangeKeyRateLimitPerUser
| APIAuditLogChangeKeyRegion
| APIAuditLogChangeKeyRulesChannelId
| APIAuditLogChangeKeySplashHash
| APIAuditLogChangeKeyStatus
| APIAuditLogChangeKeySystemChannelFlags
| APIAuditLogChangeKeySystemChannelId
| APIAuditLogChangeKeyTags
| APIAuditLogChangeKeyTemporary
| APIAuditLogChangeKeyTopic
| APIAuditLogChangeKeyTriggerMetadata
| APIAuditLogChangeKeyActions
| APIAuditLogChangeKeyEnabled
| APIAuditLogChangeKeyExemptRoles
| APIAuditLogChangeKeyExemptChannels;
| APIAuditLogChangeKeyTriggerType
| APIAuditLogChangeKeyType
| APIAuditLogChangeKeyUserLimit
| APIAuditLogChangeKeyUses
| APIAuditLogChangeKeyVanityURLCode
| APIAuditLogChangeKeyVerificationLevel
| APIAuditLogChangeKeyWidgetChannelId
| APIAuditLogChangeKeyWidgetEnabled;
/**
* Returned when an entity's name is changed
@@ -543,6 +545,14 @@ export type APIAuditLogChangeKeyWidgetEnabled = AuditLogChangeData<'widget_enabl
*/
export type APIAuditLogChangeKeyWidgetChannelId = AuditLogChangeData<'widget_channel_id', Snowflake>;
/**
* Returned when a guild's system_channel_flags is changed
*/
export type APIAuditLogChangeKeySystemChannelFlags = AuditLogChangeData<
'system_channel_flags',
GuildSystemChannelFlags
>;
/**
* Returned when a guild's system_channel_id is changed
*/

View File

@@ -41,15 +41,15 @@ export interface APIChannelBase<T extends ChannelType> extends APIPartialChannel
}
export type TextChannelType =
| ChannelType.AnnouncementThread
| ChannelType.DM
| ChannelType.GroupDM
| ChannelType.GuildAnnouncement
| ChannelType.PublicThread
| ChannelType.PrivateThread
| ChannelType.AnnouncementThread
| ChannelType.GuildStageVoice
| ChannelType.GuildText
| ChannelType.GuildVoice
| ChannelType.GuildStageVoice;
| ChannelType.PrivateThread
| ChannelType.PublicThread;
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
@@ -110,7 +110,7 @@ export interface APIGuildChannel<T extends ChannelType> extends Omit<APIChannelB
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
export interface APIGuildTextChannel<T extends GuildTextChannelType | ChannelType.GuildForum | ChannelType.GuildMedia>
export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType>
extends Omit<APITextBasedChannel<T>, 'name'>,
APIGuildChannel<T> {
/**
@@ -134,7 +134,7 @@ export type APIGuildCategoryChannel = APIGuildChannel<ChannelType.GuildCategory>
export interface APIVoiceChannelBase<T extends ChannelType>
extends APIGuildChannel<T>,
Omit<APITextBasedChannel<T>, 'name' | 'last_pin_timestamp'> {
Omit<APITextBasedChannel<T>, 'last_pin_timestamp' | 'name'> {
/**
* The bitrate (in bits) of the voice or stage channel
*/
@@ -200,7 +200,7 @@ export interface APIGroupDMChannel extends Omit<APIDMChannelBase<ChannelType.Gro
managed?: boolean;
}
export type ThreadChannelType = ChannelType.PublicThread | ChannelType.PrivateThread | ChannelType.AnnouncementThread;
export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
export interface APIThreadChannel
extends Omit<APITextBasedChannel<ThreadChannelType>, 'name'>,
@@ -369,16 +369,16 @@ export type APIGuildMediaChannel = APIThreadOnlyChannel<ChannelType.GuildMedia>;
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
*/
export type APIChannel =
| APIGroupDMChannel
| APIDMChannel
| APITextChannel
| APINewsChannel
| APIGuildVoiceChannel
| APIGuildStageVoiceChannel
| APIGroupDMChannel
| APIGuildCategoryChannel
| APIThreadChannel
| APIGuildForumChannel
| APIGuildMediaChannel;
| APIGuildMediaChannel
| APIGuildStageVoiceChannel
| APIGuildVoiceChannel
| APINewsChannel
| APITextChannel
| APIThreadChannel;
/**
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
@@ -599,7 +599,7 @@ export interface APIMessage {
* **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE`
* event to ensure it got sent**
*/
nonce?: string | number;
nonce?: number | string;
/**
* Whether this message is pinned
*/
@@ -865,19 +865,45 @@ export interface APIFollowedChannel {
*/
export interface APIReaction {
/**
* Times this emoji has been used to react
* Total number of times this emoji has been used to react (including super reacts)
*/
count: number;
/**
* An object detailing the individual reaction counts for different types of reactions
*/
count_details: APIReactionCountDetails;
/**
* Whether the current user reacted using this emoji
*/
me: boolean;
/**
* Whether the current user super-reacted using this emoji
*/
me_burst: boolean;
/**
* Emoji information
*
* See https://discord.com/developers/docs/resources/emoji#emoji-object
*/
emoji: APIPartialEmoji;
/**
* Hexadecimal colors used for this super reaction
*/
burst_colors: string[];
}
/**
* https://discord.com/developers/docs/resources/channel#reaction-count-details-object-reaction-count-details-structure
*/
export interface APIReactionCountDetails {
/**
* Count of super reactions
*/
burst: number;
/**
* Count of normal reactions
*/
normal: number;
}
/**
@@ -1537,7 +1563,7 @@ export interface APIMessageComponentEmoji {
export interface APIButtonComponentWithCustomId
extends APIButtonComponentBase<
ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success | ButtonStyle.Danger
ButtonStyle.Danger | ButtonStyle.Primary | ButtonStyle.Secondary | ButtonStyle.Success
> {
/**
* The custom_id to be sent in the interaction when clicked
@@ -1578,11 +1604,11 @@ export enum TextInputStyle {
*/
export interface APIBaseSelectMenuComponent<
T extends
| ComponentType.StringSelect
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.ChannelSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect,
| ComponentType.RoleSelect
| ComponentType.StringSelect
| ComponentType.UserSelect,
> extends APIBaseComponent<T> {
/**
* A developer-defined identifier for the select menu, max 100 characters
@@ -1614,10 +1640,10 @@ export interface APIBaseSelectMenuComponent<
export interface APIBaseAutoPopulatedSelectMenuComponent<
T extends
| ComponentType.UserSelect
| ComponentType.RoleSelect
| ComponentType.ChannelSelect
| ComponentType.MentionableSelect
| ComponentType.ChannelSelect,
| ComponentType.RoleSelect
| ComponentType.UserSelect,
D extends SelectMenuDefaultValueType,
> extends APIBaseSelectMenuComponent<T> {
/**
@@ -1657,7 +1683,7 @@ export type APIRoleSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
*/
export type APIMentionableSelectComponent = APIBaseAutoPopulatedSelectMenuComponent<
ComponentType.MentionableSelect,
SelectMenuDefaultValueType.User | SelectMenuDefaultValueType.Role
SelectMenuDefaultValueType.Role | SelectMenuDefaultValueType.User
>;
/**
@@ -1698,18 +1724,18 @@ export type APIAutoPopulatedSelectMenuComponent =
* https://discord.com/developers/docs/interactions/message-components#select-menus
*/
export type APISelectMenuComponent =
| APIStringSelectComponent
| APIUserSelectComponent
| APIRoleSelectComponent
| APIChannelSelectComponent
| APIMentionableSelectComponent
| APIChannelSelectComponent;
| APIRoleSelectComponent
| APIStringSelectComponent
| APIUserSelectComponent;
/**
* https://discord.com/developers/docs/interactions/message-components#select-menu-object-select-option-structure
*/
export interface APISelectMenuOption {
/**
* The user-facing name of the option (max 25 chars)
* The user-facing name of the option (max 100 chars)
*/
label: string;
/**
@@ -1717,7 +1743,7 @@ export interface APISelectMenuOption {
*/
value: string;
/**
* An additional description of the option (max 50 chars)
* An additional description of the option (max 100 chars)
*/
description?: string;
/**
@@ -1814,8 +1840,8 @@ export enum ChannelFlags {
/**
* https://discord.com/developers/docs/interactions/message-components#message-components
*/
export type APIMessageComponent = APIMessageActionRowComponent | APIActionRowComponent<APIMessageActionRowComponent>;
export type APIModalComponent = APIModalActionRowComponent | APIActionRowComponent<APIModalActionRowComponent>;
export type APIMessageComponent = APIActionRowComponent<APIMessageActionRowComponent> | APIMessageActionRowComponent;
export type APIModalComponent = APIActionRowComponent<APIModalActionRowComponent> | APIModalActionRowComponent;
export type APIActionRowComponentTypes = APIMessageActionRowComponent | APIModalActionRowComponent;

View File

@@ -215,7 +215,7 @@ export interface GatewayActivity {
/**
* The custom buttons shown in the Rich Presence (max 2)
*/
buttons?: string[] | GatewayActivityButton[];
buttons?: GatewayActivityButton[] | string[];
}
/**
@@ -280,7 +280,7 @@ export interface GatewayActivityTimestamps {
/**
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji
*/
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'id' | 'animated'>> & Pick<APIEmoji, 'name'>;
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'animated' | 'id'>> & Pick<APIEmoji, 'name'>;
/**
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
@@ -306,7 +306,7 @@ export type GatewayActivityAssets = Partial<
/**
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets
*/
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
export type GatewayActivitySecrets = Partial<Record<'join' | 'match' | 'spectate', string>>;
/**
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags

View File

@@ -121,7 +121,7 @@ export interface APIGuild extends APIPartialGuild {
/**
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout: 60 | 300 | 900 | 1_800 | 3_600;
afk_timeout: 1_800 | 3_600 | 60 | 300 | 900;
/**
* `true` if the guild widget is enabled
*/
@@ -798,7 +798,7 @@ export interface APIGuildIntegration {
scopes?: OAuth2Scopes[];
}
export type APIGuildIntegrationType = 'twitch' | 'youtube' | 'discord' | 'guild_subscription';
export type APIGuildIntegrationType = 'discord' | 'guild_subscription' | 'twitch' | 'youtube';
/**
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors

View File

@@ -90,9 +90,9 @@ export interface APIExternalGuildScheduledEvent
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
*/
export type APIGuildScheduledEvent =
| APIExternalGuildScheduledEvent
| APIStageInstanceGuildScheduledEvent
| APIVoiceGuildScheduledEvent
| APIExternalGuildScheduledEvent;
| APIVoiceGuildScheduledEvent;
/**
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata

View File

@@ -32,26 +32,26 @@ export * from './_interactions/responses.ts';
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIInteraction =
| APIPingInteraction
| APIApplicationCommandAutocompleteInteraction
| APIApplicationCommandInteraction
| APIMessageComponentInteraction
| APIApplicationCommandAutocompleteInteraction
| APIModalSubmitInteraction;
| APIModalSubmitInteraction
| APIPingInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIDMInteraction =
| APIApplicationCommandAutocompleteDMInteraction
| APIApplicationCommandDMInteraction
| APIMessageComponentDMInteraction
| APIApplicationCommandAutocompleteDMInteraction
| APIModalSubmitDMInteraction;
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
*/
export type APIGuildInteraction =
| APIApplicationCommandAutocompleteGuildInteraction
| APIApplicationCommandGuildInteraction
| APIMessageComponentGuildInteraction
| APIApplicationCommandAutocompleteGuildInteraction
| APIModalSubmitGuildInteraction;

View File

@@ -11,17 +11,17 @@ import type { APIUser } from './user.ts';
export type APIInviteGuild = Pick<
APIGuild,
| 'id'
| 'name'
| 'splash'
| 'banner'
| 'icon'
| 'vanity_url_code'
| 'description'
| 'features'
| 'verification_level'
| 'icon'
| 'id'
| 'name'
| 'nsfw_level'
| 'premium_subscription_count'
| 'splash'
| 'vanity_url_code'
| 'verification_level'
>;
/**

View File

@@ -92,7 +92,7 @@ export enum StickerFormatType {
/**
* https://discord.com/developers/docs/resources/sticker#sticker-item-object
*/
export type APIStickerItem = Pick<APISticker, 'id' | 'name' | 'format_type'>;
export type APIStickerItem = Pick<APISticker, 'format_type' | 'id' | 'name'>;
/**
* https://discord.com/developers/docs/resources/sticker#sticker-pack-object

View File

@@ -316,5 +316,5 @@ export interface APIApplicationRoleConnection {
/**
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
*/
metadata: Record<string, string | number>;
metadata: Record<string, number | string>;
}

View File

@@ -254,6 +254,7 @@ export enum RESTJSONErrorCodes {
NoUsersWithDiscordTagExist = 80_004,
ReactionWasBlocked = 90_001,
UserCannotUseBurstReactions,
ApplicationNotYetAvailable = 110_001,
@@ -292,6 +293,8 @@ export enum RESTJSONErrorCodes {
CannotEnableOnboardingRequirementsAreNotMet = 350_000,
CannotUpdateOnboardingWhileBelowRequirements,
FailedToBanUsers = 500_000,
}
/**
@@ -324,6 +327,7 @@ export enum Locale {
Romanian = 'ro',
Russian = 'ru',
SpanishES = 'es-ES',
SpanishLATAM = 'es-419',
Swedish = 'sv-SE',
Thai = 'th',
Turkish = 'tr',

View File

@@ -25,17 +25,17 @@ export type RESTGetCurrentApplicationResult = APIApplication;
* https://discord.com/developers/docs/resources/application#edit-current-application
*/
export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
Pick<
APIApplication,
| 'custom_install_url'
| 'description'
| 'flags'
| 'role_connections_verification_url'
| 'install_params'
| 'interactions_endpoint_url'
| 'tags'
> &
Nullable<Pick<APIApplication, 'icon' | 'cover_image'>>
Nullable<Pick<APIApplication, 'cover_image' | 'icon'>> &
Pick<
APIApplication,
| 'custom_install_url'
| 'description'
| 'flags'
| 'install_params'
| 'interactions_endpoint_url'
| 'role_connections_verification_url'
| 'tags'
>
>;
/**

View File

@@ -236,8 +236,10 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
/**
* https://discord.com/developers/docs/resources/channel#message-reference-object-message-reference-structure
*/
export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Required<Pick<APIMessageReference, 'message_id'>>> & {
export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Required<Pick<APIMessageReference, 'message_id'>>
> &
StrictPartial<APIMessageReference> & {
/**
* Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message
*
@@ -309,7 +311,7 @@ export interface RESTPostAPIChannelMessageJSONBody {
*
* See https://discord.com/developers/docs/resources/sticker#sticker-object
*/
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined;
sticker_ids?: [Snowflake, Snowflake, Snowflake] | [Snowflake, Snowflake] | [Snowflake] | undefined;
/**
* Attachment objects with filename and description
*/
@@ -318,19 +320,24 @@ export interface RESTPostAPIChannelMessageJSONBody {
* Message flags combined as a bitfield
*/
flags?: MessageFlags | undefined;
/**
* If `true` and nonce is present, it will be checked for uniqueness in the past few minutes.
* If another message was created by the same author with the same nonce, that message will be returned and no new message will be created.
*/
enforce_nonce?: boolean | undefined;
}
/**
* https://discord.com/developers/docs/resources/channel#create-message
*/
export type RESTPostAPIChannelMessageFormDataBody =
| ({
| (Record<`files[${bigint}]`, unknown> & {
/**
* JSON stringified message body
*/
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
})
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIChannelMessageJSONBody);
/**
* https://discord.com/developers/docs/resources/channel#create-message
@@ -437,13 +444,13 @@ export interface RESTPatchAPIChannelMessageJSONBody {
* https://discord.com/developers/docs/resources/channel#edit-message
*/
export type RESTPatchAPIChannelMessageFormDataBody =
| ({
| (Record<`files[${bigint}]`, unknown> & {
/**
* JSON stringified message body
*/
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
})
| (Record<`files[${bigint}]`, unknown> & RESTPatchAPIChannelMessageJSONBody);
/**
* https://discord.com/developers/docs/resources/channel#edit-message

View File

@@ -45,22 +45,22 @@ export type APIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGr
export type APIGuildCreatePartialChannel = StrictPartial<
DistributivePick<
APIGuildChannelResolvable,
| 'type'
| 'topic'
| 'nsfw'
| 'bitrate'
| 'user_limit'
| 'rate_limit_per_user'
| 'default_auto_archive_duration'
| 'position'
| 'rtc_region'
| 'video_quality_mode'
| 'flags'
| 'default_reaction_emoji'
| 'available_tags'
| 'default_sort_order'
| 'bitrate'
| 'default_auto_archive_duration'
| 'default_forum_layout'
| 'default_reaction_emoji'
| 'default_sort_order'
| 'default_thread_rate_limit_per_user'
| 'flags'
| 'nsfw'
| 'position'
| 'rate_limit_per_user'
| 'rtc_region'
| 'topic'
| 'type'
| 'user_limit'
| 'video_quality_mode'
>
> & {
name: string;
@@ -142,15 +142,15 @@ export interface RESTPostAPIGuildsJSONBody {
/**
* ID for afk channel
*/
afk_channel_id?: number | Snowflake | null | undefined;
afk_channel_id?: Snowflake | number | null | undefined;
/**
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: 60 | 300 | 900 | 1_800 | 3_600 | undefined;
afk_timeout?: 1_800 | 3_600 | 60 | 300 | 900 | undefined;
/**
* The id of the channel where guild notices such as welcome messages and boost events are posted
*/
system_channel_id?: number | Snowflake | null | undefined;
system_channel_id?: Snowflake | number | null | undefined;
/**
* System channel flags
*
@@ -246,7 +246,7 @@ export interface RESTPatchAPIGuildJSONBody {
/**
* afk timeout in seconds, can be set to: `60`, `300`, `900`, `1800`, `3600`
*/
afk_timeout?: 60 | 300 | 900 | 1_800 | 3_600 | undefined;
afk_timeout?: 1_800 | 3_600 | 60 | 300 | 900 | undefined;
/**
* base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature)
*
@@ -604,6 +604,34 @@ export type RESTPutAPIGuildBanResult = never;
*/
export type RESTDeleteAPIGuildBanResult = never;
/**
* https://discord.com/developers/docs/resources/guild#bulk-guild-ban
*/
export interface RESTPostAPIGuildBulkBanJSONBody {
/**
* List of user ids to ban (max 200)
*/
user_ids: Snowflake[];
/**
* Number of seconds to delete messages for, between 0 and 604800 (7 days)
*/
delete_message_seconds?: number | undefined;
}
/**
* https://discord.com/developers/docs/resources/guild#bulk-guild-ban
*/
export interface RESTPostAPIGuildBulkBanResult {
/**
* List of user ids, that were successfully banned
*/
banned_users: Snowflake[];
/**
* List of user ids, that were not banned
*/
failed_users: Snowflake[];
}
/**
* https://discord.com/developers/docs/resources/guild#get-guild-roles
*/
@@ -942,20 +970,20 @@ export type RESTPutAPIGuildOnboardingJSONBody = AddUndefinedToPossiblyUndefinedP
prompts?: RESTAPIModifyGuildOnboardingPromptData[] | undefined;
};
export type RESTAPIModifyGuildOnboardingPromptData = Pick<APIGuildOnboardingPrompt, 'id' | 'title'> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPrompt, 'id' | 'title' | 'options' | 'guild_id'>>
> & {
export type RESTAPIModifyGuildOnboardingPromptData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPrompt, 'guild_id' | 'id' | 'options' | 'title'>>
> &
Pick<APIGuildOnboardingPrompt, 'id' | 'title'> & {
/**
* Options available within the prompt
*/
options: RESTAPIModifyGuildOnboardingPromptOptionData[];
};
export type RESTAPIModifyGuildOnboardingPromptOptionData = Pick<APIGuildOnboardingPromptOption, 'title'> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPromptOption, 'title' | 'emoji' | 'guild_id'>>
> & {
export type RESTAPIModifyGuildOnboardingPromptOptionData = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Partial<Omit<APIGuildOnboardingPromptOption, 'emoji' | 'guild_id' | 'title'>>
> &
Pick<APIGuildOnboardingPromptOption, 'title'> & {
/**
* Emoji id
*/

View File

@@ -42,15 +42,15 @@ export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Omit<
APIApplicationCommand,
| 'id'
| 'application_id'
| 'default_member_permissions'
| 'description_localized'
| 'description'
| 'guild_id'
| 'id'
| 'name_localized'
| 'type'
| 'version'
| 'guild_id'
| 'name_localized'
| 'description_localized'
| 'default_member_permissions'
> &
Partial<Pick<APIApplicationCommand, 'default_member_permissions'>>
>;
@@ -67,7 +67,7 @@ export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPos
* https://discord.com/developers/docs/interactions/application-commands#create-global-application-command
*/
export interface RESTPostAPIContextMenuApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody {
type: ApplicationCommandType.User | ApplicationCommandType.Message;
type: ApplicationCommandType.Message | ApplicationCommandType.User;
}
/**
@@ -166,13 +166,13 @@ export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse;
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-interaction-response
*/
export type RESTPostAPIInteractionCallbackFormDataBody =
| ({
| (Record<`files[${bigint}]`, unknown> & {
/**
* JSON stringified message body
*/
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>);
})
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionCallbackJSONBody);
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response
@@ -208,13 +208,13 @@ export type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallb
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message
*/
export type RESTPostAPIInteractionFollowupFormDataBody =
| ({
| (Record<`files[${bigint}]`, unknown> & {
/**
* JSON stringified message body
*/
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>);
})
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionFollowupJSONBody);
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message

View File

@@ -473,7 +473,9 @@ export const Routes = {
parts.push('threads');
return parts.join('/') as `/channels/${Snowflake}/threads` | `/channels/${Snowflake}/messages/${Snowflake}/threads`;
return parts.join('/') as
| `/channels/${Snowflake}/messages/${Snowflake}/threads`
| `/channels/${Snowflake}/threads`;
},
/**
@@ -489,7 +491,7 @@ export const Routes = {
* - GET `/channels/{channel.id}/threads/archived/public`
* - GET `/channels/{channel.id}/threads/archived/private`
*/
channelThreads(channelId: Snowflake, archivedStatus: 'public' | 'private') {
channelThreads(channelId: Snowflake, archivedStatus: 'private' | 'public') {
return `/channels/${channelId}/threads/archived/${archivedStatus}` as const;
},
@@ -516,8 +518,8 @@ export const Routes = {
if (userId) parts.push(userId);
return parts.join('/') as
| `/channels/${Snowflake}/thread-members`
| `/channels/${Snowflake}/thread-members/${Snowflake | '@me'}`;
| `/channels/${Snowflake}/thread-members/${Snowflake | '@me'}`
| `/channels/${Snowflake}/thread-members`;
},
/**
@@ -623,7 +625,7 @@ export const Routes = {
if (webhookToken) parts.push(webhookToken);
return parts.join('/') as `/webhooks/${Snowflake}` | `/webhooks/${Snowflake}/${string}`;
return parts.join('/') as `/webhooks/${Snowflake}/${string}` | `/webhooks/${Snowflake}`;
},
/**
@@ -908,6 +910,7 @@ export const Routes = {
currentApplication() {
return '/applications/@me' as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/entitlements`
@@ -916,6 +919,7 @@ export const Routes = {
entitlements(applicationId: Snowflake) {
return `/applications/${applicationId}/entitlements` as const;
},
/**
* Route for:
* - DELETE `/applications/{application.id}/entitlements/{entitlement.id}`
@@ -923,6 +927,7 @@ export const Routes = {
entitlement(applicationId: Snowflake, entitlementId: Snowflake) {
return `/applications/${applicationId}/entitlements/${entitlementId}` as const;
},
/**
* Route for:
* - GET `/applications/{application.id}/skus`
@@ -930,6 +935,14 @@ export const Routes = {
skus(applicationId: Snowflake) {
return `/applications/${applicationId}/skus` as const;
},
/**
* Route for:
* - POST `/guilds/{guild.id}/bulk-ban`
*/
guildBulkBan(guildId: Snowflake) {
return `/guilds/${guildId}/bulk-ban` as const;
},
};
export const StickerPackApplicationId = '710982414301790216';
@@ -1213,23 +1226,23 @@ export type DefaultUserAvatarAssets = 0 | 1 | 2 | 3 | 4 | 5;
export type EmojiFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildIconFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildSplashFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type GuildDiscoverySplashFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type GuildSplashFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildDiscoverySplashFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type UserBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type DefaultUserAvatar = Extract<ImageFormat, ImageFormat.PNG>;
export type UserAvatarFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type GuildMemberAvatarFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export type ApplicationIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type ApplicationCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type ApplicationAssetFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type AchievementIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type StickerPackBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type TeamIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type StorePageAssetFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type StickerFormat = Extract<ImageFormat, ImageFormat.PNG | ImageFormat.Lottie | ImageFormat.GIF>;
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.Lottie | ImageFormat.GIF>;
export type ApplicationIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type ApplicationCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type ApplicationAssetFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type AchievementIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type StickerPackBannerFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type TeamIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type StorePageAssetFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type StickerFormat = Extract<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie | ImageFormat.PNG>;
export type RoleIconFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildScheduledEventCoverFormat = Exclude<ImageFormat, ImageFormat.GIF | ImageFormat.Lottie>;
export type GuildMemberBannerFormat = Exclude<ImageFormat, ImageFormat.Lottie>;
export interface CDNQuery {

View File

@@ -64,7 +64,7 @@ export interface RESTPostAPIEntitlementBody {
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement
*/
export type RESTPostAPIEntitlementResult = Partial<Omit<APIEntitlement, 'starts_at' | 'ends_at'>>;
export type RESTPostAPIEntitlementResult = Partial<Omit<APIEntitlement, 'ends_at' | 'starts_at'>>;
/**
* https://discord.com/developers/docs/monetization/entitlements#create-test-entitlement

View File

@@ -122,8 +122,8 @@ export interface RESTOAuth2BotAuthorizationQuery {
*/
scope:
| OAuth2Scopes.Bot
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
| `${OAuth2Scopes.Bot}${' ' | '%20'}${string}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`;
/**
* The permissions you're requesting
@@ -151,8 +151,8 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery {
*/
scope:
| OAuth2Scopes.Bot
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
| `${OAuth2Scopes.Bot}${' ' | '%20'}${string}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`;
/**
* The required permissions bitfield, stringified
@@ -196,4 +196,5 @@ export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult {
}
export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult =
RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult & RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;
RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult &
RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;

View File

@@ -35,6 +35,10 @@ export interface RESTPatchAPICurrentUserJSONBody {
* If passed, modifies the user's avatar
*/
avatar?: string | null | undefined;
/**
* If passed, modifies the user's banner
*/
banner?: string | null | undefined;
}
/**
@@ -129,7 +133,7 @@ export interface RESTPutAPICurrentUserApplicationRoleConnectionJSONBody {
/**
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
*/
metadata?: Record<string, string | number> | undefined;
metadata?: Record<string, number | string> | undefined;
}
/**

View File

@@ -160,13 +160,13 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
* https://discord.com/developers/docs/resources/webhook#execute-webhook
*/
export type RESTPostAPIWebhookWithTokenFormDataBody =
| ({
| (Record<`files[${bigint}]`, unknown> & {
/**
* JSON stringified message body
*/
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>);
})
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIWebhookWithTokenJSONBody);
/**
* https://discord.com/developers/docs/resources/webhook#execute-webhook-query-string-params
@@ -252,7 +252,7 @@ export interface RESTGetAPIWebhookWithTokenMessageQuery {
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
*/
export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>>
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'allowed_mentions' | 'components' | 'content' | 'embeds'>>
> & {
/**
* Attached files to keep
@@ -268,13 +268,13 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
*/
export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
| ({
| (Record<`files[${bigint}]`, unknown> & {
/**
* JSON stringified message body
*/
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>);
})
| (Record<`files[${bigint}]`, unknown> & RESTPatchAPIWebhookWithTokenMessageJSONBody);
/**
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message

View File

@@ -29,7 +29,7 @@ export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionsJSO
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
*/
export type APIGuildCreatePartialChannel = Partial<
Pick<APIChannel, 'type' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user'>
Pick<APIChannel, 'bitrate' | 'nsfw' | 'rate_limit_per_user' | 'topic' | 'type' | 'user_limit'>
> & {
name: string;
id?: number | string | undefined;
@@ -142,7 +142,14 @@ export type RESTGetAPIGuildChannelsResult = APIChannel[];
export type RESTPostAPIGuildChannelJSONBody = Partial<
Pick<
APIChannel,
'type' | 'permission_overwrites' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user' | 'parent_id'
| 'bitrate'
| 'nsfw'
| 'parent_id'
| 'permission_overwrites'
| 'rate_limit_per_user'
| 'topic'
| 'type'
| 'user_limit'
>
> &
Required<Pick<APIChannel, 'name'>>;

View File

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

View File

@@ -176,8 +176,10 @@ export type RESTGetAPIChannelMessageResult = APIMessage;
*
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type APIMessageReferenceSend = StrictPartial<APIMessageReference> &
AddUndefinedToPossiblyUndefinedPropertiesOfInterface<Required<Pick<APIMessageReference, 'message_id'>>> & {
export type APIMessageReferenceSend = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Required<Pick<APIMessageReference, 'message_id'>>
> &
StrictPartial<APIMessageReference> & {
/**
* Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message
*
@@ -241,11 +243,11 @@ export interface RESTPostAPIChannelMessageJSONBody {
*
* See https://discord.com/developers/docs/resources/sticker#sticker-object
*/
sticker_ids?: [Snowflake] | [Snowflake, Snowflake] | [Snowflake, Snowflake, Snowflake] | undefined;
sticker_ids?: [Snowflake, Snowflake, Snowflake] | [Snowflake, Snowflake] | [Snowflake] | undefined;
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
attachments?: (Partial<Pick<APIAttachment, 'filename'>> & Pick<APIAttachment, 'description' | 'id'>)[] | undefined;
/**
* Message flags combined as a bitfield
*/
@@ -258,13 +260,13 @@ export interface RESTPostAPIChannelMessageJSONBody {
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIChannelMessageFormDataBody =
| ({
| (Record<`files[${bigint}]`, unknown> & {
/**
* JSON stringified message body
*/
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
})
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIChannelMessageJSONBody);
/**
* https://discord.com/developers/docs/resources/channel#create-message
@@ -386,7 +388,7 @@ export interface RESTPatchAPIChannelMessageJSONBody {
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
attachments?: (Partial<Pick<APIAttachment, 'description' | 'filename'>> & Pick<APIAttachment, 'id'>)[] | undefined;
/**
* The components to include with the message
*
@@ -401,13 +403,13 @@ export interface RESTPatchAPIChannelMessageJSONBody {
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIChannelMessageFormDataBody =
| ({
| (Record<`files[${bigint}]`, unknown> & {
/**
* JSON stringified message body
*/
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPatchAPIChannelMessageJSONBody & Record<`files[${bigint}]`, unknown>);
})
| (Record<`files[${bigint}]`, unknown> & RESTPatchAPIChannelMessageJSONBody);
/**
* https://discord.com/developers/docs/resources/channel#edit-message

View File

@@ -43,7 +43,7 @@ export type APIGuildChannelResolvable = Exclude<APIChannel, APIDMChannel | APIGr
export type APIGuildCreatePartialChannel = StrictPartial<
Pick<
UnionToIntersection<APIGuildChannelResolvable>,
'type' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user'
'bitrate' | 'nsfw' | 'rate_limit_per_user' | 'topic' | 'type' | 'user_limit'
>
> & {
name: string;
@@ -130,7 +130,7 @@ export interface RESTPostAPIGuildsJSONBody {
/**
* ID for afk channel
*/
afk_channel_id?: number | Snowflake | null | undefined;
afk_channel_id?: Snowflake | number | null | undefined;
/**
* AFK timeout in seconds
*/
@@ -138,7 +138,7 @@ export interface RESTPostAPIGuildsJSONBody {
/**
* The id of the channel where guild notices such as welcome messages and boost events are posted
*/
system_channel_id?: number | Snowflake | null | undefined;
system_channel_id?: Snowflake | number | null | undefined;
/**
* System channel flags
*

View File

@@ -31,7 +31,7 @@ export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
type RESTPostAPIBaseApplicationCommandsJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Omit<APIApplicationCommand, 'id' | 'application_id' | 'description' | 'type' | 'version' | 'guild_id'>
Omit<APIApplicationCommand, 'application_id' | 'description' | 'guild_id' | 'id' | 'type' | 'version'>
>;
/**
@@ -50,7 +50,7 @@ export interface RESTPostAPIChatInputApplicationCommandsJSONBody extends RESTPos
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export interface RESTPostAPIContextMenuApplicationCommandsJSONBody extends RESTPostAPIBaseApplicationCommandsJSONBody {
type: ApplicationCommandType.User | ApplicationCommandType.Message;
type: ApplicationCommandType.Message | ApplicationCommandType.User;
}
/**
@@ -166,13 +166,13 @@ export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse;
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIInteractionCallbackFormDataBody =
| ({
| (Record<`files[${bigint}]`, unknown> & {
/**
* JSON stringified message body
*/
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIInteractionCallbackJSONBody & Record<`files[${bigint}]`, unknown>);
})
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionCallbackJSONBody);
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#get-original-interaction-response
@@ -222,13 +222,13 @@ export type RESTPostAPIInteractionFollowupJSONBody = APIInteractionResponseCallb
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIInteractionFollowupFormDataBody =
| ({
| (Record<`files[${bigint}]`, unknown> & {
/**
* JSON stringified message body
*/
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIInteractionFollowupJSONBody & Record<`files[${bigint}]`, unknown>);
})
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIInteractionFollowupJSONBody);
/**
* https://discord.com/developers/docs/interactions/receiving-and-responding#create-followup-message

View File

@@ -518,7 +518,7 @@ export const Routes = {
if (webhookToken) parts.push(webhookToken);
return parts.join('/') as `/webhooks/${Snowflake}` | `/webhooks/${Snowflake}/${string}`;
return parts.join('/') as `/webhooks/${Snowflake}/${string}` | `/webhooks/${Snowflake}`;
},
/**

View File

@@ -150,8 +150,8 @@ export interface RESTOAuth2BotAuthorizationQuery {
*/
scope:
| OAuth2Scopes.Bot
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
| `${OAuth2Scopes.Bot}${' ' | '%20'}${string}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`;
/**
* The permissions you're requesting
@@ -181,8 +181,8 @@ export interface RESTOAuth2AdvancedBotAuthorizationQuery {
*/
scope:
| OAuth2Scopes.Bot
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
| `${OAuth2Scopes.Bot}${' ' | '%20'}${string}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`;
/**
* The required permissions bitfield, stringified
@@ -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;

View File

@@ -166,7 +166,7 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
/**
* Attachment objects with filename and description
*/
attachments?: (Pick<APIAttachment, 'id' | 'description'> & Partial<Pick<APIAttachment, 'filename'>>)[] | undefined;
attachments?: (Partial<Pick<APIAttachment, 'filename'>> & Pick<APIAttachment, 'description' | 'id'>)[] | undefined;
/**
* Message flags combined as a bitfield
*/
@@ -179,13 +179,13 @@ export interface RESTPostAPIWebhookWithTokenJSONBody {
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPostAPIWebhookWithTokenFormDataBody =
| ({
| (Record<`files[${bigint}]`, unknown> & {
/**
* JSON stringified message body
*/
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPostAPIWebhookWithTokenJSONBody & Record<`files[${bigint}]`, unknown>);
})
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIWebhookWithTokenJSONBody);
/**
* https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
@@ -284,7 +284,7 @@ export type RESTGetAPIWebhookWithTokenMessageResult = APIMessage;
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossiblyUndefinedPropertiesOfInterface<
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions' | 'components'>>
Nullable<Pick<RESTPostAPIWebhookWithTokenJSONBody, 'allowed_mentions' | 'components' | 'content' | 'embeds'>>
> & {
/**
* Attached files to keep
@@ -293,7 +293,7 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
*
* See https://discord.com/developers/docs/resources/channel#attachment-object
*/
attachments?: (Pick<APIAttachment, 'id'> & Partial<Pick<APIAttachment, 'filename' | 'description'>>)[] | undefined;
attachments?: (Partial<Pick<APIAttachment, 'description' | 'filename'>> & Pick<APIAttachment, 'id'>)[] | undefined;
};
/**
@@ -302,13 +302,13 @@ export type RESTPatchAPIWebhookWithTokenMessageJSONBody = AddUndefinedToPossibly
* @deprecated API and gateway v8 are deprecated and the types will not receive further updates, please update to v10.
*/
export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
| ({
| (Record<`files[${bigint}]`, unknown> & {
/**
* JSON stringified message body
*/
payload_json?: string | undefined;
} & Record<`files[${bigint}]`, unknown>)
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & Record<`files[${bigint}]`, unknown>);
})
| (Record<`files[${bigint}]`, unknown> & RESTPatchAPIWebhookWithTokenMessageJSONBody);
/**
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message

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