mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-22 19:30:09 +00:00
Compare commits
82 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24d8037c47 | ||
|
|
07ba907242 | ||
|
|
b90714f677 | ||
|
|
6cd75426c6 | ||
|
|
d8d7bccea6 | ||
|
|
4462255168 | ||
|
|
679a5cfd77 | ||
|
|
fc4b7e2708 | ||
|
|
15c171c558 | ||
|
|
ebd5754242 | ||
|
|
ffcd95d597 | ||
|
|
2636bd0949 | ||
|
|
ceb787ba36 | ||
|
|
ca61396577 | ||
|
|
0582f883c5 | ||
|
|
9d8d090c9c | ||
|
|
eb3f8e1dea | ||
|
|
24155aeb71 | ||
|
|
76651acd49 | ||
|
|
92f76f1a3c | ||
|
|
0f29b32e05 | ||
|
|
7343fabe82 | ||
|
|
d0b3106758 | ||
|
|
eafe7ba96f | ||
|
|
ff761755a6 | ||
|
|
ae1900dc2f | ||
|
|
466fa95b0e | ||
|
|
70bfe9f4aa | ||
|
|
63096d807d | ||
|
|
855f36d930 | ||
|
|
3bf9738a72 | ||
|
|
4e4a084003 | ||
|
|
75ed123018 | ||
|
|
5826da22e3 | ||
|
|
da2c2e9ada | ||
|
|
4c77a5d90a | ||
|
|
84759d19bc | ||
|
|
999b3594d8 | ||
|
|
549a6f0236 | ||
|
|
35bd1f7dcd | ||
|
|
0ef46202f6 | ||
|
|
6464fe9932 | ||
|
|
664ad800cc | ||
|
|
15892ec870 | ||
|
|
dccdfe044f | ||
|
|
70b427bbb3 | ||
|
|
c28ef6c3d9 | ||
|
|
8c43eae001 | ||
|
|
ba4c0d78f4 | ||
|
|
2b89beb52b | ||
|
|
ec9002fc56 | ||
|
|
5d0f885d25 | ||
|
|
91cf0d31d7 | ||
|
|
c2f0deeebd | ||
|
|
018fc4f8ea | ||
|
|
b832b24603 | ||
|
|
8d77142ca5 | ||
|
|
6296ac9e4f | ||
|
|
7d873f73c7 | ||
|
|
60c38fd32c | ||
|
|
e196e65254 | ||
|
|
21b9ae4aaf | ||
|
|
39ea1f4429 | ||
|
|
fde45f9235 | ||
|
|
2ee557a598 | ||
|
|
fed4749dd4 | ||
|
|
666a0c7152 | ||
|
|
e40530599e | ||
|
|
7992fab135 | ||
|
|
61db1eee25 | ||
|
|
363d914934 | ||
|
|
91c63f05ca | ||
|
|
f058ed6aa1 | ||
|
|
0982610731 | ||
|
|
e2015c63e1 | ||
|
|
11b95c8609 | ||
|
|
dcf8ddf25b | ||
|
|
061a147fbb | ||
|
|
f375cbe3e3 | ||
|
|
97c7b4ea24 | ||
|
|
9e5c5b5aac | ||
|
|
8cf1ba3f4f |
76
.github/CODE_OF_CONDUCT.md
vendored
Normal file
76
.github/CODE_OF_CONDUCT.md
vendored
Normal file
@@ -0,0 +1,76 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to make participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
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
|
||||
|
||||
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
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies within all project spaces, and it also applies when
|
||||
an individual is representing the project or its community in public spaces.
|
||||
Examples of representing a project or community include using an official
|
||||
project e-mail address, posting via an official social media account, or acting
|
||||
as an appointed representative at an online or offline event. Representation of
|
||||
a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at https://discord.gg/bRCvFy9. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
https://www.contributor-covenant.org/faq
|
||||
91
.github/COMMIT_CONVENTION.md
vendored
Normal file
91
.github/COMMIT_CONVENTION.md
vendored
Normal file
@@ -0,0 +1,91 @@
|
||||
## Git Commit Message Convention
|
||||
|
||||
> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular).
|
||||
|
||||
#### TL;DR:
|
||||
|
||||
Messages must be matched by the following regex:
|
||||
|
||||
```js
|
||||
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .{1,72}/;
|
||||
```
|
||||
|
||||
#### Examples
|
||||
|
||||
Appears under "Features" header, `GuildMember` subheader:
|
||||
|
||||
```
|
||||
feat(GuildMember): add 'tag' method
|
||||
```
|
||||
|
||||
Appears under "Bug Fixes" header, `Guild` subheader, with a link to issue #28:
|
||||
|
||||
```
|
||||
fix(Guild): handle events correctly
|
||||
|
||||
close #28
|
||||
```
|
||||
|
||||
Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:
|
||||
|
||||
```
|
||||
perf(core): improve patching by removing 'bar' option
|
||||
|
||||
BREAKING CHANGE: The 'bar' option has been removed.
|
||||
```
|
||||
|
||||
The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header.
|
||||
|
||||
```
|
||||
revert: feat(Managers): add Managers
|
||||
|
||||
This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
|
||||
```
|
||||
|
||||
### Full Message Format
|
||||
|
||||
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:
|
||||
|
||||
```
|
||||
<type>(<scope>): <subject>
|
||||
<BLANK LINE>
|
||||
<body>
|
||||
<BLANK LINE>
|
||||
<footer>
|
||||
```
|
||||
|
||||
The **header** is mandatory and the **scope** of the header is optional.
|
||||
|
||||
### Revert
|
||||
|
||||
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body, it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
|
||||
|
||||
### Type
|
||||
|
||||
If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However, if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog.
|
||||
|
||||
Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks.
|
||||
|
||||
### Scope
|
||||
|
||||
The scope could be anything specifying the place of the commit change. For example `GuildMember`, `Guild`, `Message`, `MessageEmbed` etc...
|
||||
|
||||
### Subject
|
||||
|
||||
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
|
||||
|
||||
### Body
|
||||
|
||||
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
|
||||
The body should include the motivation for the change and contrast this with previous behavior.
|
||||
|
||||
### Footer
|
||||
|
||||
The footer should contain any information about **Breaking Changes** and is also the place to
|
||||
reference GitHub issues that this commit **Closes**.
|
||||
|
||||
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
|
||||
53
.github/CONTRIBUTING.md
vendored
Normal file
53
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,53 @@
|
||||
# discord-api-types Contributing Guide
|
||||
|
||||
**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/bRCvFy9) 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)
|
||||
|
||||
## Pull Request Guidelines
|
||||
|
||||
- Checkout a topic branch from a base branch, e.g. `main`, and merge back against that branch.
|
||||
|
||||
- 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.
|
||||
|
||||
- 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.
|
||||
|
||||
```
|
||||
fix(Guild): handle events correctly
|
||||
|
||||
close #28
|
||||
```
|
||||
|
||||
- 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.
|
||||
|
||||
- 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)).
|
||||
|
||||
- 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
|
||||
|
||||
You will need [Node.js](http://nodejs.org) **version 12+**, and [npm](https://www.npmjs.com/).
|
||||
|
||||
After cloning the repo, run:
|
||||
|
||||
```bash
|
||||
$ 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
|
||||
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
@@ -1,6 +1,6 @@
|
||||
# These are supported funding model platforms
|
||||
|
||||
github: []
|
||||
github: [vladfrangu]
|
||||
patreon: vladfrangu
|
||||
open_collective: # Replace with a single Open Collective username
|
||||
ko_fi: wolfgalvlad
|
||||
|
||||
25
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
25
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Report incorrect or unexpected behavior of discord-api-types
|
||||
title: ''
|
||||
labels: 'bug'
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
<!-- Use Discord for questions: https://discord.gg/bRCvFy9 -->
|
||||
|
||||
**Please describe the problem you are having in as much detail as possible:**
|
||||
|
||||
**Include a reproducible code sample here, if possible:**
|
||||
|
||||
```ts
|
||||
// Place your code here
|
||||
```
|
||||
|
||||
**Further details:**
|
||||
|
||||
- Runtime:
|
||||
<!-- Complete whichever is applicable -->
|
||||
- Node.js version:
|
||||
- deno version:
|
||||
- Priority this issue should have – please be realistic and elaborate if possible:
|
||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Discord server
|
||||
url: https://discord.gg/bRCvFy9
|
||||
about: Please visit our Discord server for questions and support requests.
|
||||
21
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
21
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Request a feature for the discord-api-types library
|
||||
title: ''
|
||||
labels: 'discussion'
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
<!-- Use Discord for questions: https://discord.gg/bRCvFy9 -->
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Eg. I'm always frustrated when [...]
|
||||
|
||||
**Describe the ideal solution**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
3
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
3
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
**Please describe the changes this PR makes and why it should be merged:**
|
||||
|
||||
**Reference Discord API Docs PRs or commits:**
|
||||
8
.github/SUPPORT.md
vendored
Normal file
8
.github/SUPPORT.md
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
# Seeking support?
|
||||
|
||||
We only use this issue tracker for bug reports and feature request. We are not able to provide general support or answer questions in the form of GitHub issues.
|
||||
|
||||
For general questions about discord-api-types installation and use please ask in [GitHub Discussions](https://github.com/discordjs/discord-api-types/discussions),
|
||||
or in the dedicated support channels in our Discord server: https://discord.gg/bRCvFy9
|
||||
|
||||
Any issues that don't directly involve a bug or a feature request will likely be closed and redirected.
|
||||
63
.github/workflows/cicd.yml
vendored
Normal file
63
.github/workflows/cicd.yml
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
name: Continuous Integration / Deployment
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '**'
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
testing:
|
||||
name: ESLint and TypeScript compilation
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js 14
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run ESLint
|
||||
run: npm run test:lint
|
||||
|
||||
- name: Run TSC
|
||||
run: npm run build:ci
|
||||
|
||||
deno:
|
||||
name: Generate Deno compatible code
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs: testing
|
||||
# Run workflow only if testing passes
|
||||
if: needs.testing.result == 'success'
|
||||
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js 14
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build Files
|
||||
run: npm run build:deno
|
||||
|
||||
- name: Set Git User and Email
|
||||
run: |
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Commit and Push New Code
|
||||
run: |
|
||||
git add --all .
|
||||
git commit -m "build: deno build for ${GITHUB_SHA}" || true
|
||||
git push || true
|
||||
42
.github/workflows/codequality.yml
vendored
42
.github/workflows/codequality.yml
vendored
@@ -1,42 +0,0 @@
|
||||
name: Code Quality
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- main
|
||||
- stable
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
ESLint:
|
||||
name: ESLint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v1
|
||||
- name: Use Node.js 14
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
- name: Run ESLint
|
||||
uses: icrawl/action-eslint@v1
|
||||
with:
|
||||
custom-glob: '{v*,default,common}/**'
|
||||
|
||||
TypeScript:
|
||||
name: TypeScript
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v1
|
||||
- name: Use Node.js 14
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
- name: Run TSC
|
||||
uses: icrawl/action-tsc@v1
|
||||
49
.gitignore
vendored
49
.gitignore
vendored
@@ -1,19 +1,42 @@
|
||||
node_modules/
|
||||
|
||||
out/
|
||||
coverage/
|
||||
.nyc_output/
|
||||
|
||||
# Don't commit build outputs
|
||||
globals.js
|
||||
globals.*map
|
||||
globals.d.ts
|
||||
globals.mjs
|
||||
|
||||
v*/**/*.js
|
||||
v*/**/*.map
|
||||
v*/**/*.d.ts
|
||||
gateway/**/*.js
|
||||
gateway/**/*.map
|
||||
gateway/**/*.d.ts
|
||||
gateway/**/*.mjs
|
||||
|
||||
default/*.js
|
||||
default/*.map
|
||||
default/*.d.ts
|
||||
payloads/**/*.js
|
||||
payloads/**/*.map
|
||||
payloads/**/*.d.ts
|
||||
payloads/**/*.mjs
|
||||
|
||||
common/*.js
|
||||
common/*.map
|
||||
common/*.d.ts
|
||||
rest/**/*.js
|
||||
rest/**/*.map
|
||||
rest/**/*.d.ts
|
||||
rest/**/*.mjs
|
||||
|
||||
rpc/**/*.js
|
||||
rpc/**/*.map
|
||||
rpc/**/*.d.ts
|
||||
rpc/**/*.mjs
|
||||
|
||||
shortcuts/**/*.js
|
||||
shortcuts/**/*.map
|
||||
shortcuts/**/*.d.ts
|
||||
shortcuts/**/*.mjs
|
||||
|
||||
utils/**/*.js
|
||||
utils/**/*.map
|
||||
utils/**/*.d.ts
|
||||
utils/**/*.mjs
|
||||
|
||||
voice/**/*.js
|
||||
voice/**/*.map
|
||||
voice/**/*.d.ts
|
||||
voice/**/*.mjs
|
||||
|
||||
5
.npmrc
Normal file
5
.npmrc
Normal file
@@ -0,0 +1,5 @@
|
||||
audit=false
|
||||
fund=false
|
||||
legacy-peer-deps=true
|
||||
tag-version-prefix=""
|
||||
message="chore(release): %s :tada:"
|
||||
8
.prettierrc.json
Normal file
8
.prettierrc.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"printWidth": 120,
|
||||
"useTabs": true,
|
||||
"singleQuote": true,
|
||||
"quoteProps": "as-needed",
|
||||
"trailingComma": "all",
|
||||
"endOfLine": "lf"
|
||||
}
|
||||
4
.vscode/settings.json
vendored
Normal file
4
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"files.eol": "\n",
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
}
|
||||
289
CHANGELOG.md
Normal file
289
CHANGELOG.md
Normal file
@@ -0,0 +1,289 @@
|
||||
# [0.14.0](https://github.com/discordjs/discord-api-types/compare/0.13.3...0.14.0) (2021-04-11)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIMessage:** correct type for `application` ([ed2cbe8](https://github.com/discordjs/discord-api-types/commit/ed2cbe82c56f872ee01a9eb6991ef70dc22d8c1f))
|
||||
- **GatewayGuildMemberUpdateDispatchData:** correct types ([14f14e2](https://github.com/discordjs/discord-api-types/commit/14f14e227955af41ed2823f11c6e8d03d12549ba))
|
||||
- **GatewayPresenceUpdateData:** `activities` may not be `null` ([bb3cb04](https://github.com/discordjs/discord-api-types/commit/bb3cb04e016840f66eecbe39c2e07aea8ea12bc8))
|
||||
- **GatewayVoiceServerUpdateDispatchData:** `endpoint` is nullable ([e8203a1](https://github.com/discordjs/discord-api-types/commit/e8203a1112a834ce9aaae4ab95f711d3aaffc20f))
|
||||
- **GuildWelcomeScreenChannel:** document missing `description` property ([238695b](https://github.com/discordjs/discord-api-types/commit/238695b44d8547d51782e3d9d9729e2db85bc444))
|
||||
- **OAuth2:** `scope` can be optional / not required ([bbe56a9](https://github.com/discordjs/discord-api-types/commit/bbe56a97564ce8c317f291080327484f0d987e1c))
|
||||
- **OAuth2:** remove invalid parameters from refresh token request ([1c02450](https://github.com/discordjs/discord-api-types/commit/1c024507f3f55b922565845c2bedac615ffa24d5))
|
||||
- **RPC:** version `RPC` same as` rest`, export again in `shortcuts` ([67e0ba1](https://github.com/discordjs/discord-api-types/commit/67e0ba1834e6d9de9ad00bd452f5e8da59ff1cc6))
|
||||
- **Utils:** correct import for deno users ([42dd75f](https://github.com/discordjs/discord-api-types/commit/42dd75f2581b2a8862e4f0446b42ff838f923de0))
|
||||
|
||||
### chore
|
||||
|
||||
- **Gateway:** remove `guild_subscriptions` ([ab8b289](https://github.com/discordjs/discord-api-types/commit/ab8b289ac8f99fe1a998ef06320ad9046aafa1d2))
|
||||
- **GatewayReady:** un-document `private_channels` ([457edf4](https://github.com/discordjs/discord-api-types/commit/457edf4ed43327fb871d3b1638745b905518ef91))
|
||||
- **Integrations:** remove routes that bots can no longer interact with ([577c5bd](https://github.com/discordjs/discord-api-types/commit/577c5bd040dd1dc258ca6c414cf6ac69ae84916c))
|
||||
- **MessageGetReactions:** remove `before` pagination ([0ec26b7](https://github.com/discordjs/discord-api-types/commit/0ec26b731cda570f34e59e05a8c21f272b1fd64e))
|
||||
- **Oauth2Scopes:** remove `rpc.api` ([7ee8511](https://github.com/discordjs/discord-api-types/commit/7ee85113ea8107106460889a2eaa42b251ee05d0))
|
||||
- **Permissions:** rename `USE_APPLICATION_COMMANDS` to `USE_SLASH_COMMANDS` ([2aa7f7a](https://github.com/discordjs/discord-api-types/commit/2aa7f7a7b8da3d4d46a7743830562d996d32120b))
|
||||
- **UserFlags:** un-document `SYSTEM` flag ([1774d4c](https://github.com/discordjs/discord-api-types/commit/1774d4c4749d303f24bfb3c754cf79a4ca7ef699))
|
||||
|
||||
### Code Refactoring
|
||||
|
||||
- restructure module ([81cdfc2](https://github.com/discordjs/discord-api-types/commit/81cdfc2d9c523d98edd0a69f976879e848e1167b))
|
||||
|
||||
### Features
|
||||
|
||||
- **APIApplication:** document `terms_of_service` and `privacy_policy` ([598cbfb](https://github.com/discordjs/discord-api-types/commit/598cbfb958a67d5ba61696ba877ea0bae4c4be55))
|
||||
- **APIAttachment:** add `content_type` ([2d432d1](https://github.com/discordjs/discord-api-types/commit/2d432d145eb8a009b092b27b6231252d7b2f2823))
|
||||
- **APIChannel:** add `rtc_region` ([#108](https://github.com/discordjs/discord-api-types/issues/108)) ([07ba907](https://github.com/discordjs/discord-api-types/commit/07ba9072429dec85a13479dc211ec1f9d8788acf))
|
||||
- **APIChannel:** add `video_quality_mode` ([#106](https://github.com/discordjs/discord-api-types/issues/106)) ([d8d7bcc](https://github.com/discordjs/discord-api-types/commit/d8d7bccea617ad0d1150b9d2aed3b26ec1e4f99a))
|
||||
- **APIInteraction:** add type-check utilities ([3307201](https://github.com/discordjs/discord-api-types/commit/33072011c2ea9ace8350dedc0cd1068660dc2ece))
|
||||
- **Exports:** add `globals` to the exported sub-modules ([5d35f61](https://github.com/discordjs/discord-api-types/commit/5d35f61334480af983c4767373ef05e395da2e18))
|
||||
- **Gateway:** add `INTEGRATION_*` events ([9c3fab0](https://github.com/discordjs/discord-api-types/commit/9c3fab052619609eb543ff400c2b813b69c6b99f))
|
||||
- **GuildWelcomeScreen:** document `welcome-screen` endpoint ([169ecde](https://github.com/discordjs/discord-api-types/commit/169ecde47a6a911309630e952ab26b805ac87cf0))
|
||||
- **Interactions:** add batch command create / update ([edfe70a](https://github.com/discordjs/discord-api-types/commit/edfe70a1eeec9be1104ec68a20d95e83512b3268))
|
||||
- **Interactions:** add Slash Command Permissions ([f517f35](https://github.com/discordjs/discord-api-types/commit/f517f3596f458a2c2e4c4a26d5c13bbed4c4a71f))
|
||||
- **Invites:** document `target_application` & correct property names ([97c8ab3](https://github.com/discordjs/discord-api-types/commit/97c8ab3f5165c6f161e9338e944cff8b296756d5))
|
||||
- **MessageFlags:** `EPHEMERAL` desc and added `LOADING` ([#109](https://github.com/discordjs/discord-api-types/issues/109)) ([4462255](https://github.com/discordjs/discord-api-types/commit/4462255168af2ad66c9c7405500e80d3fa41de33))
|
||||
- **PatchAPIWebhookMessage:** add `file` property ([fc2f3c5](https://github.com/discordjs/discord-api-types/commit/fc2f3c58cf5ea2a8c0a1a14a62a16f432b1776e2))
|
||||
- **Webhook:** add & document `url` property ([77e5bb6](https://github.com/discordjs/discord-api-types/commit/77e5bb624d86e4bc8696c8dac4f513c27eb8aff1))
|
||||
- invite reminder system message type and flag ([#105](https://github.com/discordjs/discord-api-types/issues/105)) ([b90714f](https://github.com/discordjs/discord-api-types/commit/b90714f677c67c009ddb6d00734ab8998c194350))
|
||||
- stage channels! ([#107](https://github.com/discordjs/discord-api-types/issues/107)) ([6cd7542](https://github.com/discordjs/discord-api-types/commit/6cd75426c6d7da145b40a656e4c1a1d3d26bfb1f))
|
||||
|
||||
### BREAKING CHANGES
|
||||
|
||||
- **APIInteraction:** This commit removes the `guild_id` property from `APIDMInteraction`
|
||||
which allows type-checks to work with the `in` operator.
|
||||
Because of that, we also provide utility functions that help with those type checks.
|
||||
Use them in your code by importing the `Utils` object, or by directly importing them.
|
||||
Check the README for examples
|
||||
- **OAuth2:** This commit removes parameters that are not expected
|
||||
in the refresh token request body
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/eaa12cbc8f96cf7cfe8c530f88e60582c24ca5dd
|
||||
|
||||
- **GatewayReady:** This property has been deprecated for a while, and was
|
||||
returning an empty array for bot users. This commit removes it entirely
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/f36156dbb641f5c4d4f4593f345bfd6e27fdee08
|
||||
|
||||
- **Permissions:** This commit brings consistency with the documentation,
|
||||
where the permission is documented as `USE_SLASH_COMMANDS`, whereas the
|
||||
client has it as `USE_APPLICATION_COMMANDS` internally
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/c7d25885c5cd80a49b31609a40b70603b35f9dec
|
||||
|
||||
- **MessageGetReactions:** This query parameter is not usable and was not respected
|
||||
by the API.
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/f72b084773d4d3989fb19be4fb4d9cf276a1e6b3
|
||||
|
||||
- **OAuth2:** This removes the `scope` property from the authorization
|
||||
code flow, as it is not expected there.
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/57965033ab4216a0bb853e85d6912531cd5a9981
|
||||
|
||||
- **Gateway:** This removes `guild_subscriptions`, as it has been
|
||||
deprecated in favor of `intents`.
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/8de017436d37e56fab14cb8f68f0448a45ebc731
|
||||
|
||||
- **Oauth2Scopes:** This removes the `rpc.api` scope, as it has been removed
|
||||
from the documentation.
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/2641d9808f676e7316483d152cdb37ed1168f968
|
||||
|
||||
- **APIMessage:** This removes the `APIMessageApplication` interface, as it has
|
||||
been removed from the documentation, being replaced with the OAuth2 application.
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/ff0c831e424f1bc17dd3cde62da48d5c3d933e88
|
||||
|
||||
- **APIApplication:** This renames the `GatewayPresenceLimit` flag to
|
||||
`GatewayPresenceLimited`, for consistency with `GatewayGuildMembersLimited`
|
||||
and the documented name.
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/39b254bed1cc396c475e508a3f2bf328815605c9
|
||||
|
||||
- **GatewayVoiceServerUpdateDispatchData:** Any code that expects `endpoint` to never be null needs
|
||||
to be updated, and the conditions specified in the documentation need
|
||||
to be respected regarding that.
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/e887382fafd4c4417f7ba62963984f25bcb643f6
|
||||
|
||||
- **Invites:** This renames `target_user_type` to `target_type`,
|
||||
the actual value the API expects.
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/1b4e363e324eb1f49a47e32cb0108fbe276c8e0e
|
||||
|
||||
- **GatewayPresenceUpdateData:** Clearing `activities` is done by setting them to an empty
|
||||
array, not by setting them to `null`.
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/5bf598b864fb89262fce07137f68ce6e7e583432
|
||||
|
||||
- **UserFlags:** This removes a flag that bots should not use, as Discord
|
||||
said this is an internal flag.
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/9293f0d490ac6acf9d627e429e5a8131b303b528
|
||||
|
||||
- **Integrations:** This removes the 3 routes that bots can no longer access.
|
||||
|
||||
Reference: https://github.com/discord/discord-api-docs/commit/efe4e5808b6826d40302e265a5ae9b5b65d92fe7
|
||||
|
||||
- **Exports:** Certain objects from this file have been moved to their
|
||||
appropriate spot (such as JSON Error Codes)
|
||||
- Files have been moved around in order to keep them
|
||||
organized. Exports might also be missing, so please report if that is the
|
||||
case.
|
||||
|
||||
## [0.13.3](https://github.com/discordjs/discord-api-types/compare/0.13.2...0.13.3) (2021-03-28)
|
||||
|
||||
## [0.13.2](https://github.com/discordjs/discord-api-types/compare/0.13.1...0.13.2) (2021-03-28)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **ApplicationCommandInteractionDataOptionSubCommandGroup:** typo ([#102](https://github.com/discordjs/discord-api-types/issues/102)) ([15c171c](https://github.com/discordjs/discord-api-types/commit/15c171c558a10cd6d1c4880e725af0e63dd82255))
|
||||
|
||||
## [0.13.1](https://github.com/discordjs/discord-api-types/compare/0.13.0...0.13.1) (2021-03-27)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIInteractionResponse:** `data` should not always be present ([#100](https://github.com/discordjs/discord-api-types/issues/100)) ([ffcd95d](https://github.com/discordjs/discord-api-types/commit/ffcd95d597a5d1c5b3ea072cd1dfb44f079de4b7))
|
||||
|
||||
# [0.13.0](https://github.com/discordjs/discord-api-types/compare/0.12.1...0.13.0) (2021-03-27)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **deno:** replace `const enum` exports in deno with normal `enum`s ([#89](https://github.com/discordjs/discord-api-types/issues/89)) ([7343fab](https://github.com/discordjs/discord-api-types/commit/7343fabe82e4321808bac784aed600afa8cf4249))
|
||||
- **RESTPostAPIChannelMessageJSONBody:** mark `tts` as a full boolean ([#96](https://github.com/discordjs/discord-api-types/issues/96)) ([9d8d090](https://github.com/discordjs/discord-api-types/commit/9d8d090c9c6cd5be1f7b578b2f6a6387544f3359))
|
||||
- **RESTPostAPIGuildsJSONBody:** make some fields nullable ([#91](https://github.com/discordjs/discord-api-types/issues/91)) ([ae1900d](https://github.com/discordjs/discord-api-types/commit/ae1900dc2f65065153b1bf2437348e63b63db49e))
|
||||
|
||||
### Features
|
||||
|
||||
- **APIApplication:** add ApplicationFlags ([#92](https://github.com/discordjs/discord-api-types/issues/92)) ([92f76f1](https://github.com/discordjs/discord-api-types/commit/92f76f1a3c8acf80689b994e9bfaec70d198aaa1))
|
||||
- **APIApplicationCommandInteractionData:** add `resolved` ([#86](https://github.com/discordjs/discord-api-types/issues/86)) ([24155ae](https://github.com/discordjs/discord-api-types/commit/24155aeb71d46de48353ce01bfb48e197a84e59b))
|
||||
- **APIBaseInteraction:** add application_id ([#98](https://github.com/discordjs/discord-api-types/issues/98)) ([0582f88](https://github.com/discordjs/discord-api-types/commit/0582f883c517e5fdc2373ac0a85717a7bfeec018))
|
||||
- **APIInteraction:** DM slash commands and property descriptions ([#84](https://github.com/discordjs/discord-api-types/issues/84)) ([d0b3106](https://github.com/discordjs/discord-api-types/commit/d0b310675848f4724e47c490b06d828f7ede204c))
|
||||
- **APIInteractionResponse, APIInteractionResponseType:** update for UI changes ([#90](https://github.com/discordjs/discord-api-types/issues/90)) ([eafe7ba](https://github.com/discordjs/discord-api-types/commit/eafe7ba96fc6e771579850a8a7de36adade8efdc))
|
||||
- **APIMessage:** add `interaction` ([#93](https://github.com/discordjs/discord-api-types/issues/93)) ([0f29b32](https://github.com/discordjs/discord-api-types/commit/0f29b32e05abe89f70f72989024b9c63493782fa))
|
||||
- **APIMessageReferenceSend:** add `fail_if_not_exists` ([#82](https://github.com/discordjs/discord-api-types/issues/82)) ([855f36d](https://github.com/discordjs/discord-api-types/commit/855f36d9309ae69f57da723648d3791e3134089e))
|
||||
- **PermissionFlagsBits:** add `USE_APPLICATION_COMMANDS` ([#85](https://github.com/discordjs/discord-api-types/issues/85)) ([ceb787b](https://github.com/discordjs/discord-api-types/commit/ceb787ba36ed05f25f9acab86496d3054cb15013))
|
||||
- **rest:** api base routes ([#87](https://github.com/discordjs/discord-api-types/issues/87)) ([466fa95](https://github.com/discordjs/discord-api-types/commit/466fa95b0e239b7984275959886b995a5020640a))
|
||||
- add Application Command events ([#75](https://github.com/discordjs/discord-api-types/issues/75)) ([da2c2e9](https://github.com/discordjs/discord-api-types/commit/da2c2e9ada39482fce095c47339b40d6c24e683a))
|
||||
- add GET single Application Command ([#76](https://github.com/discordjs/discord-api-types/issues/76)) ([5826da2](https://github.com/discordjs/discord-api-types/commit/5826da22e30839b1f9fcd73479f8bc0f213001bd))
|
||||
- implement FormatPatterns ([#79](https://github.com/discordjs/discord-api-types/issues/79)) ([4e4a084](https://github.com/discordjs/discord-api-types/commit/4e4a0840036eddb89a1d49d69f59905dba206afb))
|
||||
- **OAuth2:** add `/oauth2/[@me](https://github.com/me)` route ([#73](https://github.com/discordjs/discord-api-types/issues/73)) ([84759d1](https://github.com/discordjs/discord-api-types/commit/84759d19bc4cd0f33f0a94608c1af2b4d6a820c6))
|
||||
- **Webhook:** add Edit Webhook Message result and error 50027 ([#71](https://github.com/discordjs/discord-api-types/issues/71)) ([4c77a5d](https://github.com/discordjs/discord-api-types/commit/4c77a5d90acf627574eff571a92a6703c6ea2d13))
|
||||
|
||||
## [0.12.1](https://github.com/discordjs/discord-api-types/compare/0.12.0...0.12.1) (2021-01-05)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- run deno workflow only on branch push ([#66](https://github.com/discordjs/discord-api-types/issues/66)) ([0ef4620](https://github.com/discordjs/discord-api-types/commit/0ef46202f6c8c257e6300e634b675e7e1b6ffa90))
|
||||
|
||||
### Features
|
||||
|
||||
- add Snowflake and Permissions types ([#69](https://github.com/discordjs/discord-api-types/issues/69)) ([549a6f0](https://github.com/discordjs/discord-api-types/commit/549a6f023698f05829f1dfdf1190c027a994d6cd))
|
||||
|
||||
# [0.12.0](https://github.com/discordjs/discord-api-types/compare/0.11.2...0.12.0) (2021-01-01)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIApplication:** flags should be omitted in REST, not optional everywhere ([#57](https://github.com/discordjs/discord-api-types/issues/57)) ([664ad80](https://github.com/discordjs/discord-api-types/commit/664ad800ccdfb84cc1547dd151c0f6e16157e04b))
|
||||
- **RESTPatchAPIChannelJSONBody:** add missing bitrate field ([#60](https://github.com/discordjs/discord-api-types/issues/60)) ([15892ec](https://github.com/discordjs/discord-api-types/commit/15892ec870ff818d7f66bd9b57969638e5f17e1f))
|
||||
|
||||
### Features
|
||||
|
||||
- **GatewayActivity:** add missing fields ([#39](https://github.com/discordjs/discord-api-types/issues/39)) ([dccdfe0](https://github.com/discordjs/discord-api-types/commit/dccdfe044fb4c02b6cfc910e2d39e469ebd9c75a))
|
||||
|
||||
## [0.11.2](https://github.com/discordjs/discord-api-types/compare/0.11.1...0.11.2) (2020-12-20)
|
||||
|
||||
## [0.11.1](https://github.com/discordjs/discord-api-types/compare/0.11.0...0.11.1) (2020-12-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIAuditLogEntry:** user_id is not nullable ([#52](https://github.com/discordjs/discord-api-types/issues/52)) ([2b89beb](https://github.com/discordjs/discord-api-types/commit/2b89beb52b66a4865124b75069ca6bc3d5886c48))
|
||||
- **RESTPostAPIGuildsJSONBody:** system_channel_flags is optional ([#53](https://github.com/discordjs/discord-api-types/issues/53)) ([ba4c0d7](https://github.com/discordjs/discord-api-types/commit/ba4c0d78f4ba3755f524b5f63420a36580a1a08e))
|
||||
|
||||
# [0.11.0](https://github.com/discordjs/discord-api-types/compare/0.10.0...0.11.0) (2020-12-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIGuildMember:** drop nullability of `pending` prop ([#49](https://github.com/discordjs/discord-api-types/issues/49)) ([c2f0dee](https://github.com/discordjs/discord-api-types/commit/c2f0deeebd28fa3a09f795d1b263ff8fd5d9ae4d))
|
||||
- **RESTPatchAPIGuildJSONBody:** multiple properties are actually nullable ([#48](https://github.com/discordjs/discord-api-types/issues/48)) ([018fc4f](https://github.com/discordjs/discord-api-types/commit/018fc4f8ea4d50f719820001822778079a055fa3))
|
||||
|
||||
# [0.10.0](https://github.com/discordjs/discord-api-types/compare/0.9.1...0.10.0) (2020-12-09)
|
||||
|
||||
### Features
|
||||
|
||||
- server templates ([#25](https://github.com/discordjs/discord-api-types/issues/25)) ([7d873f7](https://github.com/discordjs/discord-api-types/commit/7d873f73c7a8c64630c57d3eaf33d8c4913ed835))
|
||||
|
||||
## [0.9.1](https://github.com/discordjs/discord-api-types/compare/0.9.0...0.9.1) (2020-11-22)
|
||||
|
||||
# [0.9.0](https://github.com/discordjs/discord-api-types/compare/0.8.0...0.9.0) (2020-11-22)
|
||||
|
||||
### Features
|
||||
|
||||
- **Message:** reply updates ([#34](https://github.com/discordjs/discord-api-types/issues/34)) ([21b9ae4](https://github.com/discordjs/discord-api-types/commit/21b9ae4aaf29c276d1a6ccc4c79ace8d64a53e9d))
|
||||
- **Message:** Stickers ([#32](https://github.com/discordjs/discord-api-types/issues/32)) ([39ea1f4](https://github.com/discordjs/discord-api-types/commit/39ea1f4429e5194576200635f885ab102763060b))
|
||||
|
||||
# [0.8.0](https://github.com/discordjs/discord-api-types/compare/0.7.0...0.8.0) (2020-11-03)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- webhookPlatform route ([#36](https://github.com/discordjs/discord-api-types/issues/36)) ([666a0c7](https://github.com/discordjs/discord-api-types/commit/666a0c71528e385677570b5359ba266276202a95))
|
||||
- **GatewayPresence:** correct type for sent activity objects ([#30](https://github.com/discordjs/discord-api-types/issues/30)) ([61db1ee](https://github.com/discordjs/discord-api-types/commit/61db1eee256037588ef27533c234cb01f1f699a4))
|
||||
|
||||
# [0.7.0](https://github.com/discordjs/discord-api-types/compare/0.6.0...0.7.0) (2020-10-18)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **GatewayHeartbeat:** d is nullable ([#26](https://github.com/discordjs/discord-api-types/issues/26)) ([0982610](https://github.com/discordjs/discord-api-types/commit/098261073163eeb4fcfc217dea3511ccea1f27c5))
|
||||
- **GatewayIdentify:** use correct presence interface ([#28](https://github.com/discordjs/discord-api-types/issues/28)) ([91c63f0](https://github.com/discordjs/discord-api-types/commit/91c63f05ca1e8e92c4c1df124365405fe8d34108))
|
||||
|
||||
### Features
|
||||
|
||||
- **APIGuildWidgetMember:** add activity and use proper status type ([#24](https://github.com/discordjs/discord-api-types/issues/24)) ([f058ed6](https://github.com/discordjs/discord-api-types/commit/f058ed6aa1f7593c22e4a3f0c9dd2f4bbd0190dc))
|
||||
|
||||
# [0.6.0](https://github.com/discordjs/discord-api-types/compare/0.5.0...0.6.0) (2020-10-04)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIChannel:** position is optional ([#21](https://github.com/discordjs/discord-api-types/issues/21)) ([061a147](https://github.com/discordjs/discord-api-types/commit/061a147fbb381738b28ca3fb73fa1a7be0e1b108))
|
||||
- **RESTPostAPIGuildsJSONBody:** use correct types ([#22](https://github.com/discordjs/discord-api-types/issues/22)) ([dcf8ddf](https://github.com/discordjs/discord-api-types/commit/dcf8ddf25b26a9c72dbb1b5712503e6d5e516ad1))
|
||||
|
||||
### Features
|
||||
|
||||
- v8 support ([#14](https://github.com/discordjs/discord-api-types/issues/14)) ([11b95c8](https://github.com/discordjs/discord-api-types/commit/11b95c86099e609128a8ca76d06d43498fae72f5))
|
||||
|
||||
# [0.5.0](https://github.com/discordjs/discord-api-types/compare/0.4.1...0.5.0) (2020-09-19)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- correct typos ([#18](https://github.com/discordjs/discord-api-types/issues/18)) ([97c7b4e](https://github.com/discordjs/discord-api-types/commit/97c7b4ea24852f49b5f952e81a0e6f21ed405316))
|
||||
- **APIUser:** premium_type is optional ([#19](https://github.com/discordjs/discord-api-types/issues/19)) ([8cf1ba3](https://github.com/discordjs/discord-api-types/commit/8cf1ba3f4f3c28f962afad4bfcc02f5bb897286a))
|
||||
- **GatewayIdentifyProperties:** rename `device` to `$device` ([#17](https://github.com/discordjs/discord-api-types/issues/17)) ([9e5c5b5](https://github.com/discordjs/discord-api-types/commit/9e5c5b5aac30e931255f39790123b4bd3458a16f))
|
||||
|
||||
## [0.4.1](https://github.com/discordjs/discord-api-types/compare/0.4.0...0.4.1) (2020-09-18)
|
||||
|
||||
### Features
|
||||
|
||||
- add oauth2 types ([#16](https://github.com/discordjs/discord-api-types/issues/16)) ([10fdeba](https://github.com/discordjs/discord-api-types/commit/10fdeba1286e385e087d6c9405872f948507f183))
|
||||
|
||||
# [0.4.0](https://github.com/discordjs/discord-api-types/compare/0.3.0...0.4.0) (2020-09-16)
|
||||
|
||||
### Features
|
||||
|
||||
- **ActivityType:** add Competing activity type ([#11](https://github.com/discordjs/discord-api-types/issues/11)) ([94d0a16](https://github.com/discordjs/discord-api-types/commit/94d0a1680532412c8d5f9659056f87a37d1def7d))
|
||||
|
||||
# [0.3.0](https://github.com/discordjs/discord-api-types/compare/v0.2.0...0.3.0) (2020-09-14)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **APIMessage:** Correct APIMessage#mentions type ([#9](https://github.com/discordjs/discord-api-types/issues/9)) ([fe1868b](https://github.com/discordjs/discord-api-types/commit/fe1868b04f8a9f4be1c09ffba0afa60f4def8595))
|
||||
|
||||
# [0.2.0](https://github.com/discordjs/discord-api-types/compare/v0.1.1...v0.2.0) (2020-09-10)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- **Readme:** add missing semicolon ([#1](https://github.com/discordjs/discord-api-types/issues/1)) ([5e3e101](https://github.com/discordjs/discord-api-types/commit/5e3e1016b5fe274d33503d36771fc276fd384ccf))
|
||||
|
||||
## [0.1.1](https://github.com/discordjs/discord-api-types/compare/767a833a12a8268b9f1b780f338da6f28cefa5cd...v0.1.1) (2020-08-22)
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- set target version to ES2020 ([767a833](https://github.com/discordjs/discord-api-types/commit/767a833a12a8268b9f1b780f338da6f28cefa5cd))
|
||||
87
README.md
87
README.md
@@ -1,9 +1,11 @@
|
||||
<div style="text-align:center;"><h1>Discord API Types</h1></div>
|
||||
# Discord API Types
|
||||
|
||||
[](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
|
||||
[](https://www.npmjs.com/package/discord-api-types)
|
||||
[](https://deno.land/x/discord_api_types)
|
||||
[](https://www.patreon.com/vladfrangu)
|
||||
[](https://ko-fi.com/wolfgalvlad)
|
||||
[](https://github.com/sponsors/vladfrangu)
|
||||
|
||||
Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro).
|
||||
|
||||
@@ -17,11 +19,62 @@ yarn add discord-api-types
|
||||
pnpm add discord-api-types
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples
|
||||
|
||||
```js
|
||||
const { APIUser } = require('discord-api-types/v8');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { APIUser } from 'discord-api-types/v8';
|
||||
```
|
||||
|
||||
You may also import just certain parts of the module that you need. The possible values are: `globals`, `gateway`, `gateway/v*`, `payloads`, `payloads/v*`, `rest`, `rest/v*`, `rpc`, `rpc/v*`, `utils`, `utils/v*`, `voice`, and `voice/v*`. Below are some examples
|
||||
|
||||
```js
|
||||
const { GatewayVersion } = require('discord-api-types/gateway/v8');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { GatewayVersion } from 'discord-api-types/gateway/v8';
|
||||
```
|
||||
|
||||
> _**Note:** The `v*` exports (`discord-api-type/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
|
||||
|
||||
### Deno
|
||||
|
||||
We also provide typings compatible with the [deno](https://deno.land/) runtime. You have 3 ways you can import them:
|
||||
|
||||
1. Directly from GitHub
|
||||
|
||||
```ts
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/shortcuts/v8/mod.ts';
|
||||
```
|
||||
|
||||
2. From [deno.land/x](https://deno.land/x)
|
||||
|
||||
```ts
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://deno.land/x/discord_api_types/shortcuts/v8.ts';
|
||||
```
|
||||
|
||||
3. From [skypack.dev](https://www.skypack.dev/)
|
||||
|
||||
```ts
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/shortcuts/v8?dts';
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
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.
|
||||
|
||||
@@ -39,32 +92,6 @@ The exports of each API version is split into three main parts:
|
||||
|
||||
- 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 `common` directory. 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.
|
||||
|
||||
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means *and have received the green light to be used*). For clarification's sake, this means that properties that are only known through the process of datamining and have not yet been confirmed in a way as described will NOT be included.
|
||||
|
||||
## Usage
|
||||
|
||||
You can `require` / `import` the module directly, which will give you the latest types as of the current API version. This is considered the `default` version and will be updated according to Discord's default API version; this means it may break at any point in time.
|
||||
|
||||
> We **strongly recommend** you use a version when importing this module! This will prevent breaking changes when updating the module.
|
||||
|
||||
```js
|
||||
const { APIUser } = require('discord-api-types');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { APIUser } from 'discord-api-types';
|
||||
```
|
||||
|
||||
You should instead consider adding the API version you want to target by appending `/v*`, where the `*` represents the API version.
|
||||
|
||||
```js
|
||||
const { APIUser } = require('discord-api-types/v6');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { APIUser } from 'discord-api-types/v6';
|
||||
```
|
||||
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means _and have received the green light to be used_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will **NOT** be included.
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
// This file exports all the types available in the default API version
|
||||
// Thereby, things MAY break in the future
|
||||
|
||||
export * from '../v6';
|
||||
21
deno/LICENSE
Normal file
21
deno/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 vladfrangu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
97
deno/README.md
Normal file
97
deno/README.md
Normal file
@@ -0,0 +1,97 @@
|
||||
# Discord API Types
|
||||
|
||||
[](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
|
||||
[](https://www.npmjs.com/package/discord-api-types)
|
||||
[](https://deno.land/x/discord_api_types)
|
||||
[](https://www.patreon.com/vladfrangu)
|
||||
[](https://ko-fi.com/wolfgalvlad)
|
||||
[](https://github.com/sponsors/vladfrangu)
|
||||
|
||||
Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro).
|
||||
|
||||
## Installation
|
||||
|
||||
Install with [npm](https://www.npmjs.com/) / [yarn](https://yarnpkg.com) / [pnpm](https://pnpm.js.org/):
|
||||
|
||||
```sh
|
||||
npm install discord-api-types
|
||||
yarn add discord-api-types
|
||||
pnpm add discord-api-types
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
You can only import this module by specifying the API version you want to target. Append `/v*` to the import path, where the `*` represents the API version. Below are some examples
|
||||
|
||||
```js
|
||||
const { APIUser } = require('discord-api-types/v8');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { APIUser } from 'discord-api-types/v8';
|
||||
```
|
||||
|
||||
You may also import just certain parts of the module that you need. The possible values are: `globals`, `gateway`, `gateway/v*`, `payloads`, `payloads/v*`, `rest`, `rest/v*`, `rpc`, `rpc/v*`, `utils`, `utils/v*`, `voice`, and `voice/v*`. Below are some examples
|
||||
|
||||
```js
|
||||
const { GatewayVersion } = require('discord-api-types/gateway/v8');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { GatewayVersion } from 'discord-api-types/gateway/v8';
|
||||
```
|
||||
|
||||
> _**Note:** The `v*` exports (`discord-api-type/v*`) include the appropriate version of `gateway`, `payloads`, `rest`, `rpc`, and `utils` you specified, alongside the `globals` exports_
|
||||
|
||||
### Deno
|
||||
|
||||
We also provide typings compatible with the [deno](https://deno.land/) runtime. You have 3 ways you can import them:
|
||||
|
||||
1. Directly from GitHub
|
||||
|
||||
```ts
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/deno/shortcuts/v8/mod.ts';
|
||||
```
|
||||
|
||||
2. From [deno.land/x](https://deno.land/x)
|
||||
|
||||
```ts
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://deno.land/x/discord_api_types/shortcuts/v8.ts';
|
||||
```
|
||||
|
||||
3. From [skypack.dev](https://www.skypack.dev/)
|
||||
|
||||
```ts
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/shortcuts/v8?dts';
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
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 `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.
|
||||
|
||||
- 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`.
|
||||
|
||||
- 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.
|
||||
|
||||
- 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).
|
||||
|
||||
- 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.
|
||||
|
||||
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means _and have received the green light to be used_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will **NOT** be included.
|
||||
8
deno/gateway/common.ts
Normal file
8
deno/gateway/common.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params
|
||||
*/
|
||||
export interface GatewayURLQuery {
|
||||
v: string;
|
||||
encoding: 'json' | 'etf';
|
||||
compress?: 'zlib-stream';
|
||||
}
|
||||
4
deno/gateway/mod.ts
Normal file
4
deno/gateway/mod.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// This file exports all the types available in the recommended gateway version
|
||||
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
|
||||
|
||||
export * from './v8.ts';
|
||||
821
deno/gateway/v6.ts
Normal file
821
deno/gateway/v6.ts
Normal file
@@ -0,0 +1,821 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
*/
|
||||
|
||||
import type {
|
||||
APIChannel,
|
||||
APIEmoji,
|
||||
APIGuild,
|
||||
APIGuildMember,
|
||||
APIMessage,
|
||||
APIRole,
|
||||
APIUnavailableGuild,
|
||||
APIUser,
|
||||
GatewayActivity,
|
||||
GatewayPresenceUpdate as RawGatewayPresenceUpdate,
|
||||
GatewayVoiceState,
|
||||
InviteTargetUserType,
|
||||
PresenceUpdateStatus,
|
||||
} from '../payloads/v6/mod.ts';
|
||||
|
||||
export * from './common.ts';
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export const GatewayVersion = '6';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GatewayOPCodes {
|
||||
Dispatch,
|
||||
Heartbeat,
|
||||
Identify,
|
||||
PresenceUpdate,
|
||||
VoiceStateUpdate,
|
||||
|
||||
Resume = 6,
|
||||
Reconnect,
|
||||
RequestGuildMembers,
|
||||
InvalidSession,
|
||||
Hello,
|
||||
HeartbeatAck,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GatewayCloseCodes {
|
||||
UnknownError = 4000,
|
||||
UnknownOpCode,
|
||||
DecodeError,
|
||||
NotAuthenticated,
|
||||
AuthenticationFailed,
|
||||
AlreadyAuthenticated,
|
||||
|
||||
InvalidSeq = 4007,
|
||||
RateLimited,
|
||||
SessionTimedOut,
|
||||
InvalidShard,
|
||||
ShardingRequired,
|
||||
InvalidAPIVersion,
|
||||
InvalidIntents,
|
||||
DisallowedIntents,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum VoiceOPCodes {
|
||||
Identify,
|
||||
SelectProtocol,
|
||||
Ready,
|
||||
Heartbeat,
|
||||
SessionDescription,
|
||||
Speaking,
|
||||
HeartbeatAck,
|
||||
Resume,
|
||||
Hello,
|
||||
Resumed,
|
||||
|
||||
ClientDisconnect = 13,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum VoiceCloseCodes {
|
||||
UnknownOpCode = 4001,
|
||||
|
||||
NotAuthenticated = 4003,
|
||||
AuthenticationFailed,
|
||||
AlreadyAuthenticated,
|
||||
SessionNoLongerValid,
|
||||
|
||||
SessionTimeout = 4009,
|
||||
|
||||
ServerNotFound = 4011,
|
||||
UnknownProtocol,
|
||||
|
||||
Disconnected = 4014,
|
||||
VoiceServerCrashed,
|
||||
UnknownEncryptionMode,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#list-of-intents
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GatewayIntentBits {
|
||||
GUILDS = 1 << 0,
|
||||
GUILD_MEMBERS = 1 << 1,
|
||||
GUILD_BANS = 1 << 2,
|
||||
GUILD_EMOJIS = 1 << 3,
|
||||
GUILD_INTEGRATIONS = 1 << 4,
|
||||
GUILD_WEBHOOKS = 1 << 5,
|
||||
GUILD_INVITES = 1 << 6,
|
||||
GUILD_VOICE_STATES = 1 << 7,
|
||||
GUILD_PRESENCES = 1 << 8,
|
||||
GUILD_MESSAGES = 1 << 9,
|
||||
GUILD_MESSAGE_REACTIONS = 1 << 10,
|
||||
GUILD_MESSAGE_TYPING = 1 << 11,
|
||||
DIRECT_MESSAGES = 1 << 12,
|
||||
DIRECT_MESSAGE_REACTIONS = 1 << 13,
|
||||
DIRECT_MESSAGE_TYPING = 1 << 14,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GatewayDispatchEvents {
|
||||
Ready = 'READY',
|
||||
Resumed = 'RESUMED',
|
||||
ChannelCreate = 'CHANNEL_CREATE',
|
||||
ChannelUpdate = 'CHANNEL_UPDATE',
|
||||
ChannelDelete = 'CHANNEL_DELETE',
|
||||
ChannelPinsUpdate = 'CHANNEL_PINS_UPDATE',
|
||||
GuildCreate = 'GUILD_CREATE',
|
||||
GuildUpdate = 'GUILD_UPDATE',
|
||||
GuildDelete = 'GUILD_DELETE',
|
||||
GuildBanAdd = 'GUILD_BAN_ADD',
|
||||
GuildBanRemove = 'GUILD_BAN_REMOVE',
|
||||
GuildEmojisUpdate = 'GUILD_EMOJIS_UPDATE',
|
||||
GuildIntegrationsUpdate = 'GUILD_INTEGRATIONS_UPDATE',
|
||||
GuildMemberAdd = 'GUILD_MEMBER_ADD',
|
||||
GuildMemberRemove = 'GUILD_MEMBER_REMOVE',
|
||||
GuildMemberUpdate = 'GUILD_MEMBER_UPDATE',
|
||||
GuildMembersChunk = 'GUILD_MEMBERS_CHUNK',
|
||||
GuildRoleCreate = 'GUILD_ROLE_CREATE',
|
||||
GuildRoleUpdate = 'GUILD_ROLE_UPDATE',
|
||||
GuildRoleDelete = 'GUILD_ROLE_DELETE',
|
||||
InviteCreate = 'INVITE_CREATE',
|
||||
InviteDelete = 'INVITE_DELETE',
|
||||
MessageCreate = 'MESSAGE_CREATE',
|
||||
MessageUpdate = 'MESSAGE_UPDATE',
|
||||
MessageDelete = 'MESSAGE_DELETE',
|
||||
MessageDeleteBulk = 'MESSAGE_DELETE_BULK',
|
||||
MessageReactionAdd = 'MESSAGE_REACTION_ADD',
|
||||
MessageReactionRemove = 'MESSAGE_REACTION_REMOVE',
|
||||
MessageReactionRemoveAll = 'MESSAGE_REACTION_REMOVE_ALL',
|
||||
MessageReactionRemoveEmoji = 'MESSAGE_REACTION_REMOVE_EMOJI',
|
||||
PresenceUpdate = 'PRESENCE_UPDATE',
|
||||
TypingStart = 'TYPING_START',
|
||||
UserUpdate = 'USER_UPDATE',
|
||||
VoiceStateUpdate = 'VOICE_STATE_UPDATE',
|
||||
VoiceServerUpdate = 'VOICE_SERVER_UPDATE',
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewaySendPayload =
|
||||
| GatewayHeartbeat
|
||||
| GatewayIdentify
|
||||
| GatewayUpdatePresence
|
||||
| GatewayVoiceStateUpdate
|
||||
| GatewayResume
|
||||
| GatewayRequestGuildMembers;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayReceivePayload =
|
||||
| GatewayHello
|
||||
| GatewayHeartbeatRequest
|
||||
| GatewayHeartbeatAck
|
||||
| GatewayInvalidSession
|
||||
| GatewayReconnect
|
||||
| GatewayDispatchPayload;
|
||||
|
||||
/**
|
||||
* @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
|
||||
| GatewayGuildEmojisUpdateDispatch
|
||||
| GatewayGuildIntegrationsUpdateDispatch
|
||||
| GatewayGuildMemberAddDispatch
|
||||
| GatewayGuildMemberRemoveDispatch
|
||||
| GatewayGuildMemberUpdateDispatch
|
||||
| GatewayGuildMembersChunkDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayGuildRoleDeleteDispatch
|
||||
| GatewayInviteCreateDispatch
|
||||
| GatewayInviteDeleteDispatch
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageUpdateDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveEmojiDispatch
|
||||
| GatewayPresenceUpdateDispatch
|
||||
| GatewayTypingStartDispatch
|
||||
| GatewayUserUpdateDispatch
|
||||
| GatewayVoiceStateUpdateDispatch
|
||||
| GatewayVoiceServerUpdateDispatch
|
||||
| GatewayWebhooksUpdateDispatch;
|
||||
|
||||
// #region Dispatch Payloads
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#hello
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHello extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.Hello;
|
||||
d: {
|
||||
heartbeat_interval: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHeartbeatRequest extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.Heartbeat;
|
||||
d: never;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating-example-gateway-heartbeat-ack
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHeartbeatAck extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.HeartbeatAck;
|
||||
d: never;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invalid-session
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayInvalidSession extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.InvalidSession;
|
||||
d: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#reconnect
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayReconnect extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.Reconnect;
|
||||
d: never;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#ready
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayReadyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.Ready,
|
||||
{
|
||||
v: number;
|
||||
user: APIUser;
|
||||
session_id: string;
|
||||
private_channels: [];
|
||||
guilds: APIUnavailableGuild[];
|
||||
shard?: [number, number];
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#resumed
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
|
||||
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-create
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-update
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-delete
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ChannelCreate | GatewayDispatchEvents.ChannelDelete | GatewayDispatchEvents.ChannelUpdate,
|
||||
APIChannel
|
||||
>;
|
||||
/* eslint-enable @typescript-eslint/indent */
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-pins-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelPinsUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ChannelPinsUpdate,
|
||||
{
|
||||
guild_id?: string;
|
||||
channel_id: string;
|
||||
last_pin_timestamp?: string;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildCreate | GatewayDispatchEvents.GuildUpdate,
|
||||
APIGuild
|
||||
>;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-delete
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildDelete, APIUnavailableGuild>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-ban-remove
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildBanModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildBanAdd | GatewayDispatchEvents.GuildBanRemove,
|
||||
{
|
||||
guild_id: string;
|
||||
user: APIUser;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-emojis-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildEmojisUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildEmojisUpdate,
|
||||
{
|
||||
guild_id: string;
|
||||
emojis: APIEmoji[];
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-integrations-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildIntegrationsUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildIntegrationsUpdate,
|
||||
{ guild_id: string }
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-add
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMemberAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildMemberAdd,
|
||||
APIGuildMember & { guild_id: string }
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-remove
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMemberRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildMemberRemove,
|
||||
{
|
||||
guild_id: string;
|
||||
user: APIUser;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildMemberUpdate,
|
||||
Omit<APIGuildMember, 'deaf' | 'mute'> & {
|
||||
guild_id: string;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-members-chunk
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMembersChunkDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildMembersChunk,
|
||||
{
|
||||
guild_id: string;
|
||||
members: APIGuildMember[];
|
||||
chunk_index?: number;
|
||||
chunk_count?: number;
|
||||
not_found?: unknown[];
|
||||
presences?: RawGatewayPresenceUpdate[];
|
||||
nonce?: string;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildRoleCreate | GatewayDispatchEvents.GuildRoleUpdate,
|
||||
{
|
||||
guild_id: string;
|
||||
role: APIRole;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-delete
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildRoleDelete,
|
||||
{
|
||||
guild_id: string;
|
||||
role_id: string;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-create
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayInviteCreateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.InviteCreate,
|
||||
{
|
||||
channel_id: string;
|
||||
code: string;
|
||||
created_at: number;
|
||||
guild_id?: string;
|
||||
inviter?: APIUser;
|
||||
max_age: number;
|
||||
max_uses: number;
|
||||
target_user?: APIUser;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
temporary: boolean;
|
||||
uses: 0;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-delete
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayInviteDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.InviteDelete,
|
||||
{
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
code: string;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-create
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageCreateDispatch = DataPayload<GatewayDispatchEvents.MessageCreate, APIMessage>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageUpdate,
|
||||
{ id: string; channel_id: string } & Partial<APIMessage>
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageDelete,
|
||||
{
|
||||
id: string;
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete-bulk
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageDeleteBulkDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageDeleteBulk,
|
||||
{
|
||||
ids: string[];
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-add
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatch = ReactionData<GatewayDispatchEvents.MessageReactionAdd>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveAllDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionRemoveAll,
|
||||
MessageReactionRemoveData
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionRemoveEmoji,
|
||||
MessageReactionRemoveData & {
|
||||
emoji: APIEmoji;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#presence-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayPresenceUpdateDispatch = DataPayload<GatewayDispatchEvents.PresenceUpdate, RawGatewayPresenceUpdate>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#typing-start
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayTypingStartDispatch = DataPayload<
|
||||
GatewayDispatchEvents.TypingStart,
|
||||
{
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
user_id: string;
|
||||
timestamp: number;
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#user-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUpdate, APIUser>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-state-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayVoiceStateUpdateDispatch = DataPayload<GatewayDispatchEvents.VoiceStateUpdate, GatewayVoiceState>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-server-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayVoiceServerUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.VoiceServerUpdate,
|
||||
{
|
||||
token: string;
|
||||
guild_id: string;
|
||||
endpoint: string;
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#webhooks-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayWebhooksUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.WebhooksUpdate,
|
||||
{
|
||||
guild_id: string;
|
||||
channel_id: string;
|
||||
}
|
||||
>;
|
||||
|
||||
// #endregion Dispatch Payloads
|
||||
|
||||
// #region Sendable Payloads
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHeartbeat {
|
||||
op: GatewayOPCodes.Heartbeat;
|
||||
d: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayIdentifyProperties {
|
||||
$os: string;
|
||||
$browser: string;
|
||||
$device: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#identify
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayIdentify {
|
||||
op: GatewayOPCodes.Identify;
|
||||
d: {
|
||||
token: string;
|
||||
properties: GatewayIdentifyProperties;
|
||||
compress?: boolean;
|
||||
large_threshold?: number;
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
shard?: [shard_id: number, shard_count: number];
|
||||
presence?: RawGatewayPresenceUpdate;
|
||||
guild_subscriptions?: boolean;
|
||||
intents?: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#resume
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayResume {
|
||||
op: GatewayOPCodes.Resume;
|
||||
d: {
|
||||
token: string;
|
||||
session_id: string;
|
||||
seq: number;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#request-guild-members
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayRequestGuildMembers {
|
||||
op: GatewayOPCodes.RequestGuildMembers;
|
||||
d: {
|
||||
guild_id: string | string[];
|
||||
query?: string;
|
||||
limit: number;
|
||||
presences?: boolean;
|
||||
user_ids?: string | string[];
|
||||
nonce?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-voice-state
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayVoiceStateUpdate {
|
||||
op: GatewayOPCodes.VoiceStateUpdate;
|
||||
d: {
|
||||
guild_id: string;
|
||||
channel_id: string | null;
|
||||
self_mute: boolean;
|
||||
self_deaf: boolean;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-status
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayUpdatePresence {
|
||||
op: GatewayOPCodes.PresenceUpdate;
|
||||
d: GatewayPresenceUpdateData;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-status-gateway-status-update-structure
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayPresenceUpdateData {
|
||||
since: number | null;
|
||||
game: GatewayActivity | null;
|
||||
status: PresenceUpdateStatus;
|
||||
afk: boolean;
|
||||
}
|
||||
|
||||
// #endregion Sendable Payloads
|
||||
|
||||
// #region Shared
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
interface BasePayload {
|
||||
op: GatewayOPCodes;
|
||||
s: number;
|
||||
d?: unknown;
|
||||
t?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
type NonDispatchPayload = Omit<BasePayload, 't'>;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
interface DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends BasePayload {
|
||||
op: GatewayOPCodes.Dispatch;
|
||||
t: Event;
|
||||
d: D;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = DataPayload<
|
||||
E,
|
||||
Omit<
|
||||
{
|
||||
user_id: string;
|
||||
channel_id: string;
|
||||
message_id: string;
|
||||
guild_id?: string;
|
||||
member?: APIGuildMember;
|
||||
emoji: APIEmoji;
|
||||
},
|
||||
O
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
interface MessageReactionRemoveData {
|
||||
channel_id: string;
|
||||
message_id: string;
|
||||
guild_id?: string;
|
||||
}
|
||||
// #endregion Shared
|
||||
1554
deno/gateway/v8.ts
Normal file
1554
deno/gateway/v8.ts
Normal file
File diff suppressed because it is too large
Load Diff
70
deno/globals.ts
Normal file
70
deno/globals.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#snowflakes
|
||||
*/
|
||||
export type Snowflake = `${bigint}`;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions
|
||||
* @internal
|
||||
*/
|
||||
export type Permissions = `${bigint}`;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#message-formatting-formats
|
||||
*/
|
||||
export const FormattingPatterns = {
|
||||
/**
|
||||
* Regular expression for matching a user mention, strictly without a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
User: /<@(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a user mention, strictly with a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
UserWithNickname: /<@!(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a user mention, with or without a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
UserWithOptionalNickname: /<@!?(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a channel mention
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
Channel: /<#(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a role mention
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
Role: /<@&(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a custom emoji, either static or animated
|
||||
*
|
||||
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
Emoji: /<(?<animated>a)?:(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching strictly an animated custom emoji
|
||||
*
|
||||
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
AnimatedEmoji: /<(?<animated>a):(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching strictly a static custom emoji
|
||||
*
|
||||
* The `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
StaticEmoji: /<:(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Freezes the formatting patterns
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(FormattingPatterns);
|
||||
4
deno/payloads/mod.ts
Normal file
4
deno/payloads/mod.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// This file exports all the payloads available in the recommended API version
|
||||
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
|
||||
|
||||
export * from './v8/mod.ts';
|
||||
547
deno/payloads/v6/auditLog.ts
Normal file
547
deno/payloads/v6/auditLog.ts
Normal file
@@ -0,0 +1,547 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/audit-log
|
||||
*/
|
||||
|
||||
import type { APIOverwrite, ChannelType } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildMFALevel,
|
||||
GuildVerificationLevel,
|
||||
IntegrationExpireBehavior,
|
||||
} from './guild.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIWebhook } from './webhook.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIAuditLog {
|
||||
webhooks: APIWebhook[];
|
||||
users: APIUser[];
|
||||
audit_log_entries: APIAuditLogEntry[];
|
||||
integrations: APIGuildIntegration[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIAuditLogEntry {
|
||||
target_id: string | null;
|
||||
changes?: APIAuditLogChange[];
|
||||
user_id: string | null;
|
||||
id: string;
|
||||
action_type: AuditLogEvent;
|
||||
options?: APIAuditLogOptions;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum AuditLogEvent {
|
||||
GUILD_UPDATE = 1,
|
||||
|
||||
CHANNEL_CREATE = 10,
|
||||
CHANNEL_UPDATE,
|
||||
CHANNEL_DELETE,
|
||||
CHANNEL_OVERWRITE_CREATE,
|
||||
CHANNEL_OVERWRITE_UPDATE,
|
||||
CHANNEL_OVERWRITE_DELETE,
|
||||
|
||||
MEMBER_KICK = 20,
|
||||
MEMBER_PRUNE,
|
||||
MEMBER_BAN_ADD,
|
||||
MEMBER_BAN_REMOVE,
|
||||
MEMBER_UPDATE,
|
||||
MEMBER_ROLE_UPDATE,
|
||||
MEMBER_MOVE,
|
||||
MEMBER_DISCONNECT,
|
||||
BOT_ADD,
|
||||
|
||||
ROLE_CREATE = 30,
|
||||
ROLE_UPDATE,
|
||||
ROLE_DELETE,
|
||||
|
||||
INVITE_CREATE = 40,
|
||||
INVITE_UPDATE,
|
||||
INVITE_DELETE,
|
||||
|
||||
WEBHOOK_CREATE = 50,
|
||||
WEBHOOK_UPDATE,
|
||||
WEBHOOK_DELETE,
|
||||
|
||||
EMOJI_CREATE = 60,
|
||||
EMOJI_UPDATE,
|
||||
EMOJI_DELETE,
|
||||
|
||||
MESSAGE_DELETE = 72,
|
||||
MESSAGE_BULK_DELETE,
|
||||
MESSAGE_PIN,
|
||||
MESSAGE_UNPIN,
|
||||
|
||||
INTEGRATION_CREATE = 80,
|
||||
INTEGRATION_UPDATE,
|
||||
INTEGRATION_DELETE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIAuditLogOptions {
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
delete_member_days?: string;
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
members_removed?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_MOVE
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
* - MESSAGE_DELETE
|
||||
*/
|
||||
channel_id?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
*/
|
||||
message_id?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - MESSAGE_DELETE
|
||||
* - MESSAGE_BULK_DELETE
|
||||
* - MEMBER_DISCONNECT
|
||||
* - MEMBER_MOVE
|
||||
*/
|
||||
count?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*/
|
||||
type: AuditLogOptionsType;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*
|
||||
* **Present only if the {@link APIAuditLogOptions#type entry type} is "role"**
|
||||
*/
|
||||
role_name?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum AuditLogOptionsType {
|
||||
Member = 'member',
|
||||
Role = 'role',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
|
||||
* @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
|
||||
| APIAuditLogChangeKeyAllow
|
||||
| APIAuditLogChangeKeyAllowNew
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDenyNew
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyChannelID
|
||||
| APIAuditLogChangeKeyInviterID
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyID
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyEnableEmoticons
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod;
|
||||
|
||||
/**
|
||||
* Returned when a guild's name is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyName = AuditLogChangeData<'name', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's icon is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyIconHash = AuditLogChangeData<'icon_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's splash is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeySplashHash = AuditLogChangeData<'splash_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's owner ID is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyOwnerID = AuditLogChangeData<'owner_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's region is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyRegion = AuditLogChangeData<'region', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's afk_channel_id is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAFKChannelID = AuditLogChangeData<'afk_channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's afk_timeout is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAFKTimeout = AuditLogChangeData<'afk_timeout', number>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's mfa_level is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMFALevel = AuditLogChangeData<'mfa_level', GuildMFALevel>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's verification_level is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyVerificationLevel = AuditLogChangeData<'verification_level', GuildVerificationLevel>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's explicit_content_filter is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExplicitContentFilter = AuditLogChangeData<
|
||||
'explicit_content_filter',
|
||||
GuildExplicitContentFilter
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's default_message_notifications is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultMessageNotifications = AuditLogChangeData<
|
||||
'default_message_notifications',
|
||||
GuildDefaultMessageNotifications
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's vanity_url_code is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyVanityURLCode = AuditLogChangeData<'vanity_url_code', string>;
|
||||
|
||||
/**
|
||||
* Returned when new role(s) are added
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Add = AuditLogChangeData<'$add', APIRole[]>;
|
||||
|
||||
/**
|
||||
* Returned when role(s) are removed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Remove = AuditLogChangeData<'$remove', APIRole[]>;
|
||||
|
||||
/**
|
||||
* Returned when there is a change in number of days after which inactive and role-unassigned members are kicked
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPruneDeleteDays = AuditLogChangeData<'prune_delete_days', number>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's widget is enabled
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyWidgetEnabled = AuditLogChangeData<'widget_enabled', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's widget_channel_id is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyWidgetChannelID = AuditLogChangeData<'widget_channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's system_channel_id is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeySystemChannelID = AuditLogChangeData<'system_channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's position is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPosition = AuditLogChangeData<'position', number>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's topic is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTopic = AuditLogChangeData<'topic', string>;
|
||||
|
||||
/**
|
||||
* Returned when a voice channel's bitrate is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyBitrate = AuditLogChangeData<'bitrate', number>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's permission overwrites is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPermissionOverwrites = AuditLogChangeData<'permission_overwrites', APIOverwrite[]>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's NSFW restriction is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyNSFW = AuditLogChangeData<'nsfw', boolean>;
|
||||
|
||||
/**
|
||||
* The application ID of the added or removed Webhook or Bot
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyApplicationID = AuditLogChangeData<'application_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's amount of seconds a user has to wait before sending another message
|
||||
* is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyRateLimitPerUser = AuditLogChangeData<'rate_limit_per_user', number>;
|
||||
|
||||
/**
|
||||
* Returned when a permission bitfield is changed
|
||||
* @deprecated Use `permissions_new` instead
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPermissions = AuditLogChangeData<'permissions', number>;
|
||||
|
||||
/**
|
||||
* Returned when a permission bitfield is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPermissionsNew = AuditLogChangeData<'permissions_new', string>;
|
||||
|
||||
/**
|
||||
* Returned when a role's color is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyColor = AuditLogChangeData<'color', number>;
|
||||
|
||||
/**
|
||||
* Returned when a role's hoist status is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyHoist = AuditLogChangeData<'hoist', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a role's mentionable status is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMentionable = AuditLogChangeData<'mentionable', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's allowed permissions bitfield is changed
|
||||
* @deprecated Use `allow_new` instead
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAllow = AuditLogChangeData<'allow', number>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's allowed permissions bitfield is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAllowNew = AuditLogChangeData<'allow_new', string>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's denied permissions bitfield is changed
|
||||
* @deprecated Use `deny_new` instead
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDeny = AuditLogChangeData<'deny', number>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's denied permissions bitfield is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDenyNew = AuditLogChangeData<'deny_new', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's code is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyCode = AuditLogChangeData<'code', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's channel_id is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyChannelID = AuditLogChangeData<'channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's inviter_id is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyInviterID = AuditLogChangeData<'inviter_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's max_uses is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMaxUses = AuditLogChangeData<'max_uses', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's uses is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyUses = AuditLogChangeData<'uses', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's max_age is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMaxAge = AuditLogChangeData<'max_age', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's temporary status is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTemporary = AuditLogChangeData<'temporary', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's deaf status is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDeaf = AuditLogChangeData<'deaf', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's mute status is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMute = AuditLogChangeData<'mute', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's nick is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyNick = AuditLogChangeData<'mute', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's avatar_hash is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvatarHash = AuditLogChangeData<'avatar_hash', string>;
|
||||
|
||||
/**
|
||||
* The ID of the changed entity - sometimes used in conjunction with other keys
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIAuditLogChangeKeyID {
|
||||
key: 'id';
|
||||
new_value: string;
|
||||
old_value?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of entity created
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyType = AuditLogChangeData<'type', ChannelType | string>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's enable_emoticons is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEnableEmoticons = AuditLogChangeData<'enable_emoticons', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's expire_behavior is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExpireBehavior = AuditLogChangeData<'expire_behavior', IntegrationExpireBehavior>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's expire_grace_period is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_grace_period', number>;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
interface AuditLogChangeData<K extends string, D extends unknown> {
|
||||
key: K;
|
||||
new_value?: D;
|
||||
old_value?: D;
|
||||
}
|
||||
343
deno/payloads/v6/channel.ts
Normal file
343
deno/payloads/v6/channel.ts
Normal file
@@ -0,0 +1,343 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/channel
|
||||
*/
|
||||
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIPartialChannel {
|
||||
id: string;
|
||||
type: ChannelType;
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIChannel extends APIPartialChannel {
|
||||
guild_id?: string;
|
||||
position?: number;
|
||||
permission_overwrites?: APIOverwrite[];
|
||||
name?: string;
|
||||
topic?: string | null;
|
||||
nsfw?: boolean;
|
||||
last_message_id?: string | null;
|
||||
bitrate?: number;
|
||||
user_limit?: number;
|
||||
rate_limit_per_user?: number;
|
||||
recipients?: APIUser[];
|
||||
icon?: string | null;
|
||||
owner_id?: string;
|
||||
application_id?: string;
|
||||
parent_id?: string | null;
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum ChannelType {
|
||||
GUILD_TEXT = 0,
|
||||
DM,
|
||||
GUILD_VOICE,
|
||||
GROUP_DM,
|
||||
GUILD_CATEGORY,
|
||||
GUILD_NEWS,
|
||||
GUILD_STORE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIMessage {
|
||||
id: string;
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
author: APIUser;
|
||||
member?: APIGuildMember;
|
||||
content: string;
|
||||
timestamp: string;
|
||||
edited_timestamp: string | null;
|
||||
tts: boolean;
|
||||
mention_everyone: boolean;
|
||||
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
|
||||
mention_roles: string[];
|
||||
mention_channels?: APIChannelMention[];
|
||||
attachments: APIAttachment[];
|
||||
embeds: APIEmbed[];
|
||||
reactions?: APIReaction[];
|
||||
nonce?: string | number;
|
||||
pinned: boolean;
|
||||
webhook_id?: string;
|
||||
type: MessageType;
|
||||
activity?: APIMessageActivity;
|
||||
application?: APIMessageApplication;
|
||||
message_reference?: APIMessageReference;
|
||||
flags?: MessageFlags;
|
||||
referenced_message?: APIMessage | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-types
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum MessageType {
|
||||
DEFAULT,
|
||||
RECIPIENT_ADD,
|
||||
RECIPIENT_REMOVE,
|
||||
CALL,
|
||||
CHANNEL_NAME_CHANGE,
|
||||
CHANNEL_ICON_CHANGE,
|
||||
CHANNEL_PINNED_MESSAGE,
|
||||
GUILD_MEMBER_JOIN,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3,
|
||||
CHANNEL_FOLLOW_ADD,
|
||||
GUILD_DISCOVERY_DISQUALIFIED = 14,
|
||||
GUILD_DISCOVERY_REQUALIFIED,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIMessageActivity {
|
||||
type: MessageActivityType;
|
||||
party_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIMessageApplication {
|
||||
id: string;
|
||||
cover_image?: string;
|
||||
description: string;
|
||||
icon: string | null;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
message_id?: string;
|
||||
channel_id: string;
|
||||
guild_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum MessageActivityType {
|
||||
JOIN = 1,
|
||||
SPECTATE,
|
||||
LISTEN,
|
||||
JOIN_REQUEST = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum MessageFlags {
|
||||
CROSSPOSTED = 1 << 0,
|
||||
IS_CROSSPOST = 1 << 1,
|
||||
SUPPRESS_EMBEDS = 1 << 2,
|
||||
SOURCE_MESSAGE_DELETED = 1 << 3,
|
||||
URGENT = 1 << 4,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIReaction {
|
||||
count: number;
|
||||
me: boolean;
|
||||
emoji: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIOverwrite {
|
||||
id: string;
|
||||
type: OverwriteType;
|
||||
/**
|
||||
* @deprecated Use `allow_new` instead
|
||||
*/
|
||||
allow: number;
|
||||
allow_new: string;
|
||||
/**
|
||||
* @deprecated Use `deny_new` instead
|
||||
*/
|
||||
deny: number;
|
||||
deny_new: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum OverwriteType {
|
||||
Member = 'member',
|
||||
Role = 'role',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbed {
|
||||
title?: string;
|
||||
/**
|
||||
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
|
||||
*/
|
||||
type?: EmbedType;
|
||||
description?: string;
|
||||
url?: string;
|
||||
timestamp?: string;
|
||||
color?: number;
|
||||
footer?: APIEmbedFooter;
|
||||
image?: APIEmbedImage;
|
||||
thumbnail?: APIEmbedThumbnail;
|
||||
video?: APIEmbedVideo;
|
||||
provider?: APIEmbedProvider;
|
||||
author?: APIEmbedAuthor;
|
||||
fields?: APIEmbedField[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-types
|
||||
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum EmbedType {
|
||||
Rich = 'rich',
|
||||
Image = 'image',
|
||||
Video = 'video',
|
||||
GifV = 'gifv',
|
||||
Article = 'article',
|
||||
Link = 'link',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedThumbnail {
|
||||
url?: string;
|
||||
proxy_url?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedVideo {
|
||||
url?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedImage {
|
||||
url?: string;
|
||||
proxy_url?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedProvider {
|
||||
name?: string;
|
||||
url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedAuthor {
|
||||
name?: string;
|
||||
url?: string;
|
||||
icon_url?: string;
|
||||
proxy_icon_url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedFooter {
|
||||
text: string;
|
||||
icon_url?: string;
|
||||
proxy_icon_url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedField {
|
||||
name: string;
|
||||
value: string;
|
||||
inline?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIAttachment {
|
||||
id: string;
|
||||
filename: string;
|
||||
size: number;
|
||||
url: string;
|
||||
proxy_url: string;
|
||||
height: number | null;
|
||||
width: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-mention-object-channel-mention-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIChannelMention {
|
||||
id: string;
|
||||
guild_id: string;
|
||||
type: ChannelType;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIFollowedChannel {
|
||||
channel_id: string;
|
||||
webhook_id: string;
|
||||
}
|
||||
27
deno/payloads/v6/emoji.ts
Normal file
27
deno/payloads/v6/emoji.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/emoji
|
||||
*/
|
||||
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* Not documented but mentioned
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIPartialEmoji {
|
||||
id: string | null;
|
||||
name: string | null;
|
||||
animated?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmoji extends APIPartialEmoji {
|
||||
roles?: string[];
|
||||
user?: APIUser;
|
||||
require_colons?: boolean;
|
||||
managed?: boolean;
|
||||
available?: boolean;
|
||||
}
|
||||
154
deno/payloads/v6/gateway.ts
Normal file
154
deno/payloads/v6/gateway.ts
Normal file
@@ -0,0 +1,154 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
*/
|
||||
|
||||
import type { APIEmoji } from './emoji.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGatewayInfo {
|
||||
url: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway-bot
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGatewayBotInfo extends APIGatewayInfo {
|
||||
shards: number;
|
||||
session_start_limit: APIGatewaySessionStartLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#session-start-limit-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGatewaySessionStartLimit {
|
||||
total: number;
|
||||
remaining: number;
|
||||
reset_after: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#presence-update-presence-update-event-fields
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayPresenceUpdate {
|
||||
user: Partial<APIUser> & {
|
||||
id: string;
|
||||
};
|
||||
roles?: string[];
|
||||
game?: GatewayActivity | null;
|
||||
guild_id?: string;
|
||||
status?: PresenceUpdateStatus;
|
||||
activities?: GatewayActivity[];
|
||||
client_status?: GatewayPresenceClientStatus;
|
||||
premium_since?: string | null;
|
||||
nick?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum PresenceUpdateStatus {
|
||||
DoNotDisturb = 'dnd',
|
||||
Idle = 'idle',
|
||||
Invisible = 'invisible',
|
||||
Offline = 'offline',
|
||||
Online = 'online',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#client-status-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayPresenceClientStatus = Partial<Record<'desktop' | 'mobile' | 'web', PresenceUpdateStatus>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayActivity {
|
||||
name: string;
|
||||
type: ActivityType;
|
||||
url?: string | null;
|
||||
created_at: number;
|
||||
timestamps?: GatewayActivityTimestamps;
|
||||
application_id?: string;
|
||||
details?: string | null;
|
||||
state?: string | null;
|
||||
emoji?: GatewayActivityEmoji;
|
||||
party?: GatewayActivityParty;
|
||||
assets?: GatewayActivityAssets;
|
||||
secrets?: GatewayActivitySecrets;
|
||||
instance?: boolean;
|
||||
flags?: ActivityFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum ActivityType {
|
||||
Game,
|
||||
Streaming,
|
||||
Listening,
|
||||
|
||||
Custom = 4,
|
||||
Competing,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-timestamps
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayActivityTimestamps {
|
||||
start?: number;
|
||||
end?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
|
||||
* @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'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayActivityParty {
|
||||
id?: string;
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
size?: [currentSize: number, maxSize: number];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayActivityAssets = Partial<
|
||||
Record<'large_image' | 'large_text' | 'small_image' | 'small_text', string>
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
|
||||
* @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>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum ActivityFlags {
|
||||
INSTANCE = 1 << 0,
|
||||
JOIN = 1 << 1,
|
||||
SPECTATE = 1 << 2,
|
||||
JOIN_REQUEST = 1 << 3,
|
||||
SYNC = 1 << 4,
|
||||
PLAY = 1 << 5,
|
||||
}
|
||||
315
deno/payloads/v6/guild.ts
Normal file
315
deno/payloads/v6/guild.ts
Normal file
@@ -0,0 +1,315 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/guild
|
||||
*/
|
||||
|
||||
import type { APIChannel } from './channel.ts';
|
||||
import type { APIEmoji } from './emoji.ts';
|
||||
import type { GatewayPresenceUpdate } from './gateway.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { GatewayVoiceState } from './voice.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIUnavailableGuild {
|
||||
id: string;
|
||||
unavailable: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'>, Pick<APIGuild, 'welcome_screen'> {
|
||||
name: string;
|
||||
icon: string | null;
|
||||
splash: string | null;
|
||||
banner?: string | null;
|
||||
description?: string | null;
|
||||
features?: GuildFeature[];
|
||||
verification_level?: GuildVerificationLevel;
|
||||
vanity_url_code?: string | null;
|
||||
unavailable?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGuild extends APIPartialGuild {
|
||||
discovery_splash: string | null;
|
||||
owner?: boolean;
|
||||
owner_id: string;
|
||||
/**
|
||||
* @deprecated Use `permissions_new` instead
|
||||
*/
|
||||
permissions?: number;
|
||||
permissions_new?: string;
|
||||
region: string;
|
||||
afk_channel_id: string | null;
|
||||
afk_timeout: number;
|
||||
/**
|
||||
* @deprecated Use `widget_enabled` instead
|
||||
*/
|
||||
embed_enabled?: boolean;
|
||||
/**
|
||||
* @deprecated Use `widget_channel_id` instead
|
||||
*/
|
||||
embed_channel_id?: string | null;
|
||||
verification_level: GuildVerificationLevel;
|
||||
default_message_notifications: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter: GuildExplicitContentFilter;
|
||||
roles: APIRole[];
|
||||
emojis: APIEmoji[];
|
||||
features: GuildFeature[];
|
||||
mfa_level: GuildMFALevel;
|
||||
application_id: string | null;
|
||||
widget_enabled?: boolean;
|
||||
widget_channel_id?: string | null;
|
||||
system_channel_id: string | null;
|
||||
system_channel_flags: GuildSystemChannelFlags;
|
||||
rules_channel_id: string | null;
|
||||
joined_at?: string;
|
||||
large?: boolean;
|
||||
member_count?: number;
|
||||
voice_states?: Omit<GatewayVoiceState, 'guild_id'>[];
|
||||
members?: APIGuildMember[];
|
||||
channels?: APIChannel[];
|
||||
presences?: GatewayPresenceUpdate[];
|
||||
max_presences?: number | null;
|
||||
max_members?: number;
|
||||
vanity_url_code: string | null;
|
||||
description: string | null;
|
||||
banner: string | null;
|
||||
premium_tier: GuildPremiumTier;
|
||||
premium_subscription_count?: number;
|
||||
preferred_locale: string;
|
||||
public_updates_channel_id: string | null;
|
||||
max_video_channel_users?: number;
|
||||
/**
|
||||
* Returned by calling GET `/guilds/{guild.id}` with the query `with_counts` set to `true`
|
||||
*/
|
||||
approximate_member_count?: number;
|
||||
/**
|
||||
* Returned by calling GET `/guilds/{guild.id}` with the query `with_counts` set to `true`
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GuildDefaultMessageNotifications {
|
||||
ALL_MESSAGES,
|
||||
ONLY_MENTIONS,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GuildExplicitContentFilter {
|
||||
DISABLED,
|
||||
MEMBERS_WITHOUT_ROLES,
|
||||
ALL_MEMBERS,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-mfa-level
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GuildMFALevel {
|
||||
NONE,
|
||||
ELEVATED,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GuildVerificationLevel {
|
||||
NONE,
|
||||
LOW,
|
||||
MEDIUM,
|
||||
HIGH,
|
||||
VERY_HIGH,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-premium-tier
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GuildPremiumTier {
|
||||
NONE,
|
||||
TIER_1,
|
||||
TIER_2,
|
||||
TIER_3,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GuildSystemChannelFlags {
|
||||
SUPPRESS_JOIN_NOTIFICATIONS = 1 << 0,
|
||||
SUPPRESS_PREMIUM_SUBSCRIPTIONS = 1 << 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GuildFeature {
|
||||
ANIMATED_ICON = 'ANIMATED_ICON',
|
||||
BANNER = 'BANNER',
|
||||
COMMERCE = 'COMMERCE',
|
||||
COMMUNITY = 'COMMUNITY',
|
||||
DISCOVERABLE = 'DISCOVERABLE',
|
||||
FEATURABLE = 'FEATURABLE',
|
||||
INVITE_SPLASH = 'INVITE_SPLASH',
|
||||
NEWS = 'NEWS',
|
||||
PARTNERED = 'PARTNERED',
|
||||
RELAY_ENABLED = 'RELAY_ENABLED',
|
||||
VANITY_URL = 'VANITY_URL',
|
||||
VERIFIED = 'VERIFIED',
|
||||
VIP_REGIONS = 'VIP_REGIONS',
|
||||
WELCOME_SCREEN_ENABLED = 'WELCOME_SCREEN_ENABLED',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-preview-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGuildPreview {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
splash: string | null;
|
||||
discovery_splash: string | null;
|
||||
emojis: APIEmoji[];
|
||||
features: GuildFeature[];
|
||||
approximate_member_count: number;
|
||||
approximate_presence_count: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use `APIGuildWidgetSettings` instead
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIGuildWidget = APIGuildWidgetSettings;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGuildWidgetSettings {
|
||||
enabled: boolean;
|
||||
channel_id: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGuildMember {
|
||||
user?: APIUser;
|
||||
nick: string | null;
|
||||
roles: string[];
|
||||
joined_at: string;
|
||||
premium_since?: string | null;
|
||||
deaf: boolean;
|
||||
mute: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGuildIntegration {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
enabled: boolean;
|
||||
syncing: boolean;
|
||||
role_id: string;
|
||||
enable_emoticons?: boolean;
|
||||
expire_behavior: IntegrationExpireBehavior;
|
||||
expire_grace_period: number;
|
||||
user?: APIUser;
|
||||
account: APIIntegrationAccount;
|
||||
synced_at: string;
|
||||
subscriber_count: number;
|
||||
revoked: boolean;
|
||||
application?: APIGuildIntegrationApplication;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum IntegrationExpireBehavior {
|
||||
RemoveRole,
|
||||
Kick,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-account-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIIntegrationAccount {
|
||||
id: string;
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-application-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGuildIntegrationApplication {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
description: string;
|
||||
summary: string;
|
||||
bot?: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#ban-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIBan {
|
||||
reason: string | null;
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-image-widget-style-options
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GuildWidgetStyle {
|
||||
Banner1 = 'banner1',
|
||||
Banner2 = 'banner2',
|
||||
Banner3 = 'banner3',
|
||||
Banner4 = 'banner4',
|
||||
Shield = 'shield',
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGuildWelcomeScreen {
|
||||
description: string | null;
|
||||
welcome_channels: APIGuildWelcomeScreenChannel[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGuildWelcomeScreenChannel {
|
||||
channel_id: string;
|
||||
emoji_id: string | null;
|
||||
emoji_name: string | null;
|
||||
}
|
||||
42
deno/payloads/v6/invite.ts
Normal file
42
deno/payloads/v6/invite.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/invite
|
||||
*/
|
||||
|
||||
import type { APIPartialChannel } from './channel.ts';
|
||||
import type { APIPartialGuild } from './guild.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIInvite {
|
||||
code: string;
|
||||
guild?: APIPartialGuild;
|
||||
channel?: Required<APIPartialChannel>;
|
||||
inviter?: APIUser;
|
||||
target_user?: APIUser;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
approximate_presence_count?: number;
|
||||
approximate_member_count?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum InviteTargetUserType {
|
||||
STREAM = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-metadata-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIExtendedInvite extends APIInvite {
|
||||
uses: number;
|
||||
max_uses: number;
|
||||
max_age: number;
|
||||
temporary: boolean;
|
||||
created_at: string;
|
||||
}
|
||||
12
deno/payloads/v6/mod.ts
Normal file
12
deno/payloads/v6/mod.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export * from './auditLog.ts';
|
||||
export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
export * from './guild.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './permissions.ts';
|
||||
export * from './teams.ts';
|
||||
export * from './user.ts';
|
||||
export * from './voice.ts';
|
||||
export * from './webhook.ts';
|
||||
28
deno/payloads/v6/oauth2.ts
Normal file
28
deno/payloads/v6/oauth2.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/oauth2
|
||||
*/
|
||||
|
||||
import type { APITeam } from './teams.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#get-current-application-information-response-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIApplication {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
description: string;
|
||||
rpc_origins?: string[];
|
||||
bot_public: boolean;
|
||||
bot_require_code_grant: boolean;
|
||||
owner: APIUser;
|
||||
summary: string;
|
||||
verify_key: string;
|
||||
team: APITeam | null;
|
||||
guild_id?: string;
|
||||
primary_sku_id?: string;
|
||||
slug?: string;
|
||||
cover_image?: string;
|
||||
}
|
||||
@@ -7,8 +7,9 @@
|
||||
*
|
||||
* These flags are exported as `BigInt`s and NOT numbers. For most of them, you can
|
||||
* convert them in a number by wrapping it in `Number()`, however be careful as any
|
||||
* futher bits added may cause issues if done so. Try to use BigInts as much as possible
|
||||
* further bits added may cause issues if done so. Try to use BigInts as much as possible
|
||||
* or modules that can replicate them in some way.
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export const PermissionFlagsBits = {
|
||||
CREATE_INSTANT_INVITE: 1n,
|
||||
@@ -52,6 +53,7 @@ Object.freeze(PermissionFlagsBits);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions#role-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIRole {
|
||||
id: string;
|
||||
@@ -69,6 +71,9 @@ export interface APIRole {
|
||||
tags?: APIRoleTags;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIRoleTags {
|
||||
bot_id?: string;
|
||||
premium_subscriber?: null;
|
||||
36
deno/payloads/v6/teams.ts
Normal file
36
deno/payloads/v6/teams.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/teams
|
||||
*/
|
||||
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APITeam {
|
||||
id: string;
|
||||
icon: string | null;
|
||||
members: APITeamMember[];
|
||||
owner_user_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-members-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APITeamMember {
|
||||
membership_state: TeamMemberMembershipState;
|
||||
permissions: string[];
|
||||
team_id: string;
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum TeamMemberMembershipState {
|
||||
INVITED = 1,
|
||||
ACCEPTED,
|
||||
}
|
||||
80
deno/payloads/v6/user.ts
Normal file
80
deno/payloads/v6/user.ts
Normal file
@@ -0,0 +1,80 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/user
|
||||
*/
|
||||
|
||||
import type { APIGuildIntegration } from './guild.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIUser {
|
||||
id: string;
|
||||
username: string;
|
||||
discriminator: string;
|
||||
avatar: string | null;
|
||||
bot?: boolean;
|
||||
system?: boolean;
|
||||
mfa_enabled?: boolean;
|
||||
locale?: string;
|
||||
verified?: boolean;
|
||||
email?: string | null;
|
||||
flags?: UserFlags;
|
||||
premium_type?: UserPremiumType;
|
||||
public_flags?: UserFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object-user-flags
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum UserFlags {
|
||||
None = 0,
|
||||
DiscordEmployee = 1 << 0,
|
||||
PartneredServerOwner = 1 << 1,
|
||||
DiscordHypeSquadEvents = 1 << 2,
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
HypeSquadHouseBravery = 1 << 6,
|
||||
HypeSquadHouseBrilliance = 1 << 7,
|
||||
HypeSquadHouseBalance = 1 << 8,
|
||||
EarlySupporter = 1 << 9,
|
||||
TeamUser = 1 << 10,
|
||||
System = 1 << 12,
|
||||
BugHunterLevel2 = 1 << 14,
|
||||
VerifiedBot = 1 << 16,
|
||||
EarlyVerifiedBotDeveloper = 1 << 17,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object-premium-types
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum UserPremiumType {
|
||||
None,
|
||||
NitroClassic,
|
||||
Nitro,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#connection-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIConnection {
|
||||
id: string;
|
||||
name: string;
|
||||
type: string;
|
||||
revoked?: boolean;
|
||||
integrations?: Partial<APIGuildIntegration>[];
|
||||
verified: boolean;
|
||||
friend_sync: boolean;
|
||||
show_activity: boolean;
|
||||
visibility: ConnectionVisibility;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum ConnectionVisibility {
|
||||
None,
|
||||
Everyone,
|
||||
}
|
||||
37
deno/payloads/v6/voice.ts
Normal file
37
deno/payloads/v6/voice.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/voice
|
||||
*/
|
||||
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayVoiceState {
|
||||
guild_id?: string;
|
||||
channel_id: string | null;
|
||||
user_id: string;
|
||||
member?: APIGuildMember;
|
||||
session_id: string;
|
||||
deaf: boolean;
|
||||
mute: boolean;
|
||||
self_deaf: boolean;
|
||||
self_mute: boolean;
|
||||
self_stream?: boolean;
|
||||
self_video: boolean;
|
||||
suppress: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIVoiceRegion {
|
||||
id: string;
|
||||
name: string;
|
||||
vip: boolean;
|
||||
optimal: boolean;
|
||||
deprecated: boolean;
|
||||
custom: boolean;
|
||||
}
|
||||
33
deno/payloads/v6/webhook.ts
Normal file
33
deno/payloads/v6/webhook.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/webhook
|
||||
*/
|
||||
|
||||
import type { APIPartialChannel } from './channel.ts';
|
||||
import type { APIPartialGuild } from './guild.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#webhook-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIWebhook {
|
||||
id: string;
|
||||
type: WebhookType;
|
||||
guild_id?: string;
|
||||
channel_id: string;
|
||||
user?: APIUser;
|
||||
name: string | null;
|
||||
avatar: string | null;
|
||||
token?: string;
|
||||
source_guild?: APIPartialGuild;
|
||||
source_channel?: APIPartialChannel;
|
||||
application_id: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum WebhookType {
|
||||
Incoming = 1,
|
||||
ChannelFollower,
|
||||
}
|
||||
576
deno/payloads/v8/auditLog.ts
Normal file
576
deno/payloads/v8/auditLog.ts
Normal file
@@ -0,0 +1,576 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/audit-log
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIOverwrite, ChannelType } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildMFALevel,
|
||||
GuildVerificationLevel,
|
||||
IntegrationExpireBehavior,
|
||||
} from './guild.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIWebhook } from './webhook.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
|
||||
*/
|
||||
export interface APIAuditLog {
|
||||
/**
|
||||
* Webhooks found in the audit log
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/webhook#webhook-object
|
||||
*/
|
||||
webhooks: APIWebhook[];
|
||||
/**
|
||||
* Users found in the audit log
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
users: APIUser[];
|
||||
/**
|
||||
* Audit log entries
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object
|
||||
*/
|
||||
audit_log_entries: APIAuditLogEntry[];
|
||||
/**
|
||||
* Partial integration objects
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#integration-object
|
||||
*/
|
||||
integrations: APIGuildIntegration[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure
|
||||
*/
|
||||
export interface APIAuditLogEntry {
|
||||
/**
|
||||
* ID of the affected entity (webhook, user, role, etc.)
|
||||
*/
|
||||
target_id: string | null;
|
||||
/**
|
||||
* Changes made to the `target_id`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/audit-log#audit-log-change-object
|
||||
*/
|
||||
changes?: APIAuditLogChange[];
|
||||
/**
|
||||
* The user who made the changes
|
||||
*
|
||||
* This can be `null` in some cases (webhooks deleting themselves by using their own token, for example)
|
||||
*/
|
||||
user_id: Snowflake | null;
|
||||
/**
|
||||
* ID of the entry
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Type of action that occurred
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
|
||||
*/
|
||||
action_type: AuditLogEvent;
|
||||
/**
|
||||
* Additional info for certain action types
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
|
||||
*/
|
||||
options?: APIAuditLogOptions;
|
||||
/**
|
||||
* The reason for the change (0-512 characters)
|
||||
*/
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
|
||||
*/
|
||||
export enum AuditLogEvent {
|
||||
GUILD_UPDATE = 1,
|
||||
|
||||
CHANNEL_CREATE = 10,
|
||||
CHANNEL_UPDATE,
|
||||
CHANNEL_DELETE,
|
||||
CHANNEL_OVERWRITE_CREATE,
|
||||
CHANNEL_OVERWRITE_UPDATE,
|
||||
CHANNEL_OVERWRITE_DELETE,
|
||||
|
||||
MEMBER_KICK = 20,
|
||||
MEMBER_PRUNE,
|
||||
MEMBER_BAN_ADD,
|
||||
MEMBER_BAN_REMOVE,
|
||||
MEMBER_UPDATE,
|
||||
MEMBER_ROLE_UPDATE,
|
||||
MEMBER_MOVE,
|
||||
MEMBER_DISCONNECT,
|
||||
BOT_ADD,
|
||||
|
||||
ROLE_CREATE = 30,
|
||||
ROLE_UPDATE,
|
||||
ROLE_DELETE,
|
||||
|
||||
INVITE_CREATE = 40,
|
||||
INVITE_UPDATE,
|
||||
INVITE_DELETE,
|
||||
|
||||
WEBHOOK_CREATE = 50,
|
||||
WEBHOOK_UPDATE,
|
||||
WEBHOOK_DELETE,
|
||||
|
||||
EMOJI_CREATE = 60,
|
||||
EMOJI_UPDATE,
|
||||
EMOJI_DELETE,
|
||||
|
||||
MESSAGE_DELETE = 72,
|
||||
MESSAGE_BULK_DELETE,
|
||||
MESSAGE_PIN,
|
||||
MESSAGE_UNPIN,
|
||||
|
||||
INTEGRATION_CREATE = 80,
|
||||
INTEGRATION_UPDATE,
|
||||
INTEGRATION_DELETE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
|
||||
*/
|
||||
export interface APIAuditLogOptions {
|
||||
/**
|
||||
* Number of days after which inactive members were kicked
|
||||
*
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
delete_member_days?: string;
|
||||
/**
|
||||
* Number of members removed by the prune
|
||||
*
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
members_removed?: string;
|
||||
|
||||
/**
|
||||
* Channel in which the entities were targeted
|
||||
*
|
||||
* Present from:
|
||||
* - MEMBER_MOVE
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
* - MESSAGE_DELETE
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
|
||||
/**
|
||||
* ID of the message that was targeted
|
||||
*
|
||||
* Present from:
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
*/
|
||||
message_id?: Snowflake;
|
||||
|
||||
/**
|
||||
* Number of entities that were targeted
|
||||
*
|
||||
* Present from:
|
||||
* - MESSAGE_DELETE
|
||||
* - MESSAGE_BULK_DELETE
|
||||
* - MEMBER_DISCONNECT
|
||||
* - MEMBER_MOVE
|
||||
*/
|
||||
count?: string;
|
||||
|
||||
/**
|
||||
* ID of the overwritten entity
|
||||
*
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*/
|
||||
id?: Snowflake;
|
||||
|
||||
/**
|
||||
* Type of overwritten entity - "0" for "role" or "1" for "member"
|
||||
*
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*
|
||||
* {@link AuditLogOptionsType}
|
||||
*/
|
||||
type?: AuditLogOptionsType;
|
||||
|
||||
/**
|
||||
* Name of the role
|
||||
*
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*
|
||||
* **Present only if the {@link APIAuditLogOptions#type entry type} is "0"**
|
||||
*/
|
||||
role_name?: string;
|
||||
}
|
||||
|
||||
export enum AuditLogOptionsType {
|
||||
Role = '0',
|
||||
Member = '1',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
|
||||
*/
|
||||
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
|
||||
| APIAuditLogChangeKeyAllow
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyChannelID
|
||||
| APIAuditLogChangeKeyInviterID
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyID
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyEnableEmoticons
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyUserLimit;
|
||||
|
||||
/**
|
||||
* Returned when a guild's name is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyName = AuditLogChangeData<'name', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's description is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDescription = AuditLogChangeData<'description', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's icon is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyIconHash = AuditLogChangeData<'icon_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's splash is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeySplashHash = AuditLogChangeData<'splash_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's discovery splash is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDiscoverySplashHash = AuditLogChangeData<'discovery_splash_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's banner hash is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyBannerHash = AuditLogChangeData<'banner_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's owner_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyOwnerID = AuditLogChangeData<'owner_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's region is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyRegion = AuditLogChangeData<'region', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's preferred_locale is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPreferredLocale = AuditLogChangeData<'preferred_locale', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's afk_channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAFKChannelID = AuditLogChangeData<'afk_channel_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's afk_timeout is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAFKTimeout = AuditLogChangeData<'afk_timeout', number>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's rules_channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyRulesChannelID = AuditLogChangeData<'rules_channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's public_updates_channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPublicUpdatesChannelID = AuditLogChangeData<'public_updates_channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's mfa_level is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMFALevel = AuditLogChangeData<'mfa_level', GuildMFALevel>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's verification_level is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyVerificationLevel = AuditLogChangeData<'verification_level', GuildVerificationLevel>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's explicit_content_filter is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExplicitContentFilter = AuditLogChangeData<
|
||||
'explicit_content_filter',
|
||||
GuildExplicitContentFilter
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's default_message_notifications is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultMessageNotifications = AuditLogChangeData<
|
||||
'default_message_notifications',
|
||||
GuildDefaultMessageNotifications
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's vanity_url_code is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyVanityURLCode = AuditLogChangeData<'vanity_url_code', string>;
|
||||
|
||||
/**
|
||||
* Returned when new role(s) are added
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Add = AuditLogChangeData<'$add', APIRole[]>;
|
||||
|
||||
/**
|
||||
* Returned when role(s) are removed
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Remove = AuditLogChangeData<'$remove', APIRole[]>;
|
||||
|
||||
/**
|
||||
* Returned when there is a change in number of days after which inactive and role-unassigned members are kicked
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPruneDeleteDays = AuditLogChangeData<'prune_delete_days', number>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's widget is enabled
|
||||
*/
|
||||
export type APIAuditLogChangeKeyWidgetEnabled = AuditLogChangeData<'widget_enabled', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's widget_channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyWidgetChannelID = AuditLogChangeData<'widget_channel_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's system_channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeySystemChannelID = AuditLogChangeData<'system_channel_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's position is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPosition = AuditLogChangeData<'position', number>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's topic is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTopic = AuditLogChangeData<'topic', string>;
|
||||
|
||||
/**
|
||||
* Returned when a voice channel's bitrate is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyBitrate = AuditLogChangeData<'bitrate', number>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's permission overwrites is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPermissionOverwrites = AuditLogChangeData<'permission_overwrites', APIOverwrite[]>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's NSFW restriction is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyNSFW = AuditLogChangeData<'nsfw', boolean>;
|
||||
|
||||
/**
|
||||
* The application ID of the added or removed Webhook or Bot
|
||||
*/
|
||||
export type APIAuditLogChangeKeyApplicationID = AuditLogChangeData<'application_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's amount of seconds a user has to wait before sending another message
|
||||
* is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyRateLimitPerUser = AuditLogChangeData<'rate_limit_per_user', number>;
|
||||
|
||||
/**
|
||||
* Returned when a permission bitfield is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPermissions = AuditLogChangeData<'permissions', string>;
|
||||
|
||||
/**
|
||||
* Returned when a role's color is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyColor = AuditLogChangeData<'color', number>;
|
||||
|
||||
/**
|
||||
* Returned when a role's hoist status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyHoist = AuditLogChangeData<'hoist', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a role's mentionable status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMentionable = AuditLogChangeData<'mentionable', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's allowed permissions bitfield is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAllow = AuditLogChangeData<'allow', string>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's denied permissions bitfield is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDeny = AuditLogChangeData<'deny', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's code is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyCode = AuditLogChangeData<'code', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyChannelID = AuditLogChangeData<'channel_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's inviter_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyInviterID = AuditLogChangeData<'inviter_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's max_uses is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMaxUses = AuditLogChangeData<'max_uses', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's uses is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyUses = AuditLogChangeData<'uses', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's max_age is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMaxAge = AuditLogChangeData<'max_age', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's temporary status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTemporary = AuditLogChangeData<'temporary', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's deaf status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDeaf = AuditLogChangeData<'deaf', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's mute status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMute = AuditLogChangeData<'mute', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's nick is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyNick = AuditLogChangeData<'mute', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's avatar_hash is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvatarHash = AuditLogChangeData<'avatar_hash', string>;
|
||||
|
||||
/**
|
||||
* The ID of the changed entity - sometimes used in conjunction with other keys
|
||||
*/
|
||||
export type APIAuditLogChangeKeyID = AuditLogChangeData<'id', Snowflake>;
|
||||
|
||||
/**
|
||||
* The type of entity created
|
||||
*/
|
||||
export type APIAuditLogChangeKeyType = AuditLogChangeData<'type', ChannelType | string>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's enable_emoticons is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEnableEmoticons = AuditLogChangeData<'enable_emoticons', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's expire_behavior is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExpireBehavior = AuditLogChangeData<'expire_behavior', IntegrationExpireBehavior>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's expire_grace_period is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_grace_period', number>;
|
||||
|
||||
/**
|
||||
* Returned when a voice channel's user_limit is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyUserLimit = AuditLogChangeData<'user_limit', number>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D extends unknown> {
|
||||
key: K;
|
||||
/**
|
||||
* The new value
|
||||
*
|
||||
* If `new_value` is not present in the change object, while `old_value` is,
|
||||
* that means the property that was changed has been reset, or set to `null`
|
||||
*/
|
||||
new_value?: D;
|
||||
old_value?: D;
|
||||
}
|
||||
936
deno/payloads/v8/channel.ts
Normal file
936
deno/payloads/v8/channel.ts
Normal file
@@ -0,0 +1,936 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/channel
|
||||
*/
|
||||
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { APIMessageInteraction } from './interactions.ts';
|
||||
import { APIApplication } from './oauth2.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
*/
|
||||
export interface APIPartialChannel {
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The type of the channel
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*/
|
||||
type: ChannelType;
|
||||
/**
|
||||
* The name of the channel (2-100 characters)
|
||||
*/
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
|
||||
*/
|
||||
export interface APIChannel extends APIPartialChannel {
|
||||
/**
|
||||
* The id of the guild (may be missing for some channel objects received over gateway guild dispatches)
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position?: number;
|
||||
/**
|
||||
* Explicit permission overwrites for members and roles
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#overwrite-object
|
||||
*/
|
||||
permission_overwrites?: APIOverwrite[];
|
||||
/**
|
||||
* The channel topic (0-1024 characters)
|
||||
*/
|
||||
topic?: string | null;
|
||||
/**
|
||||
* Whether the channel is nsfw
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
/**
|
||||
* The bitrate (in bits) of the voice channel
|
||||
*/
|
||||
bitrate?: number;
|
||||
/**
|
||||
* The user limit of the voice channel
|
||||
*/
|
||||
user_limit?: number;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
/**
|
||||
* The recipients of the DM
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
recipients?: APIUser[];
|
||||
/**
|
||||
* Icon hash
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* ID of the DM creator
|
||||
*/
|
||||
owner_id?: Snowflake;
|
||||
/**
|
||||
* Application id of the group DM creator if it is bot-created
|
||||
*/
|
||||
application_id?: Snowflake;
|
||||
/**
|
||||
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
|
||||
*/
|
||||
parent_id?: Snowflake | null;
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
/**
|
||||
* Voice region id for the voice or stage channel, automatic when set to `null`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
rtc_region: string | null;
|
||||
/**
|
||||
* The camera video quality mode of the voice channel, `1` when not present
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
|
||||
*/
|
||||
video_quality_mode?: VideoQualityMode;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*/
|
||||
export enum ChannelType {
|
||||
/**
|
||||
* A text channel within a guild
|
||||
*/
|
||||
GUILD_TEXT,
|
||||
/**
|
||||
* A direct message between users
|
||||
*/
|
||||
DM,
|
||||
/**
|
||||
* A voice channel within a guild
|
||||
*/
|
||||
GUILD_VOICE,
|
||||
/**
|
||||
* A direct message between multiple users
|
||||
*/
|
||||
GROUP_DM,
|
||||
/**
|
||||
* An organizational category that contains up to 50 channels
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/115001580171-Channel-Categories-101
|
||||
*/
|
||||
GUILD_CATEGORY,
|
||||
/**
|
||||
* A channel that users can follow and crosspost into their own guild
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/360032008192
|
||||
*/
|
||||
GUILD_NEWS,
|
||||
/**
|
||||
* A channel in which game developers can sell their game on Discord
|
||||
*
|
||||
* See https://discord.com/developers/docs/game-and-server-management/special-channels
|
||||
*/
|
||||
GUILD_STORE,
|
||||
/**
|
||||
* A voice channel for hosting events with an audience
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/1500005513722
|
||||
*/
|
||||
GUILD_STAGE_VOICE = 13,
|
||||
}
|
||||
|
||||
export enum VideoQualityMode {
|
||||
/**
|
||||
* Discord chooses the quality for optimal performance
|
||||
*/
|
||||
AUTO = 1,
|
||||
/**
|
||||
* 720p
|
||||
*/
|
||||
FULL,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-structure
|
||||
*/
|
||||
export interface APIMessage {
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* ID of the channel the message was sent in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* ID of the guild the message was sent in
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The author of this message (only a valid user in the case where the message is generated by a user or bot user)
|
||||
*
|
||||
* If the message is generated by a webhook, the author object corresponds to the webhook's id,
|
||||
* username, and avatar. You can tell if a message is generated by a webhook by checking for the `webhook_id` property
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
author: APIUser;
|
||||
/**
|
||||
* Member properties for this message's author
|
||||
*
|
||||
* The member object exists in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* Contents of the message
|
||||
*/
|
||||
content: string;
|
||||
/**
|
||||
* When this message was sent
|
||||
*/
|
||||
timestamp: string;
|
||||
/**
|
||||
* When this message was edited (or null if never)
|
||||
*/
|
||||
edited_timestamp: string | null;
|
||||
/**
|
||||
* Whether this was a TTS message
|
||||
*/
|
||||
tts: boolean;
|
||||
/**
|
||||
* Whether this message mentions everyone
|
||||
*/
|
||||
mention_everyone: boolean;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
|
||||
/**
|
||||
* Roles specifically mentioned in this message
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
mention_roles: APIRole['id'][];
|
||||
/**
|
||||
* Channels specifically mentioned in this message
|
||||
*
|
||||
* Not all channel mentions in a message will appear in `mention_channels`.
|
||||
* - Only textual channels that are visible to everyone in a lurkable guild will ever be included
|
||||
* - Only crossposted messages (via Channel Following) currently include `mention_channels` at all
|
||||
*
|
||||
* If no mentions in the message meet these requirements, this field will not be sent
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-mention-object
|
||||
*/
|
||||
mention_channels?: APIChannelMention[];
|
||||
/**
|
||||
* Any attached files
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments: APIAttachment[];
|
||||
/**
|
||||
* Any embedded content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds: APIEmbed[];
|
||||
/**
|
||||
* Reactions to the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#reaction-object
|
||||
*/
|
||||
reactions?: APIReaction[];
|
||||
/**
|
||||
* A nonce that can be used for optimistic message sending (up to 25 characters)
|
||||
*
|
||||
* **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;
|
||||
/**
|
||||
* Whether this message is pinned
|
||||
*/
|
||||
pinned: boolean;
|
||||
/**
|
||||
* If the message is generated by a webhook, this is the webhook's id
|
||||
*/
|
||||
webhook_id?: Snowflake;
|
||||
/**
|
||||
* Type of message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-types
|
||||
*/
|
||||
type: MessageType;
|
||||
/**
|
||||
* Sent with Rich Presence-related chat embeds
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
|
||||
*/
|
||||
activity?: APIMessageActivity;
|
||||
/**
|
||||
* Sent with Rich Presence-related chat embeds
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
|
||||
*/
|
||||
application?: Partial<APIApplication>;
|
||||
/**
|
||||
* Reference data sent with crossposted messages and replies
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReference;
|
||||
/**
|
||||
* Message flags combined as a bitfield
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
flags?: MessageFlags;
|
||||
/**
|
||||
* The stickers sent with the message (bots currently can only receive messages with stickers, not send)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-sticker-structure
|
||||
*/
|
||||
stickers?: APISticker[];
|
||||
/**
|
||||
* The message associated with the `message_reference`
|
||||
*
|
||||
* This field is only returned for messages with a `type` of `19` (REPLY).
|
||||
*
|
||||
* If the message is a reply but the `referenced_message` field is not present,
|
||||
* the backend did not attempt to fetch the message that was being replied to,
|
||||
* so its state is unknown.
|
||||
*
|
||||
* If the field exists but is `null`, the referenced message was deleted
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object
|
||||
*/
|
||||
referenced_message?: APIMessage | null;
|
||||
/**
|
||||
* Sent if the message is a response to an Interaction
|
||||
*/
|
||||
interaction?: APIMessageInteraction;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-types
|
||||
*/
|
||||
export enum MessageType {
|
||||
DEFAULT,
|
||||
RECIPIENT_ADD,
|
||||
RECIPIENT_REMOVE,
|
||||
CALL,
|
||||
CHANNEL_NAME_CHANGE,
|
||||
CHANNEL_ICON_CHANGE,
|
||||
CHANNEL_PINNED_MESSAGE,
|
||||
GUILD_MEMBER_JOIN,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3,
|
||||
CHANNEL_FOLLOW_ADD,
|
||||
GUILD_DISCOVERY_DISQUALIFIED = 14,
|
||||
GUILD_DISCOVERY_REQUALIFIED,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING,
|
||||
REPLY = 19,
|
||||
APPLICATION_COMMAND,
|
||||
GUILD_INVITE_REMINDER = 22,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
|
||||
*/
|
||||
export interface APIMessageActivity {
|
||||
/**
|
||||
* Type of message activity
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
|
||||
*/
|
||||
type: MessageActivityType;
|
||||
/**
|
||||
* `party_id` from a Rich Presence event
|
||||
*
|
||||
* See https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields
|
||||
*/
|
||||
party_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
/**
|
||||
* ID of the originating message
|
||||
*/
|
||||
message_id?: Snowflake;
|
||||
/**
|
||||
* ID of the originating message's channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* ID of the originating message's guild
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
|
||||
*/
|
||||
export enum MessageActivityType {
|
||||
JOIN = 1,
|
||||
SPECTATE,
|
||||
LISTEN,
|
||||
JOIN_REQUEST = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
export enum MessageFlags {
|
||||
/**
|
||||
* This message has been published to subscribed channels (via Channel Following)
|
||||
*/
|
||||
CROSSPOSTED = 1 << 0,
|
||||
/**
|
||||
* This message originated from a message in another channel (via Channel Following)
|
||||
*/
|
||||
IS_CROSSPOST = 1 << 1,
|
||||
/**
|
||||
* Do not include any embeds when serializing this message
|
||||
*/
|
||||
SUPPRESS_EMBEDS = 1 << 2,
|
||||
/**
|
||||
* The source message for this crosspost has been deleted (via Channel Following)
|
||||
*/
|
||||
SOURCE_MESSAGE_DELETED = 1 << 3,
|
||||
/**
|
||||
* This message came from the urgent message system
|
||||
*/
|
||||
URGENT = 1 << 4,
|
||||
/**
|
||||
* This message is only visible to the user who invoked the Interaction
|
||||
*/
|
||||
EPHEMERAL = 1 << 6,
|
||||
/**
|
||||
* This message is an Interaction Response and the bot is "thinking"
|
||||
*/
|
||||
LOADING = 1 << 7,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-sticker-structure
|
||||
*/
|
||||
export interface APISticker {
|
||||
/**
|
||||
* ID of the sticker
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* ID of the pack the sticker is from
|
||||
*/
|
||||
pack_id: Snowflake;
|
||||
/**
|
||||
* Name of the sticker
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Description of the sticker
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* A comma-separated list of tags for the sticker
|
||||
*/
|
||||
tags?: string;
|
||||
/**
|
||||
* Sticker asset hash
|
||||
*/
|
||||
asset: string;
|
||||
/**
|
||||
* Sticker preview asset hash
|
||||
*/
|
||||
preview_asset: string | null;
|
||||
/**
|
||||
* Type of sticker format
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-sticker-format-types
|
||||
*/
|
||||
format_type: StickerFormatType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-sticker-format-types
|
||||
*/
|
||||
export enum StickerFormatType {
|
||||
PNG = 1,
|
||||
APNG,
|
||||
LOTTIE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#followed-channel-object
|
||||
*/
|
||||
export interface APIFollowedChannel {
|
||||
/**
|
||||
* Source channel id
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Created target webhook id
|
||||
*/
|
||||
webhook_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure
|
||||
*/
|
||||
export interface APIReaction {
|
||||
/**
|
||||
* Times this emoji has been used to react
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* Whether the current user reacted using this emoji
|
||||
*/
|
||||
me: boolean;
|
||||
/**
|
||||
* Emoji information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/emoji#emoji-object
|
||||
*/
|
||||
emoji: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure
|
||||
*/
|
||||
export interface APIOverwrite {
|
||||
/**
|
||||
* Role or user id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Either 0 (role) or 1 (member)
|
||||
*
|
||||
* {@link OverwriteType}
|
||||
*/
|
||||
type: OverwriteType;
|
||||
/**
|
||||
* Permission bit set
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
allow: Permissions;
|
||||
/**
|
||||
* Permission bit set
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
deny: Permissions;
|
||||
}
|
||||
|
||||
export enum OverwriteType {
|
||||
Role,
|
||||
Member,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-structure
|
||||
*
|
||||
* Length limit: 6000 characters
|
||||
*/
|
||||
export interface APIEmbed {
|
||||
/**
|
||||
* Title of embed
|
||||
*
|
||||
* Length limit: 256 characters
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Type of embed (always "rich" for webhook embeds)
|
||||
*
|
||||
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-types
|
||||
*/
|
||||
type?: EmbedType;
|
||||
/**
|
||||
* Description of embed
|
||||
*
|
||||
* Length limit: 2048 characters
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* URL of embed
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* Timestamp of embed content
|
||||
*/
|
||||
timestamp?: string;
|
||||
/**
|
||||
* Color code of the embed
|
||||
*/
|
||||
color?: number;
|
||||
/**
|
||||
* Footer information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
|
||||
*/
|
||||
footer?: APIEmbedFooter;
|
||||
/**
|
||||
* Image information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
|
||||
*/
|
||||
image?: APIEmbedImage;
|
||||
/**
|
||||
* Thumbnail information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
|
||||
*/
|
||||
thumbnail?: APIEmbedThumbnail;
|
||||
/**
|
||||
* Video information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
|
||||
*/
|
||||
video?: APIEmbedVideo;
|
||||
/**
|
||||
* Provider information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
|
||||
*/
|
||||
provider?: APIEmbedProvider;
|
||||
/**
|
||||
* Author information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
|
||||
*/
|
||||
author?: APIEmbedAuthor;
|
||||
/**
|
||||
* Fields information
|
||||
*
|
||||
* Length limit: 25 field objects
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
|
||||
*/
|
||||
fields?: APIEmbedField[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-types
|
||||
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
|
||||
*/
|
||||
export enum EmbedType {
|
||||
/**
|
||||
* Generic embed rendered from embed attributes
|
||||
*/
|
||||
Rich = 'rich',
|
||||
/**
|
||||
* Image embed
|
||||
*/
|
||||
Image = 'image',
|
||||
/**
|
||||
* Video embed
|
||||
*/
|
||||
Video = 'video',
|
||||
/**
|
||||
* Animated gif image embed rendered as a video embed
|
||||
*/
|
||||
GifV = 'gifv',
|
||||
/**
|
||||
* Article embed
|
||||
*/
|
||||
Article = 'article',
|
||||
/**
|
||||
* Link embed
|
||||
*/
|
||||
Link = 'link',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
|
||||
*/
|
||||
export interface APIEmbedThumbnail {
|
||||
/**
|
||||
* Source url of thumbnail (only supports http(s) and attachments)
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* A proxied url of the thumbnail
|
||||
*/
|
||||
proxy_url?: string;
|
||||
/**
|
||||
* Height of thumbnail
|
||||
*/
|
||||
height?: number;
|
||||
/**
|
||||
* Width of thumbnail
|
||||
*/
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
|
||||
*/
|
||||
export interface APIEmbedVideo {
|
||||
/**
|
||||
* Source url of video
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* Height of video
|
||||
*/
|
||||
height?: number;
|
||||
/**
|
||||
* Width of video
|
||||
*/
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
|
||||
*/
|
||||
export interface APIEmbedImage {
|
||||
/**
|
||||
* Source url of image (only supports http(s) and attachments)
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* A proxied url of the image
|
||||
*/
|
||||
proxy_url?: string;
|
||||
/**
|
||||
* Height of image
|
||||
*/
|
||||
height?: number;
|
||||
/**
|
||||
* Width of image
|
||||
*/
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
|
||||
*/
|
||||
export interface APIEmbedProvider {
|
||||
/**
|
||||
* Name of provider
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* URL of provider
|
||||
*/
|
||||
url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
|
||||
*/
|
||||
export interface APIEmbedAuthor {
|
||||
/**
|
||||
* Name of author
|
||||
*
|
||||
* Length limit: 256 characters
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* URL of author
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* URL of author icon (only supports http(s) and attachments)
|
||||
*/
|
||||
icon_url?: string;
|
||||
/**
|
||||
* A proxied url of author icon
|
||||
*/
|
||||
proxy_icon_url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
|
||||
*/
|
||||
export interface APIEmbedFooter {
|
||||
/**
|
||||
* Footer text
|
||||
*
|
||||
* Length limit: 2048 characters
|
||||
*/
|
||||
text: string;
|
||||
/**
|
||||
* URL of footer icon (only supports http(s) and attachments)
|
||||
*/
|
||||
icon_url?: string;
|
||||
/**
|
||||
* A proxied url of footer icon
|
||||
*/
|
||||
proxy_icon_url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
|
||||
*/
|
||||
export interface APIEmbedField {
|
||||
/**
|
||||
* Name of the field
|
||||
*
|
||||
* Length limit: 256 characters
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Value of the field
|
||||
*
|
||||
* Length limit: 1024 characters
|
||||
*/
|
||||
value: string;
|
||||
/**
|
||||
* Whether or not this field should display inline
|
||||
*/
|
||||
inline?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
|
||||
*/
|
||||
export interface APIAttachment {
|
||||
/**
|
||||
* Attachment id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* The attachment's media type
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Media_type
|
||||
*/
|
||||
content_type?: string;
|
||||
/**
|
||||
* Size of file in bytes
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* Source url of file
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* A proxied url of file
|
||||
*/
|
||||
proxy_url: string;
|
||||
/**
|
||||
* Height of file (if image)
|
||||
*/
|
||||
height?: number | null;
|
||||
/**
|
||||
* Width of file (if image)
|
||||
*/
|
||||
width?: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-mention-object-channel-mention-structure
|
||||
*/
|
||||
export interface APIChannelMention {
|
||||
/**
|
||||
* ID of the channel
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* ID of the guild containing the channel
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The type of channel
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*/
|
||||
type: ChannelType;
|
||||
/**
|
||||
* The name of the channel
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
|
||||
*/
|
||||
export enum AllowedMentionsTypes {
|
||||
/**
|
||||
* Controls @everyone and @here mentions
|
||||
*/
|
||||
Everyone = 'everyone',
|
||||
/**
|
||||
* Controls role mentions
|
||||
*/
|
||||
Role = 'roles',
|
||||
/**
|
||||
* Controls user mentions
|
||||
*/
|
||||
User = 'users',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure
|
||||
*/
|
||||
export interface APIAllowedMentions {
|
||||
/**
|
||||
* An array of allowed mention types to parse from the content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
|
||||
*/
|
||||
parse?: AllowedMentionsTypes[];
|
||||
/**
|
||||
* Array of role_ids to mention (Max size of 100)
|
||||
*/
|
||||
roles?: Snowflake[];
|
||||
/**
|
||||
* Array of user_ids to mention (Max size of 100)
|
||||
*/
|
||||
users?: Snowflake[];
|
||||
/**
|
||||
* For replies, whether to mention the author of the message being replied to (default false)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
replied_user?: boolean;
|
||||
}
|
||||
51
deno/payloads/v8/emoji.ts
Normal file
51
deno/payloads/v8/emoji.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/emoji
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* Not documented but mentioned
|
||||
*/
|
||||
export interface APIPartialEmoji {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
id: Snowflake | null;
|
||||
/**
|
||||
* Emoji name (can be null only in reaction emoji objects)
|
||||
*/
|
||||
name: string | null;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
animated?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure
|
||||
*/
|
||||
export interface APIEmoji extends APIPartialEmoji {
|
||||
/**
|
||||
* Roles this emoji is whitelisted to
|
||||
*/
|
||||
roles?: APIRole['id'][];
|
||||
/**
|
||||
* User that created this emoji
|
||||
*/
|
||||
user?: APIUser;
|
||||
/**
|
||||
* Whether this emoji must be wrapped in colons
|
||||
*/
|
||||
require_colons?: boolean;
|
||||
/**
|
||||
* Whether this emoji is managed
|
||||
*/
|
||||
managed?: boolean;
|
||||
/**
|
||||
* Whether this emoji can be used, may be false due to loss of Server Boosts
|
||||
*/
|
||||
available?: boolean;
|
||||
}
|
||||
312
deno/payloads/v8/gateway.ts
Normal file
312
deno/payloads/v8/gateway.ts
Normal file
@@ -0,0 +1,312 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIEmoji } from './emoji.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway
|
||||
*/
|
||||
export interface APIGatewayInfo {
|
||||
/**
|
||||
* The WSS URL that can be used for connecting to the gateway
|
||||
*/
|
||||
url: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway-bot
|
||||
*/
|
||||
export interface APIGatewayBotInfo extends APIGatewayInfo {
|
||||
/**
|
||||
* The recommended number of shards to use when connecting
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#sharding
|
||||
*/
|
||||
shards: number;
|
||||
/**
|
||||
* Information on the current session start limit
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#session-start-limit-object
|
||||
*/
|
||||
session_start_limit: APIGatewaySessionStartLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#session-start-limit-object
|
||||
*/
|
||||
export interface APIGatewaySessionStartLimit {
|
||||
/**
|
||||
* The total number of session starts the current user is allowed
|
||||
*/
|
||||
total: number;
|
||||
/**
|
||||
* The remaining number of session starts the current user is allowed
|
||||
*/
|
||||
remaining: number;
|
||||
/**
|
||||
* The number of milliseconds after which the limit resets
|
||||
*/
|
||||
reset_after: number;
|
||||
/**
|
||||
* The number of identify requests allowed per 5 seconds
|
||||
*/
|
||||
max_concurrency: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#presence-update-presence-update-event-fields
|
||||
*/
|
||||
export interface GatewayPresenceUpdate {
|
||||
/**
|
||||
* The user presence is being updated for
|
||||
*
|
||||
* **The user object within this event can be partial, the only field which must be sent is the `id` field,
|
||||
* everything else is optional.**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
user: Partial<APIUser> & Pick<APIUser, 'id'>;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* Either "idle", "dnd", "online", or "offline"
|
||||
*/
|
||||
status?: PresenceUpdateStatus;
|
||||
/**
|
||||
* User's current activities
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object
|
||||
*/
|
||||
activities?: GatewayActivity[];
|
||||
/**
|
||||
* User's platform-dependent status
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#client-status-object
|
||||
*/
|
||||
client_status?: GatewayPresenceClientStatus;
|
||||
}
|
||||
|
||||
export enum PresenceUpdateStatus {
|
||||
Online = 'online',
|
||||
DoNotDisturb = 'dnd',
|
||||
Idle = 'idle',
|
||||
/**
|
||||
* Invisible and shown as offline
|
||||
*/
|
||||
Invisible = 'invisible',
|
||||
Offline = 'offline',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#client-status-object
|
||||
*/
|
||||
export interface GatewayPresenceClientStatus {
|
||||
/**
|
||||
* The user's status set for an active desktop (Windows, Linux, Mac) application session
|
||||
*/
|
||||
desktop?: PresenceUpdateStatus;
|
||||
/**
|
||||
* The user's status set for an active mobile (iOS, Android) application session
|
||||
*/
|
||||
mobile?: PresenceUpdateStatus;
|
||||
/**
|
||||
* The user's status set for an active web (browser, bot account) application session
|
||||
*/
|
||||
web?: PresenceUpdateStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-structure
|
||||
*/
|
||||
export interface GatewayActivity {
|
||||
/**
|
||||
* The activity's id
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The activity's name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Activity type
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
|
||||
*/
|
||||
type: ActivityType;
|
||||
/**
|
||||
* Stream url, is validated when type is `1`
|
||||
*/
|
||||
url?: string | null;
|
||||
/**
|
||||
* Unix timestamp of when the activity was added to the user's session
|
||||
*/
|
||||
created_at: number;
|
||||
/**
|
||||
* Unix timestamps for start and/or end of the game
|
||||
*/
|
||||
timestamps?: GatewayActivityTimestamps;
|
||||
sync_id?: string;
|
||||
platform?: ActivityPlatform;
|
||||
/**
|
||||
* Application id for the game
|
||||
*/
|
||||
application_id?: Snowflake;
|
||||
/**
|
||||
* What the player is currently doing
|
||||
*/
|
||||
details?: string | null;
|
||||
/**
|
||||
* The user's current party status
|
||||
*/
|
||||
state?: string | null;
|
||||
/**
|
||||
* The emoji used for a custom status
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
|
||||
*/
|
||||
emoji?: GatewayActivityEmoji;
|
||||
session_id?: string;
|
||||
/**
|
||||
* Information for the current party of the player
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
|
||||
*/
|
||||
party?: GatewayActivityParty;
|
||||
/**
|
||||
* Images for the presence and their hover texts
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
|
||||
*/
|
||||
assets?: GatewayActivityAssets;
|
||||
/**
|
||||
* Secrets for Rich Presence joining and spectating
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
|
||||
*/
|
||||
secrets?: GatewayActivitySecrets;
|
||||
/**
|
||||
* Whether or not the activity is an instanced game session
|
||||
*/
|
||||
instance?: boolean;
|
||||
/**
|
||||
* Activity flags `OR`d together, describes what the payload includes
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
flags?: ActivityFlags;
|
||||
/**
|
||||
* The custom buttons shown in the Rich Presence (max 2)
|
||||
*/
|
||||
buttons?: string[] | GatewayActivityButton[];
|
||||
}
|
||||
|
||||
export enum ActivityPlatform {
|
||||
Desktop = 'desktop',
|
||||
Samsung = 'samsung',
|
||||
Xbox = 'xbox',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
|
||||
*/
|
||||
export enum ActivityType {
|
||||
/**
|
||||
* Playing {game}
|
||||
*/
|
||||
Game,
|
||||
/**
|
||||
* Streaming {details}
|
||||
*/
|
||||
Streaming,
|
||||
/**
|
||||
* Listening to {name}
|
||||
*/
|
||||
Listening,
|
||||
/**
|
||||
* Watching {details}
|
||||
*/
|
||||
Watching,
|
||||
/**
|
||||
* {emoji} {details}
|
||||
*/
|
||||
Custom,
|
||||
/**
|
||||
* Competing in {name}
|
||||
*/
|
||||
Competing,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-timestamps
|
||||
*/
|
||||
export interface GatewayActivityTimestamps {
|
||||
/**
|
||||
* Unix time (in milliseconds) of when the activity started
|
||||
*/
|
||||
start?: number;
|
||||
/**
|
||||
* Unix time (in milliseconds) of when the activity ends
|
||||
*/
|
||||
end?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
|
||||
*/
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'id' | 'animated'>> & Pick<APIEmoji, 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
|
||||
*/
|
||||
export interface GatewayActivityParty {
|
||||
/**
|
||||
* The id of the party
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
* Used to show the party's current and maximum size
|
||||
*/
|
||||
size?: [current_size: number, max_size: number];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
|
||||
*/
|
||||
export type GatewayActivityAssets = Partial<
|
||||
Record<'large_image' | 'large_text' | 'small_image' | 'small_text', string>
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
|
||||
*/
|
||||
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
|
||||
*/
|
||||
export enum ActivityFlags {
|
||||
INSTANCE = 1 << 0,
|
||||
JOIN = 1 << 1,
|
||||
SPECTATE = 1 << 2,
|
||||
JOIN_REQUEST = 1 << 3,
|
||||
SYNC = 1 << 4,
|
||||
PLAY = 1 << 5,
|
||||
}
|
||||
|
||||
export interface GatewayActivityButton {
|
||||
/**
|
||||
* The text shown on the button (1-32 characters)
|
||||
*/
|
||||
label: string;
|
||||
/**
|
||||
* The url opened when clicking the button (1-512 characters)
|
||||
*/
|
||||
url: string;
|
||||
}
|
||||
865
deno/payloads/v8/guild.ts
Normal file
865
deno/payloads/v8/guild.ts
Normal file
@@ -0,0 +1,865 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/guild
|
||||
*/
|
||||
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { APIChannel } from './channel.ts';
|
||||
import type { APIEmoji } from './emoji.ts';
|
||||
import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { GatewayVoiceState } from './voice.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#unavailable-guild-object
|
||||
*/
|
||||
export interface APIUnavailableGuild {
|
||||
/**
|
||||
* Guild id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*/
|
||||
unavailable: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-guild-structure
|
||||
*/
|
||||
export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'>, Pick<APIGuild, 'welcome_screen'> {
|
||||
/**
|
||||
* Guild name (2-100 characters, excluding trailing and leading whitespace)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Icon hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
icon: string | null;
|
||||
/**
|
||||
* Splash hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
splash: string | null;
|
||||
/**
|
||||
* Banner hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
banner?: string | null;
|
||||
/**
|
||||
* The description for the guild, if the guild is discoverable
|
||||
*/
|
||||
description?: string | null;
|
||||
/**
|
||||
* Enabled guild features
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
*/
|
||||
features?: GuildFeature[];
|
||||
/**
|
||||
* Verification level required for the guild
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel;
|
||||
/**
|
||||
* The vanity url code for the guild
|
||||
*/
|
||||
vanity_url_code?: string | null;
|
||||
/**
|
||||
* `true` if this guild is unavailable due to an outage
|
||||
*/
|
||||
unavailable?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-guild-structure
|
||||
*/
|
||||
export interface APIGuild extends APIPartialGuild {
|
||||
/**
|
||||
* Icon hash, returned when in the template object
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
icon_hash?: string | null;
|
||||
/**
|
||||
* Discovery splash hash; only present for guilds with the "DISCOVERABLE" feature
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
discovery_splash: string | null;
|
||||
/**
|
||||
* `true` if the user is the owner of the guild
|
||||
*
|
||||
* **This field is only received from https://discord.com/developers/docs/resources/user#get-current-user-guilds**
|
||||
*/
|
||||
owner?: boolean;
|
||||
/**
|
||||
* ID of owner
|
||||
*/
|
||||
owner_id: Snowflake;
|
||||
/**
|
||||
* Total permissions for the user in the guild (excludes overrides)
|
||||
*
|
||||
* **This field is only received from https://discord.com/developers/docs/resources/user#get-current-user-guilds**
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
permissions?: Permissions;
|
||||
/**
|
||||
* Voice region id for the guild
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
* @deprecated This field has been deprecated in favor of `rtc_region` on the channel.
|
||||
*/
|
||||
region: string;
|
||||
/**
|
||||
* ID of afk channel
|
||||
*/
|
||||
afk_channel_id: Snowflake | null;
|
||||
/**
|
||||
* afk timeout in seconds
|
||||
*/
|
||||
afk_timeout: number;
|
||||
/**
|
||||
* `true` if the guild widget is enabled
|
||||
*/
|
||||
widget_enabled?: boolean;
|
||||
/**
|
||||
* The channel id that the widget will generate an invite to, or `null` if set to no invite
|
||||
*/
|
||||
widget_channel_id?: Snowflake | null;
|
||||
/**
|
||||
* Verification level required for the guild
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
verification_level: GuildVerificationLevel;
|
||||
/**
|
||||
* Default message notifications level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
default_message_notifications: GuildDefaultMessageNotifications;
|
||||
/**
|
||||
* Explicit content filter level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
explicit_content_filter: GuildExplicitContentFilter;
|
||||
/**
|
||||
* Roles in the guild
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
roles: APIRole[];
|
||||
/**
|
||||
* Custom guild emojis
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/emoji#emoji-object
|
||||
*/
|
||||
emojis: APIEmoji[];
|
||||
/**
|
||||
* Enabled guild features
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
*/
|
||||
features: GuildFeature[];
|
||||
/**
|
||||
* Required MFA level for the guild
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-mfa-level
|
||||
*/
|
||||
mfa_level: GuildMFALevel;
|
||||
/**
|
||||
* Application id of the guild creator if it is bot-created
|
||||
*/
|
||||
application_id: Snowflake | null;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
system_channel_id: Snowflake | null;
|
||||
/**
|
||||
* System channel flags
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags: GuildSystemChannelFlags;
|
||||
/**
|
||||
* The id of the channel where Community guilds can display rules and/or guidelines
|
||||
*/
|
||||
rules_channel_id: Snowflake | null;
|
||||
/**
|
||||
* When this guild was joined at
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*/
|
||||
joined_at?: string;
|
||||
/**
|
||||
* `true` if this is considered a large guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*/
|
||||
large?: boolean;
|
||||
/**
|
||||
* Total number of members in this guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*/
|
||||
member_count?: number;
|
||||
/**
|
||||
* States of members currently in voice channels; lacks the `guild_id` key
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
voice_states?: Omit<GatewayVoiceState, 'guild_id'>[];
|
||||
/**
|
||||
* Users in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
members?: APIGuildMember[];
|
||||
/**
|
||||
* Channels in the guild
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels?: APIChannel[];
|
||||
/**
|
||||
* Presences of the members in the guild, will only include non-offline members if the size is greater than `large_threshold`
|
||||
*
|
||||
* **This field is only sent within the [GUILD_CREATE](https://discord.com/developers/docs/topics/gateway#guild-create) event**
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway#presence-update
|
||||
*/
|
||||
presences?: GatewayPresenceUpdate[];
|
||||
/**
|
||||
* The maximum number of presences for the guild (the default value, currently 25000, is in effect when `null` is returned)
|
||||
*/
|
||||
max_presences?: number | null;
|
||||
/**
|
||||
* The maximum number of members for the guild
|
||||
*/
|
||||
max_members?: number;
|
||||
/**
|
||||
* The vanity url code for the guild
|
||||
*/
|
||||
vanity_url_code: string | null;
|
||||
/**
|
||||
* The description for the guild, if the guild is discoverable
|
||||
*/
|
||||
description: string | null;
|
||||
/**
|
||||
* Banner hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
banner: string | null;
|
||||
/**
|
||||
* Premium tier (Server Boost level)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-premium-tier
|
||||
*/
|
||||
premium_tier: GuildPremiumTier;
|
||||
/**
|
||||
* The number of boosts this guild currently has
|
||||
*/
|
||||
premium_subscription_count?: number;
|
||||
/**
|
||||
* The preferred locale of a Community guild; used in guild discovery and notices from Discord; defaults to "en-US"
|
||||
*
|
||||
* @default "en-US"
|
||||
*/
|
||||
preferred_locale: string;
|
||||
/**
|
||||
* The id of the channel where admins and moderators of Community guilds receive notices from Discord
|
||||
*/
|
||||
public_updates_channel_id: Snowflake | null;
|
||||
/**
|
||||
* The maximum amount of users in a video channel
|
||||
*/
|
||||
max_video_channel_users?: number;
|
||||
/**
|
||||
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
|
||||
*/
|
||||
approximate_member_count?: number;
|
||||
/**
|
||||
* **This field is only received from https://discord.com/developers/docs/resources/guild#get-guild with the `with_counts` query parameter set to `true`**
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
export enum GuildDefaultMessageNotifications {
|
||||
ALL_MESSAGES,
|
||||
ONLY_MENTIONS,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
export enum GuildExplicitContentFilter {
|
||||
DISABLED,
|
||||
MEMBERS_WITHOUT_ROLES,
|
||||
ALL_MEMBERS,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-mfa-level
|
||||
*/
|
||||
export enum GuildMFALevel {
|
||||
NONE,
|
||||
ELEVATED,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
export enum GuildVerificationLevel {
|
||||
/**
|
||||
* Unrestricted
|
||||
*/
|
||||
NONE,
|
||||
/**
|
||||
* Must have verified email on account
|
||||
*/
|
||||
LOW,
|
||||
/**
|
||||
* Must be registered on Discord for longer than 5 minutes
|
||||
*/
|
||||
MEDIUM,
|
||||
/**
|
||||
* Must be a member of the guild for longer than 10 minutes
|
||||
*/
|
||||
HIGH,
|
||||
/**
|
||||
* Must have a verified phone number
|
||||
*/
|
||||
VERY_HIGH,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-premium-tier
|
||||
*/
|
||||
export enum GuildPremiumTier {
|
||||
NONE,
|
||||
TIER_1,
|
||||
TIER_2,
|
||||
TIER_3,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
export enum GuildSystemChannelFlags {
|
||||
/**
|
||||
* Suppress member join notifications
|
||||
*/
|
||||
SUPPRESS_JOIN_NOTIFICATIONS = 1 << 0,
|
||||
/**
|
||||
* Suppress server boost notifications
|
||||
*/
|
||||
SUPPRESS_PREMIUM_SUBSCRIPTIONS = 1 << 1,
|
||||
/**
|
||||
* Suppress server setup tips
|
||||
*/
|
||||
SUPPRESS_GUILD_REMINDER_NOTIFICATIONS = 1 << 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
*/
|
||||
export enum GuildFeature {
|
||||
/**
|
||||
* Guild has access to set an animated guild icon
|
||||
*/
|
||||
ANIMATED_ICON = 'ANIMATED_ICON',
|
||||
/**
|
||||
* Guild has access to set a guild banner image
|
||||
*/
|
||||
BANNER = 'BANNER',
|
||||
/**
|
||||
* Guild has access to use commerce features (i.e. create store channels)
|
||||
*/
|
||||
COMMERCE = 'COMMERCE',
|
||||
/**
|
||||
* Guild can enable welcome screen, Membership Screening and discovery, and receives community updates
|
||||
*/
|
||||
COMMUNITY = 'COMMUNITY',
|
||||
/**
|
||||
* Guild is able to be discovered in the directory
|
||||
*/
|
||||
DISCOVERABLE = 'DISCOVERABLE',
|
||||
/**
|
||||
* Guild is able to be featured in the directory
|
||||
*/
|
||||
FEATURABLE = 'FEATURABLE',
|
||||
/**
|
||||
* Guild has access to set an invite splash background
|
||||
*/
|
||||
INVITE_SPLASH = 'INVITE_SPLASH',
|
||||
/**
|
||||
* Guild has access to create news channels
|
||||
*/
|
||||
NEWS = 'NEWS',
|
||||
/**
|
||||
* Guild is partnered
|
||||
*/
|
||||
PARTNERED = 'PARTNERED',
|
||||
RELAY_ENABLED = 'RELAY_ENABLED',
|
||||
/**
|
||||
* Guild has access to set a vanity URL
|
||||
*/
|
||||
VANITY_URL = 'VANITY_URL',
|
||||
/**
|
||||
* Guild is verified
|
||||
*/
|
||||
VERIFIED = 'VERIFIED',
|
||||
/**
|
||||
* Guild has access to set 384kbps bitrate in voice (previously VIP voice servers)
|
||||
*/
|
||||
VIP_REGIONS = 'VIP_REGIONS',
|
||||
/**
|
||||
* Guild has enabled the welcome screen
|
||||
*/
|
||||
WELCOME_SCREEN_ENABLED = 'WELCOME_SCREEN_ENABLED',
|
||||
/**
|
||||
* Guild has enabled Membership Screening
|
||||
*/
|
||||
MEMBER_VERIFICATION_GATE_ENABLED = 'MEMBER_VERIFICATION_GATE_ENABLED',
|
||||
/**
|
||||
* Guild can be previewed before joining via Membership Screening or the directory
|
||||
*/
|
||||
PREVIEW_ENABLED = 'PREVIEW_ENABLED',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-preview-object
|
||||
*/
|
||||
export interface APIGuildPreview {
|
||||
/**
|
||||
* Guild id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Guild name (2-100 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Icon hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
icon: string | null;
|
||||
/**
|
||||
* Splash hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
splash: string | null;
|
||||
/**
|
||||
* Discovery splash hash; only present for guilds with the "DISCOVERABLE" feature
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
discovery_splash: string | null;
|
||||
/**
|
||||
* Custom guild emojis
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/emoji#emoji-object
|
||||
*/
|
||||
emojis: APIEmoji[];
|
||||
/**
|
||||
* Enabled guild features
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
*/
|
||||
features: GuildFeature[];
|
||||
/**
|
||||
* Approximate number of members in this guild
|
||||
*/
|
||||
approximate_member_count: number;
|
||||
/**
|
||||
* Approximate number of online members in this guild
|
||||
*/
|
||||
approximate_presence_count: number;
|
||||
/**
|
||||
* The description for the guild
|
||||
*/
|
||||
description: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object
|
||||
*/
|
||||
export interface APIGuildWidgetSettings {
|
||||
/**
|
||||
* Whether the widget is enabled
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* The widget channel id
|
||||
*/
|
||||
channel_id: Snowflake | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
export interface APIGuildMember {
|
||||
/**
|
||||
* The user this guild member represents
|
||||
*
|
||||
* **This field won't be included in the member object attached to `MESSAGE_CREATE` and `MESSAGE_UPDATE` gateway events.**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
user?: APIUser;
|
||||
/**
|
||||
* This users guild nickname
|
||||
*/
|
||||
nick?: string | null;
|
||||
/**
|
||||
* Array of role object ids
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
roles: Snowflake[];
|
||||
/**
|
||||
* When the user joined the guild
|
||||
*/
|
||||
joined_at: string;
|
||||
/**
|
||||
* When the user started boosting the guild
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/360028038352-Server-Boosting-
|
||||
*/
|
||||
premium_since?: string | null;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*/
|
||||
deaf: boolean;
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*/
|
||||
mute: boolean;
|
||||
/**
|
||||
* Whether the user has not yet passed the guild's Membership Screening requirements
|
||||
*
|
||||
* *If this field is not present, it can be assumed as `false`.*
|
||||
*/
|
||||
pending?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object
|
||||
*/
|
||||
export interface APIGuildIntegration {
|
||||
/**
|
||||
* Integration id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Integration name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Integration type
|
||||
*/
|
||||
type: APIGuildInteractionType;
|
||||
/**
|
||||
* Is this integration enabled
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* Is this integration syncing
|
||||
*
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
*/
|
||||
syncing?: boolean;
|
||||
/**
|
||||
* ID that this integration uses for "subscribers"
|
||||
*
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
*/
|
||||
role_id?: Snowflake;
|
||||
/**
|
||||
* Whether emoticons should be synced for this integration (`twitch` only currently)
|
||||
*
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
*/
|
||||
enable_emoticons?: boolean;
|
||||
/**
|
||||
* The behavior of expiring subscribers
|
||||
*
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
|
||||
*/
|
||||
expire_behavior?: IntegrationExpireBehavior;
|
||||
/**
|
||||
* The grace period (in days) before expiring subscribers
|
||||
*
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
*/
|
||||
expire_grace_period?: number;
|
||||
/**
|
||||
* User for this integration
|
||||
*
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
user?: APIUser;
|
||||
/**
|
||||
* Integration account information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#integration-account-object
|
||||
*/
|
||||
account: APIIntegrationAccount;
|
||||
/**
|
||||
* When this integration was last synced
|
||||
*
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
*/
|
||||
synced_at?: string;
|
||||
/**
|
||||
* How many subscribers this integration has
|
||||
*
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
*/
|
||||
subscriber_count?: number;
|
||||
/**
|
||||
* Has this integration been revoked
|
||||
*
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
*/
|
||||
revoked?: boolean;
|
||||
/**
|
||||
* The bot/OAuth2 application for discord integrations
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#integration-application-object
|
||||
*
|
||||
* **This field is not provided for `discord` bot integrations.**
|
||||
*/
|
||||
application?: APIGuildIntegrationApplication;
|
||||
}
|
||||
|
||||
export type APIGuildInteractionType = 'twitch' | 'youtube' | 'discord';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object-integration-expire-behaviors
|
||||
*/
|
||||
export enum IntegrationExpireBehavior {
|
||||
RemoveRole,
|
||||
Kick,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-account-object
|
||||
*/
|
||||
export interface APIIntegrationAccount {
|
||||
/**
|
||||
* ID of the account
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Name of the account
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-application-object
|
||||
*/
|
||||
export interface APIGuildIntegrationApplication {
|
||||
/**
|
||||
* The id of the app
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The name of the app
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The icon hash of the app
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
icon: string | null;
|
||||
/**
|
||||
* The description of the app
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* The summary of the app
|
||||
*/
|
||||
summary: string;
|
||||
/**
|
||||
* The bot associated with this application
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
bot?: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#ban-object
|
||||
*/
|
||||
export interface APIBan {
|
||||
/**
|
||||
* The reason for the ban
|
||||
*/
|
||||
reason: string | null;
|
||||
/**
|
||||
* The banned user
|
||||
*/
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
|
||||
*/
|
||||
export interface APIGuildWidget {
|
||||
id: Snowflake;
|
||||
name: string;
|
||||
instant_invite: string | null;
|
||||
channels: APIGuildWidgetChannel[];
|
||||
members: APIGuildWidgetMember[];
|
||||
presence_count: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
|
||||
*/
|
||||
export interface APIGuildWidgetChannel {
|
||||
id: Snowflake;
|
||||
name: string;
|
||||
position: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-example-get-guild-widget
|
||||
*/
|
||||
export interface APIGuildWidgetMember {
|
||||
id: string;
|
||||
username: string;
|
||||
discriminator: string;
|
||||
avatar: string | null;
|
||||
status: PresenceUpdateStatus;
|
||||
activity?: { name: string };
|
||||
avatar_url: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-image-widget-style-options
|
||||
*/
|
||||
export enum GuildWidgetStyle {
|
||||
/**
|
||||
* Shield style widget with Discord icon and guild members online count
|
||||
*/
|
||||
Shield = 'shield',
|
||||
/**
|
||||
* Large image with guild icon, name and online count. "POWERED BY DISCORD" as the footer of the widget
|
||||
*/
|
||||
Banner1 = 'banner1',
|
||||
/**
|
||||
* Smaller widget style with guild icon, name and online count. Split on the right with Discord logo
|
||||
*/
|
||||
Banner2 = 'banner2',
|
||||
/**
|
||||
* Large image with guild icon, name and online count. In the footer, Discord logo on the left and "Chat Now" on the right
|
||||
*/
|
||||
Banner3 = 'banner3',
|
||||
/**
|
||||
* Large Discord logo at the top of the widget. Guild icon, name and online count in the middle portion of the widget
|
||||
* and a "JOIN MY SERVER" button at the bottom
|
||||
*/
|
||||
Banner4 = 'banner4',
|
||||
}
|
||||
|
||||
export interface APIGuildWelcomeScreen {
|
||||
/**
|
||||
* The welcome screen short message
|
||||
*/
|
||||
description: string | null;
|
||||
/**
|
||||
* Array of suggested channels
|
||||
*/
|
||||
welcome_channels: APIGuildWelcomeScreenChannel[];
|
||||
}
|
||||
|
||||
export interface APIGuildWelcomeScreenChannel {
|
||||
/**
|
||||
* The channel id that is suggested
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The description shown for the channel
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* The emoji id of the emoji that is shown on the left of the channel
|
||||
*/
|
||||
emoji_id: Snowflake | null;
|
||||
/**
|
||||
* The emoji name of the emoji that is shown on the left of the channel
|
||||
*/
|
||||
emoji_name: string | null;
|
||||
}
|
||||
|
||||
export interface APIGuildMembershipScreening {
|
||||
/**
|
||||
* When the fields were last updated
|
||||
*/
|
||||
version: string;
|
||||
/**
|
||||
* The steps in the screening form
|
||||
*/
|
||||
form_fields: APIGuildMembershipScreeningField[];
|
||||
/**
|
||||
* The server description shown in the screening form
|
||||
*/
|
||||
description: string | null;
|
||||
}
|
||||
|
||||
// TODO: make this a union based on the type in the future, when new types are added
|
||||
|
||||
export interface APIGuildMembershipScreeningField {
|
||||
/**
|
||||
* The type of field
|
||||
*/
|
||||
field_type: MembershipScreeningFieldType;
|
||||
/**
|
||||
* The title of the field
|
||||
*/
|
||||
label: string;
|
||||
/**
|
||||
* The list of rules
|
||||
*/
|
||||
values?: string[];
|
||||
/**
|
||||
* Whether the user has to fill out this field
|
||||
*/
|
||||
required: boolean;
|
||||
}
|
||||
|
||||
export enum MembershipScreeningFieldType {
|
||||
/**
|
||||
* Server Rules
|
||||
*/
|
||||
TERMS = 'TERMS',
|
||||
}
|
||||
396
deno/payloads/v8/interactions.ts
Normal file
396
deno/payloads/v8/interactions.ts
Normal file
@@ -0,0 +1,396 @@
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../rest/v8/mod.ts';
|
||||
import type { APIGuildMember, APIPartialChannel, APIRole, APIUser, MessageFlags } from './mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommand
|
||||
*/
|
||||
export interface APIApplicationCommand {
|
||||
/**
|
||||
* Unique id of the command
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Unique id of the parent application
|
||||
*/
|
||||
application_id: Snowflake;
|
||||
/**
|
||||
* 1-32 character name matching `^[\w-]{1,32}$`
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* 1-100 character description
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* The parameters for the command
|
||||
*/
|
||||
options?: APIApplicationCommandOption[];
|
||||
/**
|
||||
* Whether the command is enabled by default when the app is added to a guild
|
||||
*
|
||||
* If missing, this property should be assumed as `true`
|
||||
*/
|
||||
default_permissions?: boolean;
|
||||
}
|
||||
|
||||
interface APIApplicationCommandOptionBase {
|
||||
type:
|
||||
| ApplicationCommandOptionType.BOOLEAN
|
||||
| ApplicationCommandOptionType.USER
|
||||
| ApplicationCommandOptionType.CHANNEL
|
||||
| ApplicationCommandOptionType.ROLE;
|
||||
name: string;
|
||||
description: string;
|
||||
default?: boolean;
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoption
|
||||
*/
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandArgumentOptions
|
||||
| APIApplicationCommandSubCommandOptions
|
||||
| APIApplicationCommandOptionBase;
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* If the option is a `SUB_COMMAND` or `SUB_COMMAND_GROUP` type, this nested options will be the parameters
|
||||
*/
|
||||
export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.SUB_COMMAND | ApplicationCommandOptionType.SUB_COMMAND_GROUP;
|
||||
options?: APIApplicationCommandOption[];
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to `APIApplicationCommandSubCommandOptions`, these types cannot have an `options` array,
|
||||
* but they can have a `choices` one
|
||||
*/
|
||||
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.STRING | ApplicationCommandOptionType.INTEGER;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptiontype
|
||||
*/
|
||||
export enum ApplicationCommandOptionType {
|
||||
SUB_COMMAND = 1,
|
||||
SUB_COMMAND_GROUP,
|
||||
STRING,
|
||||
INTEGER,
|
||||
BOOLEAN,
|
||||
USER,
|
||||
CHANNEL,
|
||||
ROLE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptionchoice
|
||||
*/
|
||||
export interface APIApplicationCommandOptionChoice {
|
||||
name: string;
|
||||
value: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction
|
||||
*/
|
||||
export interface APIBaseInteraction {
|
||||
/**
|
||||
* ID of the interaction
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* ID of the application this interaction is for
|
||||
*/
|
||||
application_id: Snowflake;
|
||||
/**
|
||||
* The type of interaction
|
||||
*/
|
||||
type: InteractionType;
|
||||
/**
|
||||
* The command data payload
|
||||
*/
|
||||
data?: APIApplicationCommandInteractionData;
|
||||
/**
|
||||
* The channel it was sent from
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* A continuation token for responding to the interaction
|
||||
*/
|
||||
token: string;
|
||||
/**
|
||||
* Read-only property, always `1`
|
||||
*/
|
||||
version: 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction
|
||||
*/
|
||||
export interface APIGuildInteraction extends APIBaseInteraction {
|
||||
/**
|
||||
* The guild it was sent from
|
||||
*
|
||||
* In the case of an `APIDMInteraction`, this will not be present
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* Guild member data for the invoking user, including permissions
|
||||
*/
|
||||
member: APIGuildMember & { permissions: Permissions; user: APIUser };
|
||||
channel_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction
|
||||
*/
|
||||
export interface APIDMInteraction extends APIBaseInteraction {
|
||||
/**
|
||||
* User object for the invoking user, if invoked in a DM
|
||||
*/
|
||||
user: APIUser;
|
||||
channel_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction
|
||||
*/
|
||||
export type APIInteraction = APIGuildInteraction | APIDMInteraction;
|
||||
|
||||
/**
|
||||
* Like APIGuildInteraction, only with the `data` property always present
|
||||
*
|
||||
* @see APIGuildInteraction
|
||||
*/
|
||||
export type APIApplicationCommandGuildInteraction = Required<APIGuildInteraction>;
|
||||
|
||||
/**
|
||||
* Like APIDMInteraction, only with the `data` property always present
|
||||
*
|
||||
* @see APIDMInteraction
|
||||
*/
|
||||
export type APIApplicationCommandDMInteraction = Required<APIDMInteraction>;
|
||||
|
||||
/**
|
||||
* Like APIInteraction, only with the `data` property always present
|
||||
*
|
||||
* @see APIInteraction
|
||||
*/
|
||||
export type APIApplicationCommandInteraction =
|
||||
| APIApplicationCommandGuildInteraction
|
||||
| APIApplicationCommandDMInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-interactiontype
|
||||
*/
|
||||
export enum InteractionType {
|
||||
Ping = 1,
|
||||
ApplicationCommand,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#guildapplicationcommandpermissions
|
||||
*/
|
||||
export interface APIGuildApplicationCommandPermissions {
|
||||
/**
|
||||
* The id of the command
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The id of the application the command belongs to
|
||||
*/
|
||||
application_id: Snowflake;
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The permissions for the command in the guild
|
||||
*/
|
||||
permissions: APIApplicationCommandPermission[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommandpermissions
|
||||
*/
|
||||
export interface APIApplicationCommandPermission {
|
||||
/**
|
||||
* The id of the role or user
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Role or user
|
||||
*/
|
||||
type: ApplicationCommandPermissionType;
|
||||
/**
|
||||
* `true` to allow, `false`, to disallow
|
||||
*/
|
||||
permission: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommandpermissiontype
|
||||
*/
|
||||
export enum ApplicationCommandPermissionType {
|
||||
ROLE = 1,
|
||||
USER,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-applicationcommandinteractiondata
|
||||
*/
|
||||
export interface APIApplicationCommandInteractionData {
|
||||
id: Snowflake;
|
||||
name: string;
|
||||
options?: APIApplicationCommandInteractionDataOption[];
|
||||
resolved?: {
|
||||
users?: Record<string, APIUser>;
|
||||
roles?: Record<string, APIRole>;
|
||||
members?: Record<string, Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> & { permissions: Permissions }>;
|
||||
channels?: Record<string, Required<APIPartialChannel> & { permissions: Permissions }>;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-applicationcommandinteractiondataoption
|
||||
*/
|
||||
export type APIApplicationCommandInteractionDataOption =
|
||||
| ApplicationCommandInteractionDataOptionSubCommand
|
||||
| ApplicationCommandInteractionDataOptionSubCommandGroup
|
||||
| APIApplicationCommandInteractionDataOptionWithValues;
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommand {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.SUB_COMMAND;
|
||||
options: APIApplicationCommandInteractionDataOptionWithValues[];
|
||||
}
|
||||
|
||||
export interface ApplicationCommandInteractionDataOptionSubCommandGroup {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.SUB_COMMAND_GROUP;
|
||||
options: ApplicationCommandInteractionDataOptionSubCommand[];
|
||||
}
|
||||
|
||||
export type APIApplicationCommandInteractionDataOptionWithValues =
|
||||
| ApplicationCommandInteractionDataOptionString
|
||||
| ApplicationCommandInteractionDataOptionRole
|
||||
| ApplicationCommandInteractionDataOptionChannel
|
||||
| ApplicationCommandInteractionDataOptionUser
|
||||
| ApplicationCommandInteractionDataOptionInteger
|
||||
| ApplicationCommandInteractionDataOptionBoolean;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionString = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.STRING,
|
||||
string
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionRole = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.ROLE,
|
||||
Snowflake
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionChannel = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.CHANNEL,
|
||||
Snowflake
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionUser = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.USER,
|
||||
Snowflake
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionInteger = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.INTEGER,
|
||||
number
|
||||
>;
|
||||
|
||||
export type ApplicationCommandInteractionDataOptionBoolean = InteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.BOOLEAN,
|
||||
boolean
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-response
|
||||
*/
|
||||
export type APIInteractionResponse =
|
||||
| APIInteractionResponsePong
|
||||
| APIInteractionResponseChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredChannelMessageWithSource;
|
||||
|
||||
export interface APIInteractionResponsePong {
|
||||
type: InteractionResponseType.Pong;
|
||||
}
|
||||
|
||||
export interface APIInteractionResponseChannelMessageWithSource {
|
||||
type: InteractionResponseType.ChannelMessageWithSource;
|
||||
data: APIInteractionApplicationCommandCallbackData;
|
||||
}
|
||||
|
||||
export interface APIInteractionResponseDeferredChannelMessageWithSource {
|
||||
type: InteractionResponseType.DeferredChannelMessageWithSource;
|
||||
data?: Pick<APIInteractionApplicationCommandCallbackData, 'flags'>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-response-interactionresponsetype
|
||||
*/
|
||||
export enum InteractionResponseType {
|
||||
/**
|
||||
* ACK a `Ping`
|
||||
*/
|
||||
Pong = 1,
|
||||
/**
|
||||
* Respond to an interaction with a message
|
||||
*/
|
||||
ChannelMessageWithSource = 4,
|
||||
/**
|
||||
* ACK an interaction and edit to a response later, the user sees a loading state
|
||||
*/
|
||||
DeferredChannelMessageWithSource,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-response-interactionapplicationcommandcallbackdata
|
||||
*/
|
||||
export type APIInteractionApplicationCommandCallbackData = Omit<
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
'username' | 'avatar_url'
|
||||
> & { flags?: MessageFlags };
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#messageinteraction
|
||||
*/
|
||||
export interface APIMessageInteraction {
|
||||
/**
|
||||
* ID of the interaction
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The type of interaction
|
||||
*/
|
||||
type: InteractionType;
|
||||
/**
|
||||
* The name of the ApplicationCommand
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The user who invoked the interaction
|
||||
*/
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
interface InteractionDataOptionBase<T extends ApplicationCommandOptionType, D = unknown> {
|
||||
name: string;
|
||||
type: T;
|
||||
value: D;
|
||||
}
|
||||
94
deno/payloads/v8/invite.ts
Normal file
94
deno/payloads/v8/invite.ts
Normal file
@@ -0,0 +1,94 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/invite
|
||||
*/
|
||||
|
||||
import type { APIPartialChannel } from './channel.ts';
|
||||
import type { APIPartialGuild } from './guild.ts';
|
||||
import type { APIApplication } from './oauth2.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object
|
||||
*/
|
||||
export interface APIInvite {
|
||||
/**
|
||||
* The invite code (unique ID)
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* The guild this invite is for
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object
|
||||
*/
|
||||
guild?: APIPartialGuild;
|
||||
/**
|
||||
* The channel this invite is for
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channel?: Required<APIPartialChannel>;
|
||||
/**
|
||||
* The user who created the invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
inviter?: APIUser;
|
||||
/**
|
||||
* The type of user target for this voice channel invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
|
||||
*/
|
||||
target_type?: InviteTargetUserType;
|
||||
/**
|
||||
* The user whose stream to display for this voice channel stream invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
target_user?: APIUser;
|
||||
/**
|
||||
* The embedded application to open for this voice channel embedded application invite
|
||||
*/
|
||||
target_application?: Partial<APIApplication>;
|
||||
/**
|
||||
* Approximate count of online members, returned from the `GET /invites/<code>` endpoint when `with_counts` is `true`
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
/**
|
||||
* Approximate count of total members, returned from the `GET /invites/<code>` endpoint when `with_counts` is `true`
|
||||
*/
|
||||
approximate_member_count?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
|
||||
*/
|
||||
export enum InviteTargetUserType {
|
||||
STREAM = 1,
|
||||
EMBEDDED_APPLICATION,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-metadata-object
|
||||
*/
|
||||
export interface APIExtendedInvite extends APIInvite {
|
||||
/**
|
||||
* Number of times this invite has been used
|
||||
*/
|
||||
uses: number;
|
||||
/**
|
||||
* Max number of times this invite can be used
|
||||
*/
|
||||
max_uses: number;
|
||||
/**
|
||||
* Duration (in seconds) after which the invite expires
|
||||
*/
|
||||
max_age: number;
|
||||
/**
|
||||
* Whether this invite only grants temporary membership
|
||||
*/
|
||||
temporary: boolean;
|
||||
/**
|
||||
* When this invite was created
|
||||
*/
|
||||
created_at: string;
|
||||
}
|
||||
14
deno/payloads/v8/mod.ts
Normal file
14
deno/payloads/v8/mod.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
export * from './auditLog.ts';
|
||||
export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
export * from './guild.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './permissions.ts';
|
||||
export * from './teams.ts';
|
||||
export * from './template.ts';
|
||||
export * from './user.ts';
|
||||
export * from './voice.ts';
|
||||
export * from './webhook.ts';
|
||||
209
deno/payloads/v8/oauth2.ts
Normal file
209
deno/payloads/v8/oauth2.ts
Normal file
@@ -0,0 +1,209 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/oauth2
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APITeam } from './teams.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#get-current-application-information-response-structure
|
||||
*/
|
||||
export interface APIApplication {
|
||||
/**
|
||||
* The id of the app
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The name of the app
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The icon hash of the app
|
||||
*/
|
||||
icon: string | null;
|
||||
/**
|
||||
* The description of the app
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* An array of rpc origin urls, if rpc is enabled
|
||||
*/
|
||||
rpc_origins?: string[];
|
||||
/**
|
||||
* When `false` only app owner can join the app's bot to guilds
|
||||
*/
|
||||
bot_public: boolean;
|
||||
/**
|
||||
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
|
||||
*/
|
||||
bot_require_code_grant: boolean;
|
||||
/**
|
||||
* The url of the application's terms of service
|
||||
*/
|
||||
terms_of_service_url?: string;
|
||||
/**
|
||||
* The url of the application's privacy policy
|
||||
*/
|
||||
privacy_policy_url?: string;
|
||||
/**
|
||||
* Partial user object containing info on the owner of the application
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
owner: APIUser;
|
||||
/**
|
||||
* If this application is a game sold on Discord, this field will be the summary field for the store page
|
||||
* of its primary sku
|
||||
*/
|
||||
summary: string;
|
||||
/**
|
||||
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
|
||||
*
|
||||
* See https://discord.com/developers/docs/game-sdk/applications#get-ticket
|
||||
*/
|
||||
verify_key: string;
|
||||
/**
|
||||
* The team this application belongs to
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/teams#data-models-team-object
|
||||
*/
|
||||
team: APITeam | null;
|
||||
/**
|
||||
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
|
||||
*/
|
||||
primary_sku_id?: Snowflake;
|
||||
/**
|
||||
* If this application is a game sold on Discord, this field will be the URL slug that links to the store page
|
||||
*/
|
||||
slug?: string;
|
||||
/**
|
||||
* If this application is a game sold on Discord, this field will be the hash of the image on store embeds
|
||||
*/
|
||||
cover_image?: string;
|
||||
/**
|
||||
* The application's public flags
|
||||
*/
|
||||
flags: ApplicationFlags;
|
||||
}
|
||||
|
||||
export enum ApplicationFlags {
|
||||
ManagedEmoji = 1 << 2,
|
||||
GroupDMCreate = 1 << 4,
|
||||
RPCHasConnected = 1 << 11,
|
||||
GatewayPresence = 1 << 12,
|
||||
GatewayPresenceLimited = 1 << 13,
|
||||
GatewayGuildMembers = 1 << 14,
|
||||
GatewayGuildMembersLimited = 1 << 15,
|
||||
VerificationPendingGuildLimit = 1 << 16,
|
||||
Embedded = 1 << 17,
|
||||
}
|
||||
|
||||
export enum OAuth2Scopes {
|
||||
/**
|
||||
* For oauth2 bots, this puts the bot in the user's selected guild by default
|
||||
*/
|
||||
Bot = 'bot',
|
||||
/**
|
||||
* Allows [/users/@me/connections](https://discord.com/developers/docs/resources/user#get-user-connections)
|
||||
* to return linked third-party accounts
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#get-user-connections
|
||||
*/
|
||||
Connections = 'connections',
|
||||
/**
|
||||
* Enables [/users/@me](https://discord.com/developers/docs/resources/user#get-current-user) to return an `email`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#get-current-user
|
||||
*/
|
||||
Email = 'email',
|
||||
/**
|
||||
* Allows [/users/@me](https://discord.com/developers/docs/resources/user#get-current-user) without `email`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#get-current-user
|
||||
*/
|
||||
Identify = 'identify',
|
||||
/**
|
||||
* Allows [/users/@me/guilds](https://discord.com/developers/docs/resources/user#get-current-user-guilds)
|
||||
* to return basic information about all of a user's guilds
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#get-current-user-guilds
|
||||
*/
|
||||
Guilds = 'guilds',
|
||||
/**
|
||||
* Allows [/guilds/{guild.id}/members/{user.id}](https://discord.com/developers/docs/resources/guild#add-guild-member)
|
||||
* to be used for joining users to a guild
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
*/
|
||||
GuildsJoin = 'guilds.join',
|
||||
/**
|
||||
* Allows your app to join users to a group dm
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
*/
|
||||
GroupDMJoins = 'gdm.join',
|
||||
/**
|
||||
* For local rpc server api access, this allows you to read messages from all client channels
|
||||
* (otherwise restricted to channels/guilds your app creates)
|
||||
*/
|
||||
MessagesRead = 'messages.read',
|
||||
/**
|
||||
* For local rpc server access, this allows you to control a user's local Discord client - whitelist only
|
||||
*/
|
||||
RPC = 'rpc',
|
||||
/**
|
||||
* For local rpc server api access, this allows you to receive notifications pushed out to the user - whitelist only
|
||||
*/
|
||||
RPCNotificationsRead = 'rpc.notifications.read',
|
||||
/**
|
||||
* This generates a webhook that is returned in the oauth token response for authorization code grants
|
||||
*/
|
||||
WebhookIncoming = 'webhook.incoming',
|
||||
/**
|
||||
* Allows your app to upload/update builds for a user's applications - whitelist only
|
||||
*/
|
||||
ApplicationsBuildsUpload = 'applications.builds.upload',
|
||||
/**
|
||||
* Allows your app to read build data for a user's applications
|
||||
*/
|
||||
ApplicationsBuildsRead = 'applications.builds.read',
|
||||
/**
|
||||
* Allows your app to read and update store data (SKUs, store listings, achievements, etc.) for a user's applications
|
||||
*/
|
||||
ApplicationsStoreUpdate = 'applications.store.update',
|
||||
/**
|
||||
* Allows your app to read entitlements for a user's applications
|
||||
*/
|
||||
ApplicationsEntitlements = 'applications.entitlements',
|
||||
/**
|
||||
* Allows your app to know a user's friends and implicit relationships - whitelist only
|
||||
*/
|
||||
RelationshipsRead = 'relationships.read',
|
||||
/**
|
||||
* Allows your app to fetch data from a user's "Now Playing/Recently Played" list - whitelist only
|
||||
*/
|
||||
ActivitiesRead = 'activities.read',
|
||||
/**
|
||||
* Allows your app to update a user's activity - whitelist only (NOT REQUIRED FOR GAMESDK ACTIVITY MANAGER)
|
||||
*
|
||||
* See https://discord.com/developers/docs/game-sdk/activities
|
||||
*/
|
||||
ActivitiesWrite = 'activities.write',
|
||||
/**
|
||||
* Allows your app to create Slash Commands in the authorized guild
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/slash-commands
|
||||
*/
|
||||
ApplicationsCommands = 'applications.commands',
|
||||
/**
|
||||
* Allows your app to update Slash Commands via this bearer token
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/slash-commands
|
||||
*/
|
||||
ApplicationsCommandsUpdate = 'applications.commands.update',
|
||||
}
|
||||
116
deno/payloads/v8/permissions.ts
Normal file
116
deno/payloads/v8/permissions.ts
Normal file
@@ -0,0 +1,116 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/permissions
|
||||
*/
|
||||
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
|
||||
*
|
||||
* These flags are exported as `BigInt`s and NOT numbers. Wrapping them in `Number()`
|
||||
* may cause issues, try to use BigInts as much as possible or modules that can
|
||||
* replicate them in some way
|
||||
*/
|
||||
export const PermissionFlagsBits = {
|
||||
CREATE_INSTANT_INVITE: 1n << 0n,
|
||||
KICK_MEMBERS: 1n << 1n,
|
||||
BAN_MEMBERS: 1n << 2n,
|
||||
ADMINISTRATOR: 1n << 3n,
|
||||
MANAGE_CHANNELS: 1n << 4n,
|
||||
MANAGE_GUILD: 1n << 5n,
|
||||
ADD_REACTIONS: 1n << 6n,
|
||||
VIEW_AUDIT_LOG: 1n << 7n,
|
||||
PRIORITY_SPEAKER: 1n << 8n,
|
||||
STREAM: 1n << 9n,
|
||||
VIEW_CHANNEL: 1n << 10n,
|
||||
SEND_MESSAGES: 1n << 11n,
|
||||
SEND_TTS_MESSAGES: 1n << 12n,
|
||||
MANAGE_MESSAGES: 1n << 13n,
|
||||
EMBED_LINKS: 1n << 14n,
|
||||
ATTACH_FILES: 1n << 15n,
|
||||
READ_MESSAGE_HISTORY: 1n << 16n,
|
||||
MENTION_EVERYONE: 1n << 17n,
|
||||
USE_EXTERNAL_EMOJIS: 1n << 18n,
|
||||
VIEW_GUILD_INSIGHTS: 1n << 19n,
|
||||
CONNECT: 1n << 20n,
|
||||
SPEAK: 1n << 21n,
|
||||
MUTE_MEMBERS: 1n << 22n,
|
||||
DEAFEN_MEMBERS: 1n << 23n,
|
||||
MOVE_MEMBERS: 1n << 24n,
|
||||
USE_VAD: 1n << 25n,
|
||||
CHANGE_NICKNAME: 1n << 26n,
|
||||
MANAGE_NICKNAMES: 1n << 27n,
|
||||
MANAGE_ROLES: 1n << 28n,
|
||||
MANAGE_WEBHOOKS: 1n << 29n,
|
||||
MANAGE_EMOJIS: 1n << 30n,
|
||||
USE_SLASH_COMMANDS: 1n << 31n,
|
||||
REQUEST_TO_SPEAK: 1n << 32n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Freeze the object of bits, preventing any modifications to it
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(PermissionFlagsBits);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
export interface APIRole {
|
||||
/**
|
||||
* Role id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Role name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Integer representation of hexadecimal color code
|
||||
*/
|
||||
color: number;
|
||||
/**
|
||||
* If this role is pinned in the user listing
|
||||
*/
|
||||
hoist: boolean;
|
||||
/**
|
||||
* Position of this role
|
||||
*/
|
||||
position: number;
|
||||
/**
|
||||
* Permission bit set
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
permissions: Permissions;
|
||||
/**
|
||||
* Whether this role is managed by an integration
|
||||
*/
|
||||
managed: boolean;
|
||||
/**
|
||||
* Whether this role is mentionable
|
||||
*/
|
||||
mentionable: boolean;
|
||||
/**
|
||||
* The tags this role has
|
||||
*/
|
||||
tags?: APIRoleTags;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure
|
||||
*/
|
||||
export interface APIRoleTags {
|
||||
/**
|
||||
* The id of the bot this role belongs to
|
||||
*/
|
||||
bot_id?: Snowflake;
|
||||
/**
|
||||
* Whether this is the guild's premium subscriber role
|
||||
*/
|
||||
premium_subscriber?: null;
|
||||
/**
|
||||
* The id of the integration this role belongs to
|
||||
*/
|
||||
integration_id?: Snowflake;
|
||||
}
|
||||
62
deno/payloads/v8/teams.ts
Normal file
62
deno/payloads/v8/teams.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/teams
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-object
|
||||
*/
|
||||
export interface APITeam {
|
||||
/**
|
||||
* A hash of the image of the team's icon
|
||||
*/
|
||||
icon: string | null;
|
||||
/**
|
||||
* The unique id of the team
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The members of the team
|
||||
*/
|
||||
members: APITeamMember[];
|
||||
/**
|
||||
* The user id of the current team owner
|
||||
*/
|
||||
owner_user_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-members-object
|
||||
*/
|
||||
export interface APITeamMember {
|
||||
/**
|
||||
* The user's membership state on the team
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum
|
||||
*/
|
||||
membership_state: TeamMemberMembershipState;
|
||||
/**
|
||||
* Will always be `["*"]`
|
||||
*/
|
||||
permissions: ['*'];
|
||||
/**
|
||||
* The id of the parent team of which they are a member
|
||||
*/
|
||||
team_id: Snowflake;
|
||||
/**
|
||||
* The avatar, discriminator, id, and username of the user
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-membership-state-enum
|
||||
*/
|
||||
export enum TeamMemberMembershipState {
|
||||
INVITED = 1,
|
||||
ACCEPTED,
|
||||
}
|
||||
65
deno/payloads/v8/template.ts
Normal file
65
deno/payloads/v8/template.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/template
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v8/mod.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#template-object
|
||||
*/
|
||||
export interface APITemplate {
|
||||
/**
|
||||
* The template code (unique ID)
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* Template name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The description for the template
|
||||
*/
|
||||
description: string | null;
|
||||
/**
|
||||
* Number of times this template has been used
|
||||
*/
|
||||
usage_count: number;
|
||||
/**
|
||||
* The ID of the user who created the template
|
||||
*/
|
||||
creator_id: Snowflake;
|
||||
/**
|
||||
* The user who created the template
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
creator: APIUser;
|
||||
/**
|
||||
* When this template was created
|
||||
*/
|
||||
created_at: string;
|
||||
/**
|
||||
* When this template was last synced to the source guild
|
||||
*/
|
||||
updated_at: string;
|
||||
/**
|
||||
* The ID of the guild this template is based on
|
||||
*/
|
||||
source_guild_id: Snowflake;
|
||||
/**
|
||||
* The guild snapshot this template contains
|
||||
*/
|
||||
serialized_source_guild: APITemplateSerializedSourceGuild;
|
||||
/**
|
||||
* Whether the template has unsynced changes
|
||||
*/
|
||||
is_dirty: boolean | null;
|
||||
}
|
||||
|
||||
export interface APITemplateSerializedSourceGuild extends Omit<RESTPostAPIGuildsJSONBody, 'icon'> {
|
||||
description: string | null;
|
||||
preferred_locale: string;
|
||||
icon_hash: string | null;
|
||||
}
|
||||
157
deno/payloads/v8/user.ts
Normal file
157
deno/payloads/v8/user.ts
Normal file
@@ -0,0 +1,157 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/user
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIGuildIntegration } from './guild.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
export interface APIUser {
|
||||
/**
|
||||
* The user's id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The user's username, not unique across the platform
|
||||
*/
|
||||
username: string;
|
||||
/**
|
||||
* The user's 4-digit discord-tag
|
||||
*/
|
||||
discriminator: string;
|
||||
/**
|
||||
* The user's avatar hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
avatar: string | null;
|
||||
/**
|
||||
* Whether the user belongs to an OAuth2 application
|
||||
*/
|
||||
bot?: boolean;
|
||||
/**
|
||||
* Whether the user is an Official Discord System user (part of the urgent message system)
|
||||
*/
|
||||
system?: boolean;
|
||||
/**
|
||||
* Whether the user has two factor enabled on their account
|
||||
*/
|
||||
mfa_enabled?: boolean;
|
||||
/**
|
||||
* The user's chosen language option
|
||||
*/
|
||||
locale?: string;
|
||||
/**
|
||||
* Whether the email on this account has been verified
|
||||
*/
|
||||
verified?: boolean;
|
||||
/**
|
||||
* The user's email
|
||||
*/
|
||||
email?: string | null;
|
||||
/**
|
||||
* The flags on a user's account
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object-user-flags
|
||||
*/
|
||||
flags?: UserFlags;
|
||||
/**
|
||||
* The type of Nitro subscription on a user's account
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object-premium-types
|
||||
*/
|
||||
premium_type?: UserPremiumType;
|
||||
/**
|
||||
* The public flags on a user's account
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object-user-flags
|
||||
*/
|
||||
public_flags?: UserFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object-user-flags
|
||||
*/
|
||||
export enum UserFlags {
|
||||
None = 0,
|
||||
DiscordEmployee = 1 << 0,
|
||||
PartneredServerOwner = 1 << 1,
|
||||
DiscordHypeSquadEvents = 1 << 2,
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
HypeSquadHouseBravery = 1 << 6,
|
||||
HypeSquadHouseBrilliance = 1 << 7,
|
||||
HypeSquadHouseBalance = 1 << 8,
|
||||
EarlySupporter = 1 << 9,
|
||||
TeamUser = 1 << 10,
|
||||
BugHunterLevel2 = 1 << 14,
|
||||
VerifiedBot = 1 << 16,
|
||||
EarlyVerifiedBotDeveloper = 1 << 17,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object-premium-types
|
||||
*/
|
||||
export enum UserPremiumType {
|
||||
None,
|
||||
NitroClassic,
|
||||
Nitro,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#connection-object
|
||||
*/
|
||||
export interface APIConnection {
|
||||
/**
|
||||
* ID of the connection account
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The username of the connection account
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The service of the connection
|
||||
*/
|
||||
type: string;
|
||||
/**
|
||||
* Whether the connection is revoked
|
||||
*/
|
||||
revoked?: boolean;
|
||||
/**
|
||||
* An array of partial server integrations
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#integration-object
|
||||
*/
|
||||
integrations?: Partial<APIGuildIntegration>[];
|
||||
/**
|
||||
* Whether the connection is verified
|
||||
*/
|
||||
verified: boolean;
|
||||
/**
|
||||
* Whether friend sync is enabled for this connection
|
||||
*/
|
||||
friend_sync: boolean;
|
||||
/**
|
||||
* Whether activities related to this connection will be shown in presence updates
|
||||
*/
|
||||
show_activity: boolean;
|
||||
/**
|
||||
* Visibility of this connection
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#connection-object-visibility-types
|
||||
*/
|
||||
visibility: ConnectionVisibility;
|
||||
}
|
||||
|
||||
export enum ConnectionVisibility {
|
||||
/**
|
||||
* Invisible to everyone except the user themselves
|
||||
*/
|
||||
None,
|
||||
/**
|
||||
* Visible to everyone
|
||||
*/
|
||||
Everyone,
|
||||
}
|
||||
96
deno/payloads/v8/voice.ts
Normal file
96
deno/payloads/v8/voice.ts
Normal file
@@ -0,0 +1,96 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/voice
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-state-object
|
||||
*/
|
||||
export interface GatewayVoiceState {
|
||||
/**
|
||||
* The guild id this voice state is for
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The channel id this user is connected to
|
||||
*/
|
||||
channel_id: Snowflake | null;
|
||||
/**
|
||||
* The user id this voice state is for
|
||||
*/
|
||||
user_id: Snowflake;
|
||||
/**
|
||||
* The guild member this voice state is for
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* The session id for this voice state
|
||||
*/
|
||||
session_id: string;
|
||||
/**
|
||||
* Whether this user is deafened by the server
|
||||
*/
|
||||
deaf: boolean;
|
||||
/**
|
||||
* Whether this user is muted by the server
|
||||
*/
|
||||
mute: boolean;
|
||||
/**
|
||||
* Whether this user is locally deafened
|
||||
*/
|
||||
self_deaf: boolean;
|
||||
/**
|
||||
* Whether this user is locally muted
|
||||
*/
|
||||
self_mute: boolean;
|
||||
/**
|
||||
* Whether this user is streaming using "Go Live"
|
||||
*/
|
||||
self_stream?: boolean;
|
||||
/**
|
||||
* Whether this user's camera is enabled
|
||||
*/
|
||||
self_video: boolean;
|
||||
/**
|
||||
* Whether this user is muted by the current user
|
||||
*/
|
||||
suppress: boolean;
|
||||
/**
|
||||
* The time at which the user requested to speak
|
||||
*/
|
||||
request_to_speak_timestamp: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
export interface APIVoiceRegion {
|
||||
/**
|
||||
* Unique ID for the region
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Name of the region
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* `true` if this is a vip-only server
|
||||
*/
|
||||
vip: boolean;
|
||||
/**
|
||||
* `true` for a single server that is closest to the current user's client
|
||||
*/
|
||||
optimal: boolean;
|
||||
/**
|
||||
* Whether this is a deprecated voice region (avoid switching to these)
|
||||
*/
|
||||
deprecated: boolean;
|
||||
/**
|
||||
* Whether this is a custom voice region (used for events/etc)
|
||||
*/
|
||||
custom: boolean;
|
||||
}
|
||||
75
deno/payloads/v8/webhook.ts
Normal file
75
deno/payloads/v8/webhook.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/webhook
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIPartialChannel, APIPartialGuild, APIUser } from './mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#webhook-object
|
||||
*/
|
||||
export interface APIWebhook {
|
||||
/**
|
||||
* The id of the webhook
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The type of the webhook
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/webhook#webhook-object-webhook-types
|
||||
*/
|
||||
type: WebhookType;
|
||||
/**
|
||||
* The guild id this webhook is for
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The channel id this webhook is for
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The user this webhook was created by (not returned when getting a webhook with its token)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
user?: APIUser;
|
||||
/**
|
||||
* The default name of the webhook
|
||||
*/
|
||||
name: string | null;
|
||||
/**
|
||||
* The default avatar of the webhook
|
||||
*/
|
||||
avatar: string | null;
|
||||
/**
|
||||
* The secure token of the webhook (returned for Incoming Webhooks)
|
||||
*/
|
||||
token?: string;
|
||||
/**
|
||||
* The bot/OAuth2 application that created this webhook
|
||||
*/
|
||||
application_id: Snowflake | null;
|
||||
/**
|
||||
* The guild of the channel that this webhook is following (returned for Channel Follower Webhooks)
|
||||
*/
|
||||
source_guild?: APIPartialGuild;
|
||||
/**
|
||||
* The channel that this webhook is following (returned for Channel Follower Webhooks)
|
||||
*/
|
||||
source_channel?: APIPartialChannel;
|
||||
/**
|
||||
* The url used for executing the webhook (returned by the webhooks OAuth2 flow)
|
||||
*/
|
||||
url?: string;
|
||||
}
|
||||
|
||||
export enum WebhookType {
|
||||
/**
|
||||
* Incoming Webhooks can post messages to channels with a generated token
|
||||
*/
|
||||
Incoming = 1,
|
||||
/**
|
||||
* Channel Follower Webhooks are internal webhooks used with Channel Following to post new messages into channels
|
||||
*/
|
||||
ChannelFollower,
|
||||
}
|
||||
@@ -18,7 +18,7 @@ export enum RESTJSONErrorCodes {
|
||||
UnknownToken,
|
||||
UnknownUser,
|
||||
UnknownEmoji,
|
||||
UnknownWebook,
|
||||
UnknownWebhook,
|
||||
|
||||
UnknownBan = 10026,
|
||||
UnknownSKU,
|
||||
@@ -30,9 +30,15 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
UnknownRedistributable = 10036,
|
||||
|
||||
UnknownGuildTemplate = 10057,
|
||||
|
||||
UnknownApplicationCommand = 10063,
|
||||
|
||||
BotsCannotUseThisEndpoint = 20001,
|
||||
OnlyBotsCanUseThisEndpoint,
|
||||
|
||||
AnnouncementEditLimitExceeded = 20022,
|
||||
|
||||
ChannelSendRateLimit = 20028,
|
||||
|
||||
MaximumNumberOfGuildsReached = 30001,
|
||||
@@ -50,6 +56,8 @@ export enum RESTJSONErrorCodes {
|
||||
MaximumNumberOfAttachmentsInAMessageReached = 30015,
|
||||
MaximumNumberOfInvitesReached,
|
||||
|
||||
GuildAlreadyHasTemplate = 30031,
|
||||
|
||||
Unauthorized = 40001,
|
||||
VerifyYourAccount,
|
||||
|
||||
@@ -57,6 +65,8 @@ export enum RESTJSONErrorCodes {
|
||||
FeatureTemporarilyDisabledServerSide,
|
||||
UserBannedFromThisGuild,
|
||||
|
||||
ThisMessageWasAlreadyCrossposted = 40033,
|
||||
|
||||
MissingAccess = 50001,
|
||||
InvalidAccountType,
|
||||
CannotExecuteActionOnDMChannel,
|
||||
@@ -81,6 +91,8 @@ export enum RESTJSONErrorCodes {
|
||||
CannotExecuteActionOnThisChannelType = 50024,
|
||||
InvalidOauth2AccessToken,
|
||||
|
||||
InvalidWebhookToken = 50027,
|
||||
|
||||
InvalidRecipients = 50033,
|
||||
OneOfTheMessagesProvidedWasTooOldForBulkDelete,
|
||||
InvalidFormBodyOrContentType,
|
||||
@@ -90,55 +102,11 @@ export enum RESTJSONErrorCodes {
|
||||
|
||||
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
|
||||
|
||||
InvalidStickerSent = 50081,
|
||||
|
||||
TwoFactorAuthenticationIsRequired = 60003,
|
||||
|
||||
ReactionWasBlocked = 90001,
|
||||
|
||||
APIResourceOverloaded = 130000,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes
|
||||
*/
|
||||
export enum RPCErrorCodes {
|
||||
UnknownError = 1000,
|
||||
|
||||
InvalidPayload = 4000,
|
||||
|
||||
InvalidCommand = 4002,
|
||||
InvalidGuild,
|
||||
InvalidEvent,
|
||||
InvalidChannel,
|
||||
InvalidPermissions,
|
||||
InvalidClientID,
|
||||
InvalidOrigin,
|
||||
InvalidToken,
|
||||
InvalidUser,
|
||||
|
||||
Oauth2Error = 5000,
|
||||
SelectChannelTimedOut,
|
||||
GetGuildTimedOut,
|
||||
SelectVoiceForceRequired,
|
||||
CaptureShortcutAlreadyListening,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-close-event-codes
|
||||
*/
|
||||
export enum RPCCloseEventCodes {
|
||||
InvalidClientID = 4000,
|
||||
InvalidOrigin,
|
||||
RateLimited,
|
||||
TokenRevoked,
|
||||
InvalidVersion,
|
||||
InvalidEncoding,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params
|
||||
*/
|
||||
export interface GatewayConnectQuery {
|
||||
v: string;
|
||||
encoding: 'json' | 'etf';
|
||||
compress?: 'zlib-stream';
|
||||
}
|
||||
4
deno/rest/mod.ts
Normal file
4
deno/rest/mod.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// This file exports all the types available in the recommended API version
|
||||
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
|
||||
|
||||
export * from './v8/mod.ts';
|
||||
17
deno/rest/v6/auditLog.ts
Normal file
17
deno/rest/v6/auditLog.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { APIAuditLog, AuditLogEvent } from '../../payloads/v6/auditLog.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTGetAPIAuditLogQuery {
|
||||
user_id?: string;
|
||||
action_type?: AuditLogEvent;
|
||||
before?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIAuditLogResult = APIAuditLog;
|
||||
310
deno/rest/v6/channel.ts
Normal file
310
deno/rest/v6/channel.ts
Normal file
@@ -0,0 +1,310 @@
|
||||
import type {
|
||||
APIChannel,
|
||||
APIEmbed,
|
||||
APIFollowedChannel,
|
||||
APIInvite,
|
||||
APIMessage,
|
||||
APIMessageReference,
|
||||
APIOverwrite,
|
||||
APIUser,
|
||||
ChannelType,
|
||||
InviteTargetUserType,
|
||||
MessageFlags,
|
||||
OverwriteType,
|
||||
} from '../../payloads/v6/mod.ts';
|
||||
|
||||
// #region TypeDefs
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIOverwriteSend {
|
||||
id: string;
|
||||
type: OverwriteType;
|
||||
allow: number | string;
|
||||
deny: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum AllowedMentionsTypes {
|
||||
Everyone = 'everyone',
|
||||
Role = 'roles',
|
||||
User = 'users',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIAllowedMentionsSend {
|
||||
parse?: AllowedMentionsTypes[];
|
||||
roles?: string[];
|
||||
users?: string[];
|
||||
}
|
||||
|
||||
// #endregion TypeDefs
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIChannelJSONBody {
|
||||
name?: string;
|
||||
type?: ChannelType.GUILD_NEWS | ChannelType.GUILD_TEXT;
|
||||
position?: number | null;
|
||||
topic?: string | null;
|
||||
nsfw?: boolean | null;
|
||||
rate_limit_per_user?: number | null;
|
||||
user_limit?: number | null;
|
||||
permission_overwrites?: APIOverwrite[] | null;
|
||||
parent_id?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel-messages
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessagesQuery {
|
||||
around?: string;
|
||||
before?: string;
|
||||
after?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIChannelMessagesResult = APIMessage[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIChannelMessageJSONBody {
|
||||
content?: string;
|
||||
nonce?: number | string;
|
||||
tts?: boolean;
|
||||
embed?: APIEmbed;
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
message_reference?: APIMessageReference;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageFormDataBody =
|
||||
| {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| {
|
||||
content?: string;
|
||||
nonce?: number | string;
|
||||
tts?: boolean;
|
||||
embed?: APIEmbed;
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
message_reference?: APIMessageReference;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
content?: string | null;
|
||||
embed?: APIEmbed | null;
|
||||
allowed_mentions?: APIAllowedMentionsSend | null;
|
||||
flags?: MessageFlags | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageResult = APIMessage;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageResult = APIMessage;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessageReactionsQuery {
|
||||
before?: string;
|
||||
after?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIChannelMessageReactionsResult = APIUser[];
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPutAPIChannelMessageReactionResult = never;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageReactionResult = never;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIChannelAllMessageReactionsResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#bulk-delete-messages
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIChannelMessagesBulkDeleteJSONBody {
|
||||
messages: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIChannelMessagesBulkDeleteResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-channel-permissions
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPutAPIChannelPermissionsJSONBody {
|
||||
allow: number | string;
|
||||
deny: number | string;
|
||||
type: OverwriteType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPutAPIChannelPermissionsResult = never;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIChannelPermissionsResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel-invites
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIChannelInvitesResult = APIInvite[];
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIChannelInviteJSONBody {
|
||||
max_age?: number;
|
||||
max_uses?: number;
|
||||
temporary?: boolean;
|
||||
unique?: boolean;
|
||||
target_user_id?: string;
|
||||
target_user_type?: InviteTargetUserType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#trigger-typing-indicator
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIChannelTypingResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-pinned-messages
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIChannelPinsResult = APIMessage[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#add-pinned-channel-message
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPutAPIChannelPinResult = never;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIChannelPinResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPutAPIChannelRecipientJSONBody {
|
||||
access_token: string;
|
||||
nick?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPutAPIChannelRecipientResult = unknown;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIChannelRecipientResult = unknown;
|
||||
|
||||
// TODO: Docs updated once https://github.com/discord/discord-api-docs/pull/1692/files is merged
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageCrosspostResult = APIMessage;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIChannelFollowersJSONBody {
|
||||
webhook_channel_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIChannelFollowersResult = APIFollowedChannel;
|
||||
51
deno/rest/v6/emoji.ts
Normal file
51
deno/rest/v6/emoji.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
import type { APIEmoji } from '../../payloads/v6/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-guild-emojis
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildEmojisResult = APIEmoji[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#get-guild-emoji
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIGuildEmojiJSONBody {
|
||||
name: string;
|
||||
/**
|
||||
* The image data, read more [here](https://discord.com/developers/docs/reference#image-data)
|
||||
*/
|
||||
image: string;
|
||||
roles?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIGuildEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIGuildEmojiJSONBody {
|
||||
name?: string;
|
||||
roles?: string[] | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIGuildEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIGuildEmojiResult = never;
|
||||
13
deno/rest/v6/gateway.ts
Normal file
13
deno/rest/v6/gateway.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { APIGatewayBotInfo, APIGatewayInfo } from '../../payloads/v6/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGatewayResult = APIGatewayInfo;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway-bot
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGatewayBotResult = APIGatewayBotInfo;
|
||||
516
deno/rest/v6/guild.ts
Normal file
516
deno/rest/v6/guild.ts
Normal file
@@ -0,0 +1,516 @@
|
||||
import type {
|
||||
APIBan,
|
||||
APIChannel,
|
||||
APIGuild,
|
||||
APIGuildIntegration,
|
||||
APIGuildMember,
|
||||
APIGuildPreview,
|
||||
APIGuildWidgetSettings,
|
||||
APIInvite,
|
||||
APIRole,
|
||||
APIVoiceRegion,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildFeature,
|
||||
GuildVerificationLevel,
|
||||
GuildWidgetStyle,
|
||||
IntegrationExpireBehavior,
|
||||
} from '../../payloads/v6/mod.ts';
|
||||
import type { RESTPutAPIChannelPermissionsJSONBody } from './channel.ts';
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionsJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @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'>
|
||||
> & {
|
||||
name: string;
|
||||
id?: number | string;
|
||||
parent_id?: number | string;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[];
|
||||
};
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIGuildsJSONBody {
|
||||
name: string;
|
||||
region?: string;
|
||||
icon?: string;
|
||||
verification_level?: GuildVerificationLevel;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
roles?: APIGuildCreateRole[];
|
||||
channels?: APIGuildCreatePartialChannel[];
|
||||
afk_channel_id?: number | string;
|
||||
afk_timeout?: number;
|
||||
system_channel_id?: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIGuildsResult = APIGuild;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTGetAPIGuildQuery {
|
||||
with_counts?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildResult = APIGuild;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-preview
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIGuildJSONBody {
|
||||
name?: string;
|
||||
region?: string;
|
||||
verification_level?: GuildVerificationLevel;
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
afk_channel_id?: string | null;
|
||||
afk_timeout?: number;
|
||||
icon?: string | null;
|
||||
owner_id?: string;
|
||||
splash?: string | null;
|
||||
discovery_splash?: string | null;
|
||||
banner?: string | null;
|
||||
system_channel_id?: string | null;
|
||||
rules_channel_id?: string | null;
|
||||
public_updates_channel_id?: string | null;
|
||||
preferred_locale?: string;
|
||||
features?: GuildFeature[];
|
||||
description?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIGuildResult = APIGuild;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#delete-guild
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIGuildResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-channels
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildChannelsResult = APIChannel[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIGuildChannelJSONBody = Partial<
|
||||
Pick<
|
||||
APIChannel,
|
||||
'type' | 'permission_overwrites' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user' | 'parent_id'
|
||||
>
|
||||
> &
|
||||
Required<Pick<APIChannel, 'name'>>;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIGuildChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
|
||||
id: string;
|
||||
position: number;
|
||||
lock_permissions?: boolean;
|
||||
parent_id?: string | null;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIGuildChannelPositionsResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-member
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildMemberResult = APIGuildMember;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#list-guild-members
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTGetAPIGuildMembersQuery {
|
||||
limit?: number;
|
||||
after?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildMembersResult = APIGuildMember[];
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTGetAPIGuildMembersSearchQuery {
|
||||
query: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPutAPIGuildMemberJSONBody {
|
||||
access_token: string;
|
||||
nick?: string;
|
||||
roles?: string[];
|
||||
mute?: boolean;
|
||||
deaf?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-member
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIGuildMemberJSONBody {
|
||||
nick?: string | null;
|
||||
roles?: string[] | null;
|
||||
mute?: boolean | null;
|
||||
deaf?: boolean | null;
|
||||
channel_id?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIGuildMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-nick
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
|
||||
nick?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPICurrentGuildMemberNicknameResult = Required<RESTPatchAPICurrentGuildMemberNicknameJSONBody>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member-role
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPutAPIGuildMemberRoleResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#remove-guild-member-role
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIGuildMemberRoleResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#remove-guild-member
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIGuildMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-bans
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildBansResult = APIBan[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-ban
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildBanResult = APIBan;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-ban
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPutAPIGuildBanJSONBody {
|
||||
delete_message_days?: number;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPutAPIGuildBanResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#remove-guild-ban
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIGuildBanResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-roles
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildRolesResult = APIRole[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-role
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIGuildRoleJSONBody {
|
||||
name?: string | null;
|
||||
permissions?: number | string | null;
|
||||
color?: number | null;
|
||||
hoist?: boolean | null;
|
||||
mentionable?: boolean | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIGuildRoleResult = APIRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
|
||||
id: string;
|
||||
position?: number;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
name?: string;
|
||||
permissions?: number | string;
|
||||
color?: number;
|
||||
hoist?: boolean;
|
||||
mentionable?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIGuildRoleResult = APIRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#delete-guild-role
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIGuildRoleResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-prune-count
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTGetAPIGuildPruneCountQuery {
|
||||
days?: number;
|
||||
/**
|
||||
* While this is typed as a string, it represents an array of
|
||||
* role IDs delimited by commas.
|
||||
*
|
||||
* @see https://discord.com/developers/docs/resources/guild#get-guild-prune-count-query-string-params
|
||||
*/
|
||||
include_roles?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTGetAPIGuildPruneCountResult {
|
||||
pruned: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIGuildPruneJSONBody {
|
||||
days?: number;
|
||||
compute_prune_count?: boolean;
|
||||
include_roles?: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIGuildPruneResult {
|
||||
pruned: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-voice-regions
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceRegionsResult = APIVoiceRegion[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-invites
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildInvitesResult = APIInvite[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-integrations
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTGetAPIGuildIntegrationsQuery {
|
||||
include_applications?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildIntegrationsResult = APIGuildIntegration[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-integration
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIGuildIntegrationJSONBody {
|
||||
type: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIGuildIntegrationResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-integration
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIGuildIntegrationJSONBody {
|
||||
expire_behavior?: IntegrationExpireBehavior | null;
|
||||
expire_grace_period?: number | null;
|
||||
enable_emoticons?: boolean | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIGuildIntegrationResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#delete-guild-integration
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIGuildIntegrationResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#sync-guild-integration
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIGuildIntegrationSyncResult = never;
|
||||
|
||||
/**
|
||||
* @deprecated Renamed to RESTGetAPIGuildWidgetSettingsResult
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildWidgetResult = APIGuildWidgetSettings;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-settings
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildWidgetSettingsResult = APIGuildWidgetSettings;
|
||||
|
||||
/**
|
||||
* @deprecated Renamed to RESTPatchAPIGuildWidgetSettingsJSONBody
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIGuildWidgetJSONBody = Partial<APIGuildWidgetSettings>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-widget
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIGuildWidgetSettingsJSONBody = Partial<APIGuildWidgetSettings>;
|
||||
|
||||
/**
|
||||
* @deprecated Use `RESTPatchAPIGuildWidgetSettingsResult` instead
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIGuildWidgetResult = APIGuildWidgetSettings;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIGuildWidgetSettingsResult = APIGuildWidgetSettings;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-vanity-url
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTGetAPIGuildVanityUrlResult {
|
||||
code: string | null;
|
||||
uses: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-image
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTGetAPIGuildWidgetImageQuery {
|
||||
style?: GuildWidgetStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: while the return type is `ArrayBuffer`, the expected result is
|
||||
* a buffer of sorts (depends if in browser or on node.js/deno).
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildWidgetImageResult = ArrayBuffer;
|
||||
20
deno/rest/v6/invite.ts
Normal file
20
deno/rest/v6/invite.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import type { APIInvite } from '../../payloads/v6/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#get-invite
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTGetAPIInviteQuery {
|
||||
with_counts?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIInviteResult = APIInvite;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#delete-invite
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIInviteResult = APIInvite;
|
||||
521
deno/rest/v6/mod.ts
Normal file
521
deno/rest/v6/mod.ts
Normal file
@@ -0,0 +1,521 @@
|
||||
export * from '../common.ts';
|
||||
|
||||
export * from './auditLog.ts';
|
||||
export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
export * from './guild.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './user.ts';
|
||||
export * from './voice.ts';
|
||||
export * from './webhook.ts';
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export const APIVersion = '6';
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export const Routes = {
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/audit-logs`
|
||||
*/
|
||||
guildAuditLog(guildID: string) {
|
||||
return `/guilds/${guildID}/audit-logs`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}`
|
||||
* - PATCH `/channels/{channel.id}`
|
||||
* - DELETE `/channels/{channel.id}`
|
||||
*/
|
||||
channel(channelID: string) {
|
||||
return `/channels/${channelID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages`
|
||||
* - POST `/channels/{channel.id}/messages`
|
||||
*/
|
||||
channelMessages(channelID: string) {
|
||||
return `/channels/${channelID}/messages`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages/{message.id}`
|
||||
* - PATCH `/channels/{channel.id}/messages/{message.id}`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}`
|
||||
*/
|
||||
channelMessage(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/messages/{message.id}/crosspost`
|
||||
*/
|
||||
channelCrosspost(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/message/${messageID}/crosspost`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself.
|
||||
*/
|
||||
channelMessageOwnReaction(channelID: string, messageID: string, emoji: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/@me`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself.
|
||||
*/
|
||||
channelMessageUserReaction(channelID: string, messageID: string, emoji: string, userID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself.
|
||||
*/
|
||||
channelMessageSpecificReaction(channelID: string, messageID: string, emoji: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions`
|
||||
*/
|
||||
channelMessageAllReactions(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/messages/bulk-delete`
|
||||
*/
|
||||
channelBulkDelete(channelID: string) {
|
||||
return `/channels/${channelID}/bulk-delete`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/permissions/{overwrite.id}`
|
||||
* - DELETE `/channels/{channel.id}/permissions/{overwrite.id}`
|
||||
*/
|
||||
channelPermissions(channelID: string, overwriteID: string) {
|
||||
return `/channels/${channelID}/permissions/${overwriteID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/invites`
|
||||
* - POST `/channels/{channel.id}/invites`
|
||||
*/
|
||||
channelInvite(channelID: string) {
|
||||
return `/channels/${channelID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/followers`
|
||||
*/
|
||||
channelFollowers(channelID: string) {
|
||||
return `/channels/${channelID}/followers`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/typing`
|
||||
*/
|
||||
channelTyping(channelID: string) {
|
||||
return `/channels/${channelID}/typing`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/pins`
|
||||
*/
|
||||
channelPins(channelID: string) {
|
||||
return `/channels/${channelID}/pins`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/pins/{message.id}`
|
||||
* - DELETE `/channels/{channel.id}/pins/{message.id}`
|
||||
*/
|
||||
channelPin(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/pins/${messageID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/recipients/{user.id}`
|
||||
* - DELETE `/channels/{channel.id}/recipients/{user.id}`
|
||||
*/
|
||||
channelRecipient(channelID: string, userID: string) {
|
||||
return `/channels/${channelID}/recipients/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/emojis`
|
||||
* - POST `/guilds/{guild.id}/emojis`
|
||||
*/
|
||||
guildEmojis(guildID: string) {
|
||||
return `/guilds/${guildID}/emojis`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
* - PATCH `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
* - DELETE `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
*/
|
||||
guildEmoji(guildID: string, emojiID: string) {
|
||||
return `/guilds/${guildID}/emojis/${emojiID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/guilds`
|
||||
*/
|
||||
guilds() {
|
||||
return '/guilds';
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}`
|
||||
* - PATCH `/guilds/{guild.id}`
|
||||
* - DELETE `/guilds/{guild.id}`
|
||||
*/
|
||||
guild(guildID: string) {
|
||||
return `/guilds/${guildID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/preview`
|
||||
*/
|
||||
guildPreview(guildID: string) {
|
||||
return `/guilds/${guildID}/preview`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/channels`
|
||||
* - POST `/guilds/{guild.id}/channels`
|
||||
* - PATCH `/guilds/{guild.id}/channels`
|
||||
*/
|
||||
guildChannels(guildID: string) {
|
||||
return `/guilds/${guildID}/channels`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members/{user.id}`
|
||||
* - PUT `/guilds/{guild.id}/members/{user.id}`
|
||||
* - PATCH `/guilds/{guild.id}/members/{user.id}`
|
||||
* - DELETE `/guilds/{guild.id}/members/{user.id}`
|
||||
*/
|
||||
guildMember(guildID: string, userID: string) {
|
||||
return `/guilds/${guildID}/members/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members`
|
||||
*/
|
||||
guildMembers(guildID: string) {
|
||||
return `/guilds/${guildID}/members`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members/search`
|
||||
*/
|
||||
guildMembersSearch(guildID: string) {
|
||||
return `/guilds/${guildID}/members/search`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/members/@me/nick`
|
||||
*/
|
||||
guildCurrentMemberNickname(guildID: string) {
|
||||
return `/guilds/${guildID}/members/@me/nick`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
|
||||
*/
|
||||
guildMemberRole(guildID: string, memberID: string, roleID: string) {
|
||||
return `/guilds/${guildID}/members/${memberID}/roles/${roleID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/bans`
|
||||
*/
|
||||
guildBans(guildID: string) {
|
||||
return `/guilds/${guildID}/bans`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/bans/{user.id}`
|
||||
* - PUT `/guilds/{guild.id}/bans/{user.id}`
|
||||
* - DELETE `/guilds/{guild.id}/bans/{user.id}`
|
||||
*/
|
||||
guildBan(guildID: string, userID: string) {
|
||||
return `/guilds/${guildID}/bans/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/roles`
|
||||
* - POST `/guilds/{guild.id}/roles`
|
||||
* - PATCH `/guilds/{guild.id}/roles`
|
||||
*/
|
||||
guildRoles(guildID: string) {
|
||||
return `/guilds/${guildID}/roles`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/roles/{role.id}`
|
||||
*/
|
||||
guildRole(guildID: string, roleID: string) {
|
||||
return `/guilds/${guildID}/roles/${roleID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/prune`
|
||||
* - POST `/guilds/{guild.id}/prune`
|
||||
*/
|
||||
guildPrune(guildID: string) {
|
||||
return `/guilds/${guildID}/prune`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/regions`
|
||||
*/
|
||||
guildVoiceRegions(guildID: string) {
|
||||
return `/guilds/${guildID}/regions`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/invites`
|
||||
*/
|
||||
guildInvites(guildID: string) {
|
||||
return `/guilds/${guildID}/invites`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/integrations`
|
||||
* - POST `/guilds/{guild.id}/integrations`
|
||||
*/
|
||||
guildIntegrations(guildID: string) {
|
||||
return `/guilds/${guildID}/integrations`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/integrations/{integration.id}`
|
||||
* - DELETE `/guilds/{guild.id}/integrations/{integration.id}`
|
||||
*/
|
||||
guildIntegration(guildID: string, integrationID: string) {
|
||||
return `/guilds/${guildID}/integrations/${integrationID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/guilds/{guild.id}/integrations/{integration.id}/sync`
|
||||
*/
|
||||
guildIntegrationSync(guildID: string, integrationID: string) {
|
||||
return `/guilds/${guildID}/integrations/${integrationID}/sync`;
|
||||
},
|
||||
|
||||
/**
|
||||
* @deprecated Use `guildWidgetSettings` instead
|
||||
*/
|
||||
guildWidget(guildID: string) {
|
||||
return `/guilds/${guildID}/widget`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget`
|
||||
* - PATCH `/guilds/{guild.id}/widget`
|
||||
*/
|
||||
guildWidgetSettings(guildID: string) {
|
||||
return `/guilds/${guildID}/widget`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/vanity-url`
|
||||
*/
|
||||
guildVanityUrl(guildID: string) {
|
||||
return `/guilds/${guildID}/vanity-url`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget.png`
|
||||
*/
|
||||
guildWidgetImage(guildID: string) {
|
||||
return `/guilds/${guildID}/widget.png`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/invites/{invite.code}`
|
||||
* - DELETE `/invites/{invite.code}`
|
||||
*/
|
||||
invite(code: string) {
|
||||
return `/invites/${code}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me`
|
||||
* - GET `/users/{user.id}`
|
||||
* - PATCH `/users/@me`
|
||||
*/
|
||||
user(userID = '@me') {
|
||||
return `/users/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/guilds`
|
||||
*/
|
||||
userGuilds() {
|
||||
return `/users/@me/guilds`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/users/@me/guilds/{guild.id}`
|
||||
*/
|
||||
userGuild(guildID: string) {
|
||||
return `/users/@me/guilds/${guildID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/users/@me/channels`
|
||||
*/
|
||||
userChannels() {
|
||||
return `/users/@me/channels`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/connections`
|
||||
*/
|
||||
userConnections() {
|
||||
return `/users/@me/connections`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/voice/regions`
|
||||
*/
|
||||
voiceRegions() {
|
||||
return `/voice/regions`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/webhooks`
|
||||
* - GET `/channels/{channel.id}/webhooks`
|
||||
*/
|
||||
channelWebhook(channelID: string) {
|
||||
return `/channels/${channelID}/webhooks`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/webhooks`
|
||||
*/
|
||||
guildWebhooks(guildID: string) {
|
||||
return `/guilds/${guildID}/webhooks`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/webhooks/{webhook.id}`
|
||||
* - GET `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - PATCH `/webhooks/{webhook.id}`
|
||||
* - PATCH `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - DELETE `/webhooks/{webhook.id}`
|
||||
* - DELETE `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}`
|
||||
*/
|
||||
webhook(webhookID: string, webhookToken?: string) {
|
||||
const parts = ['', 'webhooks', webhookID];
|
||||
|
||||
if (webhookToken) parts.push(webhookToken);
|
||||
|
||||
return parts.join('/');
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}/slack`
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}/github`
|
||||
*/
|
||||
webhookPlatform(webhookID: string, webhookToken: string, platform: 'github' | 'slack') {
|
||||
return `/${webhookID}/${webhookToken}/${platform}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/gateway`
|
||||
*/
|
||||
gateway() {
|
||||
return `/gateway`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/gateway/bot`
|
||||
*/
|
||||
gatewayBot() {
|
||||
return `/gateway/bot`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/applications/@me`
|
||||
*/
|
||||
oauth2CurrentApplication() {
|
||||
return `/oauth2/applications/@me`;
|
||||
},
|
||||
};
|
||||
181
deno/rest/v6/oauth2.ts
Normal file
181
deno/rest/v6/oauth2.ts
Normal file
@@ -0,0 +1,181 @@
|
||||
import type { APIApplication, APIGuild, APIWebhook } from '../../payloads/v6/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#get-current-application-information
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIOauth2CurrentApplicationResult = APIApplication;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTOAuth2AuthorizationQuery {
|
||||
response_type: 'code';
|
||||
client_id: string;
|
||||
scope: string;
|
||||
redirect_uri?: string;
|
||||
state?: string;
|
||||
prompt?: 'consent' | 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTOAuth2AuthorizationQueryResult {
|
||||
code: string;
|
||||
state?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostOAuth2AccessTokenURIEncodedData {
|
||||
client_id: string;
|
||||
client_secret: string;
|
||||
grant_type: 'authorization_code';
|
||||
code: string;
|
||||
redirect_uri?: string;
|
||||
scope: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-access-token-response
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostOAuth2AccessTokenResult {
|
||||
access_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
refresh_token: string;
|
||||
scope: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-refresh-token-exchange-example
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostOAuth2RefreshTokenURIEncodedData {
|
||||
client_id: string;
|
||||
client_secret: string;
|
||||
grant_type: 'refresh_token';
|
||||
refresh_token: string;
|
||||
redirect_uri?: string;
|
||||
scope: string;
|
||||
}
|
||||
|
||||
export type RESTPostOAuth2RefreshTokenResult = RESTPostOAuth2AccessTokenResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#implicit-grant
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTOAuth2ImplicitAuthorizationQuery {
|
||||
response_type: 'token';
|
||||
client_id: string;
|
||||
scope: string;
|
||||
redirect_uri?: string;
|
||||
state?: string;
|
||||
prompt?: 'consent' | 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#implicit-grant-redirect-url-example
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTOAuth2ImplicitAuthorizationURIFragmentResult = Omit<RESTPostOAuth2AccessTokenResult, 'refresh_token'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#client-credentials-grant
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostOAuth2ClientCredentialsURIEncodedData {
|
||||
client_id: string;
|
||||
client_secret: string;
|
||||
grant_type: 'client_credentials';
|
||||
scope: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostOAuth2ClientCredentialsResult = RESTOAuth2ImplicitAuthorizationURIFragmentResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#bot-authorization-flow-bot-auth-parameters
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTOAuth2BotAuthorizationQuery {
|
||||
client_id: string;
|
||||
scope: string;
|
||||
/**
|
||||
* The required permissions bitfield, stringified
|
||||
*/
|
||||
permissions?: string;
|
||||
guild_id?: string;
|
||||
disable_guild_select?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#advanced-bot-authorization
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTOAuth2AdvancedBotAuthorizationQuery {
|
||||
client_id: string;
|
||||
/**
|
||||
* This assumes you include the `bot` scope alongside others (like `identify` for example)
|
||||
*/
|
||||
scope: string;
|
||||
/**
|
||||
* The required permissions bitfield, stringified
|
||||
*/
|
||||
permissions?: string;
|
||||
guild_id?: string;
|
||||
disable_guild_select?: boolean;
|
||||
response_type: string;
|
||||
redirect_uri?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTOAuth2AdvancedBotAuthorizationQueryResult {
|
||||
code: string;
|
||||
state?: string;
|
||||
guild_id: string;
|
||||
permissions: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#advanced-bot-authorization-extended-bot-authorization-access-token-example
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult {
|
||||
access_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
refresh_token: string;
|
||||
scope: string;
|
||||
guild: APIGuild;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#webhooks-webhook-token-response-example
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult {
|
||||
access_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
refresh_token: string;
|
||||
scope: string;
|
||||
webhook: APIWebhook;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult = RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult &
|
||||
RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;
|
||||
83
deno/rest/v6/user.ts
Normal file
83
deno/rest/v6/user.ts
Normal file
@@ -0,0 +1,83 @@
|
||||
import type { APIChannel, APIConnection, APIUser, GuildFeature } from '../../payloads/v6/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPICurrentUserResult = APIUser;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-user
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIUserResult = APIUser;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPICurrentUserJSONBody {
|
||||
username?: string;
|
||||
avatar?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPICurrentUserResult = APIUser;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user-guilds
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTGetAPICurrentUserGuildsQuery {
|
||||
before?: string;
|
||||
after?: string;
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTAPIPartialCurrentUserGuild {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
/**
|
||||
* @deprecated Use `permissions_new` instead
|
||||
*/
|
||||
permissions: number;
|
||||
permissions_new: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPICurrentUserGuildsResult = RESTAPIPartialCurrentUserGuild[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#leave-guild
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPICurrentUserGuildResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#create-dm
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPICurrentUserCreateDMChannelJSONBody {
|
||||
recipient_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPICurrentUserCreateDMChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-user-connections
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPICurrentUserConnectionsResult = APIConnection[];
|
||||
7
deno/rest/v6/voice.ts
Normal file
7
deno/rest/v6/voice.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import type { APIVoiceRegion } from '../../payloads/v6/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#list-voice-regions
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
146
deno/rest/v6/webhook.ts
Normal file
146
deno/rest/v6/webhook.ts
Normal file
@@ -0,0 +1,146 @@
|
||||
import type { APIAllowedMentionsSend } from './channel.ts';
|
||||
import type { APIEmbed, APIMessage, APIWebhook } from '../../payloads/v6/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIChannelWebhookJSONBody {
|
||||
name: string;
|
||||
avatar?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIChannelWebhookResult = APIWebhook;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-channel-webhooks
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIChannelWebhooksResult = APIWebhook[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-guild-webhooks
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIGuildWebhooksResult = APIWebhook[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-webhook
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIWebhookResult = APIWebhook;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-webhook-with-token
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPatchAPIWebhookJSONBody {
|
||||
name?: string;
|
||||
avatar?: string | null;
|
||||
channel_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIWebhookResult = APIWebhook;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenJSONBody = Omit<RESTPatchAPIWebhookJSONBody, 'channel_id'>;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#delete-webhook
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIWebhookResult = never;
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTDeleteAPIWebhookWithTokenResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
content?: string;
|
||||
username?: string;
|
||||
avatar_url?: string;
|
||||
tts?: boolean;
|
||||
embeds?: APIEmbed[];
|
||||
allowed_mentions?: APIAllowedMentionsSend;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenFormDataBody =
|
||||
| {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface RESTPostAPIWebhookWithTokenQuery {
|
||||
wait?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenResult = never;
|
||||
|
||||
/**
|
||||
* Received when a call to POST `/webhooks/{webhook.id}/{webhook.token}` receives
|
||||
* the `wait` query parameter set to `true`
|
||||
*
|
||||
* @see https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenWaitResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-querystring-params
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenSlackQuery = RESTPostAPIWebhookWithTokenQuery;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-querystring-params
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenGitHubQuery = RESTPostAPIWebhookWithTokenQuery;
|
||||
28
deno/rest/v8/auditLog.ts
Normal file
28
deno/rest/v8/auditLog.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIAuditLog, AuditLogEvent } from '../../payloads/v8/auditLog.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#get-guild-audit-log
|
||||
*/
|
||||
export interface RESTGetAPIAuditLogQuery {
|
||||
/**
|
||||
* Filter the log for actions made by a user
|
||||
*/
|
||||
user_id?: Snowflake;
|
||||
/**
|
||||
* The type of audit log events
|
||||
*/
|
||||
action_type?: AuditLogEvent;
|
||||
/**
|
||||
* Filter the log before a certain entry ID
|
||||
*/
|
||||
before?: Snowflake;
|
||||
/**
|
||||
* How many entries are returned (default 50, minimum 1, maximum 100)
|
||||
*
|
||||
* @default 50
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export type RESTGetAPIAuditLogResult = APIAuditLog;
|
||||
472
deno/rest/v8/channel.ts
Normal file
472
deno/rest/v8/channel.ts
Normal file
@@ -0,0 +1,472 @@
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type {
|
||||
APIAllowedMentions,
|
||||
APIChannel,
|
||||
APIEmbed,
|
||||
APIExtendedInvite,
|
||||
APIFollowedChannel,
|
||||
APIMessage,
|
||||
APIMessageReference,
|
||||
APIOverwrite,
|
||||
APIUser,
|
||||
ChannelType,
|
||||
InviteTargetUserType,
|
||||
MessageFlags,
|
||||
OverwriteType,
|
||||
VideoQualityMode,
|
||||
} from '../../payloads/v8/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel
|
||||
*/
|
||||
export type RESTGetAPIChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
*/
|
||||
export interface RESTPatchAPIChannelJSONBody {
|
||||
/**
|
||||
* 2-100 character channel name
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* The type of channel; only conversion between `text` and `news`
|
||||
* is supported and only in guilds with the "NEWS" feature
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
type?: ChannelType.GUILD_NEWS | ChannelType.GUILD_TEXT;
|
||||
/**
|
||||
* The position of the channel in the left-hand listing
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
position?: number | null;
|
||||
/**
|
||||
* 0-1024 character channel topic
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
topic?: string | null;
|
||||
/**
|
||||
* Whether the channel is nsfw
|
||||
*
|
||||
* Channel types: text, news, store
|
||||
*/
|
||||
nsfw?: boolean | null;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
|
||||
* are unaffected
|
||||
*
|
||||
* Channel types: text
|
||||
*/
|
||||
rate_limit_per_user?: number | null;
|
||||
/**
|
||||
* The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers)
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
bitrate?: number | null;
|
||||
/**
|
||||
* The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
user_limit?: number | null;
|
||||
/**
|
||||
* Channel or category-specific permissions
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
permission_overwrites?: APIOverwrite[] | null;
|
||||
/**
|
||||
* ID of the new parent category for a channel
|
||||
*
|
||||
* Channel types: text, news, store, voice
|
||||
*/
|
||||
parent_id?: Snowflake | null;
|
||||
/**
|
||||
* Voice region id for the voice or stage channel, automatic when set to `null`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
rtc_region?: string | null;
|
||||
/**
|
||||
* The camera video quality mode of the voice channel
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes
|
||||
*/
|
||||
video_quality_mode?: VideoQualityMode | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
*/
|
||||
export type RESTPatchAPIChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#deleteclose-channel
|
||||
*/
|
||||
export type RESTDeleteAPIChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel-messages
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessagesQuery {
|
||||
/**
|
||||
* Get messages around this message ID
|
||||
*/
|
||||
around?: Snowflake;
|
||||
/**
|
||||
* Get messages before this message ID
|
||||
*/
|
||||
before?: Snowflake;
|
||||
/**
|
||||
* Get messages after this message ID
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* Max number of messages to return (1-100)
|
||||
*
|
||||
* @default 50
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel-messages
|
||||
*/
|
||||
export type RESTGetAPIChannelMessagesResult = APIMessage[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel-message
|
||||
*/
|
||||
export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
*/
|
||||
export type APIMessageReferenceSend = Partial<APIMessageReference> &
|
||||
Required<Pick<APIMessageReference, 'message_id'>> & {
|
||||
/**
|
||||
* Whether to error if the referenced message doesn't exist instead of sending as a normal (non-reply) message
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
fail_if_not_exists?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export interface RESTPostAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string;
|
||||
/**
|
||||
* A nonce that can be used for optimistic message sending
|
||||
*/
|
||||
nonce?: number | string;
|
||||
/**
|
||||
* `true` if this is a TTS message
|
||||
*/
|
||||
tts?: boolean;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embed?: APIEmbed;
|
||||
/**
|
||||
* Allowed mentions for a message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions;
|
||||
/**
|
||||
* Include to make your message a reply
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageFormDataBody =
|
||||
| {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIChannelMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#crosspost-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageCrosspostResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-reaction
|
||||
*/
|
||||
export type RESTPutAPIChannelMessageReactionResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-own-reaction
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-user-reaction
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageUserReactionResult = never;
|
||||
|
||||
/*
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* Max number of users to return (1-100)
|
||||
*
|
||||
* @default 25
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
export type RESTGetAPIChannelMessageReactionUsersResult = APIUser[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-all-reactions
|
||||
*/
|
||||
export type RESTDeleteAPIChannelAllMessageReactionsResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageReactionResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The new message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string | null;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*/
|
||||
embed?: APIEmbed | null;
|
||||
/**
|
||||
* Edit the flags of a message (only `SUPPRESS_EMBEDS` can currently be set/unset)
|
||||
*
|
||||
* When specifying flags, ensure to include all previously set flags/bits
|
||||
* in addition to ones that you are modifying
|
||||
*/
|
||||
flags?: MessageFlags | null;
|
||||
/**
|
||||
* Allowed mentions for the message
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-message
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#bulk-delete-messages
|
||||
*/
|
||||
export interface RESTPostAPIChannelMessagesBulkDeleteJSONBody {
|
||||
/**
|
||||
* An array of message ids to delete (2-100)
|
||||
*/
|
||||
messages: Snowflake[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#bulk-delete-messages
|
||||
*/
|
||||
export type RESTPostAPIChannelMessagesBulkDeleteResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-channel-permissions
|
||||
*/
|
||||
export interface RESTPutAPIChannelPermissionJSONBody {
|
||||
/**
|
||||
* The bitwise value of all allowed permissions
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
allow: Permissions;
|
||||
/**
|
||||
* The bitwise value of all disallowed permissions
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
deny: Permissions;
|
||||
/**
|
||||
* `0` for a role or `1` for a member
|
||||
*/
|
||||
type: OverwriteType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-channel-permissions
|
||||
*/
|
||||
export type RESTPutAPIChannelPermissionResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel-invites
|
||||
*/
|
||||
export type RESTGetAPIChannelInvitesResult = APIExtendedInvite[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
*/
|
||||
export interface RESTPostAPIChannelInviteJSONBody {
|
||||
/**
|
||||
* Duration of invite in seconds before expiry, or 0 for never
|
||||
*
|
||||
* @default 86400 (24 hours)
|
||||
*/
|
||||
max_age?: number;
|
||||
/**
|
||||
* Max number of uses or 0 for unlimited
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
max_uses?: number;
|
||||
/**
|
||||
* Whether this invite only grants temporary membership
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
temporary?: boolean;
|
||||
/**
|
||||
* If true, don't try to reuse a similar invite
|
||||
* (useful for creating many unique one time use invites)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
unique?: boolean;
|
||||
/**
|
||||
* The type of target user for this voice channel invite
|
||||
*/
|
||||
target_type?: InviteTargetUserType;
|
||||
/**
|
||||
* The id of the user whose stream to display for this invite
|
||||
* - Required if `target_type` is 1
|
||||
* - The user must be streaming in the channel
|
||||
*/
|
||||
target_user_id?: Snowflake;
|
||||
/**
|
||||
* The id of the embedded application to open for this invite
|
||||
* - Required if `target_type` is 2
|
||||
* - The application must have the `EMBEDDED` flag
|
||||
*/
|
||||
target_application_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
*/
|
||||
export type RESTPostAPIChannelInviteResult = APIExtendedInvite;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-channel-permission
|
||||
*/
|
||||
export type RESTDeleteAPIChannelPermissionResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#follow-news-channel
|
||||
*/
|
||||
export interface RESTPostAPIChannelFollowersJSONBody {
|
||||
/**
|
||||
* ID of target channel
|
||||
*/
|
||||
webhook_channel_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#follow-news-channel
|
||||
*/
|
||||
export type RESTPostAPIChannelFollowersResult = APIFollowedChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#trigger-typing-indicator
|
||||
*/
|
||||
export type RESTPostAPIChannelTypingResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-pinned-messages
|
||||
*/
|
||||
export type RESTGetAPIChannelPinsResult = APIMessage[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#add-pinned-channel-message
|
||||
*/
|
||||
export type RESTPutAPIChannelPinResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-pinned-channel-message
|
||||
*/
|
||||
export type RESTDeleteAPIChannelPinResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
*/
|
||||
export interface RESTPutAPIChannelRecipientJSONBody {
|
||||
/**
|
||||
* Access token of a user that has granted your app the `gdm.join` scope
|
||||
*/
|
||||
access_token: string;
|
||||
/**
|
||||
* Nickname of the user being added
|
||||
*/
|
||||
nick?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
*/
|
||||
export type RESTPutAPIChannelRecipientResult = unknown;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient
|
||||
*/
|
||||
export type RESTDeleteAPIChannelRecipientResult = unknown;
|
||||
61
deno/rest/v8/emoji.ts
Normal file
61
deno/rest/v8/emoji.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIEmoji } from '../../payloads/v8/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#list-guild-emojis
|
||||
*/
|
||||
export type RESTGetAPIGuildEmojisResult = APIEmoji[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#get-guild-emoji
|
||||
*/
|
||||
export type RESTGetAPIGuildEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji-json-params
|
||||
*/
|
||||
export interface RESTPostAPIGuildEmojiJSONBody {
|
||||
/**
|
||||
* Name of the emoji
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The 128x128 emoji image
|
||||
*
|
||||
* https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
image: string;
|
||||
/**
|
||||
* Roles for which this emoji will be whitelisted
|
||||
*/
|
||||
roles?: Snowflake[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#create-guild-emoji
|
||||
*/
|
||||
export type RESTPostAPIGuildEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
*/
|
||||
export interface RESTPatchAPIGuildEmojiJSONBody {
|
||||
/**
|
||||
* Name of the emoji
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Roles for which this emoji will be whitelisted
|
||||
*/
|
||||
roles?: Snowflake[] | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#modify-guild-emoji
|
||||
*/
|
||||
export type RESTPatchAPIGuildEmojiResult = APIEmoji;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#delete-guild-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIGuildEmojiResult = never;
|
||||
11
deno/rest/v8/gateway.ts
Normal file
11
deno/rest/v8/gateway.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { APIGatewayBotInfo, APIGatewayInfo } from '../../payloads/v8/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway
|
||||
*/
|
||||
export type RESTGetAPIGatewayResult = APIGatewayInfo;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway-bot
|
||||
*/
|
||||
export type RESTGetAPIGatewayBotResult = APIGatewayBotInfo;
|
||||
780
deno/rest/v8/guild.ts
Normal file
780
deno/rest/v8/guild.ts
Normal file
@@ -0,0 +1,780 @@
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type {
|
||||
APIBan,
|
||||
APIChannel,
|
||||
APIExtendedInvite,
|
||||
APIGuild,
|
||||
APIGuildIntegration,
|
||||
APIGuildMember,
|
||||
APIGuildMembershipScreening,
|
||||
APIGuildPreview,
|
||||
APIGuildWelcomeScreen,
|
||||
APIGuildWidget,
|
||||
APIGuildWidgetSettings,
|
||||
APIRole,
|
||||
APIVoiceRegion,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildFeature,
|
||||
GuildSystemChannelFlags,
|
||||
GuildVerificationLevel,
|
||||
GuildWidgetStyle,
|
||||
} from '../../payloads/v8/mod.ts';
|
||||
import type { RESTPutAPIChannelPermissionJSONBody } from './channel.ts';
|
||||
|
||||
export interface APIGuildCreateOverwrite extends RESTPutAPIChannelPermissionJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
export type APIGuildCreatePartialChannel = Partial<
|
||||
Pick<APIChannel, 'type' | 'topic' | 'nsfw' | 'bitrate' | 'user_limit' | 'rate_limit_per_user'>
|
||||
> & {
|
||||
name: string;
|
||||
id?: number | string;
|
||||
parent_id?: number | string | null;
|
||||
permission_overwrites?: APIGuildCreateOverwrite[];
|
||||
};
|
||||
|
||||
export interface APIGuildCreateRole extends RESTPostAPIGuildRoleJSONBody {
|
||||
id: number | string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
*/
|
||||
export interface RESTPostAPIGuildsJSONBody {
|
||||
/**
|
||||
* Name of the guild (2-100 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Voice region id
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
region?: string;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg image for the guild icon
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string;
|
||||
/**
|
||||
* Verification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel;
|
||||
/**
|
||||
* Default message notification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
default_message_notifications?: GuildDefaultMessageNotifications;
|
||||
/**
|
||||
* Explicit content filter level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
explicit_content_filter?: GuildExplicitContentFilter;
|
||||
/**
|
||||
* New guild roles
|
||||
*
|
||||
* **When using this parameter, the first member of the array is used to change properties of the guild's @everyone role.
|
||||
* If you are trying to bootstrap a guild with additional roles, keep this in mind.**
|
||||
*
|
||||
* *When using this parameter, the required `id` field within each role object is an integer placeholder,
|
||||
* and will be replaced by the API upon consumption. Its purpose is to allow you to overwrite a role's permissions
|
||||
* in a channel when also passing in channels with the channels array.*
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
roles?: APIGuildCreateRole[];
|
||||
/**
|
||||
* New guild's channels
|
||||
*
|
||||
* **When using the channels parameter, the `position` field is ignored, and none of the default channels are created.**
|
||||
*
|
||||
* *When using the channels parameter, the `id` field within each channel object may be set to an integer placeholder,
|
||||
* and will be replaced by the API upon consumption. Its purpose is to allow you to create `GUILD_CATEGORY` channels
|
||||
* by setting the `parent_id` field on any children to the category's id field.
|
||||
* Category channels must be listed before any children.*
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channels?: APIGuildCreatePartialChannel[];
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
afk_channel_id?: number | Snowflake | null;
|
||||
/**
|
||||
* AFK timeout in seconds
|
||||
*/
|
||||
afk_timeout?: number;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
system_channel_id?: number | Snowflake | null;
|
||||
/**
|
||||
* System channel flags
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild
|
||||
*/
|
||||
export type RESTPostAPIGuildsResult = APIGuild;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild
|
||||
*/
|
||||
export interface RESTGetAPIGuildQuery {
|
||||
/**
|
||||
* When `true`, will return approximate member and presence counts for the guild
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
with_counts?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild
|
||||
*/
|
||||
export type RESTGetAPIGuildResult = APIGuild;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-preview
|
||||
*/
|
||||
export type RESTGetAPIGuildPreviewResult = APIGuildPreview;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild
|
||||
*/
|
||||
export interface RESTPatchAPIGuildJSONBody {
|
||||
/**
|
||||
* New name for the guild (2-100 characters)
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Voice region id
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/voice#voice-region-object
|
||||
*/
|
||||
region?: string | null;
|
||||
/**
|
||||
* Verification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-verification-level
|
||||
*/
|
||||
verification_level?: GuildVerificationLevel | null;
|
||||
/**
|
||||
* Default message notification level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
default_message_notifications?: GuildDefaultMessageNotifications | null;
|
||||
/**
|
||||
* Explicit content filter level
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
explicit_content_filter?: GuildExplicitContentFilter | null;
|
||||
/**
|
||||
* ID for afk channel
|
||||
*/
|
||||
afk_channel_id?: Snowflake | null;
|
||||
/**
|
||||
* AFK timeout in seconds
|
||||
*/
|
||||
afk_timeout?: number;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg/gif image for the guild icon (can be animated gif when the guild has `ANIMATED_ICON` feature)
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* User id to transfer guild ownership to (must be owner)
|
||||
*/
|
||||
owner_id?: Snowflake;
|
||||
/**
|
||||
* base64 16:9 png/jpeg image for the guild splash (when the guild has `INVITE_SPLASH` feature)
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
splash?: string | null;
|
||||
/**
|
||||
* base64 png/jpeg image for the guild discovery splash (when the guild has `DISCOVERABLE` feature)
|
||||
*/
|
||||
discovery_splash?: string | null;
|
||||
/**
|
||||
* base64 16:9 png/jpeg image for the guild banner (when the guild has `BANNER` feature)
|
||||
*/
|
||||
banner?: string | null;
|
||||
/**
|
||||
* The id of the channel where guild notices such as welcome messages and boost events are posted
|
||||
*/
|
||||
system_channel_id?: Snowflake | null;
|
||||
/**
|
||||
* System channel flags
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
system_channel_flags?: GuildSystemChannelFlags;
|
||||
/**
|
||||
* The id of the channel where Community guilds display rules and/or guidelines
|
||||
*/
|
||||
rules_channel_id?: Snowflake | null;
|
||||
/**
|
||||
* The id of the channel where admins and moderators of Community guilds receive notices from Discord
|
||||
*/
|
||||
public_updates_channel_id?: Snowflake | null;
|
||||
/**
|
||||
* The preferred locale of a Community guild used in server discovery and notices from Discord; defaults to "en-US"
|
||||
*
|
||||
* @default "en-US" (if the value is set to `null`)
|
||||
*/
|
||||
preferred_locale?: string | null;
|
||||
/**
|
||||
* Enabled guild features
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
*/
|
||||
features?: GuildFeature[];
|
||||
/**
|
||||
* The description for the guild, if the guild is discoverable
|
||||
*/
|
||||
description?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild
|
||||
*/
|
||||
export type RESTPatchAPIGuildResult = APIGuild;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#delete-guild
|
||||
*/
|
||||
export type RESTDeleteAPIGuildResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-channels
|
||||
*/
|
||||
export type RESTGetAPIGuildChannelsResult = APIChannel[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
*/
|
||||
export type RESTPostAPIGuildChannelJSONBody = Omit<APIGuildCreatePartialChannel, 'id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-channel
|
||||
*/
|
||||
export type RESTPostAPIGuildChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildChannelPositionsJSONBody = Array<{
|
||||
/**
|
||||
* Channel id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position: number;
|
||||
/**
|
||||
* Sync channel overwrites with the new parent, when moving to a new `parent_id`
|
||||
*/
|
||||
lock_permissions?: boolean;
|
||||
/**
|
||||
* The new parent id of this channel
|
||||
*/
|
||||
parent_id?: Snowflake | null;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-channel-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildChannelPositionsResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-member
|
||||
*/
|
||||
export type RESTGetAPIGuildMemberResult = APIGuildMember;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#list-guild-members
|
||||
*/
|
||||
export interface RESTGetAPIGuildMembersQuery {
|
||||
/**
|
||||
* Max number of members to return (1-1000)
|
||||
*
|
||||
* @default 1
|
||||
*/
|
||||
limit?: number;
|
||||
/**
|
||||
* The highest user id in the previous page
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
after?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#list-guild-members
|
||||
*/
|
||||
export type RESTGetAPIGuildMembersResult = APIGuildMember[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#search-guild-members
|
||||
*/
|
||||
export interface RESTGetAPIGuildMembersSearchQuery {
|
||||
/**
|
||||
* Query string to match username(s) and nickname(s) against
|
||||
*/
|
||||
query: string;
|
||||
/**
|
||||
* Max number of members to return (1-1000)
|
||||
*
|
||||
* @default 1
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export type RESTGetAPIGuildMembersSearchResult = APIGuildMember[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
*/
|
||||
export interface RESTPutAPIGuildMemberJSONBody {
|
||||
/**
|
||||
* An oauth2 access token granted with the `guilds.join` to the bot's application for the user you want to add to the guild
|
||||
*/
|
||||
access_token: string;
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `MANAGE_NICKNAMES` permission
|
||||
*/
|
||||
nick?: string;
|
||||
/**
|
||||
* Array of role ids the member is assigned
|
||||
*
|
||||
* Requires `MANAGE_ROLES` permission
|
||||
*/
|
||||
roles?: Snowflake[];
|
||||
/**
|
||||
* Whether the user is muted in voice channels
|
||||
*
|
||||
* Requires `MUTE_MEMBERS` permission
|
||||
*/
|
||||
mute?: boolean;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels
|
||||
*
|
||||
* Requires `DEAFEN_MEMBERS` permission
|
||||
*/
|
||||
deaf?: boolean;
|
||||
}
|
||||
|
||||
export type RESTPutAPIGuildMemberResult = APIGuildMember | undefined;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-member
|
||||
*/
|
||||
export interface RESTPatchAPIGuildMemberJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `MANAGE_NICKNAMES` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
/**
|
||||
* Array of role ids the member is assigned
|
||||
*
|
||||
* Requires `MANAGE_ROLES` permission
|
||||
*/
|
||||
roles?: Snowflake[] | null;
|
||||
/**
|
||||
* Whether the user is muted in voice channels. Will throw a 400 if the user is not in a voice channel
|
||||
*
|
||||
* Requires `MUTE_MEMBERS` permission
|
||||
*/
|
||||
mute?: boolean | null;
|
||||
/**
|
||||
* Whether the user is deafened in voice channels. Will throw a 400 if the user is not in a voice channel
|
||||
*
|
||||
* Requires `DEAFEN_MEMBERS` permission
|
||||
*/
|
||||
deaf?: boolean | null;
|
||||
/**
|
||||
* ID of channel to move user to (if they are connected to voice)
|
||||
*
|
||||
* Requires `MOVE_MEMBERS` permission
|
||||
*/
|
||||
channel_id?: Snowflake | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member
|
||||
*/
|
||||
export type RESTPatchAPIGuildMemberResult = APIGuildMember;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-nick
|
||||
*/
|
||||
export interface RESTPatchAPICurrentGuildMemberNicknameJSONBody {
|
||||
/**
|
||||
* Value to set users nickname to
|
||||
*
|
||||
* Requires `CHANGE_NICKNAME` permission
|
||||
*/
|
||||
nick?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-current-user-nick
|
||||
*/
|
||||
export type RESTPatchAPICurrentGuildMemberNicknameResult = Required<RESTPatchAPICurrentGuildMemberNicknameJSONBody>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#add-guild-member-role
|
||||
*/
|
||||
export type RESTPutAPIGuildMemberRoleResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#remove-guild-member-role
|
||||
*/
|
||||
export type RESTDeleteAPIGuildMemberRoleResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#remove-guild-member
|
||||
*/
|
||||
export type RESTDeleteAPIGuildMemberResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-bans
|
||||
*/
|
||||
export type RESTGetAPIGuildBansResult = APIBan[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-ban
|
||||
*/
|
||||
export type RESTGetAPIGuildBanResult = APIBan;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-ban
|
||||
*/
|
||||
export interface RESTPutAPIGuildBanJSONBody {
|
||||
/**
|
||||
* Number of days to delete messages for (0-7)
|
||||
*/
|
||||
delete_message_days?: number;
|
||||
/**
|
||||
* Reason for the ban
|
||||
*/
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-ban
|
||||
*/
|
||||
export type RESTPutAPIGuildBanResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#remove-guild-ban
|
||||
*/
|
||||
export type RESTDeleteAPIGuildBanResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-roles
|
||||
*/
|
||||
export type RESTGetAPIGuildRolesResult = APIRole[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-role
|
||||
*/
|
||||
export interface RESTPostAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* Name of the role
|
||||
*
|
||||
* @default "new role"
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* Bitwise value of the enabled/disabled permissions
|
||||
*
|
||||
* @default "default role permissions in guild"
|
||||
*/
|
||||
permissions?: Permissions | null;
|
||||
/**
|
||||
* RGB color value
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
color?: number | null;
|
||||
/**
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
mentionable?: boolean | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#create-guild-role
|
||||
*/
|
||||
export type RESTPostAPIGuildRoleResult = APIRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildRolePositionsJSONBody = Array<{
|
||||
/**
|
||||
* Role id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Sorting position of the role
|
||||
*/
|
||||
position?: number;
|
||||
}>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role-positions
|
||||
*/
|
||||
export type RESTPatchAPIGuildRolePositionsResult = APIRole[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
*/
|
||||
export interface RESTPatchAPIGuildRoleJSONBody {
|
||||
/**
|
||||
* Name of the role
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
* Bitwise value of the enabled/disabled permissions
|
||||
*/
|
||||
permissions?: Permissions | null;
|
||||
/**
|
||||
* RGB color value
|
||||
*/
|
||||
color?: number | null;
|
||||
/**
|
||||
* Whether the role should be displayed separately in the sidebar
|
||||
*/
|
||||
hoist?: boolean | null;
|
||||
/**
|
||||
* Whether the role should be mentionable
|
||||
*/
|
||||
mentionable?: boolean | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-role
|
||||
*/
|
||||
export type RESTPatchAPIGuildRoleResult = APIRole;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#delete-guild-role
|
||||
*/
|
||||
export type RESTDeleteAPIGuildRoleResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-prune-count
|
||||
*/
|
||||
export interface RESTGetAPIGuildPruneCountQuery {
|
||||
/**
|
||||
* Number of days to count prune for (1 or more)
|
||||
*
|
||||
* @default 7
|
||||
*/
|
||||
days?: number;
|
||||
/**
|
||||
* Role(s) to include
|
||||
*
|
||||
* While this is typed as a string, it represents an array of
|
||||
* role IDs delimited by commas
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#get-guild-prune-count-query-string-params
|
||||
*/
|
||||
include_roles?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-prune-count
|
||||
*/
|
||||
export interface RESTGetAPIGuildPruneCountResult {
|
||||
pruned: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
||||
*/
|
||||
export interface RESTPostAPIGuildPruneJSONBody {
|
||||
/**
|
||||
* Number of days to count prune for (1 or more)
|
||||
*
|
||||
* @default 7
|
||||
*/
|
||||
days?: number;
|
||||
/**
|
||||
* Whether `pruned is returned, discouraged for large guilds
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
compute_prune_count?: boolean;
|
||||
/**
|
||||
* Role(s) to include
|
||||
*/
|
||||
include_roles?: Snowflake[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#begin-guild-prune
|
||||
*/
|
||||
export interface RESTPostAPIGuildPruneResult {
|
||||
pruned: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-voice-regions
|
||||
*/
|
||||
export type RESTGetAPIGuildVoiceRegionsResult = APIVoiceRegion[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-invites
|
||||
*/
|
||||
export type RESTGetAPIGuildInvitesResult = APIExtendedInvite[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-integrations
|
||||
*/
|
||||
export type RESTGetAPIGuildIntegrationsResult = APIGuildIntegration[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#delete-guild-integration
|
||||
*/
|
||||
export type RESTDeleteAPIGuildIntegrationResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-settings
|
||||
*/
|
||||
export type RESTGetAPIGuildWidgetSettingsResult = APIGuildWidgetSettings;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-widget
|
||||
*/
|
||||
export type RESTPatchAPIGuildWidgetSettingsJSONBody = Partial<APIGuildWidgetSettings>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-widget
|
||||
*/
|
||||
export type RESTPatchAPIGuildWidgetSettingsResult = APIGuildWidgetSettings;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget
|
||||
*/
|
||||
export type RESTGetAPIGuildWidgetJSONResult = APIGuildWidget;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-vanity-url
|
||||
*/
|
||||
export interface RESTGetAPIGuildVanityUrlResult {
|
||||
code: string | null;
|
||||
uses: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-widget-image
|
||||
*/
|
||||
export interface RESTGetAPIGuildWidgetImageQuery {
|
||||
/**
|
||||
* Style of the widget image returned
|
||||
*
|
||||
* @default "shield"
|
||||
*/
|
||||
style?: GuildWidgetStyle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Note: while the return type is `ArrayBuffer`, the expected result is
|
||||
* a buffer of sorts (depends if in browser or on node.js/deno).
|
||||
*/
|
||||
export type RESTGetAPIGuildWidgetImageResult = ArrayBuffer;
|
||||
|
||||
export type RESTGetAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
export interface RESTPatchAPIGuildMemberVerificationJSONBody {
|
||||
/**
|
||||
* Whether Membership Screening is enabled
|
||||
*/
|
||||
enabled?: boolean;
|
||||
/**
|
||||
* Array of field objects serialized in a string
|
||||
*/
|
||||
form_fields?: string;
|
||||
/**
|
||||
* The server description to show in the screening form
|
||||
*/
|
||||
description?: string | null;
|
||||
}
|
||||
|
||||
export type RESTPatchAPIGuildMemberVerificationResult = APIGuildMembershipScreening;
|
||||
|
||||
export interface RESTPatchAPIGuildVoiceStateCurrentMemberJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean;
|
||||
/**
|
||||
* Sets the user's request to speak
|
||||
*/
|
||||
request_to_speak_timestamp?: string | null;
|
||||
}
|
||||
|
||||
export interface RESTPatchAPIGuildVoiceStateUserJSONBody {
|
||||
/**
|
||||
* The id of the channel the user is currently in
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Toggles the user's suppress state
|
||||
*/
|
||||
suppress?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#get-guild-welcome-screen
|
||||
*/
|
||||
export type RESTGetAPIGuildWelcomeScreenResult = APIGuildWelcomeScreen;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#modify-guild-welcome-screen
|
||||
*/
|
||||
export interface RESTPatchAPIGuildWelcomeScreenJSONBody extends Nullable<Partial<APIGuildWelcomeScreen>> {
|
||||
/**
|
||||
* Whether the welcome screen is enabled
|
||||
*/
|
||||
enabled?: boolean | null;
|
||||
}
|
||||
|
||||
type Nullable<T> = {
|
||||
[P in keyof T]: T[P] | null;
|
||||
};
|
||||
147
deno/rest/v8/interactions.ts
Normal file
147
deno/rest/v8/interactions.ts
Normal file
@@ -0,0 +1,147 @@
|
||||
import type {
|
||||
APIApplicationCommand,
|
||||
APIApplicationCommandPermission,
|
||||
APIGuildApplicationCommandPermissions,
|
||||
APIInteractionResponse,
|
||||
} from '../../payloads/v8/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#get-global-application-commands
|
||||
*/
|
||||
export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#get-global-application-command
|
||||
*/
|
||||
export type RESTGetAPIApplicationCommandResult = APIApplicationCommand;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#create-global-application-command
|
||||
*/
|
||||
export type RESTPostAPIApplicationCommandsJSONBody = Omit<APIApplicationCommand, 'id' | 'application_id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#create-global-application-command
|
||||
*/
|
||||
export type RESTPostAPIApplicationCommandsResult = APIApplicationCommand;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#edit-global-application-command
|
||||
*/
|
||||
export type RESTPatchAPIApplicationCommandJSONBody = Partial<RESTPostAPIApplicationCommandsJSONBody>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#edit-global-application-command
|
||||
*/
|
||||
export type RESTPatchAPIApplicationCommandResult = APIApplicationCommand;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#bulk-overwrite-global-application-commands
|
||||
*/
|
||||
export type RESTPutAPIApplicationCommandsJSONBody = RESTPostAPIApplicationCommandsJSONBody[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#bulk-overwrite-global-application-commands
|
||||
*/
|
||||
export type RESTPutAPIApplicationCommandsResult = APIApplicationCommand[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#get-guild-application-commands
|
||||
*/
|
||||
export type RESTGetAPIApplicationGuildCommandsResult = APIApplicationCommand[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#get-guild-application-command
|
||||
*/
|
||||
export type RESTGetAPIApplicationGuildCommandResult = APIApplicationCommand;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#create-guild-application-command
|
||||
*/
|
||||
export type RESTPostAPIApplicationGuildCommandsJSONBody = RESTPostAPIApplicationCommandsJSONBody;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#create-guild-application-command
|
||||
*/
|
||||
export type RESTPostAPIApplicationGuildCommandsResult = APIApplicationCommand;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#edit-guild-application-command
|
||||
*/
|
||||
export type RESTPatchAPIApplicationGuildCommandJSONBody = Partial<RESTPostAPIApplicationCommandsJSONBody>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#edit-guild-application-command
|
||||
*/
|
||||
export type RESTPatchAPIApplicationGuildCommandResult = APIApplicationCommand;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#bulk-overwrite-global-application-commands
|
||||
*/
|
||||
export type RESTPutAPIApplicationGuildCommandsJSONBody = RESTPostAPIApplicationCommandsJSONBody[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#bulk-overwrite-global-application-commands
|
||||
*/
|
||||
export type RESTPutAPIApplicationGuildCommandsResult = APIApplicationCommand[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#create-interaction-response
|
||||
*/
|
||||
export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#create-interaction-response
|
||||
*/
|
||||
export type RESTPostAPIInteractionCallbackFormDataBody =
|
||||
| {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#get-guild-application-command-permissions
|
||||
*/
|
||||
export type RESTGetAPIGuildApplicationCommandsPermissionsResult = APIGuildApplicationCommandPermissions[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#get-application-command-permissions
|
||||
*/
|
||||
export type RESTGetAPIApplicationCommandPermissionsResult = APIGuildApplicationCommandPermissions;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#edit-application-command-permissions
|
||||
*/
|
||||
export interface RESTPutAPIApplicationCommandPermissionsJSONBody {
|
||||
permissions: APIApplicationCommandPermission[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#edit-application-command-permissions
|
||||
*/
|
||||
export type RESTPutAPIApplicationCommandPermissionsResult = APIGuildApplicationCommandPermissions;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#batch-edit-application-command-permissions
|
||||
*/
|
||||
export type RESTPutAPIGuildApplicationCommandsPermissionsJSONBody = Pick<
|
||||
APIGuildApplicationCommandPermissions,
|
||||
'id' | 'permissions'
|
||||
>[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#batch-edit-application-command-permissions
|
||||
*/
|
||||
export type RESTPutAPIGuildApplicationCommandsPermissionsResult = APIGuildApplicationCommandPermissions[];
|
||||
18
deno/rest/v8/invite.ts
Normal file
18
deno/rest/v8/invite.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import type { APIInvite } from '../../payloads/v8/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#get-invite
|
||||
*/
|
||||
export interface RESTGetAPIInviteQuery {
|
||||
/**
|
||||
* Whether the invite should contain approximate member counts
|
||||
*/
|
||||
with_counts?: boolean;
|
||||
}
|
||||
|
||||
export type RESTGetAPIInviteResult = APIInvite;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#delete-invite
|
||||
*/
|
||||
export type RESTDeleteAPIInviteResult = APIInvite;
|
||||
689
deno/rest/v8/mod.ts
Normal file
689
deno/rest/v8/mod.ts
Normal file
@@ -0,0 +1,689 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
export * from '../common.ts';
|
||||
|
||||
export * from './auditLog.ts';
|
||||
export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
export * from './guild.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './template.ts';
|
||||
export * from './user.ts';
|
||||
export * from './voice.ts';
|
||||
export * from './webhook.ts';
|
||||
|
||||
export const APIVersion = '8';
|
||||
|
||||
export const Routes = {
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/audit-logs`
|
||||
*/
|
||||
guildAuditLog(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/audit-logs` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}`
|
||||
* - PATCH `/channels/{channel.id}`
|
||||
* - DELETE `/channels/{channel.id}`
|
||||
*/
|
||||
channel(channelID: Snowflake) {
|
||||
return `/channels/${channelID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages`
|
||||
* - POST `/channels/{channel.id}/messages`
|
||||
*/
|
||||
channelMessages(channelID: Snowflake) {
|
||||
return `/channels/${channelID}/messages` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages/{message.id}`
|
||||
* - PATCH `/channels/{channel.id}/messages/{message.id}`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}`
|
||||
*/
|
||||
channelMessage(channelID: Snowflake, messageID: Snowflake) {
|
||||
return `/channels/${channelID}/messages/${messageID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/messages/{message.id}/crosspost`
|
||||
*/
|
||||
channelMessageCrosspost(channelID: Snowflake, messageID: Snowflake) {
|
||||
return `/channels/${channelID}/messages/${messageID}/crosspost` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself
|
||||
*/
|
||||
channelMessageOwnReaction(channelID: Snowflake, messageID: Snowflake, emoji: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/@me` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself
|
||||
*/
|
||||
channelMessageUserReaction(channelID: Snowflake, messageID: Snowflake, emoji: string, userID: Snowflake) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/${userID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself
|
||||
*/
|
||||
channelMessageReaction(channelID: Snowflake, messageID: Snowflake, emoji: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions`
|
||||
*/
|
||||
channelMessageAllReactions(channelID: Snowflake, messageID: Snowflake) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/messages/bulk-delete`
|
||||
*/
|
||||
channelBulkDelete(channelID: Snowflake) {
|
||||
return `/channels/${channelID}/messages/bulk-delete` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/permissions/{overwrite.id}`
|
||||
* - DELETE `/channels/{channel.id}/permissions/{overwrite.id}`
|
||||
*/
|
||||
channelPermission(channelID: Snowflake, overwriteID: Snowflake) {
|
||||
return `/channels/${channelID}/permissions/${overwriteID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/invites`
|
||||
* - POST `/channels/{channel.id}/invites`
|
||||
*/
|
||||
channelInvites(channelID: Snowflake) {
|
||||
return `/channels/${channelID}/invites` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/followers`
|
||||
*/
|
||||
channelFollowers(channelID: Snowflake) {
|
||||
return `/channels/${channelID}/followers` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/typing`
|
||||
*/
|
||||
channelTyping(channelID: Snowflake) {
|
||||
return `/channels/${channelID}/typing` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/pins`
|
||||
*/
|
||||
channelPins(channelID: Snowflake) {
|
||||
return `/channels/${channelID}/pins` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/pins/{message.id}`
|
||||
* - DELETE `/channels/{channel.id}/pins/{message.id}`
|
||||
*/
|
||||
channelPin(channelID: Snowflake, messageID: Snowflake) {
|
||||
return `/channels/${channelID}/pins/${messageID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/recipients/{user.id}`
|
||||
* - DELETE `/channels/{channel.id}/recipients/{user.id}`
|
||||
*/
|
||||
channelRecipient(channelID: Snowflake, userID: Snowflake) {
|
||||
return `/channels/${channelID}/recipients/${userID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/emojis`
|
||||
* - POST `/guilds/{guild.id}/emojis`
|
||||
*/
|
||||
guildEmojis(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/emojis` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
* - PATCH `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
* - DELETE `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
*/
|
||||
guildEmoji(guildID: Snowflake, emojiID: Snowflake) {
|
||||
return `/guilds/${guildID}/emojis/${emojiID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/guilds`
|
||||
*/
|
||||
guilds() {
|
||||
return '/guilds' as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}`
|
||||
* - PATCH `/guilds/{guild.id}`
|
||||
* - DELETE `/guilds/{guild.id}`
|
||||
*/
|
||||
guild(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/preview`
|
||||
*/
|
||||
guildPreview(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/preview` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/channels`
|
||||
* - POST `/guilds/{guild.id}/channels`
|
||||
* - PATCH `/guilds/{guild.id}/channels`
|
||||
*/
|
||||
guildChannels(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/channels` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members/{user.id}`
|
||||
* - PUT `/guilds/{guild.id}/members/{user.id}`
|
||||
* - PATCH `/guilds/{guild.id}/members/{user.id}`
|
||||
* - DELETE `/guilds/{guild.id}/members/{user.id}`
|
||||
*/
|
||||
guildMember(guildID: Snowflake, userID: Snowflake) {
|
||||
return `/guilds/${guildID}/members/${userID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members`
|
||||
*/
|
||||
guildMembers(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/members` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members/search`
|
||||
*/
|
||||
guildMembersSearch(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/members/search` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/members/@me/nick`
|
||||
*/
|
||||
guildCurrentMemberNickname(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/members/@me/nick` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
|
||||
*/
|
||||
guildMemberRole(guildID: Snowflake, memberID: Snowflake, roleID: Snowflake) {
|
||||
return `/guilds/${guildID}/members/${memberID}/roles/${roleID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/bans`
|
||||
*/
|
||||
guildBans(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/bans` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/bans/{user.id}`
|
||||
* - PUT `/guilds/{guild.id}/bans/{user.id}`
|
||||
* - DELETE `/guilds/{guild.id}/bans/{user.id}`
|
||||
*/
|
||||
guildBan(guildID: Snowflake, userID: Snowflake) {
|
||||
return `/guilds/${guildID}/bans/${userID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/roles`
|
||||
* - POST `/guilds/{guild.id}/roles`
|
||||
* - PATCH `/guilds/{guild.id}/roles`
|
||||
*/
|
||||
guildRoles(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/roles` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/roles/{role.id}`
|
||||
*/
|
||||
guildRole(guildID: Snowflake, roleID: Snowflake) {
|
||||
return `/guilds/${guildID}/roles/${roleID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/prune`
|
||||
* - POST `/guilds/{guild.id}/prune`
|
||||
*/
|
||||
guildPrune(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/prune` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/regions`
|
||||
*/
|
||||
guildVoiceRegions(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/regions` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/invites`
|
||||
*/
|
||||
guildInvites(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/invites` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/integrations`
|
||||
*/
|
||||
guildIntegrations(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/integrations` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/guilds/{guild.id}/integrations/{integration.id}`
|
||||
*/
|
||||
guildIntegration(guildID: Snowflake, integrationID: Snowflake) {
|
||||
return `/guilds/${guildID}/integrations/${integrationID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget`
|
||||
* - PATCH `/guilds/{guild.id}/widget`
|
||||
*/
|
||||
guildWidgetSettings(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/widget` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget.json`
|
||||
*/
|
||||
guildWidgetJSON(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/widget.json` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/vanity-url`
|
||||
*/
|
||||
guildVanityUrl(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/vanity-url` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget.png`
|
||||
*/
|
||||
guildWidgetImage(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/widget.png` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/invites/{invite.code}`
|
||||
* - DELETE `/invites/{invite.code}`
|
||||
*/
|
||||
invite(code: string) {
|
||||
return `/invites/${code}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/templates/{template.code}`
|
||||
* - POST `/guilds/templates/{template.code}`
|
||||
*/
|
||||
template(code: string) {
|
||||
return `/guilds/templates/${code}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/templates`
|
||||
* - POST `/guilds/{guild.id}/templates`
|
||||
*/
|
||||
guildTemplates(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/templates` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/guilds/{guild.id}/templates/{template.code}`
|
||||
* - PATCH `/guilds/{guild.id}/templates/{template.code}`
|
||||
* - DELETE `/guilds/{guild.id}/templates/{template.code}`
|
||||
*/
|
||||
guildTemplate(guildID: Snowflake, code: string) {
|
||||
return `/guilds/${guildID}/templates/${code}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me`
|
||||
* - GET `/users/{user.id}`
|
||||
* - PATCH `/users/@me`
|
||||
*
|
||||
* @param [userID='@me'] The user ID, defaulted to `@me`
|
||||
*/
|
||||
user(userID = '@me') {
|
||||
return `/users/${userID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/guilds`
|
||||
*/
|
||||
userGuilds() {
|
||||
return `/users/@me/guilds` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/users/@me/guilds/{guild.id}`
|
||||
*/
|
||||
userGuild(guildID: Snowflake) {
|
||||
return `/users/@me/guilds/${guildID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/users/@me/channels`
|
||||
*/
|
||||
userChannels() {
|
||||
return `/users/@me/channels` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/connections`
|
||||
*/
|
||||
userConnections() {
|
||||
return `/users/@me/connections` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/voice/regions`
|
||||
*/
|
||||
voiceRegions() {
|
||||
return `/voice/regions` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/webhooks`
|
||||
* - POST `/channels/{channel.id}/webhooks`
|
||||
*/
|
||||
channelWebhooks(channelID: Snowflake) {
|
||||
return `/channels/${channelID}/webhooks` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/webhooks`
|
||||
*/
|
||||
guildWebhooks(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/webhooks` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/webhooks/{webhook.id}`
|
||||
* - GET `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - PATCH `/webhooks/{webhook.id}`
|
||||
* - PATCH `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - DELETE `/webhooks/{webhook.id}`
|
||||
* - DELETE `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}`
|
||||
*
|
||||
* - POST `/webhooks/{application.id}/{interaction.token}`
|
||||
*/
|
||||
webhook(webhookID: Snowflake, webhookToken?: string) {
|
||||
const parts = ['', 'webhooks', webhookID];
|
||||
|
||||
if (webhookToken) parts.push(webhookToken);
|
||||
|
||||
return parts.join('/') as `/webhooks/${Snowflake}` | `/webhooks/${Snowflake}/${string}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/webhooks/{webhook.id}/{webhook.token}/messages/@original`
|
||||
* - PATCH `/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}`
|
||||
* - DELETE `/webhooks/{webhook.id}/{webhook.token}/messages/@original`
|
||||
* - DELETE `/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}`
|
||||
*
|
||||
* - PATCH `/webhooks/{application.id}/{interaction.token}/messages/@original`
|
||||
* - PATCH `/webhooks/{application.id}/{interaction.token}/messages/{message.id}`
|
||||
* - DELETE `/webhooks/{application.id}/{interaction.token}/messages/{message.id}`
|
||||
*
|
||||
* @param [messageID='@original'] The message ID to change, defaulted to `@original`
|
||||
*/
|
||||
webhookMessage(webhookID: Snowflake, webhookToken: string, messageID = '@original') {
|
||||
return `/webhooks/${webhookID}/${webhookToken}/messages/${messageID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}/github`
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}/slack`
|
||||
*/
|
||||
webhookPlatform(webhookID: Snowflake, webhookToken: string, platform: 'github' | 'slack') {
|
||||
return `/webhooks/${webhookID}/${webhookToken}/${platform}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/gateway`
|
||||
*/
|
||||
gateway() {
|
||||
return `/gateway` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/gateway/bot`
|
||||
*/
|
||||
gatewayBot() {
|
||||
return `/gateway/bot` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/applications/@me`
|
||||
*/
|
||||
oauth2CurrentApplication() {
|
||||
return `/oauth2/applications/@me` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/@me`
|
||||
*/
|
||||
oauth2CurrentAuthorization() {
|
||||
return `/oauth2/@me` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/commands`
|
||||
* - PUT `/applications/{application.id}/commands`
|
||||
* - POST `/applications/{application.id}/commands`
|
||||
*/
|
||||
applicationCommands(applicationID: Snowflake) {
|
||||
return `/applications/${applicationID}/commands` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/commands/{command.id}`
|
||||
* - PATCH `/applications/{application.id}/commands/{command.id}`
|
||||
* - DELETE `/applications/{application.id}/commands/{command.id}`
|
||||
*/
|
||||
applicationCommand(applicationID: Snowflake, commandID: Snowflake) {
|
||||
return `/applications/${applicationID}/commands/${commandID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/guilds/{guild.id}/commands`
|
||||
* - PUT `/applications/{application.id}/guilds/{guild.id}/commands`
|
||||
* - POST `/applications/{application.id}/guilds/{guild.id}/commands`
|
||||
*/
|
||||
applicationGuildCommands(applicationID: Snowflake, guildID: Snowflake) {
|
||||
return `/applications/${applicationID}/guilds/${guildID}/commands` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}`
|
||||
* - PATCH `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}`
|
||||
* - DELETE `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}`
|
||||
*/
|
||||
applicationGuildCommand(applicationID: Snowflake, guildID: Snowflake, commandID: Snowflake) {
|
||||
return `/applications/${applicationID}/guilds/${guildID}/commands/${commandID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/interactions/{interaction.id}/{interaction.token}/callback`
|
||||
*/
|
||||
interactionCallback(interactionID: Snowflake, interactionToken: string) {
|
||||
return `/interactions/${interactionID}/${interactionToken}/callback` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/member-verification`
|
||||
* - PATCH `/guilds/{guild.id}/member-verification`
|
||||
*/
|
||||
guildMemberVerification(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/member-verification` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/voice-states/@me`
|
||||
* - PATCH `/guilds/{guild.id}/voice-states/{user.id}`
|
||||
*/
|
||||
guildVoiceState(guildID: Snowflake, userID: Snowflake | '@me' = '@me') {
|
||||
return `/guilds/${guildID}/voice-states/${userID}` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/guilds/{guild.id}/commands/permissions`
|
||||
* - PUT `/applications/{application.id}/guilds/{guild.id}/commands/permissions`
|
||||
*/
|
||||
guildApplicationCommandsPermissions(applicationID: Snowflake, guildID: Snowflake) {
|
||||
return `/applications/${applicationID}/guilds/${guildID}/commands/permissions` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions`
|
||||
* - PUT `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}/permissions`
|
||||
*/
|
||||
applicationCommandPermissions(applicationID: Snowflake, guildID: Snowflake, commandID: Snowflake) {
|
||||
return `/applications/${applicationID}/guilds/${guildID}/commands/${commandID}/permissions` as const;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/welcome-screen`
|
||||
* - PATCH `/guilds/{guild.id}/welcome-screen`
|
||||
*/
|
||||
guildWelcomeScreen(guildID: Snowflake) {
|
||||
return `/guilds/${guildID}/welcome-screen` as const;
|
||||
},
|
||||
};
|
||||
|
||||
export const RouteBases = {
|
||||
api: 'https://discord.com/api',
|
||||
cdn: 'https://cdn.discordapp.com',
|
||||
invite: 'https://discord.gg',
|
||||
template: 'https://discord.new',
|
||||
gift: 'https://discord.gift',
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Freeze bases object
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(RouteBases);
|
||||
|
||||
export const OAuth2Routes = {
|
||||
authorizationURL: `https://discord.com/api/v${APIVersion}/oauth2/authorize`,
|
||||
tokenURL: `https://discord.com/api/v${APIVersion}/oauth2/token`,
|
||||
/**
|
||||
* See https://tools.ietf.org/html/rfc7009
|
||||
*/
|
||||
tokenRevocationURL: `https://discord.com/api/v${APIVersion}/oauth2/token/revoke`,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Freeze OAuth2 route object
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(OAuth2Routes);
|
||||
199
deno/rest/v8/oauth2.ts
Normal file
199
deno/rest/v8/oauth2.ts
Normal file
@@ -0,0 +1,199 @@
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { APIApplication, APIGuild, APIUser, APIWebhook, OAuth2Scopes } from '../../payloads/v8/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#get-current-application-information
|
||||
*/
|
||||
export type RESTGetAPIOauth2CurrentApplicationResult = Omit<APIApplication, 'flags'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#get-current-authorization-information
|
||||
*/
|
||||
export interface RESTGetAPIOauth2CurrentAuthorizationResult {
|
||||
/**
|
||||
* the current application
|
||||
*/
|
||||
application: Partial<APIApplication>;
|
||||
/**
|
||||
* the scopes the user has authorized the application for
|
||||
*/
|
||||
scopes: OAuth2Scopes[];
|
||||
/**
|
||||
* when the access token expires
|
||||
*/
|
||||
expires: string;
|
||||
/**
|
||||
* the user who has authorized, if the user has authorized with the `identify` scope
|
||||
*/
|
||||
user?: APIUser;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant
|
||||
*/
|
||||
export interface RESTOAuth2AuthorizationQuery {
|
||||
response_type: 'code';
|
||||
client_id: Snowflake;
|
||||
scope: string;
|
||||
redirect_uri?: string;
|
||||
state?: string;
|
||||
prompt?: 'consent' | 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
|
||||
*/
|
||||
export interface RESTOAuth2AuthorizationQueryResult {
|
||||
code: string;
|
||||
state?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-redirect-url-example
|
||||
*/
|
||||
export interface RESTPostOAuth2AccessTokenURLEncodedData {
|
||||
client_id: Snowflake;
|
||||
client_secret: string;
|
||||
grant_type: 'authorization_code';
|
||||
code: string;
|
||||
redirect_uri?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-access-token-response
|
||||
*/
|
||||
export interface RESTPostOAuth2AccessTokenResult {
|
||||
access_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
refresh_token: string;
|
||||
scope: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#authorization-code-grant-refresh-token-exchange-example
|
||||
*/
|
||||
export interface RESTPostOAuth2RefreshTokenURLEncodedData {
|
||||
client_id: Snowflake;
|
||||
client_secret: string;
|
||||
grant_type: 'refresh_token';
|
||||
refresh_token: string;
|
||||
}
|
||||
|
||||
export type RESTPostOAuth2RefreshTokenResult = RESTPostOAuth2AccessTokenResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#implicit-grant
|
||||
*/
|
||||
export interface RESTOAuth2ImplicitAuthorizationQuery {
|
||||
response_type: 'token';
|
||||
client_id: Snowflake;
|
||||
scope: string;
|
||||
redirect_uri?: string;
|
||||
state?: string;
|
||||
prompt?: 'consent' | 'none';
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#implicit-grant-redirect-url-example
|
||||
*/
|
||||
export type RESTOAuth2ImplicitAuthorizationURLFragmentResult = Omit<RESTPostOAuth2AccessTokenResult, 'refresh_token'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#client-credentials-grant
|
||||
*/
|
||||
export interface RESTPostOAuth2ClientCredentialsURLEncodedData {
|
||||
grant_type: 'client_credentials';
|
||||
scope: string;
|
||||
}
|
||||
|
||||
export type RESTPostOAuth2ClientCredentialsResult = RESTOAuth2ImplicitAuthorizationURLFragmentResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#bot-authorization-flow-bot-auth-parameters
|
||||
*/
|
||||
export interface RESTOAuth2BotAuthorizationQuery {
|
||||
/**
|
||||
* Your app's client id
|
||||
*/
|
||||
client_id: Snowflake;
|
||||
/**
|
||||
* Needs to include bot for the bot flow
|
||||
*/
|
||||
scope:
|
||||
| OAuth2Scopes.Bot
|
||||
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
|
||||
| `${OAuth2Scopes.Bot}${' ' | '%20'}${string}`
|
||||
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`;
|
||||
/**
|
||||
* The permissions you're requesting
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions
|
||||
*/
|
||||
permissions?: Permissions;
|
||||
/**
|
||||
* Pre-fills the dropdown picker with a guild for the user
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* `true` or `false`—disallows the user from changing the guild dropdown
|
||||
*/
|
||||
disable_guild_select?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#advanced-bot-authorization
|
||||
*/
|
||||
export interface RESTOAuth2AdvancedBotAuthorizationQuery {
|
||||
client_id: Snowflake;
|
||||
/**
|
||||
* This assumes you include the `bot` scope alongside others (like `identify` for example)
|
||||
*/
|
||||
scope:
|
||||
| OAuth2Scopes.Bot
|
||||
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}`
|
||||
| `${OAuth2Scopes.Bot}${' ' | '%20'}${string}`
|
||||
| `${string}${' ' | '%20'}${OAuth2Scopes.Bot}${string}${' ' | '%20'}`;
|
||||
/**
|
||||
* The required permissions bitfield, stringified
|
||||
*/
|
||||
permissions?: Permissions;
|
||||
guild_id?: Snowflake;
|
||||
disable_guild_select?: boolean;
|
||||
response_type: string;
|
||||
redirect_uri?: string;
|
||||
}
|
||||
|
||||
export interface RESTOAuth2AdvancedBotAuthorizationQueryResult {
|
||||
code: string;
|
||||
state?: string;
|
||||
guild_id: Snowflake;
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#advanced-bot-authorization-extended-bot-authorization-access-token-example
|
||||
*/
|
||||
export interface RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult {
|
||||
access_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
refresh_token: string;
|
||||
scope: string;
|
||||
guild: APIGuild;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/oauth2#webhooks-webhook-token-response-example
|
||||
*/
|
||||
export interface RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult {
|
||||
access_token: string;
|
||||
token_type: string;
|
||||
expires_in: number;
|
||||
refresh_token: string;
|
||||
scope: string;
|
||||
webhook: APIWebhook;
|
||||
}
|
||||
|
||||
export type RESTPostOAuth2AccessTokenWithBotAndGuildsAndWebhookIncomingScopeResult = RESTPostOAuth2AccessTokenWithBotAndGuildsScopeResult &
|
||||
RESTPostOAuth2AccessTokenWithBotAndWebhookIncomingScopeResult;
|
||||
70
deno/rest/v8/template.ts
Normal file
70
deno/rest/v8/template.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
import type { APIGuild, APITemplate } from '../../payloads/v8/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#get-template
|
||||
*/
|
||||
export type RESTGetAPITemplateResult = APITemplate;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#create-guild-from-template
|
||||
*/
|
||||
export interface RESTPostAPITemplateCreateGuildJSONBody {
|
||||
/**
|
||||
* Name of the guild (2-100 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* base64 1024x1024 png/jpeg image for the guild icon
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
icon?: string;
|
||||
}
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#create-guild-from-template
|
||||
*/
|
||||
export type RESTPostAPITemplateCreateGuildResult = APIGuild;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#get-guild-templates
|
||||
*/
|
||||
export type RESTGetAPIGuildTemplatesResult = APITemplate[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#create-guild-template
|
||||
*/
|
||||
export interface RESTPostAPIGuildTemplatesJSONBody {
|
||||
/**
|
||||
* Name of the template (1-100 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Description for the template (0-120 characters)
|
||||
*/
|
||||
description?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#create-guild-template
|
||||
*/
|
||||
export type RESTPostAPIGuildTemplatesResult = APITemplate;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#sync-guild-template
|
||||
*/
|
||||
export type RESTPutAPIGuildTemplateSyncResult = APITemplate;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#modify-guild-template
|
||||
*/
|
||||
export type RESTPatchAPIGuildTemplateJSONBody = Partial<RESTPostAPIGuildTemplatesJSONBody>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#modify-guild-template
|
||||
*/
|
||||
export type RESTPatchAPIGuildTemplateResult = APITemplate;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/template#delete-guild-template
|
||||
*/
|
||||
export type RESTDeleteAPIGuildTemplateResult = APITemplate;
|
||||
90
deno/rest/v8/user.ts
Normal file
90
deno/rest/v8/user.ts
Normal file
@@ -0,0 +1,90 @@
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { APIChannel, APIConnection, APIUser, GuildFeature } from '../../payloads/v8/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user
|
||||
*/
|
||||
export type RESTGetAPICurrentUserResult = APIUser;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-user
|
||||
*/
|
||||
export type RESTGetAPIUserResult = APIUser;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
*/
|
||||
export interface RESTPatchAPICurrentUserJSONBody {
|
||||
/**
|
||||
* User's username, if changed may cause the user's discriminator to be randomized
|
||||
*/
|
||||
username?: string;
|
||||
/**
|
||||
* If passed, modifies the user's avatar
|
||||
*/
|
||||
avatar?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
*/
|
||||
export type RESTPatchAPICurrentUserResult = APIUser;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user-guilds
|
||||
*/
|
||||
export interface RESTGetAPICurrentUserGuildsQuery {
|
||||
/**
|
||||
* Get guilds before this guild ID
|
||||
*/
|
||||
before?: Snowflake;
|
||||
/**
|
||||
* Get guilds after this guild ID
|
||||
*/
|
||||
after?: Snowflake;
|
||||
/**
|
||||
* Max number of guilds to return (1-100)
|
||||
*
|
||||
* @default 100
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface RESTAPIPartialCurrentUserGuild {
|
||||
id: Snowflake;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user-guilds
|
||||
*/
|
||||
export type RESTGetAPICurrentUserGuildsResult = RESTAPIPartialCurrentUserGuild[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#leave-guild
|
||||
*/
|
||||
export type RESTDeleteAPICurrentUserGuildResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#create-dm
|
||||
*/
|
||||
export interface RESTPostAPICurrentUserCreateDMChannelJSONBody {
|
||||
/**
|
||||
* The recipient to open a DM channel with
|
||||
*/
|
||||
recipient_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#create-dm
|
||||
*/
|
||||
export type RESTPostAPICurrentUserCreateDMChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-user-connections
|
||||
*/
|
||||
export type RESTGetAPICurrentUserConnectionsResult = APIConnection[];
|
||||
6
deno/rest/v8/voice.ts
Normal file
6
deno/rest/v8/voice.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
import type { APIVoiceRegion } from '../../payloads/v8/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#list-voice-regions
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
243
deno/rest/v8/webhook.ts
Normal file
243
deno/rest/v8/webhook.ts
Normal file
@@ -0,0 +1,243 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIAllowedMentions, APIEmbed, APIMessage, APIWebhook } from '../../payloads/v8/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
export interface RESTPostAPIChannelWebhookJSONBody {
|
||||
/**
|
||||
* Name of the webhook (1-80 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Image for the default webhook avatar
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
avatar?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
export type RESTPostAPIChannelWebhookResult = APIWebhook;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-channel-webhooks
|
||||
*/
|
||||
export type RESTGetAPIChannelWebhooksResult = APIWebhook[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-guild-webhooks
|
||||
*/
|
||||
export type RESTGetAPIGuildWebhooksResult = APIWebhook[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-webhook
|
||||
*/
|
||||
export type RESTGetAPIWebhookResult = APIWebhook;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-webhook-with-token
|
||||
*/
|
||||
export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
*/
|
||||
export interface RESTPatchAPIWebhookJSONBody {
|
||||
/**
|
||||
* The default name of the webhook
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Image for the default webhook avatar
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* The new channel id this webhook should be moved to
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
*/
|
||||
export type RESTPatchAPIWebhookResult = APIWebhook;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenJSONBody = Omit<RESTPatchAPIWebhookJSONBody, 'channel_id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenResult = RESTGetAPIWebhookWithTokenResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#delete-webhook
|
||||
*/
|
||||
export type RESTDeleteAPIWebhookResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token
|
||||
*/
|
||||
export type RESTDeleteAPIWebhookWithTokenResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
/**
|
||||
* The message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string;
|
||||
/**
|
||||
* Override the default username of the webhook
|
||||
*/
|
||||
username?: string;
|
||||
/**
|
||||
* Override the default avatar of the webhook
|
||||
*/
|
||||
avatar_url?: string;
|
||||
/**
|
||||
* `true` if this is a TTS message
|
||||
*/
|
||||
tts?: boolean;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*/
|
||||
embeds?: APIEmbed[];
|
||||
/**
|
||||
* Allowed mentions for the message
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenFormDataBody =
|
||||
| {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
|
||||
*/
|
||||
export interface RESTPostAPIWebhookWithTokenQuery {
|
||||
/**
|
||||
* Waits for server confirmation of message send before response, and returns the created message body
|
||||
* (defaults to `false`; when `false` a message that is not saved does not return an error)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
wait?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenResult = never;
|
||||
|
||||
/**
|
||||
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
|
||||
* the `wait` query parameter set to `true`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenWaitResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-querystring-params
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenSlackQuery = RESTPostAPIWebhookWithTokenQuery;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenSlackResult = never;
|
||||
|
||||
/**
|
||||
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
|
||||
* the `wait` query parameter set to `true`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-querystring-params
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenSlackWaitResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-querystring-params
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenGitHubQuery = RESTPostAPIWebhookWithTokenQuery;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenGitHubResult = never;
|
||||
|
||||
/**
|
||||
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
|
||||
* the `wait` query parameter set to `true`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-querystring-params
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenGitHubWaitResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenMessageJSONBody = Nullable<
|
||||
Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions'>
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
|
||||
| {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPatchAPIWebhookWithTokenMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenMessageResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#delete-webhook-message
|
||||
*/
|
||||
export type RESTDeleteAPIWebhookWithTokenMessageResult = never;
|
||||
|
||||
type Nullable<T> = {
|
||||
[P in keyof T]: T[P] | null;
|
||||
};
|
||||
4
deno/rpc/mod.ts
Normal file
4
deno/rpc/mod.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// This file exports all the types available in the recommended API version
|
||||
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
|
||||
|
||||
export * from './v8.ts';
|
||||
33
deno/rpc/v8.ts
Normal file
33
deno/rpc/v8.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes
|
||||
*/
|
||||
export enum RPCErrorCodes {
|
||||
UnknownError = 1000,
|
||||
InvalidPayload = 4000,
|
||||
InvalidCommand = 4002,
|
||||
InvalidGuild,
|
||||
InvalidEvent,
|
||||
InvalidChannel,
|
||||
InvalidPermissions,
|
||||
InvalidClientID,
|
||||
InvalidOrigin,
|
||||
InvalidToken,
|
||||
InvalidUser,
|
||||
OAuth2Error = 5000,
|
||||
SelectChannelTimedOut,
|
||||
GetGuildTimedOut,
|
||||
SelectVoiceForceRequired,
|
||||
CaptureShortcutAlreadyListening,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-close-event-codes
|
||||
*/
|
||||
export enum RPCCloseEventCodes {
|
||||
InvalidClientID = 4000,
|
||||
InvalidOrigin,
|
||||
RateLimited,
|
||||
TokenRevoked,
|
||||
InvalidVersion,
|
||||
InvalidEncoding,
|
||||
}
|
||||
4
deno/shortcuts/v6.ts
Normal file
4
deno/shortcuts/v6.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from '../globals.ts';
|
||||
export * from '../gateway/v6.ts';
|
||||
export * from '../payloads/v6/mod.ts';
|
||||
export * from '../rest/v6/mod.ts';
|
||||
6
deno/shortcuts/v8.ts
Normal file
6
deno/shortcuts/v8.ts
Normal file
@@ -0,0 +1,6 @@
|
||||
export * from '../globals.ts';
|
||||
export * from '../gateway/v8.ts';
|
||||
export * from '../payloads/v8/mod.ts';
|
||||
export * from '../rest/v8/mod.ts';
|
||||
export * from '../rpc/v8.ts';
|
||||
export * as Utils from '../utils/v8.ts';
|
||||
4
deno/utils/mod.ts
Normal file
4
deno/utils/mod.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// This file exports all the utility functions available in the recommended API / Gateway version
|
||||
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
|
||||
|
||||
export * from './v8.ts';
|
||||
48
deno/utils/v8.ts
Normal file
48
deno/utils/v8.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import {
|
||||
APIApplicationCommandDMInteraction,
|
||||
APIApplicationCommandGuildInteraction,
|
||||
APIApplicationCommandInteraction,
|
||||
APIDMInteraction,
|
||||
APIGuildInteraction,
|
||||
APIInteraction,
|
||||
} from '../payloads/v8/mod.ts';
|
||||
|
||||
/**
|
||||
* A type-guard check for guild interactions.
|
||||
* @param interaction The interaction to check against the
|
||||
* @returns A boolean that indicates if the interaction was received from a guild
|
||||
*/
|
||||
export function isGuildInteraction(interaction: APIInteraction): interaction is APIGuildInteraction {
|
||||
return Reflect.has(interaction, 'guild_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* A type-guard check for DM interactions.
|
||||
* @param interaction The interaction to check against
|
||||
* @returns A boolean that indicates if the interaction was received from a direct message
|
||||
*/
|
||||
export function isDMInteraction(interaction: APIInteraction): interaction is APIDMInteraction {
|
||||
return !isGuildInteraction(interaction);
|
||||
}
|
||||
|
||||
/**
|
||||
* A type-guard check for guild application command interactions.
|
||||
* @param interaction The interaction to check against
|
||||
* @returns A boolean that indicates if the command interaction was received from a guild
|
||||
*/
|
||||
export function isApplicationCommandGuildInteraction(
|
||||
interaction: APIApplicationCommandInteraction,
|
||||
): interaction is APIApplicationCommandGuildInteraction {
|
||||
return isGuildInteraction(interaction);
|
||||
}
|
||||
|
||||
/**
|
||||
* A type-guard check for direct message application command interactions.
|
||||
* @param interaction The interaction to check against
|
||||
* @returns A boolean that indicates if the command interaction was received from a direct message
|
||||
*/
|
||||
export function isApplicationCommandDMInteraction(
|
||||
interaction: APIApplicationCommandInteraction,
|
||||
): interaction is APIApplicationCommandDMInteraction {
|
||||
return !isGuildInteraction(interaction);
|
||||
}
|
||||
4
deno/voice/mod.ts
Normal file
4
deno/voice/mod.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// This file exports all the types available in the recommended voice gateway version
|
||||
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
|
||||
|
||||
export * from './v4.ts';
|
||||
109
deno/voice/v4.ts
Normal file
109
deno/voice/v4.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
export const VoiceGatewayVersion = '4';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
|
||||
*/
|
||||
export enum VoiceOPCodes {
|
||||
/**
|
||||
* Begin a voice websocket connection
|
||||
*/
|
||||
Identify,
|
||||
/**
|
||||
* Select the voice protocol
|
||||
*/
|
||||
SelectProtocol,
|
||||
/**
|
||||
* Complete the websocket handshake
|
||||
*/
|
||||
Ready,
|
||||
/**
|
||||
* Keep the websocket connection alive
|
||||
*/
|
||||
Heartbeat,
|
||||
/**
|
||||
* Describe the session
|
||||
*/
|
||||
SessionDescription,
|
||||
/**
|
||||
* Indicate which users are speaking
|
||||
*/
|
||||
Speaking,
|
||||
/**
|
||||
* Sent to acknowledge a received client heartbeat
|
||||
*/
|
||||
HeartbeatAck,
|
||||
/**
|
||||
* Resume a connection
|
||||
*/
|
||||
Resume,
|
||||
/**
|
||||
* Time to wait between sending heartbeats in milliseconds
|
||||
*/
|
||||
Hello,
|
||||
/**
|
||||
* Acknowledge a successful session resume
|
||||
*/
|
||||
Resumed,
|
||||
/**
|
||||
* A client has connected to the voice channel
|
||||
*/
|
||||
ClientConnect = 12,
|
||||
/**
|
||||
* A client has disconnected from the voice channel
|
||||
*/
|
||||
ClientDisconnect,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
|
||||
*/
|
||||
export enum VoiceCloseCodes {
|
||||
/**
|
||||
* You sent an invalid opcode
|
||||
*/
|
||||
UnknownOpCode = 4001,
|
||||
/**
|
||||
* You sent a invalid payload in your identifying to the Gateway
|
||||
*/
|
||||
FailedToDecode,
|
||||
/**
|
||||
* You sent a payload before identifying with the Gateway
|
||||
*/
|
||||
NotAuthenticated,
|
||||
/**
|
||||
* The token you sent in your identify payload is incorrect
|
||||
*/
|
||||
AuthenticationFailed,
|
||||
/**
|
||||
* You sent more than one identify payload. Stahp
|
||||
*/
|
||||
AlreadyAuthenticated,
|
||||
/**
|
||||
* Your session is no longer valid
|
||||
*/
|
||||
SessionNoLongerValid,
|
||||
/**
|
||||
* Your session has timed out
|
||||
*/
|
||||
SessionTimeout = 4009,
|
||||
/**
|
||||
* We can't find the server you're trying to connect to
|
||||
*/
|
||||
ServerNotFound = 4011,
|
||||
/**
|
||||
* We didn't recognize the protocol you sent
|
||||
*/
|
||||
UnknownProtocol,
|
||||
/**
|
||||
* Either the channel was deleted, you were kicked, or the main gateway session was dropped. Should not reconnect
|
||||
*/
|
||||
Disconnected = 4014,
|
||||
/**
|
||||
* The server crashed. Our bad! Try resuming
|
||||
*/
|
||||
VoiceServerCrashed,
|
||||
/**
|
||||
* We didn't recognize your encryption
|
||||
*/
|
||||
UnknownEncryptionMode,
|
||||
}
|
||||
8
gateway/common.ts
Normal file
8
gateway/common.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-params
|
||||
*/
|
||||
export interface GatewayURLQuery {
|
||||
v: string;
|
||||
encoding: 'json' | 'etf';
|
||||
compress?: 'zlib-stream';
|
||||
}
|
||||
4
gateway/index.ts
Normal file
4
gateway/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// This file exports all the types available in the recommended gateway version
|
||||
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
|
||||
|
||||
export * from './v8';
|
||||
@@ -16,12 +16,18 @@ import type {
|
||||
GatewayVoiceState,
|
||||
InviteTargetUserType,
|
||||
PresenceUpdateStatus,
|
||||
} from '../payloads';
|
||||
} from '../payloads/v6/index';
|
||||
|
||||
export * from './common';
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export const GatewayVersion = '6';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GatewayOPCodes {
|
||||
Dispatch,
|
||||
@@ -40,6 +46,7 @@ export enum GatewayOPCodes {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GatewayCloseCodes {
|
||||
UnknownError = 4000,
|
||||
@@ -61,6 +68,7 @@ export enum GatewayCloseCodes {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum VoiceOPCodes {
|
||||
Identify,
|
||||
@@ -79,6 +87,7 @@ export enum VoiceOPCodes {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum VoiceCloseCodes {
|
||||
UnknownOpCode = 4001,
|
||||
@@ -100,6 +109,7 @@ export enum VoiceCloseCodes {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#list-of-intents
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GatewayIntentBits {
|
||||
GUILDS = 1 << 0,
|
||||
@@ -121,6 +131,7 @@ export enum GatewayIntentBits {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GatewayDispatchEvents {
|
||||
Ready = 'READY',
|
||||
@@ -161,6 +172,9 @@ export enum GatewayDispatchEvents {
|
||||
WebhooksUpdate = 'WEBHOOKS_UPDATE',
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewaySendPayload =
|
||||
| GatewayHeartbeat
|
||||
| GatewayIdentify
|
||||
@@ -169,6 +183,9 @@ export type GatewaySendPayload =
|
||||
| GatewayResume
|
||||
| GatewayRequestGuildMembers;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayReceivePayload =
|
||||
| GatewayHello
|
||||
| GatewayHeartbeatRequest
|
||||
@@ -177,6 +194,9 @@ export type GatewayReceivePayload =
|
||||
| GatewayReconnect
|
||||
| GatewayDispatchPayload;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayDispatchPayload =
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
@@ -213,6 +233,7 @@ export type GatewayDispatchPayload =
|
||||
// #region Dispatch Payloads
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#hello
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHello extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.Hello;
|
||||
@@ -223,6 +244,7 @@ export interface GatewayHello extends NonDispatchPayload {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHeartbeatRequest extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.Heartbeat;
|
||||
@@ -231,6 +253,7 @@ export interface GatewayHeartbeatRequest extends NonDispatchPayload {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating-example-gateway-heartbeat-ack
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHeartbeatAck extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.HeartbeatAck;
|
||||
@@ -239,6 +262,7 @@ export interface GatewayHeartbeatAck extends NonDispatchPayload {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invalid-session
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayInvalidSession extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.InvalidSession;
|
||||
@@ -247,6 +271,7 @@ export interface GatewayInvalidSession extends NonDispatchPayload {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#reconnect
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayReconnect extends NonDispatchPayload {
|
||||
op: GatewayOPCodes.Reconnect;
|
||||
@@ -255,6 +280,7 @@ export interface GatewayReconnect extends NonDispatchPayload {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#ready
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayReadyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.Ready,
|
||||
@@ -270,6 +296,7 @@ export type GatewayReadyDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#resumed
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
|
||||
|
||||
@@ -278,6 +305,7 @@ export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed,
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-create
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-update
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-delete
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ChannelCreate | GatewayDispatchEvents.ChannelDelete | GatewayDispatchEvents.ChannelUpdate,
|
||||
@@ -285,12 +313,24 @@ export type GatewayChannelModifyDispatch = DataPayload<
|
||||
>;
|
||||
/* eslint-enable @typescript-eslint/indent */
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelCreateDispatch = GatewayChannelModifyDispatch;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelUpdateDispatch = GatewayChannelModifyDispatch;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-pins-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelPinsUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ChannelPinsUpdate,
|
||||
@@ -304,23 +344,33 @@ export type GatewayChannelPinsUpdateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildCreate | GatewayDispatchEvents.GuildUpdate,
|
||||
APIGuild
|
||||
>;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildCreateDispatch = GatewayGuildModifyDispatch;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-delete
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildDelete, APIUnavailableGuild>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-ban-remove
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildBanModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildBanAdd | GatewayDispatchEvents.GuildBanRemove,
|
||||
@@ -330,11 +380,19 @@ export type GatewayGuildBanModifyDispatch = DataPayload<
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildBanAddDispatch = GatewayGuildBanModifyDispatch;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-emojis-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildEmojisUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildEmojisUpdate,
|
||||
@@ -346,6 +404,7 @@ export type GatewayGuildEmojisUpdateDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-integrations-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildIntegrationsUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildIntegrationsUpdate,
|
||||
@@ -354,6 +413,7 @@ export type GatewayGuildIntegrationsUpdateDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-add
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMemberAddDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildMemberAdd,
|
||||
@@ -362,6 +422,7 @@ export type GatewayGuildMemberAddDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-remove
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMemberRemoveDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildMemberRemove,
|
||||
@@ -373,6 +434,7 @@ export type GatewayGuildMemberRemoveDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildMemberUpdate,
|
||||
@@ -383,6 +445,7 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-members-chunk
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMembersChunkDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildMembersChunk,
|
||||
@@ -400,6 +463,7 @@ export type GatewayGuildMembersChunkDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildRoleCreate | GatewayDispatchEvents.GuildRoleUpdate,
|
||||
@@ -409,11 +473,19 @@ export type GatewayGuildRoleModifyDispatch = DataPayload<
|
||||
}
|
||||
>;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleCreateDispatch = GatewayGuildRoleModifyDispatch;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-delete
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.GuildRoleDelete,
|
||||
@@ -425,6 +497,7 @@ export type GatewayGuildRoleDeleteDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-create
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayInviteCreateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.InviteCreate,
|
||||
@@ -445,6 +518,7 @@ export type GatewayInviteCreateDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-delete
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayInviteDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.InviteDelete,
|
||||
@@ -457,11 +531,13 @@ export type GatewayInviteDeleteDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-create
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageCreateDispatch = DataPayload<GatewayDispatchEvents.MessageCreate, APIMessage>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageUpdate,
|
||||
@@ -470,6 +546,7 @@ export type GatewayMessageUpdateDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageDeleteDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageDelete,
|
||||
@@ -482,6 +559,7 @@ export type GatewayMessageDeleteDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete-bulk
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageDeleteBulkDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageDeleteBulk,
|
||||
@@ -494,16 +572,19 @@ export type GatewayMessageDeleteBulkDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-add
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatch = ReactionData<GatewayDispatchEvents.MessageReactionAdd>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveAllDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionRemoveAll,
|
||||
@@ -512,6 +593,7 @@ export type GatewayMessageReactionRemoveAllDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageReactionRemoveEmoji,
|
||||
@@ -522,11 +604,13 @@ export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#presence-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayPresenceUpdateDispatch = DataPayload<GatewayDispatchEvents.PresenceUpdate, RawGatewayPresenceUpdate>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#typing-start
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayTypingStartDispatch = DataPayload<
|
||||
GatewayDispatchEvents.TypingStart,
|
||||
@@ -541,16 +625,19 @@ export type GatewayTypingStartDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#user-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUpdate, APIUser>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-state-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayVoiceStateUpdateDispatch = DataPayload<GatewayDispatchEvents.VoiceStateUpdate, GatewayVoiceState>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-server-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayVoiceServerUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.VoiceServerUpdate,
|
||||
@@ -563,6 +650,7 @@ export type GatewayVoiceServerUpdateDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#webhooks-update
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayWebhooksUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.WebhooksUpdate,
|
||||
@@ -578,6 +666,7 @@ export type GatewayWebhooksUpdateDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHeartbeat {
|
||||
op: GatewayOPCodes.Heartbeat;
|
||||
@@ -586,15 +675,17 @@ export interface GatewayHeartbeat {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayIdentifyProperties {
|
||||
$os: string;
|
||||
$browser: string;
|
||||
device: string;
|
||||
$device: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#identify
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayIdentify {
|
||||
op: GatewayOPCodes.Identify;
|
||||
@@ -613,6 +704,7 @@ export interface GatewayIdentify {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#resume
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayResume {
|
||||
op: GatewayOPCodes.Resume;
|
||||
@@ -625,6 +717,7 @@ export interface GatewayResume {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#request-guild-members
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayRequestGuildMembers {
|
||||
op: GatewayOPCodes.RequestGuildMembers;
|
||||
@@ -640,6 +733,7 @@ export interface GatewayRequestGuildMembers {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-voice-state
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayVoiceStateUpdate {
|
||||
op: GatewayOPCodes.VoiceStateUpdate;
|
||||
@@ -653,6 +747,7 @@ export interface GatewayVoiceStateUpdate {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-status
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayUpdatePresence {
|
||||
op: GatewayOPCodes.PresenceUpdate;
|
||||
@@ -661,6 +756,7 @@ export interface GatewayUpdatePresence {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-status-gateway-status-update-structure
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayPresenceUpdateData {
|
||||
since: number | null;
|
||||
@@ -672,6 +768,9 @@ export interface GatewayPresenceUpdateData {
|
||||
// #endregion Sendable Payloads
|
||||
|
||||
// #region Shared
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
interface BasePayload {
|
||||
op: GatewayOPCodes;
|
||||
s: number;
|
||||
@@ -679,14 +778,23 @@ interface BasePayload {
|
||||
t?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
type NonDispatchPayload = Omit<BasePayload, 't'>;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
interface DataPayload<Event extends GatewayDispatchEvents, D = unknown> extends BasePayload {
|
||||
op: GatewayOPCodes.Dispatch;
|
||||
t: Event;
|
||||
d: D;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = DataPayload<
|
||||
E,
|
||||
Omit<
|
||||
@@ -702,6 +810,9 @@ type ReactionData<E extends GatewayDispatchEvents, O extends string = never> = D
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
interface MessageReactionRemoveData {
|
||||
channel_id: string;
|
||||
message_id: string;
|
||||
1554
gateway/v8.ts
Normal file
1554
gateway/v8.ts
Normal file
File diff suppressed because it is too large
Load Diff
70
globals.ts
Normal file
70
globals.ts
Normal file
@@ -0,0 +1,70 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#snowflakes
|
||||
*/
|
||||
export type Snowflake = `${bigint}`;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions
|
||||
* @internal
|
||||
*/
|
||||
export type Permissions = `${bigint}`;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#message-formatting-formats
|
||||
*/
|
||||
export const FormattingPatterns = {
|
||||
/**
|
||||
* Regular expression for matching a user mention, strictly without a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
User: /<@(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a user mention, strictly with a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
UserWithNickname: /<@!(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a user mention, with or without a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
UserWithOptionalNickname: /<@!?(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a channel mention
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
Channel: /<#(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a role mention
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
Role: /<@&(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a custom emoji, either static or animated
|
||||
*
|
||||
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
Emoji: /<(?<animated>a)?:(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching strictly an animated custom emoji
|
||||
*
|
||||
* The `animated`, `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
AnimatedEmoji: /<(?<animated>a):(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching strictly a static custom emoji
|
||||
*
|
||||
* The `name` and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
StaticEmoji: /<:(?<name>\w{2,32}):(?<id>\d{17,20})>/,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Freezes the formatting patterns
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(FormattingPatterns);
|
||||
12219
package-lock.json
generated
12219
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
283
package.json
283
package.json
@@ -1,94 +1,193 @@
|
||||
{
|
||||
"name": "discord-api-types",
|
||||
"version": "0.4.1",
|
||||
"description": "Discord API typings that are kept up to date for use in bot library creation.",
|
||||
"main": "default/index.js",
|
||||
"scripts": {
|
||||
"prepublishOnly": "npm run clean && npm run test:lint && npm run build",
|
||||
"build": "tsc",
|
||||
"test:lint": "eslint --ext ts {v*,default,common}/**",
|
||||
"lint": "eslint --fix --ext ts {v*,default,common}/**",
|
||||
"clean": "npx rimraf {v*,default,common}/**/*.{js,d.ts,map}"
|
||||
},
|
||||
"keywords": [
|
||||
"discord",
|
||||
"discord api",
|
||||
"types",
|
||||
"discordjs"
|
||||
],
|
||||
"author": "Vlad Frangu <kingdgrizzle@gmail.com>",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"v*/*",
|
||||
"default/*",
|
||||
"common/*",
|
||||
"!**/*.ts",
|
||||
"**/*.d.ts"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^9.1.2",
|
||||
"@commitlint/config-angular": "^9.1.2",
|
||||
"@typescript-eslint/eslint-plugin": "^4.1.0",
|
||||
"@typescript-eslint/parser": "^4.1.0",
|
||||
"eslint": "^7.8.1",
|
||||
"eslint-config-marine": "^7.2.0",
|
||||
"eslint-config-prettier": "^6.11.0",
|
||||
"eslint-plugin-prettier": "^3.1.4",
|
||||
"husky": "^4.3.0",
|
||||
"lint-staged": "^10.3.0",
|
||||
"prettier": "^2.1.1",
|
||||
"typescript": "^4.0.2"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/discordjs/discord-api-types"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "marine/prettier/node",
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.json"
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/naming-convention": 0
|
||||
}
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "lint-staged",
|
||||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.js": "eslint --fix",
|
||||
"*.ts": "eslint --fix --ext ts"
|
||||
},
|
||||
"commitlint": {
|
||||
"extends": [
|
||||
"@commitlint/config-angular"
|
||||
],
|
||||
"rules": {
|
||||
"type-enum": [
|
||||
2,
|
||||
"always",
|
||||
[
|
||||
"chore",
|
||||
"build",
|
||||
"ci",
|
||||
"docs",
|
||||
"feat",
|
||||
"fix",
|
||||
"perf",
|
||||
"refactor",
|
||||
"revert",
|
||||
"style",
|
||||
"test",
|
||||
"types",
|
||||
"wip"
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
"name": "discord-api-types",
|
||||
"version": "0.14.0",
|
||||
"description": "Discord API typings that are kept up to date for use in bot library creation.",
|
||||
"main": "./shortcuts/v8.js",
|
||||
"module": "./shortcuts/v8.mjs",
|
||||
"types": "./shortcuts/v8.d.ts",
|
||||
"exports": {
|
||||
"./globals": {
|
||||
"require": "./globals.js",
|
||||
"import": "./globals.mjs"
|
||||
},
|
||||
"./v6": {
|
||||
"require": "./shortcuts/v6.js",
|
||||
"import": "./shortcuts/v6.mjs"
|
||||
},
|
||||
"./v8": {
|
||||
"require": "./shortcuts/v8.js",
|
||||
"import": "./shortcuts/v8.mjs"
|
||||
},
|
||||
"./gateway": {
|
||||
"require": "./gateway/index.js",
|
||||
"import": "./gateway/index.mjs"
|
||||
},
|
||||
"./gateway/v*": {
|
||||
"require": "./gateway/v*.js",
|
||||
"import": "./gateway/v*.mjs"
|
||||
},
|
||||
"./payloads": {
|
||||
"require": "./payloads/index.js",
|
||||
"import": "./payloads/index.mjs"
|
||||
},
|
||||
"./payloads/v*": {
|
||||
"require": "./payloads/v*/index.js",
|
||||
"import": "./payloads/v*/index.mjs"
|
||||
},
|
||||
"./rest": {
|
||||
"require": "./rest/index.js",
|
||||
"import": "./rest/index.mjs"
|
||||
},
|
||||
"./rest/v*": {
|
||||
"require": "./rest/v*/index.js",
|
||||
"import": "./rest/v*/index.mjs"
|
||||
},
|
||||
"./rpc": {
|
||||
"require": "./rpc/index.js",
|
||||
"import": "./rpc/index.mjs"
|
||||
},
|
||||
"./rpc/v*": {
|
||||
"require": "./rpc/v*.js",
|
||||
"import": "./rpc/v*.mjs"
|
||||
},
|
||||
"./voice": {
|
||||
"require": "./voice/index.js",
|
||||
"import": "./voice/index.mjs"
|
||||
},
|
||||
"./voice/v*": {
|
||||
"require": "./voice/v*.js",
|
||||
"import": "./voice/v*.mjs"
|
||||
},
|
||||
"./utils": {
|
||||
"require": "./utils/index.js",
|
||||
"import": "./utils/index.mjs"
|
||||
},
|
||||
"./utils/v*": {
|
||||
"require": "./utils/v*.js",
|
||||
"import": "./utils/v*.mjs"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build:ci": "tsc --noEmit --incremental false",
|
||||
"build:deno": "node ./scripts/deno.mjs",
|
||||
"build:node": "tsc && run-p esm:*",
|
||||
"clean:deno": "rimraf deno/",
|
||||
"clean:node": "rimraf {gateway,payloads,rest,rpc,voice,shortcuts,utils}/**/*.{js,mjs,d.ts,map} globals.{js,mjs,d.ts,*map}",
|
||||
"clean": "run-p clean:*",
|
||||
"esm:gateway": "gen-esm-wrapper ./gateway/index.js ./gateway/index.mjs",
|
||||
"esm:payloads": "gen-esm-wrapper ./payloads/index.js ./payloads/index.mjs",
|
||||
"esm:rest": "gen-esm-wrapper ./rest/index.js ./rest/index.mjs",
|
||||
"esm:rpc": "gen-esm-wrapper ./rpc/index.js ./rpc/index.mjs",
|
||||
"esm:utils": "gen-esm-wrapper ./utils/index.js ./utils/index.mjs",
|
||||
"esm:voice": "gen-esm-wrapper ./voice/index.js ./voice/index.mjs",
|
||||
"esm:globals": "gen-esm-wrapper ./globals.js ./globals.mjs",
|
||||
"esm:versions": "node ./scripts/versions.mjs",
|
||||
"lint": "eslint --fix --ext mjs,ts {gateway,payloads,rest,rpc,voice,shortcuts,utils}/** globals.ts",
|
||||
"test:lint": "eslint --ext mjs,ts {gateway,payloads,rest,rpc,voice,shortcuts,utils}/** globals.ts",
|
||||
"prepublishOnly": "run-s clean test:lint build:node",
|
||||
"postpublish": "run-s clean:node build:deno",
|
||||
"version": "conventional-changelog -p angular -i CHANGELOG.md -s && git add CHANGELOG.md"
|
||||
},
|
||||
"keywords": [
|
||||
"discord",
|
||||
"discord api",
|
||||
"types",
|
||||
"discordjs"
|
||||
],
|
||||
"author": "Vlad Frangu <kingdgrizzle@gmail.com>",
|
||||
"license": "MIT",
|
||||
"files": [
|
||||
"{gateway,payloads,rest,rpc,voice,shortcuts,utils}/**/*.{js,js.map,d.ts,d.ts.map,mjs}",
|
||||
"globals.{js,js.map,d.ts,d.ts.map,mjs}"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^12.1.1",
|
||||
"@commitlint/config-angular": "^12.1.1",
|
||||
"@types/node": "^14.14.37",
|
||||
"@typescript-eslint/eslint-plugin": "^4.21.0",
|
||||
"@typescript-eslint/parser": "^4.21.0",
|
||||
"conventional-changelog-cli": "^2.1.1",
|
||||
"eslint": "^7.24.0",
|
||||
"eslint-config-marine": "^8.3.2",
|
||||
"eslint-config-prettier": "^8.1.0",
|
||||
"eslint-plugin-prettier": "^3.3.1",
|
||||
"gen-esm-wrapper": "^1.1.1",
|
||||
"husky": "^4.3.8",
|
||||
"lint-staged": "^10.5.4",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"prettier": "^2.2.1",
|
||||
"pretty-quick": "^3.1.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.2.4"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/discordjs/discord-api-types"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "marine/prettier/node",
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.eslint.json",
|
||||
"extraFileExtensions": [
|
||||
".mjs"
|
||||
]
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/naming-convention": 0
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": [
|
||||
"scripts/**/*.mjs"
|
||||
],
|
||||
"parserOptions": {
|
||||
"sourceType": "module"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"husky": {
|
||||
"hooks": {
|
||||
"pre-commit": "pretty-quick --staged && lint-staged && npm run build:deno && git add deno",
|
||||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
||||
}
|
||||
},
|
||||
"lint-staged": {
|
||||
"{gateway,payloads,rest,rpc,voice,shortcuts,utils}/**/*.{mjs,js,ts}": "eslint --fix --ext mjs,js,ts",
|
||||
"globals.ts": "eslint --fix --ext mjs,js,ts"
|
||||
},
|
||||
"commitlint": {
|
||||
"extends": [
|
||||
"@commitlint/config-angular"
|
||||
],
|
||||
"rules": {
|
||||
"type-enum": [
|
||||
2,
|
||||
"always",
|
||||
[
|
||||
"chore",
|
||||
"build",
|
||||
"ci",
|
||||
"docs",
|
||||
"feat",
|
||||
"fix",
|
||||
"perf",
|
||||
"refactor",
|
||||
"revert",
|
||||
"style",
|
||||
"test",
|
||||
"types",
|
||||
"wip"
|
||||
]
|
||||
],
|
||||
"scope-case": [
|
||||
1,
|
||||
"always",
|
||||
"pascal-case"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
4
payloads/index.ts
Normal file
4
payloads/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
// This file exports all the payloads available in the recommended API version
|
||||
// Thereby, things MAY break in the future. Try sticking to imports from a specific version
|
||||
|
||||
export * from './v8/index';
|
||||
547
payloads/v6/auditLog.ts
Normal file
547
payloads/v6/auditLog.ts
Normal file
@@ -0,0 +1,547 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/audit-log
|
||||
*/
|
||||
|
||||
import type { APIOverwrite, ChannelType } from './channel';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildMFALevel,
|
||||
GuildVerificationLevel,
|
||||
IntegrationExpireBehavior,
|
||||
} from './guild';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APIUser } from './user';
|
||||
import type { APIWebhook } from './webhook';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIAuditLog {
|
||||
webhooks: APIWebhook[];
|
||||
users: APIUser[];
|
||||
audit_log_entries: APIAuditLogEntry[];
|
||||
integrations: APIGuildIntegration[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIAuditLogEntry {
|
||||
target_id: string | null;
|
||||
changes?: APIAuditLogChange[];
|
||||
user_id: string | null;
|
||||
id: string;
|
||||
action_type: AuditLogEvent;
|
||||
options?: APIAuditLogOptions;
|
||||
reason?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-events
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum AuditLogEvent {
|
||||
GUILD_UPDATE = 1,
|
||||
|
||||
CHANNEL_CREATE = 10,
|
||||
CHANNEL_UPDATE,
|
||||
CHANNEL_DELETE,
|
||||
CHANNEL_OVERWRITE_CREATE,
|
||||
CHANNEL_OVERWRITE_UPDATE,
|
||||
CHANNEL_OVERWRITE_DELETE,
|
||||
|
||||
MEMBER_KICK = 20,
|
||||
MEMBER_PRUNE,
|
||||
MEMBER_BAN_ADD,
|
||||
MEMBER_BAN_REMOVE,
|
||||
MEMBER_UPDATE,
|
||||
MEMBER_ROLE_UPDATE,
|
||||
MEMBER_MOVE,
|
||||
MEMBER_DISCONNECT,
|
||||
BOT_ADD,
|
||||
|
||||
ROLE_CREATE = 30,
|
||||
ROLE_UPDATE,
|
||||
ROLE_DELETE,
|
||||
|
||||
INVITE_CREATE = 40,
|
||||
INVITE_UPDATE,
|
||||
INVITE_DELETE,
|
||||
|
||||
WEBHOOK_CREATE = 50,
|
||||
WEBHOOK_UPDATE,
|
||||
WEBHOOK_DELETE,
|
||||
|
||||
EMOJI_CREATE = 60,
|
||||
EMOJI_UPDATE,
|
||||
EMOJI_DELETE,
|
||||
|
||||
MESSAGE_DELETE = 72,
|
||||
MESSAGE_BULK_DELETE,
|
||||
MESSAGE_PIN,
|
||||
MESSAGE_UNPIN,
|
||||
|
||||
INTEGRATION_CREATE = 80,
|
||||
INTEGRATION_UPDATE,
|
||||
INTEGRATION_DELETE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIAuditLogOptions {
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
delete_member_days?: string;
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
members_removed?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - MEMBER_MOVE
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
* - MESSAGE_DELETE
|
||||
*/
|
||||
channel_id?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
*/
|
||||
message_id?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - MESSAGE_DELETE
|
||||
* - MESSAGE_BULK_DELETE
|
||||
* - MEMBER_DISCONNECT
|
||||
* - MEMBER_MOVE
|
||||
*/
|
||||
count?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*/
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*/
|
||||
type: AuditLogOptionsType;
|
||||
|
||||
/**
|
||||
* Present from:
|
||||
* - CHANNEL_OVERWRITE_CREATE
|
||||
* - CHANNEL_OVERWRITE_UPDATE
|
||||
* - CHANNEL_OVERWRITE_DELETE
|
||||
*
|
||||
* **Present only if the {@link APIAuditLogOptions#type entry type} is "role"**
|
||||
*/
|
||||
role_name?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum AuditLogOptionsType {
|
||||
Member = 'member',
|
||||
Role = 'role',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
|
||||
* @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
|
||||
| APIAuditLogChangeKeyAllow
|
||||
| APIAuditLogChangeKeyAllowNew
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDenyNew
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyChannelID
|
||||
| APIAuditLogChangeKeyInviterID
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyID
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyEnableEmoticons
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod;
|
||||
|
||||
/**
|
||||
* Returned when a guild's name is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyName = AuditLogChangeData<'name', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's icon is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyIconHash = AuditLogChangeData<'icon_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's splash is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeySplashHash = AuditLogChangeData<'splash_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's owner ID is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyOwnerID = AuditLogChangeData<'owner_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's region is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyRegion = AuditLogChangeData<'region', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's afk_channel_id is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAFKChannelID = AuditLogChangeData<'afk_channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's afk_timeout is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAFKTimeout = AuditLogChangeData<'afk_timeout', number>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's mfa_level is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMFALevel = AuditLogChangeData<'mfa_level', GuildMFALevel>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's verification_level is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyVerificationLevel = AuditLogChangeData<'verification_level', GuildVerificationLevel>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's explicit_content_filter is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExplicitContentFilter = AuditLogChangeData<
|
||||
'explicit_content_filter',
|
||||
GuildExplicitContentFilter
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's default_message_notifications is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultMessageNotifications = AuditLogChangeData<
|
||||
'default_message_notifications',
|
||||
GuildDefaultMessageNotifications
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's vanity_url_code is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyVanityURLCode = AuditLogChangeData<'vanity_url_code', string>;
|
||||
|
||||
/**
|
||||
* Returned when new role(s) are added
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Add = AuditLogChangeData<'$add', APIRole[]>;
|
||||
|
||||
/**
|
||||
* Returned when role(s) are removed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Remove = AuditLogChangeData<'$remove', APIRole[]>;
|
||||
|
||||
/**
|
||||
* Returned when there is a change in number of days after which inactive and role-unassigned members are kicked
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPruneDeleteDays = AuditLogChangeData<'prune_delete_days', number>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's widget is enabled
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyWidgetEnabled = AuditLogChangeData<'widget_enabled', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's widget_channel_id is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyWidgetChannelID = AuditLogChangeData<'widget_channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's system_channel_id is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeySystemChannelID = AuditLogChangeData<'system_channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's position is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPosition = AuditLogChangeData<'position', number>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's topic is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTopic = AuditLogChangeData<'topic', string>;
|
||||
|
||||
/**
|
||||
* Returned when a voice channel's bitrate is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyBitrate = AuditLogChangeData<'bitrate', number>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's permission overwrites is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPermissionOverwrites = AuditLogChangeData<'permission_overwrites', APIOverwrite[]>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's NSFW restriction is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyNSFW = AuditLogChangeData<'nsfw', boolean>;
|
||||
|
||||
/**
|
||||
* The application ID of the added or removed Webhook or Bot
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyApplicationID = AuditLogChangeData<'application_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's amount of seconds a user has to wait before sending another message
|
||||
* is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyRateLimitPerUser = AuditLogChangeData<'rate_limit_per_user', number>;
|
||||
|
||||
/**
|
||||
* Returned when a permission bitfield is changed
|
||||
* @deprecated Use `permissions_new` instead
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPermissions = AuditLogChangeData<'permissions', number>;
|
||||
|
||||
/**
|
||||
* Returned when a permission bitfield is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPermissionsNew = AuditLogChangeData<'permissions_new', string>;
|
||||
|
||||
/**
|
||||
* Returned when a role's color is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyColor = AuditLogChangeData<'color', number>;
|
||||
|
||||
/**
|
||||
* Returned when a role's hoist status is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyHoist = AuditLogChangeData<'hoist', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a role's mentionable status is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMentionable = AuditLogChangeData<'mentionable', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's allowed permissions bitfield is changed
|
||||
* @deprecated Use `allow_new` instead
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAllow = AuditLogChangeData<'allow', number>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's allowed permissions bitfield is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAllowNew = AuditLogChangeData<'allow_new', string>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's denied permissions bitfield is changed
|
||||
* @deprecated Use `deny_new` instead
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDeny = AuditLogChangeData<'deny', number>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's denied permissions bitfield is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDenyNew = AuditLogChangeData<'deny_new', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's code is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyCode = AuditLogChangeData<'code', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's channel_id is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyChannelID = AuditLogChangeData<'channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's inviter_id is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyInviterID = AuditLogChangeData<'inviter_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's max_uses is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMaxUses = AuditLogChangeData<'max_uses', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's uses is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyUses = AuditLogChangeData<'uses', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's max_age is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMaxAge = AuditLogChangeData<'max_age', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's temporary status is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTemporary = AuditLogChangeData<'temporary', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's deaf status is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDeaf = AuditLogChangeData<'deaf', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's mute status is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMute = AuditLogChangeData<'mute', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's nick is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyNick = AuditLogChangeData<'mute', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's avatar_hash is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvatarHash = AuditLogChangeData<'avatar_hash', string>;
|
||||
|
||||
/**
|
||||
* The ID of the changed entity - sometimes used in conjunction with other keys
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIAuditLogChangeKeyID {
|
||||
key: 'id';
|
||||
new_value: string;
|
||||
old_value?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* The type of entity created
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyType = AuditLogChangeData<'type', ChannelType | string>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's enable_emoticons is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEnableEmoticons = AuditLogChangeData<'enable_emoticons', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's expire_behavior is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExpireBehavior = AuditLogChangeData<'expire_behavior', IntegrationExpireBehavior>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's expire_grace_period is changed
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_grace_period', number>;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
interface AuditLogChangeData<K extends string, D extends unknown> {
|
||||
key: K;
|
||||
new_value?: D;
|
||||
old_value?: D;
|
||||
}
|
||||
@@ -8,6 +8,7 @@ import type { APIUser } from './user';
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIPartialChannel {
|
||||
id: string;
|
||||
@@ -17,10 +18,11 @@ export interface APIPartialChannel {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIChannel extends APIPartialChannel {
|
||||
guild_id?: string;
|
||||
position: number;
|
||||
position?: number;
|
||||
permission_overwrites?: APIOverwrite[];
|
||||
name?: string;
|
||||
topic?: string | null;
|
||||
@@ -39,6 +41,7 @@ export interface APIChannel extends APIPartialChannel {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum ChannelType {
|
||||
GUILD_TEXT = 0,
|
||||
@@ -52,6 +55,7 @@ export enum ChannelType {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIMessage {
|
||||
id: string;
|
||||
@@ -78,13 +82,15 @@ export interface APIMessage {
|
||||
application?: APIMessageApplication;
|
||||
message_reference?: APIMessageReference;
|
||||
flags?: MessageFlags;
|
||||
referenced_message?: APIMessage | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-types
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum MessageType {
|
||||
DEFAULT = 0,
|
||||
DEFAULT,
|
||||
RECIPIENT_ADD,
|
||||
RECIPIENT_REMOVE,
|
||||
CALL,
|
||||
@@ -105,6 +111,7 @@ export enum MessageType {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIMessageActivity {
|
||||
type: MessageActivityType;
|
||||
@@ -113,6 +120,7 @@ export interface APIMessageActivity {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIMessageApplication {
|
||||
id: string;
|
||||
@@ -124,6 +132,7 @@ export interface APIMessageApplication {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
message_id?: string;
|
||||
@@ -133,6 +142,7 @@ export interface APIMessageReference {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum MessageActivityType {
|
||||
JOIN = 1,
|
||||
@@ -143,6 +153,7 @@ export enum MessageActivityType {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum MessageFlags {
|
||||
CROSSPOSTED = 1 << 0,
|
||||
@@ -154,6 +165,7 @@ export enum MessageFlags {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIReaction {
|
||||
count: number;
|
||||
@@ -163,6 +175,7 @@ export interface APIReaction {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIOverwrite {
|
||||
id: string;
|
||||
@@ -179,6 +192,9 @@ export interface APIOverwrite {
|
||||
deny_new: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum OverwriteType {
|
||||
Member = 'member',
|
||||
Role = 'role',
|
||||
@@ -186,6 +202,7 @@ export enum OverwriteType {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbed {
|
||||
title?: string;
|
||||
@@ -209,6 +226,7 @@ export interface APIEmbed {
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-types
|
||||
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum EmbedType {
|
||||
Rich = 'rich',
|
||||
@@ -221,6 +239,7 @@ export enum EmbedType {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedThumbnail {
|
||||
url?: string;
|
||||
@@ -231,6 +250,7 @@ export interface APIEmbedThumbnail {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedVideo {
|
||||
url?: string;
|
||||
@@ -240,6 +260,7 @@ export interface APIEmbedVideo {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedImage {
|
||||
url?: string;
|
||||
@@ -250,6 +271,7 @@ export interface APIEmbedImage {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedProvider {
|
||||
name?: string;
|
||||
@@ -258,6 +280,7 @@ export interface APIEmbedProvider {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedAuthor {
|
||||
name?: string;
|
||||
@@ -268,6 +291,7 @@ export interface APIEmbedAuthor {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedFooter {
|
||||
text: string;
|
||||
@@ -277,6 +301,7 @@ export interface APIEmbedFooter {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmbedField {
|
||||
name: string;
|
||||
@@ -286,6 +311,7 @@ export interface APIEmbedField {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIAttachment {
|
||||
id: string;
|
||||
@@ -299,6 +325,7 @@ export interface APIAttachment {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-mention-object-channel-mention-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIChannelMention {
|
||||
id: string;
|
||||
@@ -307,6 +334,9 @@ export interface APIChannelMention {
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIFollowedChannel {
|
||||
channel_id: string;
|
||||
webhook_id: string;
|
||||
@@ -6,6 +6,7 @@ import type { APIUser } from './user';
|
||||
|
||||
/**
|
||||
* Not documented but mentioned
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIPartialEmoji {
|
||||
id: string | null;
|
||||
@@ -15,6 +16,7 @@ export interface APIPartialEmoji {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/emoji#emoji-object-emoji-structure
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIEmoji extends APIPartialEmoji {
|
||||
roles?: string[];
|
||||
@@ -7,6 +7,7 @@ import type { APIUser } from './user';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGatewayInfo {
|
||||
url: string;
|
||||
@@ -14,6 +15,7 @@ export interface APIGatewayInfo {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway-bot
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGatewayBotInfo extends APIGatewayInfo {
|
||||
shards: number;
|
||||
@@ -22,6 +24,7 @@ export interface APIGatewayBotInfo extends APIGatewayInfo {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#session-start-limit-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface APIGatewaySessionStartLimit {
|
||||
total: number;
|
||||
@@ -31,6 +34,7 @@ export interface APIGatewaySessionStartLimit {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#presence-update-presence-update-event-fields
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayPresenceUpdate {
|
||||
user: Partial<APIUser> & {
|
||||
@@ -46,6 +50,9 @@ export interface GatewayPresenceUpdate {
|
||||
nick?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated API v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum PresenceUpdateStatus {
|
||||
DoNotDisturb = 'dnd',
|
||||
Idle = 'idle',
|
||||
@@ -56,11 +63,13 @@ export enum PresenceUpdateStatus {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#client-status-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayPresenceClientStatus = Partial<Record<'desktop' | 'mobile' | 'web', PresenceUpdateStatus>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayActivity {
|
||||
name: string;
|
||||
@@ -81,6 +90,7 @@ export interface GatewayActivity {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-types
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum ActivityType {
|
||||
Game,
|
||||
@@ -93,6 +103,7 @@ export enum ActivityType {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-timestamps
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayActivityTimestamps {
|
||||
start?: number;
|
||||
@@ -101,11 +112,13 @@ export interface GatewayActivityTimestamps {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-emoji
|
||||
* @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'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-party
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayActivityParty {
|
||||
id?: string;
|
||||
@@ -115,6 +128,7 @@ export interface GatewayActivityParty {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-assets
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayActivityAssets = Partial<
|
||||
Record<'large_image' | 'large_text' | 'small_image' | 'small_text', string>
|
||||
@@ -122,11 +136,13 @@ export type GatewayActivityAssets = Partial<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-secrets
|
||||
* @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>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#activity-object-activity-flags
|
||||
* @deprecated API and Gateway v6 are deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum ActivityFlags {
|
||||
INSTANCE = 1 << 0,
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user