mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-21 10:50:08 +00:00
Compare commits
500 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ba4ee01f79 | ||
|
|
e389a2189a | ||
|
|
77585d1ffa | ||
|
|
4a25caf506 | ||
|
|
6e4a6115ae | ||
|
|
921bffd1b2 | ||
|
|
bb2ef84313 | ||
|
|
5e9bff9d0e | ||
|
|
4c334f6eb8 | ||
|
|
93667b9a9e | ||
|
|
8df9f14a24 | ||
|
|
c2bec62a8e | ||
|
|
190242a59d | ||
|
|
2b75d13b39 | ||
|
|
89bc0f40b6 | ||
|
|
2a5413def4 | ||
|
|
d7b666c739 | ||
|
|
c3fda99637 | ||
|
|
57a69a1301 | ||
|
|
e818213043 | ||
|
|
40ec4363bb | ||
|
|
190223f1f9 | ||
|
|
995126e2cc | ||
|
|
549d1daaa0 | ||
|
|
38aad33ed8 | ||
|
|
390c628ee3 | ||
|
|
c730f1a8d1 | ||
|
|
33e0f3f411 | ||
|
|
3713a553e9 | ||
|
|
b03b1fb0cd | ||
|
|
0aa384ca9a | ||
|
|
2695dade8b | ||
|
|
9d72e82e07 | ||
|
|
f91e10f830 | ||
|
|
a1869a6a6d | ||
|
|
5aa4c28635 | ||
|
|
65da837673 | ||
|
|
5e854245e1 | ||
|
|
67ecd76d3e | ||
|
|
88a60f78ef | ||
|
|
0858b7c70a | ||
|
|
cf80b2fa6b | ||
|
|
7040d9b333 | ||
|
|
5091f6e707 | ||
|
|
69aa717902 | ||
|
|
c15106b424 | ||
|
|
a1ab25db1f | ||
|
|
9448e9befd | ||
|
|
348dd416d1 | ||
|
|
aaa57b4fe9 | ||
|
|
88ce2910fb | ||
|
|
131637fbd2 | ||
|
|
8c1484ebbe | ||
|
|
8d25f233a5 | ||
|
|
df1452dc28 | ||
|
|
5053ac30d9 | ||
|
|
91a7762b5d | ||
|
|
f311574d1f | ||
|
|
e082afb93f | ||
|
|
bce07950fd | ||
|
|
70826ed76e | ||
|
|
9978b77ef2 | ||
|
|
3696ce7805 | ||
|
|
b216f7a8be | ||
|
|
05cfe1bf96 | ||
|
|
5ffb2d3586 | ||
|
|
f62f2506b0 | ||
|
|
2876125975 | ||
|
|
143b003fbe | ||
|
|
0f118d382f | ||
|
|
2dc3fd0a15 | ||
|
|
d452f6346b | ||
|
|
32f5a7b981 | ||
|
|
f4d3f4d5b1 | ||
|
|
5c7e58284e | ||
|
|
afd3b55c08 | ||
|
|
4fbe1180fc | ||
|
|
2708cb9dca | ||
|
|
a59998ad1c | ||
|
|
b08f2e34db | ||
|
|
a1100a1910 | ||
|
|
815c68fe46 | ||
|
|
04b3a7f066 | ||
|
|
b7b855b200 | ||
|
|
4e362d5260 | ||
|
|
48f0f562ba | ||
|
|
817884184b | ||
|
|
73d15ddcbb | ||
|
|
f69b586d01 | ||
|
|
1a6884423c | ||
|
|
0098889499 | ||
|
|
bd8765d666 | ||
|
|
96b4bc504d | ||
|
|
35b17dcbf8 | ||
|
|
956f289e88 | ||
|
|
ef8241fe88 | ||
|
|
248484e556 | ||
|
|
1fe707c00e | ||
|
|
5bb50ae7ea | ||
|
|
0fab79feda | ||
|
|
4732f1abbe | ||
|
|
796f6d8a3b | ||
|
|
4488d8fd26 | ||
|
|
9a50367dad | ||
|
|
dc3d5df0a2 | ||
|
|
0e03e39aa2 | ||
|
|
f8a9c8b5c6 | ||
|
|
3eb239ce0c | ||
|
|
48016e5115 | ||
|
|
a08e82f097 | ||
|
|
1def1010ca | ||
|
|
af8e7c7a5b | ||
|
|
cecf17b415 | ||
|
|
cb6d4bacc4 | ||
|
|
0a2e7787c6 | ||
|
|
65b672e2af | ||
|
|
2b53b20b84 | ||
|
|
907d88ada9 | ||
|
|
8465c5866c | ||
|
|
09a114133c | ||
|
|
4577ac2609 | ||
|
|
59e247729f | ||
|
|
e78de0c83b | ||
|
|
3644b70e2e | ||
|
|
4af2ea9141 | ||
|
|
f2c3451c2a | ||
|
|
d503c71252 | ||
|
|
e253a4ac87 | ||
|
|
84226e402a | ||
|
|
2e84efb9b8 | ||
|
|
df1527c4bb | ||
|
|
2cade98ed0 | ||
|
|
d3535d6db1 | ||
|
|
2f2d4ae3fa | ||
|
|
0c65d40af0 | ||
|
|
12072b70a0 | ||
|
|
34908aa4ce | ||
|
|
b2eeb3f27b | ||
|
|
fc3aa1c911 | ||
|
|
06098869d5 | ||
|
|
a2d76fc7ca | ||
|
|
56d491fa68 | ||
|
|
3b10c60faa | ||
|
|
c6e320bd22 | ||
|
|
f49546c780 | ||
|
|
63959ef2aa | ||
|
|
f72fbc93f6 | ||
|
|
d83dadca17 | ||
|
|
0bb2204b5d | ||
|
|
292c6b58ee | ||
|
|
63ca86afbd | ||
|
|
20653b3481 | ||
|
|
7bef64df76 | ||
|
|
6477c1e5d8 | ||
|
|
e957695400 | ||
|
|
d8543177cd | ||
|
|
cb663096a5 | ||
|
|
eff8892b03 | ||
|
|
d268e0bff7 | ||
|
|
7b1e5a70e5 | ||
|
|
8e5f07e2ee | ||
|
|
1c6ea86110 | ||
|
|
43c372d817 | ||
|
|
9f386cb874 | ||
|
|
019b9de1e8 | ||
|
|
6340f64fbc | ||
|
|
895083b8ab | ||
|
|
93eb3d3af6 | ||
|
|
7da033bc5b | ||
|
|
6a813be833 | ||
|
|
b3736d8012 | ||
|
|
15fcd1b2a8 | ||
|
|
51e664d8e8 | ||
|
|
db99388267 | ||
|
|
85802f1703 | ||
|
|
4083a32340 | ||
|
|
5108d3dcca | ||
|
|
6da0503a9f | ||
|
|
8a5fb2cdf2 | ||
|
|
5ef49f41ce | ||
|
|
6d85ad6b1d | ||
|
|
ca1110a1ae | ||
|
|
748db34e30 | ||
|
|
dc1c887821 | ||
|
|
a088bb4f77 | ||
|
|
f1cc0ab163 | ||
|
|
c8ba0c9319 | ||
|
|
927c738162 | ||
|
|
1afce87fbe | ||
|
|
a0ff4f3905 | ||
|
|
17f5caa671 | ||
|
|
d3163ca22e | ||
|
|
1737adea1f | ||
|
|
8f16f452ac | ||
|
|
c9c733d1c2 | ||
|
|
d331e0dff3 | ||
|
|
a28c824f82 | ||
|
|
43cfbcba28 | ||
|
|
b0a4f12391 | ||
|
|
3fe53ced9f | ||
|
|
1212eb933e | ||
|
|
1cd9b53ea8 | ||
|
|
4cbb5fa894 | ||
|
|
6a192b132c | ||
|
|
e4280853ae | ||
|
|
bf08484988 | ||
|
|
69079ee132 | ||
|
|
bc6e97f309 | ||
|
|
279bf67aa8 | ||
|
|
d703a6645a | ||
|
|
b1bf7bf0f9 | ||
|
|
fffd9f9088 | ||
|
|
6900b74865 | ||
|
|
f0ab4e8c48 | ||
|
|
9c12718163 | ||
|
|
25677fff43 | ||
|
|
6b0f662f0e | ||
|
|
b764e8dc1a | ||
|
|
93eab113cd | ||
|
|
c23f2accf9 | ||
|
|
feba5b743b | ||
|
|
ed0049b78f | ||
|
|
16a996d77d | ||
|
|
f173b18312 | ||
|
|
c9838220ce | ||
|
|
f532002574 | ||
|
|
f75c632565 | ||
|
|
dad9eea547 | ||
|
|
f702988112 | ||
|
|
e822e45b3b | ||
|
|
fa740eb16c | ||
|
|
8cb629befe | ||
|
|
b0443a02ec | ||
|
|
cb92843991 | ||
|
|
d06d2d6a9a | ||
|
|
854aa3691c | ||
|
|
e5710d0e42 | ||
|
|
9a578489ad | ||
|
|
10fdeaa68d | ||
|
|
fddff2167c | ||
|
|
e8127b89f8 | ||
|
|
ab2598441a | ||
|
|
95f3e175b1 | ||
|
|
a3b1006c87 | ||
|
|
dec7717bc7 | ||
|
|
e9ee6966c3 | ||
|
|
3503a4fd38 | ||
|
|
1eba8a3a34 | ||
|
|
3e3acb5297 | ||
|
|
a6aa5b3907 | ||
|
|
8d432f2ebe | ||
|
|
343359ecfc | ||
|
|
3b1acdf0ec | ||
|
|
d8a5f78f62 | ||
|
|
8e87b3e1ce | ||
|
|
5396daf0db | ||
|
|
a8f19e6a19 | ||
|
|
8ce0a231c7 | ||
|
|
0ad06fc639 | ||
|
|
9af4b4776b | ||
|
|
ed1f717679 | ||
|
|
5056da523a | ||
|
|
7abeb2e039 | ||
|
|
f88727bd80 | ||
|
|
72e9617fee | ||
|
|
d5d228e6c2 | ||
|
|
bf0f66b60a | ||
|
|
71c4e6aecd | ||
|
|
ee2b7cd920 | ||
|
|
269a75ccf7 | ||
|
|
87b9b0885a | ||
|
|
7e542152da | ||
|
|
c48aab3921 | ||
|
|
8e13cd80c6 | ||
|
|
70bab5d1b2 | ||
|
|
663c4e97fb | ||
|
|
9c2b185367 | ||
|
|
76588d9d38 | ||
|
|
80ed7ba1c1 | ||
|
|
56d39756c0 | ||
|
|
7655e20248 | ||
|
|
d95d9562dc | ||
|
|
4194bd9054 | ||
|
|
51fb37cbba | ||
|
|
310c68f034 | ||
|
|
2c1fbda621 | ||
|
|
08a8b28ee1 | ||
|
|
b07d5a0c22 | ||
|
|
03b8d3fee0 | ||
|
|
03f12d71ee | ||
|
|
83f29b6928 | ||
|
|
9a982ff8d9 | ||
|
|
5056b0f2b3 | ||
|
|
7ecf9b2c16 | ||
|
|
fe1f5313a8 | ||
|
|
0cf51abc26 | ||
|
|
751aee6fa7 | ||
|
|
9f4f59c8e5 | ||
|
|
cd580fa2c6 | ||
|
|
c20e5ae2a9 | ||
|
|
7fe78cec25 | ||
|
|
bfc5e46f53 | ||
|
|
8bbb81942b | ||
|
|
46db72da2f | ||
|
|
0bbc9721f6 | ||
|
|
7eee39d86c | ||
|
|
2c72242a03 | ||
|
|
7ab780b3ae | ||
|
|
315ce35849 | ||
|
|
c67d426e3d | ||
|
|
e9d02a19fc | ||
|
|
9e619fc460 | ||
|
|
b01716bf22 | ||
|
|
c7efcd5505 | ||
|
|
52c91f8f73 | ||
|
|
47382b6183 | ||
|
|
51dee6e0e5 | ||
|
|
3ff85eede4 | ||
|
|
44c0f05cb2 | ||
|
|
68d5c08c93 | ||
|
|
d333962715 | ||
|
|
f2d62e3cdf | ||
|
|
faa8bf494b | ||
|
|
7379a345e8 | ||
|
|
fa54b9de55 | ||
|
|
1e52e0ceab | ||
|
|
691abb581f | ||
|
|
7a15c97863 | ||
|
|
bc1d03e527 | ||
|
|
0f51d8e83f | ||
|
|
4021dae44b | ||
|
|
d189e36c49 | ||
|
|
a015f96fcb | ||
|
|
3b9320dbf2 | ||
|
|
fdf133ef45 | ||
|
|
7c36a6cdf3 | ||
|
|
a507765bba | ||
|
|
9dd3446b64 | ||
|
|
24f658de38 | ||
|
|
329451c6c9 | ||
|
|
7db69531d8 | ||
|
|
77396b557c | ||
|
|
0331518c49 | ||
|
|
64e4e5246c | ||
|
|
b453d75e4d | ||
|
|
1076822b90 | ||
|
|
0c592a0950 | ||
|
|
68d97aed14 | ||
|
|
a787426082 | ||
|
|
2aee879600 | ||
|
|
4bbe1eaa86 | ||
|
|
6f6e6daccd | ||
|
|
43cc755e33 | ||
|
|
21e1148f2d | ||
|
|
8b49887c7f | ||
|
|
d590caf359 | ||
|
|
ecbed18042 | ||
|
|
e628f0f6f0 | ||
|
|
0024823d05 | ||
|
|
64937e2311 | ||
|
|
f2e22869d0 | ||
|
|
b6babf2ee2 | ||
|
|
f2b58acbf8 | ||
|
|
b07b9030c1 | ||
|
|
fdc1c1a5b4 | ||
|
|
8fcd0f2222 | ||
|
|
5723cc04bf | ||
|
|
f93b6be252 | ||
|
|
b75b05f0d5 | ||
|
|
47100bcf2c | ||
|
|
a93235c9df | ||
|
|
b1589545e9 | ||
|
|
647905e16b | ||
|
|
f2995073e0 | ||
|
|
6f15e537df | ||
|
|
d338409410 | ||
|
|
ef2a0aeb07 | ||
|
|
ab1951b7b9 | ||
|
|
ff75eb3f5d | ||
|
|
f0f44e6db4 | ||
|
|
f99f07f72e | ||
|
|
b9d61aed90 | ||
|
|
d009554cae | ||
|
|
8dbeca0fc9 | ||
|
|
5dccc6b2a3 | ||
|
|
323e531a77 | ||
|
|
634f64d4ce | ||
|
|
ecaf52008b | ||
|
|
86e0736726 | ||
|
|
ca933ae84d | ||
|
|
4a836293d5 | ||
|
|
836e8fb294 | ||
|
|
c5b6091c43 | ||
|
|
5256ac7f97 | ||
|
|
f393ba520d | ||
|
|
e36ef9e1d2 | ||
|
|
dd12c6ac99 | ||
|
|
036bb035c9 | ||
|
|
16eae7eafe | ||
|
|
13d483ef2e | ||
|
|
d2b6276119 | ||
|
|
8627c9d219 | ||
|
|
72043a2645 | ||
|
|
d1498c3ce2 | ||
|
|
7b47fc9680 | ||
|
|
c4e69c9ce3 | ||
|
|
ca6612e0a4 | ||
|
|
63e5e8b7ab | ||
|
|
8fdf8c4453 | ||
|
|
f0b2766d5b | ||
|
|
aa5e26d92b | ||
|
|
557b969f35 | ||
|
|
bd638b97e5 | ||
|
|
44b956ad85 | ||
|
|
82ca0ce5c4 | ||
|
|
91afb0bb49 | ||
|
|
653b9ff17f | ||
|
|
bc9ab4556c | ||
|
|
abe05136fd | ||
|
|
d6fb271df8 | ||
|
|
3294fb15ae | ||
|
|
9817623291 | ||
|
|
617f507427 | ||
|
|
df09356edd | ||
|
|
21b572b7f2 | ||
|
|
6451679c9a | ||
|
|
ced37d0a5e | ||
|
|
a95f40e5b8 | ||
|
|
75f902b0f5 | ||
|
|
9420c3e0af | ||
|
|
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 |
1
.eslintignore
Normal file
1
.eslintignore
Normal file
@@ -0,0 +1 @@
|
||||
deno/
|
||||
8
.eslintrc.json
Normal file
8
.eslintrc.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "marine/prettier/node",
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"project": "./tsconfig.eslint.json",
|
||||
"extraFileExtensions": [".mjs"]
|
||||
}
|
||||
}
|
||||
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/djs. 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/djs) instead of opening an issue, or on [GitHub Discussions](https://github.com/discordjs/discord-api-types/discussions) – you will get redirected there anyway.**
|
||||
|
||||
- [Code of Conduct](https://github.com/discordjs/discord-api-types/blob/main/.github/CODE_OF_CONDUCT.md)
|
||||
- [Pull Request Guidelines](#pull-request-guidelines)
|
||||
- [Development Setup](#development-setup)
|
||||
- [Project Structure](#project-structure)
|
||||
- [Contributing Tests](#contributing-tests)
|
||||
|
||||
## 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
|
||||
|
||||
83
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
83
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
name: Bug report
|
||||
description: Report incorrect or unexpected behavior of discord-api-types, or a mistyped type
|
||||
labels: [bug]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
Use Discord for questions: https://discord.gg/djs
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Issue description
|
||||
description: |
|
||||
Please describe the problem you are having in as much detail as possible.
|
||||
|
||||
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files into it.
|
||||
placeholder: |
|
||||
Steps to reproduce with below code sample:
|
||||
1. do thing
|
||||
2. it broke :c
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: codesample
|
||||
attributes:
|
||||
label: Code sample
|
||||
description: Include a reproducible, minimal code sample. This will be automatically formatted into code, so no need for backticks.
|
||||
render: typescript
|
||||
placeholder: |
|
||||
Your code sample should be...
|
||||
... Minimal - Use as little code as possible that still produces the same problem (and is understandable)
|
||||
... Complete - Provide all parts someone else needs to reproduce your problem
|
||||
... Reproducible - Test the code you're about to provide to make sure it reproduces the problem
|
||||
|
||||
- type: input
|
||||
id: types-version
|
||||
attributes:
|
||||
label: Package version
|
||||
description: Which version of the package are you using? Run `npm list discord-api-types` in your project directory and paste the output.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: runtime
|
||||
attributes:
|
||||
label: Runtime
|
||||
description: What runtime are you using?
|
||||
options:
|
||||
- Node.js
|
||||
- Deno
|
||||
- Bun
|
||||
- Other / Browser
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: input
|
||||
id: runtime-version
|
||||
attributes:
|
||||
label: Runtime version
|
||||
description: |
|
||||
Which version of your runtime of choice are you using?
|
||||
If you are using TypeScript, please include its version (`npm list typescript`) as well.
|
||||
For Node.js: Run `node --version` in your project directory and paste the output.
|
||||
For Deno: Run `deno --version` in your project directory and paste the output.
|
||||
For Bun: Run `bun --version` in your project directory and paste the output.
|
||||
For Other / Browser: Find the version in your runtime of choice and paste it here.
|
||||
placeholder: v4.2.0
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: dropdown
|
||||
id: priority
|
||||
attributes:
|
||||
label: Priority this issue should have
|
||||
description: Please be realistic. If you need to elaborate on your reasoning, please use the Issue description field above.
|
||||
options:
|
||||
- Low (slightly annoying)
|
||||
- Medium (should be fixed soon)
|
||||
- High (immediate attention needed)
|
||||
validations:
|
||||
required: true
|
||||
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/djs
|
||||
about: Please visit our Discord server for questions and support requests.
|
||||
39
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
39
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
name: Feature request
|
||||
description: Request a feature for the discord-api-types library (we accept documented features of the official Discord developer API only!)
|
||||
labels: [discussion]
|
||||
body:
|
||||
- type: markdown
|
||||
attributes:
|
||||
value: |
|
||||
We will only only document types that Discord publishes, documents, and merges into the Discord API documentation.
|
||||
We do not implement unreleased types, or types considered client only.
|
||||
Use Discord for questions: https://discord.gg/djs
|
||||
|
||||
- type: textarea
|
||||
id: description
|
||||
attributes:
|
||||
label: Feature
|
||||
description: A clear and concise description of what the problem is, or what feature you want to be implemented.
|
||||
placeholder: I'm always frustrated when..., Discord has recently released..., A good addition would be...
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: solution
|
||||
attributes:
|
||||
label: Ideal solution or implementation
|
||||
description: A clear and concise description of what you want to happen.
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: alternatives
|
||||
attributes:
|
||||
label: Alternative solutions or implementations
|
||||
description: A clear and concise description of any alternative solutions or features you have considered.
|
||||
|
||||
- type: textarea
|
||||
id: additional-context
|
||||
attributes:
|
||||
label: Other context
|
||||
description: Any other context, screenshots, or file uploads that help us understand your feature request.
|
||||
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:**
|
||||
|
||||
**If applicable, please reference Discord API Docs PRs or commits that influenced this PR:**
|
||||
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/djs
|
||||
|
||||
Any issues that don't directly involve a bug or a feature request will likely be redirected or closed.
|
||||
8
.github/auto_assign.yml
vendored
Normal file
8
.github/auto_assign.yml
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
addReviewers: true
|
||||
reviewers:
|
||||
- iCrawl
|
||||
- SpaceEEC
|
||||
- kyranet
|
||||
- vladfrangu
|
||||
numberOfReviewers: 0
|
||||
runOnDraft: true
|
||||
58
.github/labeler.yml
vendored
Normal file
58
.github/labeler.yml
vendored
Normal file
@@ -0,0 +1,58 @@
|
||||
chore:
|
||||
- any: ['*']
|
||||
all:
|
||||
[
|
||||
'!deno/**/*',
|
||||
'!gateway/**/*',
|
||||
'!payloads/**/*',
|
||||
'!rest/**/*',
|
||||
'!rpc/**/*',
|
||||
'!tests/**/*',
|
||||
'!utils/**/*',
|
||||
'!voice/**/*',
|
||||
]
|
||||
|
||||
ci:
|
||||
- .github/**/*
|
||||
- .husky/**/*
|
||||
- scripts/actions/**/*
|
||||
|
||||
dependencies:
|
||||
- package.json
|
||||
- package-lock.json
|
||||
- website/package.json
|
||||
- website/package-lock.json
|
||||
|
||||
'topic:deno':
|
||||
- scripts/deno.mjs
|
||||
- scripts/actions/report-deno-not-ran.mjs
|
||||
|
||||
'topic:gateway':
|
||||
- gateway/**/*
|
||||
|
||||
'topic:payloads':
|
||||
- payloads/**/*
|
||||
|
||||
'topic:rest':
|
||||
- rest/**/*
|
||||
|
||||
'topic:rpc':
|
||||
- rpc/**/*
|
||||
|
||||
'topic:scripts':
|
||||
- scripts/**/*
|
||||
|
||||
'topic:tests':
|
||||
- tests/**/*
|
||||
|
||||
'topic:utils':
|
||||
- utils/**/*
|
||||
|
||||
'topic:voice':
|
||||
- voice/**/*
|
||||
|
||||
'topic:globals':
|
||||
- globals.ts
|
||||
|
||||
'topic:website':
|
||||
- website/**/*
|
||||
57
.github/labels.yml
vendored
Normal file
57
.github/labels.yml
vendored
Normal file
@@ -0,0 +1,57 @@
|
||||
# General labels
|
||||
- name: 'semver:major'
|
||||
color: 'c10f47'
|
||||
- name: 'semver:minor'
|
||||
color: 'e4f486'
|
||||
- name: 'semver:patch'
|
||||
color: 'e8be8b'
|
||||
- name: 'question (please use Discord instead)'
|
||||
color: 'd876e3'
|
||||
- name: 'regression'
|
||||
color: 'ea8785'
|
||||
- name: 'wontfix'
|
||||
color: 'ffffff'
|
||||
- name: 'chore'
|
||||
color: 'ffffff'
|
||||
- name: 'ci'
|
||||
color: '0075ca'
|
||||
- name: 'dependencies'
|
||||
color: '276bd1'
|
||||
- name: 'duplicate'
|
||||
color: 'cfd3d7'
|
||||
- name: 'feature request'
|
||||
color: 'fcf95a'
|
||||
- name: 'bug'
|
||||
color: 'd73a4a'
|
||||
- name: 'backlog'
|
||||
color: '7ef7ef'
|
||||
- name: 'good first issue'
|
||||
color: '7057ff'
|
||||
- name: 'has PR'
|
||||
color: '4b1f8e'
|
||||
- name: 'help wanted'
|
||||
color: '008672'
|
||||
|
||||
# Topic labels
|
||||
- name: 'topic:deno'
|
||||
color: 'aed5fc'
|
||||
- name: 'topic:gateway'
|
||||
color: 'aed5fc'
|
||||
- name: 'topic:payloads'
|
||||
color: 'aed5fc'
|
||||
- name: 'topic:rest'
|
||||
color: 'aed5fc'
|
||||
- name: 'topic:rpc'
|
||||
color: 'aed5fc'
|
||||
- name: 'topic:scripts'
|
||||
color: 'aed5fc'
|
||||
- name: 'topic:tests'
|
||||
color: 'aed5fc'
|
||||
- name: 'topic:utils'
|
||||
color: 'aed5fc'
|
||||
- name: 'topic:voice'
|
||||
color: 'aed5fc'
|
||||
- name: 'topic:globals'
|
||||
color: 'aed5fc'
|
||||
- name: 'topic:website'
|
||||
color: 'aed5fc'
|
||||
22
.github/problemMatchers/eslint.json
vendored
Normal file
22
.github/problemMatchers/eslint.json
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "eslint-stylish",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^([^\\s].*)$",
|
||||
"file": 1
|
||||
},
|
||||
{
|
||||
"regexp": "^\\s+(\\d+):(\\d+)\\s+(error|warning|info)\\s+(.*)\\s\\s+(.*)$",
|
||||
"line": 1,
|
||||
"column": 2,
|
||||
"severity": 3,
|
||||
"message": 4,
|
||||
"code": 5,
|
||||
"loop": true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
17
.github/problemMatchers/tsc.json
vendored
Normal file
17
.github/problemMatchers/tsc.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"problemMatcher": [
|
||||
{
|
||||
"owner": "tsc",
|
||||
"pattern": [
|
||||
{
|
||||
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+|\\d+,\\d+|\\d+,\\d+,\\d+,\\d+)\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
|
||||
"file": 1,
|
||||
"location": 2,
|
||||
"severity": 3,
|
||||
"code": 4,
|
||||
"message": 5
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
28
.github/workflows/check-deno.yml
vendored
Normal file
28
.github/workflows/check-deno.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: Deno
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
|
||||
jobs:
|
||||
check_deno:
|
||||
name: Ensure Deno types are in sync with the code
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js v16
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run Check Script
|
||||
run: node ./scripts/actions/report-deno-not-ran.mjs
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
56
.github/workflows/cicd.yml
vendored
Normal file
56
.github/workflows/cicd.yml
vendored
Normal file
@@ -0,0 +1,56 @@
|
||||
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: Add problem matcher
|
||||
run: echo "::add-matcher::.github/problemMatchers/eslint.json" && echo "::add-matcher::.github/problemMatchers/tsc.json"
|
||||
|
||||
- name: Use Node.js v16
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
cache: npm
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Check lint on discord-api-types
|
||||
run: npm run test:lint
|
||||
|
||||
- name: Run TSC
|
||||
run: npm run build:ci
|
||||
|
||||
tsd:
|
||||
name: TSD checks
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
needs: testing
|
||||
if: needs.testing.result == 'success'
|
||||
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js v16
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run TSD
|
||||
run: npm run test:types
|
||||
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
|
||||
93
.github/workflows/create-pr-for-release-and-publish.yml
vendored
Normal file
93
.github/workflows/create-pr-for-release-and-publish.yml
vendored
Normal file
@@ -0,0 +1,93 @@
|
||||
name: Create PR for new releases and publish new version
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
schedule:
|
||||
# Run every Monday and Thursday at 12:00
|
||||
- cron: '0 12 * * 1,4'
|
||||
|
||||
jobs:
|
||||
create_pr:
|
||||
name: Create PR for new version
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'discordjs' && github.event_name != 'push'
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node v16
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
- name: Install website dependencies
|
||||
run: pushd website && npm ci --ignore-scripts && popd
|
||||
|
||||
- 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: Bump version
|
||||
run: node ./scripts/bump-version.mjs
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Create branch for changes, add all changes and push
|
||||
run: |
|
||||
git checkout -b "chore/release/$(jq --raw-output '.version' package.json)"
|
||||
|
||||
# Run changelog generation, deno script, website version bump
|
||||
npm run ci:pr
|
||||
|
||||
# Add all changes, commit and push
|
||||
git add --all .
|
||||
git commit -m "chore(release): $(jq --raw-output '.version' package.json) 🎉" -m "Build ran for ${GITHUB_SHA}"
|
||||
git push -u origin "chore/release/$(jq --raw-output '.version' package.json)"
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Create Pull Request
|
||||
run: node ./scripts/actions/create-pr.mjs
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
create_release:
|
||||
name: Create release and publish
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'discordjs' && github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release)') && !contains(github.event.head_commit.message, '[skip ci]')
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node v16
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
- name: Publish release to npm
|
||||
run: npm publish
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
|
||||
- name: Create GitHub release
|
||||
run: node ./scripts/actions/create-release.mjs
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
22
.github/workflows/labelsync.yml
vendored
Normal file
22
.github/workflows/labelsync.yml
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
name: Label Sync
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 0 * * *'
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- '.github/labels.yml'
|
||||
jobs:
|
||||
labelsync:
|
||||
name: Label sync
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Label sync
|
||||
uses: crazy-max/ghaction-github-labeler@v3
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
18
.github/workflows/pr-automation.yml
vendored
Normal file
18
.github/workflows/pr-automation.yml
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
name: 'PR Automation'
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Automatically label PR
|
||||
uses: actions/labeler@v3
|
||||
with:
|
||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
sync-labels: true
|
||||
|
||||
- name: Automatically assign reviewers
|
||||
if: github.event.action == 'opened'
|
||||
uses: kentaro-m/auto-assign-action@v1.2.4
|
||||
47
.github/workflows/publish-next.yml
vendored
Normal file
47
.github/workflows/publish-next.yml
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
name: Publish next
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
name: Publish @next release to npm
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'discordjs' && !(github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release)'))
|
||||
steps:
|
||||
- name: Cancel previous publish attempts
|
||||
uses: styfle/cancel-workflow-action@0.9.1
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Install Node v16
|
||||
uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version: 16
|
||||
registry-url: https://registry.npmjs.org/
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci --ignore-scripts
|
||||
|
||||
- name: Bump version
|
||||
run: node ./scripts/bump-version.mjs
|
||||
|
||||
- name: Deprecate old @next versions
|
||||
run: npx npm-deprecate --name "*next*" --package discord-api-types --message "No longer supported. Install the latest @next release" || true
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
|
||||
- name: Publish new @next version
|
||||
run: |
|
||||
npm version $(jq --raw-output '.version' package.json)-next.$(git rev-parse --short HEAD).$(date +%s)
|
||||
npm publish --tag next || true
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
||||
59
.gitignore
vendored
59
.gitignore
vendored
@@ -1,21 +1,50 @@
|
||||
node_modules/
|
||||
|
||||
out/
|
||||
coverage/
|
||||
.nyc_output/
|
||||
|
||||
debug.log
|
||||
|
||||
# Don't commit build outputs
|
||||
globals.js
|
||||
globals.*map
|
||||
globals.d.ts
|
||||
globals.mjs
|
||||
|
||||
v*/**/*.js
|
||||
v*/**/*.map
|
||||
v*/**/*.d.ts
|
||||
./v*.js
|
||||
./v*.*map
|
||||
./v*.d.ts
|
||||
./v*.mjs
|
||||
|
||||
default/*.js
|
||||
default/*.map
|
||||
default/*.d.ts
|
||||
gateway/**/*.js
|
||||
gateway/**/*.map
|
||||
gateway/**/*.d.ts
|
||||
gateway/**/*.mjs
|
||||
|
||||
common/*.js
|
||||
common/*.map
|
||||
common/*.d.ts
|
||||
payloads/**/*.js
|
||||
payloads/**/*.map
|
||||
payloads/**/*.d.ts
|
||||
payloads/**/*.mjs
|
||||
|
||||
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
|
||||
|
||||
# macOS files
|
||||
.DS_Store
|
||||
|
||||
1
.husky/.gitignore
vendored
Normal file
1
.husky/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
_
|
||||
4
.husky/commit-msg
Executable file
4
.husky/commit-msg
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx --no-install commitlint --edit $1
|
||||
4
.husky/pre-commit
Executable file
4
.husky/pre-commit
Executable file
@@ -0,0 +1,4 @@
|
||||
#!/bin/sh
|
||||
. "$(dirname "$0")/_/husky.sh"
|
||||
|
||||
npx --no-install pretty-quick --staged && npx --no-install lint-staged && npm run build:deno && git add deno
|
||||
6
.npmrc
Normal file
6
.npmrc
Normal file
@@ -0,0 +1,6 @@
|
||||
audit=false
|
||||
fund=false
|
||||
legacy-peer-deps=true
|
||||
tag-version-prefix=""
|
||||
git-tag-version=false
|
||||
message="chore(release): %s 🎉"
|
||||
13
.prettierignore
Normal file
13
.prettierignore
Normal file
@@ -0,0 +1,13 @@
|
||||
|
||||
# Node modules
|
||||
node_modules/
|
||||
|
||||
# Generated data
|
||||
deno/
|
||||
|
||||
# Versioned json
|
||||
website/versioned_sidebars/
|
||||
website/versioned_docs/
|
||||
website/versions.json
|
||||
website/.docusaurus/
|
||||
website/build
|
||||
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"
|
||||
}
|
||||
10
.vscode/settings.json
vendored
Normal file
10
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"files.eol": "\n",
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.organizeImports": false,
|
||||
"source.fixAll": true,
|
||||
"source.fixAll.eslint": true
|
||||
},
|
||||
"cSpell.enableFiletypes": ["mdx"]
|
||||
}
|
||||
1194
CHANGELOG.md
Normal file
1194
CHANGELOG.md
Normal file
File diff suppressed because it is too large
Load Diff
93
README.md
93
README.md
@@ -1,9 +1,14 @@
|
||||
<div style="text-align:center;"><h1>Discord API Types</h1></div>
|
||||
# Discord API Types
|
||||
|
||||
[](https://github.com/discordjs/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)
|
||||
[](https://vercel.com?utm_source=discordjs&utm_campaign=oss)
|
||||
|
||||
Simple type definitions for the [Discord API](https://discord.com/developers/docs/intro).
|
||||
|
||||
@@ -17,11 +22,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/v10');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { APIUser } from 'discord-api-types/v10';
|
||||
```
|
||||
|
||||
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/v10');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { GatewayVersion } from 'discord-api-types/gateway/v10';
|
||||
```
|
||||
|
||||
> _**Note:** The `v*` exports (`discord-api-types/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/v10.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/v10.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/v10?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 +95,11 @@ 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.
|
||||
**A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs),
|
||||
that are mentioned in an open pull request, or known through other means _and have received the green light to be used_.
|
||||
Anything else will not be documented (for example client only types).
|
||||
|
||||
## 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';
|
||||
```
|
||||
With that aside, we may allow certain types that are not documented in the [API Documentation repository](https://github.com/discord/discord-api-docs) on a case by case basis.
|
||||
They will be documented with an `@unstable` tag and are not subject with the same versioning rules.
|
||||
|
||||
146
common/index.ts
146
common/index.ts
@@ -1,146 +0,0 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes
|
||||
*/
|
||||
export enum RESTJSONErrorCodes {
|
||||
GeneralError,
|
||||
|
||||
UnknownAccount = 10001,
|
||||
UnknownApplication,
|
||||
UnknownChannel,
|
||||
UnknownGuild,
|
||||
UnknownIntegration,
|
||||
UnknownInvite,
|
||||
UnknownMember,
|
||||
UnknownMessage,
|
||||
UnknownPermissionOverwrite,
|
||||
UnknownProvider,
|
||||
UnknownRole,
|
||||
UnknownToken,
|
||||
UnknownUser,
|
||||
UnknownEmoji,
|
||||
UnknownWebhook,
|
||||
|
||||
UnknownBan = 10026,
|
||||
UnknownSKU,
|
||||
UnknownStoreListing,
|
||||
UnknownEntitlement,
|
||||
UnknownBuild,
|
||||
UnknownLobby,
|
||||
UnknownBranch,
|
||||
|
||||
UnknownRedistributable = 10036,
|
||||
|
||||
BotsCannotUseThisEndpoint = 20001,
|
||||
OnlyBotsCanUseThisEndpoint,
|
||||
|
||||
AnnouncementEditLimitExceeded = 20022,
|
||||
|
||||
ChannelSendRateLimit = 20028,
|
||||
|
||||
MaximumNumberOfGuildsReached = 30001,
|
||||
MaximumNumberOfFriendsReached,
|
||||
MaximumNumberOfPinsReachedForTheChannel,
|
||||
|
||||
MaximumNumberOfGuildRolesReached = 30005,
|
||||
|
||||
MaximumNumberOfWebhooksReached = 30007,
|
||||
|
||||
MaximumNumberOfReactionsReached = 30010,
|
||||
|
||||
MaximumNumberOfGuildChannelsReached = 30013,
|
||||
|
||||
MaximumNumberOfAttachmentsInAMessageReached = 30015,
|
||||
MaximumNumberOfInvitesReached,
|
||||
|
||||
Unauthorized = 40001,
|
||||
VerifyYourAccount,
|
||||
|
||||
RequestEntityTooLarge = 40005,
|
||||
FeatureTemporarilyDisabledServerSide,
|
||||
UserBannedFromThisGuild,
|
||||
|
||||
MissingAccess = 50001,
|
||||
InvalidAccountType,
|
||||
CannotExecuteActionOnDMChannel,
|
||||
GuildWidgetDisabled,
|
||||
CannotEditMessageAuthoredByAnotherUser,
|
||||
CannotSendAnEmptyMessage,
|
||||
CannotSendMessagesToThisUser,
|
||||
CannotSendMessagesInVoiceChannel,
|
||||
ChannelVerificationLevelTooHighForYouToGainAccess,
|
||||
Oauth2ApplicationDoesNotHaveBot,
|
||||
Oauth2ApplicationLimitReached,
|
||||
InvalidOauth2State,
|
||||
MissingPermissions,
|
||||
InvalidToken,
|
||||
NoteWasTooLong,
|
||||
ProvidedTooFewOrTooManyMessagesToDelete,
|
||||
|
||||
MessageCanOnlyBePinnedInTheChannelItWasSentIn = 50019,
|
||||
InviteCodeInvalidOrTaken,
|
||||
CannotExecuteActionOnSystemMessage,
|
||||
|
||||
CannotExecuteActionOnThisChannelType = 50024,
|
||||
InvalidOauth2AccessToken,
|
||||
|
||||
InvalidRecipients = 50033,
|
||||
OneOfTheMessagesProvidedWasTooOldForBulkDelete,
|
||||
InvalidFormBodyOrContentType,
|
||||
InviteAcceptedToGuildWithoutTheBotBeingIn,
|
||||
|
||||
InvalidAPIVersion = 50041,
|
||||
|
||||
CannotDeleteChannelRequiredForCommunityGuilds = 50074,
|
||||
|
||||
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';
|
||||
}
|
||||
@@ -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 '../v8';
|
||||
1194
deno/CHANGELOG.md
Normal file
1194
deno/CHANGELOG.md
Normal file
File diff suppressed because it is too large
Load Diff
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.
|
||||
105
deno/README.md
Normal file
105
deno/README.md
Normal file
@@ -0,0 +1,105 @@
|
||||
# Discord API Types
|
||||
|
||||
[](https://github.com/discordjs/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)
|
||||
[](https://vercel.com?utm_source=discordjs&utm_campaign=oss)
|
||||
|
||||
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/v10');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { APIUser } from 'discord-api-types/v10';
|
||||
```
|
||||
|
||||
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/v10');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { GatewayVersion } from 'discord-api-types/gateway/v10';
|
||||
```
|
||||
|
||||
> _**Note:** The `v*` exports (`discord-api-types/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/v10.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/v10.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/v10?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.
|
||||
|
||||
**A note about how types are documented**: This package will add types only for known and documented properties that are present in Discord's [API Documentation repository](https://github.com/discord/discord-api-docs),
|
||||
that are mentioned in an open pull request, or known through other means _and have received the green light to be used_.
|
||||
Anything else will not be documented (for example client only types).
|
||||
|
||||
With that aside, we may allow certain types that are not documented in the [API Documentation repository](https://github.com/discord/discord-api-docs) on a case by case basis.
|
||||
They will be documented with an `@unstable` tag and are not subject with the same versioning rules.
|
||||
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-query-string-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 './v10.ts';
|
||||
2016
deno/gateway/v10.ts
Normal file
2016
deno/gateway/v10.ts
Normal file
File diff suppressed because it is too large
Load Diff
@@ -16,7 +16,9 @@ import type {
|
||||
GatewayVoiceState,
|
||||
InviteTargetUserType,
|
||||
PresenceUpdateStatus,
|
||||
} from '../payloads';
|
||||
} 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.
|
||||
@@ -692,7 +694,6 @@ export interface GatewayIdentify {
|
||||
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;
|
||||
1797
deno/gateway/v8.ts
Normal file
1797
deno/gateway/v8.ts
Normal file
File diff suppressed because it is too large
Load Diff
2015
deno/gateway/v9.ts
Normal file
2015
deno/gateway/v9.ts
Normal file
File diff suppressed because it is too large
Load Diff
97
deno/globals.ts
Normal file
97
deno/globals.ts
Normal file
@@ -0,0 +1,97 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/reference#snowflakes
|
||||
*/
|
||||
export type Snowflake = string;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions
|
||||
* @internal
|
||||
*/
|
||||
export type Permissions = string;
|
||||
|
||||
/**
|
||||
* 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
|
||||
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
|
||||
*/
|
||||
UserWithNickname: /<@!(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* Regular expression for matching a user mention, with or without a nickname
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
* @deprecated Passing `!` in user mentions is no longer necessary / supported, and future message contents won't have it
|
||||
*/
|
||||
UserWithOptionalNickname: /<@!?(?<id>\d{17,20})>/,
|
||||
/**
|
||||
* 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 application command mention
|
||||
*
|
||||
* The `fullName` (possibly including `name`, `subcommandOrGroup` and `subcommand`) and `id` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
SlashCommand:
|
||||
/<\/(?<fullName>(?<name>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32})(?: (?<subcommandOrGroup>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?(?: (?<subcommand>[-_\p{Letter}\p{Number}\p{sc=Deva}\p{sc=Thai}]{1,32}))?):(?<id>\d{17,20})>/u,
|
||||
/**
|
||||
* 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})>/,
|
||||
/**
|
||||
* Regular expression for matching a timestamp, either default or custom styled
|
||||
*
|
||||
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
Timestamp: /<t:(?<timestamp>-?\d{1,13})(:(?<style>[tTdDfFR]))?>/,
|
||||
/**
|
||||
* Regular expression for matching strictly default styled timestamps
|
||||
*
|
||||
* The `timestamp` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
DefaultStyledTimestamp: /<t:(?<timestamp>-?\d{1,13})>/,
|
||||
/**
|
||||
* Regular expression for matching strictly custom styled timestamps
|
||||
*
|
||||
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
StyledTimestamp: /<t:(?<timestamp>-?\d{1,13}):(?<style>[tTdDfFR])>/,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Freezes the formatting patterns
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(FormattingPatterns);
|
||||
104
deno/payloads/common.ts
Normal file
104
deno/payloads/common.ts
Normal file
@@ -0,0 +1,104 @@
|
||||
import type { LocaleString } from '../rest/common.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 = {
|
||||
CreateInstantInvite: 1n << 0n,
|
||||
KickMembers: 1n << 1n,
|
||||
BanMembers: 1n << 2n,
|
||||
Administrator: 1n << 3n,
|
||||
ManageChannels: 1n << 4n,
|
||||
ManageGuild: 1n << 5n,
|
||||
AddReactions: 1n << 6n,
|
||||
ViewAuditLog: 1n << 7n,
|
||||
PrioritySpeaker: 1n << 8n,
|
||||
Stream: 1n << 9n,
|
||||
ViewChannel: 1n << 10n,
|
||||
SendMessages: 1n << 11n,
|
||||
SendTTSMessages: 1n << 12n,
|
||||
ManageMessages: 1n << 13n,
|
||||
EmbedLinks: 1n << 14n,
|
||||
AttachFiles: 1n << 15n,
|
||||
ReadMessageHistory: 1n << 16n,
|
||||
MentionEveryone: 1n << 17n,
|
||||
UseExternalEmojis: 1n << 18n,
|
||||
ViewGuildInsights: 1n << 19n,
|
||||
Connect: 1n << 20n,
|
||||
Speak: 1n << 21n,
|
||||
MuteMembers: 1n << 22n,
|
||||
DeafenMembers: 1n << 23n,
|
||||
MoveMembers: 1n << 24n,
|
||||
UseVAD: 1n << 25n,
|
||||
ChangeNickname: 1n << 26n,
|
||||
ManageNicknames: 1n << 27n,
|
||||
ManageRoles: 1n << 28n,
|
||||
ManageWebhooks: 1n << 29n,
|
||||
ManageEmojisAndStickers: 1n << 30n,
|
||||
UseApplicationCommands: 1n << 31n,
|
||||
RequestToSpeak: 1n << 32n,
|
||||
ManageEvents: 1n << 33n,
|
||||
ManageThreads: 1n << 34n,
|
||||
CreatePublicThreads: 1n << 35n,
|
||||
CreatePrivateThreads: 1n << 36n,
|
||||
UseExternalStickers: 1n << 37n,
|
||||
SendMessagesInThreads: 1n << 38n,
|
||||
UseEmbeddedActivities: 1n << 39n,
|
||||
ModerateMembers: 1n << 40n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Freeze the object of bits, preventing any modifications to it
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(PermissionFlagsBits);
|
||||
|
||||
export type LocalizationMap = Partial<Record<LocaleString, string | null>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json
|
||||
*/
|
||||
export interface RESTError {
|
||||
code: number;
|
||||
message: string;
|
||||
errors?: RESTErrorData;
|
||||
}
|
||||
|
||||
export interface RESTErrorFieldInformation {
|
||||
code: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface RESTErrorGroupWrapper {
|
||||
_errors: RESTErrorData[];
|
||||
}
|
||||
|
||||
export type RESTErrorData = RESTErrorGroupWrapper | RESTErrorFieldInformation | { [k: string]: RESTErrorData } | string;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/rate-limits#exceeding-a-rate-limit-rate-limit-response-structure
|
||||
*/
|
||||
export interface RESTRateLimit {
|
||||
/**
|
||||
* An error code for some limits
|
||||
*
|
||||
* {@link RESTJSONErrorCodes}
|
||||
*/
|
||||
code?: number;
|
||||
/**
|
||||
* A value indicating if you are being globally rate limited or not
|
||||
*/
|
||||
global: boolean;
|
||||
/**
|
||||
* A message saying you are being rate limited.
|
||||
*/
|
||||
message: string;
|
||||
/**
|
||||
* The number of seconds to wait before submitting another request.
|
||||
*/
|
||||
retry_after: number;
|
||||
}
|
||||
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 './v10/mod.ts';
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
export type APIApplicationCommandAttachmentOption =
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;
|
||||
|
||||
export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Attachment,
|
||||
Snowflake
|
||||
>;
|
||||
@@ -0,0 +1,29 @@
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { LocalizationMap } from '../../../../../v10.ts';
|
||||
|
||||
export interface APIApplicationCommandOptionBase<Type extends ApplicationCommandOptionType> {
|
||||
type: Type;
|
||||
name: string;
|
||||
name_localizations?: LocalizationMap | null;
|
||||
description: string;
|
||||
description_localizations?: LocalizationMap | null;
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
export interface APIInteractionDataOptionBase<T extends ApplicationCommandOptionType, D> {
|
||||
name: string;
|
||||
type: T;
|
||||
value: D;
|
||||
}
|
||||
|
||||
export type APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
|
||||
Base extends APIApplicationCommandOptionBase<ApplicationCommandOptionType>,
|
||||
ChoiceType extends APIApplicationCommandOptionChoice,
|
||||
> =
|
||||
| (Base & {
|
||||
autocomplete: true;
|
||||
})
|
||||
| (Base & {
|
||||
autocomplete?: false;
|
||||
choices?: ChoiceType[];
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
export type APIApplicationCommandBooleanOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Boolean>;
|
||||
|
||||
export type APIApplicationCommandInteractionDataBooleanOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Boolean,
|
||||
boolean
|
||||
>;
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { ChannelType } from '../../../channel.ts';
|
||||
|
||||
export interface APIApplicationCommandChannelOption
|
||||
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {
|
||||
channel_types?: Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>[];
|
||||
}
|
||||
|
||||
export type APIApplicationCommandInteractionDataChannelOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Channel,
|
||||
Snowflake
|
||||
>;
|
||||
@@ -0,0 +1,28 @@
|
||||
import type {
|
||||
APIApplicationCommandOptionBase,
|
||||
APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper,
|
||||
APIInteractionDataOptionBase,
|
||||
} from './base.ts';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
interface APIApplicationCommandIntegerOptionBase
|
||||
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Integer> {
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
|
||||
export type APIApplicationCommandIntegerOption = APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
|
||||
APIApplicationCommandIntegerOptionBase,
|
||||
APIApplicationCommandOptionChoice<number>
|
||||
>;
|
||||
|
||||
export interface APIApplicationCommandInteractionDataIntegerOption
|
||||
extends APIInteractionDataOptionBase<ApplicationCommandOptionType.Integer, number> {
|
||||
focused?: boolean;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
export type APIApplicationCommandMentionableOption =
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Mentionable>;
|
||||
|
||||
export type APIApplicationCommandInteractionDataMentionableOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Mentionable,
|
||||
Snowflake
|
||||
>;
|
||||
@@ -0,0 +1,28 @@
|
||||
import type {
|
||||
APIApplicationCommandOptionBase,
|
||||
APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper,
|
||||
APIInteractionDataOptionBase,
|
||||
} from './base.ts';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
interface APIApplicationCommandNumberOptionBase
|
||||
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Number> {
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the minimum value permitted.
|
||||
*/
|
||||
min_value?: number;
|
||||
/**
|
||||
* If the option is an `INTEGER` or `NUMBER` type, the maximum value permitted.
|
||||
*/
|
||||
max_value?: number;
|
||||
}
|
||||
|
||||
export type APIApplicationCommandNumberOption = APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
|
||||
APIApplicationCommandNumberOptionBase,
|
||||
APIApplicationCommandOptionChoice<number>
|
||||
>;
|
||||
|
||||
export interface APIApplicationCommandInteractionDataNumberOption
|
||||
extends APIInteractionDataOptionBase<ApplicationCommandOptionType.Number, number> {
|
||||
focused?: boolean;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
export type APIApplicationCommandRoleOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Role>;
|
||||
|
||||
export type APIApplicationCommandInteractionDataRoleOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Role,
|
||||
Snowflake
|
||||
>;
|
||||
@@ -0,0 +1,27 @@
|
||||
import type { LocalizationMap } from '../../../../../v10.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-type
|
||||
*/
|
||||
export enum ApplicationCommandOptionType {
|
||||
Subcommand = 1,
|
||||
SubcommandGroup,
|
||||
String,
|
||||
Integer,
|
||||
Boolean,
|
||||
User,
|
||||
Channel,
|
||||
Role,
|
||||
Mentionable,
|
||||
Number,
|
||||
Attachment,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure
|
||||
*/
|
||||
export interface APIApplicationCommandOptionChoice<ValueType = string | number> {
|
||||
name: string;
|
||||
name_localizations?: LocalizationMap | null;
|
||||
value: ValueType;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
import type {
|
||||
APIApplicationCommandOptionBase,
|
||||
APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper,
|
||||
APIInteractionDataOptionBase,
|
||||
} from './base.ts';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
interface APIApplicationCommandStringOptionBase
|
||||
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.String> {
|
||||
/**
|
||||
* For option type `STRING`, the minimum allowed length (minimum of `0`, maximum of `6000`).
|
||||
*/
|
||||
min_length?: number;
|
||||
/**
|
||||
* For option type `STRING`, the maximum allowed length (minimum of `1`, maximum of `6000`).
|
||||
*/
|
||||
max_length?: number;
|
||||
}
|
||||
|
||||
export type APIApplicationCommandStringOption = APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper<
|
||||
APIApplicationCommandStringOptionBase,
|
||||
APIApplicationCommandOptionChoice<string>
|
||||
>;
|
||||
|
||||
export interface APIApplicationCommandInteractionDataStringOption
|
||||
extends APIInteractionDataOptionBase<ApplicationCommandOptionType.String, string> {
|
||||
focused?: boolean;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import type { APIApplicationCommandOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
|
||||
|
||||
export interface APIApplicationCommandSubcommandOption
|
||||
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Subcommand> {
|
||||
options?: APIApplicationCommandBasicOption[];
|
||||
}
|
||||
|
||||
export interface APIApplicationCommandInteractionDataSubcommandOption {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.Subcommand;
|
||||
options?: APIApplicationCommandInteractionDataBasicOption[];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import type { APIApplicationCommandOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionDataSubcommandOption,
|
||||
APIApplicationCommandSubcommandOption,
|
||||
} from './subcommand.ts';
|
||||
|
||||
export interface APIApplicationCommandSubcommandGroupOption
|
||||
extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.SubcommandGroup> {
|
||||
options?: APIApplicationCommandSubcommandOption[];
|
||||
}
|
||||
|
||||
export interface APIApplicationCommandInteractionDataSubcommandGroupOption {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.SubcommandGroup;
|
||||
options: APIApplicationCommandInteractionDataSubcommandOption[];
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
|
||||
export type APIApplicationCommandUserOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.User>;
|
||||
|
||||
export type APIApplicationCommandInteractionDataUserOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.User,
|
||||
Snowflake
|
||||
>;
|
||||
@@ -0,0 +1,130 @@
|
||||
import type {
|
||||
APIApplicationCommandAttachmentOption,
|
||||
APIApplicationCommandInteractionDataAttachmentOption,
|
||||
} from './_chatInput/attachment.ts';
|
||||
import type {
|
||||
APIApplicationCommandBooleanOption,
|
||||
APIApplicationCommandInteractionDataBooleanOption,
|
||||
} from './_chatInput/boolean.ts';
|
||||
import type {
|
||||
APIApplicationCommandChannelOption,
|
||||
APIApplicationCommandInteractionDataChannelOption,
|
||||
} from './_chatInput/channel.ts';
|
||||
import type {
|
||||
APIApplicationCommandIntegerOption,
|
||||
APIApplicationCommandInteractionDataIntegerOption,
|
||||
} from './_chatInput/integer.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionDataMentionableOption,
|
||||
APIApplicationCommandMentionableOption,
|
||||
} from './_chatInput/mentionable.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionDataNumberOption,
|
||||
APIApplicationCommandNumberOption,
|
||||
} from './_chatInput/number.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionDataRoleOption,
|
||||
APIApplicationCommandRoleOption,
|
||||
} from './_chatInput/role.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionDataStringOption,
|
||||
APIApplicationCommandStringOption,
|
||||
} from './_chatInput/string.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionDataSubcommandOption,
|
||||
APIApplicationCommandSubcommandOption,
|
||||
} from './_chatInput/subcommand.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionDataSubcommandGroupOption,
|
||||
APIApplicationCommandSubcommandGroupOption,
|
||||
} from './_chatInput/subcommandGroup.ts';
|
||||
import type {
|
||||
APIApplicationCommandInteractionDataUserOption,
|
||||
APIApplicationCommandUserOption,
|
||||
} from './_chatInput/user.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type { APIInteractionDataResolved } from '../../mod.ts';
|
||||
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
|
||||
export * from './_chatInput/attachment.ts';
|
||||
export * from './_chatInput/base.ts';
|
||||
export * from './_chatInput/boolean.ts';
|
||||
export * from './_chatInput/channel.ts';
|
||||
export * from './_chatInput/integer.ts';
|
||||
export * from './_chatInput/mentionable.ts';
|
||||
export * from './_chatInput/number.ts';
|
||||
export * from './_chatInput/role.ts';
|
||||
export * from './_chatInput/shared.ts';
|
||||
export * from './_chatInput/string.ts';
|
||||
export * from './_chatInput/subcommand.ts';
|
||||
export * from './_chatInput/subcommandGroup.ts';
|
||||
export * from './_chatInput/user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
|
||||
*/
|
||||
export type APIApplicationCommandBasicOption =
|
||||
| APIApplicationCommandStringOption
|
||||
| APIApplicationCommandIntegerOption
|
||||
| APIApplicationCommandBooleanOption
|
||||
| APIApplicationCommandUserOption
|
||||
| APIApplicationCommandChannelOption
|
||||
| APIApplicationCommandRoleOption
|
||||
| APIApplicationCommandMentionableOption
|
||||
| APIApplicationCommandNumberOption
|
||||
| APIApplicationCommandAttachmentOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure
|
||||
*/
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandSubcommandOption
|
||||
| APIApplicationCommandSubcommandGroupOption
|
||||
| APIApplicationCommandBasicOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure
|
||||
*/
|
||||
export type APIApplicationCommandInteractionDataOption =
|
||||
| APIApplicationCommandInteractionDataSubcommandOption
|
||||
| APIApplicationCommandInteractionDataSubcommandGroupOption
|
||||
| APIApplicationCommandInteractionDataBasicOption;
|
||||
|
||||
export type APIApplicationCommandInteractionDataBasicOption =
|
||||
| APIApplicationCommandInteractionDataStringOption
|
||||
| APIApplicationCommandInteractionDataIntegerOption
|
||||
| APIApplicationCommandInteractionDataBooleanOption
|
||||
| APIApplicationCommandInteractionDataUserOption
|
||||
| APIApplicationCommandInteractionDataChannelOption
|
||||
| APIApplicationCommandInteractionDataRoleOption
|
||||
| APIApplicationCommandInteractionDataMentionableOption
|
||||
| APIApplicationCommandInteractionDataNumberOption
|
||||
| APIApplicationCommandInteractionDataAttachmentOption;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIChatInputApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {
|
||||
options?: APIApplicationCommandInteractionDataOption[];
|
||||
resolved?: APIInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIChatInputApplicationCommandInteraction =
|
||||
APIApplicationCommandInteractionWrapper<APIChatInputApplicationCommandInteractionData>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIChatInputApplicationCommandDMInteraction =
|
||||
APIDMInteractionWrapper<APIChatInputApplicationCommandInteraction>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIChatInputApplicationCommandGuildInteraction =
|
||||
APIGuildInteractionWrapper<APIChatInputApplicationCommandInteraction>;
|
||||
@@ -0,0 +1,91 @@
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIMessage } from '../../channel.ts';
|
||||
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper, APIUserInteractionDataResolved } from '../base.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIUserApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.User> {
|
||||
target_id: Snowflake;
|
||||
resolved: APIUserInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export interface APIMessageApplicationCommandInteractionData
|
||||
extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.Message> {
|
||||
target_id: Snowflake;
|
||||
resolved: APIMessageApplicationCommandInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
export interface APIMessageApplicationCommandInteractionDataResolved {
|
||||
messages: Record<Snowflake, APIMessage>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export type APIContextMenuInteractionData =
|
||||
| APIUserApplicationCommandInteractionData
|
||||
| APIMessageApplicationCommandInteractionData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIUserApplicationCommandInteraction =
|
||||
APIApplicationCommandInteractionWrapper<APIUserApplicationCommandInteractionData>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIUserApplicationCommandDMInteraction = APIDMInteractionWrapper<APIUserApplicationCommandInteraction>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIUserApplicationCommandGuildInteraction =
|
||||
APIGuildInteractionWrapper<APIUserApplicationCommandInteraction>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIMessageApplicationCommandInteraction =
|
||||
APIApplicationCommandInteractionWrapper<APIMessageApplicationCommandInteractionData>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIMessageApplicationCommandDMInteraction =
|
||||
APIDMInteractionWrapper<APIMessageApplicationCommandInteraction>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIMessageApplicationCommandGuildInteraction =
|
||||
APIGuildInteractionWrapper<APIMessageApplicationCommandInteraction>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIContextMenuInteraction = APIUserApplicationCommandInteraction | APIMessageApplicationCommandInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIContextMenuDMInteraction =
|
||||
| APIUserApplicationCommandDMInteraction
|
||||
| APIMessageApplicationCommandDMInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIContextMenuGuildInteraction =
|
||||
| APIUserApplicationCommandGuildInteraction
|
||||
| APIMessageApplicationCommandGuildInteraction;
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { ApplicationCommandType } from '../applicationCommands.ts';
|
||||
|
||||
export interface APIBaseApplicationCommandInteractionData<Type extends ApplicationCommandType> {
|
||||
id: Snowflake;
|
||||
type: Type;
|
||||
name: string;
|
||||
guild_id?: Snowflake;
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-guild-application-command-permissions-structure
|
||||
*/
|
||||
export interface APIGuildApplicationCommandPermissions {
|
||||
/**
|
||||
* The id of the command or the application id if that permission applies to all commands
|
||||
*/
|
||||
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/application-commands#application-command-permissions-object-application-command-permissions-structure
|
||||
*/
|
||||
export interface APIApplicationCommandPermission {
|
||||
/**
|
||||
* The id of the role, user or channel. Can also be a permission constant
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Role, user or channel
|
||||
*/
|
||||
type: ApplicationCommandPermissionType;
|
||||
/**
|
||||
* `true` to allow, `false`, to disallow
|
||||
*/
|
||||
permission: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type
|
||||
*/
|
||||
export enum ApplicationCommandPermissionType {
|
||||
Role = 1,
|
||||
User,
|
||||
Channel,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-constants
|
||||
*/
|
||||
export const APIApplicationCommandPermissionsConstant = {
|
||||
Everyone: (guildId: string | bigint): Snowflake => String(guildId),
|
||||
AllChannels: (guildId: string | bigint): Snowflake => String(BigInt(guildId) - 1n),
|
||||
};
|
||||
138
deno/payloads/v10/_interactions/applicationCommands.ts
Normal file
138
deno/payloads/v10/_interactions/applicationCommands.ts
Normal file
@@ -0,0 +1,138 @@
|
||||
import type {
|
||||
APIApplicationCommandOption,
|
||||
APIChatInputApplicationCommandDMInteraction,
|
||||
APIChatInputApplicationCommandGuildInteraction,
|
||||
APIChatInputApplicationCommandInteraction,
|
||||
APIChatInputApplicationCommandInteractionData,
|
||||
} from './_applicationCommands/chatInput.ts';
|
||||
import type {
|
||||
APIContextMenuDMInteraction,
|
||||
APIContextMenuGuildInteraction,
|
||||
APIContextMenuInteraction,
|
||||
APIContextMenuInteractionData,
|
||||
} from './_applicationCommands/contextMenu.ts';
|
||||
import type { APIBaseInteraction } from './base.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { LocalizationMap } from '../../../v10.ts';
|
||||
|
||||
export * from './_applicationCommands/chatInput.ts';
|
||||
export * from './_applicationCommands/contextMenu.ts';
|
||||
export * from './_applicationCommands/permissions.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object
|
||||
*/
|
||||
export interface APIApplicationCommand {
|
||||
/**
|
||||
* Unique id of the command
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Type of the command
|
||||
*/
|
||||
type: ApplicationCommandType;
|
||||
/**
|
||||
* Unique id of the parent application
|
||||
*/
|
||||
application_id: Snowflake;
|
||||
/**
|
||||
* Guild id of the command, if not global
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* 1-32 character name; `CHAT_INPUT` command names must be all lowercase matching `^[-_\p{L}\p{N}\p{sc=Deva}\p{sc=Thai}]{1,32}$`
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Localization dictionary for the name field. Values follow the same restrictions as name
|
||||
*/
|
||||
name_localizations?: LocalizationMap | null;
|
||||
/**
|
||||
* The localized name
|
||||
*/
|
||||
name_localized?: string;
|
||||
/**
|
||||
* 1-100 character description for `CHAT_INPUT` commands, empty string for `USER` and `MESSAGE` commands
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* Localization dictionary for the description field. Values follow the same restrictions as description
|
||||
*/
|
||||
description_localizations?: LocalizationMap | null;
|
||||
/**
|
||||
* The localized description
|
||||
*/
|
||||
description_localized?: string;
|
||||
/**
|
||||
* The parameters for the `CHAT_INPUT` command, max 25
|
||||
*/
|
||||
options?: APIApplicationCommandOption[];
|
||||
/**
|
||||
* Set of permissions represented as a bitset
|
||||
*/
|
||||
default_member_permissions: Permissions | null;
|
||||
/**
|
||||
* Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible
|
||||
*/
|
||||
dm_permission?: boolean;
|
||||
/**
|
||||
* Whether the command is enabled by default when the app is added to a guild
|
||||
*
|
||||
* If missing, this property should be assumed as `true`
|
||||
* @deprecated Use `dm_permission` and/or `default_member_permissions` instead
|
||||
*/
|
||||
default_permission?: boolean;
|
||||
/**
|
||||
* Indicates whether the command is age-restricted, defaults to `false`
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
version: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types
|
||||
*/
|
||||
export enum ApplicationCommandType {
|
||||
ChatInput = 1,
|
||||
User,
|
||||
Message,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data
|
||||
*/
|
||||
export type APIApplicationCommandInteractionData =
|
||||
| APIChatInputApplicationCommandInteractionData
|
||||
| APIContextMenuInteractionData;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIApplicationCommandInteractionWrapper<Data extends APIApplicationCommandInteractionData> =
|
||||
APIBaseInteraction<InteractionType.ApplicationCommand, Data> &
|
||||
Required<
|
||||
Pick<APIBaseInteraction<InteractionType.ApplicationCommand, Data>, 'channel_id' | 'data' | 'app_permissions'>
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIApplicationCommandInteraction = APIChatInputApplicationCommandInteraction | APIContextMenuInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIApplicationCommandDMInteraction =
|
||||
| APIChatInputApplicationCommandDMInteraction
|
||||
| APIContextMenuDMInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIApplicationCommandGuildInteraction =
|
||||
| APIChatInputApplicationCommandGuildInteraction
|
||||
| APIContextMenuGuildInteraction;
|
||||
33
deno/payloads/v10/_interactions/autocomplete.ts
Normal file
33
deno/payloads/v10/_interactions/autocomplete.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
import type {
|
||||
APIBaseInteraction,
|
||||
APIChatInputApplicationCommandInteractionData,
|
||||
APIDMInteractionWrapper,
|
||||
APIGuildInteractionWrapper,
|
||||
InteractionType,
|
||||
} from '../mod.ts';
|
||||
|
||||
export type APIApplicationCommandAutocompleteInteraction = APIBaseInteraction<
|
||||
InteractionType.ApplicationCommandAutocomplete,
|
||||
APIChatInputApplicationCommandInteractionData
|
||||
> &
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<
|
||||
InteractionType.ApplicationCommandAutocomplete,
|
||||
Required<Pick<APIChatInputApplicationCommandInteractionData, 'options'>>
|
||||
>,
|
||||
'data'
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIApplicationCommandAutocompleteDMInteraction =
|
||||
APIDMInteractionWrapper<APIApplicationCommandAutocompleteInteraction>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIApplicationCommandAutocompleteGuildInteraction =
|
||||
APIGuildInteractionWrapper<APIApplicationCommandAutocompleteInteraction>;
|
||||
174
deno/payloads/v10/_interactions/base.ts
Normal file
174
deno/payloads/v10/_interactions/base.ts
Normal file
@@ -0,0 +1,174 @@
|
||||
import type { InteractionType } from './responses.ts';
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { APIRole, LocaleString } from '../../../v10.ts';
|
||||
import type { APIAttachment, APIMessage, APIPartialChannel, APIThreadMetadata } from '../channel.ts';
|
||||
import type { APIGuildMember } from '../guild.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
|
||||
export type PartialAPIMessageInteractionGuildMember = Pick<
|
||||
APIGuildMember,
|
||||
| 'roles'
|
||||
| 'premium_since'
|
||||
| 'pending'
|
||||
| 'nick'
|
||||
| 'mute'
|
||||
| 'joined_at'
|
||||
| 'deaf'
|
||||
| 'communication_disabled_until'
|
||||
| 'avatar'
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#message-interaction-object
|
||||
*/
|
||||
export interface APIMessageInteraction {
|
||||
/**
|
||||
* ID of the interaction
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The type of interaction
|
||||
*/
|
||||
type: InteractionType;
|
||||
/**
|
||||
* The name of the application command, including subcommands and subcommand groups
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The user who invoked the interaction
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* The guild member who invoked the interaction, only sent in MESSAGE_CREATE events
|
||||
*/
|
||||
member?: PartialAPIMessageInteractionGuildMember;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
export interface APIInteractionGuildMember extends APIGuildMember {
|
||||
permissions: Permissions;
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
// INTERACTIONS RECEIVED
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export interface APIBaseInteraction<Type extends InteractionType, Data> {
|
||||
/**
|
||||
* ID of the interaction
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* ID of the application this interaction is for
|
||||
*/
|
||||
application_id: Snowflake;
|
||||
/**
|
||||
* The type of interaction
|
||||
*/
|
||||
type: Type;
|
||||
/**
|
||||
* The command data payload
|
||||
*/
|
||||
data?: Data;
|
||||
/**
|
||||
* The guild it was sent from
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The channel it was sent from
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* Guild member data for the invoking user, including permissions
|
||||
*
|
||||
* **This is only sent when an interaction is invoked in a guild**
|
||||
*/
|
||||
member?: APIInteractionGuildMember;
|
||||
/**
|
||||
* User object for the invoking user, if invoked in a DM
|
||||
*/
|
||||
user?: APIUser;
|
||||
/**
|
||||
* A continuation token for responding to the interaction
|
||||
*/
|
||||
token: string;
|
||||
/**
|
||||
* Read-only property, always `1`
|
||||
*/
|
||||
version: 1;
|
||||
/**
|
||||
* For components, the message they were attached to
|
||||
*/
|
||||
message?: APIMessage;
|
||||
/**
|
||||
* Bitwise set of permissions the app or bot has within the channel the interaction was sent from
|
||||
*/
|
||||
app_permissions?: Permissions;
|
||||
/**
|
||||
* The selected language of the invoking user
|
||||
*/
|
||||
locale: LocaleString;
|
||||
/**
|
||||
* The guild's preferred locale, if invoked in a guild
|
||||
*/
|
||||
guild_locale?: LocaleString;
|
||||
}
|
||||
|
||||
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'member' | 'guild_id'
|
||||
> &
|
||||
Required<Pick<Original, 'user'>>;
|
||||
|
||||
export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'user'
|
||||
> &
|
||||
Required<Pick<Original, 'member' | 'guild_id'>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedChannel extends Required<APIPartialChannel> {
|
||||
thread_metadata?: APIThreadMetadata | null;
|
||||
permissions: Permissions;
|
||||
parent_id?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
export interface APIInteractionDataResolvedGuildMember extends Omit<APIGuildMember, 'user' | 'deaf' | 'mute'> {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure
|
||||
*/
|
||||
export interface APIInteractionDataResolved {
|
||||
users?: Record<Snowflake, APIUser>;
|
||||
roles?: Record<Snowflake, APIRole>;
|
||||
members?: Record<Snowflake, APIInteractionDataResolvedGuildMember>;
|
||||
channels?: Record<Snowflake, APIInteractionDataResolvedChannel>;
|
||||
attachments?: Record<Snowflake, APIAttachment>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Renamed to `APIInteractionDataResolved`
|
||||
*/
|
||||
export type APIChatInputApplicationCommandInteractionDataResolved = APIInteractionDataResolved;
|
||||
|
||||
/**
|
||||
* `users` and optional `members` from APIInteractionDataResolved, for user commands and user selects
|
||||
*/
|
||||
export type APIUserInteractionDataResolved = Required<Pick<APIInteractionDataResolved, 'users'>> &
|
||||
Pick<APIInteractionDataResolved, 'members'>;
|
||||
|
||||
/**
|
||||
* @deprecated Renamed to `APIUserInteractionDataResolved`
|
||||
*/
|
||||
export type APIUserApplicationCommandInteractionDataResolved = APIUserInteractionDataResolved;
|
||||
97
deno/payloads/v10/_interactions/messageComponents.ts
Normal file
97
deno/payloads/v10/_interactions/messageComponents.ts
Normal file
@@ -0,0 +1,97 @@
|
||||
import type {
|
||||
APIDMInteractionWrapper,
|
||||
APIGuildInteractionWrapper,
|
||||
APIInteractionDataResolved,
|
||||
APIUserInteractionDataResolved,
|
||||
} from './base.ts';
|
||||
import type { Snowflake } from '../../../globals.ts';
|
||||
import type { ComponentType } from '../channel.ts';
|
||||
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
|
||||
|
||||
export type APIMessageComponentInteraction = APIBaseInteraction<
|
||||
InteractionType.MessageComponent,
|
||||
APIMessageComponentInteractionData
|
||||
> &
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
export type APIMessageComponentButtonInteraction = APIBaseInteraction<
|
||||
InteractionType.MessageComponent,
|
||||
APIMessageButtonInteractionData
|
||||
> &
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
|
||||
InteractionType.MessageComponent,
|
||||
APIMessageSelectMenuInteractionData
|
||||
> &
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
|
||||
'channel_id' | 'data' | 'app_permissions' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
export type APIMessageComponentInteractionData = APIMessageButtonInteractionData | APIMessageSelectMenuInteractionData;
|
||||
|
||||
export interface APIMessageComponentBaseInteractionData<CType extends ComponentType> {
|
||||
/**
|
||||
* The `custom_id` of the component
|
||||
*/
|
||||
custom_id: string;
|
||||
/**
|
||||
* The type of the component
|
||||
*/
|
||||
component_type: CType;
|
||||
}
|
||||
|
||||
export type APIMessageButtonInteractionData = APIMessageComponentBaseInteractionData<ComponentType.Button>;
|
||||
|
||||
export interface APIMessageStringSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.StringSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIMessageUserSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.UserSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: APIUserInteractionDataResolved;
|
||||
}
|
||||
|
||||
export interface APIMessageRoleSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.RoleSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: Required<Pick<APIInteractionDataResolved, 'roles'>>;
|
||||
}
|
||||
|
||||
export interface APIMessageMentionableSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.MentionableSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: Pick<APIInteractionDataResolved, 'users' | 'members' | 'roles'>;
|
||||
}
|
||||
|
||||
export interface APIMessageChannelSelectInteractionData
|
||||
extends APIMessageComponentBaseInteractionData<ComponentType.ChannelSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: Required<Pick<APIInteractionDataResolved, 'channels'>>;
|
||||
}
|
||||
|
||||
export type APIMessageSelectMenuInteractionData =
|
||||
| APIMessageStringSelectInteractionData
|
||||
| APIMessageUserSelectInteractionData
|
||||
| APIMessageRoleSelectInteractionData
|
||||
| APIMessageMentionableSelectInteractionData
|
||||
| APIMessageChannelSelectInteractionData;
|
||||
|
||||
export type APIMessageComponentDMInteraction = APIDMInteractionWrapper<APIMessageComponentInteraction>;
|
||||
|
||||
export type APIMessageComponentGuildInteraction = APIGuildInteractionWrapper<APIMessageComponentInteraction>;
|
||||
49
deno/payloads/v10/_interactions/modalSubmit.ts
Normal file
49
deno/payloads/v10/_interactions/modalSubmit.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts';
|
||||
import type {
|
||||
APIBaseInteraction,
|
||||
APIDMInteractionWrapper,
|
||||
APIGuildInteractionWrapper,
|
||||
ComponentType,
|
||||
InteractionType,
|
||||
} from '../mod.ts';
|
||||
|
||||
export interface ModalSubmitComponent {
|
||||
type: ComponentType;
|
||||
custom_id: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface ModalSubmitActionRowComponent
|
||||
extends Omit<APIActionRowComponent<APIModalActionRowComponent>, 'components'> {
|
||||
components: ModalSubmitComponent[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure
|
||||
*/
|
||||
export interface APIModalSubmission {
|
||||
/**
|
||||
* A developer-defined identifier for the component, max 100 characters
|
||||
*/
|
||||
custom_id: string;
|
||||
/**
|
||||
* A list of child components
|
||||
*/
|
||||
components: ModalSubmitActionRowComponent[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIModalSubmitInteraction = APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission> &
|
||||
Required<Pick<APIBaseInteraction<InteractionType.ModalSubmit, APIModalSubmission>, 'data'>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIModalSubmitDMInteraction = APIDMInteractionWrapper<APIModalSubmitInteraction>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIModalSubmitGuildInteraction = APIGuildInteractionWrapper<APIModalSubmitInteraction>;
|
||||
4
deno/payloads/v10/_interactions/ping.ts
Normal file
4
deno/payloads/v10/_interactions/ping.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
import type { APIBaseInteraction } from './base.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
|
||||
export type APIPingInteraction = Omit<APIBaseInteraction<InteractionType.Ping, never>, 'locale'>;
|
||||
124
deno/payloads/v10/_interactions/responses.ts
Normal file
124
deno/payloads/v10/_interactions/responses.ts
Normal file
@@ -0,0 +1,124 @@
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v10.ts';
|
||||
import type { APIActionRowComponent, APIModalActionRowComponent } from '../channel.ts';
|
||||
import type { MessageFlags } from '../mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type
|
||||
*/
|
||||
export enum InteractionType {
|
||||
Ping = 1,
|
||||
ApplicationCommand,
|
||||
MessageComponent,
|
||||
ApplicationCommandAutocomplete,
|
||||
ModalSubmit,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object
|
||||
*/
|
||||
export type APIInteractionResponse =
|
||||
| APIInteractionResponsePong
|
||||
| APIInteractionResponseChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredMessageUpdate
|
||||
| APIInteractionResponseUpdateMessage
|
||||
| APIApplicationCommandAutocompleteResponse
|
||||
| APIModalInteractionResponse;
|
||||
|
||||
export interface APIInteractionResponsePong {
|
||||
type: InteractionResponseType.Pong;
|
||||
}
|
||||
|
||||
export interface APIApplicationCommandAutocompleteResponse {
|
||||
type: InteractionResponseType.ApplicationCommandAutocompleteResult;
|
||||
data: APICommandAutocompleteInteractionResponseCallbackData;
|
||||
}
|
||||
|
||||
export interface APIModalInteractionResponse {
|
||||
type: InteractionResponseType.Modal;
|
||||
data: APIModalInteractionResponseCallbackData;
|
||||
}
|
||||
|
||||
export interface APIInteractionResponseChannelMessageWithSource {
|
||||
type: InteractionResponseType.ChannelMessageWithSource;
|
||||
data: APIInteractionResponseCallbackData;
|
||||
}
|
||||
|
||||
export interface APIInteractionResponseDeferredChannelMessageWithSource {
|
||||
type: InteractionResponseType.DeferredChannelMessageWithSource;
|
||||
data?: Pick<APIInteractionResponseCallbackData, 'flags'>;
|
||||
}
|
||||
|
||||
export interface APIInteractionResponseDeferredMessageUpdate {
|
||||
type: InteractionResponseType.DeferredMessageUpdate;
|
||||
}
|
||||
|
||||
export interface APIInteractionResponseUpdateMessage {
|
||||
type: InteractionResponseType.UpdateMessage;
|
||||
data?: APIInteractionResponseCallbackData;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-type
|
||||
*/
|
||||
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,
|
||||
/**
|
||||
* ACK a button interaction and update it to a loading state
|
||||
*/
|
||||
DeferredMessageUpdate,
|
||||
/**
|
||||
* ACK a button interaction and edit the message to which the button was attached
|
||||
*/
|
||||
UpdateMessage,
|
||||
/**
|
||||
* For autocomplete interactions
|
||||
*/
|
||||
ApplicationCommandAutocompleteResult,
|
||||
/**
|
||||
* Respond to an interaction with an modal for a user to fill-out
|
||||
*/
|
||||
Modal,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-data-structure
|
||||
*/
|
||||
export type APIInteractionResponseCallbackData = Omit<
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
'username' | 'avatar_url'
|
||||
> & { flags?: MessageFlags };
|
||||
|
||||
export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-modal
|
||||
*/
|
||||
export interface APIModalInteractionResponseCallbackData {
|
||||
/**
|
||||
* A developer-defined identifier for the component, max 100 characters
|
||||
*/
|
||||
custom_id: string;
|
||||
/**
|
||||
* The title of the popup modal
|
||||
*/
|
||||
title: string;
|
||||
/**
|
||||
* Between 1 and 5 (inclusive) components that make up the modal
|
||||
*/
|
||||
components: APIActionRowComponent<APIModalActionRowComponent>[];
|
||||
}
|
||||
252
deno/payloads/v10/application.ts
Normal file
252
deno/payloads/v10/application.ts
Normal file
@@ -0,0 +1,252 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/application
|
||||
*/
|
||||
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APITeam } from './teams.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { LocalizationMap } from '../common.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* An empty string
|
||||
*
|
||||
* @deprecated This field will be removed in v11
|
||||
*/
|
||||
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#getticket
|
||||
*/
|
||||
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
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
flags: ApplicationFlags;
|
||||
/**
|
||||
* Up to 5 tags describing the content and functionality of the application
|
||||
*/
|
||||
tags?: [string, string?, string?, string?, string?];
|
||||
/**
|
||||
* Settings for the application's default in-app authorization link, if enabled
|
||||
*/
|
||||
install_params?: APIApplicationInstallParams;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
custom_install_url?: string;
|
||||
/**
|
||||
* The application's role connection verification entry point,
|
||||
* which when configured will render the app as a verification method in the guild role verification configuration
|
||||
*/
|
||||
role_connections_verification_url?: string;
|
||||
}
|
||||
|
||||
export interface APIApplicationInstallParams {
|
||||
scopes: OAuth2Scopes[];
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application#application-object-application-flags
|
||||
*/
|
||||
export enum ApplicationFlags {
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
EmbeddedReleased = 1 << 1,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
ManagedEmoji = 1 << 2,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
GroupDMCreate = 1 << 4,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
RPCHasConnected = 1 << 11,
|
||||
/**
|
||||
* Intent required for bots in 100 or more servers to receive `presence_update` events
|
||||
*/
|
||||
GatewayPresence = 1 << 12,
|
||||
/**
|
||||
* Intent required for bots in under 100 servers to receive `presence_update` events, found in Bot Settings
|
||||
*/
|
||||
GatewayPresenceLimited = 1 << 13,
|
||||
/**
|
||||
* Intent required for bots in 100 or more servers to receive member-related events like `guild_member_add`.
|
||||
* See list of member-related events [under `GUILD_MEMBERS`](https://discord.com/developers/docs/topics/gateway#list-of-intents)
|
||||
*/
|
||||
GatewayGuildMembers = 1 << 14,
|
||||
/**
|
||||
* Intent required for bots in under 100 servers to receive member-related events like `guild_member_add`, found in Bot Settings.
|
||||
* See list of member-related events [under `GUILD_MEMBERS`](https://discord.com/developers/docs/topics/gateway#list-of-intents)
|
||||
*/
|
||||
GatewayGuildMembersLimited = 1 << 15,
|
||||
/**
|
||||
* Indicates unusual growth of an app that prevents verification
|
||||
*/
|
||||
VerificationPendingGuildLimit = 1 << 16,
|
||||
/**
|
||||
* Indicates if an app is embedded within the Discord client (currently unavailable publicly)
|
||||
*/
|
||||
Embedded = 1 << 17,
|
||||
/**
|
||||
* Intent required for bots in 100 or more servers to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055)
|
||||
*/
|
||||
GatewayMessageContent = 1 << 18,
|
||||
/**
|
||||
* Intent required for bots in under 100 servers to receive [message content](https://support-dev.discord.com/hc/en-us/articles/4404772028055),
|
||||
* found in Bot Settings
|
||||
*/
|
||||
GatewayMessageContentLimited = 1 << 19,
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
EmbeddedFirstParty = 1 << 20,
|
||||
/**
|
||||
* Indicates if an app has registered global [application commands](https://discord.com/developers/docs/interactions/application-commands)
|
||||
*/
|
||||
ApplicationCommandBadge = 1 << 23,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-structure
|
||||
*/
|
||||
export interface APIApplicationRoleConnectionMetadata {
|
||||
/**
|
||||
* Type of metadata value
|
||||
*/
|
||||
type: ApplicationRoleConnectionMetadataType;
|
||||
/**
|
||||
* Dictionary key for the metadata field (must be `a-z`, `0-9`, or `_` characters; max 50 characters)
|
||||
*/
|
||||
key: string;
|
||||
/**
|
||||
* Name of the metadata field (max 100 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Translations of the name
|
||||
*/
|
||||
name_localizations?: LocalizationMap;
|
||||
/**
|
||||
* Description of the metadata field (max 200 characters)
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* Translations of the description
|
||||
*/
|
||||
description_localizations?: LocalizationMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/application-role-connection-metadata#application-role-connection-metadata-object-application-role-connection-metadata-type
|
||||
*/
|
||||
export enum ApplicationRoleConnectionMetadataType {
|
||||
/**
|
||||
* The metadata value (`integer`) is less than or equal to the guild's configured value (`integer`)
|
||||
*/
|
||||
IntegerLessThanOrEqual = 1,
|
||||
/**
|
||||
* The metadata value (`integer`) is greater than or equal to the guild's configured value (`integer`)
|
||||
*/
|
||||
IntegerGreaterThanOrEqual,
|
||||
/**
|
||||
* The metadata value (`integer`) is equal to the guild's configured value (`integer`)
|
||||
*/
|
||||
IntegerEqual,
|
||||
/**
|
||||
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`)
|
||||
*/
|
||||
IntegerNotEqual,
|
||||
/**
|
||||
* The metadata value (`ISO8601 string`) is less than or equal to the guild's configured value (`integer`; days before current date)
|
||||
*/
|
||||
DatetimeLessThanOrEqual,
|
||||
/**
|
||||
* The metadata value (`ISO8601 string`) is greater than or equal to the guild's configured value (`integer`; days before current date)
|
||||
*/
|
||||
DatetimeGreaterThanOrEqual,
|
||||
/**
|
||||
* The metadata value (`integer`) is equal to the guild's configured value (`integer`; `1`)
|
||||
*/
|
||||
BooleanEqual,
|
||||
/**
|
||||
* The metadata value (`integer`) is not equal to the guild's configured value (`integer`; `1`)
|
||||
*/
|
||||
BooleanNotEqual,
|
||||
}
|
||||
811
deno/payloads/v10/auditLog.ts
Normal file
811
deno/payloads/v10/auditLog.ts
Normal file
@@ -0,0 +1,811 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/audit-log
|
||||
*/
|
||||
|
||||
import type {
|
||||
APIAutoModerationAction,
|
||||
APIAutoModerationRule,
|
||||
APIAutoModerationRuleTriggerMetadata,
|
||||
AutoModerationRuleEventType,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from './autoModeration.ts';
|
||||
import type { APIChannel, APIOverwrite } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildMFALevel,
|
||||
GuildVerificationLevel,
|
||||
IntegrationExpireBehavior,
|
||||
} from './guild.ts';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
GuildScheduledEventEntityType,
|
||||
GuildScheduledEventStatus,
|
||||
} from './guildScheduledEvent.ts';
|
||||
import type { APIApplicationCommand } from './interactions.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { StageInstancePrivacyLevel } from './stageInstance.ts';
|
||||
import type { StickerFormatType } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIWebhook } from './webhook.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
|
||||
*/
|
||||
export interface APIAuditLog {
|
||||
/**
|
||||
* List of application commands found in the audit log
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/application-commands#application-command-object
|
||||
*/
|
||||
application_commands: APIApplicationCommand[];
|
||||
/**
|
||||
* 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[];
|
||||
/**
|
||||
* List of auto moderation rules referenced in the audit log
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object
|
||||
*/
|
||||
auto_moderation_rules: APIAutoModerationRule[];
|
||||
/**
|
||||
* Partial integration objects
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#integration-object
|
||||
*/
|
||||
integrations: APIGuildIntegration[];
|
||||
/**
|
||||
* Threads found in the audit log
|
||||
*
|
||||
* Threads referenced in THREAD_CREATE and THREAD_UPDATE events are included in the threads map, since archived threads might not be kept in memory by clients.
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
threads: APIChannel[];
|
||||
/**
|
||||
* The guild scheduled events in the audit log
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object
|
||||
*/
|
||||
guild_scheduled_events: APIGuildScheduledEvent[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
GuildUpdate = 1,
|
||||
|
||||
ChannelCreate = 10,
|
||||
ChannelUpdate,
|
||||
ChannelDelete,
|
||||
ChannelOverwriteCreate,
|
||||
ChannelOverwriteUpdate,
|
||||
ChannelOverwriteDelete,
|
||||
|
||||
MemberKick = 20,
|
||||
MemberPrune,
|
||||
MemberBanAdd,
|
||||
MemberBanRemove,
|
||||
MemberUpdate,
|
||||
MemberRoleUpdate,
|
||||
MemberMove,
|
||||
MemberDisconnect,
|
||||
BotAdd,
|
||||
|
||||
RoleCreate = 30,
|
||||
RoleUpdate,
|
||||
RoleDelete,
|
||||
|
||||
InviteCreate = 40,
|
||||
InviteUpdate,
|
||||
InviteDelete,
|
||||
|
||||
WebhookCreate = 50,
|
||||
WebhookUpdate,
|
||||
WebhookDelete,
|
||||
|
||||
EmojiCreate = 60,
|
||||
EmojiUpdate,
|
||||
EmojiDelete,
|
||||
|
||||
MessageDelete = 72,
|
||||
MessageBulkDelete,
|
||||
MessagePin,
|
||||
MessageUnpin,
|
||||
|
||||
IntegrationCreate = 80,
|
||||
IntegrationUpdate,
|
||||
IntegrationDelete,
|
||||
StageInstanceCreate,
|
||||
StageInstanceUpdate,
|
||||
StageInstanceDelete,
|
||||
|
||||
StickerCreate = 90,
|
||||
StickerUpdate,
|
||||
StickerDelete,
|
||||
|
||||
GuildScheduledEventCreate = 100,
|
||||
GuildScheduledEventUpdate,
|
||||
GuildScheduledEventDelete,
|
||||
|
||||
ThreadCreate = 110,
|
||||
ThreadUpdate,
|
||||
ThreadDelete,
|
||||
|
||||
ApplicationCommandPermissionUpdate = 121,
|
||||
|
||||
AutoModerationRuleCreate = 140,
|
||||
AutoModerationRuleUpdate,
|
||||
AutoModerationRuleDelete,
|
||||
AutoModerationBlockMessage,
|
||||
AutoModerationFlagToChannel,
|
||||
AutoModerationUserCommunicationDisabled,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
|
||||
*/
|
||||
export interface APIAuditLogOptions {
|
||||
/**
|
||||
* Name of the Auto Moderation rule that was triggered
|
||||
*
|
||||
* Present from:
|
||||
* - AUTO_MODERATION_BLOCK_MESSAGE
|
||||
* - AUTO_MODERATION_FLAG_TO_CHANNEL
|
||||
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
|
||||
*/
|
||||
auto_moderation_rule_name?: string;
|
||||
/**
|
||||
* Trigger type of the Auto Moderation rule that was triggered
|
||||
*
|
||||
* Present from:
|
||||
* - AUTO_MODERATION_BLOCK_MESSAGE
|
||||
* - AUTO_MODERATION_FLAG_TO_CHANNEL
|
||||
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
|
||||
*/
|
||||
auto_moderation_rule_trigger_type?: AuditLogRuleTriggerType;
|
||||
/**
|
||||
* 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
|
||||
* - STAGE_INSTANCE_CREATE
|
||||
* - STAGE_INSTANCE_UPDATE
|
||||
* - STAGE_INSTANCE_DELETE
|
||||
* - AUTO_MODERATION_BLOCK_MESSAGE
|
||||
* - AUTO_MODERATION_FLAG_TO_CHANNEL
|
||||
* - AUTO_MODERATION_USER_COMMUNICATION_DISABLED
|
||||
*/
|
||||
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',
|
||||
}
|
||||
|
||||
export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
|
||||
*/
|
||||
export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeyImageHash
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyOwnerId
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyPreferredLocale
|
||||
| APIAuditLogChangeKeyAFKChannelId
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyRulesChannelId
|
||||
| APIAuditLogChangeKeyPublicUpdatesChannelId
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyVerificationLevel
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyVanityURLCode
|
||||
| APIAuditLogChangeKey$Add
|
||||
| APIAuditLogChangeKey$Remove
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyWidgetEnabled
|
||||
| APIAuditLogChangeKeyWidgetChannelId
|
||||
| APIAuditLogChangeKeySystemChannelId
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyTopic
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyApplicationId
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyAllow
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyChannelId
|
||||
| APIAuditLogChangeKeyInviterId
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyId
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyEnableEmoticons
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyUserLimit
|
||||
| APIAuditLogChangeKeyPrivacyLevel
|
||||
| APIAuditLogChangeKeyTags
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeyLocation
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil
|
||||
| APIAuditLogChangeKeyTriggerType
|
||||
| APIAuditLogChangeKeyEventType
|
||||
| APIAuditLogChangeKeyTriggerMetadata
|
||||
| APIAuditLogChangeKeyActions
|
||||
| APIAuditLogChangeKeyEnabled
|
||||
| APIAuditLogChangeKeyExemptRoles
|
||||
| APIAuditLogChangeKeyExemptChannels;
|
||||
|
||||
/**
|
||||
* Returned when an entity's name is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyName = AuditLogChangeData<'name', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's or sticker's or guild scheduled event'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 scheduled event's cover image is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyImageHash = AuditLogChangeData<'image_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>;
|
||||
|
||||
/**
|
||||
* Represents a change where the key is a snowflake.
|
||||
* Currently, the only known instance of this is returned when permissions for a command were updated (<insert name of object here>)
|
||||
*/
|
||||
export type APIAuditLogChangeKeySnowflake = AuditLogChangeData<Snowflake, unknown>;
|
||||
|
||||
/**
|
||||
* 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 or guild scheduled event'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<'nick', string>;
|
||||
|
||||
/**
|
||||
* 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', number | 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>;
|
||||
|
||||
/**
|
||||
* Returned when privacy level of a stage instance or guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPrivacyLevel = AuditLogChangeData<'privacy_level', StageInstancePrivacyLevel>;
|
||||
|
||||
/**
|
||||
* Returned when a sticker's related emoji is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTags = AuditLogChangeData<'tags', string>;
|
||||
|
||||
/**
|
||||
* Returned when a sticker's format_type is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyFormatType = AuditLogChangeData<'format_type', StickerFormatType>;
|
||||
|
||||
/**
|
||||
* Empty string
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAsset = AuditLogChangeData<'asset', ''>;
|
||||
|
||||
/**
|
||||
* Returned when a sticker's availability is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvailable = AuditLogChangeData<'available', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a sticker's guild_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyGuildId = AuditLogChangeData<'guild_id', Snowflake>;
|
||||
|
||||
/*
|
||||
* Returned when a thread's archive status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyArchived = AuditLogChangeData<'archived', boolean>;
|
||||
|
||||
/*
|
||||
* Returned when a thread's lock status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyLocked = AuditLogChangeData<'locked', boolean>;
|
||||
|
||||
/*
|
||||
* Returned when a thread's auto archive duration is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAutoArchiveDuration = AuditLogChangeData<'auto_archive_duration', number>;
|
||||
|
||||
/*
|
||||
* Returned when a channel's default auto archive duration for newly created threads is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultAutoArchiveDuration = AuditLogChangeData<
|
||||
'default_auto_archive_duration',
|
||||
number
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when entity type of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEntityType = AuditLogChangeData<'entity_type', GuildScheduledEventEntityType>;
|
||||
|
||||
/**
|
||||
* Returned when status of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyStatus = AuditLogChangeData<'status', GuildScheduledEventStatus>;
|
||||
|
||||
/**
|
||||
* Returned when location of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyLocation = AuditLogChangeData<'location', string>;
|
||||
|
||||
/**
|
||||
* Returned when a user's timeout is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyCommunicationDisabledUntil = AuditLogChangeData<'communication_disabled_until', string>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's trigger type is changed (only in rule creation or deletion)
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTriggerType = AuditLogChangeData<'trigger_type', AutoModerationRuleTriggerType>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's event type is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEventType = AuditLogChangeData<'event_type', AutoModerationRuleEventType>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's trigger metadata is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTriggerMetadata = AuditLogChangeData<
|
||||
'trigger_metadata',
|
||||
APIAutoModerationRuleTriggerMetadata
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's actions is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyActions = AuditLogChangeData<'actions', APIAutoModerationAction[]>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's enabled status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEnabled = AuditLogChangeData<'enabled', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's exempt roles is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptRoles = AuditLogChangeData<'exempt_roles', Snowflake[]>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's exempt channels is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptChannels = AuditLogChangeData<'exempt_channels', Snowflake[]>;
|
||||
|
||||
interface AuditLogChangeData<K extends string, D> {
|
||||
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;
|
||||
}
|
||||
203
deno/payloads/v10/autoModeration.ts
Normal file
203
deno/payloads/v10/autoModeration.ts
Normal file
@@ -0,0 +1,203 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/auto-moderation
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-auto-moderation-rule-structure
|
||||
*/
|
||||
export interface APIAutoModerationRule {
|
||||
/**
|
||||
* The id of this rule
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The guild which this rule belongs to
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The rule name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The user id who created this rule
|
||||
*/
|
||||
creator_id: Snowflake;
|
||||
/**
|
||||
* The rule event type
|
||||
*/
|
||||
event_type: AutoModerationRuleEventType;
|
||||
/**
|
||||
* The rule trigger type
|
||||
*/
|
||||
trigger_type: AutoModerationRuleTriggerType;
|
||||
/**
|
||||
* The rule trigger metadata
|
||||
*/
|
||||
trigger_metadata: APIAutoModerationRuleTriggerMetadata;
|
||||
/**
|
||||
* The actions which will execute when this rule is triggered
|
||||
*/
|
||||
actions: APIAutoModerationAction[];
|
||||
/**
|
||||
* Whether this rule is enabled
|
||||
*/
|
||||
enabled: boolean;
|
||||
/**
|
||||
* The role ids that shouldn't be affected by this rule (Maximum of 20)
|
||||
*/
|
||||
exempt_roles: Snowflake[];
|
||||
/**
|
||||
* The channel ids that shouldn't be affected by this rule (Maximum of 50)
|
||||
*/
|
||||
exempt_channels: Snowflake[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-types
|
||||
*/
|
||||
export enum AutoModerationRuleTriggerType {
|
||||
/**
|
||||
* Check if content contains words from a user defined list of keywords (Maximum of 3 per guild)
|
||||
*/
|
||||
Keyword = 1,
|
||||
/**
|
||||
* Check if content represents generic spam (Maximum of 1 per guild)
|
||||
*/
|
||||
Spam = 3,
|
||||
/**
|
||||
* Check if content contains words from internal pre-defined wordsets (Maximum of 1 per guild)
|
||||
*/
|
||||
KeywordPreset,
|
||||
/**
|
||||
* Check if content contains more mentions than allowed (Maximum of 1 per guild)
|
||||
*/
|
||||
MentionSpam,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-trigger-metadata
|
||||
*/
|
||||
export interface APIAutoModerationRuleTriggerMetadata {
|
||||
/**
|
||||
* Substrings which will be searched for in content (Maximum of 1000)
|
||||
*
|
||||
* A keyword can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 30 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
*/
|
||||
keyword_filter?: string[];
|
||||
/**
|
||||
* The internally pre-defined wordsets which will be searched for in content
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
|
||||
*/
|
||||
presets?: AutoModerationRuleKeywordPresetType[];
|
||||
/**
|
||||
* Substrings which will be exempt from triggering the preset trigger type (Maximum of 1000)
|
||||
*
|
||||
* A allowed-word can be a phrase which contains multiple words. Wildcard symbols can be used to customize how each string will be matched. Each keyword must be 30 characters or less
|
||||
* See [keyword matching strategies](https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.KeywordPreset}
|
||||
*/
|
||||
allow_list?: string[];
|
||||
/**
|
||||
* Regular expression patterns which will be matched against content (Maximum of 10)
|
||||
*
|
||||
* Only Rust flavored regex is currently supported (Maximum of 75 characters)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.Keyword}
|
||||
*/
|
||||
regex_patterns?: string[];
|
||||
/**
|
||||
* Total number of mentions (role & user) allowed per message (Maximum of 50)
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
|
||||
*/
|
||||
mention_total_limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-preset-types
|
||||
*/
|
||||
export enum AutoModerationRuleKeywordPresetType {
|
||||
/**
|
||||
* Words that may be considered forms of swearing or cursing
|
||||
*/
|
||||
Profanity = 1,
|
||||
/**
|
||||
* Words that refer to sexually explicit behavior or activity
|
||||
*/
|
||||
SexualContent,
|
||||
/**
|
||||
* Personal insults or words that may be considered hate speech
|
||||
*/
|
||||
Slurs,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-event-types
|
||||
*/
|
||||
export enum AutoModerationRuleEventType {
|
||||
/**
|
||||
* When a member sends or edits a message in the guild
|
||||
*/
|
||||
MessageSend = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-auto-moderation-action-structure
|
||||
*/
|
||||
export interface APIAutoModerationAction {
|
||||
/**
|
||||
* The action type
|
||||
*/
|
||||
type: AutoModerationActionType;
|
||||
/**
|
||||
* Additional metadata needed during execution for this specific action type
|
||||
*
|
||||
* Will only be omitted if the action type is {@link AutoModerationActionType.BlockMessage}
|
||||
*/
|
||||
metadata?: APIAutoModerationActionMetadata;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types
|
||||
*/
|
||||
export enum AutoModerationActionType {
|
||||
/**
|
||||
* Blocks the content of a message according to the rule
|
||||
*/
|
||||
BlockMessage = 1,
|
||||
/**
|
||||
* Logs user content to a specified channel
|
||||
*/
|
||||
SendAlertMessage,
|
||||
/**
|
||||
* Timeout user for specified duration, this action type can be set if the bot has `MODERATE_MEMBERS` permission
|
||||
*/
|
||||
Timeout,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-metadata
|
||||
*/
|
||||
export interface APIAutoModerationActionMetadata {
|
||||
/**
|
||||
* Channel to which user content should be logged
|
||||
*
|
||||
* Associated action type: {@link AutoModerationActionType.SendAlertMessage}
|
||||
*/
|
||||
channel_id?: Snowflake;
|
||||
/**
|
||||
* Timeout duration in seconds (Maximum of 4 weeks - 2419200 seconds)
|
||||
*
|
||||
* Only available if using {@link AutoModerationRuleTriggerType.Keyword}
|
||||
*
|
||||
* Associated action type: {@link AutoModerationActionType.Timeout}
|
||||
*/
|
||||
duration_seconds?: number;
|
||||
}
|
||||
1633
deno/payloads/v10/channel.ts
Normal file
1633
deno/payloads/v10/channel.ts
Normal file
File diff suppressed because it is too large
Load Diff
51
deno/payloads/v10/emoji.ts
Normal file
51
deno/payloads/v10/emoji.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/emoji
|
||||
*/
|
||||
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.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;
|
||||
}
|
||||
387
deno/payloads/v10/gateway.ts
Normal file
387
deno/payloads/v10/gateway.ts
Normal file
@@ -0,0 +1,387 @@
|
||||
/**
|
||||
* Types extracted from
|
||||
* - https://discord.com/developers/docs/topics/gateway
|
||||
* - https://discord.com/developers/docs/topics/gateway-events
|
||||
*/
|
||||
|
||||
import type { APIChannel, APIThreadMember } from './channel.ts';
|
||||
import type { APIEmoji } from './emoji.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway
|
||||
*/
|
||||
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-events#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-events#activity-object
|
||||
*/
|
||||
activities?: GatewayActivity[];
|
||||
/**
|
||||
* User's platform-dependent status
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#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-events#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-events#activity-object-activity-structure
|
||||
*/
|
||||
export interface GatewayActivity {
|
||||
/**
|
||||
* The activity's id
|
||||
* @unstable
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The activity's name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Activity type
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#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;
|
||||
/**
|
||||
* The Spotify song id
|
||||
* @unstable
|
||||
*/
|
||||
sync_id?: string;
|
||||
/**
|
||||
* The platform this activity is being done on
|
||||
* @unstable You can use {@link ActivityPlatform} as a stepping stone, but this might be inaccurate
|
||||
*/
|
||||
platform?: string;
|
||||
/**
|
||||
* 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-events#activity-object-activity-emoji
|
||||
*/
|
||||
emoji?: GatewayActivityEmoji;
|
||||
/**
|
||||
* @unstable
|
||||
*/
|
||||
session_id?: string;
|
||||
/**
|
||||
* Information for the current party of the player
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party
|
||||
*/
|
||||
party?: GatewayActivityParty;
|
||||
/**
|
||||
* Images for the presence and their hover texts
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets
|
||||
*/
|
||||
assets?: GatewayActivityAssets;
|
||||
/**
|
||||
* Secrets for Rich Presence joining and spectating
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/gateway-events#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-events#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[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @unstable This enum is currently not documented by Discord but has known values which we will try to keep up to date.
|
||||
* Values might be added or removed without a major version bump.
|
||||
*/
|
||||
export enum ActivityPlatform {
|
||||
Desktop = 'desktop',
|
||||
Xbox = 'xbox',
|
||||
Samsung = 'samsung',
|
||||
IOS = 'ios',
|
||||
Android = 'android',
|
||||
Embedded = 'embedded',
|
||||
PS4 = 'ps4',
|
||||
PS5 = 'ps5',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-types
|
||||
*/
|
||||
export enum ActivityType {
|
||||
/**
|
||||
* Playing {game}
|
||||
*/
|
||||
Playing,
|
||||
/**
|
||||
* Streaming {details}
|
||||
*/
|
||||
Streaming,
|
||||
/**
|
||||
* Listening to {name}
|
||||
*/
|
||||
Listening,
|
||||
/**
|
||||
* Watching {details}
|
||||
*/
|
||||
Watching,
|
||||
/**
|
||||
* {emoji} {details}
|
||||
*/
|
||||
Custom,
|
||||
/**
|
||||
* Competing in {name}
|
||||
*/
|
||||
Competing,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#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-events#activity-object-activity-emoji
|
||||
*/
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'id' | 'animated'>> & Pick<APIEmoji, 'name'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#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-events#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-events#activity-object-activity-secrets
|
||||
*/
|
||||
export type GatewayActivitySecrets = Partial<Record<'join' | 'spectate' | 'match', string>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags
|
||||
*/
|
||||
export enum ActivityFlags {
|
||||
Instance = 1 << 0,
|
||||
Join = 1 << 1,
|
||||
Spectate = 1 << 2,
|
||||
JoinRequest = 1 << 3,
|
||||
Sync = 1 << 4,
|
||||
Play = 1 << 5,
|
||||
PartyPrivacyFriends = 1 << 6,
|
||||
PartyPrivacyVoiceChannel = 1 << 7,
|
||||
Embedded = 1 << 8,
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-list-sync-thread-list-sync-event-fields
|
||||
*/
|
||||
export interface GatewayThreadListSync {
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The ids of all the parent channels whose threads are being synced, otherwise the entire guild
|
||||
*/
|
||||
channel_ids?: Snowflake[];
|
||||
/**
|
||||
* Array of the synced threads
|
||||
*/
|
||||
threads: APIChannel[];
|
||||
/**
|
||||
* The member objects for the client user in each joined thread that was synced
|
||||
*/
|
||||
members: APIThreadMember[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway-events#thread-members-update-thread-members-update-event-fields
|
||||
*/
|
||||
export interface GatewayThreadMembersUpdate {
|
||||
/**
|
||||
* The id of the thread for which members are being synced
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The id of the guild that the thread is in
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The approximate member count of the thread, does not count above 50 even if there are more members
|
||||
*/
|
||||
member_count: number;
|
||||
/**
|
||||
* The members that were added to the thread
|
||||
*/
|
||||
added_members?: APIThreadMember[];
|
||||
/**
|
||||
* The ids of the members that were removed from the thread
|
||||
*/
|
||||
removed_member_ids?: Snowflake[];
|
||||
}
|
||||
926
deno/payloads/v10/guild.ts
Normal file
926
deno/payloads/v10/guild.ts
Normal file
@@ -0,0 +1,926 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/guild
|
||||
*/
|
||||
|
||||
import type { APIEmoji } from './emoji.ts';
|
||||
import type { PresenceUpdateStatus } from './gateway.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APISticker } from './sticker.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Permissions, Snowflake } from '../../globals.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
|
||||
*/
|
||||
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;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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, can be set to: `60`, `300`, `900`, `1800`, `3600`
|
||||
*/
|
||||
afk_timeout: 60 | 300 | 900 | 1800 | 3600;
|
||||
/**
|
||||
* `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;
|
||||
/**
|
||||
* The maximum number of presences for the guild (`null` is always returned, apart from the largest of guilds)
|
||||
*/
|
||||
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
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* The welcome screen of a Community guild, shown to new members
|
||||
*
|
||||
* Returned in the invite object
|
||||
*/
|
||||
welcome_screen?: APIGuildWelcomeScreen;
|
||||
/**
|
||||
* The nsfw level of the guild
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object-guild-nsfw-level
|
||||
*/
|
||||
nsfw_level: GuildNSFWLevel;
|
||||
/**
|
||||
* Custom guild stickers
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
stickers: APISticker[];
|
||||
/**
|
||||
* Whether the guild has the boost progress bar enabled.
|
||||
*/
|
||||
premium_progress_bar_enabled: boolean;
|
||||
/**
|
||||
* The type of Student Hub the guild is
|
||||
*/
|
||||
hub_type: GuildHubType | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-default-message-notification-level
|
||||
*/
|
||||
export enum GuildDefaultMessageNotifications {
|
||||
AllMessages,
|
||||
OnlyMentions,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-explicit-content-filter-level
|
||||
*/
|
||||
export enum GuildExplicitContentFilter {
|
||||
Disabled,
|
||||
MembersWithoutRoles,
|
||||
AllMembers,
|
||||
}
|
||||
|
||||
/**
|
||||
* 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-guild-nsfw-level
|
||||
*/
|
||||
export enum GuildNSFWLevel {
|
||||
Default,
|
||||
Explicit,
|
||||
Safe,
|
||||
AgeRestricted,
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
VeryHigh,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-premium-tier
|
||||
*/
|
||||
export enum GuildPremiumTier {
|
||||
None,
|
||||
Tier1,
|
||||
Tier2,
|
||||
Tier3,
|
||||
}
|
||||
|
||||
export enum GuildHubType {
|
||||
Default,
|
||||
HighSchool,
|
||||
College,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-system-channel-flags
|
||||
*/
|
||||
export enum GuildSystemChannelFlags {
|
||||
/**
|
||||
* Suppress member join notifications
|
||||
*/
|
||||
SuppressJoinNotifications = 1 << 0,
|
||||
/**
|
||||
* Suppress server boost notifications
|
||||
*/
|
||||
SuppressPremiumSubscriptions = 1 << 1,
|
||||
/**
|
||||
* Suppress server setup tips
|
||||
*/
|
||||
SuppressGuildReminderNotifications = 1 << 2,
|
||||
/**
|
||||
* Hide member join sticker reply buttons
|
||||
*/
|
||||
SuppressJoinNotificationReplies = 1 << 3,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-object-guild-features
|
||||
*/
|
||||
export enum GuildFeature {
|
||||
/**
|
||||
* Guild has access to set an animated guild banner image
|
||||
*/
|
||||
AnimatedBanner = 'ANIMATED_BANNER',
|
||||
/**
|
||||
* Guild has access to set an animated guild icon
|
||||
*/
|
||||
AnimatedIcon = 'ANIMATED_ICON',
|
||||
/**
|
||||
* Guild is using the old permissions configuration behavior
|
||||
*
|
||||
* See https://discord.com/developers/docs/change-log#upcoming-application-command-permission-changes
|
||||
*/
|
||||
ApplicationCommandPermissionsV2 = 'APPLICATION_COMMAND_PERMISSIONS_V2',
|
||||
/**
|
||||
* Guild has set up auto moderation rules
|
||||
*/
|
||||
AutoModeration = 'AUTO_MODERATION',
|
||||
/**
|
||||
* Guild has access to set a guild banner image
|
||||
*/
|
||||
Banner = 'BANNER',
|
||||
/**
|
||||
* Guild can enable welcome screen, Membership Screening and discovery, and receives community updates
|
||||
*/
|
||||
Community = 'COMMUNITY',
|
||||
/*
|
||||
* Guild has been set as a support server on the App Directory
|
||||
*/
|
||||
DeveloperSupportServer = 'DEVELOPER_SUPPORT_SERVER',
|
||||
/**
|
||||
* Guild is able to be discovered in the directory
|
||||
*/
|
||||
Discoverable = 'DISCOVERABLE',
|
||||
/**
|
||||
* Guild is able to be featured in the directory
|
||||
*/
|
||||
Featurable = 'FEATURABLE',
|
||||
/**
|
||||
* Guild is listed in a directory channel
|
||||
*/
|
||||
HasDirectoryEntry = 'HAS_DIRECTORY_ENTRY',
|
||||
/**
|
||||
* Guild is a Student Hub
|
||||
*
|
||||
* See https://support.discord.com/hc/articles/4406046651927
|
||||
*
|
||||
* @unstable This feature is currently not documented by Discord, but has known value
|
||||
*/
|
||||
Hub = 'HUB',
|
||||
/**
|
||||
* Guild has disabled invite usage, preventing users from joining
|
||||
*/
|
||||
InvitesDisabled = 'INVITES_DISABLED',
|
||||
/**
|
||||
* Guild has access to set an invite splash background
|
||||
*/
|
||||
InviteSplash = 'INVITE_SPLASH',
|
||||
/**
|
||||
* Guild is in a Student Hub
|
||||
*
|
||||
* See https://support.discord.com/hc/articles/4406046651927
|
||||
*
|
||||
* @unstable This feature is currently not documented by Discord, but has known value
|
||||
*/
|
||||
LinkedToHub = 'LINKED_TO_HUB',
|
||||
/**
|
||||
* Guild has enabled Membership Screening
|
||||
*/
|
||||
MemberVerificationGateEnabled = 'MEMBER_VERIFICATION_GATE_ENABLED',
|
||||
/**
|
||||
* Guild has enabled monetization
|
||||
*/
|
||||
MonetizationEnabled = 'MONETIZATION_ENABLED',
|
||||
/**
|
||||
* Guild has increased custom sticker slots
|
||||
*/
|
||||
MoreStickers = 'MORE_STICKERS',
|
||||
/**
|
||||
* Guild has access to create news channels
|
||||
*/
|
||||
News = 'NEWS',
|
||||
/**
|
||||
* Guild is partnered
|
||||
*/
|
||||
Partnered = 'PARTNERED',
|
||||
/**
|
||||
* Guild can be previewed before joining via Membership Screening or the directory
|
||||
*/
|
||||
PreviewEnabled = 'PREVIEW_ENABLED',
|
||||
/**
|
||||
* Guild has access to create private threads
|
||||
*/
|
||||
PrivateThreads = 'PRIVATE_THREADS',
|
||||
RelayEnabled = 'RELAY_ENABLED',
|
||||
/**
|
||||
* Guild is able to set role icons
|
||||
*/
|
||||
RoleIcons = 'ROLE_ICONS',
|
||||
/**
|
||||
* Guild has enabled ticketed events
|
||||
*/
|
||||
TicketedEventsEnabled = 'TICKETED_EVENTS_ENABLED',
|
||||
/**
|
||||
* Guild has access to set a vanity URL
|
||||
*/
|
||||
VanityURL = 'VANITY_URL',
|
||||
/**
|
||||
* Guild is verified
|
||||
*/
|
||||
Verified = 'VERIFIED',
|
||||
/**
|
||||
* Guild has access to set 384kbps bitrate in voice (previously VIP voice servers)
|
||||
*/
|
||||
VIPRegions = 'VIP_REGIONS',
|
||||
/**
|
||||
* Guild has enabled the welcome screen
|
||||
*/
|
||||
WelcomeScreenEnabled = 'WELCOME_SCREEN_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;
|
||||
/**
|
||||
* Custom guild stickers
|
||||
*/
|
||||
stickers: APISticker[];
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* The member's guild avatar hash
|
||||
*/
|
||||
avatar?: 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/articles/360028038352
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* Timestamp of when the time out will be removed; until then, they cannot interact with the guild
|
||||
*/
|
||||
communication_disabled_until?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#integration-object
|
||||
*/
|
||||
export interface APIGuildIntegration {
|
||||
/**
|
||||
* Integration id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Integration name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Integration type
|
||||
*/
|
||||
type: APIGuildIntegrationType;
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* The scopes the application has been authorized for
|
||||
*/
|
||||
scopes?: OAuth2Scopes[];
|
||||
}
|
||||
|
||||
export type APIGuildIntegrationType = '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 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#guild-widget-object
|
||||
*/
|
||||
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#guild-widget-object-example-guild-widget
|
||||
*/
|
||||
export interface APIGuildWidgetChannel {
|
||||
id: Snowflake;
|
||||
name: string;
|
||||
position: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild#guild-widget-object-example-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',
|
||||
}
|
||||
152
deno/payloads/v10/guildScheduledEvent.ts
Normal file
152
deno/payloads/v10/guildScheduledEvent.ts
Normal file
@@ -0,0 +1,152 @@
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
interface APIGuildScheduledEventBase<Type extends GuildScheduledEventEntityType> {
|
||||
/**
|
||||
* The id of the guild event
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The guild id which the scheduled event belongs to
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The channel id in which the scheduled event will be hosted, or `null` if entity type is `EXTERNAL`
|
||||
*/
|
||||
channel_id: Snowflake | null;
|
||||
/**
|
||||
* The id of the user that created the scheduled event
|
||||
*/
|
||||
creator_id?: Snowflake | null;
|
||||
/**
|
||||
* The name of the scheduled event
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The description of the scheduled event
|
||||
*/
|
||||
description?: string | null;
|
||||
/**
|
||||
* The time the scheduled event will start
|
||||
*/
|
||||
scheduled_start_time: string;
|
||||
/**
|
||||
* The time at which the guild event will end, or `null` if the event does not have a scheduled time to end
|
||||
*/
|
||||
scheduled_end_time: string | null;
|
||||
/**
|
||||
* The privacy level of the scheduled event
|
||||
*/
|
||||
privacy_level: GuildScheduledEventPrivacyLevel;
|
||||
/**
|
||||
* The status of the scheduled event
|
||||
*/
|
||||
status: GuildScheduledEventStatus;
|
||||
/**
|
||||
* The type of hosting entity associated with the scheduled event
|
||||
*/
|
||||
entity_type: Type;
|
||||
/**
|
||||
* The id of the hosting entity associated with the scheduled event
|
||||
*/
|
||||
entity_id: Snowflake | null;
|
||||
/**
|
||||
* The entity metadata for the scheduled event
|
||||
*/
|
||||
entity_metadata: APIGuildScheduledEventEntityMetadata | null;
|
||||
/**
|
||||
* The user that created the scheduled event
|
||||
*/
|
||||
creator?: APIUser;
|
||||
/**
|
||||
* The number of users subscribed to the scheduled event
|
||||
*/
|
||||
user_count?: number;
|
||||
/**
|
||||
* The cover image of the scheduled event
|
||||
*/
|
||||
image?: string | null;
|
||||
}
|
||||
|
||||
export interface APIStageInstanceGuildScheduledEvent
|
||||
extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.StageInstance> {
|
||||
channel_id: Snowflake;
|
||||
entity_metadata: null;
|
||||
}
|
||||
|
||||
export interface APIVoiceGuildScheduledEvent extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.Voice> {
|
||||
channel_id: Snowflake;
|
||||
entity_metadata: null;
|
||||
}
|
||||
|
||||
export interface APIExternalGuildScheduledEvent
|
||||
extends APIGuildScheduledEventBase<GuildScheduledEventEntityType.External> {
|
||||
channel_id: null;
|
||||
entity_metadata: Required<APIGuildScheduledEventEntityMetadata>;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure
|
||||
*/
|
||||
export type APIGuildScheduledEvent =
|
||||
| APIStageInstanceGuildScheduledEvent
|
||||
| APIVoiceGuildScheduledEvent
|
||||
| APIExternalGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-metadata
|
||||
*/
|
||||
export interface APIGuildScheduledEventEntityMetadata {
|
||||
/**
|
||||
* The location of the scheduled event
|
||||
*/
|
||||
location?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-entity-types
|
||||
*/
|
||||
export enum GuildScheduledEventEntityType {
|
||||
StageInstance = 1,
|
||||
Voice,
|
||||
External,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-status
|
||||
*/
|
||||
export enum GuildScheduledEventStatus {
|
||||
Scheduled = 1,
|
||||
Active,
|
||||
Completed,
|
||||
Canceled,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-privacy-level
|
||||
*/
|
||||
export enum GuildScheduledEventPrivacyLevel {
|
||||
/**
|
||||
* The scheduled event is only accessible to guild members
|
||||
*/
|
||||
GuildOnly = 2,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-user-object-guild-scheduled-event-user-structure
|
||||
*/
|
||||
export interface APIGuildScheduledEventUser {
|
||||
/**
|
||||
* The scheduled event id which the user subscribed to
|
||||
*/
|
||||
guild_scheduled_event_id: Snowflake;
|
||||
/**
|
||||
* The user which subscribed to the event
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* The guild member data for this user for the guild which this event belongs to, if any
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
57
deno/payloads/v10/interactions.ts
Normal file
57
deno/payloads/v10/interactions.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import type {
|
||||
APIApplicationCommandDMInteraction,
|
||||
APIApplicationCommandGuildInteraction,
|
||||
APIApplicationCommandInteraction,
|
||||
} from './_interactions/applicationCommands.ts';
|
||||
import type {
|
||||
APIApplicationCommandAutocompleteDMInteraction,
|
||||
APIApplicationCommandAutocompleteGuildInteraction,
|
||||
APIApplicationCommandAutocompleteInteraction,
|
||||
} from './_interactions/autocomplete.ts';
|
||||
import type {
|
||||
APIMessageComponentDMInteraction,
|
||||
APIMessageComponentGuildInteraction,
|
||||
APIMessageComponentInteraction,
|
||||
} from './_interactions/messageComponents.ts';
|
||||
import type {
|
||||
APIModalSubmitDMInteraction,
|
||||
APIModalSubmitGuildInteraction,
|
||||
APIModalSubmitInteraction,
|
||||
} from './_interactions/modalSubmit.ts';
|
||||
import type { APIPingInteraction } from './_interactions/ping.ts';
|
||||
|
||||
export * from './_interactions/applicationCommands.ts';
|
||||
export * from './_interactions/autocomplete.ts';
|
||||
export * from './_interactions/base.ts';
|
||||
export * from './_interactions/messageComponents.ts';
|
||||
export * from './_interactions/modalSubmit.ts';
|
||||
export * from './_interactions/ping.ts';
|
||||
export * from './_interactions/responses.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIInteraction =
|
||||
| APIPingInteraction
|
||||
| APIApplicationCommandInteraction
|
||||
| APIMessageComponentInteraction
|
||||
| APIApplicationCommandAutocompleteInteraction
|
||||
| APIModalSubmitInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIDMInteraction =
|
||||
| APIApplicationCommandDMInteraction
|
||||
| APIMessageComponentDMInteraction
|
||||
| APIApplicationCommandAutocompleteDMInteraction
|
||||
| APIModalSubmitDMInteraction;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object
|
||||
*/
|
||||
export type APIGuildInteraction =
|
||||
| APIApplicationCommandGuildInteraction
|
||||
| APIMessageComponentGuildInteraction
|
||||
| APIApplicationCommandAutocompleteGuildInteraction
|
||||
| APIModalSubmitGuildInteraction;
|
||||
126
deno/payloads/v10/invite.ts
Normal file
126
deno/payloads/v10/invite.ts
Normal file
@@ -0,0 +1,126 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/invite
|
||||
*/
|
||||
|
||||
import type { APIApplication } from './application.ts';
|
||||
import type { APIPartialChannel } from './channel.ts';
|
||||
import type { APIGuild } from './guild.ts';
|
||||
import type { APIGuildScheduledEvent } from './guildScheduledEvent.ts';
|
||||
import type { APIInviteStageInstance } from './stageInstance.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
export type APIInviteGuild = Pick<
|
||||
APIGuild,
|
||||
| 'id'
|
||||
| 'name'
|
||||
| 'splash'
|
||||
| 'banner'
|
||||
| 'icon'
|
||||
| 'vanity_url_code'
|
||||
| 'description'
|
||||
| 'features'
|
||||
| 'verification_level'
|
||||
| 'nsfw_level'
|
||||
| 'premium_subscription_count'
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object
|
||||
*/
|
||||
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?: APIInviteGuild;
|
||||
/**
|
||||
* The channel this invite is for
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channel: Required<APIPartialChannel> | null;
|
||||
/**
|
||||
* The user who created the invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
inviter?: APIUser;
|
||||
/**
|
||||
* The type of target for this voice channel invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
|
||||
*/
|
||||
target_type?: InviteTargetType;
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/application#application-object
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* The expiration date of this invite, returned from the `GET /invites/<code>` endpoint when `with_expiration` is `true`
|
||||
*/
|
||||
expires_at?: string | null;
|
||||
/**
|
||||
* The stage instance data if there is a public stage instance in the stage channel this invite is for
|
||||
* @deprecated
|
||||
*/
|
||||
stage_instance?: APIInviteStageInstance;
|
||||
/**
|
||||
* The guild scheduled event data, returned from the `GET /invites/<code>` endpoint when `guild_scheduled_event_id` is a valid guild scheduled event id
|
||||
*/
|
||||
guild_scheduled_event?: APIGuildScheduledEvent;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object-invite-target-types
|
||||
*/
|
||||
export enum InviteTargetType {
|
||||
Stream = 1,
|
||||
EmbeddedApplication,
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
20
deno/payloads/v10/mod.ts
Normal file
20
deno/payloads/v10/mod.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
export * from '../common.ts';
|
||||
export * from './application.ts';
|
||||
export * from './auditLog.ts';
|
||||
export * from './autoModeration.ts';
|
||||
export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
export * from './guild.ts';
|
||||
export * from './guildScheduledEvent.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './permissions.ts';
|
||||
export * from './stageInstance.ts';
|
||||
export * from './sticker.ts';
|
||||
export * from './teams.ts';
|
||||
export * from './template.ts';
|
||||
export * from './user.ts';
|
||||
export * from './voice.ts';
|
||||
export * from './webhook.ts';
|
||||
132
deno/payloads/v10/oauth2.ts
Normal file
132
deno/payloads/v10/oauth2.ts
Normal file
@@ -0,0 +1,132 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/oauth2
|
||||
*/
|
||||
|
||||
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',
|
||||
/**
|
||||
* Allows your app to see information about the user's DMs and group DMs - requires Discord approval
|
||||
*/
|
||||
DMChannelsRead = 'dm_channels.read',
|
||||
/**
|
||||
* 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 /users/@me/guilds/{guild.id}/member to return a user's member information in a guild
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#get-current-user-guild-member
|
||||
*/
|
||||
GuildsMembersRead = 'guilds.members.read',
|
||||
/**
|
||||
* 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',
|
||||
/**
|
||||
* Allows your app to update a user's connection and metadata for the app
|
||||
*/
|
||||
RoleConnectionsWrite = 'role_connections.write',
|
||||
/**
|
||||
* For local rpc server access, this allows you to control a user's local Discord client - requires Discord approval
|
||||
*/
|
||||
RPC = 'rpc',
|
||||
/**
|
||||
* For local rpc server api access, this allows you to receive notifications pushed out to the user - requires Discord approval
|
||||
*/
|
||||
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 connect to voice on user's behalf and see all the voice members - requires Discord approval
|
||||
*/
|
||||
Voice = 'voice',
|
||||
/**
|
||||
* Allows your app to upload/update builds for a user's applications - requires Discord approval
|
||||
*/
|
||||
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 - requires Discord approval
|
||||
*/
|
||||
RelationshipsRead = 'relationships.read',
|
||||
/**
|
||||
* Allows your app to fetch data from a user's "Now Playing/Recently Played" list - requires Discord approval
|
||||
*/
|
||||
ActivitiesRead = 'activities.read',
|
||||
/**
|
||||
* Allows your app to update a user's activity - requires Discord approval (NOT REQUIRED FOR GAMESDK ACTIVITY MANAGER)
|
||||
*
|
||||
* See https://discord.com/developers/docs/game-sdk/activities
|
||||
*/
|
||||
ActivitiesWrite = 'activities.write',
|
||||
/**
|
||||
* Allows your app to use Application Commands in a guild
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/application-commands
|
||||
*/
|
||||
ApplicationsCommands = 'applications.commands',
|
||||
/**
|
||||
* Allows your app to update its Application Commands via this bearer token - client credentials grant only
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/application-commands
|
||||
*/
|
||||
ApplicationsCommandsUpdate = 'applications.commands.update',
|
||||
/**
|
||||
* Allows your app to update permissions for its commands using a Bearer token - client credentials grant only
|
||||
*
|
||||
* See https://discord.com/developers/docs/interactions/application-commands
|
||||
*/
|
||||
ApplicationCommandsPermissionsUpdate = 'applications.commands.permissions.update',
|
||||
}
|
||||
75
deno/payloads/v10/permissions.ts
Normal file
75
deno/payloads/v10/permissions.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/permissions
|
||||
*/
|
||||
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* The role icon hash
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* The role unicode emoji as a standard emoji
|
||||
*/
|
||||
unicode_emoji?: string | null;
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
77
deno/payloads/v10/stageInstance.ts
Normal file
77
deno/payloads/v10/stageInstance.ts
Normal file
@@ -0,0 +1,77 @@
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#stage-instance-object
|
||||
*/
|
||||
export interface APIStageInstance {
|
||||
/**
|
||||
* The id of the stage instance
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The guild id of the associated stage channel
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
/**
|
||||
* The id of the associated stage channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* The topic of the stage instance (1-120 characters)
|
||||
*/
|
||||
topic: string;
|
||||
/**
|
||||
* The privacy level of the stage instance
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-privacy-level
|
||||
*/
|
||||
privacy_level: StageInstancePrivacyLevel;
|
||||
/**
|
||||
* Whether or not stage discovery is disabled
|
||||
* @deprecated
|
||||
*/
|
||||
discoverable_disabled: boolean;
|
||||
/**
|
||||
* The id of the scheduled event for this stage instance
|
||||
*/
|
||||
guild_scheduled_event_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/stage-instance#stage-instance-object-privacy-level
|
||||
*/
|
||||
export enum StageInstancePrivacyLevel {
|
||||
/**
|
||||
* The stage instance is visible publicly, such as on stage discovery
|
||||
*/
|
||||
Public = 1,
|
||||
/**
|
||||
* The stage instance is visible to only guild members
|
||||
*/
|
||||
GuildOnly,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-stage-instance-object-invite-stage-instance-structure
|
||||
*/
|
||||
export interface APIInviteStageInstance {
|
||||
/**
|
||||
* The topic of the stage instance (1-120 characters)
|
||||
*/
|
||||
topic: string;
|
||||
/**
|
||||
* The number of users in the stage
|
||||
*/
|
||||
participant_count: number;
|
||||
/**
|
||||
* The number of users speaking in the stage
|
||||
*/
|
||||
speaker_count: number;
|
||||
/**
|
||||
* The members speaking in the stage
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object-guild-member-structure
|
||||
*/
|
||||
members: APIGuildMember[];
|
||||
}
|
||||
127
deno/payloads/v10/sticker.ts
Normal file
127
deno/payloads/v10/sticker.ts
Normal file
@@ -0,0 +1,127 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/sticker
|
||||
*/
|
||||
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#sticker-object
|
||||
*/
|
||||
export interface APISticker {
|
||||
/**
|
||||
* ID of the sticker
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* For standard stickers, ID of the pack the sticker is from
|
||||
*/
|
||||
pack_id?: Snowflake;
|
||||
/**
|
||||
* Name of the sticker
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Description of the sticker
|
||||
*/
|
||||
description: string | null;
|
||||
/**
|
||||
* For guild stickers, the Discord name of a unicode emoji representing the sticker's expression. for standard stickers, a comma-separated list of related expressions.
|
||||
*/
|
||||
tags: string;
|
||||
/**
|
||||
* Previously the sticker asset hash, now an empty string
|
||||
* @deprecated
|
||||
*/
|
||||
asset?: '';
|
||||
/**
|
||||
* Type of sticker
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-types
|
||||
*/
|
||||
type: StickerType;
|
||||
/**
|
||||
* Type of sticker format
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-format-types
|
||||
*/
|
||||
format_type: StickerFormatType;
|
||||
/**
|
||||
* Whether this guild sticker can be used, may be false due to loss of Server Boosts
|
||||
*/
|
||||
available?: boolean;
|
||||
/**
|
||||
* ID of the guild that owns this sticker
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The user that uploaded the guild sticker
|
||||
*/
|
||||
user?: APIUser;
|
||||
/**
|
||||
* The standard sticker's sort order within its pack
|
||||
*/
|
||||
sort_value?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-types
|
||||
*/
|
||||
export enum StickerType {
|
||||
/**
|
||||
* An official sticker in a pack, part of Nitro or in a removed purchasable pack
|
||||
*/
|
||||
Standard = 1,
|
||||
/**
|
||||
* A sticker uploaded to a guild for the guild's members
|
||||
*/
|
||||
Guild,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#sticker-object-sticker-format-types
|
||||
*/
|
||||
export enum StickerFormatType {
|
||||
PNG = 1,
|
||||
APNG,
|
||||
Lottie,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#sticker-item-object
|
||||
*/
|
||||
export type APIStickerItem = Pick<APISticker, 'id' | 'name' | 'format_type'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/sticker#sticker-pack-object
|
||||
*/
|
||||
export interface APIStickerPack {
|
||||
/**
|
||||
* ID of the sticker pack
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The stickers in the pack
|
||||
*/
|
||||
stickers: APISticker[];
|
||||
/**
|
||||
* Name of the sticker pack
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* ID of the pack's SKU
|
||||
*/
|
||||
sku_id: Snowflake;
|
||||
/**
|
||||
* ID of a sticker in the pack which is shown as the pack's icon
|
||||
*/
|
||||
cover_sticker_id?: Snowflake;
|
||||
/**
|
||||
* Description of the sticker pack
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* ID of the sticker pack's banner image
|
||||
*/
|
||||
banner_asset_id?: Snowflake;
|
||||
}
|
||||
66
deno/payloads/v10/teams.ts
Normal file
66
deno/payloads/v10/teams.ts
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/teams
|
||||
*/
|
||||
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.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 name of the team
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The user id of the current team owner
|
||||
*/
|
||||
owner_user_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/teams#data-models-team-member-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/v10/template.ts
Normal file
65
deno/payloads/v10/template.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/guild-template
|
||||
*/
|
||||
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { RESTPostAPIGuildsJSONBody } from '../../rest/v10/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/guild-template#guild-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;
|
||||
}
|
||||
275
deno/payloads/v10/user.ts
Normal file
275
deno/payloads/v10/user.ts
Normal file
@@ -0,0 +1,275 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/user
|
||||
*/
|
||||
|
||||
import type { APIGuildIntegration } from './guild.ts';
|
||||
import type { Snowflake } from '../../globals.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 banner hash
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-formatting
|
||||
*/
|
||||
banner?: string | null;
|
||||
/**
|
||||
* The user's banner color encoded as an integer representation of hexadecimal color code
|
||||
*/
|
||||
accent_color?: number | null;
|
||||
/**
|
||||
* 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 {
|
||||
/**
|
||||
* Discord Employee
|
||||
*/
|
||||
Staff = 1 << 0,
|
||||
/**
|
||||
* Partnered Server Owner
|
||||
*/
|
||||
Partner = 1 << 1,
|
||||
/**
|
||||
* HypeSquad Events Member
|
||||
*/
|
||||
Hypesquad = 1 << 2,
|
||||
/**
|
||||
* Bug Hunter Level 1
|
||||
*/
|
||||
BugHunterLevel1 = 1 << 3,
|
||||
/**
|
||||
* House Bravery Member
|
||||
*/
|
||||
HypeSquadOnlineHouse1 = 1 << 6,
|
||||
/**
|
||||
* House Brilliance Member
|
||||
*/
|
||||
HypeSquadOnlineHouse2 = 1 << 7,
|
||||
/**
|
||||
* House Balance Member
|
||||
*/
|
||||
HypeSquadOnlineHouse3 = 1 << 8,
|
||||
/**
|
||||
* Early Nitro Supporter
|
||||
*/
|
||||
PremiumEarlySupporter = 1 << 9,
|
||||
/**
|
||||
* User is a [team](https://discord.com/developers/docs/topics/teams)
|
||||
*/
|
||||
TeamPseudoUser = 1 << 10,
|
||||
/**
|
||||
* Bug Hunter Level 2
|
||||
*/
|
||||
BugHunterLevel2 = 1 << 14,
|
||||
/**
|
||||
* Verified Bot
|
||||
*/
|
||||
VerifiedBot = 1 << 16,
|
||||
/**
|
||||
* Early Verified Bot Developer
|
||||
*/
|
||||
VerifiedDeveloper = 1 << 17,
|
||||
/**
|
||||
* Moderator Programs Alumni
|
||||
*/
|
||||
CertifiedModerator = 1 << 18,
|
||||
/**
|
||||
* Bot uses only [HTTP interactions](https://discord.com/developers/docs/interactions/receiving-and-responding#receiving-an-interaction) and is shown in the online member list
|
||||
*/
|
||||
BotHTTPInteractions = 1 << 19,
|
||||
/**
|
||||
* User has been identified as spammer
|
||||
*
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
Spammer = 1 << 20,
|
||||
/**
|
||||
* User is an [Active Developer](https://support-dev.discord.com/hc/articles/10113997751447)
|
||||
*/
|
||||
ActiveDeveloper = 1 << 22,
|
||||
/**
|
||||
* User's account has been [quarantined](https://support.discord.com/hc/articles/6461420677527) based on recent activity
|
||||
*
|
||||
* @unstable This user flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*
|
||||
* @privateRemarks
|
||||
*
|
||||
* This value would be 1 << 44, but bit shifting above 1 << 30 requires bigints
|
||||
*/
|
||||
Quarantined = 17592186044416,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#user-object-premium-types
|
||||
*/
|
||||
export enum UserPremiumType {
|
||||
None,
|
||||
NitroClassic,
|
||||
Nitro,
|
||||
NitroBasic,
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#connection-object-services
|
||||
*/
|
||||
type: ConnectionService;
|
||||
/**
|
||||
* 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;
|
||||
/**
|
||||
* Whether this connection supports console voice transfer
|
||||
*/
|
||||
two_way_link: boolean;
|
||||
/**
|
||||
* Visibility of this connection
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#connection-object-visibility-types
|
||||
*/
|
||||
visibility: ConnectionVisibility;
|
||||
}
|
||||
|
||||
export enum ConnectionService {
|
||||
BattleNet = 'battlenet',
|
||||
eBay = 'ebay',
|
||||
EpicGames = 'epicgames',
|
||||
Facebook = 'facebook',
|
||||
GitHub = 'github',
|
||||
LeagueOfLegends = 'leagueoflegends',
|
||||
PayPal = 'paypal',
|
||||
PlayStationNetwork = 'playstation',
|
||||
Reddit = 'reddit',
|
||||
RiotGames = 'riotgames',
|
||||
Spotify = 'spotify',
|
||||
Skype = 'skype',
|
||||
Steam = 'steam',
|
||||
Twitch = 'twitch',
|
||||
Twitter = 'twitter',
|
||||
Xbox = 'xbox',
|
||||
YouTube = 'youtube',
|
||||
}
|
||||
|
||||
export enum ConnectionVisibility {
|
||||
/**
|
||||
* Invisible to everyone except the user themselves
|
||||
*/
|
||||
None,
|
||||
/**
|
||||
* Visible to everyone
|
||||
*/
|
||||
Everyone,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#application-role-connection-object-application-role-connection-structure
|
||||
*/
|
||||
export interface APIApplicationRoleConnection {
|
||||
/**
|
||||
* The vanity name of the platform a bot has connected (max 50 characters)
|
||||
*/
|
||||
platform_name: string | null;
|
||||
/**
|
||||
* The username on the platform a bot has connected (max 100 characters)
|
||||
*/
|
||||
platform_username: string | null;
|
||||
/**
|
||||
* Object mapping application role connection metadata keys to their `string`-ified value (max 100 characters) for the user on the platform a bot has connected
|
||||
*/
|
||||
metadata: Record<string, string | number>;
|
||||
}
|
||||
92
deno/payloads/v10/voice.ts
Normal file
92
deno/payloads/v10/voice.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/voice
|
||||
*/
|
||||
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { Snowflake } from '../../globals.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` 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;
|
||||
}
|
||||
79
deno/payloads/v10/webhook.ts
Normal file
79
deno/payloads/v10/webhook.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/webhook
|
||||
*/
|
||||
|
||||
import type { APIPartialChannel, APIPartialGuild, APIUser } from './mod.ts';
|
||||
import type { Snowflake } from '../../globals.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,
|
||||
/**
|
||||
* Application webhooks are webhooks used with Interactions
|
||||
*/
|
||||
Application,
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/audit-log
|
||||
*/
|
||||
|
||||
import type { APIOverwrite, ChannelType } from './channel';
|
||||
import type { APIOverwrite, ChannelType } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
GuildDefaultMessageNotifications,
|
||||
@@ -10,13 +10,14 @@ import type {
|
||||
GuildMFALevel,
|
||||
GuildVerificationLevel,
|
||||
IntegrationExpireBehavior,
|
||||
} from './guild';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APIUser } from './user';
|
||||
import type { APIWebhook } from './webhook';
|
||||
} 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[];
|
||||
@@ -27,6 +28,7 @@ export interface APIAuditLog {
|
||||
|
||||
/**
|
||||
* 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;
|
||||
@@ -40,6 +42,7 @@ export interface APIAuditLogEntry {
|
||||
|
||||
/**
|
||||
* 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,
|
||||
@@ -89,6 +92,7 @@ export enum AuditLogEvent {
|
||||
|
||||
/**
|
||||
* 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 {
|
||||
/**
|
||||
@@ -154,13 +158,17 @@ export interface APIAuditLogOptions {
|
||||
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 {
|
||||
Role = '0',
|
||||
Member = '1',
|
||||
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
|
||||
@@ -189,11 +197,14 @@ export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyApplicationID
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyPermissionsNew
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyAllow
|
||||
| APIAuditLogChangeKeyAllowNew
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDenyNew
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyChannelID
|
||||
| APIAuditLogChangeKeyInviterID
|
||||
@@ -213,51 +224,61 @@ export type APIAuditLogChange =
|
||||
|
||||
/**
|
||||
* 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',
|
||||
@@ -266,6 +287,7 @@ export type APIAuditLogChangeKeyExplicitContentFilter = AuditLogChangeData<
|
||||
|
||||
/**
|
||||
* 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',
|
||||
@@ -274,162 +296,215 @@ export type APIAuditLogChangeKeyDefaultMessageNotifications = AuditLogChangeData
|
||||
|
||||
/**
|
||||
* 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', string>;
|
||||
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', string>;
|
||||
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', string>;
|
||||
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';
|
||||
@@ -439,28 +514,33 @@ export interface APIAuditLogChangeKeyID {
|
||||
|
||||
/**
|
||||
* 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> {
|
||||
interface AuditLogChangeData<K extends string, D> {
|
||||
key: K;
|
||||
new_value?: D;
|
||||
old_value?: D;
|
||||
@@ -2,12 +2,13 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/channel
|
||||
*/
|
||||
|
||||
import type { APIPartialEmoji } from './emoji';
|
||||
import type { APIGuildMember } from './guild';
|
||||
import type { APIUser } from './user';
|
||||
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;
|
||||
@@ -17,6 +18,7 @@ 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;
|
||||
@@ -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;
|
||||
@@ -83,6 +87,7 @@ export interface APIMessage {
|
||||
|
||||
/**
|
||||
* 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,
|
||||
@@ -102,11 +107,11 @@ export enum MessageType {
|
||||
GUILD_DISCOVERY_REQUALIFIED,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING,
|
||||
INLINE_REPLY,
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
@@ -115,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;
|
||||
@@ -126,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;
|
||||
@@ -135,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,
|
||||
@@ -145,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,
|
||||
@@ -156,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;
|
||||
@@ -165,21 +175,34 @@ 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;
|
||||
type: OverwriteType;
|
||||
allow: string;
|
||||
deny: string;
|
||||
/**
|
||||
* @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 {
|
||||
Role,
|
||||
Member,
|
||||
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;
|
||||
@@ -203,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',
|
||||
@@ -215,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;
|
||||
@@ -225,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;
|
||||
@@ -234,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;
|
||||
@@ -244,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;
|
||||
@@ -252,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;
|
||||
@@ -262,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;
|
||||
@@ -271,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;
|
||||
@@ -280,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;
|
||||
@@ -293,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;
|
||||
@@ -301,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;
|
||||
@@ -2,10 +2,11 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/emoji
|
||||
*/
|
||||
|
||||
import type { APIUser } from './user';
|
||||
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;
|
||||
@@ -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[];
|
||||
@@ -2,11 +2,12 @@
|
||||
* Types extracted from https://discord.com/developers/docs/topics/gateway
|
||||
*/
|
||||
|
||||
import type { APIEmoji } from './emoji';
|
||||
import type { APIUser } from './user';
|
||||
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;
|
||||
@@ -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,17 +34,25 @@ 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> & {
|
||||
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',
|
||||
@@ -52,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;
|
||||
@@ -77,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,
|
||||
@@ -89,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;
|
||||
@@ -97,20 +112,22 @@ 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;
|
||||
// eslint-disable-next-line prettier/prettier
|
||||
size?: [currentSize: number, maxSize: number];
|
||||
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>
|
||||
@@ -118,11 +135,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,
|
||||
@@ -2,21 +2,25 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/guild
|
||||
*/
|
||||
|
||||
import type { APIChannel } from './channel';
|
||||
import type { APIEmoji } from './emoji';
|
||||
import type { GatewayPresenceUpdate, PresenceUpdateStatus } from './gateway';
|
||||
import type { APIRole } from './permissions';
|
||||
import type { APIUser } from './user';
|
||||
import type { GatewayVoiceState } from './voice';
|
||||
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;
|
||||
@@ -29,16 +33,29 @@ export interface APIPartialGuild extends Omit<APIUnavailableGuild, 'unavailable'
|
||||
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;
|
||||
permissions?: string;
|
||||
/**
|
||||
* @deprecated Use `permissions_new` instead
|
||||
*/
|
||||
permissions?: number;
|
||||
permissions_new?: string;
|
||||
region: string;
|
||||
afk_channel_id: string | null;
|
||||
afk_timeout: number;
|
||||
widget_enabled?: boolean;
|
||||
widget_channel_id?: string | null;
|
||||
/**
|
||||
* @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;
|
||||
@@ -47,6 +64,8 @@ export interface APIGuild extends APIPartialGuild {
|
||||
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;
|
||||
@@ -80,6 +99,7 @@ export interface APIGuild extends APIPartialGuild {
|
||||
|
||||
/**
|
||||
* 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,
|
||||
@@ -88,6 +108,7 @@ export enum GuildDefaultMessageNotifications {
|
||||
|
||||
/**
|
||||
* 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,
|
||||
@@ -97,6 +118,7 @@ export enum GuildExplicitContentFilter {
|
||||
|
||||
/**
|
||||
* 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,
|
||||
@@ -105,6 +127,7 @@ export enum GuildMFALevel {
|
||||
|
||||
/**
|
||||
* 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,
|
||||
@@ -116,6 +139,7 @@ export enum GuildVerificationLevel {
|
||||
|
||||
/**
|
||||
* 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,
|
||||
@@ -126,6 +150,7 @@ export enum GuildPremiumTier {
|
||||
|
||||
/**
|
||||
* 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,
|
||||
@@ -134,6 +159,7 @@ export enum GuildSystemChannelFlags {
|
||||
|
||||
/**
|
||||
* 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',
|
||||
@@ -154,6 +180,7 @@ export enum GuildFeature {
|
||||
|
||||
/**
|
||||
* 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;
|
||||
@@ -167,50 +194,24 @@ export interface APIGuildPreview {
|
||||
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#get-guild-widget-example-get-guild-widget
|
||||
*/
|
||||
export interface APIGuildWidget {
|
||||
id: string;
|
||||
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: string;
|
||||
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#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;
|
||||
@@ -224,27 +225,29 @@ export interface APIGuildMember {
|
||||
|
||||
/**
|
||||
* 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;
|
||||
syncing: boolean;
|
||||
role_id: string;
|
||||
enable_emoticons?: boolean;
|
||||
expire_behavior?: IntegrationExpireBehavior;
|
||||
expire_grace_period?: number;
|
||||
expire_behavior: IntegrationExpireBehavior;
|
||||
expire_grace_period: number;
|
||||
user?: APIUser;
|
||||
account: APIIntegrationAccount;
|
||||
synced_at?: string;
|
||||
subscriber_count?: number;
|
||||
revoked?: boolean;
|
||||
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,
|
||||
@@ -253,6 +256,7 @@ export enum IntegrationExpireBehavior {
|
||||
|
||||
/**
|
||||
* 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;
|
||||
@@ -261,6 +265,7 @@ export interface APIIntegrationAccount {
|
||||
|
||||
/**
|
||||
* 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;
|
||||
@@ -273,6 +278,7 @@ export interface APIGuildIntegrationApplication {
|
||||
|
||||
/**
|
||||
* 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;
|
||||
@@ -281,6 +287,7 @@ export interface APIBan {
|
||||
|
||||
/**
|
||||
* 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',
|
||||
@@ -290,11 +297,17 @@ export enum GuildWidgetStyle {
|
||||
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;
|
||||
@@ -2,12 +2,13 @@
|
||||
* Types extracted from https://discord.com/developers/docs/resources/invite
|
||||
*/
|
||||
|
||||
import type { APIPartialChannel } from './channel';
|
||||
import type { APIPartialGuild } from './guild';
|
||||
import type { APIUser } from './user';
|
||||
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;
|
||||
@@ -22,6 +23,7 @@ export interface APIInvite {
|
||||
|
||||
/**
|
||||
* 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,
|
||||
@@ -29,6 +31,7 @@ export enum InviteTargetUserType {
|
||||
|
||||
/**
|
||||
* 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;
|
||||
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';
|
||||
@@ -2,11 +2,12 @@
|
||||
* Types extracted from https://discord.com/developers/docs/topics/oauth2
|
||||
*/
|
||||
|
||||
import type { APITeam } from './teams';
|
||||
import type { APIUser } from './user';
|
||||
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;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user