mirror of
https://github.com/discordjs/discord-api-types.git
synced 2026-05-21 10:50:08 +00:00
Compare commits
1379 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e50ccf576 | ||
|
|
66c6b4f555 | ||
|
|
5cd0686f1a | ||
|
|
391d0d4454 | ||
|
|
2d3fc09ade | ||
|
|
3637535d28 | ||
|
|
14bca2694d | ||
|
|
1e8075e41d | ||
|
|
bb1f5dfe5e | ||
|
|
b9df5c2d02 | ||
|
|
812fbbe688 | ||
|
|
edf9a9651b | ||
|
|
9c2f1746b1 | ||
|
|
f8f039867e | ||
|
|
8a4a6d1e43 | ||
|
|
2e5e31b4c4 | ||
|
|
0bd00dd111 | ||
|
|
d5dc47a36c | ||
|
|
09c71fe9d1 | ||
|
|
3691d77da3 | ||
|
|
bece6b84ee | ||
|
|
e9e7f5c24f | ||
|
|
e1b27cd5a9 | ||
|
|
5acf5c5989 | ||
|
|
d165766302 | ||
|
|
702e541bf0 | ||
|
|
27ef064f92 | ||
|
|
c21ae24f7a | ||
|
|
b2a8b740e5 | ||
|
|
19d04c00c9 | ||
|
|
2802117c0b | ||
|
|
487c3b7980 | ||
|
|
3a296fa929 | ||
|
|
1506ff0d2b | ||
|
|
d4248babd2 | ||
|
|
07d7b05cde | ||
|
|
69bbc57575 | ||
|
|
6a29982d09 | ||
|
|
ae75ee7863 | ||
|
|
763bfc810c | ||
|
|
c76a1bc372 | ||
|
|
afe009d84e | ||
|
|
d4fc31de65 | ||
|
|
0a514f68d9 | ||
|
|
308308dfab | ||
|
|
ca423b001a | ||
|
|
3bc73f8b4f | ||
|
|
96a34ba74b | ||
|
|
b63fafdfd4 | ||
|
|
1c722899a1 | ||
|
|
c5aa81d971 | ||
|
|
ae938673f9 | ||
|
|
93e4c79e2e | ||
|
|
a99c8c0f53 | ||
|
|
c080b2a838 | ||
|
|
ed0c19aef7 | ||
|
|
662cb0cb0a | ||
|
|
e65e02f05f | ||
|
|
b4eaf0b607 | ||
|
|
ebdb44eb79 | ||
|
|
d7192dc74e | ||
|
|
b985362252 | ||
|
|
25778aeee9 | ||
|
|
899544f379 | ||
|
|
76ee81b8e1 | ||
|
|
93f3d45596 | ||
|
|
811314a825 | ||
|
|
ba01bacfc0 | ||
|
|
a4aa724eb8 | ||
|
|
dea22dc487 | ||
|
|
cf6476dc8a | ||
|
|
f76c2fa249 | ||
|
|
0000e9afe3 | ||
|
|
c3b331d80a | ||
|
|
f1a3cb7bb7 | ||
|
|
38b9467178 | ||
|
|
32b544e05e | ||
|
|
e1ff008cd6 | ||
|
|
46b8cbd46f | ||
|
|
c8ef2fefde | ||
|
|
bf12195401 | ||
|
|
a73d1d0ce2 | ||
|
|
17eade718c | ||
|
|
c242454e9f | ||
|
|
6dc3caa692 | ||
|
|
6b47a0c960 | ||
|
|
e9169b8acb | ||
|
|
d7a38425c0 | ||
|
|
8190a1a475 | ||
|
|
818b899f9d | ||
|
|
61788ced57 | ||
|
|
f6ae280ab5 | ||
|
|
6708005f0c | ||
|
|
9b00e9d441 | ||
|
|
cbec753710 | ||
|
|
5ea94a6629 | ||
|
|
cef79b442e | ||
|
|
1353b5915c | ||
|
|
beb982dd82 | ||
|
|
da016bd49d | ||
|
|
0ee3cf31bb | ||
|
|
8b22f9511f | ||
|
|
32975aecea | ||
|
|
c93fdc0996 | ||
|
|
164f79e6c4 | ||
|
|
e60a3f8aac | ||
|
|
36e76904ef | ||
|
|
177e9d199b | ||
|
|
7e0de6eaa1 | ||
|
|
c2872acc40 | ||
|
|
47b0d075b0 | ||
|
|
c726e8be53 | ||
|
|
6b6b256d5f | ||
|
|
26580371d2 | ||
|
|
a57db79645 | ||
|
|
2a9dfd41db | ||
|
|
8fd402464a | ||
|
|
a8e30a616c | ||
|
|
b549a5fe8d | ||
|
|
f9496a795f | ||
|
|
2a42f0d0b5 | ||
|
|
6f6b780851 | ||
|
|
6df197ac47 | ||
|
|
b6b4027cb5 | ||
|
|
807f86cb87 | ||
|
|
592503aa18 | ||
|
|
511ee8edd3 | ||
|
|
dd79152139 | ||
|
|
94d41859b7 | ||
|
|
a3aec11efd | ||
|
|
0bd1de5a97 | ||
|
|
18fa946bdf | ||
|
|
df9c860cca | ||
|
|
deea7340d3 | ||
|
|
5abb566fcb | ||
|
|
b29dd22b52 | ||
|
|
5adaf81117 | ||
|
|
6ed498e4a1 | ||
|
|
d6ce5e8259 | ||
|
|
ef46b927b6 | ||
|
|
0192dab947 | ||
|
|
3c846fc0dc | ||
|
|
e51f9c6cfc | ||
|
|
ffec279615 | ||
|
|
2389ed4f27 | ||
|
|
d8b6653b69 | ||
|
|
36500e61ae | ||
|
|
d363c6b9b3 | ||
|
|
acdf14ca54 | ||
|
|
8aa9e9e849 | ||
|
|
b67f4bd157 | ||
|
|
aec9bc07e5 | ||
|
|
237d00ca3d | ||
|
|
4ba461e93f | ||
|
|
dd55679e75 | ||
|
|
60cdc321ef | ||
|
|
c533c76df9 | ||
|
|
5b82aa564c | ||
|
|
5a4c4aff19 | ||
|
|
38e98c8063 | ||
|
|
8f0474b83c | ||
|
|
e8893bc7f4 | ||
|
|
fd16e2799b | ||
|
|
b6f328aa0f | ||
|
|
6579f2c9c5 | ||
|
|
176e2f59b6 | ||
|
|
0d35199598 | ||
|
|
7d1b2a2ae0 | ||
|
|
12760a8959 | ||
|
|
a8c28ab728 | ||
|
|
cdec113cbf | ||
|
|
de72feaa35 | ||
|
|
aa6e72d34f | ||
|
|
2117f4926b | ||
|
|
f883770df6 | ||
|
|
117b63dcd0 | ||
|
|
5f25c39bc5 | ||
|
|
200f650539 | ||
|
|
2736687283 | ||
|
|
388faf3d33 | ||
|
|
20b7057c50 | ||
|
|
5c73edb70a | ||
|
|
2b5a2bc1e9 | ||
|
|
b89290fc95 | ||
|
|
bf4291bed8 | ||
|
|
4237b1a115 | ||
|
|
d47172c0c9 | ||
|
|
075ec3daf2 | ||
|
|
4e69666fe6 | ||
|
|
73760723b4 | ||
|
|
6fdf2c8a72 | ||
|
|
fb8972f52c | ||
|
|
fb0109e8e0 | ||
|
|
e37f802e39 | ||
|
|
ea2b922d12 | ||
|
|
be8b372663 | ||
|
|
c5c0312867 | ||
|
|
7d6a934f66 | ||
|
|
9347651bbe | ||
|
|
6e5563e2b7 | ||
|
|
8064df3722 | ||
|
|
eeb99a9ea0 | ||
|
|
63c9e4f72e | ||
|
|
4d73b0e509 | ||
|
|
a56c3c892e | ||
|
|
97b0580189 | ||
|
|
62e5b4a95c | ||
|
|
c96926b6a2 | ||
|
|
790b4deb0f | ||
|
|
51b2d4e1c9 | ||
|
|
687f474d4e | ||
|
|
ff892fa66e | ||
|
|
84f312db2a | ||
|
|
9665e02367 | ||
|
|
71a0b8d211 | ||
|
|
00c46946a0 | ||
|
|
f65b30a3bf | ||
|
|
6295858de5 | ||
|
|
0c6d4249b6 | ||
|
|
95b186deb7 | ||
|
|
18cf4a514e | ||
|
|
7a07478721 | ||
|
|
97cc33d528 | ||
|
|
f6e0da697b | ||
|
|
6f286522b4 | ||
|
|
d74c6f1923 | ||
|
|
7937338193 | ||
|
|
d0ed48c189 | ||
|
|
607dd01f09 | ||
|
|
34485bc840 | ||
|
|
eb252bd049 | ||
|
|
34bd7d0aba | ||
|
|
de7ac23d41 | ||
|
|
e52ac85e9d | ||
|
|
aca4683388 | ||
|
|
e316373609 | ||
|
|
cf57fc92dd | ||
|
|
14963d61d4 | ||
|
|
041583d8da | ||
|
|
35a4084647 | ||
|
|
35867c19e6 | ||
|
|
8eb66a1512 | ||
|
|
5a07684ef9 | ||
|
|
464a9c8cbf | ||
|
|
4d3d83d09e | ||
|
|
af3907b106 | ||
|
|
fa05a7503f | ||
|
|
36567c75e8 | ||
|
|
51106df44d | ||
|
|
7df81ce484 | ||
|
|
28dfa78080 | ||
|
|
9f7933dd03 | ||
|
|
ae09e2b9e4 | ||
|
|
d3dc8c13d7 | ||
|
|
e665ddc003 | ||
|
|
a4063bd034 | ||
|
|
3659c59ce7 | ||
|
|
e849c17e84 | ||
|
|
8947930088 | ||
|
|
ad46fc3d38 | ||
|
|
4d1f9d96bc | ||
|
|
72445f8ae2 | ||
|
|
1a37ae3eea | ||
|
|
b05df17466 | ||
|
|
51705cba50 | ||
|
|
77ffcfecb9 | ||
|
|
3cb4bb409b | ||
|
|
8db0929ba1 | ||
|
|
5e096f7e61 | ||
|
|
4a6bfd2a56 | ||
|
|
f35fc69267 | ||
|
|
2a7c1d271f | ||
|
|
b7e8a9f527 | ||
|
|
e428c7590f | ||
|
|
5f9c1e1b1c | ||
|
|
87b52b7890 | ||
|
|
256911b9ad | ||
|
|
26a6dd5c77 | ||
|
|
a45f0161e7 | ||
|
|
53f47105dc | ||
|
|
36b23c126b | ||
|
|
53ac69e1a7 | ||
|
|
fe08e2d1e2 | ||
|
|
4afd0c13fd | ||
|
|
03f02a5a9e | ||
|
|
b4285c1d7e | ||
|
|
295276a581 | ||
|
|
46bb280690 | ||
|
|
cda030d74e | ||
|
|
79534f2e9d | ||
|
|
e6c12634e9 | ||
|
|
a41e646d3d | ||
|
|
a72e4545a3 | ||
|
|
0785436e2f | ||
|
|
5cd2511798 | ||
|
|
b760be279a | ||
|
|
c47e14570d | ||
|
|
30f95bc938 | ||
|
|
fe220db046 | ||
|
|
2f3b892feb | ||
|
|
574e5c12bd | ||
|
|
3eb77eb89e | ||
|
|
cbee43cdcd | ||
|
|
ecb4c336c0 | ||
|
|
9b68f04fb7 | ||
|
|
82f8ec4366 | ||
|
|
92b6632981 | ||
|
|
a8faa02857 | ||
|
|
1fee6339bf | ||
|
|
3245f7de92 | ||
|
|
b238cc5b67 | ||
|
|
e2ce6a3d2d | ||
|
|
f1d456de8c | ||
|
|
71c6d2609f | ||
|
|
7fbb3e3310 | ||
|
|
ef1f32acd0 | ||
|
|
6b05db5a2f | ||
|
|
ab926eb038 | ||
|
|
3e394aa44b | ||
|
|
077623299d | ||
|
|
fa5ab47b5e | ||
|
|
77cb32746f | ||
|
|
60e2b679f8 | ||
|
|
818d4ee6e7 | ||
|
|
31f07f9e5b | ||
|
|
91d851628d | ||
|
|
b2da18c634 | ||
|
|
9ae89dd9d8 | ||
|
|
c60f8d2e29 | ||
|
|
bb713c0aec | ||
|
|
28bb65f85a | ||
|
|
c76dd317b4 | ||
|
|
6df612809b | ||
|
|
7a18245abf | ||
|
|
ba70b0573c | ||
|
|
d71276cb5f | ||
|
|
121fb47f4c | ||
|
|
83d34ef00c | ||
|
|
c670a2551a | ||
|
|
ebf313c49c | ||
|
|
1d8f79e6b2 | ||
|
|
7d92c012c7 | ||
|
|
5d72696e20 | ||
|
|
10bf20b000 | ||
|
|
b16b065d04 | ||
|
|
61cda0c1fb | ||
|
|
7020afbe84 | ||
|
|
a2f3a7e79b | ||
|
|
a51261d2f2 | ||
|
|
de98a67b41 | ||
|
|
a822bc3f77 | ||
|
|
923aae517f | ||
|
|
8c61ed12dc | ||
|
|
e37ebed680 | ||
|
|
3cfa7f8ea7 | ||
|
|
f4b750062d | ||
|
|
0909412254 | ||
|
|
58fa897069 | ||
|
|
b7857315c4 | ||
|
|
64855f3451 | ||
|
|
da23f132f4 | ||
|
|
9daac44f1d | ||
|
|
72b8c830ee | ||
|
|
b360b2e6a7 | ||
|
|
544bd94be5 | ||
|
|
f25ea9dd1f | ||
|
|
c531fe2ff1 | ||
|
|
8d56c85160 | ||
|
|
653bba0bad | ||
|
|
90711463b6 | ||
|
|
17e1173e3d | ||
|
|
b0eed606a0 | ||
|
|
631be006d7 | ||
|
|
565918591b | ||
|
|
38fe58bc1a | ||
|
|
210ed49724 | ||
|
|
fda19fd863 | ||
|
|
4b84659fff | ||
|
|
b1244f1117 | ||
|
|
6a103d6b8a | ||
|
|
3af2ae2b85 | ||
|
|
a5d949e650 | ||
|
|
42acecced8 | ||
|
|
21420c3028 | ||
|
|
ca206593ef | ||
|
|
c64362a711 | ||
|
|
f5eb4b9e35 | ||
|
|
06ca2741f0 | ||
|
|
0479cafa1b | ||
|
|
bfaf36e42e | ||
|
|
5049f81b39 | ||
|
|
6437928821 | ||
|
|
07c9d4aab2 | ||
|
|
4b0a3af12b | ||
|
|
7196d8772d | ||
|
|
7d1d55fdc7 | ||
|
|
04ee6ac7f1 | ||
|
|
f5f850eb10 | ||
|
|
771745c424 | ||
|
|
d3ef6c9fd8 | ||
|
|
a50d6f4fd3 | ||
|
|
a2c1eccc68 | ||
|
|
ebd9814412 | ||
|
|
527ac2fe0f | ||
|
|
aa68bd5336 | ||
|
|
bf3a9f3c35 | ||
|
|
0799b367db | ||
|
|
8f675f6a95 | ||
|
|
f0918bbdef | ||
|
|
e981f95482 | ||
|
|
65a0e8a12d | ||
|
|
b66c4af72a | ||
|
|
9f769c319e | ||
|
|
076e7b8f7b | ||
|
|
048772d1f1 | ||
|
|
5b6f0d43a4 | ||
|
|
cfac62e44a | ||
|
|
def67dbe90 | ||
|
|
ac4d59d17e | ||
|
|
d12dcb103c | ||
|
|
699c3df1ec | ||
|
|
78d6acfdb8 | ||
|
|
19a8371695 | ||
|
|
d5cdb37a8f | ||
|
|
2023a0ab2a | ||
|
|
8fe9c072b3 | ||
|
|
d446be5ecd | ||
|
|
27840d1086 | ||
|
|
1fc2a6ece8 | ||
|
|
f90b47c95c | ||
|
|
cf076b868b | ||
|
|
470f340e75 | ||
|
|
d9b6935b01 | ||
|
|
907c1685a3 | ||
|
|
3f61ce43e9 | ||
|
|
92d0ef46d9 | ||
|
|
b648c89b5e | ||
|
|
6ace234311 | ||
|
|
a9ba1e18bc | ||
|
|
ee53ef7306 | ||
|
|
cddd038a8b | ||
|
|
fc4e7bebc5 | ||
|
|
a81f31178f | ||
|
|
5c6e5ca7bb | ||
|
|
6c13d341a6 | ||
|
|
a7d019eab9 | ||
|
|
936a03982b | ||
|
|
6d8fd9f3d8 | ||
|
|
d222c61e0a | ||
|
|
9f327dd999 | ||
|
|
5d472cbfba | ||
|
|
bcb13de75b | ||
|
|
61592d6a85 | ||
|
|
b3e818fd33 | ||
|
|
3faaf75970 | ||
|
|
fb7c6b8903 | ||
|
|
20f44ac7d9 | ||
|
|
68e19d38e4 | ||
|
|
534dc2f1be | ||
|
|
5c48554c8d | ||
|
|
c69bb52384 | ||
|
|
92b1ce2fae | ||
|
|
4a47ef8c83 | ||
|
|
c52a3f6721 | ||
|
|
079fcd6c00 | ||
|
|
566ae49c74 | ||
|
|
2d22f2fcef | ||
|
|
9b47ba562f | ||
|
|
2e6ad68151 | ||
|
|
9f1fa8c722 | ||
|
|
ace02e2b9b | ||
|
|
e7f0caabaa | ||
|
|
5350806773 | ||
|
|
ced86e4b42 | ||
|
|
8659ac8b8d | ||
|
|
029002b171 | ||
|
|
68273caf10 | ||
|
|
f65246f8fd | ||
|
|
1ba3472938 | ||
|
|
00954701e8 | ||
|
|
7debb55f03 | ||
|
|
f5ebb2088b | ||
|
|
999e48fae0 | ||
|
|
b3b4eb66c0 | ||
|
|
408165e96f | ||
|
|
3f489f18dc | ||
|
|
df0d390303 | ||
|
|
7fa0e159d0 | ||
|
|
f6984045f1 | ||
|
|
092cf01f45 | ||
|
|
3512262194 | ||
|
|
8ada51ac6d | ||
|
|
6813c62e9e | ||
|
|
88d8bed1ca | ||
|
|
736479cab3 | ||
|
|
d673e5f9bb | ||
|
|
7af532c383 | ||
|
|
76b393a7e4 | ||
|
|
daacd2d1b5 | ||
|
|
756658ba85 | ||
|
|
cc6121c2c0 | ||
|
|
bfeaaae9a8 | ||
|
|
82d02a487f | ||
|
|
76fc8f035b | ||
|
|
0fe6059753 | ||
|
|
122ddcb6b1 | ||
|
|
32cabcfcb3 | ||
|
|
6962103023 | ||
|
|
4746e8d486 | ||
|
|
ecf1a17b73 | ||
|
|
a0b7487a09 | ||
|
|
8d46830046 | ||
|
|
ec9819bb2d | ||
|
|
21e9732d85 | ||
|
|
240226f3d2 | ||
|
|
57ee8db3b1 | ||
|
|
2b653a00b3 | ||
|
|
2ae232477a | ||
|
|
5d95d970cf | ||
|
|
2cc5730d32 | ||
|
|
b30a016db3 | ||
|
|
a620bb9f70 | ||
|
|
087d682c3b | ||
|
|
29944fee29 | ||
|
|
a47eca9cb5 | ||
|
|
7fe434114e | ||
|
|
258fb72f38 | ||
|
|
93e649a20d | ||
|
|
d3b5187c77 | ||
|
|
344274b56c | ||
|
|
f770290717 | ||
|
|
b4b70d8bdc | ||
|
|
3de4ca8933 | ||
|
|
8f781909f1 | ||
|
|
3f3fe21e15 | ||
|
|
011d439971 | ||
|
|
0938b664ce | ||
|
|
d1e64eea8d | ||
|
|
557c534b67 | ||
|
|
8054f50230 | ||
|
|
74d80b1e77 | ||
|
|
a9c6985d63 | ||
|
|
4b64f84ddf | ||
|
|
2803e8df2f | ||
|
|
58848bed54 | ||
|
|
f019f0fe97 | ||
|
|
e09ded64b3 | ||
|
|
3aee5c4a0d | ||
|
|
3455ed4cce | ||
|
|
4ef182d009 | ||
|
|
86a9f965dd | ||
|
|
b90fddc285 | ||
|
|
f67043b3f4 | ||
|
|
19d2aeb4a8 | ||
|
|
31b3766b19 | ||
|
|
1b1a865efe | ||
|
|
a85521aa8b | ||
|
|
8b00031c51 | ||
|
|
147e459a16 | ||
|
|
fbfbc6b23f | ||
|
|
906dd8e241 | ||
|
|
25efb9c403 | ||
|
|
822956fe78 | ||
|
|
d5047639e6 | ||
|
|
cbd8d108ee | ||
|
|
d816bf31ab | ||
|
|
71602b5c49 | ||
|
|
6ead98b782 | ||
|
|
ea1a6c3c86 | ||
|
|
a59f9f002f | ||
|
|
ace41f38e4 | ||
|
|
25a6f5330f | ||
|
|
4409fc24c1 | ||
|
|
1178c23389 | ||
|
|
34b0ddd105 | ||
|
|
9c1fc9bdee | ||
|
|
472fe5f837 | ||
|
|
588140c0a9 | ||
|
|
799044d3f0 | ||
|
|
eb7b3d90dd | ||
|
|
2c1ff0ea34 | ||
|
|
5f22a6baca | ||
|
|
cbcd51d093 | ||
|
|
4f66b4dd04 | ||
|
|
da9496f291 | ||
|
|
b1e1c60a07 | ||
|
|
4fdc6db296 | ||
|
|
608f0fa8cd | ||
|
|
0e8b624c3e | ||
|
|
1301b3417c | ||
|
|
e098870a08 | ||
|
|
2049dde09a | ||
|
|
ea7cafaafa | ||
|
|
c05998de27 | ||
|
|
f50ae60ea9 | ||
|
|
0ebf2afb58 | ||
|
|
ee09eafb76 | ||
|
|
a7fac3dc04 | ||
|
|
1fd407f481 | ||
|
|
aa8e307f4d | ||
|
|
897fd90bf2 | ||
|
|
666f0e79bc | ||
|
|
c9117a7bcc | ||
|
|
fe7ba16e3c | ||
|
|
643bf747be | ||
|
|
0340b3c3a1 | ||
|
|
45ef182b79 | ||
|
|
17c19750ae | ||
|
|
088dbe016f | ||
|
|
e3eb86936e | ||
|
|
d201436233 | ||
|
|
d63bea7dfc | ||
|
|
e330d3dcde | ||
|
|
fdb2d0a3c0 | ||
|
|
8657befda4 | ||
|
|
173f9ed0fa | ||
|
|
fdc04089e1 | ||
|
|
c6a72a55e5 | ||
|
|
98544fa56a | ||
|
|
3ce9610ba0 | ||
|
|
509746003a | ||
|
|
f859a96974 | ||
|
|
344e43b307 | ||
|
|
709153564e | ||
|
|
782a711236 | ||
|
|
566f2bc2c7 | ||
|
|
2627c0c98c | ||
|
|
0c46476110 | ||
|
|
d273000c32 | ||
|
|
5678a63875 | ||
|
|
f9913cb9a1 | ||
|
|
16a6a46832 | ||
|
|
79d9875c5d | ||
|
|
ddb2bde077 | ||
|
|
c8bfdebf24 | ||
|
|
707fd2e36e | ||
|
|
a69286a361 | ||
|
|
c457b8d059 | ||
|
|
7650ce4f72 | ||
|
|
65eebd92d6 | ||
|
|
0fafe5e901 | ||
|
|
0fce829175 | ||
|
|
33d5b14f22 | ||
|
|
aa7d1ee943 | ||
|
|
3e4c34cace | ||
|
|
8c603dc838 | ||
|
|
f9155dddb8 | ||
|
|
d0e4018607 | ||
|
|
189e91d62c | ||
|
|
2eae29d8ca | ||
|
|
2c595f7b20 | ||
|
|
cf4ecedced | ||
|
|
4e37de7f72 | ||
|
|
c9f2c5b020 | ||
|
|
312947de1e | ||
|
|
3ae6d722fd | ||
|
|
fddb2257db | ||
|
|
8de6d6bb4c | ||
|
|
c4ee7907c2 | ||
|
|
02695c5c19 | ||
|
|
fcc48a43e6 | ||
|
|
308d7d40f4 | ||
|
|
1572c2d291 | ||
|
|
a36449a028 | ||
|
|
29d88445e9 | ||
|
|
df3457a520 | ||
|
|
e1653f8f3e | ||
|
|
369d7b712f | ||
|
|
df495ecd20 | ||
|
|
ee7fc06b75 | ||
|
|
c6899314eb | ||
|
|
547d6d118f | ||
|
|
2831452fbd | ||
|
|
3c00105453 | ||
|
|
781f8f198a | ||
|
|
77f5dde20e | ||
|
|
e2b3eb5654 | ||
|
|
46cc9ae288 | ||
|
|
5934e43d01 | ||
|
|
5ae3514498 | ||
|
|
0322478a21 | ||
|
|
33d3806d89 | ||
|
|
aa5f15ed7d | ||
|
|
22b5f47787 | ||
|
|
ddf0a7bdba | ||
|
|
e70fa70526 | ||
|
|
90c70c01bd | ||
|
|
3442d5657a | ||
|
|
43803d6c52 | ||
|
|
0c3383558d | ||
|
|
e030fe2ab7 | ||
|
|
634df000c6 | ||
|
|
495148dc46 | ||
|
|
61ce329f61 | ||
|
|
7dcad582ce | ||
|
|
4db44b553d | ||
|
|
ccb7ef479c | ||
|
|
37b08a293f | ||
|
|
db89f0ef66 | ||
|
|
47c9ad0e70 | ||
|
|
eaaa8254b9 | ||
|
|
1d5646e5a0 | ||
|
|
b7ae342faa | ||
|
|
698282f4b0 | ||
|
|
19327a5d66 | ||
|
|
66958cb67e | ||
|
|
bd7e1e7b4f | ||
|
|
6ce581c0db | ||
|
|
7f22d4da37 | ||
|
|
d6d2fb69c9 | ||
|
|
dfc109f3f1 | ||
|
|
1377730766 | ||
|
|
22e6bafd39 | ||
|
|
5e175e1595 | ||
|
|
fcf14c3ea2 | ||
|
|
8640cdd360 | ||
|
|
1f83534ccb | ||
|
|
affc669a73 | ||
|
|
15fe19b39d | ||
|
|
c83a604076 | ||
|
|
6887b8fc46 | ||
|
|
f509930e00 | ||
|
|
597b7f7fb0 | ||
|
|
badf590103 | ||
|
|
d7d089e3cd | ||
|
|
36e8d3caed | ||
|
|
9fc46f8ecb | ||
|
|
930162c7a6 | ||
|
|
1cf1a57365 | ||
|
|
a39a5d9d41 | ||
|
|
a0e00ffaf7 | ||
|
|
45e2d17c65 | ||
|
|
8691b992e0 | ||
|
|
36d1b4ba50 | ||
|
|
de02125eec | ||
|
|
8acc356d27 | ||
|
|
803e5b31b9 | ||
|
|
c7e0e32aa5 | ||
|
|
5aec2d293e | ||
|
|
5e09570716 | ||
|
|
d98c991c35 | ||
|
|
2814d7e2f5 | ||
|
|
23f87a8ff2 | ||
|
|
1d39612329 | ||
|
|
ef31e116b6 | ||
|
|
abbd4b2e21 | ||
|
|
5e295706b8 | ||
|
|
803dcd7bdd | ||
|
|
62de95fd6f | ||
|
|
4f46175c3c | ||
|
|
150dc46b87 | ||
|
|
c008413a8a | ||
|
|
9564941b3a | ||
|
|
f329a80a6b | ||
|
|
0cfe05dad8 | ||
|
|
4473293b0e | ||
|
|
a28b2d749e | ||
|
|
55efcca4f8 | ||
|
|
6f541d58d2 | ||
|
|
71caf7cfc6 | ||
|
|
819d85207a | ||
|
|
7f797b2b4b | ||
|
|
470fe189ae | ||
|
|
b4226bb708 | ||
|
|
72a78a4f6f | ||
|
|
957488134e | ||
|
|
5327f3f38c | ||
|
|
ca05ee5eb2 | ||
|
|
1d8399d925 | ||
|
|
a8efb1949a | ||
|
|
c0f68e9509 | ||
|
|
28ed3701e6 | ||
|
|
4640f80274 | ||
|
|
ba08061917 | ||
|
|
f51c2d95ae | ||
|
|
984eacdef6 | ||
|
|
0a914acd11 | ||
|
|
3f1d9b47aa | ||
|
|
8541201a96 | ||
|
|
17f42e0b38 | ||
|
|
5515e2914a | ||
|
|
ecef5b492b | ||
|
|
c71258ceb4 | ||
|
|
a4cdbbfdf8 | ||
|
|
06fb47c51d | ||
|
|
cc47220e87 | ||
|
|
4defa9ea12 | ||
|
|
1290c942ab | ||
|
|
4309463634 | ||
|
|
1b8f62fc98 | ||
|
|
32ba5ce36c | ||
|
|
1598baf0c3 | ||
|
|
ceb2f033f7 | ||
|
|
36e3d156c6 | ||
|
|
a26629c0e8 | ||
|
|
018d889d9a | ||
|
|
1eb01618a3 | ||
|
|
31c8549fe3 | ||
|
|
729d4bf719 | ||
|
|
19beae59e0 | ||
|
|
d24e928051 | ||
|
|
27bebd978b | ||
|
|
b919e721bc | ||
|
|
138b9f2bf2 | ||
|
|
382fb0317c | ||
|
|
e095e09b0b | ||
|
|
9212ab8b99 | ||
|
|
460b72c518 | ||
|
|
52611242fb | ||
|
|
d2bb76574b | ||
|
|
1071d24362 | ||
|
|
ae8503f0e7 | ||
|
|
773556aa32 | ||
|
|
06ee56475c | ||
|
|
a1c26c2372 | ||
|
|
387f37f1d5 | ||
|
|
874f13573b | ||
|
|
289c53ab31 | ||
|
|
f556455ba6 | ||
|
|
7f9a7e5b94 | ||
|
|
47f78bcc69 | ||
|
|
488b5adf04 | ||
|
|
82d7024dfd | ||
|
|
9d6ae11e30 | ||
|
|
3bb2821e8d | ||
|
|
201cb13b6d | ||
|
|
844ad568c4 | ||
|
|
374f690860 | ||
|
|
e5d8050f39 | ||
|
|
300e31b514 | ||
|
|
40b9d60549 | ||
|
|
5af7147863 | ||
|
|
e01cf7cfb4 | ||
|
|
eced39cc3f | ||
|
|
f3fe162848 | ||
|
|
da09a267d1 | ||
|
|
30fb4978b7 | ||
|
|
1db56d30a8 | ||
|
|
0e6b19d2bc | ||
|
|
21d1be9e18 | ||
|
|
db49793666 | ||
|
|
9dce6ed392 | ||
|
|
be770c91be | ||
|
|
cd8b63f9ba | ||
|
|
5079b164db | ||
|
|
50ace3b7e0 | ||
|
|
7c69137a47 | ||
|
|
3dac5b93e7 | ||
|
|
0f7602605c | ||
|
|
ca6a95d69c | ||
|
|
9a66d21f49 | ||
|
|
bb0ccf1e28 | ||
|
|
cfedc17338 | ||
|
|
e647e795c9 | ||
|
|
f52efabbb1 | ||
|
|
9074621085 | ||
|
|
8e2a5d2451 | ||
|
|
311b7a2eb9 | ||
|
|
4aa9646d05 | ||
|
|
d8435774d6 | ||
|
|
8f9370d259 | ||
|
|
0cd9b0debb | ||
|
|
4723d29c9e | ||
|
|
2a78a517d2 | ||
|
|
08cbcd74a8 | ||
|
|
9e68e0c9e0 | ||
|
|
590e0e4883 | ||
|
|
0d47c69ca8 | ||
|
|
dc09aceb2f | ||
|
|
a968c5f78a | ||
|
|
b37b34277b | ||
|
|
85051eaab7 | ||
|
|
040b6826c3 | ||
|
|
c09c5f5093 | ||
|
|
b1446279a8 | ||
|
|
20153f6fe2 | ||
|
|
d661ff5ee7 | ||
|
|
4cf6fd2cec | ||
|
|
c65e214fdd | ||
|
|
8477deb6a8 | ||
|
|
41b31ebfd6 | ||
|
|
d609efc746 | ||
|
|
8d37bc5e30 | ||
|
|
052ceb2d02 | ||
|
|
602c16eee1 | ||
|
|
1247cfc624 | ||
|
|
b14aea65f8 | ||
|
|
fddb6f1362 | ||
|
|
4edd16cc7e | ||
|
|
cc3aec7aa1 | ||
|
|
0e44dd9681 | ||
|
|
ff20a503bc | ||
|
|
31ca234dec | ||
|
|
e902671411 | ||
|
|
2df39d296f | ||
|
|
4edcd6a8dd | ||
|
|
14a54994b7 | ||
|
|
7798f2642b | ||
|
|
792c60b332 | ||
|
|
3dbe985b6e | ||
|
|
af06df6cae | ||
|
|
8869e92336 | ||
|
|
b10e9bbe5a | ||
|
|
a6bcb3f0fe | ||
|
|
e2fb5ee488 | ||
|
|
0b4058bdd4 | ||
|
|
195156480c | ||
|
|
7d55b33bac | ||
|
|
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 |
102
.deno/README.md
102
.deno/README.md
@@ -1,102 +0,0 @@
|
||||
<div style="text-align:center;"><h1>Discord API Types</h1></div>
|
||||
|
||||
[](https://github.com/discordjs/discord-api-types/blob/main/LICENSE.md)
|
||||
[](https://www.npmjs.com/package/discord-api-types)
|
||||
[](https://www.patreon.com/vladfrangu)
|
||||
[](https://ko-fi.com/wolfgalvlad)
|
||||
|
||||
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
|
||||
```
|
||||
|
||||
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 the default API version
|
||||
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/.deno/mod.ts';
|
||||
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/.deno/v8/mod.ts';
|
||||
```
|
||||
|
||||
2. From [deno.land/x](https://deno.land/x)
|
||||
|
||||
```ts
|
||||
// Importing the default API version
|
||||
import { APIUser } from 'https://deno.land/x/discord_api_types@0.12.0/mod.ts';
|
||||
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://deno.land/x/discord_api_types@0.12.0/v8/mod.ts';
|
||||
```
|
||||
|
||||
3. From [skypack.dev](https://www.skypack.dev/)
|
||||
|
||||
```ts
|
||||
// Importing the default API version
|
||||
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types?dts';
|
||||
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v8?dts';
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
The exports of each API version is split into three main parts:
|
||||
|
||||
- Everything exported with the `API` prefix represents a payload you may get from the REST API _or_ the Gateway.
|
||||
|
||||
- Everything exported with the `Gateway` prefix represents data that ONLY comes from or is directly related to the Gateway.
|
||||
|
||||
- Everything exported with the `REST` prefix represents data that ONLY comes from or is directly related to the REST API.
|
||||
|
||||
- For endpoint options, they will follow the following structure: `REST<HTTP Method><Type><Query|(JSON|FormData)Body|Result>` where the type represents what it will return.
|
||||
|
||||
- For example, `RESTPostAPIChannelMessageJSONBody` or `RESTGetAPIGatewayBotInfoResult`.
|
||||
|
||||
- Some exported types (specifically OAuth2 related ones) may not respect this entire structure due to the nature of the fields. They will start with either `RESTOAuth2` or with something similar to `REST<HTTP Method>OAuth2`
|
||||
|
||||
- If a type ends with `Result`, then it represents the expected result by calling its accompanying route.
|
||||
|
||||
- Types that are exported as `never` usually mean the result will be a `204 No Content`, so you can safely ignore it. This does **not** account for errors.
|
||||
|
||||
- Anything else that is miscellaneous will be exported based on what it represents (for example the `REST` route object).
|
||||
|
||||
- There may be types exported that are identical for all versions. These will be exported as is and can be found in the `common` directory. They will still be prefixed accordingly as described above.
|
||||
|
||||
**Warning**: This package documents just KNOWN (and documented) properties. Anything that isn't documented will NOT be added to this package (unless said properties are in an open Pull Request to Discord's [API Documentation repository](https://github.com/discord/discord-api-docs) or known through other means _and have received the green light to be used_). For clarification's sake, this means that properties that are only known through the process of data mining and have not yet been confirmed in a way as described will NOT be included.
|
||||
|
||||
## 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/v8');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { APIUser } from 'discord-api-types/v8';
|
||||
```
|
||||
@@ -1,149 +0,0 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes
|
||||
*/
|
||||
export const 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,
|
||||
|
||||
GuildAlreadyHasTemplate = 30031,
|
||||
|
||||
Unauthorized = 40001,
|
||||
VerifyYourAccount,
|
||||
|
||||
RequestEntityTooLarge = 40005,
|
||||
FeatureTemporarilyDisabledServerSide,
|
||||
UserBannedFromThisGuild,
|
||||
|
||||
ThisMessageWasAlreadyCrossposted = 40033,
|
||||
|
||||
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,
|
||||
|
||||
InvalidStickerSent = 50081,
|
||||
|
||||
TwoFactorAuthenticationIsRequired = 60003,
|
||||
|
||||
ReactionWasBlocked = 90001,
|
||||
|
||||
APIResourceOverloaded = 130000,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes
|
||||
*/
|
||||
export const 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 const 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/mod.ts';
|
||||
@@ -1,4 +0,0 @@
|
||||
export * from '../common/mod.ts';
|
||||
export * from './gateway/mod.ts';
|
||||
export * from './payloads/mod.ts';
|
||||
export * from './rest/mod.ts';
|
||||
@@ -1,4 +0,0 @@
|
||||
export * from '../common/mod.ts';
|
||||
export * from './gateway/mod.ts';
|
||||
export * from './payloads/mod.ts';
|
||||
export * from './rest/mod.ts';
|
||||
@@ -1,531 +0,0 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/audit-log
|
||||
*/
|
||||
|
||||
import type { APIOverwrite, ChannelType } from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildMFALevel,
|
||||
GuildVerificationLevel,
|
||||
IntegrationExpireBehavior,
|
||||
} from './guild.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { APIWebhook } from './webhook.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-object-audit-log-structure
|
||||
*/
|
||||
export interface APIAuditLog {
|
||||
/**
|
||||
* Webhooks found in the audit log
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/webhook#webhook-object
|
||||
*/
|
||||
webhooks: APIWebhook[];
|
||||
/**
|
||||
* Users found in the audit log
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
users: APIUser[];
|
||||
/**
|
||||
* Audit log entries
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object
|
||||
*/
|
||||
audit_log_entries: APIAuditLogEntry[];
|
||||
/**
|
||||
* Partial integration objects
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#integration-object
|
||||
*/
|
||||
integrations: APIGuildIntegration[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-audit-log-entry-structure
|
||||
*/
|
||||
export interface APIAuditLogEntry {
|
||||
/**
|
||||
* ID of the affected entity (webhook, user, role, etc.)
|
||||
*/
|
||||
target_id: string | null;
|
||||
/**
|
||||
* Changes made to the `target_id`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/audit-log#audit-log-change-object
|
||||
*/
|
||||
changes?: APIAuditLogChange[];
|
||||
/**
|
||||
* The user who made the changes
|
||||
*
|
||||
* *Against all odds, this can be `null` in some cases (webhooks deleting themselves
|
||||
* by using their own token, for example)*
|
||||
*/
|
||||
user_id: string | null;
|
||||
/**
|
||||
* ID of the entry
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* 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 const enum AuditLogEvent {
|
||||
GUILD_UPDATE = 1,
|
||||
|
||||
CHANNEL_CREATE = 10,
|
||||
CHANNEL_UPDATE,
|
||||
CHANNEL_DELETE,
|
||||
CHANNEL_OVERWRITE_CREATE,
|
||||
CHANNEL_OVERWRITE_UPDATE,
|
||||
CHANNEL_OVERWRITE_DELETE,
|
||||
|
||||
MEMBER_KICK = 20,
|
||||
MEMBER_PRUNE,
|
||||
MEMBER_BAN_ADD,
|
||||
MEMBER_BAN_REMOVE,
|
||||
MEMBER_UPDATE,
|
||||
MEMBER_ROLE_UPDATE,
|
||||
MEMBER_MOVE,
|
||||
MEMBER_DISCONNECT,
|
||||
BOT_ADD,
|
||||
|
||||
ROLE_CREATE = 30,
|
||||
ROLE_UPDATE,
|
||||
ROLE_DELETE,
|
||||
|
||||
INVITE_CREATE = 40,
|
||||
INVITE_UPDATE,
|
||||
INVITE_DELETE,
|
||||
|
||||
WEBHOOK_CREATE = 50,
|
||||
WEBHOOK_UPDATE,
|
||||
WEBHOOK_DELETE,
|
||||
|
||||
EMOJI_CREATE = 60,
|
||||
EMOJI_UPDATE,
|
||||
EMOJI_DELETE,
|
||||
|
||||
MESSAGE_DELETE = 72,
|
||||
MESSAGE_BULK_DELETE,
|
||||
MESSAGE_PIN,
|
||||
MESSAGE_UNPIN,
|
||||
|
||||
INTEGRATION_CREATE = 80,
|
||||
INTEGRATION_UPDATE,
|
||||
INTEGRATION_DELETE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-entry-object-optional-audit-entry-info
|
||||
*/
|
||||
export interface APIAuditLogOptions {
|
||||
/**
|
||||
* Number of days after which inactive members were kicked
|
||||
*
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
delete_member_days?: string;
|
||||
/**
|
||||
* Number of members removed by the prune
|
||||
*
|
||||
* Present from:
|
||||
* - MEMBER_PRUNE
|
||||
*/
|
||||
members_removed?: string;
|
||||
|
||||
/**
|
||||
* Channel in which the entities were targeted
|
||||
*
|
||||
* Present from:
|
||||
* - MEMBER_MOVE
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
* - MESSAGE_DELETE
|
||||
*/
|
||||
channel_id?: string;
|
||||
|
||||
/**
|
||||
* ID of the message that was targeted
|
||||
*
|
||||
* Present from:
|
||||
* - MESSAGE_PIN
|
||||
* - MESSAGE_UNPIN
|
||||
*/
|
||||
message_id?: string;
|
||||
|
||||
/**
|
||||
* 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?: string;
|
||||
|
||||
/**
|
||||
* 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 const enum AuditLogOptionsType {
|
||||
Role = '0',
|
||||
Member = '1',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure
|
||||
*/
|
||||
export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyOwnerID
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyAFKChannelID
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyVerificationLevel
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyVanityURLCode
|
||||
| APIAuditLogChangeKey$Add
|
||||
| APIAuditLogChangeKey$Remove
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyWidgetEnabled
|
||||
| APIAuditLogChangeKeyWidgetChannelID
|
||||
| APIAuditLogChangeKeySystemChannelID
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyTopic
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyApplicationID
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyAllow
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyChannelID
|
||||
| APIAuditLogChangeKeyInviterID
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyID
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyEnableEmoticons
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod;
|
||||
|
||||
/**
|
||||
* Returned when a guild's name is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyName = AuditLogChangeData<'name', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's icon is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyIconHash = AuditLogChangeData<'icon_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's splash is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeySplashHash = AuditLogChangeData<'splash_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's owner ID is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyOwnerID = AuditLogChangeData<'owner_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's region is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyRegion = AuditLogChangeData<'region', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's afk_channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAFKChannelID = AuditLogChangeData<'afk_channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's afk_timeout is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAFKTimeout = AuditLogChangeData<'afk_timeout', number>;
|
||||
|
||||
/**
|
||||
* 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', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's system_channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeySystemChannelID = AuditLogChangeData<'system_channel_id', string>;
|
||||
|
||||
/**
|
||||
* 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', string>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's amount of seconds a user has to wait before sending another message
|
||||
* is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyRateLimitPerUser = AuditLogChangeData<'rate_limit_per_user', number>;
|
||||
|
||||
/**
|
||||
* Returned when a permission bitfield is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPermissions = AuditLogChangeData<'permissions', string>;
|
||||
|
||||
/**
|
||||
* Returned when a role's color is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyColor = AuditLogChangeData<'color', number>;
|
||||
|
||||
/**
|
||||
* Returned when a role's hoist status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyHoist = AuditLogChangeData<'hoist', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a role's mentionable status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMentionable = AuditLogChangeData<'mentionable', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's allowed permissions bitfield is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAllow = AuditLogChangeData<'allow', string>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's denied permissions bitfield is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDeny = AuditLogChangeData<'deny', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's code is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyCode = AuditLogChangeData<'code', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyChannelID = AuditLogChangeData<'channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's inviter_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyInviterID = AuditLogChangeData<'inviter_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's max_uses is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMaxUses = AuditLogChangeData<'max_uses', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's uses is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyUses = AuditLogChangeData<'uses', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's max_age is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMaxAge = AuditLogChangeData<'max_age', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's temporary status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTemporary = AuditLogChangeData<'temporary', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's deaf status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDeaf = AuditLogChangeData<'deaf', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's mute status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMute = AuditLogChangeData<'mute', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's nick is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyNick = AuditLogChangeData<'mute', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's avatar_hash is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvatarHash = AuditLogChangeData<'avatar_hash', string>;
|
||||
|
||||
/**
|
||||
* The ID of the changed entity - sometimes used in conjunction with other keys
|
||||
*/
|
||||
export type APIAuditLogChangeKeyID = AuditLogChangeData<'id', string>;
|
||||
|
||||
/**
|
||||
* The type of entity created
|
||||
*/
|
||||
export type APIAuditLogChangeKeyType = AuditLogChangeData<'type', ChannelType | string>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's enable_emoticons is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEnableEmoticons = AuditLogChangeData<'enable_emoticons', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's expire_behavior is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExpireBehavior = AuditLogChangeData<'expire_behavior', IntegrationExpireBehavior>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's expire_grace_period is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExpireGracePeriod = AuditLogChangeData<'expire_grace_period', number>;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
interface AuditLogChangeData<K extends string, D extends unknown> {
|
||||
key: K;
|
||||
new_value?: D;
|
||||
old_value?: D;
|
||||
}
|
||||
@@ -1,911 +0,0 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/channel
|
||||
*/
|
||||
|
||||
import type { APIPartialEmoji } from './emoji.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
*/
|
||||
export interface APIPartialChannel {
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* The type of the channel
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*/
|
||||
type: ChannelType;
|
||||
/**
|
||||
* The name of the channel (2-100 characters)
|
||||
*/
|
||||
name?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-structure
|
||||
*/
|
||||
export interface APIChannel extends APIPartialChannel {
|
||||
/**
|
||||
* The id of the guild
|
||||
*/
|
||||
guild_id?: string;
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position?: number;
|
||||
/**
|
||||
* Explicit permission overwrites for members and roles
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#overwrite-object
|
||||
*/
|
||||
permission_overwrites?: APIOverwrite[];
|
||||
/**
|
||||
* The channel topic (0-1024 characters)
|
||||
*/
|
||||
topic?: string | null;
|
||||
/**
|
||||
* Whether the channel is nsfw
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: string | null;
|
||||
/**
|
||||
* The bitrate (in bits) of the voice channel
|
||||
*/
|
||||
bitrate?: number;
|
||||
/**
|
||||
* The user limit of the voice channel
|
||||
*/
|
||||
user_limit?: number;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`, are unaffected
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
/**
|
||||
* The recipients of the DM
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
recipients?: APIUser[];
|
||||
/**
|
||||
* Icon hash
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* ID of the DM creator
|
||||
*/
|
||||
owner_id?: string;
|
||||
/**
|
||||
* Application id of the group DM creator if it is bot-created
|
||||
*/
|
||||
application_id?: string;
|
||||
/**
|
||||
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
|
||||
*/
|
||||
parent_id?: string | null;
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*/
|
||||
export const enum ChannelType {
|
||||
/**
|
||||
* A text channel within a guild
|
||||
*/
|
||||
GUILD_TEXT = 0,
|
||||
/**
|
||||
* A direct message between users
|
||||
*/
|
||||
DM,
|
||||
/**
|
||||
* A voice channel within a guild
|
||||
*/
|
||||
GUILD_VOICE,
|
||||
/**
|
||||
* A direct message between multiple users
|
||||
*/
|
||||
GROUP_DM,
|
||||
/**
|
||||
* An organizational category that contains up to 50 channels
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/115001580171-Channel-Categories-101
|
||||
*/
|
||||
GUILD_CATEGORY,
|
||||
/**
|
||||
* A channel that users can follow and crosspost into their own guild
|
||||
*
|
||||
* See https://support.discord.com/hc/en-us/articles/360032008192
|
||||
*/
|
||||
GUILD_NEWS,
|
||||
/**
|
||||
* A channel in which game developers can sell their game on Discord
|
||||
*
|
||||
* See https://discord.com/developers/docs/game-and-server-management/special-channels
|
||||
*/
|
||||
GUILD_STORE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-structure
|
||||
*/
|
||||
export interface APIMessage {
|
||||
/**
|
||||
* ID of the message
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* ID of the channel the message was sent in
|
||||
*/
|
||||
channel_id: string;
|
||||
/**
|
||||
* ID of the guild the message was sent in
|
||||
*/
|
||||
guild_id?: string;
|
||||
/**
|
||||
* The author of this message (only a valid user in the case where the message is generated by a user or bot user)
|
||||
*
|
||||
* If the message is generated by a webhook, the author object corresponds to the webhook's id,
|
||||
* username, and avatar. You can tell if a message is generated by a webhook by checking for the `webhook_id` property
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
author: APIUser;
|
||||
/**
|
||||
* Member properties for this message's author
|
||||
*
|
||||
* The member object exists in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
/**
|
||||
* Contents of the message
|
||||
*/
|
||||
content: string;
|
||||
/**
|
||||
* When this message was sent
|
||||
*/
|
||||
timestamp: string;
|
||||
/**
|
||||
* When this message was edited (or null if never)
|
||||
*/
|
||||
edited_timestamp: string | null;
|
||||
/**
|
||||
* Whether this was a TTS message
|
||||
*/
|
||||
tts: boolean;
|
||||
/**
|
||||
* Whether this message mentions everyone
|
||||
*/
|
||||
mention_everyone: boolean;
|
||||
/**
|
||||
* Users specifically mentioned in the message
|
||||
*
|
||||
* The `member` field is only present in `MESSAGE_CREATE` and `MESSAGE_UPDATE` events
|
||||
* from text-based guild channels
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-member-object
|
||||
*/
|
||||
mentions: (APIUser & { member?: Omit<APIGuildMember, 'user'> })[];
|
||||
/**
|
||||
* Roles specifically mentioned in this message
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
mention_roles: string[];
|
||||
/**
|
||||
* Channels specifically mentioned in this message
|
||||
*
|
||||
* Not all channel mentions in a message will appear in `mention_channels`.
|
||||
* - Only textual channels that are visible to everyone in a lurkable guild will ever be included
|
||||
* - Only crossposted messages (via Channel Following) currently include `mention_channels` at all
|
||||
*
|
||||
* If no mentions in the message meet these requirements, this field will not be sent
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-mention-object
|
||||
*/
|
||||
mention_channels?: APIChannelMention[];
|
||||
/**
|
||||
* Any attached files
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#attachment-object
|
||||
*/
|
||||
attachments: APIAttachment[];
|
||||
/**
|
||||
* Any embedded content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embeds: APIEmbed[];
|
||||
/**
|
||||
* Reactions to the message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#reaction-object
|
||||
*/
|
||||
reactions?: APIReaction[];
|
||||
/**
|
||||
* Used for validating a message was sent
|
||||
*
|
||||
* **You will not receive this from further fetches. This is received only once from a `MESSAGE_CREATE`
|
||||
* event to ensure it got sent**
|
||||
*/
|
||||
nonce?: string | number;
|
||||
/**
|
||||
* Whether this message is pinned
|
||||
*/
|
||||
pinned: boolean;
|
||||
/**
|
||||
* If the message is generated by a webhook, this is the webhook's id
|
||||
*/
|
||||
webhook_id?: string;
|
||||
/**
|
||||
* Type of message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-types
|
||||
*/
|
||||
type: MessageType;
|
||||
/**
|
||||
* Sent with Rich Presence-related chat embeds
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
|
||||
*/
|
||||
activity?: APIMessageActivity;
|
||||
/**
|
||||
* Sent with Rich Presence-related chat embeds
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
|
||||
*/
|
||||
application?: APIMessageApplication;
|
||||
/**
|
||||
* Reference data sent with crossposted messages and replies
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReference;
|
||||
/**
|
||||
* Message flags combined as a bitfield
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
flags?: MessageFlags;
|
||||
/**
|
||||
* The stickers sent with the message (bots currently can only receive messages with stickers, not send)
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-sticker-structure
|
||||
*/
|
||||
stickers?: APISticker[];
|
||||
/**
|
||||
* The message associated with the `message_reference`
|
||||
*
|
||||
* This field is only returned for messages with a `type` of `19` (REPLY).
|
||||
*
|
||||
* If the message is a reply but the `referenced_message` field is not present,
|
||||
* the backend did not attempt to fetch the message that was being replied to,
|
||||
* so its state is unknown.
|
||||
*
|
||||
* If the field exists but is `null`, the referenced message was deleted
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object
|
||||
*/
|
||||
referenced_message?: APIMessage | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-types
|
||||
*/
|
||||
export const enum MessageType {
|
||||
DEFAULT,
|
||||
RECIPIENT_ADD,
|
||||
RECIPIENT_REMOVE,
|
||||
CALL,
|
||||
CHANNEL_NAME_CHANGE,
|
||||
CHANNEL_ICON_CHANGE,
|
||||
CHANNEL_PINNED_MESSAGE,
|
||||
GUILD_MEMBER_JOIN,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_1,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_2,
|
||||
USER_PREMIUM_GUILD_SUBSCRIPTION_TIER_3,
|
||||
CHANNEL_FOLLOW_ADD,
|
||||
GUILD_DISCOVERY_DISQUALIFIED = 14,
|
||||
GUILD_DISCOVERY_REQUALIFIED,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_INITIAL_WARNING,
|
||||
GUILD_DISCOVERY_GRACE_PERIOD_FINAL_WARNING,
|
||||
REPLY = 19,
|
||||
APPLICATION_COMMAND,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-structure
|
||||
*/
|
||||
export interface APIMessageActivity {
|
||||
/**
|
||||
* Type of message activity
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
|
||||
*/
|
||||
type: MessageActivityType;
|
||||
/**
|
||||
* `party_id` from a Rich Presence event
|
||||
*
|
||||
* See https://discord.com/developers/docs/rich-presence/how-to#updating-presence-update-presence-payload-fields
|
||||
*/
|
||||
party_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-application-structure
|
||||
*/
|
||||
export interface APIMessageApplication {
|
||||
/**
|
||||
* ID of the application
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* ID of the embed's image asset
|
||||
*/
|
||||
cover_image?: string;
|
||||
/**
|
||||
* Application's description
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* ID of the application's icon
|
||||
*/
|
||||
icon: string | null;
|
||||
/**
|
||||
* Name of the application
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
*/
|
||||
export interface APIMessageReference {
|
||||
/**
|
||||
* ID of the originating message
|
||||
*/
|
||||
message_id?: string;
|
||||
/**
|
||||
* ID of the originating message's channel
|
||||
*/
|
||||
channel_id: string;
|
||||
/**
|
||||
* ID of the originating message's guild
|
||||
*/
|
||||
guild_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-activity-types
|
||||
*/
|
||||
export const enum MessageActivityType {
|
||||
JOIN = 1,
|
||||
SPECTATE,
|
||||
LISTEN,
|
||||
JOIN_REQUEST = 5,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-flags
|
||||
*/
|
||||
export const enum MessageFlags {
|
||||
/**
|
||||
* This message has been published to subscribed channels (via Channel Following)
|
||||
*/
|
||||
CROSSPOSTED = 1 << 0,
|
||||
/**
|
||||
* This message originated from a message in another channel (via Channel Following)
|
||||
*/
|
||||
IS_CROSSPOST = 1 << 1,
|
||||
/**
|
||||
* Do not include any embeds when serializing this message
|
||||
*/
|
||||
SUPPRESS_EMBEDS = 1 << 2,
|
||||
/**
|
||||
* The source message for this crosspost has been deleted (via Channel Following)
|
||||
*/
|
||||
SOURCE_MESSAGE_DELETED = 1 << 3,
|
||||
/**
|
||||
* This message came from the urgent message system
|
||||
*/
|
||||
URGENT = 1 << 4,
|
||||
EPHEMERAL = 1 << 6,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-sticker-structure
|
||||
*/
|
||||
export interface APISticker {
|
||||
/**
|
||||
* ID of the sticker
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* ID of the pack the sticker is from
|
||||
*/
|
||||
pack_id: string;
|
||||
/**
|
||||
* Name of the sticker
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Description of the sticker
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* A comma-separated list of tags for the sticker
|
||||
*/
|
||||
tags?: string;
|
||||
/**
|
||||
* Sticker asset hash
|
||||
*/
|
||||
asset: string;
|
||||
/**
|
||||
* Sticker preview asset hash
|
||||
*/
|
||||
preview_asset: string | null;
|
||||
/**
|
||||
* Type of sticker format
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-sticker-format-types
|
||||
*/
|
||||
format_type: StickerFormatType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#message-object-message-sticker-format-types
|
||||
*/
|
||||
export const enum StickerFormatType {
|
||||
PNG = 1,
|
||||
APNG,
|
||||
LOTTIE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#followed-channel-object
|
||||
*/
|
||||
export interface APIFollowedChannel {
|
||||
/**
|
||||
* Source channel id
|
||||
*/
|
||||
channel_id: string;
|
||||
/**
|
||||
* Created target webhook id
|
||||
*/
|
||||
webhook_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#reaction-object-reaction-structure
|
||||
*/
|
||||
export interface APIReaction {
|
||||
/**
|
||||
* Times this emoji has been used to react
|
||||
*/
|
||||
count: number;
|
||||
/**
|
||||
* Whether the current user reacted using this emoji
|
||||
*/
|
||||
me: boolean;
|
||||
/**
|
||||
* Emoji information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/emoji#emoji-object
|
||||
*/
|
||||
emoji: APIPartialEmoji;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure
|
||||
*/
|
||||
export interface APIOverwrite {
|
||||
/**
|
||||
* Role or user id
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Either 0 (role) or 1 (member)
|
||||
*
|
||||
* {@link OverwriteType}
|
||||
*/
|
||||
type: OverwriteType;
|
||||
/**
|
||||
* Permission bit set
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
allow: string;
|
||||
/**
|
||||
* Permission bit set
|
||||
*
|
||||
* See https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
deny: string;
|
||||
}
|
||||
|
||||
export const enum OverwriteType {
|
||||
Role,
|
||||
Member,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-structure
|
||||
*
|
||||
* Length limit: 6000 characters
|
||||
*/
|
||||
export interface APIEmbed {
|
||||
/**
|
||||
* Title of embed
|
||||
*
|
||||
* Length limit: 256 characters
|
||||
*/
|
||||
title?: string;
|
||||
/**
|
||||
* Type of embed (always "rich" for webhook embeds)
|
||||
*
|
||||
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-types
|
||||
*/
|
||||
type?: EmbedType;
|
||||
/**
|
||||
* Description of embed
|
||||
*
|
||||
* Length limit: 2048 characters
|
||||
*/
|
||||
description?: string;
|
||||
/**
|
||||
* URL of embed
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* Timestamp of embed content
|
||||
*/
|
||||
timestamp?: string;
|
||||
/**
|
||||
* Color code of the embed
|
||||
*/
|
||||
color?: number;
|
||||
/**
|
||||
* Footer information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
|
||||
*/
|
||||
footer?: APIEmbedFooter;
|
||||
/**
|
||||
* Image information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
|
||||
*/
|
||||
image?: APIEmbedImage;
|
||||
/**
|
||||
* Thumbnail information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
|
||||
*/
|
||||
thumbnail?: APIEmbedThumbnail;
|
||||
/**
|
||||
* Video information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
|
||||
*/
|
||||
video?: APIEmbedVideo;
|
||||
/**
|
||||
* Provider information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
|
||||
*/
|
||||
provider?: APIEmbedProvider;
|
||||
/**
|
||||
* Author information
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
|
||||
*/
|
||||
author?: APIEmbedAuthor;
|
||||
/**
|
||||
* Fields information
|
||||
*
|
||||
* Length limit: 25 field objects
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
|
||||
*/
|
||||
fields?: APIEmbedField[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-types
|
||||
* @deprecated *Embed types should be considered deprecated and might be removed in a future API version*
|
||||
*/
|
||||
export const enum EmbedType {
|
||||
/**
|
||||
* Generic embed rendered from embed attributes
|
||||
*/
|
||||
Rich = 'rich',
|
||||
/**
|
||||
* Image embed
|
||||
*/
|
||||
Image = 'image',
|
||||
/**
|
||||
* Video embed
|
||||
*/
|
||||
Video = 'video',
|
||||
/**
|
||||
* Animated gif image embed rendered as a video embed
|
||||
*/
|
||||
GifV = 'gifv',
|
||||
/**
|
||||
* Article embed
|
||||
*/
|
||||
Article = 'article',
|
||||
/**
|
||||
* Link embed
|
||||
*/
|
||||
Link = 'link',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-thumbnail-structure
|
||||
*/
|
||||
export interface APIEmbedThumbnail {
|
||||
/**
|
||||
* Source url of thumbnail (only supports http(s) and attachments)
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* A proxied url of the thumbnail
|
||||
*/
|
||||
proxy_url?: string;
|
||||
/**
|
||||
* Height of thumbnail
|
||||
*/
|
||||
height?: number;
|
||||
/**
|
||||
* Width of thumbnail
|
||||
*/
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-video-structure
|
||||
*/
|
||||
export interface APIEmbedVideo {
|
||||
/**
|
||||
* Source url of video
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* Height of video
|
||||
*/
|
||||
height?: number;
|
||||
/**
|
||||
* Width of video
|
||||
*/
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-image-structure
|
||||
*/
|
||||
export interface APIEmbedImage {
|
||||
/**
|
||||
* Source url of image (only supports http(s) and attachments)
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* A proxied url of the image
|
||||
*/
|
||||
proxy_url?: string;
|
||||
/**
|
||||
* Height of image
|
||||
*/
|
||||
height?: number;
|
||||
/**
|
||||
* Width of image
|
||||
*/
|
||||
width?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-provider-structure
|
||||
*/
|
||||
export interface APIEmbedProvider {
|
||||
/**
|
||||
* Name of provider
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* URL of provider
|
||||
*/
|
||||
url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-author-structure
|
||||
*/
|
||||
export interface APIEmbedAuthor {
|
||||
/**
|
||||
* Name of author
|
||||
*
|
||||
* Length limit: 256 characters
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* URL of author
|
||||
*/
|
||||
url?: string;
|
||||
/**
|
||||
* URL of author icon (only supports http(s) and attachments)
|
||||
*/
|
||||
icon_url?: string;
|
||||
/**
|
||||
* A proxied url of author icon
|
||||
*/
|
||||
proxy_icon_url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-footer-structure
|
||||
*/
|
||||
export interface APIEmbedFooter {
|
||||
/**
|
||||
* Footer text
|
||||
*
|
||||
* Length limit: 2048 characters
|
||||
*/
|
||||
text: string;
|
||||
/**
|
||||
* URL of footer icon (only supports http(s) and attachments)
|
||||
*/
|
||||
icon_url?: string;
|
||||
/**
|
||||
* A proxied url of footer icon
|
||||
*/
|
||||
proxy_icon_url?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#embed-object-embed-field-structure
|
||||
*/
|
||||
export interface APIEmbedField {
|
||||
/**
|
||||
* Name of the field
|
||||
*
|
||||
* Length limit: 256 characters
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Value of the field
|
||||
*
|
||||
* Length limit: 1024 characters
|
||||
*/
|
||||
value: string;
|
||||
/**
|
||||
* Whether or not this field should display inline
|
||||
*/
|
||||
inline?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#attachment-object-attachment-structure
|
||||
*/
|
||||
export interface APIAttachment {
|
||||
/**
|
||||
* Attachment id
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Name of file attached
|
||||
*/
|
||||
filename: string;
|
||||
/**
|
||||
* Size of file in bytes
|
||||
*/
|
||||
size: number;
|
||||
/**
|
||||
* Source url of file
|
||||
*/
|
||||
url: string;
|
||||
/**
|
||||
* A proxied url of file
|
||||
*/
|
||||
proxy_url: string;
|
||||
/**
|
||||
* Height of file (if image)
|
||||
*/
|
||||
height?: number | null;
|
||||
/**
|
||||
* Width of file (if image)
|
||||
*/
|
||||
width?: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#channel-mention-object-channel-mention-structure
|
||||
*/
|
||||
export interface APIChannelMention {
|
||||
/**
|
||||
* ID of the channel
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* ID of the guild containing the channel
|
||||
*/
|
||||
guild_id: string;
|
||||
/**
|
||||
* The type of channel
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object-channel-types
|
||||
*/
|
||||
type: ChannelType;
|
||||
/**
|
||||
* The name of the channel
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
|
||||
*/
|
||||
export const enum AllowedMentionsTypes {
|
||||
/**
|
||||
* Controls @everyone and @here mentions
|
||||
*/
|
||||
Everyone = 'everyone',
|
||||
/**
|
||||
* Controls role mentions
|
||||
*/
|
||||
Role = 'roles',
|
||||
/**
|
||||
* Controls user mentions
|
||||
*/
|
||||
User = 'users',
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mentions-structure
|
||||
*/
|
||||
export interface APIAllowedMentions {
|
||||
/**
|
||||
* An array of allowed mention types to parse from the content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object-allowed-mention-types
|
||||
*/
|
||||
parse?: AllowedMentionsTypes[];
|
||||
/**
|
||||
* Array of role_ids to mention (Max size of 100)
|
||||
*/
|
||||
roles?: string[];
|
||||
/**
|
||||
* Array of user_ids to mention (Max size of 100)
|
||||
*/
|
||||
users?: string[];
|
||||
/**
|
||||
* For replies, whether to mention the author of the message being replied to (default false)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
replied_user?: boolean;
|
||||
}
|
||||
@@ -1,180 +0,0 @@
|
||||
import type { APIGuildMember, APIUser, MessageFlags } from './mod.ts';
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../rest/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommand
|
||||
*/
|
||||
export interface APIApplicationCommand {
|
||||
id: string;
|
||||
application_id: string;
|
||||
name: string;
|
||||
description: string;
|
||||
options?: APIApplicationCommandOption[];
|
||||
}
|
||||
|
||||
interface APIApplicationCommandOptionBase {
|
||||
type:
|
||||
| ApplicationCommandOptionType.BOOLEAN
|
||||
| ApplicationCommandOptionType.USER
|
||||
| ApplicationCommandOptionType.CHANNEL
|
||||
| ApplicationCommandOptionType.ROLE;
|
||||
name: string;
|
||||
description: string;
|
||||
default?: boolean;
|
||||
required?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoption
|
||||
*/
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandArgumentOptions
|
||||
| APIApplicationCommandSubCommandOptions
|
||||
| APIApplicationCommandOptionBase;
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* If the option is a `SUB_COMMAND` or `SUB_COMMAND_GROUP` type, this nested options will be the parameters
|
||||
*/
|
||||
export interface APIApplicationCommandSubCommandOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.SUB_COMMAND | ApplicationCommandOptionType.SUB_COMMAND_GROUP;
|
||||
options?: APIApplicationCommandOption[];
|
||||
}
|
||||
|
||||
/**
|
||||
* This type is exported as a way to make it stricter for you when you're writing your commands
|
||||
*
|
||||
* In contrast to @see APIApplicationCommandSubCommandOptions, these types cannot have an `options` array,
|
||||
* but they can have a `choices` one
|
||||
*/
|
||||
export interface APIApplicationCommandArgumentOptions extends Omit<APIApplicationCommandOptionBase, 'type'> {
|
||||
type: ApplicationCommandOptionType.STRING | ApplicationCommandOptionType.INTEGER;
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptiontype
|
||||
*/
|
||||
export const enum ApplicationCommandOptionType {
|
||||
SUB_COMMAND = 1,
|
||||
SUB_COMMAND_GROUP,
|
||||
STRING,
|
||||
INTEGER,
|
||||
BOOLEAN,
|
||||
USER,
|
||||
CHANNEL,
|
||||
ROLE,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptionchoice
|
||||
*/
|
||||
export interface APIApplicationCommandOptionChoice {
|
||||
name: string;
|
||||
value: string | number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction
|
||||
*/
|
||||
export interface APIInteraction {
|
||||
id: string;
|
||||
type: InteractionType;
|
||||
data?: APIApplicationCommandInteractionData;
|
||||
guild_id: string;
|
||||
channel_id: string;
|
||||
member: APIGuildMember & { permissions: string; user: APIUser };
|
||||
token: string;
|
||||
version: 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Like See APIInteraction, only with the `data` property always present
|
||||
*/
|
||||
export type APIApplicationCommandInteraction = Required<APIInteraction>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-interactiontype
|
||||
*/
|
||||
export const enum InteractionType {
|
||||
Ping = 1,
|
||||
ApplicationCommand,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-applicationcommandinteractiondata
|
||||
*/
|
||||
export interface APIApplicationCommandInteractionData {
|
||||
id: string;
|
||||
name: string;
|
||||
options?: APIApplicationCommandInteractionDataOption[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-applicationcommandinteractiondataoption
|
||||
*/
|
||||
export interface APIApplicationCommandInteractionDataOption {
|
||||
name: string;
|
||||
/**
|
||||
* The value returned here depends on the `ApplicationCommandOptionType` type of the option with the name
|
||||
* that matches this interface's `name`.
|
||||
*
|
||||
* You will need to manually cast this to the appropriate type based on the returned data
|
||||
*/
|
||||
value?: unknown;
|
||||
options?: APIApplicationCommandInteractionDataOption[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-interaction-response
|
||||
*/
|
||||
export type APIInteractionResponse =
|
||||
| APIInteractionResponsePong
|
||||
| APIInteractionResponseAcknowledge
|
||||
| APIInteractionResponseAcknowledgeWithSource
|
||||
| APIInteractionResponseChannelMessage
|
||||
| APIInteractionResponseChannelMessageWithSource;
|
||||
|
||||
export type APIInteractionResponsePong = InteractionResponsePayload<APIInteractionResponseType.Pong>;
|
||||
|
||||
export type APIInteractionResponseAcknowledge = InteractionResponsePayload<APIInteractionResponseType.Acknowledge>;
|
||||
|
||||
export type APIInteractionResponseAcknowledgeWithSource = InteractionResponsePayload<APIInteractionResponseType.AcknowledgeWithSource>;
|
||||
|
||||
export type APIInteractionResponseChannelMessage = InteractionResponsePayload<
|
||||
APIInteractionResponseType.ChannelMessage,
|
||||
true
|
||||
>;
|
||||
|
||||
export type APIInteractionResponseChannelMessageWithSource = InteractionResponsePayload<
|
||||
APIInteractionResponseType.ChannelMessageWithSource,
|
||||
true
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-interactionresponsetype
|
||||
*/
|
||||
export const enum APIInteractionResponseType {
|
||||
Pong = 1,
|
||||
Acknowledge,
|
||||
ChannelMessage,
|
||||
ChannelMessageWithSource,
|
||||
AcknowledgeWithSource,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#interaction-interactionapplicationcommandcallbackdata
|
||||
*/
|
||||
export type APIInteractionApplicationCommandCallbackData = Omit<
|
||||
RESTPostAPIWebhookWithTokenJSONBody,
|
||||
'username' | 'avatar_url'
|
||||
> & { flags?: MessageFlags };
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
interface InteractionResponsePayload<T extends APIInteractionResponseType, D = false> {
|
||||
type: T;
|
||||
data?: D extends true ? APIInteractionApplicationCommandCallbackData : never;
|
||||
}
|
||||
@@ -1,88 +0,0 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/invite
|
||||
*/
|
||||
|
||||
import type { APIPartialChannel } from './channel.ts';
|
||||
import type { APIPartialGuild } from './guild.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object
|
||||
*/
|
||||
export interface APIInvite {
|
||||
/**
|
||||
* The invite code (unique ID)
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* The guild this invite is for
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/guild#guild-object
|
||||
*/
|
||||
guild?: APIPartialGuild;
|
||||
/**
|
||||
* The channel this invite is for
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#channel-object
|
||||
*/
|
||||
channel?: Required<APIPartialChannel>;
|
||||
/**
|
||||
* The user who created the invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
inviter?: APIUser;
|
||||
/**
|
||||
* The target user for this invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/user#user-object
|
||||
*/
|
||||
target_user?: APIUser;
|
||||
/**
|
||||
* The type of user target for this invite
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
|
||||
*/
|
||||
target_user_type?: InviteTargetUserType;
|
||||
/**
|
||||
* Approximate count of online members (only present when `target_user` is set)
|
||||
*/
|
||||
approximate_presence_count?: number;
|
||||
/**
|
||||
* Approximate count of total members
|
||||
*/
|
||||
approximate_member_count?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#invite-object-target-user-types
|
||||
*/
|
||||
export const enum InviteTargetUserType {
|
||||
STREAM = 1,
|
||||
}
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
@@ -1,113 +0,0 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/topics/permissions
|
||||
*/
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags
|
||||
*
|
||||
* These flags are exported as `BigInt`s and NOT numbers. For most of them, you can
|
||||
* convert them in a number by wrapping it in `Number()`, however be careful as any
|
||||
* further bits added may cause issues if done so. Try to use BigInts as much as possible
|
||||
* or modules that can replicate them in some way
|
||||
*/
|
||||
export const PermissionFlagsBits = {
|
||||
CREATE_INSTANT_INVITE: 1n << 0n,
|
||||
KICK_MEMBERS: 1n << 1n,
|
||||
BAN_MEMBERS: 1n << 2n,
|
||||
ADMINISTRATOR: 1n << 3n,
|
||||
MANAGE_CHANNELS: 1n << 4n,
|
||||
MANAGE_GUILD: 1n << 5n,
|
||||
ADD_REACTIONS: 1n << 6n,
|
||||
VIEW_AUDIT_LOG: 1n << 7n,
|
||||
PRIORITY_SPEAKER: 1n << 8n,
|
||||
STREAM: 1n << 9n,
|
||||
VIEW_CHANNEL: 1n << 10n,
|
||||
SEND_MESSAGES: 1n << 11n,
|
||||
SEND_TTS_MESSAGES: 1n << 12n,
|
||||
MANAGE_MESSAGES: 1n << 13n,
|
||||
EMBED_LINKS: 1n << 14n,
|
||||
ATTACH_FILES: 1n << 15n,
|
||||
READ_MESSAGE_HISTORY: 1n << 16n,
|
||||
MENTION_EVERYONE: 1n << 17n,
|
||||
USE_EXTERNAL_EMOJIS: 1n << 18n,
|
||||
VIEW_GUILD_INSIGHTS: 1n << 19n,
|
||||
CONNECT: 1n << 20n,
|
||||
SPEAK: 1n << 21n,
|
||||
MUTE_MEMBERS: 1n << 22n,
|
||||
DEAFEN_MEMBERS: 1n << 23n,
|
||||
MOVE_MEMBERS: 1n << 24n,
|
||||
USE_VAD: 1n << 25n,
|
||||
CHANGE_NICKNAME: 1n << 26n,
|
||||
MANAGE_NICKNAMES: 1n << 27n,
|
||||
MANAGE_ROLES: 1n << 28n,
|
||||
MANAGE_WEBHOOKS: 1n << 29n,
|
||||
MANAGE_EMOJIS: 1n << 30n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Freeze the object of bits, preventing any modifications to it
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(PermissionFlagsBits);
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/permissions#role-object
|
||||
*/
|
||||
export interface APIRole {
|
||||
/**
|
||||
* Role id
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Role name
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Integer representation of hexadecimal color code
|
||||
*/
|
||||
color: number;
|
||||
/**
|
||||
* If this role is pinned in the user listing
|
||||
*/
|
||||
hoist: boolean;
|
||||
/**
|
||||
* Position of this role
|
||||
*/
|
||||
position: number;
|
||||
/**
|
||||
* Permission bit set
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
permissions: string;
|
||||
/**
|
||||
* 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?: string;
|
||||
/**
|
||||
* Whether this is the guild's premium subscriber role
|
||||
*/
|
||||
premium_subscriber?: null;
|
||||
/**
|
||||
* The id of the integration this role belongs to
|
||||
*/
|
||||
integration_id?: string;
|
||||
}
|
||||
@@ -1,443 +0,0 @@
|
||||
import type {
|
||||
APIAllowedMentions,
|
||||
APIChannel,
|
||||
APIEmbed,
|
||||
APIExtendedInvite,
|
||||
APIFollowedChannel,
|
||||
APIMessage,
|
||||
APIMessageReference,
|
||||
APIOverwrite,
|
||||
APIUser,
|
||||
ChannelType,
|
||||
InviteTargetUserType,
|
||||
MessageFlags,
|
||||
OverwriteType,
|
||||
} from '../payloads/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel
|
||||
*/
|
||||
export type RESTGetAPIChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
*/
|
||||
export interface RESTPatchAPIChannelJSONBody {
|
||||
/**
|
||||
* 2-100 character channel name
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* The type of channel; only conversion between `text` and `news`
|
||||
* is supported and only in guilds with the "NEWS" feature
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
type?: ChannelType.GUILD_NEWS | ChannelType.GUILD_TEXT;
|
||||
/**
|
||||
* The position of the channel in the left-hand listing
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
position?: number | null;
|
||||
/**
|
||||
* 0-1024 character channel topic
|
||||
*
|
||||
* Channel types: text, news
|
||||
*/
|
||||
topic?: string | null;
|
||||
/**
|
||||
* Whether the channel is nsfw
|
||||
*
|
||||
* Channel types: text, news, store
|
||||
*/
|
||||
nsfw?: boolean | null;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `MANAGE_MESSAGES` or `MANAGE_CHANNELS`,
|
||||
* are unaffected
|
||||
*
|
||||
* Channel types: text
|
||||
*/
|
||||
rate_limit_per_user?: number | null;
|
||||
/**
|
||||
* The bitrate (in bits) of the voice channel; 8000 to 96000 (128000 for VIP servers)
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
bitrate?: number | null;
|
||||
/**
|
||||
* The user limit of the voice channel; 0 refers to no limit, 1 to 99 refers to a user limit
|
||||
*
|
||||
* Channel types: voice
|
||||
*/
|
||||
user_limit?: number | null;
|
||||
/**
|
||||
* Channel or category-specific permissions
|
||||
*
|
||||
* Channel types: all
|
||||
*/
|
||||
permission_overwrites?: APIOverwrite[] | null;
|
||||
/**
|
||||
* ID of the new parent category for a channel
|
||||
*
|
||||
* Channel types: text, news, store, voice
|
||||
*/
|
||||
parent_id?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#modify-channel
|
||||
*/
|
||||
export type RESTPatchAPIChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#deleteclose-channel
|
||||
*/
|
||||
export type RESTDeleteAPIChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel-messages
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessagesQuery {
|
||||
/**
|
||||
* Get messages around this message ID
|
||||
*/
|
||||
around?: string;
|
||||
/**
|
||||
* Get messages before this message ID
|
||||
*/
|
||||
before?: string;
|
||||
/**
|
||||
* Get messages after this message ID
|
||||
*/
|
||||
after?: string;
|
||||
/**
|
||||
* Max number of messages to return (1-100)
|
||||
*
|
||||
* @default 50
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel-messages
|
||||
*/
|
||||
export type RESTGetAPIChannelMessagesResult = APIMessage[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel-message
|
||||
*/
|
||||
export type RESTGetAPIChannelMessageResult = APIMessage;
|
||||
|
||||
export type APIMessageReferenceSend = Partial<APIMessageReference> & Required<Pick<APIMessageReference, 'message_id'>>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export interface RESTPostAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string;
|
||||
/**
|
||||
* A nonce that can be used for optimistic message sending
|
||||
*/
|
||||
nonce?: number | string;
|
||||
/**
|
||||
* `true` if this is a TTS message
|
||||
*/
|
||||
tts?: true;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#embed-object
|
||||
*/
|
||||
embed?: APIEmbed;
|
||||
/**
|
||||
* Allowed mentions for a message
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#allowed-mentions-object
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions;
|
||||
/**
|
||||
* Include to make your message a reply
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/channel#message-object-message-reference-structure
|
||||
*/
|
||||
message_reference?: APIMessageReferenceSend;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageFormDataBody =
|
||||
| {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIChannelMessageJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#crosspost-message
|
||||
*/
|
||||
export type RESTPostAPIChannelMessageCrosspostResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-reaction
|
||||
*/
|
||||
export type RESTPutAPIChannelMessageReactionResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-own-reaction
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageOwnReaction = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-user-reaction
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageUserReactionResult = never;
|
||||
|
||||
/*
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
export interface RESTGetAPIChannelMessageReactionUsersQuery {
|
||||
/**
|
||||
* Get users before this user ID
|
||||
*/
|
||||
before?: string;
|
||||
/**
|
||||
* Get users after this user ID
|
||||
*/
|
||||
after?: string;
|
||||
/**
|
||||
* Max number of users to return (1-100)
|
||||
*
|
||||
* @default 25
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-reactions
|
||||
*/
|
||||
export type RESTGetAPIChannelMessageReactionUsersResult = APIUser[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-all-reactions
|
||||
*/
|
||||
export type RESTDeleteAPIChannelAllMessageReactionsResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-all-reactions-for-emoji
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageReactionResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export interface RESTPatchAPIChannelMessageJSONBody {
|
||||
/**
|
||||
* The new message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string | null;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*/
|
||||
embed?: APIEmbed | null;
|
||||
/**
|
||||
* Edit the flags of a message (only `SUPPRESS_EMBEDS` can currently be set/unset)
|
||||
*
|
||||
* When specifying flags, ensure to include all previously set flags/bits
|
||||
* in addition to ones that you are modifying
|
||||
*/
|
||||
flags?: MessageFlags | null;
|
||||
/**
|
||||
* Allowed mentions for the message
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-message
|
||||
*/
|
||||
export type RESTPatchAPIChannelMessageResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-message
|
||||
*/
|
||||
export type RESTDeleteAPIChannelMessageResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#bulk-delete-messages
|
||||
*/
|
||||
export interface RESTPostAPIChannelMessagesBulkDeleteJSONBody {
|
||||
/**
|
||||
* An array of message ids to delete (2-100)
|
||||
*/
|
||||
messages: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#bulk-delete-messages
|
||||
*/
|
||||
export type RESTPostAPIChannelMessagesBulkDeleteResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-channel-permissions
|
||||
*/
|
||||
export interface RESTPutAPIChannelPermissionJSONBody {
|
||||
/**
|
||||
* The bitwise value of all allowed permissions
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
allow: string;
|
||||
/**
|
||||
* The bitwise value of all disallowed permissions
|
||||
*
|
||||
* See https://en.wikipedia.org/wiki/Bit_field
|
||||
*/
|
||||
deny: string;
|
||||
/**
|
||||
* `0` for a role or `1` for a member
|
||||
*/
|
||||
type: OverwriteType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#edit-channel-permissions
|
||||
*/
|
||||
export type RESTPutAPIChannelPermissionResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-channel-invites
|
||||
*/
|
||||
export type RESTGetAPIChannelInvitesResult = APIExtendedInvite[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
*/
|
||||
export interface RESTPostAPIChannelInviteJSONBody {
|
||||
/**
|
||||
* Duration of invite in seconds before expiry, or 0 for never
|
||||
*
|
||||
* @default 86400 (24 hours)
|
||||
*/
|
||||
max_age?: number;
|
||||
/**
|
||||
* Max number of uses or 0 for unlimited
|
||||
*
|
||||
* @default 0
|
||||
*/
|
||||
max_uses?: number;
|
||||
/**
|
||||
* Whether this invite only grants temporary membership
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
temporary?: boolean;
|
||||
/**
|
||||
* If true, don't try to reuse a similar invite
|
||||
* (useful for creating many unique one time use invites)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
unique?: boolean;
|
||||
/**
|
||||
* The target user id for this invite
|
||||
*/
|
||||
target_user_id?: string;
|
||||
/**
|
||||
* The type of target user for this invite
|
||||
*/
|
||||
target_user_type?: InviteTargetUserType;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#create-channel-invite
|
||||
*/
|
||||
export type RESTPostAPIChannelInviteResult = APIExtendedInvite;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-channel-permission
|
||||
*/
|
||||
export type RESTDeleteAPIChannelPermissionResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#follow-news-channel
|
||||
*/
|
||||
export interface RESTPostAPIChannelFollowersJSONBody {
|
||||
/**
|
||||
* ID of target channel
|
||||
*/
|
||||
webhook_channel_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#follow-news-channel
|
||||
*/
|
||||
export type RESTPostAPIChannelFollowersResult = APIFollowedChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#trigger-typing-indicator
|
||||
*/
|
||||
export type RESTPostAPIChannelTypingResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#get-pinned-messages
|
||||
*/
|
||||
export type RESTGetAPIChannelPinsResult = APIMessage[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#add-pinned-channel-message
|
||||
*/
|
||||
export type RESTPutAPIChannelPinResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#delete-pinned-channel-message
|
||||
*/
|
||||
export type RESTDeleteAPIChannelPinResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
*/
|
||||
export interface RESTPutAPIChannelRecipientJSONBody {
|
||||
/**
|
||||
* Access token of a user that has granted your app the `gdm.join` scope
|
||||
*/
|
||||
access_token: string;
|
||||
/**
|
||||
* Nickname of the user being added
|
||||
*/
|
||||
nick?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-add-recipient
|
||||
*/
|
||||
export type RESTPutAPIChannelRecipientResult = unknown;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/channel#group-dm-remove-recipient
|
||||
*/
|
||||
export type RESTDeleteAPIChannelRecipientResult = unknown;
|
||||
@@ -1,11 +0,0 @@
|
||||
import type { APIGatewayBotInfo, APIGatewayInfo } from '../payloads/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway
|
||||
*/
|
||||
export type RESTGetAPIGatewayResult = APIGatewayInfo;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#get-gateway-bot
|
||||
*/
|
||||
export type RESTGetAPIGatewayBotResult = APIGatewayBotInfo;
|
||||
@@ -1,77 +0,0 @@
|
||||
import type { APIApplicationCommand, APIInteractionResponse } from '../payloads/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#get-global-application-commands
|
||||
*/
|
||||
export type RESTGetAPIApplicationCommandsResult = APIApplicationCommand[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#create-global-application-command
|
||||
*/
|
||||
export type RESTPostAPIApplicationCommandsJSONBody = Omit<APIApplicationCommand, 'id' | 'application_id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#create-global-application-command
|
||||
*/
|
||||
export type RESTPostAPIApplicationCommandsResult = APIApplicationCommand;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#edit-global-application-command
|
||||
*/
|
||||
export type RESTPatchAPIApplicationCommandJSONBody = Partial<RESTPostAPIApplicationCommandsJSONBody>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#edit-global-application-command
|
||||
*/
|
||||
export type RESTPatchAPIApplicationCommandResult = APIApplicationCommand;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#get-guild-application-commands
|
||||
*/
|
||||
export type RESTGetAPIApplicationGuildCommandsResult = APIApplicationCommand[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#create-guild-application-command
|
||||
*/
|
||||
export type RESTPostAPIApplicationGuildCommandsJSONBody = RESTPostAPIApplicationCommandsJSONBody;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#create-guild-application-command
|
||||
*/
|
||||
export type RESTPostAPIApplicationGuildCommandsResult = APIApplicationCommand;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#edit-guild-application-command
|
||||
*/
|
||||
export type RESTPatchAPIApplicationGuildCommandJSONBody = Partial<RESTPostAPIApplicationCommandsJSONBody>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#edit-guild-application-command
|
||||
*/
|
||||
export type RESTPatchAPIApplicationGuildCommandResult = APIApplicationCommand;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#create-interaction-response
|
||||
*/
|
||||
export type RESTPostAPIInteractionCallbackJSONBody = APIInteractionResponse;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/interactions/slash-commands#create-interaction-response
|
||||
*/
|
||||
export type RESTPostAPIInteractionCallbackFormDataBody =
|
||||
| {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIInteractionCallbackJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
@@ -1,18 +0,0 @@
|
||||
import type { APIInvite } from '../payloads/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#get-invite
|
||||
*/
|
||||
export interface RESTGetAPIInviteQuery {
|
||||
/**
|
||||
* Whether the invite should contain approximate member counts
|
||||
*/
|
||||
with_counts?: boolean;
|
||||
}
|
||||
|
||||
export type RESTGetAPIInviteResult = APIInvite;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/invite#delete-invite
|
||||
*/
|
||||
export type RESTDeleteAPIInviteResult = APIInvite;
|
||||
@@ -1,632 +0,0 @@
|
||||
export * from './auditLog.ts';
|
||||
export * from './channel.ts';
|
||||
export * from './emoji.ts';
|
||||
export * from './gateway.ts';
|
||||
export * from './guild.ts';
|
||||
export * from './interactions.ts';
|
||||
export * from './invite.ts';
|
||||
export * from './oauth2.ts';
|
||||
export * from './template.ts';
|
||||
export * from './user.ts';
|
||||
export * from './voice.ts';
|
||||
export * from './webhook.ts';
|
||||
|
||||
export const APIVersion = '8';
|
||||
export const Routes = {
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/audit-logs`
|
||||
*/
|
||||
guildAuditLog(guildID: string) {
|
||||
return `/guilds/${guildID}/audit-logs`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}`
|
||||
* - PATCH `/channels/{channel.id}`
|
||||
* - DELETE `/channels/{channel.id}`
|
||||
*/
|
||||
channel(channelID: string) {
|
||||
return `/channels/${channelID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages`
|
||||
* - POST `/channels/{channel.id}/messages`
|
||||
*/
|
||||
channelMessages(channelID: string) {
|
||||
return `/channels/${channelID}/messages`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages/{message.id}`
|
||||
* - PATCH `/channels/{channel.id}/messages/{message.id}`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}`
|
||||
*/
|
||||
channelMessage(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/messages/{message.id}/crosspost`
|
||||
*/
|
||||
channelMessageCrosspost(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/crosspost`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself
|
||||
*/
|
||||
channelMessageOwnReaction(channelID: string, messageID: string, emoji: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/@me`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself
|
||||
*/
|
||||
channelMessageUserReaction(channelID: string, messageID: string, emoji: string, userID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions/{emoji}`
|
||||
*
|
||||
* **Note**: You need to URL encode the emoji yourself
|
||||
*/
|
||||
channelMessageReaction(channelID: string, messageID: string, emoji: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions/${emoji}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/channels/{channel.id}/messages/{message.id}/reactions`
|
||||
*/
|
||||
channelMessageAllReactions(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/messages/${messageID}/reactions`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/messages/bulk-delete`
|
||||
*/
|
||||
channelBulkDelete(channelID: string) {
|
||||
return `/channels/${channelID}/messages/bulk-delete`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/permissions/{overwrite.id}`
|
||||
* - DELETE `/channels/{channel.id}/permissions/{overwrite.id}`
|
||||
*/
|
||||
channelPermission(channelID: string, overwriteID: string) {
|
||||
return `/channels/${channelID}/permissions/${overwriteID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/invites`
|
||||
* - POST `/channels/{channel.id}/invites`
|
||||
*/
|
||||
channelInvites(channelID: string) {
|
||||
return `/channels/${channelID}/invites`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/followers`
|
||||
*/
|
||||
channelFollowers(channelID: string) {
|
||||
return `/channels/${channelID}/followers`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/channels/{channel.id}/typing`
|
||||
*/
|
||||
channelTyping(channelID: string) {
|
||||
return `/channels/${channelID}/typing`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/pins`
|
||||
*/
|
||||
channelPins(channelID: string) {
|
||||
return `/channels/${channelID}/pins`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/pins/{message.id}`
|
||||
* - DELETE `/channels/{channel.id}/pins/{message.id}`
|
||||
*/
|
||||
channelPin(channelID: string, messageID: string) {
|
||||
return `/channels/${channelID}/pins/${messageID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/channels/{channel.id}/recipients/{user.id}`
|
||||
* - DELETE `/channels/{channel.id}/recipients/{user.id}`
|
||||
*/
|
||||
channelRecipient(channelID: string, userID: string) {
|
||||
return `/channels/${channelID}/recipients/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/emojis`
|
||||
* - POST `/guilds/{guild.id}/emojis`
|
||||
*/
|
||||
guildEmojis(guildID: string) {
|
||||
return `/guilds/${guildID}/emojis`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
* - PATCH `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
* - DELETE `/guilds/{guild.id}/emojis/{emoji.id}`
|
||||
*/
|
||||
guildEmoji(guildID: string, emojiID: string) {
|
||||
return `/guilds/${guildID}/emojis/${emojiID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/guilds`
|
||||
*/
|
||||
guilds() {
|
||||
return '/guilds';
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}`
|
||||
* - PATCH `/guilds/{guild.id}`
|
||||
* - DELETE `/guilds/{guild.id}`
|
||||
*/
|
||||
guild(guildID: string) {
|
||||
return `/guilds/${guildID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/preview`
|
||||
*/
|
||||
guildPreview(guildID: string) {
|
||||
return `/guilds/${guildID}/preview`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/channels`
|
||||
* - POST `/guilds/{guild.id}/channels`
|
||||
* - PATCH `/guilds/{guild.id}/channels`
|
||||
*/
|
||||
guildChannels(guildID: string) {
|
||||
return `/guilds/${guildID}/channels`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members/{user.id}`
|
||||
* - PUT `/guilds/{guild.id}/members/{user.id}`
|
||||
* - PATCH `/guilds/{guild.id}/members/{user.id}`
|
||||
* - DELETE `/guilds/{guild.id}/members/{user.id}`
|
||||
*/
|
||||
guildMember(guildID: string, userID: string) {
|
||||
return `/guilds/${guildID}/members/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members`
|
||||
*/
|
||||
guildMembers(guildID: string) {
|
||||
return `/guilds/${guildID}/members`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/members/search`
|
||||
*/
|
||||
guildMembersSearch(guildID: string) {
|
||||
return `/guilds/${guildID}/members/search`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/members/@me/nick`
|
||||
*/
|
||||
guildCurrentMemberNickname(guildID: string) {
|
||||
return `/guilds/${guildID}/members/@me/nick`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/members/{user.id}/roles/{role.id}`
|
||||
*/
|
||||
guildMemberRole(guildID: string, memberID: string, roleID: string) {
|
||||
return `/guilds/${guildID}/members/${memberID}/roles/${roleID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/bans`
|
||||
*/
|
||||
guildBans(guildID: string) {
|
||||
return `/guilds/${guildID}/bans`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/bans/{user.id}`
|
||||
* - PUT `/guilds/{guild.id}/bans/{user.id}`
|
||||
* - DELETE `/guilds/{guild.id}/bans/{user.id}`
|
||||
*/
|
||||
guildBan(guildID: string, userID: string) {
|
||||
return `/guilds/${guildID}/bans/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/roles`
|
||||
* - POST `/guilds/{guild.id}/roles`
|
||||
* - PATCH `/guilds/{guild.id}/roles`
|
||||
*/
|
||||
guildRoles(guildID: string) {
|
||||
return `/guilds/${guildID}/roles`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/roles/{role.id}`
|
||||
* - DELETE `/guilds/{guild.id}/roles/{role.id}`
|
||||
*/
|
||||
guildRole(guildID: string, roleID: string) {
|
||||
return `/guilds/${guildID}/roles/${roleID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/prune`
|
||||
* - POST `/guilds/{guild.id}/prune`
|
||||
*/
|
||||
guildPrune(guildID: string) {
|
||||
return `/guilds/${guildID}/prune`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/regions`
|
||||
*/
|
||||
guildVoiceRegions(guildID: string) {
|
||||
return `/guilds/${guildID}/regions`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/invites`
|
||||
*/
|
||||
guildInvites(guildID: string) {
|
||||
return `/guilds/${guildID}/invites`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/integrations`
|
||||
* - POST `/guilds/{guild.id}/integrations`
|
||||
*/
|
||||
guildIntegrations(guildID: string) {
|
||||
return `/guilds/${guildID}/integrations`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/guilds/{guild.id}/integrations/{integration.id}`
|
||||
* - DELETE `/guilds/{guild.id}/integrations/{integration.id}`
|
||||
*/
|
||||
guildIntegration(guildID: string, integrationID: string) {
|
||||
return `/guilds/${guildID}/integrations/${integrationID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/guilds/{guild.id}/integrations/{integration.id}/sync`
|
||||
*/
|
||||
guildIntegrationSync(guildID: string, integrationID: string) {
|
||||
return `/guilds/${guildID}/integrations/${integrationID}/sync`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget`
|
||||
* - PATCH `/guilds/{guild.id}/widget`
|
||||
*/
|
||||
guildWidgetSettings(guildID: string) {
|
||||
return `/guilds/${guildID}/widget`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget.json`
|
||||
*/
|
||||
guildWidgetJSON(guildID: string) {
|
||||
return `/guilds/${guildID}/widget.json`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/vanity-url`
|
||||
*/
|
||||
guildVanityUrl(guildID: string) {
|
||||
return `/guilds/${guildID}/vanity-url`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/widget.png`
|
||||
*/
|
||||
guildWidgetImage(guildID: string) {
|
||||
return `/guilds/${guildID}/widget.png`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/invites/{invite.code}`
|
||||
* - DELETE `/invites/{invite.code}`
|
||||
*/
|
||||
invite(code: string) {
|
||||
return `/invites/${code}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/templates/{template.code}`
|
||||
* - POST `/guilds/templates/{template.code}`
|
||||
*/
|
||||
template(code: string) {
|
||||
return `/guilds/templates/${code}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/templates`
|
||||
* - POST `/guilds/{guild.id}/templates`
|
||||
*/
|
||||
guildTemplates(guildID: string) {
|
||||
return `/guilds/${guildID}/templates`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PUT `/guilds/{guild.id}/templates/{template.code}`
|
||||
* - PATCH `/guilds/{guild.id}/templates/{template.code}`
|
||||
* - DELETE `/guilds/{guild.id}/templates/{template.code}`
|
||||
*/
|
||||
guildTemplate(guildID: string, code: string) {
|
||||
return `/guilds/${guildID}/templates/${code}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me`
|
||||
* - GET `/users/{user.id}`
|
||||
* - PATCH `/users/@me`
|
||||
*
|
||||
* @param [userID='@me'] The user ID, defaulted to `@me`
|
||||
*/
|
||||
user(userID = '@me') {
|
||||
return `/users/${userID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/guilds`
|
||||
*/
|
||||
userGuilds() {
|
||||
return `/users/@me/guilds`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - DELETE `/users/@me/guilds/{guild.id}`
|
||||
*/
|
||||
userGuild(guildID: string) {
|
||||
return `/users/@me/guilds/${guildID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/users/@me/channels`
|
||||
*/
|
||||
userChannels() {
|
||||
return `/users/@me/channels`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/users/@me/connections`
|
||||
*/
|
||||
userConnections() {
|
||||
return `/users/@me/connections`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/voice/regions`
|
||||
*/
|
||||
voiceRegions() {
|
||||
return `/voice/regions`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/channels/{channel.id}/webhooks`
|
||||
* - POST `/channels/{channel.id}/webhooks`
|
||||
*/
|
||||
channelWebhooks(channelID: string) {
|
||||
return `/channels/${channelID}/webhooks`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/webhooks`
|
||||
*/
|
||||
guildWebhooks(guildID: string) {
|
||||
return `/guilds/${guildID}/webhooks`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/webhooks/{webhook.id}`
|
||||
* - GET `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - PATCH `/webhooks/{webhook.id}`
|
||||
* - PATCH `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - DELETE `/webhooks/{webhook.id}`
|
||||
* - DELETE `/webhooks/{webhook.id}/{webhook.token}`
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}`
|
||||
*
|
||||
* - POST `/webhooks/{application.id}/{interaction.token}`
|
||||
*/
|
||||
webhook(webhookID: string, webhookToken?: string) {
|
||||
const parts = ['', 'webhooks', webhookID];
|
||||
|
||||
if (webhookToken) parts.push(webhookToken);
|
||||
|
||||
return parts.join('/');
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/webhooks/{webhook.id}/{webhook.token}/messages/@original`
|
||||
* - PATCH `/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}`
|
||||
* - DELETE `/webhooks/{webhook.id}/{webhook.token}/messages/@original`
|
||||
* - DELETE `/webhooks/{webhook.id}/{webhook.token}/messages/{message.id}`
|
||||
*
|
||||
* - PATCH `/webhooks/{application.id}/{interaction.token}/messages/@original`
|
||||
* - PATCH `/webhooks/{application.id}/{interaction.token}/messages/{message.id}`
|
||||
* - DELETE `/webhooks/{application.id}/{interaction.token}/messages/{message.id}`
|
||||
*
|
||||
* @param [messageID='@original'] The message ID to change, defaulted to `@original`
|
||||
*/
|
||||
webhookMessage(webhookID: string, webhookToken: string, messageID = '@original') {
|
||||
return `/webhooks/${webhookID}/${webhookToken}/messages/${messageID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}/github`
|
||||
* - POST `/webhooks/{webhook.id}/{webhook.token}/slack`
|
||||
*/
|
||||
webhookPlatform(webhookID: string, webhookToken: string, platform: 'github' | 'slack') {
|
||||
return `/webhooks/${webhookID}/${webhookToken}/${platform}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/gateway`
|
||||
*/
|
||||
gateway() {
|
||||
return `/gateway`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/gateway/bot`
|
||||
*/
|
||||
gatewayBot() {
|
||||
return `/gateway/bot`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/oauth2/applications/@me`
|
||||
*/
|
||||
oauth2CurrentApplication() {
|
||||
return `/oauth2/applications/@me`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/commands`
|
||||
* - POST `/applications/{application.id}/commands`
|
||||
*/
|
||||
applicationCommands(applicationID: string) {
|
||||
return `/applications/${applicationID}/commands`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/applications/{application.id}/commands/{command.id}`
|
||||
* - DELETE `/applications/{application.id}/commands/{command.id}`
|
||||
*/
|
||||
applicationCommand(applicationID: string, commandID: string) {
|
||||
return `/applications/${applicationID}/commands/${commandID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/applications/{application.id}/guilds/{guild.id}/commands`
|
||||
* - POST `/applications/{application.id}/guilds/{guild.id}/commands`
|
||||
*/
|
||||
applicationGuildCommands(applicationID: string, guildID: string) {
|
||||
return `/applications/${applicationID}/guilds/${guildID}/commands`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - PATCH `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}`
|
||||
* - DELETE `/applications/{application.id}/guilds/{guild.id}/commands/{command.id}`
|
||||
*/
|
||||
applicationGuildCommand(applicationID: string, guildID: string, commandID: string) {
|
||||
return `/applications/${applicationID}/guilds/${guildID}/commands/${commandID}`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - POST `/interactions/{interaction.id}/{interaction.token}/callback`
|
||||
*/
|
||||
interactionCallback(interactionID: string, interactionToken: string) {
|
||||
return `/interactions/${interactionID}/${interactionToken}/callback`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Route for:
|
||||
* - GET `/guilds/{guild.id}/member-verification`
|
||||
* - PATCH `/guilds/{guild.id}/member-verification`
|
||||
*/
|
||||
guildMemberVerification(guildID: string) {
|
||||
return `/guilds/${guildID}/member-verification`;
|
||||
},
|
||||
};
|
||||
|
||||
export const OAuth2Routes = {
|
||||
authorizationURL: `https://discord.com/api/v${APIVersion}/oauth2/authorize`,
|
||||
tokenURL: `https://discord.com/api/v${APIVersion}/oauth2/token`,
|
||||
/**
|
||||
* See https://tools.ietf.org/html/rfc7009
|
||||
*/
|
||||
tokenRevocationURL: `https://discord.com/api/v${APIVersion}/oauth2/token/revoke`,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Freeze route object
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(OAuth2Routes);
|
||||
@@ -1,89 +0,0 @@
|
||||
import type { APIChannel, APIConnection, APIUser, GuildFeature } from '../payloads/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user
|
||||
*/
|
||||
export type RESTGetAPICurrentUserResult = APIUser;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-user
|
||||
*/
|
||||
export type RESTGetAPIUserResult = APIUser;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
*/
|
||||
export interface RESTPatchAPICurrentUserJSONBody {
|
||||
/**
|
||||
* User's username, if changed may cause the user's discriminator to be randomized
|
||||
*/
|
||||
username?: string;
|
||||
/**
|
||||
* If passed, modifies the user's avatar
|
||||
*/
|
||||
avatar?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#modify-current-user
|
||||
*/
|
||||
export type RESTPatchAPICurrentUserResult = APIUser;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user-guilds
|
||||
*/
|
||||
export interface RESTGetAPICurrentUserGuildsQuery {
|
||||
/**
|
||||
* Get guilds before this guild ID
|
||||
*/
|
||||
before?: string;
|
||||
/**
|
||||
* Get guilds after this guild ID
|
||||
*/
|
||||
after?: string;
|
||||
/**
|
||||
* Max number of guilds to return (1-100)
|
||||
*
|
||||
* @default 100
|
||||
*/
|
||||
limit?: number;
|
||||
}
|
||||
|
||||
export interface RESTAPIPartialCurrentUserGuild {
|
||||
id: string;
|
||||
name: string;
|
||||
icon: string | null;
|
||||
owner: boolean;
|
||||
features: GuildFeature[];
|
||||
permissions: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-current-user-guilds
|
||||
*/
|
||||
export type RESTGetAPICurrentUserGuildsResult = RESTAPIPartialCurrentUserGuild[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#leave-guild
|
||||
*/
|
||||
export type RESTDeleteAPICurrentUserGuildResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#create-dm
|
||||
*/
|
||||
export interface RESTPostAPICurrentUserCreateDMChannelJSONBody {
|
||||
/**
|
||||
* The recipient to open a DM channel with
|
||||
*/
|
||||
recipient_id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#create-dm
|
||||
*/
|
||||
export type RESTPostAPICurrentUserCreateDMChannelResult = APIChannel;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/user#get-user-connections
|
||||
*/
|
||||
export type RESTGetAPICurrentUserConnectionsResult = APIConnection[];
|
||||
@@ -1,6 +0,0 @@
|
||||
import type { APIVoiceRegion } from '../payloads/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/voice#list-voice-regions
|
||||
*/
|
||||
export type GetAPIVoiceRegionsResult = APIVoiceRegion[];
|
||||
@@ -1,222 +0,0 @@
|
||||
import type { APIAllowedMentions, APIEmbed, APIMessage, APIWebhook } from '../payloads/mod.ts';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
export interface RESTPostAPIChannelWebhookJSONBody {
|
||||
/**
|
||||
* Name of the webhook (1-80 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Image for the default webhook avatar
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
avatar?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#create-webhook
|
||||
*/
|
||||
export type RESTPostAPIChannelWebhookResult = APIWebhook;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-channel-webhooks
|
||||
*/
|
||||
export type RESTGetAPIChannelWebhooksResult = APIWebhook[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-guild-webhooks
|
||||
*/
|
||||
export type RESTGetAPIGuildWebhooksResult = APIWebhook[];
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-webhook
|
||||
*/
|
||||
export type RESTGetAPIWebhookResult = APIWebhook;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#get-webhook-with-token
|
||||
*/
|
||||
export type RESTGetAPIWebhookWithTokenResult = Omit<APIWebhook, 'user'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
*/
|
||||
export interface RESTPatchAPIWebhookJSONBody {
|
||||
/**
|
||||
* The default name of the webhook
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Image for the default webhook avatar
|
||||
*
|
||||
* See https://discord.com/developers/docs/reference#image-data
|
||||
*/
|
||||
avatar?: string | null;
|
||||
/**
|
||||
* The new channel id this webhook should be moved to
|
||||
*/
|
||||
channel_id?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook
|
||||
*/
|
||||
export type RESTPatchAPIWebhookResult = APIWebhook;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenJSONBody = Omit<RESTPatchAPIWebhookJSONBody, 'channel_id'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#modify-webhook-with-token
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenResult = RESTGetAPIWebhookWithTokenResult;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#delete-webhook
|
||||
*/
|
||||
export type RESTDeleteAPIWebhookResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#delete-webhook-with-token
|
||||
*/
|
||||
export type RESTDeleteAPIWebhookWithTokenResult = never;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export interface RESTPostAPIWebhookWithTokenJSONBody {
|
||||
/**
|
||||
* The message contents (up to 2000 characters)
|
||||
*/
|
||||
content?: string;
|
||||
/**
|
||||
* Override the default username of the webhook
|
||||
*/
|
||||
username?: string;
|
||||
/**
|
||||
* Override the default avatar of the webhook
|
||||
*/
|
||||
avatar_url?: string;
|
||||
/**
|
||||
* `true` if this is a TTS message
|
||||
*/
|
||||
tts?: boolean;
|
||||
/**
|
||||
* Embedded `rich` content
|
||||
*/
|
||||
embeds?: APIEmbed[];
|
||||
/**
|
||||
* Allowed mentions for the message
|
||||
*/
|
||||
allowed_mentions?: APIAllowedMentions;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenFormDataBody =
|
||||
| {
|
||||
/**
|
||||
* JSON stringified message body
|
||||
*/
|
||||
payload_json?: string;
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
}
|
||||
| (RESTPostAPIWebhookWithTokenJSONBody & {
|
||||
/**
|
||||
* The file contents
|
||||
*/
|
||||
file: unknown;
|
||||
});
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
|
||||
*/
|
||||
export interface RESTPostAPIWebhookWithTokenQuery {
|
||||
/**
|
||||
* Waits for server confirmation of message send before response, and returns the created message body
|
||||
* (defaults to `false`; when `false` a message that is not saved does not return an error)
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
wait?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenResult = never;
|
||||
|
||||
/**
|
||||
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
|
||||
* the `wait` query parameter set to `true`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenWaitResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-querystring-params
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenSlackQuery = RESTPostAPIWebhookWithTokenQuery;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenSlackResult = never;
|
||||
|
||||
/**
|
||||
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
|
||||
* the `wait` query parameter set to `true`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-querystring-params
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenSlackWaitResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-querystring-params
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenGitHubQuery = RESTPostAPIWebhookWithTokenQuery;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenGitHubResult = never;
|
||||
|
||||
/**
|
||||
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
|
||||
* the `wait` query parameter set to `true`
|
||||
*
|
||||
* See https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-querystring-params
|
||||
*/
|
||||
export type RESTPostAPIWebhookWithTokenGitHubWaitResult = APIMessage;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
|
||||
*/
|
||||
export type RESTPatchAPIWebhookWithTokenMessageJSONBody = Nullable<
|
||||
Pick<RESTPostAPIWebhookWithTokenJSONBody, 'content' | 'embeds' | 'allowed_mentions'>
|
||||
>;
|
||||
|
||||
export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
|
||||
| {
|
||||
payload_json: string;
|
||||
}
|
||||
| RESTPatchAPIWebhookWithTokenMessageJSONBody;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/resources/webhook#delete-webhook-message
|
||||
*/
|
||||
export type RESTDeleteAPIWebhookWithTokenMessageResult = never;
|
||||
|
||||
type Nullable<T> = {
|
||||
[P in keyof T]: T[P] | null;
|
||||
};
|
||||
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
deno/** linguist-generated
|
||||
11
.github/CODEOWNERS
vendored
Normal file
11
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
* @vladfrangu
|
||||
|
||||
/*.ts @discordjs/discord-api-types
|
||||
deno/ @discordjs/discord-api-types
|
||||
gateway/ @discordjs/discord-api-types
|
||||
payloads/ @discordjs/discord-api-types
|
||||
rest/ @discordjs/discord-api-types
|
||||
rpc/ @discordjs/discord-api-types
|
||||
tests/ @discordjs/discord-api-types
|
||||
utils/ @discordjs/discord-api-types
|
||||
voice/ @discordjs/discord-api-types
|
||||
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.
|
||||
47
.github/CONTRIBUTING.md
vendored
Normal file
47
.github/CONTRIBUTING.md
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
# discord-api-types Contributing Guide
|
||||
|
||||
- [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)
|
||||
|
||||
## 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](https://github.com/discordjs/discord-api-types/blob/main/.github/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 an LTS version of [Node.js](http://nodejs.org) and [Yarn](https://yarnpkg.com).
|
||||
|
||||
After cloning the repo, run:
|
||||
|
||||
```bash
|
||||
$ yarn install # 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
|
||||
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: [feature request]
|
||||
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.
|
||||
83
.github/labeler.yml
vendored
Normal file
83
.github/labeler.yml
vendored
Normal file
@@ -0,0 +1,83 @@
|
||||
chore:
|
||||
- changed-files:
|
||||
- all-globs-to-any-file:
|
||||
- '*'
|
||||
- '!deno/**/*'
|
||||
- '!gateway/**/*'
|
||||
- '!payloads/**/*'
|
||||
- '!rest/**/*'
|
||||
- '!rpc/**/*'
|
||||
- '!tests/**/*'
|
||||
- '!utils/**/*'
|
||||
- '!voice/**/*'
|
||||
|
||||
ci:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- .github/**/*
|
||||
- .husky/**/*
|
||||
- scripts/actions/**/*
|
||||
|
||||
dependencies:
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- package.json
|
||||
- package-lock.json
|
||||
- website/package.json
|
||||
- website/package-lock.json
|
||||
|
||||
'topic:deno':
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- scripts/deno.mjs
|
||||
- scripts/actions/report-deno-not-ran.mjs
|
||||
|
||||
'topic:gateway':
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- gateway/**/*
|
||||
|
||||
'topic:payloads':
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- payloads/**/*
|
||||
|
||||
'topic:rest':
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- rest/**/*
|
||||
|
||||
'topic:rpc':
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- rpc/**/*
|
||||
|
||||
'topic:scripts':
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- scripts/**/*
|
||||
|
||||
'topic:tests':
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- tests/**/*
|
||||
|
||||
'topic:utils':
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- utils/**/*
|
||||
|
||||
'topic:voice':
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- voice/**/*
|
||||
|
||||
'topic:globals':
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- globals.ts
|
||||
|
||||
'topic:website':
|
||||
- changed-files:
|
||||
- any-glob-to-any-file:
|
||||
- website/**/*
|
||||
59
.github/labels.yml
vendored
Normal file
59
.github/labels.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
# General labels
|
||||
- name: 'semver:major'
|
||||
color: 'c10f47'
|
||||
- name: 'semver:minor'
|
||||
color: 'e4f486'
|
||||
- name: 'semver:patch'
|
||||
color: 'e8be8b'
|
||||
- name: 'blocked'
|
||||
color: 'fc1423'
|
||||
- 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
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
36
.github/workflows/cicd.yml
vendored
Normal file
36
.github/workflows/cicd.yml
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
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@v6
|
||||
|
||||
- name: Add problem matcher
|
||||
run: echo "::add-matcher::.github/problemMatchers/eslint.json" && echo "::add-matcher::.github/problemMatchers/tsc.json"
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
cache: 'yarn'
|
||||
node-version-file: package.json
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Check lint on discord-api-types
|
||||
run: yarn test:lint
|
||||
|
||||
- name: Run TSC
|
||||
run: yarn build:ci
|
||||
|
||||
- name: Run Type Tests
|
||||
run: yarn 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
|
||||
40
.github/workflows/deno.yml
vendored
40
.github/workflows/deno.yml
vendored
@@ -1,40 +0,0 @@
|
||||
name: Deno Deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
|
||||
jobs:
|
||||
BuildDeno:
|
||||
name: Publish Deno Types
|
||||
runs-on: ubuntu-latest
|
||||
if: "contains(github.event.head_commit.message, 'release')"
|
||||
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Use Node.js 14
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: 14
|
||||
|
||||
- name: Install Dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Get GitHub Branch Name
|
||||
run: echo "GITHUB_BRANCH_NAME=$(echo ${{ github.ref }} | cut -c12-)" >> $GITHUB_ENV
|
||||
|
||||
- name: Push new code
|
||||
run: |
|
||||
# Build files
|
||||
npm run build:deno
|
||||
|
||||
echo -e "\n# Commit and push"
|
||||
git add --all .
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
git commit -m "build: deno build for ${GITHUB_SHA}" || true
|
||||
git push origin $TARGET_BRANCH
|
||||
env:
|
||||
TARGET_BRANCH: '${{ env.GITHUB_BRANCH_NAME }}'
|
||||
GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
|
||||
241
.github/workflows/documentation.yml
vendored
Normal file
241
.github/workflows/documentation.yml
vendored
Normal file
@@ -0,0 +1,241 @@
|
||||
name: Documentation
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- 'main'
|
||||
paths:
|
||||
- '**'
|
||||
- '!website/**'
|
||||
tags:
|
||||
- '**'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ref:
|
||||
description: 'The branch, tag or SHA to checkout'
|
||||
required: true
|
||||
ref_type:
|
||||
type: choice
|
||||
description: 'Branch or tag'
|
||||
options:
|
||||
- branch
|
||||
- tag
|
||||
required: true
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
ACTION_PACKAGE: discord-api-types
|
||||
|
||||
jobs:
|
||||
build-docs:
|
||||
name: Build & upload documentation
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
REF_TYPE: ${{ inputs.ref_type || github.ref_type }}
|
||||
if: github.repository_owner == 'discordjs'
|
||||
|
||||
steps:
|
||||
- name: Checkout discord-api-types
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ inputs.ref || '' }}
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
cache: 'yarn'
|
||||
node-version-file: package.json
|
||||
|
||||
- name: Install Dependencies for discord-api-types
|
||||
run: yarn
|
||||
|
||||
#region DJS start (mostly from discord.js/packages/actions/src/pnpmCache)
|
||||
# pnpm --filter="*api-*" --filter="scripts" --filter="actions" run build
|
||||
|
||||
- name: Checkout discord.js
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
repository: discordjs/discord.js
|
||||
path: djs
|
||||
|
||||
- name: Set up swap space
|
||||
if: runner.os == 'Linux'
|
||||
uses: pierotofy/set-swap-space@v1.0
|
||||
with:
|
||||
swap-size-gb: 10
|
||||
|
||||
- uses: pnpm/action-setup@v5.0.0
|
||||
name: Install pnpm
|
||||
with:
|
||||
run_install: false
|
||||
package_json_file: djs/package.json
|
||||
|
||||
- name: Expose pnpm config(s) through "$GITHUB_OUTPUT"
|
||||
id: pnpm-config
|
||||
shell: bash
|
||||
run: |
|
||||
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Cache rotation keys
|
||||
id: cache-rotation
|
||||
shell: bash
|
||||
run: |
|
||||
echo "YEAR_MONTH=$(/bin/date -u "+%Y%m")" >> $GITHUB_OUTPUT
|
||||
|
||||
- uses: actions/cache@v5
|
||||
name: Setup pnpm cache
|
||||
with:
|
||||
path: ${{ steps.pnpm-config.outputs.STORE_PATH }}
|
||||
key: ${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-${{ hashFiles('**/pnpm-lock.yaml') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pnpm-store-cache-${{ steps.cache-rotation.outputs.YEAR_MONTH }}-
|
||||
|
||||
- name: Install djs dependencies
|
||||
working-directory: djs
|
||||
shell: bash
|
||||
run: |
|
||||
pnpm install --filter="*api-*" --filter="scripts" --filter="actions" --frozen-lockfile --prefer-offline --loglevel error
|
||||
env:
|
||||
HUSKY: '0'
|
||||
|
||||
- name: Build djs
|
||||
working-directory: djs
|
||||
shell: bash
|
||||
run: |
|
||||
pnpm --filter="*api-*" --filter="scripts" --filter="actions" run build
|
||||
|
||||
#endregion
|
||||
|
||||
- name: Extract package and semver from tag
|
||||
if: ${{ env.REF_TYPE == 'tag' }}
|
||||
id: extract-tag
|
||||
uses: ./djs/packages/actions/src/formatTag
|
||||
with:
|
||||
tag: ${{ inputs.ref || github.ref_name }}
|
||||
|
||||
- name: Apply tag to api-extractor config
|
||||
if: ${{ env.REF_TYPE == 'tag' && !inputs.ref }}
|
||||
run: sed -i 's!https://github.com/discordjs/discord-api-types/tree/main!https://github.com/discordjs/discord-api-types/tree/${{ github.ref_name }}!' "api-extractor.json"
|
||||
|
||||
- name: Build docs
|
||||
shell: bash
|
||||
run: |
|
||||
yarn prepack
|
||||
./djs/packages/api-extractor/bin/api-extractor run --local --minify
|
||||
./djs/packages/scripts/bin/generateSplitDocumentation.js
|
||||
yarn postpack
|
||||
|
||||
- name: Upload documentation to database
|
||||
if: ${{ env.REF_TYPE == 'tag' && (!inputs.ref || inputs.ref == 'main') }}
|
||||
env:
|
||||
CF_D1_DOCS_API_KEY: ${{ secrets.CF_D1_DOCS_API_KEY }}
|
||||
CF_D1_DOCS_ID: ${{ secrets.CF_D1_DOCS_ID }}
|
||||
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
|
||||
CF_R2_DOCS_URL: ${{ secrets.CF_R2_DOCS_URL }}
|
||||
CF_R2_DOCS_ACCESS_KEY_ID: ${{ secrets.CF_R2_DOCS_ACCESS_KEY_ID }}
|
||||
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
|
||||
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
|
||||
CF_R2_DOCS_BUCKET_URL: ${{ secrets.CF_R2_DOCS_BUCKET_URL }}
|
||||
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
|
||||
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
|
||||
run: |
|
||||
yarn tsx ./scripts/actions/documentation/uploadDocumentation.ts
|
||||
|
||||
- name: Upload documentation to database
|
||||
if: ${{ env.REF_TYPE == 'tag' && inputs.ref && inputs.ref != 'main' }}
|
||||
env:
|
||||
CF_D1_DOCS_API_KEY: ${{ secrets.CF_D1_DOCS_API_KEY }}
|
||||
CF_D1_DOCS_ID: ${{ secrets.CF_D1_DOCS_ID }}
|
||||
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
|
||||
CF_R2_DOCS_URL: ${{ secrets.CF_R2_DOCS_URL }}
|
||||
CF_R2_DOCS_ACCESS_KEY_ID: ${{ secrets.CF_R2_DOCS_ACCESS_KEY_ID }}
|
||||
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
|
||||
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
|
||||
CF_R2_DOCS_BUCKET_URL: ${{ secrets.CF_R2_DOCS_BUCKET_URL }}
|
||||
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
|
||||
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
|
||||
run: |
|
||||
yarn tsx ./scripts/actions/documentation/uploadDocumentation.ts
|
||||
|
||||
- name: Upload split documentation to blob storage
|
||||
if: ${{ env.REF_TYPE == 'tag' && (!inputs.ref || inputs.ref == 'main') }}
|
||||
env:
|
||||
CF_R2_DOCS_URL: ${{ secrets.CF_R2_DOCS_URL }}
|
||||
CF_R2_DOCS_ACCESS_KEY_ID: ${{ secrets.CF_R2_DOCS_ACCESS_KEY_ID }}
|
||||
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
|
||||
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
|
||||
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
|
||||
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
|
||||
run: |
|
||||
yarn tsx ./scripts/actions/documentation/uploadSplitDocumentation.ts
|
||||
|
||||
- name: Upload split documentation to blob storage
|
||||
if: ${{ env.REF_TYPE == 'tag' && inputs.ref && inputs.ref != 'main' }}
|
||||
env:
|
||||
CF_R2_DOCS_URL: ${{ secrets.CF_R2_DOCS_URL }}
|
||||
CF_R2_DOCS_ACCESS_KEY_ID: ${{ secrets.CF_R2_DOCS_ACCESS_KEY_ID }}
|
||||
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
|
||||
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
|
||||
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
|
||||
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
|
||||
run: |
|
||||
yarn tsx ./scripts/actions/documentation/uploadSplitDocumentation.ts
|
||||
|
||||
- name: Upload documentation to database
|
||||
if: ${{ env.REF_TYPE == 'branch' && (!inputs.ref || inputs.ref == 'main') }}
|
||||
env:
|
||||
CF_D1_DOCS_API_KEY: ${{ secrets.CF_D1_DOCS_API_KEY }}
|
||||
CF_D1_DOCS_ID: ${{ secrets.CF_D1_DOCS_ID }}
|
||||
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
|
||||
CF_R2_DOCS_URL: ${{ secrets.CF_R2_DOCS_URL }}
|
||||
CF_R2_DOCS_ACCESS_KEY_ID: ${{ secrets.CF_R2_DOCS_ACCESS_KEY_ID }}
|
||||
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
|
||||
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
|
||||
CF_R2_DOCS_BUCKET_URL: ${{ secrets.CF_R2_DOCS_BUCKET_URL }}
|
||||
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
|
||||
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
|
||||
run: |
|
||||
yarn tsx ./scripts/actions/documentation/uploadDocumentation.ts
|
||||
|
||||
- name: Upload documentation to database
|
||||
if: ${{ env.REF_TYPE == 'branch' && inputs.ref && inputs.ref != 'main' }}
|
||||
env:
|
||||
CF_D1_DOCS_API_KEY: ${{ secrets.CF_D1_DOCS_API_KEY }}
|
||||
CF_D1_DOCS_ID: ${{ secrets.CF_D1_DOCS_ID }}
|
||||
CF_ACCOUNT_ID: ${{ secrets.CF_ACCOUNT_ID }}
|
||||
CF_R2_DOCS_URL: ${{ secrets.CF_R2_DOCS_URL }}
|
||||
CF_R2_DOCS_ACCESS_KEY_ID: ${{ secrets.CF_R2_DOCS_ACCESS_KEY_ID }}
|
||||
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
|
||||
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
|
||||
CF_R2_DOCS_BUCKET_URL: ${{ secrets.CF_R2_DOCS_BUCKET_URL }}
|
||||
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
|
||||
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
|
||||
run: |
|
||||
yarn tsx ./scripts/actions/documentation/uploadDocumentation.ts
|
||||
|
||||
- name: Upload split documentation to blob storage
|
||||
if: ${{ env.REF_TYPE == 'branch' && (!inputs.ref || inputs.ref == 'main') }}
|
||||
env:
|
||||
CF_R2_DOCS_URL: ${{ secrets.CF_R2_DOCS_URL }}
|
||||
CF_R2_DOCS_ACCESS_KEY_ID: ${{ secrets.CF_R2_DOCS_ACCESS_KEY_ID }}
|
||||
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
|
||||
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
|
||||
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
|
||||
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
|
||||
run: |
|
||||
yarn tsx ./scripts/actions/documentation/uploadSplitDocumentation.ts
|
||||
|
||||
- name: Upload split documentation to blob storage
|
||||
if: ${{ env.REF_TYPE == 'branch' && inputs.ref && inputs.ref != 'main' }}
|
||||
env:
|
||||
CF_R2_DOCS_URL: ${{ secrets.CF_R2_DOCS_URL }}
|
||||
CF_R2_DOCS_ACCESS_KEY_ID: ${{ secrets.CF_R2_DOCS_ACCESS_KEY_ID }}
|
||||
CF_R2_DOCS_SECRET_ACCESS_KEY: ${{ secrets.CF_R2_DOCS_SECRET_ACCESS_KEY }}
|
||||
CF_R2_DOCS_BUCKET: ${{ secrets.CF_R2_DOCS_BUCKET }}
|
||||
ACTION_PACKAGE: ${{ env.ACTION_PACKAGE }}
|
||||
ACTION_VERSION: ${{ steps.extract-tag.outputs.semver }}
|
||||
run: |
|
||||
yarn tsx ./scripts/actions/documentation/uploadSplitDocumentation.ts
|
||||
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@v6
|
||||
|
||||
- name: Label sync
|
||||
uses: crazy-max/ghaction-github-labeler@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
17
.github/workflows/pr-automation.yml
vendored
Normal file
17
.github/workflows/pr-automation.yml
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
name: 'PR Automation'
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
|
||||
jobs:
|
||||
triage:
|
||||
permissions:
|
||||
contents: read
|
||||
pull-requests: write
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Automatically label PR
|
||||
uses: actions/labeler@v6
|
||||
with:
|
||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
||||
sync-labels: true
|
||||
155
.github/workflows/release-flows.yml
vendored
Normal file
155
.github/workflows/release-flows.yml
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
name: Release flows
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
schedule:
|
||||
# Run every Monday and Thursday at 12:00
|
||||
- cron: '0 12 * * 1,4'
|
||||
|
||||
jobs:
|
||||
publish_next:
|
||||
concurrency:
|
||||
group: publish_next
|
||||
cancel-in-progress: true
|
||||
|
||||
name: Publish @next release to npm
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
id-token: write
|
||||
|
||||
if: github.repository_owner == 'discordjs' && github.event_name == 'push' && !startsWith(github.event.head_commit.message, 'chore(release)')
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
cache: 'yarn'
|
||||
node-version-file: package.json
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Bump version
|
||||
run: node ./scripts/bump-version.mjs
|
||||
|
||||
# TODO: we need a scoped token for this -.-, can't OIDC tmk
|
||||
# - name: Deprecate old @next versions
|
||||
# run: yarn 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: |
|
||||
yarn version $(jq --raw-output '.version' package.json)-next.$(git rev-parse --short HEAD).$(date +%s)
|
||||
yarn npm publish --tag next
|
||||
|
||||
create_pr:
|
||||
name: Create PR for new version
|
||||
runs-on: ubuntu-latest
|
||||
if: github.repository_owner == 'discordjs' && github.event_name != 'push'
|
||||
|
||||
steps:
|
||||
- uses: actions/create-github-app-token@v3
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ vars.DISCORDJS_APP_ID }}
|
||||
private-key: ${{ secrets.DISCORDJS_APP_KEY_RELEASE }}
|
||||
permission-contents: write
|
||||
permission-pull-requests: write
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
cache: 'yarn'
|
||||
node-version-file: package.json
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Install website dependencies
|
||||
run: pushd website && npm ci --ignore-scripts && popd
|
||||
|
||||
- name: Set Git User and Email
|
||||
run: |
|
||||
git config user.name "discord-js[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: ${{ steps.app-token.outputs.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
|
||||
yarn 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: ${{ steps.app-token.outputs.token }}
|
||||
|
||||
create_release:
|
||||
name: Create release and publish
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
id-token: write
|
||||
contents: write
|
||||
|
||||
if: github.repository_owner == 'discordjs' && github.event_name == 'push' && startsWith(github.event.head_commit.message, 'chore(release)') && !contains(github.event.head_commit.message, '[skip ci]')
|
||||
|
||||
steps:
|
||||
- uses: actions/create-github-app-token@v3
|
||||
id: app-token
|
||||
with:
|
||||
app-id: ${{ vars.DISCORDJS_APP_ID }}
|
||||
private-key: ${{ secrets.DISCORDJS_APP_KEY_RELEASE }}
|
||||
permission-contents: write
|
||||
permission-pull-requests: write
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
cache: 'yarn'
|
||||
node-version-file: package.json
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Publish release to npm
|
||||
run: |
|
||||
yarn npm publish
|
||||
|
||||
- name: Create GitHub release
|
||||
run: node ./scripts/actions/create-release.mjs
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ steps.app-token.outputs.token }}
|
||||
41
.github/workflows/validate-pull-request.yml
vendored
Normal file
41
.github/workflows/validate-pull-request.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Validate Pull Request
|
||||
on:
|
||||
pull_request:
|
||||
jobs:
|
||||
deno:
|
||||
name: Ensure Deno types are synchronized
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
pull-requests: write
|
||||
steps:
|
||||
- name: Checkout Project
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
cache: 'yarn'
|
||||
node-version-file: package.json
|
||||
|
||||
- name: Install Dependencies
|
||||
run: yarn
|
||||
|
||||
- name: Run Check Script
|
||||
run: node ./scripts/actions/report-deno-not-ran.mjs
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
validate-supported-versions:
|
||||
runs-on: ubuntu-latest
|
||||
name: Disallow unsupported API versions
|
||||
steps:
|
||||
- name: Check for unsupported API changes
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
run: |
|
||||
PATTERNS="gateway/v6.ts|gateway/v8.ts|payloads/v6/|payloads/v8/|rest/v6/|rest/v8/|rpc/v8.ts|utils/v8.ts|voice/v4.ts|^v6.ts$|^v8.ts$"
|
||||
|
||||
if gh pr view ${{ github.event.pull_request.number }} --repo ${{github.repository}} --json files --jq ".files[].path | select(test(\"$PATTERNS\"))" | grep -q .; then
|
||||
echo "::error::Unsupported API versions modified. Please make changes to current API versions only."
|
||||
exit 1
|
||||
fi
|
||||
80
.gitignore
vendored
80
.gitignore
vendored
@@ -1,24 +1,70 @@
|
||||
node_modules/
|
||||
.yarn/install-state.gz
|
||||
|
||||
out/
|
||||
coverage/
|
||||
.nyc_output/
|
||||
|
||||
debug.log
|
||||
# Custom ESLint rules
|
||||
.eslint-plugin-local/*
|
||||
!.eslint-plugin-local/index.ts
|
||||
!.eslint-plugin-local/tsconfig.json
|
||||
|
||||
# Don't commit build outputs
|
||||
globals.js
|
||||
globals.*map
|
||||
globals.d.ts
|
||||
globals.mjs
|
||||
|
||||
v*/**/*.js
|
||||
v*/**/*.map
|
||||
v*/**/*.d.ts
|
||||
v*/**/*.mjs
|
||||
v*.js
|
||||
v*.*map
|
||||
v*.d.ts
|
||||
v*.mjs
|
||||
|
||||
default/*.js
|
||||
default/*.map
|
||||
default/*.d.ts
|
||||
default/*.mjs
|
||||
deno/**/*.js
|
||||
deno/**/*.map
|
||||
deno/**/*.d.ts
|
||||
deno/**/*.mjs
|
||||
|
||||
common/*.js
|
||||
common/*.map
|
||||
common/*.d.ts
|
||||
common/*.mjs
|
||||
gateway/**/*.js
|
||||
gateway/**/*.map
|
||||
gateway/**/*.d.ts
|
||||
gateway/**/*.mjs
|
||||
|
||||
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
|
||||
|
||||
# Don't commit generated docs
|
||||
tsdoc-metadata.json
|
||||
docs/*
|
||||
|
||||
# macOS files
|
||||
.DS_Store
|
||||
|
||||
# djs repo clone
|
||||
djs
|
||||
|
||||
_generated_
|
||||
|
||||
1
.husky/commit-msg
Executable file
1
.husky/commit-msg
Executable file
@@ -0,0 +1 @@
|
||||
yarn commitlint --edit $1
|
||||
1
.husky/pre-commit
Executable file
1
.husky/pre-commit
Executable file
@@ -0,0 +1 @@
|
||||
yarn pretty-quick --staged && yarn lint-staged && yarn clean:node && yarn 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 🎉"
|
||||
42
.prettierignore
Normal file
42
.prettierignore
Normal file
@@ -0,0 +1,42 @@
|
||||
# Node modules
|
||||
node_modules/
|
||||
|
||||
# Generated data
|
||||
deno/
|
||||
|
||||
# Versioned json
|
||||
website/versioned_sidebars/
|
||||
website/versioned_docs/
|
||||
website/versions.json
|
||||
website/.docusaurus/
|
||||
website/build
|
||||
|
||||
# Don't format build outputs
|
||||
*.js
|
||||
!eslint.config.js
|
||||
*.d.ts
|
||||
*.mjs
|
||||
|
||||
# Miscellaneous
|
||||
CODEOWNERS
|
||||
CHANGELOG.md
|
||||
|
||||
# Format all of scripts
|
||||
!scripts/**/*
|
||||
!.prettierrc.mjs
|
||||
|
||||
# Deprecated versions
|
||||
gateway/v6/*
|
||||
payloads/v6/*
|
||||
rest/v6/*
|
||||
v6.ts
|
||||
|
||||
gateway/v8/*
|
||||
payloads/v8/*
|
||||
rest/v8/*
|
||||
utils/v8.ts
|
||||
v8.ts
|
||||
|
||||
.yarn/*
|
||||
djs/*
|
||||
_generated_
|
||||
12
.prettierrc.mjs
Normal file
12
.prettierrc.mjs
Normal file
@@ -0,0 +1,12 @@
|
||||
import sapphirePrettierConfig from '@sapphire/prettier-config';
|
||||
|
||||
export default {
|
||||
...sapphirePrettierConfig,
|
||||
printWidth: 120,
|
||||
useTabs: true,
|
||||
singleQuote: true,
|
||||
quoteProps: 'as-needed',
|
||||
trailingComma: 'all',
|
||||
endOfLine: 'lf',
|
||||
experimentalTernaries: true,
|
||||
};
|
||||
15
.vscode/settings.json
vendored
Normal file
15
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"files.eol": "\n",
|
||||
"typescript.tsdk": "node_modules/typescript/lib",
|
||||
"editor.codeActionsOnSave": {
|
||||
"source.organizeImports": "never",
|
||||
"source.fixAll": "explicit",
|
||||
"source.fixAll.eslint": "explicit"
|
||||
},
|
||||
"cSpell.enableFiletypes": ["mdx"],
|
||||
"search.exclude": {
|
||||
"**/v6": true,
|
||||
"**/v8": true,
|
||||
"deno": true
|
||||
}
|
||||
}
|
||||
67
.yarn/plugins/postinstallDev.cjs
vendored
Normal file
67
.yarn/plugins/postinstallDev.cjs
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* Altered from https://github.com/sachinraja/yarn-plugin-postinstall-dev/blob/main/sources/index.ts
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021-2022 Sachin Raja
|
||||
|
||||
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.
|
||||
*/
|
||||
|
||||
const scriptName = 'postinstallDev';
|
||||
|
||||
module.exports = {
|
||||
name: 'postinstall-dev-script',
|
||||
factory: (require) => ({
|
||||
hooks: {
|
||||
/**
|
||||
* @param {import('@yarnpkg/core').Project} project
|
||||
* @param {Parameters<import('@yarnpkg/core').Hooks['afterAllInstalled']>[1]} options
|
||||
*/
|
||||
async afterAllInstalled(project, options) {
|
||||
/**
|
||||
* @type {import('@yarnpkg/core')}
|
||||
*/
|
||||
const { scriptUtils, InstallMode } = require('@yarnpkg/core');
|
||||
|
||||
if (options.mode === InstallMode.UpdateLockfile) {
|
||||
return;
|
||||
}
|
||||
|
||||
const locator = project.topLevelWorkspace.anchoredLocator;
|
||||
|
||||
if (await scriptUtils.hasPackageScript(locator, scriptName, { project })) {
|
||||
const exitCode = await scriptUtils.executePackageScript(locator, scriptName, [], {
|
||||
project,
|
||||
stdin: process.stdin,
|
||||
stdout: process.stdout,
|
||||
stderr: process.stderr,
|
||||
});
|
||||
|
||||
if (exitCode !== 0) {
|
||||
const error = new Error(`${scriptName} script failed with exit code ${exitCode}`);
|
||||
error.stack = undefined;
|
||||
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
}),
|
||||
};
|
||||
940
.yarn/releases/yarn-4.14.1.cjs
vendored
Executable file
940
.yarn/releases/yarn-4.14.1.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
8
.yarnrc.yml
Normal file
8
.yarnrc.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
enableGlobalCache: true
|
||||
|
||||
nodeLinker: node-modules
|
||||
|
||||
yarnPath: .yarn/releases/yarn-4.14.1.cjs
|
||||
|
||||
plugins:
|
||||
- path: ./.yarn/plugins/postinstallDev.cjs
|
||||
2442
CHANGELOG.md
Normal file
2442
CHANGELOG.md
Normal file
File diff suppressed because it is too large
Load Diff
96
README.md
96
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,36 +22,55 @@ 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 the default API version
|
||||
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/.deno/mod.ts';
|
||||
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://raw.githubusercontent.com/discordjs/discord-api-types/main/.deno/v8/mod.ts';
|
||||
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 the default API version
|
||||
import { APIUser } from 'https://deno.land/x/discord_api_types@0.12.0/mod.ts';
|
||||
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://deno.land/x/discord_api_types@0.12.0/v8/mod.ts';
|
||||
import { APIUser } from 'https://deno.land/x/discord_api_types/v10.ts';
|
||||
```
|
||||
|
||||
3. From [skypack.dev](https://www.skypack.dev/)
|
||||
|
||||
```ts
|
||||
// Importing the default API version
|
||||
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types?dts';
|
||||
|
||||
// Importing a specific API version
|
||||
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v8?dts';
|
||||
import { APIUser } from 'https://cdn.skypack.dev/discord-api-types/v10?dts';
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
@@ -58,45 +82,21 @@ The exports of each API version is split into three main parts:
|
||||
- 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`.
|
||||
|
||||
- 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.
|
||||
- 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`
|
||||
|
||||
- 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.
|
||||
- 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 `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 data mining 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/v8');
|
||||
```
|
||||
|
||||
```ts
|
||||
// TypeScript/ES Module support
|
||||
import { APIUser } from 'discord-api-types/v8';
|
||||
```
|
||||
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.
|
||||
|
||||
104
api-extractor.json
Normal file
104
api-extractor.json
Normal file
@@ -0,0 +1,104 @@
|
||||
{
|
||||
"$schema": "../discord.js/packages/api-extractor/src/schemas/api-extractor.schema.json",
|
||||
|
||||
"mainEntryPointFilePath": "<projectFolder>/v10.d.ts",
|
||||
"mainEntryPointName": "v10",
|
||||
|
||||
"additionalEntryPoints": [
|
||||
{ "modulePath": "v9", "filePath": "<projectFolder>/v9.d.ts" },
|
||||
{ "modulePath": "rpc/v10", "filePath": "<projectFolder>/rpc/v10.d.ts" },
|
||||
{ "modulePath": "voice/v4", "filePath": "<projectFolder>/voice/v4.d.ts" },
|
||||
{ "modulePath": "voice/v8", "filePath": "<projectFolder>/voice/v8.d.ts" }
|
||||
],
|
||||
|
||||
"bundledPackages": [],
|
||||
|
||||
"compiler": {
|
||||
"overrideTsconfig": {
|
||||
"compilerOptions": {
|
||||
"allowUnreachableCode": false,
|
||||
"allowUnusedLabels": false,
|
||||
"exactOptionalPropertyTypes": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitOverride": true,
|
||||
"noImplicitReturns": true,
|
||||
"noPropertyAccessFromIndexSignature": false,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"strict": true,
|
||||
|
||||
"allowArbitraryExtensions": false,
|
||||
"allowImportingTsExtensions": false,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "nodenext",
|
||||
"resolveJsonModule": true,
|
||||
"resolvePackageJsonExports": false,
|
||||
"resolvePackageJsonImports": false,
|
||||
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"importHelpers": false,
|
||||
"newLine": "lf",
|
||||
"noEmitHelpers": true,
|
||||
"outDir": "dist",
|
||||
"removeComments": false,
|
||||
"sourceMap": true,
|
||||
|
||||
"esModuleInterop": false,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"isolatedModules": true,
|
||||
|
||||
"experimentalDecorators": true,
|
||||
"lib": ["ESNext"],
|
||||
"target": "ES2022",
|
||||
"useDefineForClassFields": true
|
||||
},
|
||||
"exclude": ["djs/**/*", "website/**/*", "node_modules/**/*"]
|
||||
}
|
||||
},
|
||||
"apiReport": {
|
||||
"enabled": false
|
||||
},
|
||||
|
||||
"docModel": {
|
||||
"enabled": true,
|
||||
|
||||
"apiJsonFilePath": "<projectFolder>/docs/docs.api.json",
|
||||
"projectFolderUrl": "https://github.com/discordjs/discord-api-types/tree/main"
|
||||
},
|
||||
|
||||
"dtsRollup": {
|
||||
"enabled": false,
|
||||
|
||||
"untrimmedFilePath": "<projectFolder>/v10.d.ts"
|
||||
},
|
||||
|
||||
"tsdocMetadata": {},
|
||||
|
||||
"newlineKind": "lf",
|
||||
|
||||
"messages": {
|
||||
"compilerMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning"
|
||||
}
|
||||
},
|
||||
|
||||
"extractorMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning"
|
||||
},
|
||||
|
||||
"ae-missing-release-tag": {
|
||||
"logLevel": "none"
|
||||
}
|
||||
},
|
||||
|
||||
"tsdocMessageReporting": {
|
||||
"default": {
|
||||
"logLevel": "warning"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
149
common/index.ts
149
common/index.ts
@@ -1,149 +0,0 @@
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#json-json-error-codes
|
||||
*/
|
||||
export const 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,
|
||||
|
||||
GuildAlreadyHasTemplate = 30031,
|
||||
|
||||
Unauthorized = 40001,
|
||||
VerifyYourAccount,
|
||||
|
||||
RequestEntityTooLarge = 40005,
|
||||
FeatureTemporarilyDisabledServerSide,
|
||||
UserBannedFromThisGuild,
|
||||
|
||||
ThisMessageWasAlreadyCrossposted = 40033,
|
||||
|
||||
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,
|
||||
|
||||
InvalidStickerSent = 50081,
|
||||
|
||||
TwoFactorAuthenticationIsRequired = 60003,
|
||||
|
||||
ReactionWasBlocked = 90001,
|
||||
|
||||
APIResourceOverloaded = 130000,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#rpc-rpc-error-codes
|
||||
*/
|
||||
export const 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 const 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/index';
|
||||
2442
deno/CHANGELOG.md
generated
Normal file
2442
deno/CHANGELOG.md
generated
Normal file
File diff suppressed because it is too large
Load Diff
0
.deno/LICENSE → deno/LICENSE
generated
0
.deno/LICENSE → deno/LICENSE
generated
102
deno/README.md
generated
Normal file
102
deno/README.md
generated
Normal file
@@ -0,0 +1,102 @@
|
||||
# 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
generated
Normal file
8
deno/gateway/common.ts
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway#connecting-gateway-url-query-string-params}
|
||||
*/
|
||||
export interface GatewayURLQuery {
|
||||
v: string;
|
||||
encoding: 'etf' | 'json';
|
||||
compress?: 'zlib-stream' | 'zstd-stream';
|
||||
}
|
||||
4
deno/gateway/mod.ts
generated
Normal file
4
deno/gateway/mod.ts
generated
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';
|
||||
2668
deno/gateway/v10.ts
generated
Normal file
2668
deno/gateway/v10.ts
generated
Normal file
File diff suppressed because it is too large
Load Diff
111
.deno/v6/gateway/mod.ts → deno/gateway/v6.ts
generated
111
.deno/v6/gateway/mod.ts → deno/gateway/v6.ts
generated
@@ -16,7 +16,9 @@ import type {
|
||||
GatewayVoiceState,
|
||||
InviteTargetUserType,
|
||||
PresenceUpdateStatus,
|
||||
} from '../payloads/mod.ts';
|
||||
} from '../payloads/v6/mod.ts';
|
||||
|
||||
export type * from './common.ts';
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
@@ -25,6 +27,7 @@ export const GatewayVersion = '6';
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-opcodes
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GatewayOPCodes {
|
||||
@@ -44,17 +47,18 @@ export enum GatewayOPCodes {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#gateway-gateway-close-event-codes
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GatewayCloseCodes {
|
||||
UnknownError = 4000,
|
||||
UnknownError = 4_000,
|
||||
UnknownOpCode,
|
||||
DecodeError,
|
||||
NotAuthenticated,
|
||||
AuthenticationFailed,
|
||||
AlreadyAuthenticated,
|
||||
|
||||
InvalidSeq = 4007,
|
||||
InvalidSeq = 4_007,
|
||||
RateLimited,
|
||||
SessionTimedOut,
|
||||
InvalidShard,
|
||||
@@ -66,6 +70,7 @@ export enum GatewayCloseCodes {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-opcodes
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum VoiceOPCodes {
|
||||
@@ -85,28 +90,30 @@ export enum VoiceOPCodes {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/opcodes-and-status-codes#voice-voice-close-event-codes
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum VoiceCloseCodes {
|
||||
UnknownOpCode = 4001,
|
||||
UnknownOpCode = 4_001,
|
||||
|
||||
NotAuthenticated = 4003,
|
||||
NotAuthenticated = 4_003,
|
||||
AuthenticationFailed,
|
||||
AlreadyAuthenticated,
|
||||
SessionNoLongerValid,
|
||||
|
||||
SessionTimeout = 4009,
|
||||
SessionTimeout = 4_009,
|
||||
|
||||
ServerNotFound = 4011,
|
||||
ServerNotFound = 4_011,
|
||||
UnknownProtocol,
|
||||
|
||||
Disconnected = 4014,
|
||||
Disconnected = 4_014,
|
||||
VoiceServerCrashed,
|
||||
UnknownEncryptionMode,
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#list-of-intents
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GatewayIntentBits {
|
||||
@@ -129,6 +136,7 @@ export enum GatewayIntentBits {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#commands-and-events-gateway-events
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export enum GatewayDispatchEvents {
|
||||
@@ -176,61 +184,62 @@ export enum GatewayDispatchEvents {
|
||||
export type GatewaySendPayload =
|
||||
| GatewayHeartbeat
|
||||
| GatewayIdentify
|
||||
| GatewayUpdatePresence
|
||||
| GatewayVoiceStateUpdate
|
||||
| GatewayRequestGuildMembers
|
||||
| GatewayResume
|
||||
| GatewayRequestGuildMembers;
|
||||
| GatewayUpdatePresence
|
||||
| GatewayVoiceStateUpdate;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayReceivePayload =
|
||||
| GatewayHello
|
||||
| GatewayHeartbeatRequest
|
||||
| GatewayDispatchPayload
|
||||
| GatewayHeartbeatAck
|
||||
| GatewayHeartbeatRequest
|
||||
| GatewayHello
|
||||
| GatewayInvalidSession
|
||||
| GatewayReconnect
|
||||
| GatewayDispatchPayload;
|
||||
| GatewayReconnect;
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayDispatchPayload =
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayChannelModifyDispatch
|
||||
| GatewayChannelPinsUpdateDispatch
|
||||
| GatewayGuildModifyDispatch
|
||||
| GatewayGuildDeleteDispatch
|
||||
| GatewayGuildBanModifyDispatch
|
||||
| GatewayGuildDeleteDispatch
|
||||
| GatewayGuildEmojisUpdateDispatch
|
||||
| GatewayGuildIntegrationsUpdateDispatch
|
||||
| GatewayGuildMemberAddDispatch
|
||||
| GatewayGuildMemberRemoveDispatch
|
||||
| GatewayGuildMemberUpdateDispatch
|
||||
| GatewayGuildMembersChunkDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayGuildMemberUpdateDispatch
|
||||
| GatewayGuildModifyDispatch
|
||||
| GatewayGuildRoleDeleteDispatch
|
||||
| GatewayGuildRoleModifyDispatch
|
||||
| GatewayInviteCreateDispatch
|
||||
| GatewayInviteDeleteDispatch
|
||||
| GatewayMessageCreateDispatch
|
||||
| GatewayMessageUpdateDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessageDeleteBulkDispatch
|
||||
| GatewayMessageDeleteDispatch
|
||||
| GatewayMessageReactionAddDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
| GatewayMessageReactionRemoveAllDispatch
|
||||
| GatewayMessageReactionRemoveDispatch
|
||||
| GatewayMessageReactionRemoveEmojiDispatch
|
||||
| GatewayMessageUpdateDispatch
|
||||
| GatewayPresenceUpdateDispatch
|
||||
| GatewayReadyDispatch
|
||||
| GatewayResumedDispatch
|
||||
| GatewayTypingStartDispatch
|
||||
| GatewayUserUpdateDispatch
|
||||
| GatewayVoiceStateUpdateDispatch
|
||||
| GatewayVoiceServerUpdateDispatch
|
||||
| GatewayVoiceStateUpdateDispatch
|
||||
| GatewayWebhooksUpdateDispatch;
|
||||
|
||||
// #region Dispatch Payloads
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#hello
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHello extends NonDispatchPayload {
|
||||
@@ -242,6 +251,7 @@ export interface GatewayHello extends NonDispatchPayload {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHeartbeatRequest extends NonDispatchPayload {
|
||||
@@ -251,6 +261,7 @@ export interface GatewayHeartbeatRequest extends NonDispatchPayload {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating-example-gateway-heartbeat-ack
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHeartbeatAck extends NonDispatchPayload {
|
||||
@@ -260,6 +271,7 @@ export interface GatewayHeartbeatAck extends NonDispatchPayload {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invalid-session
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayInvalidSession extends NonDispatchPayload {
|
||||
@@ -269,6 +281,7 @@ export interface GatewayInvalidSession extends NonDispatchPayload {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#reconnect
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayReconnect extends NonDispatchPayload {
|
||||
@@ -278,6 +291,7 @@ export interface GatewayReconnect extends NonDispatchPayload {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#ready
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayReadyDispatch = DataPayload<
|
||||
@@ -294,22 +308,22 @@ export type GatewayReadyDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#resumed
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayResumedDispatch = DataPayload<GatewayDispatchEvents.Resumed, never>;
|
||||
|
||||
/* eslint-disable @typescript-eslint/indent */
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-create
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-update
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-delete
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelModifyDispatch = DataPayload<
|
||||
GatewayDispatchEvents.ChannelCreate | GatewayDispatchEvents.ChannelDelete | GatewayDispatchEvents.ChannelUpdate,
|
||||
APIChannel
|
||||
>;
|
||||
/* eslint-enable @typescript-eslint/indent */
|
||||
|
||||
/**
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
@@ -328,6 +342,7 @@ export type GatewayChannelDeleteDispatch = GatewayChannelModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#channel-pins-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayChannelPinsUpdateDispatch = DataPayload<
|
||||
@@ -342,6 +357,7 @@ export type GatewayChannelPinsUpdateDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildModifyDispatch = DataPayload<
|
||||
@@ -361,6 +377,7 @@ export type GatewayGuildUpdateDispatch = GatewayGuildModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-delete
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.GuildDelete, APIUnavailableGuild>;
|
||||
@@ -368,6 +385,7 @@ export type GatewayGuildDeleteDispatch = DataPayload<GatewayDispatchEvents.Guild
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-ban-add
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-ban-remove
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildBanModifyDispatch = DataPayload<
|
||||
@@ -390,6 +408,7 @@ export type GatewayGuildBanRemoveDispatch = GatewayGuildBanModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-emojis-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildEmojisUpdateDispatch = DataPayload<
|
||||
@@ -402,6 +421,7 @@ export type GatewayGuildEmojisUpdateDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-integrations-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildIntegrationsUpdateDispatch = DataPayload<
|
||||
@@ -411,6 +431,7 @@ export type GatewayGuildIntegrationsUpdateDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-add
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMemberAddDispatch = DataPayload<
|
||||
@@ -420,6 +441,7 @@ export type GatewayGuildMemberAddDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-remove
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMemberRemoveDispatch = DataPayload<
|
||||
@@ -432,6 +454,7 @@ export type GatewayGuildMemberRemoveDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-member-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMemberUpdateDispatch = DataPayload<
|
||||
@@ -443,6 +466,7 @@ export type GatewayGuildMemberUpdateDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-members-chunk
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildMembersChunkDispatch = DataPayload<
|
||||
@@ -461,6 +485,7 @@ export type GatewayGuildMembersChunkDispatch = DataPayload<
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-create
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleModifyDispatch = DataPayload<
|
||||
@@ -483,6 +508,7 @@ export type GatewayGuildRoleUpdateDispatch = GatewayGuildRoleModifyDispatch;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#guild-role-delete
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayGuildRoleDeleteDispatch = DataPayload<
|
||||
@@ -495,6 +521,7 @@ export type GatewayGuildRoleDeleteDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-create
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayInviteCreateDispatch = DataPayload<
|
||||
@@ -516,6 +543,7 @@ export type GatewayInviteCreateDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#invite-delete
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayInviteDeleteDispatch = DataPayload<
|
||||
@@ -529,21 +557,24 @@ export type GatewayInviteDeleteDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-create
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageCreateDispatch = DataPayload<GatewayDispatchEvents.MessageCreate, APIMessage>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageUpdateDispatch = DataPayload<
|
||||
GatewayDispatchEvents.MessageUpdate,
|
||||
{ id: string; channel_id: string } & Partial<APIMessage>
|
||||
Partial<APIMessage> & { id: string; channel_id: string }
|
||||
>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageDeleteDispatch = DataPayload<
|
||||
@@ -557,6 +588,7 @@ export type GatewayMessageDeleteDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-delete-bulk
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageDeleteBulkDispatch = DataPayload<
|
||||
@@ -570,18 +602,21 @@ export type GatewayMessageDeleteBulkDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-add
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionAddDispatch = ReactionData<GatewayDispatchEvents.MessageReactionAdd>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveDispatch = ReactionData<GatewayDispatchEvents.MessageReactionRemove, 'member'>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-all
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveAllDispatch = DataPayload<
|
||||
@@ -591,6 +626,7 @@ export type GatewayMessageReactionRemoveAllDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#message-reaction-remove-emoji
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<
|
||||
@@ -602,12 +638,14 @@ export type GatewayMessageReactionRemoveEmojiDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#presence-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayPresenceUpdateDispatch = DataPayload<GatewayDispatchEvents.PresenceUpdate, RawGatewayPresenceUpdate>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#typing-start
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayTypingStartDispatch = DataPayload<
|
||||
@@ -623,18 +661,21 @@ export type GatewayTypingStartDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#user-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayUserUpdateDispatch = DataPayload<GatewayDispatchEvents.UserUpdate, APIUser>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-state-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayVoiceStateUpdateDispatch = DataPayload<GatewayDispatchEvents.VoiceStateUpdate, GatewayVoiceState>;
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#voice-server-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayVoiceServerUpdateDispatch = DataPayload<
|
||||
@@ -648,6 +689,7 @@ export type GatewayVoiceServerUpdateDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#webhooks-update
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export type GatewayWebhooksUpdateDispatch = DataPayload<
|
||||
@@ -664,6 +706,7 @@ export type GatewayWebhooksUpdateDispatch = DataPayload<
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#heartbeating
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayHeartbeat {
|
||||
@@ -673,6 +716,7 @@ export interface GatewayHeartbeat {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#identify-identify-connection-properties
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayIdentifyProperties {
|
||||
@@ -683,6 +727,7 @@ export interface GatewayIdentifyProperties {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#identify
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayIdentify {
|
||||
@@ -692,7 +737,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;
|
||||
@@ -702,6 +746,7 @@ export interface GatewayIdentify {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#resume
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayResume {
|
||||
@@ -715,22 +760,24 @@ export interface GatewayResume {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#request-guild-members
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayRequestGuildMembers {
|
||||
op: GatewayOPCodes.RequestGuildMembers;
|
||||
d: {
|
||||
guild_id: string | string[];
|
||||
guild_id: string[] | string;
|
||||
query?: string;
|
||||
limit: number;
|
||||
presences?: boolean;
|
||||
user_ids?: string | string[];
|
||||
user_ids?: string[] | string;
|
||||
nonce?: string;
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-voice-state
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayVoiceStateUpdate {
|
||||
@@ -745,6 +792,7 @@ export interface GatewayVoiceStateUpdate {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-status
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayUpdatePresence {
|
||||
@@ -754,6 +802,7 @@ export interface GatewayUpdatePresence {
|
||||
|
||||
/**
|
||||
* https://discord.com/developers/docs/topics/gateway#update-status-gateway-status-update-structure
|
||||
*
|
||||
* @deprecated Gateway v6 is deprecated and the types will not receive further updates, please update to v8.
|
||||
*/
|
||||
export interface GatewayPresenceUpdateData {
|
||||
878
v8/gateway/index.ts → deno/gateway/v8.ts
generated
878
v8/gateway/index.ts → deno/gateway/v8.ts
generated
File diff suppressed because it is too large
Load Diff
2667
deno/gateway/v9.ts
generated
Normal file
2667
deno/gateway/v9.ts
generated
Normal file
File diff suppressed because it is too large
Load Diff
114
deno/globals.ts
generated
Normal file
114
deno/globals.ts
generated
Normal file
@@ -0,0 +1,114 @@
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/reference#snowflakes}
|
||||
*/
|
||||
export type Snowflake = string;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/permissions}
|
||||
*/
|
||||
export type Permissions = string;
|
||||
|
||||
const timestampStyles = 'DFRSTdfst';
|
||||
const timestampLength = 13;
|
||||
|
||||
/**
|
||||
* @see {@link 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: new RegExp(`<t:(?<timestamp>-?\\d{1,${timestampLength}})(:(?<style>[${timestampStyles}]))?>`),
|
||||
/**
|
||||
* Regular expression for matching strictly default styled timestamps
|
||||
*
|
||||
* The `timestamp` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
DefaultStyledTimestamp: new RegExp(`<t:(?<timestamp>-?\\d{1,${timestampLength}})>`),
|
||||
/**
|
||||
* Regular expression for matching strictly custom styled timestamps
|
||||
*
|
||||
* The `timestamp` and `style` group properties are present on the `exec` result of this expression
|
||||
*/
|
||||
StyledTimestamp: new RegExp(`<t:(?<timestamp>-?\\d{1,${timestampLength}}):(?<style>[${timestampStyles}])>`),
|
||||
/**
|
||||
* Regular expression for matching a guild navigation mention
|
||||
*
|
||||
* The `type` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
GuildNavigation: /<id:(?<type>customize|browse|guide|linked-roles)>/,
|
||||
/**
|
||||
* Regular expression for matching a linked role mention
|
||||
*
|
||||
* The `id` group property is present on the `exec` result of this expression
|
||||
*/
|
||||
LinkedRole: /<id:linked-roles:(?<id>\d{17,20})>/,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Freezes the formatting patterns
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(FormattingPatterns);
|
||||
355
deno/payloads/common.ts
generated
Normal file
355
deno/payloads/common.ts
generated
Normal file
@@ -0,0 +1,355 @@
|
||||
import type { Locale } from '../rest/common.ts';
|
||||
|
||||
/**
|
||||
* @see {@link 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 = {
|
||||
/**
|
||||
* Allows creation of instant invites
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
CreateInstantInvite: 1n << 0n,
|
||||
/**
|
||||
* Allows kicking members
|
||||
*/
|
||||
KickMembers: 1n << 1n,
|
||||
/**
|
||||
* Allows banning members
|
||||
*/
|
||||
BanMembers: 1n << 2n,
|
||||
/**
|
||||
* Allows all permissions and bypasses channel permission overwrites
|
||||
*/
|
||||
Administrator: 1n << 3n,
|
||||
/**
|
||||
* Allows management and editing of channels
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
ManageChannels: 1n << 4n,
|
||||
/**
|
||||
* Allows management and editing of the guild
|
||||
*/
|
||||
ManageGuild: 1n << 5n,
|
||||
/**
|
||||
* Allows for the addition of reactions to messages. This permission does not apply to reacting with an existing reaction on a message
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
AddReactions: 1n << 6n,
|
||||
/**
|
||||
* Allows for viewing of audit logs
|
||||
*/
|
||||
ViewAuditLog: 1n << 7n,
|
||||
/**
|
||||
* Allows for using priority speaker in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
PrioritySpeaker: 1n << 8n,
|
||||
/**
|
||||
* Allows the user to go live
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
Stream: 1n << 9n,
|
||||
/**
|
||||
* Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
ViewChannel: 1n << 10n,
|
||||
/**
|
||||
* Allows for sending messages in a channel and creating threads in a forum
|
||||
* (does not allow sending messages in threads)
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendMessages: 1n << 11n,
|
||||
/**
|
||||
* Allows for sending of `/tts` messages
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendTTSMessages: 1n << 12n,
|
||||
/**
|
||||
* Allows for deletion of other users messages
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
ManageMessages: 1n << 13n,
|
||||
/**
|
||||
* Links sent by users with this permission will be auto-embedded
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
EmbedLinks: 1n << 14n,
|
||||
/**
|
||||
* Allows for uploading images and files
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
AttachFiles: 1n << 15n,
|
||||
/**
|
||||
* Allows for reading of message history
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
ReadMessageHistory: 1n << 16n,
|
||||
/**
|
||||
* Allows for using the `@everyone` tag to notify all users in a channel,
|
||||
* and the `@here` tag to notify all online users in a channel
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
MentionEveryone: 1n << 17n,
|
||||
/**
|
||||
* Allows the usage of custom emojis from other servers
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
UseExternalEmojis: 1n << 18n,
|
||||
/**
|
||||
* Allows for viewing guild insights
|
||||
*/
|
||||
ViewGuildInsights: 1n << 19n,
|
||||
/**
|
||||
* Allows for joining of a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
Connect: 1n << 20n,
|
||||
/**
|
||||
* Allows for speaking in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
Speak: 1n << 21n,
|
||||
/**
|
||||
* Allows for muting members in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
MuteMembers: 1n << 22n,
|
||||
/**
|
||||
* Allows for deafening of members in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
DeafenMembers: 1n << 23n,
|
||||
/**
|
||||
* Allows for moving of members between voice channels
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
MoveMembers: 1n << 24n,
|
||||
/**
|
||||
* Allows for using voice-activity-detection in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
UseVAD: 1n << 25n,
|
||||
/**
|
||||
* Allows for modification of own nickname
|
||||
*/
|
||||
ChangeNickname: 1n << 26n,
|
||||
/**
|
||||
* Allows for modification of other users nicknames
|
||||
*/
|
||||
ManageNicknames: 1n << 27n,
|
||||
/**
|
||||
* Allows management and editing of roles
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
ManageRoles: 1n << 28n,
|
||||
/**
|
||||
* Allows management and editing of webhooks
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
ManageWebhooks: 1n << 29n,
|
||||
/**
|
||||
* Allows management and editing of emojis, stickers, and soundboard sounds
|
||||
*
|
||||
* @deprecated This is the old name for {@link PermissionFlagsBits.ManageGuildExpressions}
|
||||
*/
|
||||
ManageEmojisAndStickers: 1n << 30n,
|
||||
/**
|
||||
* Allows for editing and deleting emojis, stickers, and soundboard sounds created by all users
|
||||
*/
|
||||
ManageGuildExpressions: 1n << 30n,
|
||||
/**
|
||||
* Allows members to use application commands, including slash commands and context menu commands
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
UseApplicationCommands: 1n << 31n,
|
||||
/**
|
||||
* Allows for requesting to speak in stage channels
|
||||
*
|
||||
* Applies to channel types: Stage
|
||||
*/
|
||||
RequestToSpeak: 1n << 32n,
|
||||
/**
|
||||
* Allows for editing and deleting scheduled events created by all users
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
ManageEvents: 1n << 33n,
|
||||
/**
|
||||
* Allows for deleting and archiving threads, and viewing all private threads
|
||||
*
|
||||
* Applies to channel types: Text
|
||||
*/
|
||||
ManageThreads: 1n << 34n,
|
||||
/**
|
||||
* Allows for creating public and announcement threads
|
||||
*
|
||||
* Applies to channel types: Text
|
||||
*/
|
||||
CreatePublicThreads: 1n << 35n,
|
||||
/**
|
||||
* Allows for creating private threads
|
||||
*
|
||||
* Applies to channel types: Text
|
||||
*/
|
||||
CreatePrivateThreads: 1n << 36n,
|
||||
/**
|
||||
* Allows the usage of custom stickers from other servers
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
UseExternalStickers: 1n << 37n,
|
||||
/**
|
||||
* Allows for sending messages in threads
|
||||
*
|
||||
* Applies to channel types: Text
|
||||
*/
|
||||
SendMessagesInThreads: 1n << 38n,
|
||||
/**
|
||||
* Allows for using Activities (applications with the {@link ApplicationFlags.Embedded} flag)
|
||||
*
|
||||
* Applies to channel types: Text, Voice
|
||||
*/
|
||||
UseEmbeddedActivities: 1n << 39n,
|
||||
/**
|
||||
* Allows for timing out users to prevent them from sending or reacting to messages in chat and threads,
|
||||
* and from speaking in voice and stage channels
|
||||
*/
|
||||
ModerateMembers: 1n << 40n,
|
||||
/**
|
||||
* Allows for viewing role subscription insights
|
||||
*/
|
||||
ViewCreatorMonetizationAnalytics: 1n << 41n,
|
||||
/**
|
||||
* Allows for using soundboard in a voice channel
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
UseSoundboard: 1n << 42n,
|
||||
/**
|
||||
* Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those created by the current user
|
||||
*/
|
||||
CreateGuildExpressions: 1n << 43n,
|
||||
/**
|
||||
* Allows for creating scheduled events, and editing and deleting those created by the current user
|
||||
*
|
||||
* Applies to channel types: Voice, Stage
|
||||
*/
|
||||
CreateEvents: 1n << 44n,
|
||||
/**
|
||||
* Allows the usage of custom soundboard sounds from other servers
|
||||
*
|
||||
* Applies to channel types: Voice
|
||||
*/
|
||||
UseExternalSounds: 1n << 45n,
|
||||
/**
|
||||
* Allows sending voice messages
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendVoiceMessages: 1n << 46n,
|
||||
/**
|
||||
* Allows sending polls
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
SendPolls: 1n << 49n,
|
||||
/**
|
||||
* Allows user-installed apps to send public responses. When disabled, users will still be allowed to use their apps but the responses will be ephemeral. This only applies to apps not also installed to the server
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
UseExternalApps: 1n << 50n,
|
||||
/**
|
||||
* Allows pinning and unpinning messages
|
||||
*
|
||||
* Applies to channel types: Text
|
||||
*/
|
||||
PinMessages: 1n << 51n,
|
||||
/**
|
||||
* Allows bypassing slowmode restrictions
|
||||
*
|
||||
* Applies to channel types: Text, Voice, Stage
|
||||
*/
|
||||
BypassSlowmode: 1n << 52n,
|
||||
} as const;
|
||||
|
||||
/**
|
||||
* Freeze the object of bits, preventing any modifications to it
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
Object.freeze(PermissionFlagsBits);
|
||||
|
||||
export type LocalizationMap = Partial<Record<Locale, string | null>>;
|
||||
|
||||
/**
|
||||
* @see {@link 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 = RESTErrorFieldInformation | RESTErrorGroupWrapper | string | { [k: string]: RESTErrorData };
|
||||
|
||||
/**
|
||||
* @see {@link 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
generated
Normal file
4
deno/payloads/mod.ts
generated
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';
|
||||
11
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/attachment.ts
generated
Normal file
11
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/attachment.ts
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
export type APIApplicationCommandAttachmentOption =
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Attachment>;
|
||||
|
||||
export type APIApplicationCommandInteractionDataAttachmentOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Attachment,
|
||||
Snowflake
|
||||
>;
|
||||
30
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/base.ts
generated
Normal file
30
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/base.ts
generated
Normal file
@@ -0,0 +1,30 @@
|
||||
import type { LocalizationMap } from '../../../../../v10.ts';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.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;
|
||||
choices?: [];
|
||||
})
|
||||
| (Base & {
|
||||
autocomplete?: false;
|
||||
choices?: ChoiceType[];
|
||||
});
|
||||
9
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/boolean.ts
generated
Normal file
9
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/boolean.ts
generated
Normal file
@@ -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
|
||||
>;
|
||||
13
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/channel.ts
generated
Normal file
13
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/channel.ts
generated
Normal file
@@ -0,0 +1,13 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { ApplicationCommandOptionAllowedChannelType } from '../../../channel.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
export interface APIApplicationCommandChannelOption extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Channel> {
|
||||
channel_types?: ApplicationCommandOptionAllowedChannelType[];
|
||||
}
|
||||
|
||||
export type APIApplicationCommandInteractionDataChannelOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Channel,
|
||||
Snowflake
|
||||
>;
|
||||
32
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/integer.ts
generated
Normal file
32
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/integer.ts
generated
Normal file
@@ -0,0 +1,32 @@
|
||||
import type { InteractionType } from '../../responses.ts';
|
||||
import type {
|
||||
APIApplicationCommandOptionBase,
|
||||
APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper,
|
||||
APIInteractionDataOptionBase,
|
||||
} from './base.ts';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
export 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<
|
||||
Type extends InteractionType = InteractionType,
|
||||
> extends APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Integer,
|
||||
Type extends InteractionType.ApplicationCommandAutocomplete ? string : number
|
||||
> {
|
||||
focused?: boolean;
|
||||
}
|
||||
11
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/mentionable.ts
generated
Normal file
11
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/mentionable.ts
generated
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
export type APIApplicationCommandMentionableOption =
|
||||
APIApplicationCommandOptionBase<ApplicationCommandOptionType.Mentionable>;
|
||||
|
||||
export type APIApplicationCommandInteractionDataMentionableOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Mentionable,
|
||||
Snowflake
|
||||
>;
|
||||
32
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/number.ts
generated
Normal file
32
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/number.ts
generated
Normal file
@@ -0,0 +1,32 @@
|
||||
import type { InteractionType } from '../../responses.ts';
|
||||
import type {
|
||||
APIApplicationCommandOptionBase,
|
||||
APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper,
|
||||
APIInteractionDataOptionBase,
|
||||
} from './base.ts';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
export 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<
|
||||
Type extends InteractionType = InteractionType,
|
||||
> extends APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Number,
|
||||
Type extends InteractionType.ApplicationCommandAutocomplete ? string : number
|
||||
> {
|
||||
focused?: boolean;
|
||||
}
|
||||
10
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/role.ts
generated
Normal file
10
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/role.ts
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
export type APIApplicationCommandRoleOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.Role>;
|
||||
|
||||
export type APIApplicationCommandInteractionDataRoleOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.Role,
|
||||
Snowflake
|
||||
>;
|
||||
27
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/shared.ts
generated
Normal file
27
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/shared.ts
generated
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { LocalizationMap } from '../../../../../v10.ts';
|
||||
|
||||
/**
|
||||
* @see {@link 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,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-choice-structure}
|
||||
*/
|
||||
export interface APIApplicationCommandOptionChoice<ValueType = number | string> {
|
||||
name: string;
|
||||
name_localizations?: LocalizationMap | null;
|
||||
value: ValueType;
|
||||
}
|
||||
29
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/string.ts
generated
Normal file
29
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/string.ts
generated
Normal file
@@ -0,0 +1,29 @@
|
||||
import type {
|
||||
APIApplicationCommandOptionBase,
|
||||
APIApplicationCommandOptionWithAutocompleteOrChoicesWrapper,
|
||||
APIInteractionDataOptionBase,
|
||||
} from './base.ts';
|
||||
import type { APIApplicationCommandOptionChoice, ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
export 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;
|
||||
}
|
||||
14
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/subcommand.ts
generated
Normal file
14
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/subcommand.ts
generated
Normal file
@@ -0,0 +1,14 @@
|
||||
import type { InteractionType } from '../../responses.ts';
|
||||
import type { APIApplicationCommandBasicOption, APIApplicationCommandInteractionDataBasicOption } from '../chatInput.ts';
|
||||
import type { APIApplicationCommandOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
export interface APIApplicationCommandSubcommandOption extends APIApplicationCommandOptionBase<ApplicationCommandOptionType.Subcommand> {
|
||||
options?: APIApplicationCommandBasicOption[];
|
||||
}
|
||||
|
||||
export interface APIApplicationCommandInteractionDataSubcommandOption<Type extends InteractionType = InteractionType> {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.Subcommand;
|
||||
options?: APIApplicationCommandInteractionDataBasicOption<Type>[];
|
||||
}
|
||||
19
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/subcommandGroup.ts
generated
Normal file
19
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/subcommandGroup.ts
generated
Normal file
@@ -0,0 +1,19 @@
|
||||
import type { InteractionType } from '../../responses.ts';
|
||||
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<
|
||||
Type extends InteractionType = InteractionType,
|
||||
> {
|
||||
name: string;
|
||||
type: ApplicationCommandOptionType.SubcommandGroup;
|
||||
options: APIApplicationCommandInteractionDataSubcommandOption<Type>[];
|
||||
}
|
||||
10
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/user.ts
generated
Normal file
10
deno/payloads/v10/_interactions/_applicationCommands/_chatInput/user.ts
generated
Normal file
@@ -0,0 +1,10 @@
|
||||
import type { Snowflake } from '../../../../../globals.ts';
|
||||
import type { APIApplicationCommandOptionBase, APIInteractionDataOptionBase } from './base.ts';
|
||||
import type { ApplicationCommandOptionType } from './shared.ts';
|
||||
|
||||
export type APIApplicationCommandUserOption = APIApplicationCommandOptionBase<ApplicationCommandOptionType.User>;
|
||||
|
||||
export type APIApplicationCommandInteractionDataUserOption = APIInteractionDataOptionBase<
|
||||
ApplicationCommandOptionType.User,
|
||||
Snowflake
|
||||
>;
|
||||
137
deno/payloads/v10/_interactions/_applicationCommands/chatInput.ts
generated
Normal file
137
deno/payloads/v10/_interactions/_applicationCommands/chatInput.ts
generated
Normal file
@@ -0,0 +1,137 @@
|
||||
import type { APIInteractionDataResolved, InteractionType } from '../../mod.ts';
|
||||
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
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';
|
||||
|
||||
export type * from './_chatInput/attachment.ts';
|
||||
export type * from './_chatInput/base.ts';
|
||||
export type * from './_chatInput/boolean.ts';
|
||||
export type * from './_chatInput/channel.ts';
|
||||
export type * from './_chatInput/integer.ts';
|
||||
export type * from './_chatInput/mentionable.ts';
|
||||
export type * from './_chatInput/number.ts';
|
||||
export type * from './_chatInput/role.ts';
|
||||
export * from './_chatInput/shared.ts';
|
||||
export type * from './_chatInput/string.ts';
|
||||
export type * from './_chatInput/subcommand.ts';
|
||||
export type * from './_chatInput/subcommandGroup.ts';
|
||||
export type * from './_chatInput/user.ts';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure}
|
||||
*/
|
||||
export type APIApplicationCommandBasicOption =
|
||||
| APIApplicationCommandAttachmentOption
|
||||
| APIApplicationCommandBooleanOption
|
||||
| APIApplicationCommandChannelOption
|
||||
| APIApplicationCommandIntegerOption
|
||||
| APIApplicationCommandMentionableOption
|
||||
| APIApplicationCommandNumberOption
|
||||
| APIApplicationCommandRoleOption
|
||||
| APIApplicationCommandStringOption
|
||||
| APIApplicationCommandUserOption;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-option-structure}
|
||||
*/
|
||||
export type APIApplicationCommandOption =
|
||||
| APIApplicationCommandBasicOption
|
||||
| APIApplicationCommandSubcommandGroupOption
|
||||
| APIApplicationCommandSubcommandOption;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-interaction-data-option-structure}
|
||||
*/
|
||||
export type APIApplicationCommandInteractionDataOption<Type extends InteractionType = InteractionType> =
|
||||
| APIApplicationCommandInteractionDataBasicOption<Type>
|
||||
| APIApplicationCommandInteractionDataSubcommandGroupOption<Type>
|
||||
| APIApplicationCommandInteractionDataSubcommandOption<Type>;
|
||||
|
||||
export type APIApplicationCommandInteractionDataBasicOption<Type extends InteractionType = InteractionType> =
|
||||
| APIApplicationCommandInteractionDataAttachmentOption
|
||||
| APIApplicationCommandInteractionDataBooleanOption
|
||||
| APIApplicationCommandInteractionDataChannelOption
|
||||
| APIApplicationCommandInteractionDataIntegerOption<Type>
|
||||
| APIApplicationCommandInteractionDataMentionableOption
|
||||
| APIApplicationCommandInteractionDataNumberOption<Type>
|
||||
| APIApplicationCommandInteractionDataRoleOption
|
||||
| APIApplicationCommandInteractionDataStringOption
|
||||
| APIApplicationCommandInteractionDataUserOption;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data}
|
||||
*/
|
||||
export interface APIChatInputApplicationCommandInteractionData extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {
|
||||
options?: APIApplicationCommandInteractionDataOption<InteractionType.ApplicationCommand>[];
|
||||
resolved?: APIInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data}
|
||||
*/
|
||||
export interface APIAutocompleteApplicationCommandInteractionData extends APIBaseApplicationCommandInteractionData<ApplicationCommandType.ChatInput> {
|
||||
options?: APIApplicationCommandInteractionDataOption<InteractionType.ApplicationCommandAutocomplete>[];
|
||||
resolved?: APIInteractionDataResolved;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIChatInputApplicationCommandInteraction =
|
||||
APIApplicationCommandInteractionWrapper<APIChatInputApplicationCommandInteractionData>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIChatInputApplicationCommandDMInteraction =
|
||||
APIDMInteractionWrapper<APIChatInputApplicationCommandInteraction>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIChatInputApplicationCommandGuildInteraction =
|
||||
APIGuildInteractionWrapper<APIChatInputApplicationCommandInteraction>;
|
||||
89
deno/payloads/v10/_interactions/_applicationCommands/contextMenu.ts
generated
Normal file
89
deno/payloads/v10/_interactions/_applicationCommands/contextMenu.ts
generated
Normal file
@@ -0,0 +1,89 @@
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
import type { APIMessage } from '../../message.ts';
|
||||
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper, APIUserInteractionDataResolved } from '../base.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure}
|
||||
*/
|
||||
export interface APIMessageApplicationCommandInteractionDataResolved {
|
||||
messages: Record<Snowflake, APIMessage>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data}
|
||||
*/
|
||||
export type APIContextMenuInteractionData =
|
||||
| APIMessageApplicationCommandInteractionData
|
||||
| APIUserApplicationCommandInteractionData;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIUserApplicationCommandInteraction =
|
||||
APIApplicationCommandInteractionWrapper<APIUserApplicationCommandInteractionData>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIUserApplicationCommandDMInteraction = APIDMInteractionWrapper<APIUserApplicationCommandInteraction>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIUserApplicationCommandGuildInteraction =
|
||||
APIGuildInteractionWrapper<APIUserApplicationCommandInteraction>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIMessageApplicationCommandInteraction =
|
||||
APIApplicationCommandInteractionWrapper<APIMessageApplicationCommandInteractionData>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIMessageApplicationCommandDMInteraction =
|
||||
APIDMInteractionWrapper<APIMessageApplicationCommandInteraction>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIMessageApplicationCommandGuildInteraction =
|
||||
APIGuildInteractionWrapper<APIMessageApplicationCommandInteraction>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIContextMenuInteraction = APIMessageApplicationCommandInteraction | APIUserApplicationCommandInteraction;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIContextMenuDMInteraction =
|
||||
| APIMessageApplicationCommandDMInteraction
|
||||
| APIUserApplicationCommandDMInteraction;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIContextMenuGuildInteraction =
|
||||
| APIMessageApplicationCommandGuildInteraction
|
||||
| APIUserApplicationCommandGuildInteraction;
|
||||
26
deno/payloads/v10/_interactions/_applicationCommands/entryPoint.ts
generated
Normal file
26
deno/payloads/v10/_interactions/_applicationCommands/entryPoint.ts
generated
Normal file
@@ -0,0 +1,26 @@
|
||||
import type { APIApplicationCommandInteractionWrapper, ApplicationCommandType } from '../applicationCommands.ts';
|
||||
import type { APIDMInteractionWrapper, APIGuildInteractionWrapper } from '../base.ts';
|
||||
import type { APIBaseApplicationCommandInteractionData } from './internals.ts';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data}
|
||||
*/
|
||||
export type APIPrimaryEntryPointCommandInteractionData =
|
||||
APIBaseApplicationCommandInteractionData<ApplicationCommandType.PrimaryEntryPoint>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIPrimaryEntryPointCommandInteraction =
|
||||
APIApplicationCommandInteractionWrapper<APIPrimaryEntryPointCommandInteractionData>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIPrimaryEntryPointCommandDMInteraction = APIDMInteractionWrapper<APIPrimaryEntryPointCommandInteraction>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIPrimaryEntryPointCommandGuildInteraction =
|
||||
APIGuildInteractionWrapper<APIPrimaryEntryPointCommandInteraction>;
|
||||
9
deno/payloads/v10/_interactions/_applicationCommands/internals.ts
generated
Normal file
9
deno/payloads/v10/_interactions/_applicationCommands/internals.ts
generated
Normal file
@@ -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;
|
||||
}
|
||||
59
deno/payloads/v10/_interactions/_applicationCommands/permissions.ts
generated
Normal file
59
deno/payloads/v10/_interactions/_applicationCommands/permissions.ts
generated
Normal file
@@ -0,0 +1,59 @@
|
||||
import type { Snowflake } from '../../../../globals.ts';
|
||||
|
||||
/**
|
||||
* @see {@link 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[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permission-type}
|
||||
*/
|
||||
export enum ApplicationCommandPermissionType {
|
||||
Role = 1,
|
||||
User,
|
||||
Channel,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-permissions-object-application-command-permissions-constants}
|
||||
*/
|
||||
export const APIApplicationCommandPermissionsConstant = {
|
||||
// eslint-disable-next-line unicorn/prefer-native-coercion-functions
|
||||
Everyone: (guildId: bigint | string): Snowflake => String(guildId),
|
||||
AllChannels: (guildId: bigint | string): Snowflake => String(BigInt(guildId) - 1n),
|
||||
};
|
||||
239
deno/payloads/v10/_interactions/applicationCommands.ts
generated
Normal file
239
deno/payloads/v10/_interactions/applicationCommands.ts
generated
Normal file
@@ -0,0 +1,239 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { LocalizationMap } from '../../../v10.ts';
|
||||
import type {
|
||||
APIApplicationCommandOption,
|
||||
APIChatInputApplicationCommandDMInteraction,
|
||||
APIChatInputApplicationCommandGuildInteraction,
|
||||
APIChatInputApplicationCommandInteraction,
|
||||
APIChatInputApplicationCommandInteractionData,
|
||||
} from './_applicationCommands/chatInput.ts';
|
||||
import type {
|
||||
APIContextMenuDMInteraction,
|
||||
APIContextMenuGuildInteraction,
|
||||
APIContextMenuInteraction,
|
||||
APIContextMenuInteractionData,
|
||||
} from './_applicationCommands/contextMenu.ts';
|
||||
import type {
|
||||
APIPrimaryEntryPointCommandDMInteraction,
|
||||
APIPrimaryEntryPointCommandGuildInteraction,
|
||||
APIPrimaryEntryPointCommandInteraction,
|
||||
APIPrimaryEntryPointCommandInteractionData,
|
||||
} from './_applicationCommands/entryPoint.ts';
|
||||
import type { APIBaseInteraction } from './base.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
|
||||
export * from './_applicationCommands/chatInput.ts';
|
||||
export type * from './_applicationCommands/contextMenu.ts';
|
||||
export * from './_applicationCommands/permissions.ts';
|
||||
export type * from './_applicationCommands/entryPoint.ts';
|
||||
export type * from './_applicationCommands/internals.ts';
|
||||
|
||||
/**
|
||||
* @see {@link 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
|
||||
*
|
||||
* @deprecated Use {@link APIApplicationCommand.contexts} instead
|
||||
*/
|
||||
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 {@link APIApplicationCommand.dm_permission} and/or {@link APIApplicationCommand.default_member_permissions} instead
|
||||
*/
|
||||
default_permission?: boolean;
|
||||
/**
|
||||
* Indicates whether the command is age-restricted
|
||||
*
|
||||
* @defaultValue `false`
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
/**
|
||||
* Installation context(s) where the command is available, only for globally-scoped commands
|
||||
*
|
||||
* @defaultValue `[ApplicationIntegrationType.GuildInstall]`
|
||||
*/
|
||||
integration_types?: ApplicationIntegrationType[];
|
||||
/**
|
||||
* Interaction context(s) where the command can be used, only for globally-scoped commands
|
||||
*
|
||||
* @defaultValue `[InteractionContextType.Guild, InteractionContextType.BotDM, InteractionContextType.PrivateChannel]`
|
||||
*/
|
||||
contexts?: InteractionContextType[] | null;
|
||||
/**
|
||||
* Autoincrementing version identifier updated during substantial record changes
|
||||
*/
|
||||
version: Snowflake;
|
||||
/**
|
||||
* Determines whether the interaction is handled by the app's interactions handler or by Discord
|
||||
*
|
||||
* @remarks
|
||||
* This is only available for {@link ApplicationCommandType.PrimaryEntryPoint} commands
|
||||
*/
|
||||
handler?: EntryPointCommandHandlerType;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-types}
|
||||
*/
|
||||
export enum ApplicationCommandType {
|
||||
/**
|
||||
* Slash commands; a text-based command that shows up when a user types `/`
|
||||
*/
|
||||
ChatInput = 1,
|
||||
/**
|
||||
* A UI-based command that shows up when you right click or tap on a user
|
||||
*/
|
||||
User,
|
||||
/**
|
||||
* A UI-based command that shows up when you right click or tap on a message
|
||||
*/
|
||||
Message,
|
||||
/**
|
||||
* A UI-based command that represents the primary way to invoke an app's Activity
|
||||
*/
|
||||
PrimaryEntryPoint,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/application#application-object-application-integration-types}
|
||||
*/
|
||||
export enum ApplicationIntegrationType {
|
||||
/**
|
||||
* App is installable to servers
|
||||
*/
|
||||
GuildInstall,
|
||||
/**
|
||||
* App is installable to users
|
||||
*/
|
||||
UserInstall,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-context-types}
|
||||
*/
|
||||
export enum InteractionContextType {
|
||||
/**
|
||||
* Interaction can be used within servers
|
||||
*/
|
||||
Guild,
|
||||
/**
|
||||
* Interaction can be used within DMs with the app's bot user
|
||||
*/
|
||||
BotDM,
|
||||
/**
|
||||
* Interaction can be used within Group DMs and DMs other than the app's bot user
|
||||
*/
|
||||
PrivateChannel,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object-entry-point-command-handler-types}
|
||||
*/
|
||||
export enum EntryPointCommandHandlerType {
|
||||
/**
|
||||
* The app handles the interaction using an interaction token
|
||||
*/
|
||||
AppHandler = 1,
|
||||
/**
|
||||
* Discord handles the interaction by launching an Activity and sending a follow-up message without coordinating with
|
||||
* the app
|
||||
*/
|
||||
DiscordLaunchActivity,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-data}
|
||||
*/
|
||||
export type APIApplicationCommandInteractionData =
|
||||
| APIChatInputApplicationCommandInteractionData
|
||||
| APIContextMenuInteractionData
|
||||
| APIPrimaryEntryPointCommandInteractionData;
|
||||
|
||||
/**
|
||||
* @see {@link 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>,
|
||||
'app_permissions' | 'channel_id' | 'channel' | 'data'
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIApplicationCommandInteraction =
|
||||
| APIChatInputApplicationCommandInteraction
|
||||
| APIContextMenuInteraction
|
||||
| APIPrimaryEntryPointCommandInteraction;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIApplicationCommandDMInteraction =
|
||||
| APIChatInputApplicationCommandDMInteraction
|
||||
| APIContextMenuDMInteraction
|
||||
| APIPrimaryEntryPointCommandDMInteraction;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIApplicationCommandGuildInteraction =
|
||||
| APIChatInputApplicationCommandGuildInteraction
|
||||
| APIContextMenuGuildInteraction
|
||||
| APIPrimaryEntryPointCommandGuildInteraction;
|
||||
33
deno/payloads/v10/_interactions/autocomplete.ts
generated
Normal file
33
deno/payloads/v10/_interactions/autocomplete.ts
generated
Normal file
@@ -0,0 +1,33 @@
|
||||
import type {
|
||||
APIBaseInteraction,
|
||||
APIAutocompleteApplicationCommandInteractionData,
|
||||
APIDMInteractionWrapper,
|
||||
APIGuildInteractionWrapper,
|
||||
InteractionType,
|
||||
} from '../mod.ts';
|
||||
|
||||
export type APIApplicationCommandAutocompleteInteraction = APIBaseInteraction<
|
||||
InteractionType.ApplicationCommandAutocomplete,
|
||||
APIAutocompleteApplicationCommandInteractionData
|
||||
> &
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<
|
||||
InteractionType.ApplicationCommandAutocomplete,
|
||||
Required<Pick<APIAutocompleteApplicationCommandInteractionData, 'options'>>
|
||||
>,
|
||||
'data'
|
||||
>
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIApplicationCommandAutocompleteDMInteraction =
|
||||
APIDMInteractionWrapper<APIApplicationCommandAutocompleteInteraction>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIApplicationCommandAutocompleteGuildInteraction =
|
||||
APIGuildInteractionWrapper<APIApplicationCommandAutocompleteInteraction>;
|
||||
284
deno/payloads/v10/_interactions/base.ts
generated
Normal file
284
deno/payloads/v10/_interactions/base.ts
generated
Normal file
@@ -0,0 +1,284 @@
|
||||
import type { Permissions, Snowflake } from '../../../globals.ts';
|
||||
import type { APIRole, ApplicationIntegrationType, InteractionContextType, Locale } from '../../../v10.ts';
|
||||
import type { APIChannel, APIPartialChannel, APIThreadChannel, ChannelType, ThreadChannelType } from '../channel.ts';
|
||||
import type {
|
||||
APIBaseGuildMember,
|
||||
APIFlaggedGuildMember,
|
||||
APIGuildMember,
|
||||
APIGuildMemberAvatar,
|
||||
APIGuildMemberJoined,
|
||||
APIPartialInteractionGuild,
|
||||
} from '../guild.ts';
|
||||
import type { APIAttachment, APIMessage } from '../message.ts';
|
||||
import type { APIEntitlement } from '../monetization.ts';
|
||||
import type { APIUser } from '../user.ts';
|
||||
import type { InteractionType } from './responses.ts';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#message-interaction-metadata-object}
|
||||
*/
|
||||
export type APIMessageInteractionMetadata =
|
||||
| APIApplicationCommandInteractionMetadata
|
||||
| APIMessageComponentInteractionMetadata
|
||||
| APIModalSubmitInteractionMetadata;
|
||||
|
||||
export interface APIBaseInteractionMetadata<Type extends InteractionType> {
|
||||
/**
|
||||
* ID of the interaction
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Type of interaction
|
||||
*/
|
||||
type: Type;
|
||||
/**
|
||||
* User who triggered the interaction
|
||||
*/
|
||||
user: APIUser;
|
||||
/**
|
||||
* IDs for installation context(s) related to an interaction
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* ID of the original response message, present only on follow-up messages
|
||||
*/
|
||||
original_response_message_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-application-command-interaction-metadata-structure}
|
||||
*/
|
||||
export interface APIApplicationCommandInteractionMetadata extends APIBaseInteractionMetadata<InteractionType.ApplicationCommand> {
|
||||
/**
|
||||
* The user the command was run on, present only on user commands interactions
|
||||
*/
|
||||
target_user?: APIUser;
|
||||
/**
|
||||
* The ID of the message the command was run on, present only on message command interactions.
|
||||
* The original response message will also have `message_reference` and `referenced_message` pointing to this message.
|
||||
*/
|
||||
target_message_id?: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-message-command-interaction-metadata-structure}
|
||||
*/
|
||||
export interface APIMessageComponentInteractionMetadata extends APIBaseInteractionMetadata<InteractionType.MessageComponent> {
|
||||
/**
|
||||
* ID of the message that contained the interactive component
|
||||
*/
|
||||
interacted_message_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/message#message-interaction-metadata-object-modal-submit-interaction-metadata-structure}
|
||||
*/
|
||||
export interface APIModalSubmitInteractionMetadata extends APIBaseInteractionMetadata<InteractionType.ModalSubmit> {
|
||||
/**
|
||||
* Metadata for the interaction that was used to open the modal
|
||||
*/
|
||||
triggering_interaction_metadata: APIApplicationCommandInteractionMetadata | APIMessageComponentInteractionMetadata;
|
||||
}
|
||||
|
||||
export type PartialAPIMessageInteractionGuildMember = Pick<
|
||||
APIGuildMember,
|
||||
| 'avatar'
|
||||
| 'communication_disabled_until'
|
||||
| 'deaf'
|
||||
| 'joined_at'
|
||||
| 'mute'
|
||||
| 'nick'
|
||||
| 'pending'
|
||||
| 'premium_since'
|
||||
| 'roles'
|
||||
>;
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIInteractionGuildMember extends APIGuildMember {
|
||||
permissions: Permissions;
|
||||
user: APIUser;
|
||||
}
|
||||
|
||||
// INTERACTIONS RECEIVED
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
/**
|
||||
* Guild that the interaction was sent from
|
||||
*/
|
||||
guild?: APIPartialInteractionGuild;
|
||||
/**
|
||||
* Guild that the interaction was sent from
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* The channel it was sent from
|
||||
*/
|
||||
channel?: Partial<APIChannel> & Pick<APIChannel, 'id' | 'type'>;
|
||||
/**
|
||||
* The id of the channel it was sent from
|
||||
*
|
||||
* @deprecated Use {@link APIBaseInteraction.channel} instead
|
||||
*/
|
||||
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: Locale;
|
||||
/**
|
||||
* The guild's preferred locale, if invoked in a guild
|
||||
*/
|
||||
guild_locale?: Locale;
|
||||
/**
|
||||
* For monetized apps, any entitlements for the invoking user, representing access to premium SKUs
|
||||
*/
|
||||
entitlements: APIEntitlement[];
|
||||
/**
|
||||
* Mapping of installation contexts that the interaction was authorized for to related user or guild IDs.
|
||||
*/
|
||||
authorizing_integration_owners: APIAuthorizingIntegrationOwnersMap;
|
||||
/**
|
||||
* Context where the interaction was triggered from
|
||||
*/
|
||||
context?: InteractionContextType;
|
||||
/**
|
||||
* Attachment size limit in bytes
|
||||
*/
|
||||
attachment_size_limit: number;
|
||||
}
|
||||
|
||||
export type APIAuthorizingIntegrationOwnersMap = {
|
||||
[key in ApplicationIntegrationType]?: Snowflake;
|
||||
};
|
||||
|
||||
export type APIDMInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'guild_id' | 'member'
|
||||
> &
|
||||
Required<Pick<Original, 'user'>>;
|
||||
|
||||
export type APIGuildInteractionWrapper<Original extends APIBaseInteraction<InteractionType, unknown>> = Omit<
|
||||
Original,
|
||||
'user'
|
||||
> &
|
||||
Required<Pick<Original, 'guild_id' | 'member'>>;
|
||||
|
||||
export interface APIInteractionDataResolvedChannelBase<T extends ChannelType> extends Required<APIPartialChannel> {
|
||||
type: T;
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object}
|
||||
*/
|
||||
export type APIInteractionDataResolvedChannel =
|
||||
| APIInteractionDataResolvedChannelBase<Exclude<ChannelType, ThreadChannelType>>
|
||||
| (APIInteractionDataResolvedChannelBase<ThreadChannelType> &
|
||||
Pick<APIThreadChannel, 'parent_id' | 'thread_metadata'>);
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild#guild-member-object}
|
||||
*/
|
||||
export interface APIInteractionDataResolvedGuildMember
|
||||
extends APIBaseGuildMember, APIFlaggedGuildMember, APIGuildMemberAvatar, APIGuildMemberJoined {
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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 = Pick<APIInteractionDataResolved, 'members'> &
|
||||
Required<Pick<APIInteractionDataResolved, 'users'>>;
|
||||
|
||||
/**
|
||||
* @deprecated Renamed to `APIUserInteractionDataResolved`
|
||||
*/
|
||||
export type APIUserApplicationCommandInteractionDataResolved = APIUserInteractionDataResolved;
|
||||
92
deno/payloads/v10/_interactions/messageComponents.ts
generated
Normal file
92
deno/payloads/v10/_interactions/messageComponents.ts
generated
Normal file
@@ -0,0 +1,92 @@
|
||||
import type { Snowflake } from '../../../globals.ts';
|
||||
import type { APIBaseInteraction, InteractionType } from '../interactions.ts';
|
||||
import type { ComponentType } from '../message.ts';
|
||||
import type {
|
||||
APIDMInteractionWrapper,
|
||||
APIGuildInteractionWrapper,
|
||||
APIInteractionDataResolved,
|
||||
APIUserInteractionDataResolved,
|
||||
} from './base.ts';
|
||||
|
||||
export type APIMessageComponentInteraction = APIBaseInteraction<
|
||||
InteractionType.MessageComponent,
|
||||
APIMessageComponentInteractionData
|
||||
> &
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageComponentInteractionData>,
|
||||
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
export type APIMessageComponentButtonInteraction = APIBaseInteraction<
|
||||
InteractionType.MessageComponent,
|
||||
APIMessageButtonInteractionData
|
||||
> &
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageButtonInteractionData>,
|
||||
'app_permissions' | 'channel_id' | 'channel' | 'data' | 'message'
|
||||
>
|
||||
>;
|
||||
|
||||
export type APIMessageComponentSelectMenuInteraction = APIBaseInteraction<
|
||||
InteractionType.MessageComponent,
|
||||
APIMessageSelectMenuInteractionData
|
||||
> &
|
||||
Required<
|
||||
Pick<
|
||||
APIBaseInteraction<InteractionType.MessageComponent, APIMessageSelectMenuInteractionData>,
|
||||
'app_permissions' | 'channel_id' | 'channel' | 'data' | '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, 'members' | 'roles' | 'users'>;
|
||||
}
|
||||
|
||||
export interface APIMessageChannelSelectInteractionData extends APIMessageComponentBaseInteractionData<ComponentType.ChannelSelect> {
|
||||
values: Snowflake[];
|
||||
resolved: Required<Pick<APIInteractionDataResolved, 'channels'>>;
|
||||
}
|
||||
|
||||
export type APIMessageSelectMenuInteractionData =
|
||||
| APIMessageChannelSelectInteractionData
|
||||
| APIMessageMentionableSelectInteractionData
|
||||
| APIMessageRoleSelectInteractionData
|
||||
| APIMessageStringSelectInteractionData
|
||||
| APIMessageUserSelectInteractionData;
|
||||
|
||||
export type APIMessageComponentDMInteraction = APIDMInteractionWrapper<APIMessageComponentInteraction>;
|
||||
|
||||
export type APIMessageComponentGuildInteraction = APIGuildInteractionWrapper<APIMessageComponentInteraction>;
|
||||
116
deno/payloads/v10/_interactions/modalSubmit.ts
generated
Normal file
116
deno/payloads/v10/_interactions/modalSubmit.ts
generated
Normal file
@@ -0,0 +1,116 @@
|
||||
import type {
|
||||
APIBaseInteraction,
|
||||
APIDMInteractionWrapper,
|
||||
APIGuildInteractionWrapper,
|
||||
APIInteractionDataResolved,
|
||||
ComponentType,
|
||||
InteractionType,
|
||||
} from '../mod.ts';
|
||||
import type { APIBaseComponent } from '../message.ts';
|
||||
|
||||
export interface APIBaseModalSubmitComponent<T extends ComponentType> extends APIBaseComponent<T> {
|
||||
custom_id: string;
|
||||
}
|
||||
|
||||
export interface APIModalSubmitTextInputComponent extends APIBaseModalSubmitComponent<ComponentType.TextInput> {
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface APIModalSubmitStringSelectComponent extends APIBaseModalSubmitComponent<ComponentType.StringSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitUserSelectComponent extends APIBaseModalSubmitComponent<ComponentType.UserSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitRoleSelectComponent extends APIBaseModalSubmitComponent<ComponentType.RoleSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitMentionableSelectComponent extends APIBaseModalSubmitComponent<ComponentType.MentionableSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitChannelSelectComponent extends APIBaseModalSubmitComponent<ComponentType.ChannelSelect> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitFileUploadComponent extends APIBaseModalSubmitComponent<ComponentType.FileUpload> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitRadioGroupComponent extends APIBaseModalSubmitComponent<ComponentType.RadioGroup> {
|
||||
value: string | null;
|
||||
}
|
||||
|
||||
export interface APIModalSubmitCheckboxGroupComponent extends APIBaseModalSubmitComponent<ComponentType.CheckboxGroup> {
|
||||
values: string[];
|
||||
}
|
||||
|
||||
export interface APIModalSubmitCheckboxComponent extends APIBaseModalSubmitComponent<ComponentType.Checkbox> {
|
||||
value: boolean;
|
||||
}
|
||||
|
||||
export type ModalSubmitComponent =
|
||||
| APIModalSubmitChannelSelectComponent
|
||||
| APIModalSubmitCheckboxComponent
|
||||
| APIModalSubmitCheckboxGroupComponent
|
||||
| APIModalSubmitFileUploadComponent
|
||||
| APIModalSubmitMentionableSelectComponent
|
||||
| APIModalSubmitRadioGroupComponent
|
||||
| APIModalSubmitRoleSelectComponent
|
||||
| APIModalSubmitStringSelectComponent
|
||||
| APIModalSubmitTextInputComponent
|
||||
| APIModalSubmitUserSelectComponent;
|
||||
|
||||
export interface ModalSubmitActionRowComponent extends APIBaseComponent<ComponentType.ActionRow> {
|
||||
components: APIModalSubmitTextInputComponent[];
|
||||
}
|
||||
|
||||
export interface ModalSubmitTextDisplayComponent extends APIBaseComponent<ComponentType.TextDisplay> {}
|
||||
|
||||
export interface ModalSubmitLabelComponent extends APIBaseComponent<ComponentType.Label> {
|
||||
component: ModalSubmitComponent;
|
||||
}
|
||||
|
||||
export type APIModalSubmissionComponent =
|
||||
| ModalSubmitActionRowComponent
|
||||
| ModalSubmitLabelComponent
|
||||
| ModalSubmitTextDisplayComponent;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-modal-submit-data-structure}
|
||||
*/
|
||||
export interface APIModalSubmission {
|
||||
/**
|
||||
* Data for users, members, channels, and roles in the modal's auto-populated select menus
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure}
|
||||
*/
|
||||
resolved?: APIInteractionDataResolved;
|
||||
/**
|
||||
* A developer-defined identifier for the component, max 100 characters
|
||||
*/
|
||||
custom_id: string;
|
||||
/**
|
||||
* A list of child components
|
||||
*/
|
||||
components: APIModalSubmissionComponent[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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'>>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIModalSubmitDMInteraction = APIDMInteractionWrapper<APIModalSubmitInteraction>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object}
|
||||
*/
|
||||
export type APIModalSubmitGuildInteraction = APIGuildInteractionWrapper<APIModalSubmitInteraction>;
|
||||
4
deno/payloads/v10/_interactions/ping.ts
generated
Normal file
4
deno/payloads/v10/_interactions/ping.ts
generated
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'>;
|
||||
157
deno/payloads/v10/_interactions/responses.ts
generated
Normal file
157
deno/payloads/v10/_interactions/responses.ts
generated
Normal file
@@ -0,0 +1,157 @@
|
||||
import type { RESTPostAPIWebhookWithTokenJSONBody } from '../../../v10.ts';
|
||||
import type {
|
||||
APIActionRowComponent,
|
||||
APIComponentInModalActionRow,
|
||||
APILabelComponent,
|
||||
APITextDisplayComponent,
|
||||
} from '../message.ts';
|
||||
import type { APIApplicationCommandOptionChoice } from './applicationCommands.ts';
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-object-interaction-type}
|
||||
*/
|
||||
export enum InteractionType {
|
||||
Ping = 1,
|
||||
ApplicationCommand,
|
||||
MessageComponent,
|
||||
ApplicationCommandAutocomplete,
|
||||
ModalSubmit,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object}
|
||||
*/
|
||||
export type APIInteractionResponse =
|
||||
| APIApplicationCommandAutocompleteResponse
|
||||
| APIInteractionResponseChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredChannelMessageWithSource
|
||||
| APIInteractionResponseDeferredMessageUpdate
|
||||
| APIInteractionResponseLaunchActivity
|
||||
| APIInteractionResponsePong
|
||||
| APIInteractionResponseUpdateMessage
|
||||
| APIModalInteractionResponse
|
||||
| APIPremiumRequiredInteractionResponse;
|
||||
|
||||
export interface APIInteractionResponsePong {
|
||||
type: InteractionResponseType.Pong;
|
||||
}
|
||||
|
||||
export interface APIApplicationCommandAutocompleteResponse {
|
||||
type: InteractionResponseType.ApplicationCommandAutocompleteResult;
|
||||
data: APICommandAutocompleteInteractionResponseCallbackData;
|
||||
}
|
||||
|
||||
export interface APIModalInteractionResponse {
|
||||
type: InteractionResponseType.Modal;
|
||||
data: APIModalInteractionResponseCallbackData;
|
||||
}
|
||||
|
||||
export interface APIPremiumRequiredInteractionResponse {
|
||||
type: InteractionResponseType.PremiumRequired;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
export interface APIInteractionResponseLaunchActivity {
|
||||
type: InteractionResponseType.LaunchActivity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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,
|
||||
/**
|
||||
* Respond to an interaction with an upgrade button, only available for apps with monetization enabled
|
||||
*
|
||||
* @deprecated Send a button with Premium type instead.
|
||||
* {@link https://discord.com/developers/docs/change-log#premium-apps-new-premium-button-style-deep-linking-url-schemes | Learn more here}
|
||||
*/
|
||||
PremiumRequired,
|
||||
|
||||
/**
|
||||
* Launch the Activity associated with the app.
|
||||
*
|
||||
* @remarks
|
||||
* Only available for apps with Activities enabled
|
||||
*/
|
||||
LaunchActivity = 12,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/interactions/receiving-and-responding#interaction-response-object-interaction-callback-data-structure}
|
||||
*/
|
||||
export type APIInteractionResponseCallbackData = Omit<RESTPostAPIWebhookWithTokenJSONBody, 'avatar_url' | 'username'>;
|
||||
|
||||
export interface APICommandAutocompleteInteractionResponseCallbackData {
|
||||
choices?: APIApplicationCommandOptionChoice[];
|
||||
}
|
||||
|
||||
export type APIModalInteractionResponseCallbackComponent =
|
||||
| APIActionRowComponent<APIComponentInModalActionRow>
|
||||
| APILabelComponent
|
||||
| APITextDisplayComponent;
|
||||
|
||||
/**
|
||||
* @see {@link 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
|
||||
*
|
||||
* @remarks Using action rows inside modals is deprecated.
|
||||
*/
|
||||
components: APIModalInteractionResponseCallbackComponent[];
|
||||
}
|
||||
398
deno/payloads/v10/application.ts
generated
Normal file
398
deno/payloads/v10/application.ts
generated
Normal file
@@ -0,0 +1,398 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/application
|
||||
*/
|
||||
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { LocalizationMap } from '../common.ts';
|
||||
import type { APIPartialGuild } from './guild.ts';
|
||||
import type { ApplicationIntegrationType } from './interactions.ts';
|
||||
import type { OAuth2Scopes } from './oauth2.ts';
|
||||
import type { APITeam } from './teams.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
import type { ApplicationWebhookEventType } from './webhook.ts';
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
/**
|
||||
* Partial user object for the bot user associated with the application
|
||||
*/
|
||||
bot?: APIUser;
|
||||
/**
|
||||
* 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 {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
owner?: APIUser;
|
||||
/**
|
||||
* An empty string
|
||||
*
|
||||
* @deprecated This field will be removed in v11
|
||||
* @unstable This field is no longer documented by Discord and will be removed in v11
|
||||
*/
|
||||
summary: '';
|
||||
/**
|
||||
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/game-sdk/applications#getticket}
|
||||
*/
|
||||
verify_key: string;
|
||||
/**
|
||||
* The team this application belongs to
|
||||
*
|
||||
* @see {@link 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;
|
||||
/**
|
||||
* A partial object of the associated guild
|
||||
*/
|
||||
guild?: APIPartialGuild;
|
||||
/**
|
||||
* 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 {@link https://discord.com/developers/docs/resources/application#application-object-application-flags}
|
||||
*/
|
||||
flags: ApplicationFlags;
|
||||
/**
|
||||
* Approximate count of guilds the application has been added to
|
||||
*/
|
||||
approximate_guild_count?: number;
|
||||
/**
|
||||
* Approximate count of users that have installed the app (authorized with `application.commands` as a scope)
|
||||
*/
|
||||
approximate_user_install_count?: number;
|
||||
/**
|
||||
* Approximate count of users that have OAuth2 authorizations for the app
|
||||
*/
|
||||
approximate_user_authorization_count?: number;
|
||||
/**
|
||||
* Array of redirect URIs for the application
|
||||
*/
|
||||
redirect_uris?: string[];
|
||||
/**
|
||||
* The interactions endpoint URL for the application
|
||||
*/
|
||||
interactions_endpoint_url?: string | null;
|
||||
/**
|
||||
* 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 | null;
|
||||
/**
|
||||
* Up to 5 tags of max 20 characters each 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;
|
||||
/**
|
||||
* Default scopes and permissions for each supported installation context. Value for each key is an integration type configuration object
|
||||
*/
|
||||
integration_types_config?: APIApplicationIntegrationTypesConfigMap;
|
||||
/**
|
||||
* The application's default custom authorization link, if enabled
|
||||
*/
|
||||
custom_install_url?: string;
|
||||
/**
|
||||
* Event webhook URL for the app to receive webhook events
|
||||
*/
|
||||
event_webhooks_url?: string | null;
|
||||
/**
|
||||
* If webhook events are enabled for the app
|
||||
*/
|
||||
event_webhooks_status?: ApplicationWebhookEventStatus;
|
||||
/**
|
||||
* List of webhook event types the app subscribes to
|
||||
*/
|
||||
event_webhooks_types?: ApplicationWebhookEventType[];
|
||||
}
|
||||
|
||||
export interface APIApplicationInstallParams {
|
||||
scopes: OAuth2Scopes[];
|
||||
permissions: Permissions;
|
||||
}
|
||||
|
||||
export interface APIApplicationIntegrationTypeConfiguration {
|
||||
oauth2_install_params?: APIApplicationInstallParams;
|
||||
}
|
||||
|
||||
export type APIApplicationIntegrationTypesConfigMap = {
|
||||
[key in ApplicationIntegrationType]?: APIApplicationIntegrationTypeConfiguration;
|
||||
};
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/application#application-object-application-flags}
|
||||
*/
|
||||
export enum ApplicationFlags {
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedReleased = 1 << 1,
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ManagedEmoji = 1 << 2,
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedIAP = 1 << 3,
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
GroupDMCreate = 1 << 4,
|
||||
/**
|
||||
* Indicates if an app uses the Auto Moderation API
|
||||
*/
|
||||
ApplicationAutoModerationRuleCreateBadge = 1 << 6,
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
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 {@link https://discord.com/developers/docs/topics/gateway#list-of-intents | under `GUILD_MEMBERS`}
|
||||
*/
|
||||
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 {@link https://discord.com/developers/docs/topics/gateway#list-of-intents | under `GUILD_MEMBERS`}
|
||||
*/
|
||||
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 {@link https://support-dev.discord.com/hc/articles/6207308062871 | message content}
|
||||
*/
|
||||
GatewayMessageContent = 1 << 18,
|
||||
/**
|
||||
* Intent required for bots in under 100 servers to receive {@link https://support-dev.discord.com/hc/articles/6207308062871 | message content},
|
||||
* found in Bot Settings
|
||||
*/
|
||||
GatewayMessageContentLimited = 1 << 19,
|
||||
/**
|
||||
* @unstable This application flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
EmbeddedFirstParty = 1 << 20,
|
||||
/**
|
||||
* Indicates if an app has registered global {@link https://discord.com/developers/docs/interactions/application-commands | application commands}
|
||||
*/
|
||||
ApplicationCommandBadge = 1 << 23,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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; 1-50 characters)
|
||||
*/
|
||||
key: string;
|
||||
/**
|
||||
* Name of the metadata field (1-100 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Translations of the name
|
||||
*/
|
||||
name_localizations?: LocalizationMap;
|
||||
/**
|
||||
* Description of the metadata field (1-200 characters)
|
||||
*/
|
||||
description: string;
|
||||
/**
|
||||
* Translations of the description
|
||||
*/
|
||||
description_localizations?: LocalizationMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-location-kind-enum}
|
||||
*/
|
||||
export enum ActivityLocationKind {
|
||||
/**
|
||||
* Location is a guild channel
|
||||
*/
|
||||
GuildChannel = 'gc',
|
||||
/**
|
||||
* Location is a private channel, such as a DM or GDM
|
||||
*/
|
||||
PrivateChannel = 'pc',
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-location-object}
|
||||
*/
|
||||
export interface APIActivityLocation {
|
||||
/**
|
||||
* Unique identifier for the location
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Enum describing kind of location
|
||||
*/
|
||||
kind: ActivityLocationKind;
|
||||
/**
|
||||
* ID of the channel
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id?: Snowflake | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/application#get-application-activity-instance-activity-instance-object}
|
||||
*/
|
||||
export interface APIActivityInstance {
|
||||
/**
|
||||
* Application ID
|
||||
*/
|
||||
application_id: Snowflake;
|
||||
/**
|
||||
* Activity instance ID
|
||||
*/
|
||||
instance_id: string;
|
||||
/**
|
||||
* Unique identifier for the launch
|
||||
*/
|
||||
launch_id: Snowflake;
|
||||
/**
|
||||
* Location the instance is running in
|
||||
*/
|
||||
location: APIActivityLocation;
|
||||
/**
|
||||
* IDs of the users currently connected to the instance
|
||||
*/
|
||||
users: Snowflake[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/application#application-object-application-event-webhook-status}
|
||||
*/
|
||||
export enum ApplicationWebhookEventStatus {
|
||||
/**
|
||||
* Webhook events are disabled by developer
|
||||
*/
|
||||
Disabled = 1,
|
||||
/**
|
||||
* Webhook events are enabled by developer
|
||||
*/
|
||||
Enabled,
|
||||
/**
|
||||
* Webhook events are disabled by Discord, usually due to inactivity
|
||||
*/
|
||||
DisabledByDiscord,
|
||||
}
|
||||
965
deno/payloads/v10/auditLog.ts
generated
Normal file
965
deno/payloads/v10/auditLog.ts
generated
Normal file
@@ -0,0 +1,965 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/audit-log
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type {
|
||||
APIAutoModerationAction,
|
||||
APIAutoModerationRule,
|
||||
APIAutoModerationRuleTriggerMetadata,
|
||||
AutoModerationRuleEventType,
|
||||
AutoModerationRuleTriggerType,
|
||||
} from './autoModeration.ts';
|
||||
import type {
|
||||
APIChannel,
|
||||
APIGuildForumDefaultReactionEmoji,
|
||||
APIGuildForumTag,
|
||||
APIOverwrite,
|
||||
VideoQualityMode,
|
||||
} from './channel.ts';
|
||||
import type {
|
||||
APIGuildIntegration,
|
||||
APIGuildIntegrationType,
|
||||
GuildDefaultMessageNotifications,
|
||||
GuildExplicitContentFilter,
|
||||
GuildMFALevel,
|
||||
GuildSystemChannelFlags,
|
||||
GuildVerificationLevel,
|
||||
IntegrationExpireBehavior,
|
||||
} from './guild.ts';
|
||||
import type {
|
||||
APIGuildScheduledEvent,
|
||||
APIGuildScheduledEventRecurrenceRule,
|
||||
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';
|
||||
|
||||
/**
|
||||
* @see {@link 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 {@link https://discord.com/developers/docs/interactions/application-commands#application-command-object}
|
||||
*/
|
||||
application_commands: APIApplicationCommand[];
|
||||
/**
|
||||
* Webhooks found in the audit log
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/webhook#webhook-object}
|
||||
*/
|
||||
webhooks: APIWebhook[];
|
||||
/**
|
||||
* Users found in the audit log
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
users: APIUser[];
|
||||
/**
|
||||
* Audit log entries
|
||||
*
|
||||
* @see {@link 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 {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object}
|
||||
*/
|
||||
auto_moderation_rules: APIAutoModerationRule[];
|
||||
/**
|
||||
* Partial integration objects
|
||||
*
|
||||
* @see {@link 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 {@link https://discord.com/developers/docs/resources/channel#channel-object}
|
||||
*/
|
||||
threads: APIChannel[];
|
||||
/**
|
||||
* The guild scheduled events in the audit log
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object}
|
||||
*/
|
||||
guild_scheduled_events: APIGuildScheduledEvent[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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 {@link 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 {@link 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 {@link 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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,
|
||||
|
||||
SoundboardSoundCreate = 130,
|
||||
SoundboardSoundUpdate,
|
||||
SoundboardSoundDelete,
|
||||
|
||||
AutoModerationRuleCreate = 140,
|
||||
AutoModerationRuleUpdate,
|
||||
AutoModerationRuleDelete,
|
||||
AutoModerationBlockMessage,
|
||||
AutoModerationFlagToChannel,
|
||||
AutoModerationUserCommunicationDisabled,
|
||||
AutoModerationQuarantineUser,
|
||||
|
||||
CreatorMonetizationRequestCreated = 150,
|
||||
CreatorMonetizationTermsAccepted,
|
||||
|
||||
OnboardingPromptCreate = 163,
|
||||
OnboardingPromptUpdate,
|
||||
OnboardingPromptDelete,
|
||||
OnboardingCreate,
|
||||
OnboardingUpdate,
|
||||
|
||||
HomeSettingsCreate = 190,
|
||||
HomeSettingsUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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_QUARANTINE_USER
|
||||
*/
|
||||
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_QUARANTINE_USER
|
||||
*/
|
||||
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
|
||||
* - AUTO_MODERATION_QUARANTINE_USER
|
||||
*/
|
||||
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;
|
||||
|
||||
/**
|
||||
* Type of integration which performed the action
|
||||
*
|
||||
* Present from:
|
||||
* - MEMBER_KICK
|
||||
* - MEMBER_ROLE_UPDATE
|
||||
*/
|
||||
integration_type?: APIGuildIntegrationType;
|
||||
/**
|
||||
* ID of the app whose permissions were targeted
|
||||
*
|
||||
* Present from:
|
||||
* - APPLICATION_COMMAND_PERMISSION_UPDATE
|
||||
*/
|
||||
application_id?: Snowflake;
|
||||
}
|
||||
|
||||
export enum AuditLogOptionsType {
|
||||
Role = '0',
|
||||
Member = '1',
|
||||
}
|
||||
|
||||
export type AuditLogRuleTriggerType = `${AutoModerationRuleTriggerType}`;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/audit-log#audit-log-change-object-audit-log-change-structure}
|
||||
*/
|
||||
export type APIAuditLogChange =
|
||||
| APIAuditLogChangeKey$Add
|
||||
| APIAuditLogChangeKey$Remove
|
||||
| APIAuditLogChangeKeyActions
|
||||
| APIAuditLogChangeKeyAFKChannelId
|
||||
| APIAuditLogChangeKeyAFKTimeout
|
||||
| APIAuditLogChangeKeyAllow
|
||||
| APIAuditLogChangeKeyApplicationId
|
||||
| APIAuditLogChangeKeyArchived
|
||||
| APIAuditLogChangeKeyAsset
|
||||
| APIAuditLogChangeKeyAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyAvailable
|
||||
| APIAuditLogChangeKeyAvailableTags
|
||||
| APIAuditLogChangeKeyAvatarHash
|
||||
| APIAuditLogChangeKeyBannerHash
|
||||
| APIAuditLogChangeKeyBitrate
|
||||
| APIAuditLogChangeKeyChannelId
|
||||
| APIAuditLogChangeKeyCode
|
||||
| APIAuditLogChangeKeyColor
|
||||
| APIAuditLogChangeKeyCommunicationDisabledUntil
|
||||
| APIAuditLogChangeKeyDeaf
|
||||
| APIAuditLogChangeKeyDefaultAutoArchiveDuration
|
||||
| APIAuditLogChangeKeyDefaultMessageNotifications
|
||||
| APIAuditLogChangeKeyDefaultReactionEmoji
|
||||
| APIAuditLogChangeKeyDefaultThreadRateLimitPerUser
|
||||
| APIAuditLogChangeKeyDeny
|
||||
| APIAuditLogChangeKeyDescription
|
||||
| APIAuditLogChangeKeyDiscoverySplashHash
|
||||
| APIAuditLogChangeKeyEmojiId
|
||||
| APIAuditLogChangeKeyEmojiName
|
||||
| APIAuditLogChangeKeyEnabled
|
||||
| APIAuditLogChangeKeyEnableEmoticons
|
||||
| APIAuditLogChangeKeyEntityType
|
||||
| APIAuditLogChangeKeyEventType
|
||||
| APIAuditLogChangeKeyExemptChannels
|
||||
| APIAuditLogChangeKeyExemptRoles
|
||||
| APIAuditLogChangeKeyExpireBehavior
|
||||
| APIAuditLogChangeKeyExpireGracePeriod
|
||||
| APIAuditLogChangeKeyExplicitContentFilter
|
||||
| APIAuditLogChangeKeyFlags
|
||||
| APIAuditLogChangeKeyFormatType
|
||||
| APIAuditLogChangeKeyGuildId
|
||||
| APIAuditLogChangeKeyHoist
|
||||
| APIAuditLogChangeKeyIconHash
|
||||
| APIAuditLogChangeKeyId
|
||||
| APIAuditLogChangeKeyImageHash
|
||||
| APIAuditLogChangeKeyInviterId
|
||||
| APIAuditLogChangeKeyLocation
|
||||
| APIAuditLogChangeKeyLocked
|
||||
| APIAuditLogChangeKeyMaxAge
|
||||
| APIAuditLogChangeKeyMaxUses
|
||||
| APIAuditLogChangeKeyMentionable
|
||||
| APIAuditLogChangeKeyMFALevel
|
||||
| APIAuditLogChangeKeyMute
|
||||
| APIAuditLogChangeKeyName
|
||||
| APIAuditLogChangeKeyNick
|
||||
| APIAuditLogChangeKeyNSFW
|
||||
| APIAuditLogChangeKeyOwnerId
|
||||
| APIAuditLogChangeKeyPermissionOverwrites
|
||||
| APIAuditLogChangeKeyPermissions
|
||||
| APIAuditLogChangeKeyPosition
|
||||
| APIAuditLogChangeKeyPreferredLocale
|
||||
| APIAuditLogChangeKeyPremiumProgressBarEnabled
|
||||
| APIAuditLogChangeKeyPrivacyLevel
|
||||
| APIAuditLogChangeKeyPruneDeleteDays
|
||||
| APIAuditLogChangeKeyPublicUpdatesChannelId
|
||||
| APIAuditLogChangeKeyRateLimitPerUser
|
||||
| APIAuditLogChangeKeyRecurrenceRule
|
||||
| APIAuditLogChangeKeyRegion
|
||||
| APIAuditLogChangeKeyRTCRegion
|
||||
| APIAuditLogChangeKeyRulesChannelId
|
||||
| APIAuditLogChangeKeySafetyAlertsChannelId
|
||||
| APIAuditLogChangeKeySoundId
|
||||
| APIAuditLogChangeKeySplashHash
|
||||
| APIAuditLogChangeKeyStatus
|
||||
| APIAuditLogChangeKeySystemChannelFlags
|
||||
| APIAuditLogChangeKeySystemChannelId
|
||||
| APIAuditLogChangeKeyTags
|
||||
| APIAuditLogChangeKeyTemporary
|
||||
| APIAuditLogChangeKeyTopic
|
||||
| APIAuditLogChangeKeyTriggerMetadata
|
||||
| APIAuditLogChangeKeyTriggerType
|
||||
| APIAuditLogChangeKeyType
|
||||
| APIAuditLogChangeKeyUserId
|
||||
| APIAuditLogChangeKeyUserLimit
|
||||
| APIAuditLogChangeKeyUses
|
||||
| APIAuditLogChangeKeyVanityURLCode
|
||||
| APIAuditLogChangeKeyVerificationLevel
|
||||
| APIAuditLogChangeKeyVideoQualityMode
|
||||
| APIAuditLogChangeKeyVolume
|
||||
| APIAuditLogChangeKeyWidgetChannelId
|
||||
| APIAuditLogChangeKeyWidgetEnabled;
|
||||
|
||||
/**
|
||||
* Returned when an entity's name is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyName = APIAuditLogChangeData<'name', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's or sticker's or guild scheduled event's description is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDescription = APIAuditLogChangeData<'description', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's icon is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyIconHash = APIAuditLogChangeData<'icon_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's scheduled event's cover image is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyImageHash = APIAuditLogChangeData<'image_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's splash is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeySplashHash = APIAuditLogChangeData<'splash_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's discovery splash is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDiscoverySplashHash = APIAuditLogChangeData<'discovery_splash_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's banner hash is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyBannerHash = APIAuditLogChangeData<'banner_hash', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's owner_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyOwnerId = APIAuditLogChangeData<'owner_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's region is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyRegion = APIAuditLogChangeData<'region', string>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's rtc_region is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyRTCRegion = APIAuditLogChangeData<'rtc_region', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's preferred_locale is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPreferredLocale = APIAuditLogChangeData<'preferred_locale', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's afk_channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAFKChannelId = APIAuditLogChangeData<'afk_channel_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's afk_timeout is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAFKTimeout = APIAuditLogChangeData<'afk_timeout', number>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's rules_channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyRulesChannelId = APIAuditLogChangeData<'rules_channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's public_updates_channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPublicUpdatesChannelId = APIAuditLogChangeData<'public_updates_channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's safety_alerts_channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeySafetyAlertsChannelId = APIAuditLogChangeData<'safety_alerts_channel_id', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's mfa_level is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMFALevel = APIAuditLogChangeData<'mfa_level', GuildMFALevel>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's verification_level is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyVerificationLevel = APIAuditLogChangeData<'verification_level', GuildVerificationLevel>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's video_quality_mode is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyVideoQualityMode = APIAuditLogChangeData<'video_quality_mode', VideoQualityMode>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's explicit_content_filter is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExplicitContentFilter = APIAuditLogChangeData<
|
||||
'explicit_content_filter',
|
||||
GuildExplicitContentFilter
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's default_message_notifications is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultMessageNotifications = APIAuditLogChangeData<
|
||||
'default_message_notifications',
|
||||
GuildDefaultMessageNotifications
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's vanity_url_code is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyVanityURLCode = APIAuditLogChangeData<'vanity_url_code', string>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's boost progress bar is enabled
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPremiumProgressBarEnabled = APIAuditLogChangeData<
|
||||
'premium_progress_bar_enabled',
|
||||
boolean
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when new role(s) are added
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Add = APIAuditLogChangeData<'$add', Pick<APIRole, 'id' | 'name'>[]>;
|
||||
|
||||
/**
|
||||
* Returned when role(s) are removed
|
||||
*/
|
||||
export type APIAuditLogChangeKey$Remove = APIAuditLogChangeData<'$remove', Pick<APIRole, 'id' | 'name'>[]>;
|
||||
|
||||
/**
|
||||
* Returned when there is a change in number of days after which inactive and role-unassigned members are kicked
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPruneDeleteDays = APIAuditLogChangeData<'prune_delete_days', number>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's widget is enabled
|
||||
*/
|
||||
export type APIAuditLogChangeKeyWidgetEnabled = APIAuditLogChangeData<'widget_enabled', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's widget_channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyWidgetChannelId = APIAuditLogChangeData<'widget_channel_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's system_channel_flags is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeySystemChannelFlags = APIAuditLogChangeData<
|
||||
'system_channel_flags',
|
||||
GuildSystemChannelFlags
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a guild's system_channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeySystemChannelId = APIAuditLogChangeData<'system_channel_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's position is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPosition = APIAuditLogChangeData<'position', number>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's topic is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTopic = APIAuditLogChangeData<'topic', string>;
|
||||
|
||||
/**
|
||||
* Returned when a voice channel's bitrate is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyBitrate = APIAuditLogChangeData<'bitrate', number>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's permission overwrites is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPermissionOverwrites = APIAuditLogChangeData<'permission_overwrites', APIOverwrite[]>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's NSFW restriction is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyNSFW = APIAuditLogChangeData<'nsfw', boolean>;
|
||||
|
||||
/**
|
||||
* The application ID of the added or removed Webhook or Bot
|
||||
*/
|
||||
export type APIAuditLogChangeKeyApplicationId = APIAuditLogChangeData<'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 = APIAuditLogChangeData<'rate_limit_per_user', number>;
|
||||
|
||||
/**
|
||||
* Returned when a guild scheduled event's recurrence_rule is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyRecurrenceRule = APIAuditLogChangeData<
|
||||
'recurrence_rule',
|
||||
APIGuildScheduledEventRecurrenceRule
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a permission bitfield is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPermissions = APIAuditLogChangeData<'permissions', string>;
|
||||
|
||||
/**
|
||||
* Returned when a role's color is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyColor = APIAuditLogChangeData<'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
|
||||
*/
|
||||
export type APIAuditLogChangeKeySnowflake = APIAuditLogChangeData<Snowflake, unknown>;
|
||||
|
||||
/**
|
||||
* Returned when a role's hoist status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyHoist = APIAuditLogChangeData<'hoist', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a role's mentionable status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMentionable = APIAuditLogChangeData<'mentionable', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's allowed permissions bitfield is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAllow = APIAuditLogChangeData<'allow', string>;
|
||||
|
||||
/**
|
||||
* Returned when an overwrite's denied permissions bitfield is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDeny = APIAuditLogChangeData<'deny', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's code is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyCode = APIAuditLogChangeData<'code', string>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's or guild scheduled event's channel_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyChannelId = APIAuditLogChangeData<'channel_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's inviter_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyInviterId = APIAuditLogChangeData<'inviter_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's max_uses is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMaxUses = APIAuditLogChangeData<'max_uses', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's uses is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyUses = APIAuditLogChangeData<'uses', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's max_age is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMaxAge = APIAuditLogChangeData<'max_age', number>;
|
||||
|
||||
/**
|
||||
* Returned when an invite's temporary status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTemporary = APIAuditLogChangeData<'temporary', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's deaf status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDeaf = APIAuditLogChangeData<'deaf', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's mute status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyMute = APIAuditLogChangeData<'mute', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a user's nick is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyNick = APIAuditLogChangeData<'nick', string>;
|
||||
|
||||
/**
|
||||
* Returned when a user's avatar_hash is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvatarHash = APIAuditLogChangeData<'avatar_hash', string>;
|
||||
|
||||
/**
|
||||
* The ID of the changed entity - sometimes used in conjunction with other keys
|
||||
*/
|
||||
export type APIAuditLogChangeKeyId = APIAuditLogChangeData<'id', Snowflake>;
|
||||
|
||||
/**
|
||||
* The type of entity created
|
||||
*/
|
||||
export type APIAuditLogChangeKeyType = APIAuditLogChangeData<'type', number | string>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's enable_emoticons is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEnableEmoticons = APIAuditLogChangeData<'enable_emoticons', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's expire_behavior is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExpireBehavior = APIAuditLogChangeData<'expire_behavior', IntegrationExpireBehavior>;
|
||||
|
||||
/**
|
||||
* Returned when an integration's expire_grace_period is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExpireGracePeriod = APIAuditLogChangeData<'expire_grace_period', number>;
|
||||
|
||||
/**
|
||||
* Returned when a voice channel's user_limit is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyUserLimit = APIAuditLogChangeData<'user_limit', number>;
|
||||
|
||||
/**
|
||||
* Returned when privacy level of a stage instance or guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyPrivacyLevel = APIAuditLogChangeData<'privacy_level', StageInstancePrivacyLevel>;
|
||||
|
||||
/**
|
||||
* Returned when a sticker's related emoji is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTags = APIAuditLogChangeData<'tags', string>;
|
||||
|
||||
/**
|
||||
* Returned when a sticker's format_type is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyFormatType = APIAuditLogChangeData<'format_type', StickerFormatType>;
|
||||
|
||||
/**
|
||||
* Empty string
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAsset = APIAuditLogChangeData<'asset', ''>;
|
||||
|
||||
/**
|
||||
* Returned when a sticker's availability is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvailable = APIAuditLogChangeData<'available', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a sticker's guild_id is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyGuildId = APIAuditLogChangeData<'guild_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a thread's archive status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyArchived = APIAuditLogChangeData<'archived', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a thread's lock status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyLocked = APIAuditLogChangeData<'locked', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when a thread's auto archive duration is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAutoArchiveDuration = APIAuditLogChangeData<'auto_archive_duration', number>;
|
||||
|
||||
/**
|
||||
* Returned when a channel's default auto archive duration for newly created threads is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultAutoArchiveDuration = APIAuditLogChangeData<
|
||||
'default_auto_archive_duration',
|
||||
number
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when entity type of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEntityType = APIAuditLogChangeData<'entity_type', GuildScheduledEventEntityType>;
|
||||
|
||||
/**
|
||||
* Returned when status of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyStatus = APIAuditLogChangeData<'status', GuildScheduledEventStatus>;
|
||||
|
||||
/**
|
||||
* Returned when location of a guild scheduled event is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyLocation = APIAuditLogChangeData<'location', string>;
|
||||
|
||||
/**
|
||||
* Returned when a user's timeout is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyCommunicationDisabledUntil = APIAuditLogChangeData<
|
||||
'communication_disabled_until',
|
||||
string
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's trigger type is changed (only in rule creation or deletion)
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTriggerType = APIAuditLogChangeData<'trigger_type', AutoModerationRuleTriggerType>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's event type is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEventType = APIAuditLogChangeData<'event_type', AutoModerationRuleEventType>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's trigger metadata is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyTriggerMetadata = APIAuditLogChangeData<
|
||||
'trigger_metadata',
|
||||
APIAutoModerationRuleTriggerMetadata
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's actions is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyActions = APIAuditLogChangeData<'actions', APIAutoModerationAction[]>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's enabled status is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEnabled = APIAuditLogChangeData<'enabled', boolean>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's exempt roles is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptRoles = APIAuditLogChangeData<'exempt_roles', Snowflake[]>;
|
||||
|
||||
/**
|
||||
* Returned when an auto moderation rule's exempt channels is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyExemptChannels = APIAuditLogChangeData<'exempt_channels', Snowflake[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's available tags gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyAvailableTags = APIAuditLogChangeData<'available_tags', APIGuildForumTag[]>;
|
||||
|
||||
/**
|
||||
* Returned when a guild forum's default reaction emoji gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultReactionEmoji = APIAuditLogChangeData<
|
||||
'default_reaction_emoji',
|
||||
APIGuildForumDefaultReactionEmoji
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a channel flag gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyFlags = APIAuditLogChangeData<'flags', number>;
|
||||
|
||||
/**
|
||||
* Returned when a thread's amount of seconds a user has to wait before creating another thread
|
||||
* gets changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyDefaultThreadRateLimitPerUser = APIAuditLogChangeData<
|
||||
'default_thread_rate_limit_per_user',
|
||||
number
|
||||
>;
|
||||
|
||||
/**
|
||||
* Returned when a soundboard is create or deleted
|
||||
*/
|
||||
export type APIAuditLogChangeKeySoundId = APIAuditLogChangeData<'sound_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a soundboard's volume is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyVolume = APIAuditLogChangeData<'volume', number>;
|
||||
|
||||
/**
|
||||
* Returned when a soundboard's custom emoji is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEmojiId = APIAuditLogChangeData<'emoji_id', Snowflake>;
|
||||
|
||||
/**
|
||||
* Returned when a soundboard's unicode emoji is changed
|
||||
*/
|
||||
export type APIAuditLogChangeKeyEmojiName = APIAuditLogChangeData<'emoji_name', string>;
|
||||
|
||||
/**
|
||||
* Returned when a sounboard is created
|
||||
*/
|
||||
export type APIAuditLogChangeKeyUserId = APIAuditLogChangeData<'user_id', Snowflake>;
|
||||
|
||||
export interface APIAuditLogChangeData<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;
|
||||
}
|
||||
230
deno/payloads/v10/autoModeration.ts
generated
Normal file
230
deno/payloads/v10/autoModeration.ts
generated
Normal file
@@ -0,0 +1,230 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/auto-moderation
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
|
||||
/**
|
||||
* @see {@link 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[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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 6 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,
|
||||
/**
|
||||
* Check if member profile contains words from a user defined list of keywords (Maximum of 1 per guild)
|
||||
*/
|
||||
MemberProfile,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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 60 characters or less
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies | Keyword matching strategies}
|
||||
*
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
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 60 characters or less
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-rule-object-keyword-matching-strategies | Keyword matching strategies}
|
||||
*
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.KeywordPreset}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
allow_list?: string[];
|
||||
/**
|
||||
* Regular expression patterns which will be matched against content (Maximum of 10)
|
||||
*
|
||||
* Only Rust flavored regex is currently supported (Maximum of 260 characters)
|
||||
*
|
||||
* Associated trigger types: {@link AutoModerationRuleTriggerType.Keyword}, {@link AutoModerationRuleTriggerType.MemberProfile}
|
||||
*/
|
||||
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;
|
||||
/**
|
||||
* Whether to automatically detect mention raids
|
||||
*
|
||||
* Associated trigger type: {@link AutoModerationRuleTriggerType.MentionSpam}
|
||||
*/
|
||||
mention_raid_protection_enabled?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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,
|
||||
/**
|
||||
* When a member edits their profile
|
||||
*/
|
||||
MemberUpdate,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/auto-moderation#auto-moderation-action-object-action-types}
|
||||
*/
|
||||
export enum AutoModerationActionType {
|
||||
/**
|
||||
* Blocks a member's message and prevents it from being posted.
|
||||
* A custom explanation can be specified and shown to members whenever their message is blocked
|
||||
*/
|
||||
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,
|
||||
/**
|
||||
* Prevents a member from using text, voice, or other interactions
|
||||
*/
|
||||
BlockMemberInteraction,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
/**
|
||||
* Additional explanation that will be shown to members whenever their message is blocked (Maximum 150 characters)
|
||||
*
|
||||
* Associated action type {@link AutoModerationActionType.BlockMessage}
|
||||
*/
|
||||
custom_message?: string;
|
||||
}
|
||||
729
deno/payloads/v10/channel.ts
generated
Normal file
729
deno/payloads/v10/channel.ts
generated
Normal file
@@ -0,0 +1,729 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/channel
|
||||
*/
|
||||
|
||||
import type { Permissions, Snowflake } from '../../globals.ts';
|
||||
import type { _NonNullableFields } from '../../utils/internals.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
export interface APIBasePartialChannel {
|
||||
/**
|
||||
* The id of the channel
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The type of the channel
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types}
|
||||
*/
|
||||
type: ChannelType;
|
||||
}
|
||||
|
||||
export interface APINameableChannel {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
name?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Not documented, but partial only includes id, name, and type
|
||||
*/
|
||||
export interface APIPartialChannel extends APIBasePartialChannel, APINameableChannel {}
|
||||
|
||||
/**
|
||||
* A channel obtained from fetching an invite.
|
||||
*/
|
||||
export interface APIInviteChannel extends Required<APIPartialChannel> {
|
||||
/**
|
||||
* Icon hash.
|
||||
*/
|
||||
icon?: string | undefined;
|
||||
/**
|
||||
* The invite channel's recipients.
|
||||
*
|
||||
* @remarks Only includes usernames of users.
|
||||
*/
|
||||
recipients?: Pick<APIUser, 'username'>[] | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Source channel of channel follower webhooks.
|
||||
*/
|
||||
export type APIWebhookSourceChannel = Required<_NonNullableFields<Pick<APIPartialChannel, 'id' | 'name'>>>;
|
||||
|
||||
/**
|
||||
* This interface is used to allow easy extension for other channel types. While
|
||||
* also allowing `APIPartialChannel` to be used without breaking.
|
||||
*/
|
||||
export interface APIChannelBase<T extends ChannelType> extends APIBasePartialChannel {
|
||||
type: T;
|
||||
flags?: ChannelFlags;
|
||||
}
|
||||
|
||||
export type TextChannelType =
|
||||
| ChannelType.AnnouncementThread
|
||||
| ChannelType.DM
|
||||
| ChannelType.GroupDM
|
||||
| ChannelType.GuildAnnouncement
|
||||
| ChannelType.GuildStageVoice
|
||||
| ChannelType.GuildText
|
||||
| ChannelType.GuildVoice
|
||||
| ChannelType.PrivateThread
|
||||
| ChannelType.PublicThread;
|
||||
|
||||
export type GuildChannelType = Exclude<ChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export type ApplicationCommandOptionAllowedChannelType = Exclude<
|
||||
ChannelType,
|
||||
ChannelType.DM | ChannelType.GroupDM | ChannelType.GuildDirectory
|
||||
>;
|
||||
|
||||
export interface APISlowmodeChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* Amount of seconds a user has to wait before sending another message (0-21600);
|
||||
* bots, as well as users with the permission `BYPASS_SLOWMODE`, are unaffected
|
||||
*
|
||||
* `rate_limit_per_user` also applies to thread creation. Users can send one message and create one thread during each `rate_limit_per_user` interval.
|
||||
*
|
||||
* For thread channels, `rate_limit_per_user` is only returned if the field is set to a non-zero and non-null value.
|
||||
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
}
|
||||
|
||||
export interface APISortableChannel {
|
||||
/**
|
||||
* Sorting position of the channel
|
||||
*/
|
||||
position: number;
|
||||
}
|
||||
|
||||
export interface APITextBasedChannel<T extends ChannelType> extends APIChannelBase<T>, APISlowmodeChannel<T> {
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
}
|
||||
|
||||
export interface APIPinChannel<T extends ChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
}
|
||||
|
||||
export interface APIGuildChannel<T extends GuildChannelType = GuildChannelType> extends APIChannelBase<T> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* The id of the guild (may be missing for some channel objects received over gateway guild dispatches)
|
||||
*/
|
||||
guild_id?: Snowflake;
|
||||
/**
|
||||
* Explicit permission overwrites for members and roles
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#overwrite-object}
|
||||
*/
|
||||
permission_overwrites?: APIOverwrite[];
|
||||
/**
|
||||
* ID of the parent category for a channel (each parent category can contain up to 50 channels)
|
||||
*/
|
||||
parent_id?: Snowflake | null;
|
||||
/**
|
||||
* Whether the channel is nsfw
|
||||
*/
|
||||
nsfw?: boolean;
|
||||
}
|
||||
|
||||
export type GuildTextChannelType = Exclude<TextChannelType, ChannelType.DM | ChannelType.GroupDM>;
|
||||
|
||||
export interface APIGuildTextChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia | GuildTextChannelType>
|
||||
extends APITextBasedChannel<T>, APIGuildChannel<T>, APISortableChannel, APIPinChannel<T> {
|
||||
/**
|
||||
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
|
||||
*/
|
||||
default_auto_archive_duration?: ThreadAutoArchiveDuration;
|
||||
/**
|
||||
* The initial `rate_limit_per_user` to set on newly created threads.
|
||||
* This field is copied to the thread at creation time and does not live update
|
||||
*/
|
||||
default_thread_rate_limit_per_user?: number;
|
||||
/**
|
||||
* The channel topic (0-1024 characters)
|
||||
*/
|
||||
topic?: string | null;
|
||||
}
|
||||
|
||||
export type APITextChannel = APIGuildTextChannel<ChannelType.GuildText>;
|
||||
export type APINewsChannel = APIGuildTextChannel<ChannelType.GuildAnnouncement>;
|
||||
export interface APIGuildCategoryChannel extends APIGuildChannel<ChannelType.GuildCategory>, APISortableChannel {
|
||||
parent_id?: null;
|
||||
}
|
||||
|
||||
export interface APIVoiceChannelBase<T extends GuildChannelType>
|
||||
extends APIGuildChannel<T>, APISortableChannel, APITextBasedChannel<T>, APISlowmodeChannel<T> {
|
||||
/**
|
||||
* The bitrate (in bits) of the voice or stage channel
|
||||
*/
|
||||
bitrate?: number;
|
||||
/**
|
||||
* The user limit of the voice or stage channel
|
||||
*/
|
||||
user_limit?: number;
|
||||
/**
|
||||
* Voice region id for the voice or stage channel, automatic when set to `null`
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/voice#voice-region-object}
|
||||
*/
|
||||
rtc_region?: string | null;
|
||||
/**
|
||||
* The camera video quality mode of the voice or stage channel, `1` when not present
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-video-quality-modes}
|
||||
*/
|
||||
video_quality_mode?: VideoQualityMode;
|
||||
}
|
||||
|
||||
export type APIGuildVoiceChannel = APIVoiceChannelBase<ChannelType.GuildVoice>;
|
||||
|
||||
export type APIGuildStageVoiceChannel = APIVoiceChannelBase<ChannelType.GuildStageVoice>;
|
||||
|
||||
export interface APIDMChannelBase<T extends ChannelType> extends APITextBasedChannel<T>, APIPinChannel<T> {
|
||||
/**
|
||||
* The recipients of the DM
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
recipients?: APIUser[];
|
||||
}
|
||||
|
||||
export interface APIDMChannel extends APIDMChannelBase<ChannelType.DM> {
|
||||
/**
|
||||
* The name of the channel (always null for DM channels)
|
||||
*/
|
||||
name: null;
|
||||
}
|
||||
|
||||
export interface APIGroupDMChannel extends APIDMChannelBase<ChannelType.GroupDM> {
|
||||
/**
|
||||
* The name of the channel (1-100 characters)
|
||||
*/
|
||||
name: string | null;
|
||||
/**
|
||||
* Application id of the group DM creator if it is bot-created
|
||||
*/
|
||||
application_id?: Snowflake;
|
||||
/**
|
||||
* Icon hash
|
||||
*/
|
||||
icon?: string | null;
|
||||
/**
|
||||
* ID of the DM creator
|
||||
*/
|
||||
owner_id?: Snowflake;
|
||||
/**
|
||||
* The id of the last message sent in this channel (may not point to an existing or valid message)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
/**
|
||||
* Whether the channel is managed by an OAuth2 application
|
||||
*/
|
||||
managed?: boolean;
|
||||
}
|
||||
|
||||
export type ThreadChannelType = ChannelType.AnnouncementThread | ChannelType.PrivateThread | ChannelType.PublicThread;
|
||||
|
||||
export interface APIThreadChannel<Type extends ThreadChannelType = ThreadChannelType>
|
||||
extends APITextBasedChannel<Type>, APIGuildChannel<Type>, APIPinChannel<Type> {
|
||||
/**
|
||||
* The client users member for the thread, only included in select endpoints
|
||||
*/
|
||||
member?: APIThreadMember;
|
||||
/**
|
||||
* The metadata for a thread channel not shared by other channels
|
||||
*/
|
||||
thread_metadata?: APIThreadMetadata;
|
||||
/**
|
||||
* Number of messages (not including the initial message or deleted messages) in a thread
|
||||
*
|
||||
* If the thread was created before July 1, 2022, it stops counting at 50 messages
|
||||
*/
|
||||
message_count?: number;
|
||||
/**
|
||||
* The approximate member count of the thread, does not count above 50 even if there are more members
|
||||
*/
|
||||
member_count?: number;
|
||||
/**
|
||||
* ID of the thread creator
|
||||
*/
|
||||
owner_id?: Snowflake;
|
||||
/**
|
||||
* Number of messages ever sent in a thread
|
||||
*
|
||||
* Similar to `message_count` on message creation, but won't decrement when a message is deleted
|
||||
*/
|
||||
total_message_sent?: number;
|
||||
/**
|
||||
* The IDs of the set of tags that have been applied to a thread in a thread-only channel
|
||||
*/
|
||||
applied_tags?: Snowflake[];
|
||||
/**
|
||||
* ID of the parent channel for the thread
|
||||
*/
|
||||
parent_id?: Snowflake;
|
||||
}
|
||||
|
||||
export type APIPublicThreadChannel = APIThreadChannel<ChannelType.PublicThread>;
|
||||
export type APIPrivateThreadChannel = APIThreadChannel<ChannelType.PrivateThread>;
|
||||
export type APIAnnouncementThreadChannel = APIThreadChannel<ChannelType.AnnouncementThread>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#forum-tag-object-forum-tag-structure}
|
||||
*/
|
||||
export interface APIGuildForumTag {
|
||||
/**
|
||||
* The id of the tag
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* The name of the tag (0-20 characters)
|
||||
*/
|
||||
name: string;
|
||||
/**
|
||||
* Whether this tag can only be added to or removed from threads by a member with the `MANAGE_THREADS` permission
|
||||
*/
|
||||
moderated: boolean;
|
||||
/**
|
||||
* The id of a guild's custom emoji
|
||||
*/
|
||||
emoji_id: Snowflake | null;
|
||||
/**
|
||||
* The unicode character of the emoji
|
||||
*/
|
||||
emoji_name: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#default-reaction-object-default-reaction-structure}
|
||||
*/
|
||||
export interface APIGuildForumDefaultReactionEmoji {
|
||||
/**
|
||||
* The id of a guild's custom emoji
|
||||
*/
|
||||
emoji_id: Snowflake | null;
|
||||
/**
|
||||
* The unicode character of the emoji
|
||||
*/
|
||||
emoji_name: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel/#channel-object-sort-order-types}
|
||||
*/
|
||||
export enum SortOrderType {
|
||||
/**
|
||||
* Sort forum posts by activity
|
||||
*/
|
||||
LatestActivity,
|
||||
/**
|
||||
* Sort forum posts by creation time (from most recent to oldest)
|
||||
*/
|
||||
CreationDate,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel/#channel-object-forum-layout-types}
|
||||
*/
|
||||
export enum ForumLayoutType {
|
||||
/**
|
||||
* No default has been set for forum channel
|
||||
*/
|
||||
NotSet,
|
||||
/**
|
||||
* Display posts as a list
|
||||
*/
|
||||
ListView,
|
||||
/**
|
||||
* Display posts as a collection of tiles
|
||||
*/
|
||||
GalleryView,
|
||||
}
|
||||
|
||||
export interface APIThreadOnlyChannel<T extends ChannelType.GuildForum | ChannelType.GuildMedia>
|
||||
extends APIGuildChannel<T>, APISortableChannel {
|
||||
/**
|
||||
* The channel topic (0-4096 characters)
|
||||
*/
|
||||
topic?: string | null;
|
||||
/**
|
||||
* The id of the last thread created in this channel (may not point to an existing or valid thread)
|
||||
*/
|
||||
last_message_id?: Snowflake | null;
|
||||
/**
|
||||
* Amount of seconds a user has to wait before creating another thread (0-21600);
|
||||
* bots, as well as users with the permission `BYPASS_SLOWMODE`, are unaffected
|
||||
*
|
||||
* The absence of this field in API calls and Gateway events should indicate that slowmode has been reset to the default value.
|
||||
*/
|
||||
rate_limit_per_user?: number;
|
||||
/**
|
||||
* When the last pinned message was pinned.
|
||||
* This may be `null` in events such as `GUILD_CREATE` when a message is not pinned
|
||||
*/
|
||||
last_pin_timestamp?: string | null;
|
||||
/**
|
||||
* Default duration for newly created threads, in minutes, to automatically archive the thread after recent activity
|
||||
*/
|
||||
default_auto_archive_duration?: ThreadAutoArchiveDuration;
|
||||
/**
|
||||
* The set of tags that can be used in a thread-only channel
|
||||
*/
|
||||
available_tags: APIGuildForumTag[];
|
||||
/**
|
||||
* The initial `rate_limit_per_user` to set on newly created threads.
|
||||
* This field is copied to the thread at creation time and does not live update
|
||||
*/
|
||||
default_thread_rate_limit_per_user?: number;
|
||||
/**
|
||||
* The emoji to show in the add reaction button on a thread in a thread-only channel
|
||||
*/
|
||||
default_reaction_emoji: APIGuildForumDefaultReactionEmoji | null;
|
||||
/**
|
||||
* The default sort order type used to order posts in a thread-only channel
|
||||
*/
|
||||
default_sort_order: SortOrderType | null;
|
||||
}
|
||||
|
||||
export interface APIGuildForumChannel extends APIThreadOnlyChannel<ChannelType.GuildForum> {
|
||||
/**
|
||||
* The default layout type used to display posts in a forum channel
|
||||
*
|
||||
* @defaultValue `ForumLayoutType.NotSet` which indicates a layout view has not been set by a channel admin
|
||||
*/
|
||||
default_forum_layout: ForumLayoutType;
|
||||
}
|
||||
|
||||
export type APIGuildMediaChannel = APIThreadOnlyChannel<ChannelType.GuildMedia>;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-structure}
|
||||
*/
|
||||
export type APIChannel =
|
||||
| APIAnnouncementThreadChannel
|
||||
| APIDMChannel
|
||||
| APIGroupDMChannel
|
||||
| APIGuildCategoryChannel
|
||||
| APIGuildForumChannel
|
||||
| APIGuildMediaChannel
|
||||
| APIGuildStageVoiceChannel
|
||||
| APIGuildVoiceChannel
|
||||
| APINewsChannel
|
||||
| APIPrivateThreadChannel
|
||||
| APIPublicThreadChannel
|
||||
| APITextChannel;
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-types}
|
||||
*/
|
||||
export enum ChannelType {
|
||||
/**
|
||||
* A text channel within a guild
|
||||
*/
|
||||
GuildText,
|
||||
/**
|
||||
* A direct message between users
|
||||
*/
|
||||
DM,
|
||||
/**
|
||||
* A voice channel within a guild
|
||||
*/
|
||||
GuildVoice,
|
||||
/**
|
||||
* A direct message between multiple users
|
||||
*/
|
||||
GroupDM,
|
||||
/**
|
||||
* An organizational category that contains up to 50 channels
|
||||
*
|
||||
* @see {@link https://support.discord.com/hc/articles/115001580171}
|
||||
*/
|
||||
GuildCategory,
|
||||
/**
|
||||
* A channel that users can follow and crosspost into their own guild
|
||||
*
|
||||
* @see {@link https://support.discord.com/hc/articles/360032008192}
|
||||
*/
|
||||
GuildAnnouncement,
|
||||
/**
|
||||
* A temporary sub-channel within a Guild Announcement channel
|
||||
*/
|
||||
AnnouncementThread = 10,
|
||||
/**
|
||||
* A temporary sub-channel within a Guild Text or Guild Forum channel
|
||||
*/
|
||||
PublicThread,
|
||||
/**
|
||||
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
|
||||
*/
|
||||
PrivateThread,
|
||||
/**
|
||||
* A voice channel for hosting events with an audience
|
||||
*
|
||||
* @see {@link https://support.discord.com/hc/articles/1500005513722}
|
||||
*/
|
||||
GuildStageVoice,
|
||||
/**
|
||||
* The channel in a Student Hub containing the listed servers
|
||||
*
|
||||
* @see {@link https://support.discord.com/hc/articles/4406046651927}
|
||||
*/
|
||||
GuildDirectory,
|
||||
/**
|
||||
* A channel that can only contain threads
|
||||
*/
|
||||
GuildForum,
|
||||
/**
|
||||
* A channel like forum channels but contains media for server subscriptions
|
||||
*
|
||||
* @see {@link https://creator-support.discord.com/hc/articles/14346342766743}
|
||||
*/
|
||||
GuildMedia,
|
||||
|
||||
// EVERYTHING BELOW THIS LINE SHOULD BE OLD NAMES FOR RENAMED ENUM MEMBERS //
|
||||
|
||||
/**
|
||||
* A channel that users can follow and crosspost into their own guild
|
||||
*
|
||||
* @deprecated This is the old name for {@link ChannelType.GuildAnnouncement}
|
||||
* @see {@link https://support.discord.com/hc/articles/360032008192}
|
||||
*/
|
||||
GuildNews = 5,
|
||||
/**
|
||||
* A temporary sub-channel within a Guild Announcement channel
|
||||
*
|
||||
* @deprecated This is the old name for {@link ChannelType.AnnouncementThread}
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
|
||||
GuildNewsThread = 10,
|
||||
/**
|
||||
* A temporary sub-channel within a Guild Text channel
|
||||
*
|
||||
* @deprecated This is the old name for {@link ChannelType.PublicThread}
|
||||
*/
|
||||
GuildPublicThread = 11,
|
||||
/**
|
||||
* A temporary sub-channel within a Guild Text channel that is only viewable by those invited and those with the Manage Threads permission
|
||||
*
|
||||
* @deprecated This is the old name for {@link ChannelType.PrivateThread}
|
||||
*/
|
||||
GuildPrivateThread = 12,
|
||||
}
|
||||
|
||||
export enum VideoQualityMode {
|
||||
/**
|
||||
* Discord chooses the quality for optimal performance
|
||||
*/
|
||||
Auto = 1,
|
||||
/**
|
||||
* 720p
|
||||
*/
|
||||
Full,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#followed-channel-object}
|
||||
*/
|
||||
export interface APIFollowedChannel {
|
||||
/**
|
||||
* Source channel id
|
||||
*/
|
||||
channel_id: Snowflake;
|
||||
/**
|
||||
* Created target webhook id
|
||||
*/
|
||||
webhook_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#overwrite-object-overwrite-structure}
|
||||
*/
|
||||
export interface APIOverwrite {
|
||||
/**
|
||||
* Role or user id
|
||||
*/
|
||||
id: Snowflake;
|
||||
/**
|
||||
* Either 0 (role) or 1 (member)
|
||||
*/
|
||||
type: OverwriteType;
|
||||
/**
|
||||
* Permission bit set
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags}
|
||||
* @see {@link https://en.wikipedia.org/wiki/Bit_field}
|
||||
*/
|
||||
allow: Permissions;
|
||||
/**
|
||||
* Permission bit set
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/topics/permissions#permissions-bitwise-permission-flags}
|
||||
* @see {@link https://en.wikipedia.org/wiki/Bit_field}
|
||||
*/
|
||||
deny: Permissions;
|
||||
}
|
||||
|
||||
export enum OverwriteType {
|
||||
Role,
|
||||
Member,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#thread-metadata-object-thread-metadata-structure}
|
||||
*/
|
||||
export interface APIThreadMetadata {
|
||||
/**
|
||||
* Whether the thread is archived
|
||||
*/
|
||||
archived: boolean;
|
||||
/**
|
||||
* Duration in minutes to automatically archive the thread after recent activity, can be set to: 60, 1440, 4320, 10080
|
||||
*/
|
||||
auto_archive_duration: ThreadAutoArchiveDuration;
|
||||
/**
|
||||
* An ISO8601 timestamp when the thread's archive status was last changed, used for calculating recent activity
|
||||
*/
|
||||
archive_timestamp: string;
|
||||
/**
|
||||
* Whether the thread is locked; when a thread is locked, only users with `MANAGE_THREADS` can unarchive it
|
||||
*/
|
||||
locked: boolean;
|
||||
/**
|
||||
* Whether non-moderators can add other non-moderators to the thread; only available on private threads
|
||||
*/
|
||||
invitable?: boolean;
|
||||
/**
|
||||
* Timestamp when the thread was created; only populated for threads created after 2022-01-09
|
||||
*/
|
||||
create_timestamp?: string;
|
||||
}
|
||||
|
||||
export enum ThreadAutoArchiveDuration {
|
||||
OneHour = 60,
|
||||
OneDay = 1_440,
|
||||
ThreeDays = 4_320,
|
||||
OneWeek = 10_080,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#thread-member-object-thread-member-structure}
|
||||
*/
|
||||
export interface APIThreadMember {
|
||||
/**
|
||||
* The id of the thread
|
||||
*
|
||||
* **This field is omitted on the member sent within each thread in the `GUILD_CREATE` event**
|
||||
*/
|
||||
id?: Snowflake;
|
||||
/**
|
||||
* The id of the member
|
||||
*
|
||||
* **This field is omitted on the member sent within each thread in the `GUILD_CREATE` event**
|
||||
*/
|
||||
user_id?: Snowflake;
|
||||
/**
|
||||
* An ISO8601 timestamp for when the member last joined
|
||||
*/
|
||||
join_timestamp: string;
|
||||
/**
|
||||
* Member flags combined as a bitfield
|
||||
*
|
||||
* @see {@link https://en.wikipedia.org/wiki/Bit_field}
|
||||
*/
|
||||
flags: ThreadMemberFlags;
|
||||
/**
|
||||
* Additional information about the user
|
||||
*
|
||||
* **This field is omitted on the member sent within each thread in the `GUILD_CREATE` event**
|
||||
*
|
||||
* **This field is only present when `with_member` is set to true when calling `List Thread Members` or `Get Thread Member`**
|
||||
*/
|
||||
member?: APIGuildMember;
|
||||
}
|
||||
|
||||
export enum ThreadMemberFlags {
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
HasInteracted = 1 << 0,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
AllMessages = 1 << 1,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
OnlyMentions = 1 << 2,
|
||||
/**
|
||||
* @unstable This thread member flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
NoMessages = 1 << 3,
|
||||
}
|
||||
|
||||
export interface APIThreadList {
|
||||
/**
|
||||
* The threads that were fetched
|
||||
*/
|
||||
threads: APIChannel[];
|
||||
/**
|
||||
* The members for the client user in each of the fetched threads
|
||||
*/
|
||||
members: APIThreadMember[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/channel#channel-object-channel-flags}
|
||||
*/
|
||||
export enum ChannelFlags {
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
GuildFeedRemoved = 1 << 0,
|
||||
/**
|
||||
* This thread is pinned to the top of its parent forum channel
|
||||
*/
|
||||
Pinned = 1 << 1,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ActiveChannelsRemoved = 1 << 2,
|
||||
/**
|
||||
* Whether a tag is required to be specified when creating a thread in a forum channel.
|
||||
* Tags are specified in the `applied_tags` field
|
||||
*/
|
||||
RequireTag = 1 << 4,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsSpam = 1 << 5,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsGuildResourceChannel = 1 << 7,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
ClydeAI = 1 << 8,
|
||||
/**
|
||||
* @unstable This channel flag is currently not documented by Discord but has a known value which we will try to keep up to date.
|
||||
*/
|
||||
IsScheduledForDeletion = 1 << 9,
|
||||
/**
|
||||
* Whether media download options are hidden.
|
||||
*/
|
||||
HideMediaDownloadOptions = 1 << 15,
|
||||
}
|
||||
82
deno/payloads/v10/emoji.ts
generated
Normal file
82
deno/payloads/v10/emoji.ts
generated
Normal file
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
* Types extracted from https://discord.com/developers/docs/resources/emoji
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { _NonNullableFields } from '../../utils/internals.ts';
|
||||
import type { APIRole } from './permissions.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* Not documented but mentioned
|
||||
*/
|
||||
export interface APIPartialEmoji {
|
||||
/**
|
||||
* Emoji id
|
||||
*/
|
||||
id: Snowflake | null;
|
||||
/**
|
||||
* Emoji name (can be null only in reaction emoji objects)
|
||||
*/
|
||||
name: string | null;
|
||||
/**
|
||||
* Whether this emoji is animated
|
||||
*/
|
||||
animated?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/emoji#emoji-object-applicationowned-emoji}
|
||||
*/
|
||||
export type APIApplicationEmoji = _NonNullableFields<Required<Pick<APIEmoji, 'animated' | 'id' | 'name' | 'user'>>> & {
|
||||
/**
|
||||
* Roles allowed to use this emoji.
|
||||
*
|
||||
* @remarks Always empty.
|
||||
*/
|
||||
roles: [];
|
||||
/**
|
||||
* Whether this emoji must be wrapped in colons.
|
||||
*
|
||||
* @remarks Always `true`.
|
||||
*/
|
||||
require_colons: true;
|
||||
/**
|
||||
* Whether this emoji is managed.
|
||||
*
|
||||
* @remarks Always `false`.
|
||||
*/
|
||||
managed: false;
|
||||
/**
|
||||
* Whether this emoji is available.
|
||||
*
|
||||
* @remarks Always `true`.
|
||||
*/
|
||||
available: true;
|
||||
};
|
||||
477
deno/payloads/v10/gateway.ts
generated
Normal file
477
deno/payloads/v10/gateway.ts
generated
Normal file
@@ -0,0 +1,477 @@
|
||||
/**
|
||||
* Types extracted from
|
||||
* - https://discord.com/developers/docs/topics/gateway
|
||||
* - https://discord.com/developers/docs/topics/gateway-events
|
||||
*/
|
||||
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIThreadChannel, APIThreadMember } from './channel.ts';
|
||||
import type { APIEmoji } from './emoji.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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 {@link https://discord.com/developers/docs/topics/gateway#sharding}
|
||||
*/
|
||||
shards: number;
|
||||
/**
|
||||
* Information on the current session start limit
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway#session-start-limit-object}
|
||||
*/
|
||||
session_start_limit: APIGatewaySessionStartLimit;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence}
|
||||
*/
|
||||
export interface GatewayGuildMembersChunkPresence {
|
||||
/**
|
||||
* 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 {@link https://discord.com/developers/docs/resources/user#user-object}
|
||||
*/
|
||||
user: Partial<APIUser> & Pick<APIUser, 'id'>;
|
||||
/**
|
||||
* Either "idle", "dnd", "online", or "offline"
|
||||
*/
|
||||
status?: PresenceUpdateReceiveStatus;
|
||||
/**
|
||||
* User's current activities
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object}
|
||||
*/
|
||||
activities?: GatewayActivity[];
|
||||
/**
|
||||
* User's platform-dependent status
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#client-status-object}
|
||||
*/
|
||||
client_status?: GatewayPresenceClientStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#presence-update-presence-update-event-fields}
|
||||
*/
|
||||
export interface GatewayPresenceUpdate extends GatewayGuildMembersChunkPresence {
|
||||
/**
|
||||
* ID of the guild
|
||||
*/
|
||||
guild_id: Snowflake;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#update-presence-status-types}
|
||||
*/
|
||||
export enum PresenceUpdateStatus {
|
||||
Online = 'online',
|
||||
DoNotDisturb = 'dnd',
|
||||
Idle = 'idle',
|
||||
/**
|
||||
* Invisible and shown as offline
|
||||
*/
|
||||
Invisible = 'invisible',
|
||||
Offline = 'offline',
|
||||
}
|
||||
|
||||
export type PresenceUpdateReceiveStatus = Exclude<PresenceUpdateStatus, PresenceUpdateStatus.Invisible>;
|
||||
|
||||
/**
|
||||
* @see {@link 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?: PresenceUpdateReceiveStatus;
|
||||
/**
|
||||
* The user's status set for an active mobile (iOS, Android) application session
|
||||
*/
|
||||
mobile?: PresenceUpdateReceiveStatus;
|
||||
/**
|
||||
* The user's status set for an active web (browser, bot account) application session
|
||||
*/
|
||||
web?: PresenceUpdateReceiveStatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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 {@link 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;
|
||||
/**
|
||||
* Controls which field is displayed in the user's status text in the member list
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/events/gateway-events#activity-object-status-display-types}
|
||||
*/
|
||||
status_display_type?: StatusDisplayType | null;
|
||||
/**
|
||||
* What the player is currently doing
|
||||
*/
|
||||
details?: string | null;
|
||||
/**
|
||||
* URL that is linked when clicking on the details text
|
||||
*/
|
||||
details_url?: string | null;
|
||||
/**
|
||||
* The user's current party status, or the text used for a custom status
|
||||
*/
|
||||
state?: string | null;
|
||||
/**
|
||||
* URL that is linked when clicking on the state text
|
||||
*/
|
||||
state_url?: string | null;
|
||||
/**
|
||||
* The emoji used for a custom status
|
||||
*
|
||||
* @see {@link 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 {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-party}
|
||||
*/
|
||||
party?: GatewayActivityParty;
|
||||
/**
|
||||
* Images for the presence and their hover texts
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets}
|
||||
*/
|
||||
assets?: GatewayActivityAssets;
|
||||
/**
|
||||
* Secrets for Rich Presence joining and spectating
|
||||
*
|
||||
* @see {@link 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 {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-flags}
|
||||
* @see {@link https://en.wikipedia.org/wiki/Bit_field}
|
||||
*/
|
||||
flags?: ActivityFlags;
|
||||
/**
|
||||
* The custom buttons shown in the Rich Presence (max 2)
|
||||
*/
|
||||
buttons?: GatewayActivityButton[] | string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @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',
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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\} \{state\}
|
||||
*/
|
||||
Custom,
|
||||
/**
|
||||
* Competing in \{name\}
|
||||
*/
|
||||
Competing,
|
||||
}
|
||||
|
||||
/**
|
||||
* Controls which field is used in the user's status message
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/events/gateway-events#activity-object-status-display-types}
|
||||
*/
|
||||
export enum StatusDisplayType {
|
||||
/**
|
||||
* Playing \{name\}
|
||||
*/
|
||||
Name,
|
||||
/**
|
||||
* Playing \{state\}
|
||||
*/
|
||||
State,
|
||||
/**
|
||||
* Playing \{details\}
|
||||
*/
|
||||
Details,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-emoji}
|
||||
*/
|
||||
export type GatewayActivityEmoji = Partial<Pick<APIEmoji, 'animated' | 'id'>> & Pick<APIEmoji, 'name'>;
|
||||
|
||||
/**
|
||||
* @see {@link 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];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-assets}
|
||||
*/
|
||||
export interface GatewayActivityAssets {
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/events/gateway-events#activity-object-activity-asset-image}
|
||||
*/
|
||||
large_image?: string;
|
||||
/**
|
||||
* Text displayed when hovering over the large image of the activity
|
||||
*/
|
||||
large_text?: string;
|
||||
/**
|
||||
* URL that is opened when clicking on the large image
|
||||
*/
|
||||
large_url?: string;
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/events/gateway-events#activity-object-activity-asset-image}
|
||||
*/
|
||||
small_image?: string;
|
||||
/**
|
||||
* Text displayed when hovering over the small image of the activity
|
||||
*/
|
||||
small_text?: string;
|
||||
/**
|
||||
* URL that is opened when clicking on the small image
|
||||
*/
|
||||
small_url?: string;
|
||||
/**
|
||||
* Displayed as a banner on a Game Invite.
|
||||
*
|
||||
* @see {@link https://discord.com/developers/docs/events/gateway-events#activity-object-activity-asset-image | Activity Asset Image}
|
||||
* @see {@link https://discord.com/developers/docs/discord-social-sdk/development-guides/managing-game-invites | Game Invite}
|
||||
*/
|
||||
invite_cover_image?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/topics/gateway-events#activity-object-activity-secrets}
|
||||
*/
|
||||
export interface GatewayActivitySecrets {
|
||||
/**
|
||||
* The secret for joining a party
|
||||
*/
|
||||
join?: string;
|
||||
/**
|
||||
* The secret for spectating a game
|
||||
*/
|
||||
spectate?: string;
|
||||
/**
|
||||
* The secret for a specific instance of a match
|
||||
*/
|
||||
match?: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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: APIThreadChannel[];
|
||||
/**
|
||||
* The member objects for the client user in each joined thread that was synced
|
||||
*/
|
||||
members: APIThreadMember[];
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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[];
|
||||
}
|
||||
1273
deno/payloads/v10/guild.ts
generated
Normal file
1273
deno/payloads/v10/guild.ts
generated
Normal file
File diff suppressed because it is too large
Load Diff
262
deno/payloads/v10/guildScheduledEvent.ts
generated
Normal file
262
deno/payloads/v10/guildScheduledEvent.ts
generated
Normal file
@@ -0,0 +1,262 @@
|
||||
import type { Snowflake } from '../../globals.ts';
|
||||
import type { APIGuildMember } from './guild.ts';
|
||||
import type { APIUser } from './user.ts';
|
||||
|
||||
export 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;
|
||||
/**
|
||||
* The definition for how often this event should recur
|
||||
*/
|
||||
recurrence_rule: APIGuildScheduledEventRecurrenceRule | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-structure}
|
||||
*/
|
||||
export interface APIGuildScheduledEventRecurrenceRule {
|
||||
/**
|
||||
* Starting time of the recurrence interval
|
||||
*/
|
||||
start: string;
|
||||
/**
|
||||
* Ending time of the recurrence interval
|
||||
*/
|
||||
end: string | null;
|
||||
/**
|
||||
* How often the event occurs
|
||||
*/
|
||||
frequency: GuildScheduledEventRecurrenceRuleFrequency;
|
||||
/**
|
||||
* The spacing between the events, defined by `frequency`.
|
||||
* For example, `frequency` of {@link GuildScheduledEventRecurrenceRuleFrequency.Weekly} and an `interval` of `2`
|
||||
* would be "every-other week"
|
||||
*/
|
||||
interval: number;
|
||||
/**
|
||||
* Set of specific days within a week for the event to recur on
|
||||
*/
|
||||
by_weekday: GuildScheduledEventRecurrenceRuleWeekday[] | null;
|
||||
/**
|
||||
* List of specific days within a specific week (1-5) to recur on
|
||||
*/
|
||||
by_n_weekday: APIGuildScheduledEventRecurrenceRuleNWeekday[] | null;
|
||||
/**
|
||||
* Set of specific months to recur on
|
||||
*/
|
||||
by_month: GuildScheduledEventRecurrenceRuleMonth[] | null;
|
||||
/**
|
||||
* Set of specific dates within a month to recur on
|
||||
*/
|
||||
by_month_day: number[] | null;
|
||||
/**
|
||||
* Set of days within a year to recur on (1-364)
|
||||
*/
|
||||
by_year_day: number[] | null;
|
||||
/**
|
||||
* The total amount of times that the event is allowed to recur before stopping
|
||||
*/
|
||||
count: number | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-frequency}
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleFrequency {
|
||||
Yearly,
|
||||
Monthly,
|
||||
Weekly,
|
||||
Daily,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-weekday}
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleWeekday {
|
||||
Monday,
|
||||
Tuesday,
|
||||
Wednesday,
|
||||
Thursday,
|
||||
Friday,
|
||||
Saturday,
|
||||
Sunday,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-month}
|
||||
*/
|
||||
export enum GuildScheduledEventRecurrenceRuleMonth {
|
||||
January = 1,
|
||||
February,
|
||||
March,
|
||||
April,
|
||||
May,
|
||||
June,
|
||||
July,
|
||||
August,
|
||||
September,
|
||||
October,
|
||||
November,
|
||||
December,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-recurrence-rule-object-guild-scheduled-event-recurrence-rule-nweekday-structure}
|
||||
*/
|
||||
export interface APIGuildScheduledEventRecurrenceRuleNWeekday {
|
||||
/**
|
||||
* The week to reoccur on.
|
||||
*/
|
||||
n: 1 | 2 | 3 | 4 | 5;
|
||||
/**
|
||||
* The day within the week to reoccur on
|
||||
*/
|
||||
day: GuildScheduledEventRecurrenceRuleWeekday;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use {@link APIGuildScheduledEventRecurrenceRuleNWeekday} instead
|
||||
*/
|
||||
export type GuildScheduledEventRecurrenceRuleNWeekday = APIGuildScheduledEventRecurrenceRuleNWeekday;
|
||||
|
||||
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>;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link https://discord.com/developers/docs/resources/guild-scheduled-event#guild-scheduled-event-object-guild-scheduled-event-structure}
|
||||
*/
|
||||
export type APIGuildScheduledEvent =
|
||||
| APIExternalGuildScheduledEvent
|
||||
| APIStageInstanceGuildScheduledEvent
|
||||
| APIVoiceGuildScheduledEvent;
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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,
|
||||
}
|
||||
|
||||
/**
|
||||
* @see {@link 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;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user