Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ddae7b5e46 | ||
|
|
32c9a6b4f3 | ||
|
|
0ad24ba89f | ||
|
|
5412416166 | ||
|
|
78a937d4e9 | ||
|
|
5b45dc265b | ||
|
|
4b210fe793 | ||
|
|
8891320bdf | ||
|
|
8ccfd5c4eb | ||
|
|
44074004e4 | ||
|
|
2f1c885b4f | ||
|
|
c94867280d | ||
|
|
138f7fa2bb | ||
|
|
465eda1c24 | ||
|
|
c821e7dd6d | ||
|
|
f9ce496cc5 | ||
|
|
3989fb5f76 | ||
|
|
779efca39a | ||
|
|
4976aa3d45 | ||
|
|
9cdff2c1de | ||
|
|
2e29947ba5 | ||
|
|
0aa3dca63b | ||
|
|
90851f881d | ||
|
|
b972c97871 | ||
|
|
db94f226fb | ||
|
|
6a4f40d862 | ||
|
|
1f402a848e | ||
|
|
24d98aeaeb | ||
|
|
b95b8f239e | ||
|
|
488b5fce53 | ||
|
|
c2117a67ed | ||
|
|
d31be1bb57 | ||
|
|
76095bea30 | ||
|
|
da962c6c2e | ||
|
|
a89d5c2149 | ||
|
|
7d5313c77e | ||
|
|
16f1be32a3 | ||
|
|
e1a6feea6e | ||
|
|
9668851a82 | ||
|
|
68d6a2df3f | ||
|
|
f835850b3f | ||
|
|
f7fa0998b6 | ||
|
|
4416736947 | ||
|
|
5494c1ad8f | ||
|
|
4147658575 | ||
|
|
f7cda48ed6 | ||
|
|
4b485adf82 | ||
|
|
e55438cc67 | ||
|
|
c7b44232c4 | ||
|
|
68a8170570 | ||
|
|
34ed4edede | ||
|
|
a40a9b8be8 | ||
|
|
e8f96ef84f | ||
|
|
8413d3c2b7 | ||
|
|
30b6ab4df6 | ||
|
|
2aef855902 | ||
|
|
4aacdd1607 | ||
|
|
d66925a450 | ||
|
|
d2cd6be513 | ||
|
|
30a0a6c503 | ||
|
|
72f84b2566 | ||
|
|
6ce017b407 | ||
|
|
415330be21 | ||
|
|
21ce2921a1 | ||
|
|
b07252151b | ||
|
|
02d37dd177 | ||
|
|
706006e319 | ||
|
|
82f2aeaa90 | ||
|
|
793c6f0603 | ||
|
|
1ef74f0b6b | ||
|
|
337dc3827e | ||
|
|
810db76e91 | ||
|
|
f4f6f30fa2 | ||
|
|
8436b19cbf | ||
|
|
549c161830 | ||
|
|
adc2433216 | ||
|
|
3b3c0aff96 | ||
|
|
ce6ca6fc09 | ||
|
|
e3bc985c0c | ||
|
|
ff8568fde7 | ||
|
|
8ec710fa55 | ||
|
|
076fcbcb37 | ||
|
|
6df3498cb5 | ||
|
|
8116d4d8dd | ||
|
|
e987c176b7 | ||
|
|
2ea38cd7a5 | ||
|
|
b2f2ef3405 | ||
|
|
c2e6f781b9 | ||
|
|
8dfd17ddde | ||
|
|
5f077e87f6 | ||
|
|
76dc3b1022 | ||
|
|
93ed56b4ae | ||
|
|
160f89c7cf | ||
|
|
51c4ae0229 | ||
|
|
2cc2ccc68e | ||
|
|
0a29e13640 | ||
|
|
31b94718f1 | ||
|
|
6ac993617e | ||
|
|
9f4999b89b | ||
|
|
dd3c159413 | ||
|
|
72627a7058 | ||
|
|
b683365126 | ||
|
|
03b3495eb2 | ||
|
|
a6be9df213 | ||
|
|
6b2f291122 | ||
|
|
af0dc879c6 | ||
|
|
a12f60136a | ||
|
|
1d05d04bf2 | ||
|
|
ff6a9eefaf | ||
|
|
aa9004d7e2 | ||
|
|
7e1fe78a26 | ||
|
|
675571b8d8 | ||
|
|
48f0d65fad | ||
|
|
a54422b222 | ||
|
|
c243d03216 | ||
|
|
b965a4f5a2 | ||
|
|
0d8dd8cd17 | ||
|
|
6ac432cadc | ||
|
|
dec6c7598b | ||
|
|
2de2e3cd9b | ||
|
|
f117943e00 | ||
|
|
951aff093a | ||
|
|
2acd185d6f | ||
|
|
2fbef46a53 | ||
|
|
5d0776a9b9 | ||
|
|
7bf843c851 | ||
|
|
3e3ea9263f | ||
|
|
bb5c3e9c8d | ||
|
|
8df13b0d36 | ||
|
|
b5dd7158df | ||
|
|
05919bb57e | ||
|
|
1d6572aa36 | ||
|
|
83080a6e4d | ||
|
|
35fdafb21d | ||
|
|
a0e03be103 | ||
|
|
d404f343e0 | ||
|
|
adf4acd443 | ||
|
|
94f32674cb | ||
|
|
e8eb52e00b | ||
|
|
4efa165949 | ||
|
|
4c3e4ef9a5 | ||
|
|
fd739054fd | ||
|
|
2d1724893e | ||
|
|
7696202dec | ||
|
|
e36c1992de | ||
|
|
e73c8e9b3b | ||
|
|
ad623f9650 | ||
|
|
515b7e1ffc | ||
|
|
605173e788 | ||
|
|
e129724c12 | ||
|
|
49504bc3de | ||
|
|
f414fd77fc | ||
|
|
5dcbcbfabc | ||
|
|
6ec228df53 | ||
|
|
1f3894141a | ||
|
|
9253377766 | ||
|
|
6355fb5562 | ||
|
|
442c201994 | ||
|
|
b61f9d4d5a | ||
|
|
129053b9f5 | ||
|
|
35a0511b97 | ||
|
|
bae221056c | ||
|
|
9c6e4ccde4 | ||
|
|
ac6845b4d4 | ||
|
|
30352b570a | ||
|
|
1fddad1e96 | ||
|
|
75770c84b2 | ||
|
|
2281d78896 | ||
|
|
37cc3b794e | ||
|
|
d545d21bb1 | ||
|
|
5f79ae909b | ||
|
|
831e120093 | ||
|
|
376fa23288 | ||
|
|
9414b96221 | ||
|
|
0befd2860e | ||
|
|
74d4ac24f2 | ||
|
|
364bf4f702 | ||
|
|
dd5b76f3d8 | ||
|
|
a02ba56e9a | ||
|
|
6d5bdc5dd4 | ||
|
|
51bfb1a367 | ||
|
|
d85d842046 | ||
|
|
53136e0e6c | ||
|
|
2031a82523 | ||
|
|
453c48fab5 | ||
|
|
fd3bc0e7b9 | ||
|
|
f316ae83e7 | ||
|
|
d2c5cf0fc1 | ||
|
|
45dfc18c1d | ||
|
|
d81b1e7be3 | ||
|
|
2a82bdebae | ||
|
|
c9e13b2471 | ||
|
|
cbeac2fda2 | ||
|
|
8b1dd7d27a | ||
|
|
9e7cd28c6a | ||
|
|
fabe11bfd1 | ||
|
|
79187b9995 | ||
|
|
a1251cf11c | ||
|
|
1bc8b2b401 | ||
|
|
ce727e52b0 | ||
|
|
30233df7b0 | ||
|
|
48d3296868 | ||
|
|
6b8ef26b4c | ||
|
|
9c992c3dbd | ||
|
|
6feb56c25c | ||
|
|
e29b6afd87 | ||
|
|
d35b7fca99 | ||
|
|
126fada990 | ||
|
|
bd4929f11b | ||
|
|
d28fcf40d7 | ||
|
|
bed4e2a56a | ||
|
|
ba3a35a343 | ||
|
|
1e159c9bab | ||
|
|
e7ad3dd50b | ||
|
|
177dee7468 | ||
|
|
0d40c23aa8 | ||
|
|
15eef95fdd | ||
|
|
c89e93d33d | ||
|
|
e6c413cdf5 | ||
|
|
b12556120c | ||
|
|
58674452d8 | ||
|
|
a2f9593d55 | ||
|
|
9702c4d97d | ||
|
|
f13777e5f3 | ||
|
|
9395e9af75 | ||
|
|
b2a5e65fe2 | ||
|
|
071c8f953c | ||
|
|
9a4e5e2175 | ||
|
|
4e709f2a0b | ||
|
|
27e3e78439 | ||
|
|
06e7919162 | ||
|
|
bf952e3ef7 | ||
|
|
a397b66c9e | ||
|
|
27f6e3a81f | ||
|
|
f2cefae37c | ||
|
|
6acbf74846 | ||
|
|
29f8e1452c | ||
|
|
ce242741cd | ||
|
|
ac587568d3 | ||
|
|
f5e78949d7 | ||
|
|
8e7fe4e502 | ||
|
|
e51cc54090 | ||
|
|
dc3515da10 | ||
|
|
c57f3397a4 | ||
|
|
686b45b0bd | ||
|
|
96d6758b4a | ||
|
|
52b49ec564 | ||
|
|
deebd2b758 | ||
|
|
ed9afffd70 | ||
|
|
91cad963e5 | ||
|
|
baa4e35878 | ||
|
|
f6c70fa62a | ||
|
|
58fb7b7512 | ||
|
|
5e1cfe7942 | ||
|
|
507d254556 | ||
|
|
43356fef05 | ||
|
|
bbae139c6b | ||
|
|
6516857866 | ||
|
|
213ec32225 | ||
|
|
04789d5426 | ||
|
|
0437af1507 | ||
|
|
73d188c5dc | ||
|
|
057a5fc6ae | ||
|
|
d35eb8f8bf | ||
|
|
19e5902320 | ||
|
|
66b0377a2b | ||
|
|
3bd308007c | ||
|
|
40bd873a33 | ||
|
|
09d9b2d265 | ||
|
|
7fb169789b | ||
|
|
1ab207b4eb | ||
|
|
5e5ac3e409 | ||
|
|
7809ffc5c6 | ||
|
|
9da823aa4b | ||
|
|
ff23b0e89e | ||
|
|
c3474fb017 | ||
|
|
03982f644e | ||
|
|
3a30152cb2 | ||
|
|
334c9dde21 | ||
|
|
b6985f9d28 | ||
|
|
7d30bf24d9 | ||
|
|
138378ac31 | ||
|
|
9a73ee0d01 | ||
|
|
f26e6f5e99 | ||
|
|
209041c1e5 | ||
|
|
499901fbf1 | ||
|
|
1a1a3f3b02 | ||
|
|
dd5374f84c | ||
|
|
02e8b7d0a1 | ||
|
|
ce0af7e1e9 | ||
|
|
e1fab310a4 | ||
|
|
0615235780 | ||
|
|
abd672dd3b | ||
|
|
f05d2d7d1b | ||
|
|
e65a092bc0 | ||
|
|
17e1902681 | ||
|
|
91657f7519 | ||
|
|
cfa692b356 | ||
|
|
0604e334ed | ||
|
|
e9d20c0a14 | ||
|
|
67465bfdf4 | ||
|
|
a66d3aad2d | ||
|
|
f2de7fc408 | ||
|
|
0cbf991090 | ||
|
|
72f7cbce26 | ||
|
|
05b4080ac5 | ||
|
|
7646b3fc35 | ||
|
|
bf13e15d56 | ||
|
|
f0183c319a | ||
|
|
c6e836455c | ||
|
|
8a6a8e527f | ||
|
|
4e7d45ea07 | ||
|
|
b7f5c7191d | ||
|
|
106cb0f718 | ||
|
|
0c2b688862 | ||
|
|
a037d76060 | ||
|
|
1e2321313f | ||
|
|
91ea12a6cc | ||
|
|
5d86269743 | ||
|
|
42ff447a94 | ||
|
|
7627c07b71 | ||
|
|
147ebc90da | ||
|
|
e8319cccea | ||
|
|
66ab30bf06 | ||
|
|
d0ef2a9873 | ||
|
|
3e928ed06e | ||
|
|
b22f7b2de7 | ||
|
|
6b36b1caf6 | ||
|
|
f8da68607d | ||
|
|
a31588f025 | ||
|
|
5a4b45aa3f | ||
|
|
92aa42fc7c | ||
|
|
4022ae49c2 | ||
|
|
319bbe318d | ||
|
|
970807d144 | ||
|
|
929f57721b | ||
|
|
3469e61065 | ||
|
|
3ddb03a569 | ||
|
|
3fa72e07d8 | ||
|
|
6423ed4b41 | ||
|
|
fc8a252e67 | ||
|
|
ca9fe0aa77 | ||
|
|
798ab8fab1 | ||
|
|
848c968483 | ||
|
|
330ea47ab9 | ||
|
|
4e10cba203 | ||
|
|
56e1fb3939 | ||
|
|
7c76be8473 | ||
|
|
7fa5dca7b3 | ||
|
|
6d3f210612 | ||
|
|
118161698e | ||
|
|
6a8a8dd34d | ||
|
|
28f0d974e5 | ||
|
|
77c486e2b7 | ||
|
|
20bf25aa98 | ||
|
|
70048fa399 | ||
|
|
8eae88b1c6 | ||
|
|
35b02e0a8f | ||
|
|
2a8e41005f | ||
|
|
85026793a4 | ||
|
|
55bcff8030 | ||
|
|
39099a0dfe | ||
|
|
504889a83d | ||
|
|
c1c80fc04d | ||
|
|
4e030bf95b | ||
|
|
adae64bab9 | ||
|
|
bfa05297b2 | ||
|
|
509e961446 | ||
|
|
147eae05b3 | ||
|
|
e410ceaa64 | ||
|
|
51e1ca6fa3 | ||
|
|
e67c505e32 | ||
|
|
12885f63d6 | ||
|
|
c49f577f7f | ||
|
|
d5295a9480 | ||
|
|
177ab95dba | ||
|
|
5e2e0417dc | ||
|
|
b3cd37bb4b | ||
|
|
5512bc1134 | ||
|
|
7dd9bf1ac0 | ||
|
|
cd7fb7533f | ||
|
|
8e730fdfae | ||
|
|
1dd8c0246a | ||
|
|
0a69efdfe5 | ||
|
|
9028eaa16a | ||
|
|
0c2aca7039 | ||
|
|
9326d0fae8 | ||
|
|
e1f4936ae6 | ||
|
|
fd3ae39150 | ||
|
|
1b0da061ba | ||
|
|
07eb8f34e9 | ||
|
|
64fef62bf5 | ||
|
|
b2be76f5b6 | ||
|
|
856ccc10b9 | ||
|
|
8c6681f025 | ||
|
|
cc21e28470 | ||
|
|
7815400472 | ||
|
|
fda8a397d6 | ||
|
|
ae306332bb | ||
|
|
bc46d4ab46 | ||
|
|
b0b4e21aff | ||
|
|
fb3764eefb | ||
|
|
d5efe06fe5 | ||
|
|
cdb2673217 | ||
|
|
6018a183fb | ||
|
|
73f9f4037f | ||
|
|
b5b537e85e | ||
|
|
6ebeb7a93c | ||
|
|
7584c25e93 | ||
|
|
94b3788cfb | ||
|
|
e7d9ad374e | ||
|
|
0e597232f0 | ||
|
|
acc89990c2 | ||
|
|
ee9f8eaca1 | ||
|
|
ae8a8d1b14 | ||
|
|
38afb9c2a6 | ||
|
|
5bdb7941b6 | ||
|
|
01c1f3150e | ||
|
|
e524cccd19 | ||
|
|
ede102bddf | ||
|
|
ab5d5c06be | ||
|
|
355f078ee5 | ||
|
|
c207560743 | ||
|
|
b29dfaeaae | ||
|
|
1710111fcb | ||
|
|
805c6b8e55 | ||
|
|
d0ab311da4 | ||
|
|
92a3671768 | ||
|
|
71074e1afe | ||
|
|
e80ce1a64a | ||
|
|
5dfbce1856 | ||
|
|
407e56a806 | ||
|
|
e0f42834e5 | ||
|
|
d03abd9eeb | ||
|
|
466a4aea81 | ||
|
|
9d96d11cd3 | ||
|
|
e3b99e656e | ||
|
|
07e2a68d06 | ||
|
|
795ca4f981 | ||
|
|
5231129278 | ||
|
|
f62bc7adf9 | ||
|
|
5de6b1e906 | ||
|
|
62413505d6 | ||
|
|
20b617f6eb | ||
|
|
94510bbfb0 | ||
|
|
d51511fdb5 | ||
|
|
3447a37603 | ||
|
|
4b17aa640f | ||
|
|
3b7674f1a5 | ||
|
|
7de9339da3 | ||
|
|
e2e1e19bc8 | ||
|
|
5f19adf561 | ||
|
|
1bb70745ea | ||
|
|
589bbe5cd5 | ||
|
|
447fddea56 | ||
|
|
bf7a003799 | ||
|
|
6115ab1cc8 | ||
|
|
c2307fd1ed | ||
|
|
2a3850c3cc | ||
|
|
688c40ce7b | ||
|
|
dee2a21be9 | ||
|
|
d7ae040d60 | ||
|
|
7b6202985a | ||
|
|
a2f2c601a5 | ||
|
|
b27016df2e | ||
|
|
6341f2f71b | ||
|
|
56a5b9c7d0 | ||
|
|
f608cb71ce | ||
|
|
7c7c325307 | ||
|
|
832021d72a | ||
|
|
030554a7f5 | ||
|
|
ada5ea0c5d | ||
|
|
fb6b891835 | ||
|
|
739ad81f3f | ||
|
|
a6f67a9452 | ||
|
|
56a6540663 | ||
|
|
5f8812d261 | ||
|
|
7a3dcf4c42 | ||
|
|
7cebd4dd6a | ||
|
|
27912a0c37 | ||
|
|
67871d885a | ||
|
|
1bd0d013ed | ||
|
|
a074a17519 | ||
|
|
67af96ef5c | ||
|
|
a041f28cf7 | ||
|
|
a8c9c2ea8d | ||
|
|
8748301b04 | ||
|
|
2d7a7b5728 | ||
|
|
0807ca884c | ||
|
|
0ead037fa8 | ||
|
|
4287c11bf1 | ||
|
|
69fdc7ccf0 | ||
|
|
6c213306b6 | ||
|
|
4096e8196d | ||
|
|
94ee890848 | ||
|
|
4dced819a3 | ||
|
|
1159af9fa9 | ||
|
|
67d429c52b | ||
|
|
f67af805c1 | ||
|
|
944032f690 | ||
|
|
ee248e86bc | ||
|
|
b171bce62b | ||
|
|
df0bce0189 | ||
|
|
2630aa899f | ||
|
|
dba370d66e | ||
|
|
d0bcf26b93 | ||
|
|
65f82171d3 | ||
|
|
6e730f058d | ||
|
|
4702c633ec | ||
|
|
dc14a39c4e | ||
|
|
05c97909d4 | ||
|
|
b3c4c2f6e8 | ||
|
|
e0e678bee0 | ||
|
|
1b01b1703f | ||
|
|
26539360c6 | ||
|
|
627c461f64 | ||
|
|
2e40dc0468 | ||
|
|
fa57b9a93f | ||
|
|
930452155b | ||
|
|
e70f22162d | ||
|
|
d5b0a0f3c6 | ||
|
|
c43081e05d | ||
|
|
8c4bf735f1 | ||
|
|
3a20c4707b | ||
|
|
9a7e563c57 | ||
|
|
72b4f43a25 | ||
|
|
5fec028cc9 | ||
|
|
81300303e5 | ||
|
|
8a1ea1c856 | ||
|
|
8a9d63bf8b | ||
|
|
208b365276 | ||
|
|
abb64a0575 | ||
|
|
c930140540 | ||
|
|
294c4d3f2b | ||
|
|
28e7d48e7e | ||
|
|
bad278e681 | ||
|
|
2e2542d064 | ||
|
|
2c48da45ae | ||
|
|
e1232a559e | ||
|
|
3d58475461 | ||
|
|
f702b199da | ||
|
|
ea1604a805 | ||
|
|
f8bc3d9e12 | ||
|
|
af35f83291 | ||
|
|
39fec94ead | ||
|
|
1b8468330e | ||
|
|
b698c89a89 | ||
|
|
7ed2d7bcc7 | ||
|
|
f2ddaa5fd4 | ||
|
|
fc50a8e83f | ||
|
|
5bece3357d | ||
|
|
97d1489558 | ||
|
|
a211cef1f6 | ||
|
|
ae002e168b | ||
|
|
86a5a1a2ca | ||
|
|
23ebc14b8b | ||
|
|
3a5768a1b1 | ||
|
|
33c3803ca8 | ||
|
|
f3613fb674 | ||
|
|
f1dc8cbcf5 | ||
|
|
a365c4b69f | ||
|
|
687372481a | ||
|
|
1bc8bde922 |
@@ -0,0 +1,328 @@
|
|||||||
|
//@ts-check
|
||||||
|
const fs = require("fs")
|
||||||
|
|
||||||
|
/*////// OT DOCS GENERATOR ////////
|
||||||
|
What does this file do?:
|
||||||
|
Well, this file will parse the result returned from typedoc (the documentation generator).
|
||||||
|
The resulting file will then be used in the OT Docs markdown generator to generate the Open Ticket API Reference.
|
||||||
|
|
||||||
|
In short:
|
||||||
|
This file generates the documentation for Open Ticket :)
|
||||||
|
|
||||||
|
Contributing:
|
||||||
|
If you want to contribute to the Open Ticket Docs, please run the following command:
|
||||||
|
|
||||||
|
> npm run docs
|
||||||
|
|
||||||
|
This will give you a "result.json" file which can then be used in the OT Docs.
|
||||||
|
Further instructions can be found there.
|
||||||
|
/////////////////////////////////*/
|
||||||
|
|
||||||
|
if (!fs.existsSync(".docs/typedoc-result.json")){
|
||||||
|
console.log("Unable to generate documentation! Run typedoc first!")
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
const result = JSON.parse(fs.readFileSync(".docs/typedoc-result.json").toString())
|
||||||
|
const availableElements = []
|
||||||
|
const skipElementNames = [
|
||||||
|
"#opendiscord-types"
|
||||||
|
]
|
||||||
|
|
||||||
|
const handleFunction = (memberType) => {
|
||||||
|
if (!memberType || !memberType.signatures || !Array.isArray(memberType.signatures)) return {type:"unknown"}
|
||||||
|
|
||||||
|
//try to get signature
|
||||||
|
let signature = memberType.signatures.find((s) => !s.typeParameters)
|
||||||
|
if (!signature) signature = memberType.signatures[0]
|
||||||
|
if (!signature) return {type:"unknown"}
|
||||||
|
|
||||||
|
//try to get comment
|
||||||
|
let comment = signature.comment
|
||||||
|
if (!comment) comment = memberType.signatures.find((s) => s.comment)?.comment
|
||||||
|
if (!comment) comment = null
|
||||||
|
|
||||||
|
const signatureInherited = signature.flags.isInherited ? true : false
|
||||||
|
const signatureComment = comment ? comment.summary?.map((c) => c.text).join("") : null
|
||||||
|
const signatureParameters = signature.parameters?.map((p) => {
|
||||||
|
return {name:p.name,details:handleType(p.type)}
|
||||||
|
}) ?? []
|
||||||
|
const signatureReturns = handleType(signature.type)
|
||||||
|
|
||||||
|
return {type:"function",inherited:signatureInherited,comment:signatureComment,parameters:signatureParameters,returns:signatureReturns}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleObject = (memberType) => {
|
||||||
|
if (!memberType || !memberType.children || !Array.isArray(memberType.children)) return {type:"unknown"}
|
||||||
|
const propertyIds = memberType.groups?.find((g) => g.title == "Properties")?.children ?? []
|
||||||
|
const methodIds = memberType.groups?.find((g) => g.title == "Methods")?.children ?? []
|
||||||
|
|
||||||
|
const objectChildren = []
|
||||||
|
for (const member of (memberType.children ?? [])){
|
||||||
|
const memberName = member.name
|
||||||
|
const memberType = propertyIds.includes(member.id) ? "property" : methodIds.includes(member.id) ? "method" : "other"
|
||||||
|
let memberComment = member.comment?.summary?.map((c) => c.text).join("") ?? null
|
||||||
|
|
||||||
|
const rawMemberSource = member.sources ? (member.sources[0] ?? null) : null
|
||||||
|
let memberSource = rawMemberSource ? rawMemberSource.fileName+":"+rawMemberSource.line+":"+rawMemberSource.character : null
|
||||||
|
|
||||||
|
let memberDetails = null
|
||||||
|
if (memberType == "property"){
|
||||||
|
//INTERFACE => PROPERTY
|
||||||
|
memberDetails = handleType(member.type)
|
||||||
|
}else if (memberType == "method"){
|
||||||
|
//INTERFACE => METHOD
|
||||||
|
memberDetails = handleFunction(member)
|
||||||
|
memberComment = memberDetails.comment
|
||||||
|
}
|
||||||
|
|
||||||
|
objectChildren.push({
|
||||||
|
type:memberType,
|
||||||
|
name:memberName,
|
||||||
|
comment:memberComment,
|
||||||
|
source:memberSource,
|
||||||
|
details:memberDetails
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return {type:"object",children:objectChildren}
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleType = (memberType) => {
|
||||||
|
if (!memberType || !memberType.type) return {type:"unknown"}
|
||||||
|
else if (memberType.type == "intrinsic") return {type:"primitive",name:memberType.name}
|
||||||
|
else if (memberType.type == "array") return {type:"array",child:handleType(memberType.elementType)}
|
||||||
|
else if (memberType.type == "union") return {type:"union",children:memberType.types.map((t) => handleType(t))}
|
||||||
|
else if (memberType.type == "intersection") return {type:"intersection",children:memberType.types.map((t) => handleType(t))}
|
||||||
|
else if (memberType.type == "reference"){
|
||||||
|
const referenceTypeArguments = (memberType.typeArguments) ? memberType.typeArguments.map((ta) => handleType(ta)) : null
|
||||||
|
let referenceType = availableElements.find((el) => el.name == memberType.name)?.type ?? null
|
||||||
|
|
||||||
|
if (referenceType){
|
||||||
|
//member is known type (from Open Ticket)
|
||||||
|
return {type:"reference",name:memberType.name,target:referenceType,typeArguments:referenceTypeArguments}
|
||||||
|
}else if (memberType.package){
|
||||||
|
//member is type from node.js or another package
|
||||||
|
if (memberType.package == "typescript") return {type:"internal",name:memberType.name,typeArguments:referenceTypeArguments}
|
||||||
|
if (memberType.package == "open-ticket" && memberType.refersToTypeParameter) return {type:"typeParam",name:memberType.name,typeArguments:referenceTypeArguments}
|
||||||
|
else return {type:"external",package:memberType.package,name:memberType.name,typeArguments:referenceTypeArguments}
|
||||||
|
}else return {type:"unknown"}
|
||||||
|
}
|
||||||
|
else if (memberType.type == "literal") return {type:"literal",name:(typeof memberType.value == "string") ? JSON.stringify(memberType.value) : String(memberType.value)}
|
||||||
|
else if (memberType.type == "typeOperator"){
|
||||||
|
if (memberType.operator == "keyof") return {type:"keyof",child:handleType(memberType.target)}
|
||||||
|
else if (memberType.operator == "readonly") return {type:"readonly",child:handleType(memberType.target)}
|
||||||
|
else if (memberType.operator == "unique") return {type:"unique",child:handleType(memberType.target)}
|
||||||
|
}
|
||||||
|
else if (memberType.type == "conditional") return {type:"conditional",checker:handleType(memberType.checkType),extends:handleType(memberType.extendsType),trueValue:handleType(memberType.trueType),falseValue:handleType(memberType.falseType)}
|
||||||
|
else if (memberType.type == "indexedAccess") return {type:"index",index:handleType(memberType.indexType),object:handleType(memberType.objectType)}
|
||||||
|
else if (memberType.type == "mapped") return {type:"mapped",parameterName:memberType.parameter,parameter:handleType(memberType.parameterType),template:handleType(memberType.templateType)}
|
||||||
|
else if (memberType.type == "optional") return {type:"optional",child:handleType(memberType.elementType)}
|
||||||
|
else if (memberType.type == "predicate") return {type:"predicate",name:memberType.name,target:handleType(memberType.targetType)}
|
||||||
|
else if (memberType.type == "query") return {type:"query",target:handleType(memberType.queryType)}
|
||||||
|
else if (memberType.type == "rest") return {type:"rest",child:handleType(memberType.elementType)}
|
||||||
|
else if (memberType.type == "tuple") return {type:"tuple",children:memberType.elements.map((t) => handleType(t))}
|
||||||
|
else if (memberType.type == "templateLiteral") return {type:"template",head:memberType.head,tails:memberType.tail.map((t) => {
|
||||||
|
return {element:handleType(t[0]),text:t[1]}
|
||||||
|
})}
|
||||||
|
else if (memberType.type == "reflection" && memberType.declaration && memberType.declaration.signatures && memberType.declaration.signatures[0]){
|
||||||
|
return handleFunction(memberType.declaration)
|
||||||
|
}
|
||||||
|
else if (memberType.type == "reflection"){
|
||||||
|
return handleObject(memberType.declaration)
|
||||||
|
}
|
||||||
|
else return {type:"unknown"}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const file of result.children){
|
||||||
|
const classIds = file.groups?.find((g) => g.title == "Classes")?.children ?? []
|
||||||
|
const interfaceIds = file.groups?.find((g) => g.title == "Interfaces")?.children ?? []
|
||||||
|
const typeIds = file.groups?.find((g) => g.title == "Type Aliases")?.children ?? []
|
||||||
|
const enumIds = file.groups?.find((g) => g.title == "Enumerations")?.children ?? []
|
||||||
|
const varIds = file.groups?.find((g) => g.title == "Variables")?.children ?? []
|
||||||
|
const funcIds = file.groups?.find((g) => g.title == "Functions")?.children ?? []
|
||||||
|
|
||||||
|
for (const declaration of file.children){
|
||||||
|
const declarationName = declaration.name
|
||||||
|
const declarationType = classIds.includes(declaration.id) ? "class" : interfaceIds.includes(declaration.id) ? "interface" : typeIds.includes(declaration.id) ? "type" : enumIds.includes(declaration.id) ? "enum" : varIds.includes(declaration.id) ? "variable" : funcIds.includes(declaration.id) ? "function" : "other"
|
||||||
|
availableElements.push({name:declarationName,type:declarationType})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const exported = []
|
||||||
|
for (const file of result.children){
|
||||||
|
const classIds = file.groups?.find((g) => g.title == "Classes")?.children ?? []
|
||||||
|
const interfaceIds = file.groups?.find((g) => g.title == "Interfaces")?.children ?? []
|
||||||
|
const typeIds = file.groups?.find((g) => g.title == "Type Aliases")?.children ?? []
|
||||||
|
const enumIds = file.groups?.find((g) => g.title == "Enumerations")?.children ?? []
|
||||||
|
const varIds = file.groups?.find((g) => g.title == "Variables")?.children ?? []
|
||||||
|
const funcIds = file.groups?.find((g) => g.title == "Functions")?.children ?? []
|
||||||
|
|
||||||
|
for (const declaration of (file.children ?? [])){
|
||||||
|
const declarationName = declaration.name
|
||||||
|
if (skipElementNames.includes(declarationName)) continue
|
||||||
|
|
||||||
|
const declarationType = classIds.includes(declaration.id) ? "class" : interfaceIds.includes(declaration.id) ? "interface" : typeIds.includes(declaration.id) ? "type" : enumIds.includes(declaration.id) ? "enum" : varIds.includes(declaration.id) ? "variable" : funcIds.includes(declaration.id) ? "function" : "other"
|
||||||
|
const declarationTypeParams = (declaration.typeParameters) ? declaration.typeParameters.map((tp) => {
|
||||||
|
return {name:tp.name,type:handleType(tp.type)}
|
||||||
|
}) : null
|
||||||
|
const declarationComment = declaration.comment?.summary?.map((c) => c.text).join("") ?? null
|
||||||
|
const declarationConstant = declaration.flags.isConst ? true : false
|
||||||
|
|
||||||
|
const rawDeclarationSource = declaration.sources ? (declaration.sources[0] ?? null) : null
|
||||||
|
const declarationSource = rawDeclarationSource ? rawDeclarationSource.fileName+":"+rawDeclarationSource.line+":"+rawDeclarationSource.character : null
|
||||||
|
|
||||||
|
const declarationChildren = []
|
||||||
|
if (declarationType == "class"){
|
||||||
|
//CLASS
|
||||||
|
const constructorIds = declaration.groups?.find((g) => g.title == "Constructors")?.children ?? []
|
||||||
|
const propertyIds = declaration.groups?.find((g) => g.title == "Properties")?.children ?? []
|
||||||
|
const methodIds = declaration.groups?.find((g) => g.title == "Methods")?.children ?? []
|
||||||
|
|
||||||
|
for (const member of (declaration.children ?? [])){
|
||||||
|
const memberName = member.name
|
||||||
|
const memberType = constructorIds.includes(member.id) ? "constructor" : propertyIds.includes(member.id) ? "property" : methodIds.includes(member.id) ? "method" : "other"
|
||||||
|
let memberComment = member.comment?.summary?.map((c) => c.text).join("") ?? null
|
||||||
|
|
||||||
|
const rawMemberSource = member.sources ? (member.sources[0] ?? null) : null
|
||||||
|
let memberSource = rawMemberSource ? rawMemberSource.fileName+":"+rawMemberSource.line+":"+rawMemberSource.character : null
|
||||||
|
|
||||||
|
const memberInherited = member.flags.isInherited ? true : false
|
||||||
|
const memberStatic = member.flags.isStatic ? true : false
|
||||||
|
const memberProtected = member.flags.isProtected ? true : false
|
||||||
|
const memberOptional = member.flags.isOptional ? true : false
|
||||||
|
const memberReadonly = member.flags.isReadonly ? true : false
|
||||||
|
|
||||||
|
let memberDetails = null
|
||||||
|
if (memberType == "property"){
|
||||||
|
//CLASS => PROPERTY
|
||||||
|
memberDetails = handleType(member.type)
|
||||||
|
|
||||||
|
}else if (memberType == "method"){
|
||||||
|
//CLASS => METHOD
|
||||||
|
memberDetails = handleFunction(member)
|
||||||
|
memberComment = memberDetails.comment
|
||||||
|
|
||||||
|
}else if (memberType == "constructor"){
|
||||||
|
//CLASS => CONSTRUCTOR
|
||||||
|
memberDetails = handleFunction(member)
|
||||||
|
memberComment = memberDetails.comment
|
||||||
|
}
|
||||||
|
|
||||||
|
declarationChildren.push({
|
||||||
|
type:memberType,
|
||||||
|
name:memberName,
|
||||||
|
comment:memberComment,
|
||||||
|
source:memberSource,
|
||||||
|
details:memberDetails,
|
||||||
|
inherited:memberInherited,
|
||||||
|
static:memberStatic,
|
||||||
|
protected:memberProtected,
|
||||||
|
optional:memberOptional,
|
||||||
|
readonly:memberReadonly
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}else if (declarationType == "interface"){
|
||||||
|
//INTERFACE
|
||||||
|
const propertyIds = declaration.groups?.find((g) => g.title == "Properties")?.children ?? []
|
||||||
|
const methodIds = declaration.groups?.find((g) => g.title == "Methods")?.children ?? []
|
||||||
|
|
||||||
|
for (const member of (declaration.children ?? [])){
|
||||||
|
const memberName = member.name
|
||||||
|
const memberType = propertyIds.includes(member.id) ? "property" : methodIds.includes(member.id) ? "method" : "other"
|
||||||
|
let memberComment = member.comment?.summary?.map((c) => c.text).join("") ?? null
|
||||||
|
|
||||||
|
const rawMemberSource = member.sources ? (member.sources[0] ?? null) : null
|
||||||
|
let memberSource = rawMemberSource ? rawMemberSource.fileName+":"+rawMemberSource.line+":"+rawMemberSource.character : null
|
||||||
|
|
||||||
|
const memberInherited = member.flags.isInherited ? true : false
|
||||||
|
const memberStatic = member.flags.isStatic ? true : false
|
||||||
|
const memberProtected = member.flags.isProtected ? true : false
|
||||||
|
const memberOptional = member.flags.isOptional ? true : false
|
||||||
|
const memberReadonly = member.flags.isReadonly ? true : false
|
||||||
|
|
||||||
|
let memberDetails = null
|
||||||
|
if (memberType == "property"){
|
||||||
|
//INTERFACE => PROPERTY
|
||||||
|
memberDetails = handleType(member.type)
|
||||||
|
}else if (memberType == "method"){
|
||||||
|
//INTERFACE => METHOD
|
||||||
|
memberDetails = handleFunction(member)
|
||||||
|
memberComment = memberDetails.comment
|
||||||
|
}
|
||||||
|
|
||||||
|
declarationChildren.push({
|
||||||
|
type:memberType,
|
||||||
|
name:memberName,
|
||||||
|
comment:memberComment,
|
||||||
|
source:memberSource,
|
||||||
|
details:memberDetails,
|
||||||
|
inherited:memberInherited,
|
||||||
|
static:memberStatic,
|
||||||
|
protected:memberProtected,
|
||||||
|
optional:memberOptional,
|
||||||
|
readonly:memberReadonly
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}else if (declarationType == "type"){
|
||||||
|
//TYPE
|
||||||
|
declarationChildren.push(handleType(declaration.type))
|
||||||
|
}else if (declarationType == "enum"){
|
||||||
|
//ENUM
|
||||||
|
const enumerableIds = declaration.groups?.find((g) => g.title == "Enumeration Members")?.children ?? []
|
||||||
|
|
||||||
|
for (const member of (declaration.children ?? [])){
|
||||||
|
const memberName = member.name
|
||||||
|
const memberType = enumerableIds.includes(member.id) ? "enumerable" : "other"
|
||||||
|
const memberComment = member.comment?.summary?.map((c) => c.text).join("") ?? null
|
||||||
|
|
||||||
|
const rawMemberSource = member.sources ? (member.sources[0] ?? null) : null
|
||||||
|
let memberSource = rawMemberSource ? rawMemberSource.fileName+":"+rawMemberSource.line+":"+rawMemberSource.character : null
|
||||||
|
|
||||||
|
let memberDetails = null
|
||||||
|
if (memberType == "enumerable"){
|
||||||
|
//ENUM => ENUMERABLE
|
||||||
|
memberDetails = handleType(member.type)
|
||||||
|
}
|
||||||
|
|
||||||
|
const memberInherited = member.flags.isInherited ? true : false
|
||||||
|
const memberStatic = member.flags.isStatic ? true : false
|
||||||
|
const memberProtected = member.flags.isProtected ? true : false
|
||||||
|
const memberOptional = member.flags.isOptional ? true : false
|
||||||
|
const memberReadonly = member.flags.isReadonly ? true : false
|
||||||
|
|
||||||
|
declarationChildren.push({
|
||||||
|
type:memberType,
|
||||||
|
name:memberName,
|
||||||
|
comment:memberComment,
|
||||||
|
source:memberSource,
|
||||||
|
details:memberDetails,
|
||||||
|
inherited:memberInherited,
|
||||||
|
static:memberStatic,
|
||||||
|
protected:memberProtected,
|
||||||
|
optional:memberOptional,
|
||||||
|
readonly:memberReadonly
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}else if (declarationType == "variable"){
|
||||||
|
//VARIABLE
|
||||||
|
declarationChildren.push(handleType(declaration.type))
|
||||||
|
|
||||||
|
}else if (declarationType == "function"){
|
||||||
|
//FUNCTION
|
||||||
|
declarationChildren.push(handleFunction(declaration))
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
exported.push({
|
||||||
|
type:declarationType,
|
||||||
|
name:declarationName,
|
||||||
|
comment:declarationComment,
|
||||||
|
constant:declarationConstant,
|
||||||
|
source:declarationSource,
|
||||||
|
children:declarationChildren,
|
||||||
|
typeParams:declarationTypeParams
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync(".docs/result.json",JSON.stringify(exported,null,"\t"))
|
||||||
|
fs.rmSync(".docs/typedoc-result.json")
|
||||||
@@ -0,0 +1,649 @@
|
|||||||
|
//@ts-check
|
||||||
|
const fjs = require("formatted-json-stringify")
|
||||||
|
const fs = require("fs")
|
||||||
|
const formatter = new fjs.ObjectFormatter(null,true,[
|
||||||
|
new fjs.ObjectFormatter("_TRANSLATION",true,[
|
||||||
|
new fjs.PropertyFormatter("otversion"),
|
||||||
|
new fjs.ArrayFormatter("translators",false,new fjs.PropertyFormatter(null)),
|
||||||
|
new fjs.PropertyFormatter("lastedited"),
|
||||||
|
new fjs.PropertyFormatter("language"),
|
||||||
|
new fjs.PropertyFormatter("automated"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("checker",true,[
|
||||||
|
new fjs.ObjectFormatter("system",true,[
|
||||||
|
new fjs.PropertyFormatter("typeError"),
|
||||||
|
new fjs.PropertyFormatter("headerOpenTicket"),
|
||||||
|
new fjs.PropertyFormatter("typeWarning"),
|
||||||
|
new fjs.PropertyFormatter("typeInfo"),
|
||||||
|
new fjs.PropertyFormatter("headerConfigChecker"),
|
||||||
|
new fjs.PropertyFormatter("headerDescription"),
|
||||||
|
new fjs.PropertyFormatter("footerError"),
|
||||||
|
new fjs.PropertyFormatter("footerWarning"),
|
||||||
|
new fjs.PropertyFormatter("footerSupport"),
|
||||||
|
new fjs.PropertyFormatter("compactInformation"),
|
||||||
|
new fjs.PropertyFormatter("dataPath"),
|
||||||
|
new fjs.PropertyFormatter("dataDocs"),
|
||||||
|
new fjs.PropertyFormatter("dataMessages"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("messages",true,[
|
||||||
|
new fjs.PropertyFormatter("stringTooShort"),
|
||||||
|
new fjs.PropertyFormatter("stringTooLong"),
|
||||||
|
new fjs.PropertyFormatter("stringLengthInvalid"),
|
||||||
|
new fjs.PropertyFormatter("stringStartsWith"),
|
||||||
|
new fjs.PropertyFormatter("stringEndsWith"),
|
||||||
|
new fjs.PropertyFormatter("stringContains"),
|
||||||
|
new fjs.PropertyFormatter("stringChoices"),
|
||||||
|
new fjs.PropertyFormatter("stringRegex"),
|
||||||
|
|
||||||
|
new fjs.PropertyFormatter("stringInvertedContains"),
|
||||||
|
new fjs.PropertyFormatter("stringLowercase"),
|
||||||
|
new fjs.PropertyFormatter("stringUppercase"),
|
||||||
|
new fjs.PropertyFormatter("stringSpecialCharacters"),
|
||||||
|
new fjs.PropertyFormatter("stringNoSpaces"),
|
||||||
|
new fjs.PropertyFormatter("stringCapitalWord"),
|
||||||
|
new fjs.PropertyFormatter("stringCapitalSentence"),
|
||||||
|
new fjs.PropertyFormatter("stringPunctuation"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("numberTooShort"),
|
||||||
|
new fjs.PropertyFormatter("numberTooLong"),
|
||||||
|
new fjs.PropertyFormatter("numberLengthInvalid"),
|
||||||
|
new fjs.PropertyFormatter("numberTooSmall"),
|
||||||
|
new fjs.PropertyFormatter("numberTooLarge"),
|
||||||
|
new fjs.PropertyFormatter("numberNotEqual"),
|
||||||
|
new fjs.PropertyFormatter("numberStep"),
|
||||||
|
new fjs.PropertyFormatter("numberStepOffset"),
|
||||||
|
new fjs.PropertyFormatter("numberStartsWith"),
|
||||||
|
new fjs.PropertyFormatter("numberEndsWith"),
|
||||||
|
new fjs.PropertyFormatter("numberContains"),
|
||||||
|
new fjs.PropertyFormatter("numberChoices"),
|
||||||
|
new fjs.PropertyFormatter("numberFloat"),
|
||||||
|
new fjs.PropertyFormatter("numberNegative"),
|
||||||
|
new fjs.PropertyFormatter("numberPositive"),
|
||||||
|
new fjs.PropertyFormatter("numberZero"),
|
||||||
|
new fjs.PropertyFormatter("numberNan"),
|
||||||
|
new fjs.PropertyFormatter("numberInvertedContains"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("booleanTrue"),
|
||||||
|
new fjs.PropertyFormatter("booleanFalse"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("arrayEmptyDisabled"),
|
||||||
|
new fjs.PropertyFormatter("arrayEmptyRequired"),
|
||||||
|
new fjs.PropertyFormatter("arrayTooShort"),
|
||||||
|
new fjs.PropertyFormatter("arrayTooLong"),
|
||||||
|
new fjs.PropertyFormatter("arrayLengthInvalid"),
|
||||||
|
new fjs.PropertyFormatter("arrayInvalidTypes"),
|
||||||
|
new fjs.PropertyFormatter("arrayDouble"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("discordInvalidId"),
|
||||||
|
new fjs.PropertyFormatter("discordInvalidIdOptions"),
|
||||||
|
new fjs.PropertyFormatter("discordInvalidToken"),
|
||||||
|
new fjs.PropertyFormatter("colorInvalid"),
|
||||||
|
new fjs.PropertyFormatter("emojiTooShort"),
|
||||||
|
new fjs.PropertyFormatter("emojiTooLong"),
|
||||||
|
new fjs.PropertyFormatter("emojiCustom"),
|
||||||
|
new fjs.PropertyFormatter("emojiInvalid"),
|
||||||
|
new fjs.PropertyFormatter("urlInvalid"),
|
||||||
|
new fjs.PropertyFormatter("urlInvalidHttp"),
|
||||||
|
new fjs.PropertyFormatter("urlInvalidProtocol"),
|
||||||
|
new fjs.PropertyFormatter("urlInvalidHostname"),
|
||||||
|
new fjs.PropertyFormatter("urlInvalidExtension"),
|
||||||
|
new fjs.PropertyFormatter("urlInvalidPath"),
|
||||||
|
new fjs.PropertyFormatter("idNotUnique"),
|
||||||
|
new fjs.PropertyFormatter("idNonExistent"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("invalidType"),
|
||||||
|
new fjs.PropertyFormatter("propertyMissing"),
|
||||||
|
new fjs.PropertyFormatter("propertyOptional"),
|
||||||
|
new fjs.PropertyFormatter("objectDisabled"),
|
||||||
|
new fjs.PropertyFormatter("nullInvalid"),
|
||||||
|
new fjs.PropertyFormatter("switchInvalidType"),
|
||||||
|
new fjs.PropertyFormatter("objectSwitchInvalid"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("invalidLanguage"),
|
||||||
|
new fjs.PropertyFormatter("invalidButton"),
|
||||||
|
new fjs.PropertyFormatter("unusedOption"),
|
||||||
|
new fjs.PropertyFormatter("unusedQuestion"),
|
||||||
|
new fjs.PropertyFormatter("dropdownOption"),
|
||||||
|
new fjs.PropertyFormatter("customInvalidVersion"),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("actions",true,[
|
||||||
|
new fjs.ObjectFormatter("buttons",true,[
|
||||||
|
new fjs.PropertyFormatter("create"),
|
||||||
|
new fjs.PropertyFormatter("close"),
|
||||||
|
new fjs.PropertyFormatter("delete"),
|
||||||
|
new fjs.PropertyFormatter("reopen"),
|
||||||
|
new fjs.PropertyFormatter("claim"),
|
||||||
|
new fjs.PropertyFormatter("unclaim"),
|
||||||
|
new fjs.PropertyFormatter("pin"),
|
||||||
|
new fjs.PropertyFormatter("unpin"),
|
||||||
|
new fjs.PropertyFormatter("clear"),
|
||||||
|
new fjs.PropertyFormatter("helpSwitchSlash"),
|
||||||
|
new fjs.PropertyFormatter("helpSwitchText"),
|
||||||
|
new fjs.PropertyFormatter("helpPage"),
|
||||||
|
new fjs.PropertyFormatter("withReason"),
|
||||||
|
new fjs.PropertyFormatter("withoutTranscript"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("titles",true,[
|
||||||
|
new fjs.PropertyFormatter("created"),
|
||||||
|
new fjs.PropertyFormatter("close"),
|
||||||
|
new fjs.PropertyFormatter("delete"),
|
||||||
|
new fjs.PropertyFormatter("reopen"),
|
||||||
|
new fjs.PropertyFormatter("claim"),
|
||||||
|
new fjs.PropertyFormatter("unclaim"),
|
||||||
|
new fjs.PropertyFormatter("pin"),
|
||||||
|
new fjs.PropertyFormatter("unpin"),
|
||||||
|
new fjs.PropertyFormatter("rename"),
|
||||||
|
new fjs.PropertyFormatter("move"),
|
||||||
|
new fjs.PropertyFormatter("add"),
|
||||||
|
new fjs.PropertyFormatter("remove"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("help"),
|
||||||
|
new fjs.PropertyFormatter("statsReset"),
|
||||||
|
new fjs.PropertyFormatter("blacklistAdd"),
|
||||||
|
new fjs.PropertyFormatter("blacklistRemove"),
|
||||||
|
new fjs.PropertyFormatter("blacklistGet"),
|
||||||
|
new fjs.PropertyFormatter("blacklistView"),
|
||||||
|
new fjs.PropertyFormatter("blacklistAddDm"),
|
||||||
|
new fjs.PropertyFormatter("blacklistRemoveDm"),
|
||||||
|
new fjs.PropertyFormatter("clear"),
|
||||||
|
new fjs.PropertyFormatter("clearTickets"),
|
||||||
|
new fjs.PropertyFormatter("roles"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("autoclose"),
|
||||||
|
new fjs.PropertyFormatter("autocloseEnabled"),
|
||||||
|
new fjs.PropertyFormatter("autocloseDisabled"),
|
||||||
|
new fjs.PropertyFormatter("autodelete"),
|
||||||
|
new fjs.PropertyFormatter("autodeleteEnabled"),
|
||||||
|
new fjs.PropertyFormatter("autodeleteDisabled"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("topicSet"),
|
||||||
|
new fjs.PropertyFormatter("prioritySet"),
|
||||||
|
new fjs.PropertyFormatter("priorityGet"),
|
||||||
|
new fjs.PropertyFormatter("transfer"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("descriptions",true,[
|
||||||
|
new fjs.PropertyFormatter("create"),
|
||||||
|
new fjs.PropertyFormatter("close"),
|
||||||
|
new fjs.PropertyFormatter("delete"),
|
||||||
|
new fjs.PropertyFormatter("reopen"),
|
||||||
|
new fjs.PropertyFormatter("claim"),
|
||||||
|
new fjs.PropertyFormatter("unclaim"),
|
||||||
|
new fjs.PropertyFormatter("pin"),
|
||||||
|
new fjs.PropertyFormatter("unpin"),
|
||||||
|
new fjs.PropertyFormatter("rename"),
|
||||||
|
new fjs.PropertyFormatter("move"),
|
||||||
|
new fjs.PropertyFormatter("add"),
|
||||||
|
new fjs.PropertyFormatter("remove"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("helpExplanation"),
|
||||||
|
new fjs.PropertyFormatter("statsReset"),
|
||||||
|
new fjs.PropertyFormatter("statsError"),
|
||||||
|
new fjs.PropertyFormatter("blacklistAdd"),
|
||||||
|
new fjs.PropertyFormatter("blacklistRemove"),
|
||||||
|
new fjs.PropertyFormatter("blacklistGetSuccess"),
|
||||||
|
new fjs.PropertyFormatter("blacklistGetEmpty"),
|
||||||
|
new fjs.PropertyFormatter("blacklistViewEmpty"),
|
||||||
|
new fjs.PropertyFormatter("blacklistViewTip"),
|
||||||
|
new fjs.PropertyFormatter("clearVerify"),
|
||||||
|
new fjs.PropertyFormatter("clearReady"),
|
||||||
|
new fjs.PropertyFormatter("rolesEmpty"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("autocloseLeave"),
|
||||||
|
new fjs.PropertyFormatter("autocloseTimeout"),
|
||||||
|
new fjs.PropertyFormatter("autodeleteLeave"),
|
||||||
|
new fjs.PropertyFormatter("autodeleteTimeout"),
|
||||||
|
new fjs.PropertyFormatter("autocloseEnabled"),
|
||||||
|
new fjs.PropertyFormatter("autocloseDisabled"),
|
||||||
|
new fjs.PropertyFormatter("autodeleteEnabled"),
|
||||||
|
new fjs.PropertyFormatter("autodeleteDisabled"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("ticketMessageLimit"),
|
||||||
|
new fjs.PropertyFormatter("ticketMessageAutoclose"),
|
||||||
|
new fjs.PropertyFormatter("ticketMessageAutodelete"),
|
||||||
|
new fjs.PropertyFormatter("panelReady"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("topicSet"),
|
||||||
|
new fjs.PropertyFormatter("prioritySet"),
|
||||||
|
new fjs.PropertyFormatter("priorityGet"),
|
||||||
|
new fjs.PropertyFormatter("transfer"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("modal",true,[
|
||||||
|
new fjs.PropertyFormatter("closePlaceholder"),
|
||||||
|
new fjs.PropertyFormatter("deletePlaceholder"),
|
||||||
|
new fjs.PropertyFormatter("reopenPlaceholder"),
|
||||||
|
new fjs.PropertyFormatter("claimPlaceholder"),
|
||||||
|
new fjs.PropertyFormatter("unclaimPlaceholder"),
|
||||||
|
new fjs.PropertyFormatter("pinPlaceholder"),
|
||||||
|
new fjs.PropertyFormatter("unpinPlaceholder"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("logs",true,[
|
||||||
|
new fjs.PropertyFormatter("createLog"),
|
||||||
|
new fjs.PropertyFormatter("closeLog"),
|
||||||
|
new fjs.PropertyFormatter("closeDm"),
|
||||||
|
new fjs.PropertyFormatter("deleteLog"),
|
||||||
|
new fjs.PropertyFormatter("deleteDm"),
|
||||||
|
new fjs.PropertyFormatter("reopenLog"),
|
||||||
|
new fjs.PropertyFormatter("reopenDm"),
|
||||||
|
new fjs.PropertyFormatter("claimLog"),
|
||||||
|
new fjs.PropertyFormatter("claimDm"),
|
||||||
|
new fjs.PropertyFormatter("unclaimLog"),
|
||||||
|
new fjs.PropertyFormatter("unclaimDm"),
|
||||||
|
new fjs.PropertyFormatter("pinLog"),
|
||||||
|
new fjs.PropertyFormatter("pinDm"),
|
||||||
|
new fjs.PropertyFormatter("unpinLog"),
|
||||||
|
new fjs.PropertyFormatter("unpinDm"),
|
||||||
|
new fjs.PropertyFormatter("renameLog"),
|
||||||
|
new fjs.PropertyFormatter("renameDm"),
|
||||||
|
new fjs.PropertyFormatter("moveLog"),
|
||||||
|
new fjs.PropertyFormatter("moveDm"),
|
||||||
|
new fjs.PropertyFormatter("addLog"),
|
||||||
|
new fjs.PropertyFormatter("addDm"),
|
||||||
|
new fjs.PropertyFormatter("removeLog"),
|
||||||
|
new fjs.PropertyFormatter("removeDm"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("blacklistAddLog"),
|
||||||
|
new fjs.PropertyFormatter("blacklistRemoveLog"),
|
||||||
|
new fjs.PropertyFormatter("blacklistAddDm"),
|
||||||
|
new fjs.PropertyFormatter("blacklistRemoveDm"),
|
||||||
|
new fjs.PropertyFormatter("clearLog"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("transferLog"),
|
||||||
|
new fjs.PropertyFormatter("transferDm"),
|
||||||
|
new fjs.PropertyFormatter("prioritySetLog"),
|
||||||
|
new fjs.PropertyFormatter("prioritySetDm"),
|
||||||
|
new fjs.PropertyFormatter("roleUpdateLog"),
|
||||||
|
new fjs.PropertyFormatter("roleUpdateDm"),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("transcripts",true,[
|
||||||
|
new fjs.ObjectFormatter("success",true,[
|
||||||
|
new fjs.PropertyFormatter("visit"),
|
||||||
|
new fjs.PropertyFormatter("ready"),
|
||||||
|
new fjs.PropertyFormatter("textFileDescription"),
|
||||||
|
new fjs.PropertyFormatter("htmlProgress"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("createdChannel"),
|
||||||
|
new fjs.PropertyFormatter("createdCreator"),
|
||||||
|
new fjs.PropertyFormatter("createdParticipant"),
|
||||||
|
new fjs.PropertyFormatter("createdActiveAdmin"),
|
||||||
|
new fjs.PropertyFormatter("createdEveryAdmin"),
|
||||||
|
new fjs.PropertyFormatter("createdOther"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("errors",true,[
|
||||||
|
new fjs.PropertyFormatter("retry"),
|
||||||
|
new fjs.PropertyFormatter("continue"),
|
||||||
|
new fjs.PropertyFormatter("backup"),
|
||||||
|
new fjs.PropertyFormatter("error"),
|
||||||
|
new fjs.PropertyFormatter("title"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("text",true,[
|
||||||
|
new fjs.PropertyFormatter("messagesTitle"),
|
||||||
|
new fjs.PropertyFormatter("embedTitle"),
|
||||||
|
new fjs.PropertyFormatter("fileTitle"),
|
||||||
|
new fjs.PropertyFormatter("fieldsTitle"),
|
||||||
|
new fjs.PropertyFormatter("reactionsTitle"),
|
||||||
|
new fjs.PropertyFormatter("statsTitle"),
|
||||||
|
new fjs.PropertyFormatter("emptyContent"),
|
||||||
|
new fjs.PropertyFormatter("noTitle"),
|
||||||
|
new fjs.PropertyFormatter("noDesc"),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("errors",true,[
|
||||||
|
new fjs.ObjectFormatter("titles",true,[
|
||||||
|
new fjs.PropertyFormatter("internalError"),
|
||||||
|
new fjs.PropertyFormatter("optionMissing"),
|
||||||
|
new fjs.PropertyFormatter("optionInvalid"),
|
||||||
|
new fjs.PropertyFormatter("unknownCommand"),
|
||||||
|
new fjs.PropertyFormatter("noPermissions"),
|
||||||
|
new fjs.PropertyFormatter("unknownTicket"),
|
||||||
|
new fjs.PropertyFormatter("deprecatedTicket"),
|
||||||
|
new fjs.PropertyFormatter("unknownOption"),
|
||||||
|
new fjs.PropertyFormatter("unknownPanel"),
|
||||||
|
new fjs.PropertyFormatter("notInGuild"),
|
||||||
|
new fjs.PropertyFormatter("channelRename"),
|
||||||
|
new fjs.PropertyFormatter("busy"),
|
||||||
|
new fjs.PropertyFormatter("permissionError"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("descriptions",true,[
|
||||||
|
new fjs.PropertyFormatter("askForInfo"),
|
||||||
|
new fjs.PropertyFormatter("askForInfoResolve"),
|
||||||
|
new fjs.PropertyFormatter("internalError"),
|
||||||
|
new fjs.PropertyFormatter("optionMissing"),
|
||||||
|
new fjs.PropertyFormatter("optionInvalid"),
|
||||||
|
new fjs.PropertyFormatter("optionInvalidChoose"),
|
||||||
|
new fjs.PropertyFormatter("unknownCommand"),
|
||||||
|
new fjs.PropertyFormatter("noPermissions"),
|
||||||
|
new fjs.PropertyFormatter("noPermissionsList"),
|
||||||
|
new fjs.PropertyFormatter("noPermissionsCooldown"),
|
||||||
|
new fjs.PropertyFormatter("noPermissionsBlacklist"),
|
||||||
|
new fjs.PropertyFormatter("noPermissionsLimitGlobal"),
|
||||||
|
new fjs.PropertyFormatter("noPermissionsLimitGlobalUser"),
|
||||||
|
new fjs.PropertyFormatter("noPermissionsLimitOption"),
|
||||||
|
new fjs.PropertyFormatter("noPermissionsLimitOptionUser"),
|
||||||
|
new fjs.PropertyFormatter("unknownTicket"),
|
||||||
|
new fjs.PropertyFormatter("deprecatedTicket"),
|
||||||
|
new fjs.PropertyFormatter("notInGuild"),
|
||||||
|
new fjs.PropertyFormatter("channelRename"),
|
||||||
|
new fjs.PropertyFormatter("channelRenameSource"),
|
||||||
|
new fjs.PropertyFormatter("busy"),
|
||||||
|
new fjs.PropertyFormatter("closeBeforeMessage"),
|
||||||
|
new fjs.PropertyFormatter("closeBeforeAdminMessage"),
|
||||||
|
new fjs.PropertyFormatter("unableToCreateTicket"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("optionInvalidReasons",true,[
|
||||||
|
new fjs.PropertyFormatter("stringRegex"),
|
||||||
|
new fjs.PropertyFormatter("stringMinLength"),
|
||||||
|
new fjs.PropertyFormatter("stringMaxLength"),
|
||||||
|
new fjs.PropertyFormatter("numberInvalid"),
|
||||||
|
new fjs.PropertyFormatter("numberMin"),
|
||||||
|
new fjs.PropertyFormatter("numberMax"),
|
||||||
|
new fjs.PropertyFormatter("numberDecimal"),
|
||||||
|
new fjs.PropertyFormatter("numberNegative"),
|
||||||
|
new fjs.PropertyFormatter("numberPositive"),
|
||||||
|
new fjs.PropertyFormatter("numberZero"),
|
||||||
|
new fjs.PropertyFormatter("channelNotFound"),
|
||||||
|
new fjs.PropertyFormatter("userNotFound"),
|
||||||
|
new fjs.PropertyFormatter("roleNotFound"),
|
||||||
|
new fjs.PropertyFormatter("memberNotFound"),
|
||||||
|
new fjs.PropertyFormatter("mentionableNotFound"),
|
||||||
|
new fjs.PropertyFormatter("channelType"),
|
||||||
|
new fjs.PropertyFormatter("notInGuild"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("permissions",true,[
|
||||||
|
new fjs.PropertyFormatter("developer"),
|
||||||
|
new fjs.PropertyFormatter("owner"),
|
||||||
|
new fjs.PropertyFormatter("admin"),
|
||||||
|
new fjs.PropertyFormatter("moderator"),
|
||||||
|
new fjs.PropertyFormatter("support"),
|
||||||
|
new fjs.PropertyFormatter("member"),
|
||||||
|
new fjs.PropertyFormatter("discord-administrator"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("actionInvalid",true,[
|
||||||
|
new fjs.PropertyFormatter("close"),
|
||||||
|
new fjs.PropertyFormatter("reopen"),
|
||||||
|
new fjs.PropertyFormatter("claim"),
|
||||||
|
new fjs.PropertyFormatter("unclaim"),
|
||||||
|
new fjs.PropertyFormatter("pin"),
|
||||||
|
new fjs.PropertyFormatter("unpin"),
|
||||||
|
new fjs.PropertyFormatter("add"),
|
||||||
|
new fjs.PropertyFormatter("remove"),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("params",true,[
|
||||||
|
new fjs.ObjectFormatter("uppercase",true,[
|
||||||
|
new fjs.PropertyFormatter("ticket"),
|
||||||
|
new fjs.PropertyFormatter("tickets"),
|
||||||
|
new fjs.PropertyFormatter("reason"),
|
||||||
|
new fjs.PropertyFormatter("creator"),
|
||||||
|
new fjs.PropertyFormatter("remaining"),
|
||||||
|
new fjs.PropertyFormatter("added"),
|
||||||
|
new fjs.PropertyFormatter("removed"),
|
||||||
|
new fjs.PropertyFormatter("filter"),
|
||||||
|
new fjs.PropertyFormatter("method"),
|
||||||
|
new fjs.PropertyFormatter("type"),
|
||||||
|
new fjs.PropertyFormatter("blacklisted"),
|
||||||
|
new fjs.PropertyFormatter("panel"),
|
||||||
|
new fjs.PropertyFormatter("command"),
|
||||||
|
new fjs.PropertyFormatter("system"),
|
||||||
|
new fjs.PropertyFormatter("true"),
|
||||||
|
new fjs.PropertyFormatter("false"),
|
||||||
|
new fjs.PropertyFormatter("syntax"),
|
||||||
|
new fjs.PropertyFormatter("originalName"),
|
||||||
|
new fjs.PropertyFormatter("newName"),
|
||||||
|
new fjs.PropertyFormatter("until"),
|
||||||
|
new fjs.PropertyFormatter("validOptions"),
|
||||||
|
new fjs.PropertyFormatter("validPanels"),
|
||||||
|
new fjs.PropertyFormatter("autoclose"),
|
||||||
|
new fjs.PropertyFormatter("autodelete"),
|
||||||
|
new fjs.PropertyFormatter("startupDate"),
|
||||||
|
new fjs.PropertyFormatter("version"),
|
||||||
|
new fjs.PropertyFormatter("name"),
|
||||||
|
new fjs.PropertyFormatter("role"),
|
||||||
|
new fjs.PropertyFormatter("status"),
|
||||||
|
new fjs.PropertyFormatter("claimed"),
|
||||||
|
new fjs.PropertyFormatter("pinned"),
|
||||||
|
new fjs.PropertyFormatter("creationDate"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("noone"),
|
||||||
|
new fjs.PropertyFormatter("open"),
|
||||||
|
new fjs.PropertyFormatter("closed"),
|
||||||
|
new fjs.PropertyFormatter("priority"),
|
||||||
|
new fjs.PropertyFormatter("participants"),
|
||||||
|
new fjs.PropertyFormatter("yes"),
|
||||||
|
new fjs.PropertyFormatter("no"),
|
||||||
|
new fjs.PropertyFormatter("option"),
|
||||||
|
new fjs.PropertyFormatter("topic"),
|
||||||
|
new fjs.PropertyFormatter("uptime"),
|
||||||
|
new fjs.PropertyFormatter("messages"),
|
||||||
|
new fjs.PropertyFormatter("embeds"),
|
||||||
|
new fjs.PropertyFormatter("files"),
|
||||||
|
new fjs.PropertyFormatter("components"),
|
||||||
|
new fjs.PropertyFormatter("cooldown"),
|
||||||
|
new fjs.PropertyFormatter("maxTickets"),
|
||||||
|
new fjs.PropertyFormatter("admins"),
|
||||||
|
new fjs.PropertyFormatter("roles"),
|
||||||
|
new fjs.PropertyFormatter("size"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("lowercase",true,[
|
||||||
|
new fjs.PropertyFormatter("text"),
|
||||||
|
new fjs.PropertyFormatter("html"),
|
||||||
|
new fjs.PropertyFormatter("command"),
|
||||||
|
new fjs.PropertyFormatter("modal"),
|
||||||
|
new fjs.PropertyFormatter("button"),
|
||||||
|
new fjs.PropertyFormatter("dropdown"),
|
||||||
|
new fjs.PropertyFormatter("method"),
|
||||||
|
]),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("commands",true,[
|
||||||
|
new fjs.PropertyFormatter("reason"),
|
||||||
|
new fjs.PropertyFormatter("help"),
|
||||||
|
new fjs.PropertyFormatter("panel"),
|
||||||
|
new fjs.PropertyFormatter("panelId"),
|
||||||
|
new fjs.PropertyFormatter("panelAutoUpdate"),
|
||||||
|
new fjs.PropertyFormatter("ticket"),
|
||||||
|
new fjs.PropertyFormatter("ticketId"),
|
||||||
|
new fjs.PropertyFormatter("close"),
|
||||||
|
new fjs.PropertyFormatter("delete"),
|
||||||
|
new fjs.PropertyFormatter("deleteNoTranscript"),
|
||||||
|
new fjs.PropertyFormatter("reopen"),
|
||||||
|
new fjs.PropertyFormatter("claim"),
|
||||||
|
new fjs.PropertyFormatter("claimUser"),
|
||||||
|
new fjs.PropertyFormatter("unclaim"),
|
||||||
|
new fjs.PropertyFormatter("pin"),
|
||||||
|
new fjs.PropertyFormatter("unpin"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("move"),
|
||||||
|
new fjs.PropertyFormatter("moveId"),
|
||||||
|
new fjs.PropertyFormatter("rename"),
|
||||||
|
new fjs.PropertyFormatter("renameName"),
|
||||||
|
new fjs.PropertyFormatter("add"),
|
||||||
|
new fjs.PropertyFormatter("addUser"),
|
||||||
|
new fjs.PropertyFormatter("remove"),
|
||||||
|
new fjs.PropertyFormatter("removeUser"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("blacklist"),
|
||||||
|
new fjs.PropertyFormatter("blacklistView"),
|
||||||
|
new fjs.PropertyFormatter("blacklistAdd"),
|
||||||
|
new fjs.PropertyFormatter("blacklistRemove"),
|
||||||
|
new fjs.PropertyFormatter("blacklistGet"),
|
||||||
|
new fjs.PropertyFormatter("blacklistGetUser"),
|
||||||
|
new fjs.PropertyFormatter("stats"),
|
||||||
|
new fjs.PropertyFormatter("statsReset"),
|
||||||
|
new fjs.PropertyFormatter("statsGlobal"),
|
||||||
|
new fjs.PropertyFormatter("statsUser"),
|
||||||
|
new fjs.PropertyFormatter("statsUserUser"),
|
||||||
|
new fjs.PropertyFormatter("statsTicket"),
|
||||||
|
new fjs.PropertyFormatter("statsTicketTicket"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("clear"),
|
||||||
|
new fjs.PropertyFormatter("clearFilter"),
|
||||||
|
new fjs.ObjectFormatter("clearFilters",true,[
|
||||||
|
new fjs.PropertyFormatter("all"),
|
||||||
|
new fjs.PropertyFormatter("open"),
|
||||||
|
new fjs.PropertyFormatter("close"),
|
||||||
|
new fjs.PropertyFormatter("claim"),
|
||||||
|
new fjs.PropertyFormatter("unclaim"),
|
||||||
|
new fjs.PropertyFormatter("pin"),
|
||||||
|
new fjs.PropertyFormatter("unpin"),
|
||||||
|
new fjs.PropertyFormatter("autoclose"),
|
||||||
|
]),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("autoclose"),
|
||||||
|
new fjs.PropertyFormatter("autocloseDisable"),
|
||||||
|
new fjs.PropertyFormatter("autocloseEnable"),
|
||||||
|
new fjs.PropertyFormatter("autocloseEnableTime"),
|
||||||
|
new fjs.PropertyFormatter("autodelete"),
|
||||||
|
new fjs.PropertyFormatter("autodeleteDisable"),
|
||||||
|
new fjs.PropertyFormatter("autodeleteEnable"),
|
||||||
|
new fjs.PropertyFormatter("autodeleteEnableTime"),
|
||||||
|
new fjs.TextFormatter(""),
|
||||||
|
new fjs.PropertyFormatter("topic"),
|
||||||
|
new fjs.PropertyFormatter("topicSet"),
|
||||||
|
new fjs.PropertyFormatter("topicValue"),
|
||||||
|
new fjs.PropertyFormatter("topicList"),
|
||||||
|
new fjs.PropertyFormatter("priority"),
|
||||||
|
new fjs.PropertyFormatter("prioritySet"),
|
||||||
|
new fjs.PropertyFormatter("priorityValue"),
|
||||||
|
new fjs.PropertyFormatter("priorityGet"),
|
||||||
|
new fjs.PropertyFormatter("priorityList"),
|
||||||
|
new fjs.PropertyFormatter("transfer"),
|
||||||
|
new fjs.PropertyFormatter("transferUser"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("helpMenu",true,[
|
||||||
|
new fjs.PropertyFormatter("help"),
|
||||||
|
new fjs.PropertyFormatter("ticket"),
|
||||||
|
new fjs.PropertyFormatter("close"),
|
||||||
|
new fjs.PropertyFormatter("delete"),
|
||||||
|
new fjs.PropertyFormatter("reopen"),
|
||||||
|
new fjs.PropertyFormatter("pin"),
|
||||||
|
new fjs.PropertyFormatter("unpin"),
|
||||||
|
new fjs.PropertyFormatter("move"),
|
||||||
|
new fjs.PropertyFormatter("rename"),
|
||||||
|
new fjs.PropertyFormatter("claim"),
|
||||||
|
new fjs.PropertyFormatter("unclaim"),
|
||||||
|
new fjs.PropertyFormatter("add"),
|
||||||
|
new fjs.PropertyFormatter("remove"),
|
||||||
|
new fjs.PropertyFormatter("panel"),
|
||||||
|
new fjs.PropertyFormatter("blacklistView"),
|
||||||
|
new fjs.PropertyFormatter("blacklistAdd"),
|
||||||
|
new fjs.PropertyFormatter("blacklistRemove"),
|
||||||
|
new fjs.PropertyFormatter("blacklistGet"),
|
||||||
|
new fjs.PropertyFormatter("statsGlobal"),
|
||||||
|
new fjs.PropertyFormatter("statsTicket"),
|
||||||
|
new fjs.PropertyFormatter("statsUser"),
|
||||||
|
new fjs.PropertyFormatter("statsReset"),
|
||||||
|
new fjs.PropertyFormatter("autocloseDisable"),
|
||||||
|
new fjs.PropertyFormatter("autocloseEnable"),
|
||||||
|
new fjs.PropertyFormatter("autodeleteDisable"),
|
||||||
|
new fjs.PropertyFormatter("autodeleteEnable"),
|
||||||
|
new fjs.ObjectFormatter("categories",true,[
|
||||||
|
new fjs.PropertyFormatter("general"),
|
||||||
|
new fjs.PropertyFormatter("basicTicket"),
|
||||||
|
new fjs.PropertyFormatter("advancedTicket"),
|
||||||
|
new fjs.PropertyFormatter("userTicket"),
|
||||||
|
new fjs.PropertyFormatter("admin"),
|
||||||
|
new fjs.PropertyFormatter("advanced"),
|
||||||
|
new fjs.PropertyFormatter("extra"),
|
||||||
|
])
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("stats",true,[
|
||||||
|
new fjs.ObjectFormatter("scopes",true,[
|
||||||
|
new fjs.PropertyFormatter("global"),
|
||||||
|
new fjs.PropertyFormatter("system"),
|
||||||
|
new fjs.PropertyFormatter("user"),
|
||||||
|
new fjs.PropertyFormatter("ticket"),
|
||||||
|
new fjs.PropertyFormatter("participants"),
|
||||||
|
new fjs.PropertyFormatter("messages"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("properties",true,[
|
||||||
|
new fjs.PropertyFormatter("ticketsCreated"),
|
||||||
|
new fjs.PropertyFormatter("ticketsClosed"),
|
||||||
|
new fjs.PropertyFormatter("ticketsDeleted"),
|
||||||
|
new fjs.PropertyFormatter("ticketsReopened"),
|
||||||
|
new fjs.PropertyFormatter("ticketsAutoclosed"),
|
||||||
|
new fjs.PropertyFormatter("ticketsClaimed"),
|
||||||
|
new fjs.PropertyFormatter("ticketsPinned"),
|
||||||
|
new fjs.PropertyFormatter("ticketsMoved"),
|
||||||
|
new fjs.PropertyFormatter("usersBlacklisted"),
|
||||||
|
new fjs.PropertyFormatter("transcriptsCreated"),
|
||||||
|
new fjs.PropertyFormatter("ticketsAutodeleted"),
|
||||||
|
new fjs.PropertyFormatter("ticketsTransferred"),
|
||||||
|
new fjs.PropertyFormatter("ticketVolume"),
|
||||||
|
new fjs.PropertyFormatter("averageTickets"),
|
||||||
|
new fjs.PropertyFormatter("currentTickets"),
|
||||||
|
new fjs.PropertyFormatter("age"),
|
||||||
|
new fjs.PropertyFormatter("responseTime"),
|
||||||
|
new fjs.PropertyFormatter("resolutionTime"),
|
||||||
|
new fjs.PropertyFormatter("createdOn"),
|
||||||
|
new fjs.PropertyFormatter("createdBy"),
|
||||||
|
new fjs.PropertyFormatter("closedOn"),
|
||||||
|
new fjs.PropertyFormatter("closedBy"),
|
||||||
|
new fjs.PropertyFormatter("claimedOn"),
|
||||||
|
new fjs.PropertyFormatter("claimedBy"),
|
||||||
|
new fjs.PropertyFormatter("pinnedOn"),
|
||||||
|
new fjs.PropertyFormatter("pinnedBy"),
|
||||||
|
new fjs.PropertyFormatter("deletedOn"),
|
||||||
|
new fjs.PropertyFormatter("deletedBy"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("roles",true,[
|
||||||
|
new fjs.PropertyFormatter("developer"),
|
||||||
|
new fjs.PropertyFormatter("serverOwner"),
|
||||||
|
new fjs.PropertyFormatter("serverAdmin"),
|
||||||
|
new fjs.PropertyFormatter("moderator"),
|
||||||
|
new fjs.PropertyFormatter("support"),
|
||||||
|
new fjs.PropertyFormatter("member"),
|
||||||
|
])
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("panel",true,[
|
||||||
|
new fjs.PropertyFormatter("selectTicket"),
|
||||||
|
new fjs.PropertyFormatter("selectRole"),
|
||||||
|
new fjs.PropertyFormatter("selectOption"),
|
||||||
|
]),
|
||||||
|
new fjs.ObjectFormatter("priorities",true,[
|
||||||
|
new fjs.PropertyFormatter("urgent"),
|
||||||
|
new fjs.PropertyFormatter("veryHigh"),
|
||||||
|
new fjs.PropertyFormatter("high"),
|
||||||
|
new fjs.PropertyFormatter("normal"),
|
||||||
|
new fjs.PropertyFormatter("low"),
|
||||||
|
new fjs.PropertyFormatter("veryLow"),
|
||||||
|
new fjs.PropertyFormatter("none"),
|
||||||
|
]),
|
||||||
|
])
|
||||||
|
|
||||||
|
for (const language of fs.readdirSync(".docs/languages/")){
|
||||||
|
if (!fs.existsSync("./languages/"+language)){
|
||||||
|
console.log("language:",language,"does not exist yet in the primary ./languages/ folder. Unable to merge!")
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
console.log("merging "+language+"...")
|
||||||
|
const original = JSON.parse(fs.readFileSync("./languages/"+language).toString())
|
||||||
|
const newSentences = JSON.parse(fs.readFileSync(".docs/languages/"+language).toString())
|
||||||
|
|
||||||
|
for (const key of Object.keys(newSentences)){
|
||||||
|
if (key.startsWith("_")) continue
|
||||||
|
try{
|
||||||
|
const splitted = key.split(".")
|
||||||
|
let currentObject = original
|
||||||
|
splitted.forEach((property,index) => {
|
||||||
|
let shouldBeObject = (splitted.length-1 !== index)
|
||||||
|
if (shouldBeObject && typeof currentObject[property] == "object"){
|
||||||
|
currentObject = currentObject[property]
|
||||||
|
}else if (shouldBeObject && typeof currentObject[property] == "undefined"){
|
||||||
|
currentObject[property] = {}
|
||||||
|
currentObject = currentObject[property]
|
||||||
|
}else if (typeof currentObject[property] == "string" || typeof currentObject[property] == "undefined"){
|
||||||
|
currentObject[property] = newSentences[key]
|
||||||
|
}else{
|
||||||
|
console.log("Failed to merge key:",key,"in file:",language,"--> Invalid type:",typeof currentObject[property])
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}catch(err){
|
||||||
|
console.log("Failed to merge key:",key,"in file:",language)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
original["_TRANSLATION"]["lastedited"] = new Date().toLocaleDateString("nl-BE",{day:"2-digit",month:"2-digit",year:"numeric"})
|
||||||
|
original["_TRANSLATION"]["otversion"] = "v4.1.3"
|
||||||
|
const finalText = formatter.stringify(original)
|
||||||
|
fs.writeFileSync("./languages/"+language,finalText)
|
||||||
|
}
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://typedoc.org/schema.json",
|
||||||
|
"entryPoints": [
|
||||||
|
"../src/core/api/modules/",
|
||||||
|
"../src/core/api/defaults/",
|
||||||
|
"../src/core/api/openticket/",
|
||||||
|
"../src/core/api/main.ts",
|
||||||
|
"../src/core/startup/init.ts",
|
||||||
|
],
|
||||||
|
"entryPointStrategy": "expand",
|
||||||
|
"json": "./typedoc-result.json",
|
||||||
|
"basePath": "../"
|
||||||
|
}
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
# Pterodactyl Eggs
|
||||||
|
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket Logo" width="500px">
|
||||||
|
|
||||||
|
[](https://discord.com/invite/26vT9wt3n3)
|
||||||
|
[](https://github.com/open-discord-bots/open-ticket/releases/tag/v4.1.3)
|
||||||
|
[](https://github.com/sponsors/DJj123dj)
|
||||||
|
[](.eggs/README.md)
|
||||||
|
|
||||||
|
|
||||||
|
Hi there! Open Ticket provides **official eggs** for the Pterodactyl & Pelican panels!<br>
|
||||||
|
There are different eggs for different versions of Open Ticket.
|
||||||
|
Please choose the one that fits your needs the most.
|
||||||
|
|
||||||
|
If you encounter any issues while installing these eggs, please head to our [**discord server**](https://discord.dj-dj.be) for further assistance!
|
||||||
|
|
||||||
|
### Requirements
|
||||||
|
It's recommended to provide at least `1GB` of **Memory/RAM** and `5GB` of **disk space** for Open Ticket to work correctly.
|
||||||
|
|
||||||
|
### Egg Variants
|
||||||
|
[**`openticket-egg-main.json` (Recommended)**](openticket-egg-main.json)
|
||||||
|
- This egg will use the `main` branch of Open Ticket.
|
||||||
|
|
||||||
|
[**`openticket-egg-v4.1.3.json`**](openticket-egg-v4.1.3.json)
|
||||||
|
- This egg will always use Open Ticket `v4.1.3`. Open Ticket updates will not have an effect on this egg.
|
||||||
|
|
||||||
|
[**`openticket-egg-v4.1.2.json`**](openticket-egg-v4.1.2.json)
|
||||||
|
- This egg will always use Open Ticket `v4.1.2`. Open Ticket updates will not have an effect on this egg.
|
||||||
|
|
||||||
|
[**`openticket-egg-v4.1.1.json`**](openticket-egg-v4.1.1.json)
|
||||||
|
- This egg will always use Open Ticket `v4.1.1`. Open Ticket updates will not have an effect on this egg.
|
||||||
|
|
||||||
|
[**`openticket-egg-v4.1.0.json`**](openticket-egg-v4.1.0.json)
|
||||||
|
- This egg will always use Open Ticket `v4.1.0`. Open Ticket updates will not have an effect on this egg.
|
||||||
|
|
||||||
|
[**`openticket-egg-v4.0.7.json`**](openticket-egg-v4.0.7.json)
|
||||||
|
- This egg will always use Open Ticket `v4.0.7`. Open Ticket updates will not have an effect on this egg.
|
||||||
|
|
||||||
|
[**`openticket-egg-v3.5.9.json`**](openticket-egg-v3.5.9.json)
|
||||||
|
- This egg will always use Open Ticket `v3.5.9`. Open Ticket updates will not have an effect on this egg.
|
||||||
|
|
||||||
|
[**`openticket-egg-dev.json` (Not Recommended)**](openticket-egg-dev.json)
|
||||||
|
- This egg will use the `dev` branch of Open Ticket.
|
||||||
|
|
||||||
|
---
|
||||||
|
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket Logo" width="170px">
|
||||||
|
|
||||||
|
**Pterodactyl Eggs**<br>
|
||||||
|
[Changelog](https://otgithub.dj-dj.be/releases) - [Documentation](https://otdocs.dj-dj.be) - [Website](https://openticket.dj-dj.be) - [Support Server](https://discord.dj-dj.be) - [License](./LICENSE.md)<br>
|
||||||
|
|
||||||
|
© 2021 - 2026 - [DJdj Development](https://www.dj-dj.be) - [Terms](https://www.dj-dj.be/terms) - [Privacy Policy](https://www.dj-dj.be/privacy) - [Support Us](https://github.com/sponsors/DJj123dj)
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
|
||||||
|
"meta": {
|
||||||
|
"version": "PTDL_v2",
|
||||||
|
"update_url": null
|
||||||
|
},
|
||||||
|
"exported_at": "2025-03-16T18:10:21+01:00",
|
||||||
|
"name": "Open Ticket (Experimental)",
|
||||||
|
"author": "support@dj-dj.be",
|
||||||
|
"description": "This is the experimental Pterodactyl egg for Open Ticket, the most advanced & customisable discord ticket bot that you will ever find! DO NOT USE IN PRODUCTION!",
|
||||||
|
"features": null,
|
||||||
|
"docker_images": {
|
||||||
|
"ghcr.io\/parkervcp\/yolks:nodejs_20": "ghcr.io\/parkervcp\/yolks:nodejs_20"
|
||||||
|
},
|
||||||
|
"file_denylist": [],
|
||||||
|
"startup": "if [[ ! -z ${NODE_PACKAGES} ]]; then npm install ${NODE_PACKAGES}; fi; if [[ ! -z ${UNNODE_PACKAGES} ]]; then npm uninstall ${UNNODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then npm install; fi; node \"\/home\/container\/index.js\" ${NODE_FLAGS};",
|
||||||
|
"config": {
|
||||||
|
"files": "{}",
|
||||||
|
"startup": "{\r\n \"done\": \"STARTUP INFO:\"\r\n}",
|
||||||
|
"logs": "{}",
|
||||||
|
"stop": "^C"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"installation": {
|
||||||
|
"script": "#!\/bin\/bash\r\n# Open Ticket Installation Script (dev)\r\n# Inspired by: Node.js Installation Script\r\n# \u00a9 DJdj Development\r\n\r\necho -e \"[OT INSTALLER] installing dependencies. please wait...\"\r\napt update\r\napt install -y git curl\r\n\r\necho -e \"[OT INSTALLER] updating npm. please wait...\"\r\nnpm install npm@latest --location=global\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nBRANCH=\"dev\"\r\n\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"[OT INSTALLER] \/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \"[OT INSTALLER] .git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"[OT INSTALLER] loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"[OT INSTALLER] files found with no git config\"\r\n echo -e \"[OT INSTALLER] closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"https:\/\/github.com\/open-discord-bots\/open-ticket.git\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"[OT INSTALLER] \/mnt\/server is empty.\"\r\n echo -e \"[OT INSTALLER] cloning files into repo.\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"[OT INSTALLER] cloning default branch\"\r\n git clone https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n else\r\n echo -e \"[OT INSTALLER] cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n fi\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing Open Ticket node.js packages.\"\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --omit=dev\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing custom node.js packages.\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\necho -e \"[OT INSTALLER] install complete!\"\r\nexit 0",
|
||||||
|
"container": "node:latest",
|
||||||
|
"entrypoint": "bash"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "Additional Npm Packages",
|
||||||
|
"description": "Specify additional npm packages used by Open Ticket plugins. Use spaces to separate.",
|
||||||
|
"env_variable": "NODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Startup Flags",
|
||||||
|
"description": "Start the bot with additional Open Ticket flags. Separate using spaces.\r\nA full reference list can be found in the documentation.",
|
||||||
|
"env_variable": "NODE_FLAGS",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Uninstall Npm Packages",
|
||||||
|
"description": "A list of npm packages to uninstall. Separate by spaces.",
|
||||||
|
"env_variable": "UNNODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
|
||||||
|
"meta": {
|
||||||
|
"version": "PTDL_v2",
|
||||||
|
"update_url": null
|
||||||
|
},
|
||||||
|
"exported_at": "2025-03-16T18:10:20+01:00",
|
||||||
|
"name": "Open Ticket (Latest)",
|
||||||
|
"author": "support@dj-dj.be",
|
||||||
|
"description": "This is the official Pterodactyl egg for Open Ticket, the most advanced & customisable discord ticket bot that you will ever find! You can customise up to 300+ variables! This includes Html Transcripts, Advanced Plugins, Custom Embeds, Questions\/Modals, Stats & more!",
|
||||||
|
"features": null,
|
||||||
|
"docker_images": {
|
||||||
|
"ghcr.io\/parkervcp\/yolks:nodejs_20": "ghcr.io\/parkervcp\/yolks:nodejs_20"
|
||||||
|
},
|
||||||
|
"file_denylist": [],
|
||||||
|
"startup": "if [[ ! -z ${NODE_PACKAGES} ]]; then npm install ${NODE_PACKAGES}; fi; if [[ ! -z ${UNNODE_PACKAGES} ]]; then npm uninstall ${UNNODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then npm install; fi; node \"\/home\/container\/index.js\" ${NODE_FLAGS};",
|
||||||
|
"config": {
|
||||||
|
"files": "{}",
|
||||||
|
"startup": "{\r\n \"done\": \"STARTUP INFO:\"\r\n}",
|
||||||
|
"logs": "{}",
|
||||||
|
"stop": "^C"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"installation": {
|
||||||
|
"script": "#!\/bin\/bash\r\n# Open Ticket Installation Script (main)\r\n# Inspired by: Node.js Installation Script\r\n# \u00a9 DJdj Development\r\n\r\necho -e \"[OT INSTALLER] installing dependencies. please wait...\"\r\napt update\r\napt install -y git curl\r\n\r\necho -e \"[OT INSTALLER] updating npm. please wait...\"\r\nnpm install npm@latest --location=global\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nBRANCH=\"main\"\r\n\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"[OT INSTALLER] \/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \"[OT INSTALLER] .git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"[OT INSTALLER] loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"[OT INSTALLER] files found with no git config\"\r\n echo -e \"[OT INSTALLER] closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"https:\/\/github.com\/open-discord-bots\/open-ticket.git\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"[OT INSTALLER] \/mnt\/server is empty.\"\r\n echo -e \"[OT INSTALLER] cloning files into repo.\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"[OT INSTALLER] cloning default branch\"\r\n git clone https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n else\r\n echo -e \"[OT INSTALLER] cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n fi\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing Open Ticket node.js packages.\"\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --omit=dev\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing custom node.js packages.\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\necho -e \"[OT INSTALLER] install complete!\"\r\nexit 0",
|
||||||
|
"container": "node:latest",
|
||||||
|
"entrypoint": "bash"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "Additional Npm Packages",
|
||||||
|
"description": "Specify additional npm packages used by Open Ticket plugins. Use spaces to separate.",
|
||||||
|
"env_variable": "NODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Startup Flags",
|
||||||
|
"description": "Start the bot with additional Open Ticket flags. Separate using spaces.\r\nA full reference list can be found in the documentation.",
|
||||||
|
"env_variable": "NODE_FLAGS",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Uninstall Npm Packages",
|
||||||
|
"description": "A list of npm packages to uninstall. Separate by spaces.",
|
||||||
|
"env_variable": "UNNODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
|
||||||
|
"meta": {
|
||||||
|
"version": "PTDL_v2",
|
||||||
|
"update_url": null
|
||||||
|
},
|
||||||
|
"exported_at": "2025-03-16T18:10:19+01:00",
|
||||||
|
"name": "Open Ticket (v3.5.9)",
|
||||||
|
"author": "support@dj-dj.be",
|
||||||
|
"description": "This is the official Pterodactyl egg for Open Ticket v3.5.9, the most advanced & customisable discord ticket bot that you will ever find! You can customise up to 300+ variables! This includes Html Transcripts, Advanced Plugins, Custom Embeds, Questions\/Modals, Stats & more!",
|
||||||
|
"features": null,
|
||||||
|
"docker_images": {
|
||||||
|
"ghcr.io\/parkervcp\/yolks:nodejs_20": "ghcr.io\/parkervcp\/yolks:nodejs_20"
|
||||||
|
},
|
||||||
|
"file_denylist": [],
|
||||||
|
"startup": "if [[ ! -z ${NODE_PACKAGES} ]]; then npm install ${NODE_PACKAGES}; fi; if [[ ! -z ${UNNODE_PACKAGES} ]]; then npm uninstall ${UNNODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then npm install; fi; node \"\/home\/container\/index.js\" ${NODE_FLAGS};",
|
||||||
|
"config": {
|
||||||
|
"files": "{}",
|
||||||
|
"startup": "{\r\n \"done\": \"STARTUP INFO:\"\r\n}",
|
||||||
|
"logs": "{}",
|
||||||
|
"stop": "^C"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"installation": {
|
||||||
|
"script": "#!\/bin\/bash\r\n# Open Ticket Installation Script (v3.5.9)\r\n# Inspired by: Node.js Installation Script\r\n# \u00a9 DJdj Development\r\n\r\necho -e \"[OT INSTALLER] installing dependencies. please wait...\"\r\napt update\r\napt install -y git curl\r\n\r\necho -e \"[OT INSTALLER] updating npm. please wait...\"\r\nnpm install npm@latest --location=global\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nBRANCH=\"v3.5.9\"\r\n\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"[OT INSTALLER] \/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \"[OT INSTALLER] .git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"[OT INSTALLER] loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"[OT INSTALLER] files found with no git config\"\r\n echo -e \"[OT INSTALLER] closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"https:\/\/github.com\/open-discord-bots\/open-ticket.git\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"[OT INSTALLER] \/mnt\/server is empty.\"\r\n echo -e \"[OT INSTALLER] cloning files into repo.\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"[OT INSTALLER] cloning default branch\"\r\n git clone https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n else\r\n echo -e \"[OT INSTALLER] cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n fi\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing Open Ticket node.js packages.\"\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --omit=dev\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing custom node.js packages.\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\necho -e \"[OT INSTALLER] install complete!\"\r\nexit 0",
|
||||||
|
"container": "node:latest",
|
||||||
|
"entrypoint": "bash"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "Additional Npm Packages",
|
||||||
|
"description": "Specify additional npm packages used by Open Ticket plugins. Use spaces to separate.",
|
||||||
|
"env_variable": "NODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Startup Flags",
|
||||||
|
"description": "Start the bot with additional Open Ticket flags. Separate using spaces.\r\nA full reference list can be found in the documentation.",
|
||||||
|
"env_variable": "NODE_FLAGS",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Uninstall Npm Packages",
|
||||||
|
"description": "A list of npm packages to uninstall. Separate by spaces.",
|
||||||
|
"env_variable": "UNNODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
|
||||||
|
"meta": {
|
||||||
|
"version": "PTDL_v2",
|
||||||
|
"update_url": null
|
||||||
|
},
|
||||||
|
"exported_at": "2025-03-16T18:10:18+01:00",
|
||||||
|
"name": "Open Ticket (v4.0.7)",
|
||||||
|
"author": "support@dj-dj.be",
|
||||||
|
"description": "This is the official Pterodactyl egg for Open Ticket v4.0.7, the most advanced & customisable discord ticket bot that you will ever find! You can customise up to 300+ variables! This includes Html Transcripts, Advanced Plugins, Custom Embeds, Questions\/Modals, Stats & more!",
|
||||||
|
"features": null,
|
||||||
|
"docker_images": {
|
||||||
|
"ghcr.io\/parkervcp\/yolks:nodejs_20": "ghcr.io\/parkervcp\/yolks:nodejs_20"
|
||||||
|
},
|
||||||
|
"file_denylist": [],
|
||||||
|
"startup": "if [[ ! -z ${NODE_PACKAGES} ]]; then npm install ${NODE_PACKAGES}; fi; if [[ ! -z ${UNNODE_PACKAGES} ]]; then npm uninstall ${UNNODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then npm install; fi; node \"\/home\/container\/index.js\" ${NODE_FLAGS};",
|
||||||
|
"config": {
|
||||||
|
"files": "{}",
|
||||||
|
"startup": "{\r\n \"done\": \"STARTUP INFO:\"\r\n}",
|
||||||
|
"logs": "{}",
|
||||||
|
"stop": "^C"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"installation": {
|
||||||
|
"script": "#!\/bin\/bash\r\n# Open Ticket Installation Script (v4.0.7)\r\n# Inspired by: Node.js Installation Script\r\n# \u00a9 DJdj Development\r\n\r\necho -e \"[OT INSTALLER] installing dependencies. please wait...\"\r\napt update\r\napt install -y git curl\r\n\r\necho -e \"[OT INSTALLER] updating npm. please wait...\"\r\nnpm install npm@latest --location=global\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nBRANCH=\"v4.0.7\"\r\n\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"[OT INSTALLER] \/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \"[OT INSTALLER] .git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"[OT INSTALLER] loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"[OT INSTALLER] files found with no git config\"\r\n echo -e \"[OT INSTALLER] closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"https:\/\/github.com\/open-discord-bots\/open-ticket.git\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"[OT INSTALLER] \/mnt\/server is empty.\"\r\n echo -e \"[OT INSTALLER] cloning files into repo.\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"[OT INSTALLER] cloning default branch\"\r\n git clone https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n else\r\n echo -e \"[OT INSTALLER] cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n fi\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing Open Ticket node.js packages.\"\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --omit=dev\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing custom node.js packages.\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\necho -e \"[OT INSTALLER] install complete!\"\r\nexit 0",
|
||||||
|
"container": "node:latest",
|
||||||
|
"entrypoint": "bash"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "Additional Npm Packages",
|
||||||
|
"description": "Specify additional npm packages used by Open Ticket plugins. Use spaces to separate.",
|
||||||
|
"env_variable": "NODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Startup Flags",
|
||||||
|
"description": "Start the bot with additional Open Ticket flags. Separate using spaces.\r\nA full reference list can be found in the documentation.",
|
||||||
|
"env_variable": "NODE_FLAGS",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Uninstall Npm Packages",
|
||||||
|
"description": "A list of npm packages to uninstall. Separate by spaces.",
|
||||||
|
"env_variable": "UNNODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
|
||||||
|
"meta": {
|
||||||
|
"version": "PTDL_v2",
|
||||||
|
"update_url": null
|
||||||
|
},
|
||||||
|
"exported_at": "2025-03-16T18:10:18+01:00",
|
||||||
|
"name": "Open Ticket (v4.1.0)",
|
||||||
|
"author": "support@dj-dj.be",
|
||||||
|
"description": "This is the official Pterodactyl egg for Open Ticket v4.1.0, the most advanced & customisable discord ticket bot that you will ever find! You can customise up to 300+ variables! This includes Html Transcripts, Advanced Plugins, Custom Embeds, Questions\/Modals, Stats & more!",
|
||||||
|
"features": null,
|
||||||
|
"docker_images": {
|
||||||
|
"ghcr.io\/parkervcp\/yolks:nodejs_20": "ghcr.io\/parkervcp\/yolks:nodejs_20"
|
||||||
|
},
|
||||||
|
"file_denylist": [],
|
||||||
|
"startup": "if [[ ! -z ${NODE_PACKAGES} ]]; then npm install ${NODE_PACKAGES}; fi; if [[ ! -z ${UNNODE_PACKAGES} ]]; then npm uninstall ${UNNODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then npm install; fi; node \"\/home\/container\/index.js\" ${NODE_FLAGS};",
|
||||||
|
"config": {
|
||||||
|
"files": "{}",
|
||||||
|
"startup": "{\r\n \"done\": \"STARTUP INFO:\"\r\n}",
|
||||||
|
"logs": "{}",
|
||||||
|
"stop": "^C"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"installation": {
|
||||||
|
"script": "#!\/bin\/bash\r\n# Open Ticket Installation Script (v4.1.0)\r\n# Inspired by: Node.js Installation Script\r\n# \u00a9 DJdj Development\r\n\r\necho -e \"[OT INSTALLER] installing dependencies. please wait...\"\r\napt update\r\napt install -y git curl\r\n\r\necho -e \"[OT INSTALLER] updating npm. please wait...\"\r\nnpm install npm@latest --location=global\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nBRANCH=\"v4.1.0\"\r\n\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"[OT INSTALLER] \/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \"[OT INSTALLER] .git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"[OT INSTALLER] loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"[OT INSTALLER] files found with no git config\"\r\n echo -e \"[OT INSTALLER] closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"https:\/\/github.com\/open-discord-bots\/open-ticket.git\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"[OT INSTALLER] \/mnt\/server is empty.\"\r\n echo -e \"[OT INSTALLER] cloning files into repo.\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"[OT INSTALLER] cloning default branch\"\r\n git clone https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n else\r\n echo -e \"[OT INSTALLER] cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n fi\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing Open Ticket node.js packages.\"\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --omit=dev\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing custom node.js packages.\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\necho -e \"[OT INSTALLER] install complete!\"\r\nexit 0",
|
||||||
|
"container": "node:latest",
|
||||||
|
"entrypoint": "bash"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "Additional Npm Packages",
|
||||||
|
"description": "Specify additional npm packages used by Open Ticket plugins. Use spaces to separate.",
|
||||||
|
"env_variable": "NODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Startup Flags",
|
||||||
|
"description": "Start the bot with additional Open Ticket flags. Separate using spaces.\r\nA full reference list can be found in the documentation.",
|
||||||
|
"env_variable": "NODE_FLAGS",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Uninstall Npm Packages",
|
||||||
|
"description": "A list of npm packages to uninstall. Separate by spaces.",
|
||||||
|
"env_variable": "UNNODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
|
||||||
|
"meta": {
|
||||||
|
"version": "PTDL_v2",
|
||||||
|
"update_url": null
|
||||||
|
},
|
||||||
|
"exported_at": "2025-03-16T18:10:18+01:00",
|
||||||
|
"name": "Open Ticket (v4.1.1)",
|
||||||
|
"author": "support@dj-dj.be",
|
||||||
|
"description": "This is the official Pterodactyl egg for Open Ticket v4.1.1, the most advanced & customisable discord ticket bot that you will ever find! You can customise up to 300+ variables! This includes Html Transcripts, Advanced Plugins, Custom Embeds, Questions\/Modals, Stats & more!",
|
||||||
|
"features": null,
|
||||||
|
"docker_images": {
|
||||||
|
"ghcr.io\/parkervcp\/yolks:nodejs_20": "ghcr.io\/parkervcp\/yolks:nodejs_20"
|
||||||
|
},
|
||||||
|
"file_denylist": [],
|
||||||
|
"startup": "if [[ ! -z ${NODE_PACKAGES} ]]; then npm install ${NODE_PACKAGES}; fi; if [[ ! -z ${UNNODE_PACKAGES} ]]; then npm uninstall ${UNNODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then npm install; fi; node \"\/home\/container\/index.js\" ${NODE_FLAGS};",
|
||||||
|
"config": {
|
||||||
|
"files": "{}",
|
||||||
|
"startup": "{\r\n \"done\": \"STARTUP INFO:\"\r\n}",
|
||||||
|
"logs": "{}",
|
||||||
|
"stop": "^C"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"installation": {
|
||||||
|
"script": "#!\/bin\/bash\r\n# Open Ticket Installation Script (v4.1.1)\r\n# Inspired by: Node.js Installation Script\r\n# \u00a9 DJdj Development\r\n\r\necho -e \"[OT INSTALLER] installing dependencies. please wait...\"\r\napt update\r\napt install -y git curl\r\n\r\necho -e \"[OT INSTALLER] updating npm. please wait...\"\r\nnpm install npm@latest --location=global\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nBRANCH=\"v4.1.1\"\r\n\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"[OT INSTALLER] \/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \"[OT INSTALLER] .git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"[OT INSTALLER] loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"[OT INSTALLER] files found with no git config\"\r\n echo -e \"[OT INSTALLER] closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"https:\/\/github.com\/open-discord-bots\/open-ticket.git\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"[OT INSTALLER] \/mnt\/server is empty.\"\r\n echo -e \"[OT INSTALLER] cloning files into repo.\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"[OT INSTALLER] cloning default branch\"\r\n git clone https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n else\r\n echo -e \"[OT INSTALLER] cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n fi\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing Open Ticket node.js packages.\"\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --omit=dev\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing custom node.js packages.\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\necho -e \"[OT INSTALLER] install complete!\"\r\nexit 0",
|
||||||
|
"container": "node:latest",
|
||||||
|
"entrypoint": "bash"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "Additional Npm Packages",
|
||||||
|
"description": "Specify additional npm packages used by Open Ticket plugins. Use spaces to separate.",
|
||||||
|
"env_variable": "NODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Startup Flags",
|
||||||
|
"description": "Start the bot with additional Open Ticket flags. Separate using spaces.\r\nA full reference list can be found in the documentation.",
|
||||||
|
"env_variable": "NODE_FLAGS",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Uninstall Npm Packages",
|
||||||
|
"description": "A list of npm packages to uninstall. Separate by spaces.",
|
||||||
|
"env_variable": "UNNODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
|
||||||
|
"meta": {
|
||||||
|
"version": "PTDL_v2",
|
||||||
|
"update_url": null
|
||||||
|
},
|
||||||
|
"exported_at": "2025-03-16T18:10:18+01:00",
|
||||||
|
"name": "Open Ticket (v4.1.2)",
|
||||||
|
"author": "support@dj-dj.be",
|
||||||
|
"description": "This is the official Pterodactyl egg for Open Ticket v4.1.2, the most advanced & customisable discord ticket bot that you will ever find! You can customise up to 300+ variables! This includes Html Transcripts, Advanced Plugins, Custom Embeds, Questions\/Modals, Stats & more!",
|
||||||
|
"features": null,
|
||||||
|
"docker_images": {
|
||||||
|
"ghcr.io\/parkervcp\/yolks:nodejs_20": "ghcr.io\/parkervcp\/yolks:nodejs_20"
|
||||||
|
},
|
||||||
|
"file_denylist": [],
|
||||||
|
"startup": "if [[ ! -z ${NODE_PACKAGES} ]]; then npm install ${NODE_PACKAGES}; fi; if [[ ! -z ${UNNODE_PACKAGES} ]]; then npm uninstall ${UNNODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then npm install; fi; node \"\/home\/container\/index.js\" ${NODE_FLAGS};",
|
||||||
|
"config": {
|
||||||
|
"files": "{}",
|
||||||
|
"startup": "{\r\n \"done\": \"STARTUP INFO:\"\r\n}",
|
||||||
|
"logs": "{}",
|
||||||
|
"stop": "^C"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"installation": {
|
||||||
|
"script": "#!\/bin\/bash\r\n# Open Ticket Installation Script (v4.1.2)\r\n# Inspired by: Node.js Installation Script\r\n# \u00a9 DJdj Development\r\n\r\necho -e \"[OT INSTALLER] installing dependencies. please wait...\"\r\napt update\r\napt install -y git curl\r\n\r\necho -e \"[OT INSTALLER] updating npm. please wait...\"\r\nnpm install npm@latest --location=global\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nBRANCH=\"v4.1.2\"\r\n\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"[OT INSTALLER] \/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \"[OT INSTALLER] .git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"[OT INSTALLER] loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"[OT INSTALLER] files found with no git config\"\r\n echo -e \"[OT INSTALLER] closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"https:\/\/github.com\/open-discord-bots\/open-ticket.git\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"[OT INSTALLER] \/mnt\/server is empty.\"\r\n echo -e \"[OT INSTALLER] cloning files into repo.\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"[OT INSTALLER] cloning default branch\"\r\n git clone https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n else\r\n echo -e \"[OT INSTALLER] cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n fi\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing Open Ticket node.js packages.\"\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --omit=dev\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing custom node.js packages.\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\necho -e \"[OT INSTALLER] install complete!\"\r\nexit 0",
|
||||||
|
"container": "node:latest",
|
||||||
|
"entrypoint": "bash"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "Additional Npm Packages",
|
||||||
|
"description": "Specify additional npm packages used by Open Ticket plugins. Use spaces to separate.",
|
||||||
|
"env_variable": "NODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Startup Flags",
|
||||||
|
"description": "Start the bot with additional Open Ticket flags. Separate using spaces.\r\nA full reference list can be found in the documentation.",
|
||||||
|
"env_variable": "NODE_FLAGS",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Uninstall Npm Packages",
|
||||||
|
"description": "A list of npm packages to uninstall. Separate by spaces.",
|
||||||
|
"env_variable": "UNNODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
{
|
||||||
|
"_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO",
|
||||||
|
"meta": {
|
||||||
|
"version": "PTDL_v2",
|
||||||
|
"update_url": null
|
||||||
|
},
|
||||||
|
"exported_at": "2025-03-16T18:10:18+01:00",
|
||||||
|
"name": "Open Ticket (v4.1.3)",
|
||||||
|
"author": "support@dj-dj.be",
|
||||||
|
"description": "This is the official Pterodactyl egg for Open Ticket v4.1.3, the most advanced & customisable discord ticket bot that you will ever find! You can customise up to 300+ variables! This includes Html Transcripts, Advanced Plugins, Custom Embeds, Questions\/Modals, Stats & more!",
|
||||||
|
"features": null,
|
||||||
|
"docker_images": {
|
||||||
|
"ghcr.io\/parkervcp\/yolks:nodejs_20": "ghcr.io\/parkervcp\/yolks:nodejs_20"
|
||||||
|
},
|
||||||
|
"file_denylist": [],
|
||||||
|
"startup": "if [[ ! -z ${NODE_PACKAGES} ]]; then npm install ${NODE_PACKAGES}; fi; if [[ ! -z ${UNNODE_PACKAGES} ]]; then npm uninstall ${UNNODE_PACKAGES}; fi; if [ -f \/home\/container\/package.json ]; then npm install; fi; node \"\/home\/container\/index.js\" ${NODE_FLAGS};",
|
||||||
|
"config": {
|
||||||
|
"files": "{}",
|
||||||
|
"startup": "{\r\n \"done\": \"STARTUP INFO:\"\r\n}",
|
||||||
|
"logs": "{}",
|
||||||
|
"stop": "^C"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"installation": {
|
||||||
|
"script": "#!\/bin\/bash\r\n# Open Ticket Installation Script (v4.1.3)\r\n# Inspired by: Node.js Installation Script\r\n# \u00a9 DJdj Development\r\n\r\necho -e \"[OT INSTALLER] installing dependencies. please wait...\"\r\napt update\r\napt install -y git curl\r\n\r\necho -e \"[OT INSTALLER] updating npm. please wait...\"\r\nnpm install npm@latest --location=global\r\n\r\nmkdir -p \/mnt\/server\r\ncd \/mnt\/server\r\n\r\nBRANCH=\"v4.1.3\"\r\n\r\nif [ \"$(ls -A \/mnt\/server)\" ]; then\r\n echo -e \"[OT INSTALLER] \/mnt\/server directory is not empty.\"\r\n if [ -d .git ]; then\r\n echo -e \"[OT INSTALLER] .git directory exists\"\r\n if [ -f .git\/config ]; then\r\n echo -e \"[OT INSTALLER] loading info from git config\"\r\n ORIGIN=$(git config --get remote.origin.url)\r\n else\r\n echo -e \"[OT INSTALLER] files found with no git config\"\r\n echo -e \"[OT INSTALLER] closing out without touching things to not break anything\"\r\n exit 10\r\n fi\r\n fi\r\n\r\n if [ \"${ORIGIN}\" == \"https:\/\/github.com\/open-discord-bots\/open-ticket.git\" ]; then\r\n echo \"pulling latest from github\"\r\n git pull\r\n fi\r\nelse\r\n echo -e \"[OT INSTALLER] \/mnt\/server is empty.\"\r\n echo -e \"[OT INSTALLER] cloning files into repo.\"\r\n if [ -z ${BRANCH} ]; then\r\n echo -e \"[OT INSTALLER] cloning default branch\"\r\n git clone https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n else\r\n echo -e \"[OT INSTALLER] cloning ${BRANCH}'\"\r\n git clone --single-branch --branch ${BRANCH} https:\/\/github.com\/open-discord-bots\/open-ticket.git .\r\n fi\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing Open Ticket node.js packages.\"\r\nif [ -f \/mnt\/server\/package.json ]; then\r\n \/usr\/local\/bin\/npm install --omit=dev\r\nfi\r\n\r\necho -e \"[OT INSTALLER] installing custom node.js packages.\"\r\nif [[ ! -z ${NODE_PACKAGES} ]]; then\r\n \/usr\/local\/bin\/npm install ${NODE_PACKAGES}\r\nfi\r\n\r\necho -e \"[OT INSTALLER] install complete!\"\r\nexit 0",
|
||||||
|
"container": "node:latest",
|
||||||
|
"entrypoint": "bash"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"variables": [
|
||||||
|
{
|
||||||
|
"name": "Additional Npm Packages",
|
||||||
|
"description": "Specify additional npm packages used by Open Ticket plugins. Use spaces to separate.",
|
||||||
|
"env_variable": "NODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Startup Flags",
|
||||||
|
"description": "Start the bot with additional Open Ticket flags. Separate using spaces.\r\nA full reference list can be found in the documentation.",
|
||||||
|
"env_variable": "NODE_FLAGS",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Uninstall Npm Packages",
|
||||||
|
"description": "A list of npm packages to uninstall. Separate by spaces.",
|
||||||
|
"env_variable": "UNNODE_PACKAGES",
|
||||||
|
"default_value": "",
|
||||||
|
"user_viewable": false,
|
||||||
|
"user_editable": true,
|
||||||
|
"rules": "string|nullable",
|
||||||
|
"field_type": "text"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# 🎥 Content Creators
|
||||||
|
Hi there! We're searching for content creators to create tutorials & setup guides for Open Ticket.
|
||||||
|
You can get many great rewards from helping us!
|
||||||
|
|
||||||
|
You can choose which type of tutorial you want to make. You can create a quick setup, full setup, plugin tutorial or something else!
|
||||||
|
You are not required to talk in the video, but make sure it has some kind of subtitles instead.
|
||||||
|
|
||||||
|
### 📄 Requirements
|
||||||
|
- 📌 Video length of at least 2 minutes.
|
||||||
|
- 📌 Provide a link to the Open Ticket repository in the description of the video.
|
||||||
|
- 📌 Please use the latest version of Open Ticket available at the time of making the video.
|
||||||
|
- 📌 **(Optional)** Recommended language is English.
|
||||||
|
- 📌 **(Optional)** Recommended platform is YouTube!
|
||||||
|
- 📌 **(Optional)** Speech in the video *(AI is allowed)*
|
||||||
|
|
||||||
|
|
||||||
|
### 🎁 Rewards
|
||||||
|
We won't give out any compensation in money, but we will give you some advantages!
|
||||||
|
- ✅ Advertisement of tutorial in the [README.md](../README.md)!
|
||||||
|
- ✅ Advertisement of channel in our [discord server](https://discord.dj-dj.be)!
|
||||||
|
- ✅ `Content Creator` role in our [discord server](https://discord.dj-dj.be)!
|
||||||
|
- ✅ Advertisement of tutorial & channel in documentation!
|
||||||
|
- ✅ Lot's of of views generated from GitHub traffic!
|
||||||
|
- ✅ A completely free 24/7 hosted Open Ticket bot!
|
||||||
|
- ✅ We will advertise the video to all our socials!
|
||||||
|
|
||||||
|
### 💤 Outdated Content
|
||||||
|
When a tutorial or setup guide is outdated or no longer applicable,
|
||||||
|
we will remove it from the `README.md` & documentation.
|
||||||
|
Your channel will still stay in the list of contributors, so don't worry about that!
|
||||||
|
|
||||||
|
You will be noticed at least a month before removal.
|
||||||
|
This way you can take time to create an updated tutorial if you want.
|
||||||
|
|
||||||
|
### 💬 Contact Us
|
||||||
|
If you've read all these guidelines, requirements & rewards,
|
||||||
|
you can create a ticket in our [discord server](https://discord.dj-dj.be) to start working on it!
|
||||||
|
|
||||||
|
We will try to help you as fast as possible!
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
# Contributing Guidelines
|
||||||
|
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket Logo" width="500px">
|
||||||
|
|
||||||
|
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/open-discord-bots/open-ticket/releases/tag/v4.1.3) [](https://github.com/sponsors/DJj123dj)
|
||||||
|
|
||||||
|
These are the Contributing Guidelines of Open Ticket!<br>
|
||||||
|
Here you can find everything you need to know about contributing to Open Ticket.<br>
|
||||||
|
This includes new features, translations & bug fixes.
|
||||||
|
|
||||||
|
### 💬 Translations
|
||||||
|
#### Step 1: View & Check
|
||||||
|
1. Check the [`./languages/`](./languages/) folder for existing translations.
|
||||||
|
2. When it doesn't exist yet, visit **[step 2](#step-2-translation)**.
|
||||||
|
3. When it does exist, check if it is outdated, incorrect or incomplete.
|
||||||
|
4. If you match one of these requirements, you can also visit **[step 2](#step-2-translating)**.
|
||||||
|
|
||||||
|
#### Step 2: Translation
|
||||||
|
1. If your language doesn't exist yet, copy the [`english.json`](./../languages/english.json) file and rename it to your language.
|
||||||
|
2. **(❌ Not Recommended)** You are allowed to use `Google Translate` or `DeepL`, but only when you say it in the pull request and enable the `"automated"` boolean.
|
||||||
|
3. Only translate existing values in the json file. Don't add or remove any values from the file.
|
||||||
|
4. You're **NOT REQUIRED** to translate everything! If you only want to translate a part of it, it's okay!
|
||||||
|
5. If you are unable to translate something, leave it in `English`.
|
||||||
|
|
||||||
|
#### Step 3: Metadata
|
||||||
|
Metadata can be found in the `_TRANSLATION` variable.
|
||||||
|
|Value |Notes |
|
||||||
|
|--------------|-------------------------------------------------------------------------------------------------|
|
||||||
|
|`otversion` |The Open Ticket version of this translation. **❌ DON'T EDIT!** |
|
||||||
|
|`translators` |The discord usernames from the translators. Add your name to the list when you've contributed. |
|
||||||
|
|`lastedited` |The last edited date in the `DD/MM/YYYY` format. |
|
||||||
|
|`language` |The full name of the language with capital letter. |
|
||||||
|
|`automated` |Enable this boolean when this translation has been made using ChatGPT, Google Translate, ... |
|
||||||
|
|
||||||
|
> #### ✅ You are also allowed to add your username to the [`README.md`](./../README.md) translator list!
|
||||||
|
|
||||||
|
#### Step 4: Uploading
|
||||||
|
1. When adding a new language, please mention @DJj123dj. He will add the code required for the language to work.
|
||||||
|
2. There are currently 3 ways of uploading translations:
|
||||||
|
- Create a pull request to the [__`dev` branch!__](https://github.com/open-discord-bots/open-ticket/tree/dev)
|
||||||
|
- Create a ticket in our [discord server](https://discord.dj-dj.be)!
|
||||||
|
- Send a DM to @DJj123dj on discord!
|
||||||
|
3. Now you'll need to wait until the next Open Ticket version for it to be added.
|
||||||
|
|
||||||
|
#### Step 5: Rewards
|
||||||
|
Translators get some rewards for translating Open Ticket!
|
||||||
|
- ✅ Credits in the [`README.md`](./../README.md) translator list!
|
||||||
|
- ✅ Credits in the changelog!
|
||||||
|
- ✅ Credits in the documentation!
|
||||||
|
- ✅ Credits in the translation JSON file!
|
||||||
|
- ✅ A special role in our [Discord server](https://discord.dj-dj.be)!
|
||||||
|
|
||||||
|
### 🧩 Plugins
|
||||||
|
#### Step 1: Creating Plugins
|
||||||
|
The documentation for creating plugins will be ready soon!<br>
|
||||||
|
In the meantime, you can already look at existing plugins or try it at your own!
|
||||||
|
|
||||||
|
#### Step 2: Uploading Plugins
|
||||||
|
Create a pull request in the [**`open-discord-plugins`**](https://odplugins.dj-dj.be/) repository or contact DJj123dj in our [Discord server](https://discord.dj-dj.be)!
|
||||||
|
|
||||||
|
### 📦 Features
|
||||||
|
Feature requests are required to be made in one of the following ways:
|
||||||
|
- ✅ In our [Discord server](https://discord.dj-dj.be)
|
||||||
|
- ✅ Create an issue on GitHub
|
||||||
|
- ✅ Message DJj123dj in DM on Discord
|
||||||
|
- ✅ Email to support@dj-dj.be
|
||||||
|
|
||||||
|
> **We won't accept pull requests for features. Only for bugs, small fixes, translation and plugins!**
|
||||||
|
|
||||||
|
### 🕷️ Bug Fixes
|
||||||
|
You are able to report bugs in one of the following ways:
|
||||||
|
- ✅ In our [Discord server](https://discord.dj-dj.be)
|
||||||
|
- ✅ Create an issue on GitHub
|
||||||
|
- ✅ Message DJj123dj in DM on Discord
|
||||||
|
- ✅ Email to support@dj-dj.be
|
||||||
|
|
||||||
|
📌 **If you want, you can also create a pull request to fix the bug yourself :)**
|
||||||
|
|
||||||
|
#### 🔴 Security Vulnerabilities
|
||||||
|
If you've found a bug which could affect the **SECURITY OF THE BOT** or may be potentially dangerous to the users of the bot,
|
||||||
|
you are **REQUIRED to send the bug privately via one of the following methods:**
|
||||||
|
- 🔴 Message DJj123dj in DM on Discord
|
||||||
|
- 🔴 Email to support@dj-dj.be
|
||||||
|
|
||||||
|
> ### Please try to always include the `otdebug.txt` file!
|
||||||
|
|
||||||
|
---
|
||||||
|
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket Logo" width="170px">
|
||||||
|
|
||||||
|
**Contributing Guidelines**<br>
|
||||||
|
[Changelog](https://otgithub.dj-dj.be/releases) - [Documentation](https://otdocs.dj-dj.be) - [Website](https://openticket.dj-dj.be) - [Support Server](https://discord.dj-dj.be) - [License](./LICENSE.md)<br>
|
||||||
|
|
||||||
|
© 2021 - 2026 - [DJdj Development](https://www.dj-dj.be) - [Terms](https://www.dj-dj.be/terms) - [Privacy Policy](https://www.dj-dj.be/privacy) - [Support Us](https://github.com/sponsors/DJj123dj)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
github: DJj123dj
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
name: Bug Report
|
||||||
|
about: Report bugs to help us improve Open Ticket!
|
||||||
|
title: "Your Bug Name"
|
||||||
|
---
|
||||||
|
|
||||||
|
### Bug Description:
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
### Steps To Reproduce:
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
> Leave empty when you are unable to reproduce the bug!
|
||||||
|
|
||||||
|
### Expected Behaviour:
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
### Screenshots:
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
### Files:
|
||||||
|
Please include the `otdebug.txt` file in your report! With this file, we can take a deep-dive in to the error that happend.
|
||||||
|
> This file doesn't contain any credentials or sensitive information!
|
||||||
|
|
||||||
|
### Additional Notes:
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
name: Documentation
|
||||||
|
about: Do you know anything to be improved in the Open Ticket documentation?
|
||||||
|
title: "Documentation Improvement Name"
|
||||||
|
labels: "Documentation"
|
||||||
|
---
|
||||||
|
|
||||||
|
### Related Docs/Systems:
|
||||||
|
Choose related systems/docs for this improvement/change:
|
||||||
|
- [ ] Guides
|
||||||
|
- [ ] Developer Guides
|
||||||
|
- [ ] API Reference
|
||||||
|
- [ ] Blog
|
||||||
|
- [ ] System (Docusaurus & Javascript)
|
||||||
|
- [ ] Assets (images)
|
||||||
|
- [ ] Other
|
||||||
|
|
||||||
|
### Improvement Description:
|
||||||
|
A clear and concise description of the improvement.
|
||||||
|
|
||||||
|
> Please explain it as detailed as possible!
|
||||||
|
|
||||||
|
### Screenshots:
|
||||||
|
If applicable, add screenshots to help explain your request.
|
||||||
|
|
||||||
|
### Additional Notes:
|
||||||
|
Add any other context about the request here.
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
---
|
||||||
|
name: Feature Request
|
||||||
|
about: Do you have a great idea for Open Ticket? Let us know using this issue!
|
||||||
|
title: "Your Feature Name"
|
||||||
|
labels: "Concept"
|
||||||
|
---
|
||||||
|
|
||||||
|
### Feature Description:
|
||||||
|
A clear and concise description of what the feature is.
|
||||||
|
|
||||||
|
### Affected Systems
|
||||||
|
Systems which are affected, improved or modified:
|
||||||
|
- (example) Slash command registration...
|
||||||
|
- (example) API embed builders...
|
||||||
|
- Scroll down to '....'
|
||||||
|
- See error
|
||||||
|
|
||||||
|
> Leave empty when you don't know which parts this feature affects!
|
||||||
|
|
||||||
|
### Advantages & Use Cases:
|
||||||
|
What advantages & use cases do you think this feature would result in?
|
||||||
|
|
||||||
|
### Screenshots:
|
||||||
|
If applicable, add screenshots to help explain your feature request.
|
||||||
|
|
||||||
|
### Additional Notes:
|
||||||
|
Add any other context about the request here.
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: HTML Transcripts
|
||||||
|
about: Found a bug related to the HTML Transcripts? Or do you have a feature request?
|
||||||
|
title: "Your Bug/Improvement Name"
|
||||||
|
labels: "HTML Transcripts"
|
||||||
|
---
|
||||||
|
|
||||||
|
### Feature/Bug Description:
|
||||||
|
A clear and concise description of what the feature/bug report is.
|
||||||
|
|
||||||
|
### Screenshots:
|
||||||
|
If applicable, add screenshots to help explain your feature request or bug report.
|
||||||
|
|
||||||
|
### Files:
|
||||||
|
Please include the `otdebug.txt` file in your report! With this file, we can take a deep-dive in to the error that happend.
|
||||||
|
> #### Include this file for bug reports!
|
||||||
|
> This file doesn't contain any credentials or sensitive information!
|
||||||
|
|
||||||
|
### Additional Notes:
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
---
|
||||||
|
name: New Language
|
||||||
|
about: Do you want to add a new language to Open Ticket?
|
||||||
|
title: "Language Name"
|
||||||
|
labels: "New Translation"
|
||||||
|
---
|
||||||
|
|
||||||
|
### Language Name
|
||||||
|
The name of the new language.
|
||||||
|
|
||||||
|
### Language Description/Details:
|
||||||
|
A clear and concise description of the translation/language.
|
||||||
|
|
||||||
|
### Checklist
|
||||||
|
Before the language is fully implemented, the following checklist must be met:
|
||||||
|
- [ ] **📌 Created a language file in the `./languages/` directory.**
|
||||||
|
- [ ] **📌 The translation file uses the `<lowercase-language-name>.json` format.**
|
||||||
|
- [ ] **📌 The `"_TRANSLATION"` metadata in the language file is correctly configured.**
|
||||||
|
- [ ] The `"otversion"` is correct.
|
||||||
|
- [ ] The `"translators"` list is up to date has the discord/github usernames from all translators.
|
||||||
|
- [ ] The `"lastedited"` variable is the last edited date in the following format: `DD/MM/YYYY`.
|
||||||
|
- [ ] The `"language"` variable is the name of the language in English.
|
||||||
|
- [ ] `"automated"` is enabled when `Google Translate`, `DeepL`, `ChatGPT` or any other kind of translation tools were used.
|
||||||
|
- [ ] **📌 The language has been added to the `README.md` list.**
|
||||||
|
- [ ] **📌 The language counters have been updated in the `README.md`.**
|
||||||
|
- [ ] **📌 The language has been added to the list in the `ODLanguageManagerIds_Default` interface in (`./src/core/api/defaults/language.ts`).**
|
||||||
|
- [ ] **📌 The language has been added to the list in `./src/data/languageLoader.ts`.**
|
||||||
|
|
||||||
|
### Additional Notes:
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
name: Plugin Request
|
||||||
|
about: Do you have an idea for an Open Ticket plugin?
|
||||||
|
title: "Your Plugin Name"
|
||||||
|
labels: "Plugin"
|
||||||
|
---
|
||||||
|
|
||||||
|
### Plugin Description:
|
||||||
|
A clear and concise description of what the plugin is & does.
|
||||||
|
|
||||||
|
> Please explain the plugin as detailed as possible!
|
||||||
|
|
||||||
|
### Advantages & Use Cases:
|
||||||
|
What advantages & use cases do you think this plugin would result in?
|
||||||
|
|
||||||
|
### Screenshots:
|
||||||
|
If applicable, add screenshots to help explain your plugin request.
|
||||||
|
|
||||||
|
### Additional Notes:
|
||||||
|
Add any other context about the request here.
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
name: Question
|
||||||
|
about: Do you have a question about Open Ticket?
|
||||||
|
title: "My Question"
|
||||||
|
labels: "Question"
|
||||||
|
---
|
||||||
|
|
||||||
|
### Question:
|
||||||
|
A clear and concise description of the question.
|
||||||
|
|
||||||
|
> Please explain the question as detailed as possible!
|
||||||
|
|
||||||
|
### Screenshots:
|
||||||
|
If applicable, add screenshots to help explain your plugin request.
|
||||||
|
|
||||||
|
### Checklist:
|
||||||
|
Before creating this question, the following checklist must be met:
|
||||||
|
- [ ] **📌 I've read the docs (https://otdocs.dj-dj.be) and I didn't found the solution.**
|
||||||
|
- [ ] **📌 I've asked other people & they didn't know the solution.**
|
||||||
|
- [ ] **📌 The question is not related to the following subjects: (If so, ask it in our discord server: https://discord.dj-dj.be)**
|
||||||
|
- Configuring the bot
|
||||||
|
- Hosting the bot (24/7)
|
||||||
|
- Updating the bot
|
||||||
|
- [ ] **📌 I know that this issue is publicly visible for everyone and I haven't shared any private info.**
|
||||||
|
|
||||||
|
|
||||||
|
### Additional Notes:
|
||||||
|
Add any other context about the request here.
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
---
|
||||||
|
name: Updated Language
|
||||||
|
about: Do you want to update/improve an existing language in Open Ticket?
|
||||||
|
title: "Language Name"
|
||||||
|
labels: "Updated Translation"
|
||||||
|
---
|
||||||
|
|
||||||
|
### Language Name
|
||||||
|
The name of the existing language.
|
||||||
|
|
||||||
|
### Language Description/Details:
|
||||||
|
A clear and concise description of the translation/language changes.
|
||||||
|
|
||||||
|
### Checklist
|
||||||
|
Before the language is updated, the following checklist must be met:
|
||||||
|
- [ ] **📌 The `"_TRANSLATION"` metadata in the language file is correctly configured.**
|
||||||
|
- [ ] The `"otversion"` is correct.
|
||||||
|
- [ ] The `"translators"` list is up to date has the discord/github usernames from all translators.
|
||||||
|
- [ ] The `"lastedited"` variable is the last edited date in the following format: `DD/MM/YYYY`.
|
||||||
|
- [ ] The `"language"` variable is the name of the language in English.
|
||||||
|
- [ ] `"automated"` is enabled when `Google Translate`, `DeepL`, `ChatGPT` or any other kind of translation tools were used.
|
||||||
|
|
||||||
|
### Additional Notes:
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
# Security Policy
|
||||||
|
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket Logo" width="500px">
|
||||||
|
|
||||||
|
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/open-discord-bots/open-ticket/releases/tag/v4.0.4) [](https://github.com/sponsors/DJj123dj)
|
||||||
|
|
||||||
|
This is the Security Policy of Open Ticket!<br>
|
||||||
|
Here you can find a list of all supported & deprecated versions of the bot.<br>
|
||||||
|
You will also find some guidelines about how to report vulnerabilities, bugs & errors.
|
||||||
|
|
||||||
|
### 📦 Supported Versions
|
||||||
|
Below, you can find a list with the status of every Open Ticket version.<br>
|
||||||
|
This list will be updated on every release.
|
||||||
|
|
||||||
|
- 🟦 In Development **(ideas, bugs, support, html transcripts)**
|
||||||
|
- ✅ Supported **(features, bugs, support, docs, html transcripts)**
|
||||||
|
- 🚧 Maintenance **(support, docs, html transcripts)**
|
||||||
|
- 🟧 Deprecated **(docs only)**
|
||||||
|
- ❌ Fully Deprecated
|
||||||
|
|
||||||
|
| Version | Supported | Notes |
|
||||||
|
|------------|-----------|---------------------------------------------------------------|
|
||||||
|
| 4.2.0 | 🟦 | In Development |
|
||||||
|
| 4.1.x | 🟦 | In Development |
|
||||||
|
| 4.1.3 | ✅ | |
|
||||||
|
| 4.1.2 | ✅ | |
|
||||||
|
| 4.1.1 | ✅ | Supported Until April 2026 (LTS) |
|
||||||
|
| 4.1.0 | 🚧 | |
|
||||||
|
| 4.0.7 | 🚧 | |
|
||||||
|
| 4.0.6 | 🚧 | |
|
||||||
|
| 4.0.5 | 🟧 | Deprecated |
|
||||||
|
| 4.0.4 | 🟧 | Deprecated |
|
||||||
|
| < 4.0.4 | 🟧 | Deprecated, Transcripts v2.0, Documentation Only |
|
||||||
|
| < 4.0.0 | ❌ | |
|
||||||
|
|
||||||
|
### 🕷️ Reporting Vulnerabilities
|
||||||
|
You can report vulnerabilities, errors & bugs using one of the following methods:
|
||||||
|
- Create an issue on GitHub!
|
||||||
|
- Create a ticket in our [discord server](https://discord.dj-dj.be)!
|
||||||
|
- Message @DJj123dj in DM on discord!
|
||||||
|
- Send an E-mail to [support@dj-dj.be](mailto:support@dj-dj.be)!
|
||||||
|
|
||||||
|
When you report a problem, please **give a small description** about what & how it happend.<br>
|
||||||
|
Try to explain the issue in as much detail as possible.
|
||||||
|
|
||||||
|
If possible, try to provide screenshots!
|
||||||
|
|
||||||
|
### Please upload the `otdebug.txt` file together with your bug report!
|
||||||
|
|
||||||
|
---
|
||||||
|
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket Logo" width="170px">
|
||||||
|
|
||||||
|
**Security Policy**<br>
|
||||||
|
[Changelog](https://otgithub.dj-dj.be/releases) - [Documentation](https://otdocs.dj-dj.be) - [Website](https://openticket.dj-dj.be) - [Support Server](https://discord.dj-dj.be) - [License](./LICENSE.md)<br>
|
||||||
|
|
||||||
|
© 2021 - 2026 - [DJdj Development](https://www.dj-dj.be) - [Terms](https://www.dj-dj.be/terms) - [Privacy Policy](https://www.dj-dj.be/privacy) - [Support Us](https://github.com/sponsors/DJj123dj)
|
||||||
+20
-13
@@ -1,16 +1,23 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
package-lock.json
|
package-lock.json
|
||||||
devConfig.json
|
|
||||||
devConfig1.json
|
|
||||||
devConfig2.json
|
|
||||||
devConfig3.json
|
|
||||||
devConfig4.json
|
|
||||||
devConfig5.json
|
|
||||||
.DS_Store
|
|
||||||
openticketdebug.txt
|
|
||||||
developerChangelog.md
|
|
||||||
storage/dynamicDB/
|
|
||||||
storage/.DS_Store
|
|
||||||
.vscode/
|
.vscode/
|
||||||
livestatus.json
|
|
||||||
test.js
|
devconfig/
|
||||||
|
devdatabase/
|
||||||
|
plugins/*
|
||||||
|
!plugins/example-plugin/
|
||||||
|
database/openticket.sqlite
|
||||||
|
dist/
|
||||||
|
|
||||||
|
otdebug.txt
|
||||||
|
|
||||||
|
.DS_Store
|
||||||
|
*/.DS_Store
|
||||||
|
*/*/.DS_Store
|
||||||
|
*/*/*/.DS_Store
|
||||||
|
**/.DS_Store
|
||||||
|
|
||||||
|
.docs/*
|
||||||
|
!.docs/createDocs.js
|
||||||
|
!.docs/mergeTranslations.js
|
||||||
|
!.docs/typedoc-config.json
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# comming soon
|
|
||||||
For now on, you can create a ticket in our server:
|
|
||||||
https://discord.dj-dj.be
|
|
||||||
+41
-2
@@ -1,7 +1,17 @@
|
|||||||
|
<!-- omit from toc -->
|
||||||
|
# Open Ticket (License)
|
||||||
|
© 2021 - 2026 - DJj123dj & Contributors
|
||||||
|
|
||||||
|
#### Table Of Contents
|
||||||
|
- [General License](#general-license)
|
||||||
|
- [Additional Terms for Open Ticket](#additional-terms-for-open-ticket)
|
||||||
|
|
||||||
|
### General License
|
||||||
|
```
|
||||||
GNU GENERAL PUBLIC LICENSE
|
GNU GENERAL PUBLIC LICENSE
|
||||||
Version 3, 29 June 2007
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
Copyright (C) 2026 DJdj Development. <https://www.dj-dj.be/>
|
||||||
Everyone is permitted to copy and distribute verbatim copies
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
of this license document, but changing it is not allowed.
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
@@ -70,7 +80,7 @@ modification follow.
|
|||||||
|
|
||||||
TERMS AND CONDITIONS
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
0. Definitions.
|
1. Definitions.
|
||||||
|
|
||||||
"This License" refers to version 3 of the GNU General Public License.
|
"This License" refers to version 3 of the GNU General Public License.
|
||||||
|
|
||||||
@@ -672,3 +682,32 @@ may consider it more useful to permit linking proprietary applications with
|
|||||||
the library. If this is what you want to do, use the GNU Lesser General
|
the library. If this is what you want to do, use the GNU Lesser General
|
||||||
Public License instead of this License. But first, please read
|
Public License instead of this License. But first, please read
|
||||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||||
|
```
|
||||||
|
|
||||||
|
### Additional Terms for Open Ticket
|
||||||
|
#### Terminology:
|
||||||
|
1. **“Software”**
|
||||||
|
Refers to the Open Ticket source code, documentation, and any associated files distributed under this license, including any modifications or derivative works thereof.
|
||||||
|
|
||||||
|
1. **“Public Discord Bot**
|
||||||
|
A Discord bot that is made publicly available for use by multiple, unrelated Discord servers or users, where the bot’s functionality is provided as a service rather than for private or personal use.
|
||||||
|
|
||||||
|
1. **“Monetized Service”**
|
||||||
|
Refers to any service or deployment that generates direct or indirect revenue through the use of the Software. This includes, but is not limited to, subscriptions, premium features, paid hosting, advertisements.
|
||||||
|
|
||||||
|
1. **“For-Profit Discord Server”**
|
||||||
|
Means a Discord server that generates income, revenue, or other material benefits, whether through memberships, donations, or other monetization strategies.
|
||||||
|
|
||||||
|
1. **“Private Use”**
|
||||||
|
Refers to using the Software on a limited number of Discord servers controlled or operated by a single individual or organization, not made available as a public service to multiple unrelated users.
|
||||||
|
|
||||||
|
#### Additional Terms:
|
||||||
|
The following additional terms apply to the use of this software:
|
||||||
|
|
||||||
|
1. This software may not be used as (or part of) a public Discord bot that is monetized (e.g., generating revenue through subscriptions, donations, or other forms of payment) without the prior written permission of the original author.
|
||||||
|
|
||||||
|
2. This software may not be used as (or part of) a public Discord bot on multiple Discord servers without attribution to the original author.
|
||||||
|
|
||||||
|
3. You are allowed to use this bot in a Discord server that makes money or is for-profit, provided that the income is not generated directly from the ticket bot or its functionality.
|
||||||
|
|
||||||
|
These additional terms are an extension to the GNU GPL v3 and must be followed alongside the original license terms. In case of any conflict between these additional terms and the GNU GPL v3, the additional terms shall take precedence.
|
||||||
@@ -1,59 +1,263 @@
|
|||||||
# Open Ticket
|
<p align="center">
|
||||||
[](https://discord.com/invite/26vT9wt3n3) [](https://github.com/DJj123dj/open-ticket/releases/tag/v3.0.0) []() [](https://github.com/DJj123dj/open-ticket/blob/main/LICENSE) [](https://docs.openticket.dj-dj.be)
|
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket" width="650px"><br>
|
||||||
|
<span align="center"><b>The most advanced self-hosted ticket bot for Discord</b></span><br>
|
||||||
|
<sub align="center">Related Projects:</sub><br>
|
||||||
|
<a href="https://odplugins.dj-dj.be"><img src="https://apis.dj-dj.be/cdn/opendiscord/logo.png" alt="Open Discord" height="55px"></a><br><br>
|
||||||
|
<a href="https://discord.com/invite/26vT9wt3n3"><img alt="Discord Invite Link" src="https://img.shields.io/badge/discord-support%20server-5865F2.svg?style=flat-square&logo=discord"></img></a>
|
||||||
|
<a href="https://github.com/open-discord-bots/open-ticket/releases/tag/v4.1.3"><img alt="Open Ticket Version" src="https://img.shields.io/badge/version-4.1.3-brightgreen.svg?style=flat-square"></img></a>
|
||||||
|
<a href="https://otdocs.dj-dj.be"><img alt="Open Ticket Documentation" src="https://img.shields.io/badge/discord.js-v14-CB3837.svg?style=flat-square&logo=npm"></img></a>
|
||||||
|
<a href="https://github.com/open-discord-bots/open-ticket/blob/main/LICENSE"><img alt="Open Ticket License" src="https://img.shields.io/badge/license-GPL%203.0-important.svg?style=flat-square"></img></a>
|
||||||
|
<a href="https://otdocs.dj-dj.be"><img alt="Open Ticket Stars" src="https://img.shields.io/github/stars/djj123dj/open-ticket?color=yellow&label=stars&logo=github&style=flat-square"></img></a>
|
||||||
|
<br>
|
||||||
|
<a href="https://github.com/sponsors/DJj123dj"><img alt="Sponsor DJj123dj" src="https://img.shields.io/badge/sponsor-DJj123dj-ea4aaa?style=flat-square&logo=githubsponsors"></img></a>
|
||||||
|
<a href="https://hub.docker.com/repository/docker/djj123dj/open-ticket"><img alt="Open Ticket supports Docker!" src="https://img.shields.io/badge/docker-supported-2496ED?style=flat-square&logo=docker"></img></a>
|
||||||
|
<a href=".eggs/README.md"><img alt="Open Ticket supports Pterodactyl Eggs!" src="https://img.shields.io/badge/pterodactyl-supported-10539F?style=flat-square&logo=pterodactyl"></img></a>
|
||||||
|
</p>
|
||||||
|
|
||||||
Open ticket is the most configurable open-source ticket bot for discord! Made with the newest technologies. Like: Slash commands, transcripts, multiple ticket types, buttons & dropdowns!
|
<p align="center">
|
||||||
Start using it now, you can do anything!
|
Open Ticket is the most <b>advanced and customizable</b> Discord ticket bot available. With <b>350+ configurable settings</b>, you have full control over every aspect of your ticket system!
|
||||||
|
From <code>HTML transcripts</code> and <code>Advanced Plugins</code> to <code>Claiming & Pinning</code>, <code>Questions & Modals</code>, <code>Detailed Statistics</code>, and much more.<br><br>
|
||||||
|
The bot is fully translated into <b>36+ languages</b> and has been battle-tested in large Discord servers.<br>
|
||||||
|
Need help or want to get involved? Feel free to join our <a href="https://discord.dj-dj.be"><b>Discord server</b></a>.
|
||||||
|
</p>
|
||||||
|
|
||||||
*We love to hear suggestions for more features!*
|
<h3 align="center"><b>⭐️ Support Open Ticket’s growth by starring this repo! ⭐️</b></h3>
|
||||||
|
<p align="center"><sup>❤️ Love Open Ticket? <a href="https://github.com/sponsors/DJj123dj">Sponsorships</a> help fuel our HTML transcript servers and future features! ❤️</sup></p>
|
||||||
|
|
||||||
<img src="logo.png" alt="Open Ticket logo" style="height: 200px; width:200px;"/>
|
---
|
||||||
|
> **[-> Navigate to (⏱️ Quick Setup)](#️-quick-start-using-cli)**
|
||||||
|
> **[-> Navigate to (📚 Documentation)](https://otdocs.dj-dj.be)**
|
||||||
|
> **[-> Navigate to (📞 Support Server)](https://discord.dj-dj.be)**
|
||||||
|
|
||||||
[](https://www.github.com/DJj123dj/open-ticket/wiki)
|
### 📌 Features
|
||||||
|
- **⏳ Quick Setup** - Using the interactive Quick Setup CLI, you can **configure Open Ticket in less than 5min!**
|
||||||
|
- **🦇 Pterodactyl Support** - Open Ticket works perfect on Pterodactyl based panels. [(Download official eggs)](.eggs/README.md)
|
||||||
|
- **💩 No Credits** - Your bot won't contain any form of bloat or credits. It's all yours!
|
||||||
|
- **🔒 Private & Secure** - It has been battletested by thousands of servers and **respects security & privacy.**
|
||||||
|
- **📈 Scalable** - Made to handle huge servers and has already been **tested in servers with 100k members.**
|
||||||
|
- **📄 HTML Transcripts** - The **built-in HTML Transcripts Service** provides beautiful & easy-to-use transcripts.
|
||||||
|
- **✅ Ticket Status** - Close, reopen, delete, claim, pin, rename or move tickets in your server.
|
||||||
|
- **🇬🇧 Translation** - Every message has been translated in more than **36 languages** by our community.
|
||||||
|
- **🎨 Customisation** - More than **200+ settings** are related to customisation & advanced features.
|
||||||
|
- **🖥️ Interactions** - The bot has full support for buttons, dropdowns, slash/text commands & modals.
|
||||||
|
- **∞ Unlimited Possibilities** - Create an infinite amount of tickets, questions & panels.
|
||||||
|
- **📝 Advanced Plugins** - Create advanced plugins or use [**pre-made plugins**](#-plugins) by our community.
|
||||||
|
- **👥 Participants** - Add or remove participants & transfer ownership from one user to another.
|
||||||
|
- **📊 Detailed Statistics** - With more than **50+ statistics** for tickets, users & the server.
|
||||||
|
- **🚫 Blacklist** - Blacklist users to prevent them from creating new tickets.
|
||||||
|
- **🚨 Priorities** - Assign different **priority levels** to tickets to mark them as important.
|
||||||
|
- **❓ Modal Questions** - Give users the ability to **answer questions** in a modal before their ticket is created.
|
||||||
|
- **✨ Commands** - Manage all your tickets with more than 28+ commands.
|
||||||
|
- **🤖 Automation** - Automate ticket handling with **autoclose, autodelete** & slow mode.
|
||||||
|
- **😎 Additional Features** - For some weird reason, the bot also supports Reaction Role & URL Buttons.
|
||||||
|
|
||||||
### Thanks to these people:
|
#### And even more using [pre-made community plugins](#-plugins)!
|
||||||
- DJ-Lite: for doing the administration
|
- **💬 Reviews** - Create & manage a support review system.
|
||||||
- Sanke: for translation & new ideas
|
- **📢 Feedback** - Collect feedback & create forms for users to answer.
|
||||||
- Everyone that reported a bug
|
- **⏰ Reminders** - Create & manage customisable reminders.
|
||||||
#### And our translators!
|
- **🏷️ Tags** - Create tags & answer questions automatically using keywords.
|
||||||
- ExothDE
|
- **📝 Forms** - Create advanced forms and automatically ask for repetitive questions.
|
||||||
- 1x1
|
- **🔄 Channel Display** - Create a voice channel with realtime statistics from the ticket system.
|
||||||
- Redactado
|
- **💾 SQLite Database** - Use an `SQLite` database for increased performance.
|
||||||
- t0miiis
|
- **🎉 Custom Embeds** - Create your own embeds and send them using a command.
|
||||||
- josuens14
|
- **🎨 Customisation** - Yep, you heard it right. Even more customisation!
|
||||||
- M4
|
- **😁 And so much more...**
|
||||||
- David.
|
|
||||||
- Maurizio
|
|
||||||
|
|
||||||
## features
|
### ⏱️ Quick Start (Using Interactive CLI Tool)
|
||||||
- discord interaction buttons
|
> 1. Download the latest version of Open Ticket on [Github](https://github.com/open-discord-bots/open-ticket).
|
||||||
- slash & text commands
|
> 2. Make sure Node.js & Npm are installed using `node -v` (minimum `v20`).
|
||||||
- close, delete & re-open tickets
|
> 3. Install any required dependencies using `npm install`.
|
||||||
- translation in 10 different languages
|
> 4. Start the **Quick Setup CLI** using `npm run setup`.
|
||||||
- transcripts
|
> 5. Click on `> ⏱️ Quick Setup` and follow the instructions.
|
||||||
- add/remove users from a ticket
|
> 6. Start the bot using `npm start` or `node index.js`
|
||||||
- a lot of customisation options.
|
> - If required, the bot will give a report of errors that must be solved.
|
||||||
- tickets, reaction roles & links are all possible!
|
> - Follow the instructions and restart the bot.
|
||||||
- choose between buttons or dropdowns!
|
> 7. Enjoy using Open Ticket!
|
||||||
- discord.js v14
|
>
|
||||||
- everyting is configurable
|
> #### 🚦 Navigation
|
||||||
- custom API + plugins
|
> **[-> Navigate to (📚 Documentation)](https://otdocs.dj-dj.be)**
|
||||||
- unlimited tickets spread over multiple messages
|
> **[-> Navigate to (📞 Support Server)](https://discord.dj-dj.be)**
|
||||||
- close with reason
|
> **[-> Navigate to (🧩 Download Plugins)](https://odplugins.dj-dj.be)**
|
||||||
|
>
|
||||||
|
> #### 🖥️ Recommended Hosting
|
||||||
|
> - **A VPS (Virtual Private Server)** - Extra customisation & more stability. Recommended for most servers.
|
||||||
|
> - **Any Pterodactyl-Based Panel** - Easy installation & configuration.
|
||||||
|
|
||||||
*comming soon*
|
### ❤️ Sponsors
|
||||||
- share transcripts
|
Huge thanks to our sponsors for making this project possible. Your support means everything to us.
|
||||||
- view transcripts in html
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td><img src="https://github.com/guillee3.png" alt="Profile Picture" width="100px"></td>
|
||||||
|
<td><img src="https://github.com/yeeetSK.png" alt="Profile Picture" width="100px"></td>
|
||||||
|
<td><img src="https://github.com/jacobhumston.png" alt="Profile Picture" width="100px"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><a href="https://github.com/guillee3"><b>guillee3</b></a></td>
|
||||||
|
<td align="center"><a href="https://github.com/yeeetSK"><b>yeeetSK</b></a></td>
|
||||||
|
<td align="center"><a href="https://github.com/jacobhumston"><b>jacobhumston</b></a></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
## quick start
|
**Past Sponsors:**<br>
|
||||||
[Click here to start your adventure!](https://docs.openticket.dj-dj.be/quick-start)
|
<a href="https://github.com/sponsors/DJj123dj">
|
||||||
|
<img src="https://github.com/SpyEye2.png" alt="SpyEye" width="40px">
|
||||||
|
<img src="https://github.com/mods-hd.png" alt="Mods HD" width="40px">
|
||||||
|
<img src="https://github.com/DOSEV5.png" alt="DOSEV5" width="40px">
|
||||||
|
<img src="https://github.com/BENZORICH.png" alt="BENZORICH" width="40px">
|
||||||
|
</a>
|
||||||
|
|
||||||
## documentation
|
## 📸 Preview
|
||||||
[Official Documentation](https://docs.openticket.dj-dj.be)
|
<img alt="An example of a panel." src="https://apis.dj-dj.be/cdn/openticket/preview-v4/panel-examples.png">
|
||||||
|
<img alt="An example of a ticket message." src="https://apis.dj-dj.be/cdn/openticket/preview-v4/ticket-example.png">
|
||||||
|
<img alt="Examples of built-in commands." src="https://apis.dj-dj.be/cdn/openticket/preview-v4/command-examples.png">
|
||||||
|
|
||||||
## information
|
## 🛠️ Contributors
|
||||||
|
### 🖥️ Team & Contributors
|
||||||
|
A list of amazing people who have contributed or provided supported for **Open Ticket** and **Open Discord**.
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td align="center"><img src="https://github.com/DJj123dj.png" alt="Profile Picture" width="80px"></td>
|
||||||
|
<td align="center"><img src="https://github.com/guillee3.png" alt="Profile Picture" width="80px"></td>
|
||||||
|
<td align="center"><img src="https://github.com/smetsliam.png" alt="Profile Picture" width="80px"></td>
|
||||||
|
<td align="center"><img src="https://github.com/FrankVissers.png" alt="Profile Picture" width="80px"></td>
|
||||||
|
<td align="center"><img src="https://github.com/Sank34.png" alt="Profile Picture" width="80px"></td>
|
||||||
|
<td align="center"><img src="https://github.com/SKaranjaN.png" alt="Profile Picture" width="80px"></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><a href="https://github.com/DJj123dj">💻🧩💬 DJj123dj</a></th>
|
||||||
|
<th><a href="https://github.com/guillee3">🧩💬 Guillee3</a></th>
|
||||||
|
<th><a href="https://github.com/smetsliam">💬 smetsliam</a></th>
|
||||||
|
<th><a href="https://github.com/FrankVissers">💬 Frank Vissers</a></th>
|
||||||
|
<th><a href="https://github.com/Sank34">💬 Sanke</a></th>
|
||||||
|
<th><a href="https://github.com/SKaranjaN">🧩 SKaranjaN</a></th>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
_v3.0.0_
|
### 💬 Translators
|
||||||
|
With the amazing support of our translators, we've been able to translate Open Ticket in more than **36 languages**!
|
||||||
|
#### Categories:
|
||||||
|
- **🟢 Available**
|
||||||
|
- **🤖 Partially Made Using AI**
|
||||||
|
- **🟠 Incomplete**
|
||||||
|
- **🔴 Unavailable/Outdated**
|
||||||
|
|
||||||
changelog: [click here](https://docs.openticket.dj-dj.be/other/changelog)
|
|🔍 |Languages (36) |Maintainer (Github/Discord) |
|
||||||
|
|----|---------------------|--------------------------------|
|
||||||
|
|🟢 |🇬🇧 English |djj123dj |
|
||||||
|
|🟢 |🇳🇱 Dutch |djj123dj |
|
||||||
|
|🟢 |🇩🇪 German |benzorich |
|
||||||
|
|🟢 |🇫🇷 French |guillee.3 |
|
||||||
|
|🟢 |🇪🇸 Spanish |redactado & josuens |
|
||||||
|
|🟢 |🇵🇹 Portuguese |quiradon |
|
||||||
|
|🟢 |🇮🇹 Italian |fraden1mvp. & imperatorix_17 |
|
||||||
|
|🟢 |🇸🇪 Swedish |NoOneNook |
|
||||||
|
|🟢 |🇳🇴 Norwegian |NoOneNook |
|
||||||
|
|🟢 |🇹🇭 Thai |modshd |
|
||||||
|
|🟢 |🇮🇳 Hindi |challenger_nova |
|
||||||
|
|🟢 |🇭🇺 Hungarian |kornel0706 |
|
||||||
|
|🟢 |🇮🇩 Indonesian |erxg |
|
||||||
|
|🟢 |🇱🇹 Lithuanian |tsgindrius |
|
||||||
|
|🟢 |🇺🇦 Ukrainian |anderskiy |
|
||||||
|
|🟢 |🇨🇿 Czech |spyeye_ |
|
||||||
|
|🟢 |🇷🇴 Romanian |sankedev |
|
||||||
|
|🟢 |🇩🇰 Danish |the_gamer |
|
||||||
|
|🟢 |🇹🇷 Turkish |palestinian |
|
||||||
|
|🟢 |🇦🇪 Arabic |palestinian |
|
||||||
|
|🟢 |🇵🇱 Polish |danoglez |
|
||||||
|
|🟢 |🇮🇷 Persian |dysashop & zhavis |
|
||||||
|
|🟢 |🇧🇩 Bengali |HanumeshGupta |
|
||||||
|
|🟢 |❓ Catalan |guillee3 |
|
||||||
|
|🤖 |🇪🇪 Estonian |iamnotmega |
|
||||||
|
|🤖 |🇫🇮 Finnish |iamnotmega |
|
||||||
|
|🤖 |🇯🇵 Japanese |HanumeshGupta |
|
||||||
|
|🤖 |🇬🇷 Greek |HanumeshGupta |
|
||||||
|
|🤖 |🇸🇮 Slovenian |HanumeshGupta |
|
||||||
|
|🤖 |🇰🇷 Korean |HanumeshGupta |
|
||||||
|
|🤖 |🇮🇳 Tamil |HanumeshGupta |
|
||||||
|
|🤖 |🇨🇳 Simplified Chinese |HanumeshGupta |
|
||||||
|
|🤖 |❓ Kurdish |HanumeshGupta |
|
||||||
|
|🤖 |🇷🇺 Russian |NoOneNook |
|
||||||
|
|🤖 |🇱🇻 Latvian |NoOneNook |
|
||||||
|
|🤖 |🇻🇳 Vietnamese |ngocdiep2006 |
|
||||||
|
|🔴 |🇨🇳 Traditional Chinese|[⭐ Contribute!](.github/CONTRIBUTING.md)|
|
||||||
|
<!--[⭐ Contribute!](.github/CONTRIBUTING.md) -->
|
||||||
|
|
||||||
© 2022 - DJdj Development | [website](https://www.dj-dj.be) | [discord](https://discord.dj-dj.be) | [terms of service](https://www.dj-dj.be/terms)
|
## ⭐️ Star History
|
||||||
|
If you enjoy using Open ticket, **consider starring** this repository.
|
||||||
|
This will help us grow and reach even more people!
|
||||||
|
|
||||||
|
<a href="https://star-history.com/#open-discord-bots/open-ticket&Date">
|
||||||
|
<picture>
|
||||||
|
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/svg?repos=open-discord-bots/open-ticket&type=Date&theme=dark" />
|
||||||
|
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/svg?repos=open-discord-bots/open-ticket&type=Date" />
|
||||||
|
<img alt="Star History Chart" src="https://api.star-history.com/svg?repos=open-discord-bots/open-ticket&type=Date" />
|
||||||
|
</picture>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
## 🧩 Plugins
|
||||||
|
**Download all plugins from our [Official Plugin Repository](https://github.com/open-discord-bots/plugins)!**<br>
|
||||||
|
> #### ⭐ Featured Plugins (Top 5 Most Used)
|
||||||
|
> **[`ot-sqlite-database`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-sqlite-database/),
|
||||||
|
> [`ot-reviews`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-reviews/),
|
||||||
|
> [`ot-feedback`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-feedback/),
|
||||||
|
> [`ot-tags`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-tags/),
|
||||||
|
> [`ot-restrictions`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-restrictions/)**
|
||||||
|
|
||||||
|
#### Categories:
|
||||||
|
- **📄 Example** - These plugins serve as an example or starting template.
|
||||||
|
- **📢 Command** - These plugins add new commands to the bot.
|
||||||
|
- **⚙️ Utility** - These plugins help with utility systems. You might not notice them as a ticket user/admin directly.
|
||||||
|
- **🎨 Customisation** - These plugins add even more customisation to the bot.
|
||||||
|
- **💼 Management** - These plugins add features that help you manage your server or ticket system.
|
||||||
|
- **🤖 Client** - These plugins add features affecting the Discord Client or bot itself.
|
||||||
|
- Please Create a new category when your plugin doesn't fit in one of the available categories.
|
||||||
|
|
||||||
|
### 📦 Official *(made by DJdj Development)*
|
||||||
|
|Name |Category |Description |
|
||||||
|
|----------------------------------------------------------------------|----------------------------|-------------------------|
|
||||||
|
|[`example-plugin`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/example-plugin/) |📄 Example |This is just an example plugin for people that want to create their own plugin. |
|
||||||
|
|[`example-command`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/example-command/) |📄 Example |Sample custom command using the Open Discord system. |
|
||||||
|
|[`ot-jump-to-top`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-jump-to-top/) |📢 Command |Add a simple command to jump to the top of the ticket. |
|
||||||
|
|[`ot-kill-switch`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-kill-switch/) |📢 Command |Temporarily disable the ticket system using a kill switch. |
|
||||||
|
|[`ot-hosting-status`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-hosting-status/) |📢 Command |A simple command to send hosting status updates to a channel. |
|
||||||
|
|[`ot-shutdown`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-shutdown/) |📢 Command |A simple command to turn off the bot from a slash command (server & bot owner only). |
|
||||||
|
|[`ot-sqlite-database`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-sqlite-database/) |⚙️ Utility |With this plugin, the database will be an SQLite file. It's a must-have for large servers! |
|
||||||
|
|[`ot-no-slash-clear`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-no-slash-clear/) |⚙️ Utility |Disable the automatic removal of slash commands that aren't used by Open Ticket. |
|
||||||
|
|[`ot-migrate-v3`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-migrate-v3/) |⚙️ Utility |Use this plugin to migrate all tickets from Open Ticket v3 to v4. |
|
||||||
|
|[`ot-ticket-message-extras`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-ticket-message-extras/) |🎨 Customisation |A plugin which adds a few little features to the ticket message. |
|
||||||
|
|[`ot-rename-keep-prefix`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-rename-keep-prefix/) |🎨 Customisation |Simple plugin to keep the channel prefix when using the /rename command. |
|
||||||
|
|[`ot-customise-buttons`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-customise-buttons/) |🎨 Customisation |Customise almost all built-in buttons. This includes the claim, reopen, close & delete buttons. |
|
||||||
|
|[`ot-ephemeral-messages`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-ephemeral-messages/) |🎨 Customisation |Customise for every messages if it needs to be ephemeral or not. |
|
||||||
|
|[`ot-footers`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-footers/) |🎨 Customisation |A simple plugin to add footers in all Open Ticket embeds. |
|
||||||
|
|[`ot-alt-detector`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-alt-detector/) |💼 Management |Use the discord-alt-detector npm package by DJdj Development in your ticket bot. |
|
||||||
|
|[`ot-embeds`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-embeds/) |💼 Management |Create custom premade embeds in the config or use the command to create one from scratch. |
|
||||||
|
|[`ot-move-actions`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-move-actions/) |💼 Management |Automatically unclaim/unpin a ticket when it's moved using `/move`. |
|
||||||
|
|[`ot-reviews`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-reviews/) |💼 Management |Review system for Open Ticket! It is very customisable and has lots of features. |
|
||||||
|
|[`ot-tags`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-tags/) |💼 Management |Use tags to quickly reply with a pre-existing text. |
|
||||||
|
|[`ot-restrictions`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-restrictions/) |💼 Management |Restrict which roles can open a specific ticket option. |
|
||||||
|
|[`ot-better-status`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-better-status/) |🤖 Client |An advanced status plugin to rotate between states. It also allows for the use of variables. |
|
||||||
|
|[`ot-channel-display`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-channel-display/) |🤖 Client |A plugin to show different variables in a voice channel in your server. |
|
||||||
|
|[`ot-vanity`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-vanity/) |🤖 Client |A plugin to detect the vanity status of members in the server and give them exclusive privilleges. |
|
||||||
|
|
||||||
|
### ✅ Verified *(made by community)*
|
||||||
|
|Name |Author |Category |Description |
|
||||||
|
|---------------------------------------------------------------------|----------------------------|----------------------------|-------------------------|
|
||||||
|
|[`ot-config-reload`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-config-reload/) |guillee.3 |⚙️ Utility |This plugin adds a new command that allows reloading the Open Ticket config files without the need for a restart. |
|
||||||
|
|[`ot-feedback`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-feedback/) |an_developer |💼 Management |A plugin to gather feedback of your support service. |
|
||||||
|
|[`ot-assign-role`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-assign-role/) |rapid.fast |💼 Management |This plugin assigns a predefined role to a user upon creating a ticket. |
|
||||||
|
|[`ot-moderation`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-moderation/) |NotMukundOP |💼 Management |A simple moderation plugin for Open Discord with ban, kick & warnings. |
|
||||||
|
|[`ot-template-system`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-template-system/) |DanoGlez |💼 Management |Predefined template system for sending quick messages. |
|
||||||
|
|[`ot-volume-warning`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-volume-warning/) |guillee.3 |💼 Management |Alerts ticket creators when too many tickets are open, indicating possible response delays. |
|
||||||
|
|[`ot-reminders`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-reminders/) |guillee.3 |💼 Management |Set reminders that will be sent to a channel every specified time. |
|
||||||
|
|[`ot-ticket-forms`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-ticket-forms/) |guillee.3 |💼 Management |An advanced forms plugin for Open Ticket. |
|
||||||
|
|[`ot-followups`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-followups/) |guillee.3 |💼 Management |Send additional follow-up messages to a ticket. |
|
||||||
|
|[`ot-twitch-notifier`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-twitch-notifier/) |guillee.3 |💼 Management |Get notified when your favorite Twitch streamers go live. |
|
||||||
|
|[`ot-translate-cmds`](https://github.com/open-discord-bots/plugins/tree/main/open-ticket/ot-translate-cmds/) |guillee.3 |🤖 Client |Translate all built-in command names, descriptions & options. |
|
||||||
|
|
||||||
|
---
|
||||||
|
<img src="https://apis.dj-dj.be/cdn/openticket/logo.png" alt="Open Ticket Logo" width="170px">
|
||||||
|
|
||||||
|
**README.md**<br>
|
||||||
|
[Changelog](https://otgithub.dj-dj.be/releases) - [Documentation](https://otdocs.dj-dj.be) - [Website](https://openticket.dj-dj.be) - [Support Server](https://discord.dj-dj.be) - [License](./LICENSE.md)<br>
|
||||||
|
|
||||||
|
© 2021 - 2026 - [DJdj Development](https://www.dj-dj.be) - [Terms](https://www.dj-dj.be/terms) - [Privacy Policy](https://www.dj-dj.be/privacy) - [Support Us](https://github.com/sponsors/DJj123dj)
|
||||||
|
|||||||
@@ -1,79 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
const DISABLE = require("../core/api/api.json").disable
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
bot.errorLog.log("debug","COMMANDS: loaded add.js")
|
|
||||||
|
|
||||||
if (!DISABLE.commands.text.add) client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"add")) return
|
|
||||||
var user = msg.mentions.users.first()
|
|
||||||
if (!user) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"add <user>`")]})
|
|
||||||
|
|
||||||
if (!msg.guild) return
|
|
||||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(msg.author)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
msg.channel.permissionOverwrites.create(user.id, { ViewChannel:true, AddReactions:true,AttachFiles:true, EmbedLinks:true, SendMessages:true})
|
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.addEmbed(user,msg.author)]})
|
|
||||||
|
|
||||||
var loguser = msg.mentions.users.first()
|
|
||||||
log("command","someone used the 'add' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
log("system","user added to ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"added_user",value:loguser.tag}])
|
|
||||||
|
|
||||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
|
||||||
APIEvents.onTicketAdd(msg.author,loguser,msg.channel,msg.guild,new Date(),{status:"open",name:msg.channel.name,ticketOptions:ticketData})
|
|
||||||
|
|
||||||
APIEvents.onCommand("add",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!DISABLE.commands.slash.add) client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "add") return
|
|
||||||
const user = interaction.options.getUser("user")
|
|
||||||
|
|
||||||
if (!interaction.guild) return
|
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.create(user.id, { ViewChannel:true, AddReactions:true,AttachFiles:true, EmbedLinks:true, SendMessages:true})
|
|
||||||
interaction.reply({embeds:[bot.embeds.commands.addEmbed(user,interaction.user)]})
|
|
||||||
|
|
||||||
var loguser = user
|
|
||||||
log("command","someone used the 'add' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
log("system","user added to ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"added_user",value:loguser.tag}])
|
|
||||||
|
|
||||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
|
||||||
APIEvents.onTicketAdd(interaction.user,loguser,interaction.channel,interaction.guild,new Date(),{status:"open",name:interaction.channel.name,ticketOptions:ticketData})
|
|
||||||
APIEvents.onCommand("add",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
const DISABLE = require("../core/api/api.json").disable
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
bot.errorLog.log("debug","COMMANDS: loaded claim.js")
|
|
||||||
|
|
||||||
if (!DISABLE.commands.text.claim) client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"claim")) return
|
|
||||||
var user = msg.mentions.users.first()
|
|
||||||
|
|
||||||
const claimingUser = user ? user : msg.author
|
|
||||||
|
|
||||||
if (!msg.guild) return
|
|
||||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(msg.author)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
|
|
||||||
//msg.channel.send({embeds:[bot.embeds.commands.claimEmbed(claimingUser,msg.author)]})
|
|
||||||
msg.channel.send({embeds:[bot.errorLog.warning("Coming soon!","This feature isn't ready yet!\nIt will become active in the next update!")]})
|
|
||||||
|
|
||||||
var loguser = claimingUser
|
|
||||||
log("command","someone used the 'claim' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
log("system","user claimed to ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"claimed_user",value:claimingUser.tag}])
|
|
||||||
|
|
||||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
|
||||||
//APIEvents.onTicketAdd(msg.author,loguser,msg.channel,msg.guild,new Date(),{status:"open",name:msg.channel.name,ticketOptions:ticketData})
|
|
||||||
//APIEvents.onCommand("add",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!DISABLE.commands.slash.claim) client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "claim") return
|
|
||||||
const user = interaction.options.getUser("user",false) ? interaction.options.getUser("user",true) : interaction.user
|
|
||||||
|
|
||||||
if (!interaction.guild) return
|
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
//interaction.reply({embeds:[bot.embeds.commands.claimEmbed(user,interaction.user)]})
|
|
||||||
interaction.reply({embeds:[bot.errorLog.warning("Coming soon!","This feature isn't ready yet!\nIt will become active in the next update!")]})
|
|
||||||
|
|
||||||
var loguser = user
|
|
||||||
log("command","someone used the 'claim' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
log("system","user claimed to ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"claimed_user",value:loguser.tag}])
|
|
||||||
|
|
||||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
|
||||||
//APIEvents.onTicketAdd(interaction.user,loguser,interaction.channel,interaction.guild,new Date(),{status:"open",name:interaction.channel.name,ticketOptions:ticketData})
|
|
||||||
//APIEvents.onCommand("add",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,92 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
const DISABLE = require("../core/api/api.json").disable
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
bot.errorLog.log("debug","COMMANDS: loaded close.js")
|
|
||||||
|
|
||||||
if (!DISABLE.commands.text.close) client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"close")) return
|
|
||||||
|
|
||||||
const args = msg.content.substring((config.prefix+"close").length).split(" ")
|
|
||||||
args.shift()
|
|
||||||
/**@type {String|false} */
|
|
||||||
var tempreason = args.join(" ")
|
|
||||||
if (!tempreason || tempreason == " " || tempreason == " "){
|
|
||||||
tempreason = false
|
|
||||||
}
|
|
||||||
const reason = tempreason
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
if (hiddendata.data.find(h => h.key == "pendingdelete")) return msg.channel.send({embeds:[bot.errorLog.warning("Warning!","You can't close a ticket while it's being deleted!")]})
|
|
||||||
|
|
||||||
const descriptionReason = reason ? "**"+l.messages.reason+":** "+reason : false
|
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.closeEmbed(msg.author,descriptionReason)],components:[bot.buttons.close.closeCommandRow]})
|
|
||||||
|
|
||||||
var name = msg.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
require("../core/ticketActions/ticketCloser").NEWcloseTicket(msg.member,msg.channel,prefix,"close",reason,true)
|
|
||||||
|
|
||||||
log("command","someone used the 'close' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
APIEvents.onCommand("close",true,msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!DISABLE.commands.slash.close) client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "close") return
|
|
||||||
|
|
||||||
//interaction.deferReply()
|
|
||||||
|
|
||||||
const reason = interaction.options.getString("reason") ? interaction.options.getString("reason") : false
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
if (hiddendata.data.find(h => h.key == "pendingdelete")) return interaction.reply({embeds:[bot.errorLog.warning("Warning!","You can't close a ticket while it's being deleted!")]})
|
|
||||||
|
|
||||||
const descriptionReason = reason ? "**"+l.messages.reason+":** "+reason : false
|
|
||||||
interaction.reply({embeds:[bot.embeds.commands.closeEmbed(interaction.user,descriptionReason)],components:[bot.buttons.close.closeCommandRow]})
|
|
||||||
|
|
||||||
var name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
require("../core/ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close",false,true)
|
|
||||||
|
|
||||||
log("command","someone used the 'close' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
APIEvents.onCommand("close",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,86 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
const DISABLE = require("../core/api/api.json").disable
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
bot.errorLog.log("debug","COMMANDS: loaded delete.js")
|
|
||||||
|
|
||||||
if (!DISABLE.commands.text.delete) client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"delete")) return
|
|
||||||
|
|
||||||
if (!msg.guild) return
|
|
||||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(msg.author)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.deleteEmbed(msg.author)]})
|
|
||||||
|
|
||||||
var name = msg.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
require("../core/ticketActions/ticketCloser").NEWcloseTicket(msg.member,msg.channel,prefix,"delete",false,true)
|
|
||||||
|
|
||||||
log("command","someone used the 'delete' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
APIEvents.onCommand("delete",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!DISABLE.commands.slash.delete) client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "delete") return
|
|
||||||
|
|
||||||
//interaction.deferReply()
|
|
||||||
|
|
||||||
if (!interaction.guild) return
|
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
|
||||||
return interaction.reply({embeds:[bot.errorLog.noPermsDelete(interaction.user)]})
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
interaction.reply({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
|
||||||
|
|
||||||
var name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
require("../core/ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete",false,true)
|
|
||||||
|
|
||||||
log("command","someone used the 'delete' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
APIEvents.onCommand("delete",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,56 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
const DISABLE = require("../core/api/api.json").disable
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
bot.errorLog.log("debug","COMMANDS: loaded help.js")
|
|
||||||
|
|
||||||
const msgName = config.system.showSlashcmdsInHelp ? "message" : "msg"
|
|
||||||
const prefix = config.system.showSlashcmdsInHelp ? "/" : config.prefix
|
|
||||||
|
|
||||||
const helpEmbed = new discord.EmbedBuilder()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle("❔ "+l.helpMenu.title)
|
|
||||||
|
|
||||||
const header = config.system.ticket_channel ? l.helpMenu.header1.replace("{0}","<#"+config.system.ticket_channel+">") : l.helpMenu.header2
|
|
||||||
helpEmbed.setDescription(header+"`"+prefix+msgName+" <id>` ➜ _"+l.helpMenu.msgCmd+"_\n\n`"+prefix+"rename <name>` ➜ _"+l.helpMenu.renameCmd+"_\n`"+prefix+"close` ➜ _"+l.helpMenu.closeCmd+"_\n`"+prefix+"delete` ➜ _"+l.helpMenu.deleteCmd+"_\n`"+prefix+"reopen` ➜ _"+l.helpMenu.reopenCmd+"_\n\n`"+prefix+"add <user>` ➜ _"+l.helpMenu.addCmd+"_\n`"+prefix+"remove <user>` ➜ _"+l.helpMenu.removeCmd+"_")
|
|
||||||
|
|
||||||
if (config.credits) helpEmbed.setFooter({text:"Open-Ticket by DJdj Development | view on github for source code",iconURL:"https://raw.githubusercontent.com/DJj123dj/open-ticket/main/logo.png"})
|
|
||||||
|
|
||||||
var otherprefix = prefix.endsWith(" ") ? prefix.substring(0,prefix.length-1) : prefix
|
|
||||||
|
|
||||||
if (!DISABLE.commands.text.help) client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix)) return
|
|
||||||
var args = msg.content.split(config.prefix)
|
|
||||||
|
|
||||||
if (msg.content == config.prefix || msg.content == config.prefix+" " || msg.content == otherprefix){
|
|
||||||
msg.channel.send({embeds:[helpEmbed]})
|
|
||||||
log("command","someone used the 'help' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
APIEvents.onCommand("help",true,msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (args[1]){
|
|
||||||
if (!args[1].startsWith("close") && !args[1].startsWith("delete") && !args[1].startsWith("remove") && !args[1].startsWith("add") && !args[1].startsWith("msg") && !args[1].startsWith("remove") && !args[1].startsWith("rename") && !args[1].startsWith("reopen")){
|
|
||||||
msg.channel.send({embeds:[helpEmbed]})
|
|
||||||
log("command","someone used the 'help' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
APIEvents.onCommand("help",true,msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!DISABLE.commands.slash.help) client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "help") return
|
|
||||||
|
|
||||||
interaction.reply({embeds:[helpEmbed]})
|
|
||||||
log("command","someone used the 'help' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
APIEvents.onCommand("help",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
const DISABLE = require("../core/api/api.json").disable
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
bot.errorLog.log("debug","COMMANDS: loaded remove.js")
|
|
||||||
|
|
||||||
if (!DISABLE.commands.text.remove) client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"remove")) return
|
|
||||||
var user = msg.mentions.users.first()
|
|
||||||
if (!user) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<user>`:\n`"+config.prefix+"remove <user>`")]})
|
|
||||||
|
|
||||||
if (!msg.guild) return
|
|
||||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(msg.author)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
msg.channel.permissionOverwrites.delete(user.id)
|
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.removeEmbed(user,msg.author)]})
|
|
||||||
|
|
||||||
var loguser = msg.mentions.users.first()
|
|
||||||
|
|
||||||
log("command","someone used the 'remove' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
log("system","user removed from ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"removed_user",value:loguser.tag}])
|
|
||||||
|
|
||||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
|
||||||
APIEvents.onTicketRemove(msg.author,loguser,msg.channel,msg.guild,new Date(),{status:"open",name:msg.channel.name,ticketOptions:ticketData})
|
|
||||||
APIEvents.onCommand("remove",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!DISABLE.commands.slash.remove) client.on("interactionCreate",async (interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "remove") return
|
|
||||||
const user = interaction.options.getUser("user")
|
|
||||||
|
|
||||||
if (!interaction.guild) return
|
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
await interaction.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.delete(user.id)
|
|
||||||
interaction.reply({embeds:[bot.embeds.commands.removeEmbed(user,interaction.user)]})
|
|
||||||
|
|
||||||
var loguser = user
|
|
||||||
|
|
||||||
log("command","someone used the 'remove' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
log("system","user removed from ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"removed_user",value:loguser.tag}])
|
|
||||||
|
|
||||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
|
||||||
APIEvents.onTicketRemove(interaction.user,loguser,interaction.channel,interaction.guild,new Date(),{status:"open",name:interaction.channel.name,ticketOptions:ticketData})
|
|
||||||
APIEvents.onCommand("remove",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,95 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
const DISABLE = require("../core/api/api.json").disable
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
bot.errorLog.log("debug","COMMANDS: loaded rename.js")
|
|
||||||
|
|
||||||
if (!DISABLE.commands.text.rename) client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"rename")) return
|
|
||||||
|
|
||||||
if (!msg.guild) return
|
|
||||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(msg.author)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
var newname = msg.content.split(config.prefix+"rename")[1].substring(1)
|
|
||||||
|
|
||||||
if (!newname) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<name>`:\n`"+config.prefix+"rename <name>`")]})
|
|
||||||
|
|
||||||
var name = msg.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!prefix) prefix = "noprefix-"
|
|
||||||
|
|
||||||
msg.channel.setName(prefix+newname)
|
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.renameEmbed(msg.author,prefix+newname)]})
|
|
||||||
|
|
||||||
log("command","someone used the 'rename' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
log("system","ticket renamed",[{key:"user",value:msg.author.tag},{key:"ticket",value:name},{key:"newname",value:newname}])
|
|
||||||
APIEvents.onCommand("rename",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!DISABLE.commands.slash.rename) client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "rename") return
|
|
||||||
|
|
||||||
if (!interaction.guild) return
|
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
//interaction.deferReply()
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
var newname = interaction.options.getString("name")
|
|
||||||
var name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!prefix) prefix = "noprefix-"
|
|
||||||
|
|
||||||
interaction.channel.setName(prefix+newname)
|
|
||||||
interaction.reply({embeds:[bot.embeds.commands.renameEmbed(interaction.user,prefix+newname)]})
|
|
||||||
|
|
||||||
log("command","someone used the 'rename' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
log("system","ticket renamed",[{key:"user",value:interaction.user.tag},{key:"ticket",value:name},{key:"newname",value:newname}])
|
|
||||||
|
|
||||||
APIEvents.onCommand("rename",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
const DISABLE = require("../core/api/api.json").disable
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
bot.errorLog.log("debug","COMMANDS: loaded reopen.js")
|
|
||||||
|
|
||||||
if (!DISABLE.commands.text.reopen) client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"reopen")) return
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
if (hiddendata.data.find(h => h.key == "pendingdelete")) return msg.channel.send({embeds:[bot.errorLog.warning("Warning!","You can't re-open a ticket while it's being deleted!")]})
|
|
||||||
|
|
||||||
msg.channel.send({embeds:[bot.embeds.commands.reopenEmbed(msg.author)],components:[bot.buttons.close.openRowNormal]})
|
|
||||||
|
|
||||||
require("../core/ticketActions/ticketReopener").reopenTicket(msg.guild,msg.channel,msg.author)
|
|
||||||
|
|
||||||
log("command","someone used the 'reopen' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
APIEvents.onCommand("reopen",true,msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!DISABLE.commands.slash.reopen) client.on("interactionCreate",async (interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "reopen") return
|
|
||||||
|
|
||||||
//interaction.deferReply()
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(async msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
if (hiddendata.data.find(h => h.key == "pendingdelete")) return interaction.reply({embeds:[bot.errorLog.warning("Warning!","You can't re-open a ticket while it's being deleted!")]})
|
|
||||||
|
|
||||||
await interaction.reply({embeds:[bot.embeds.commands.reopenEmbed(interaction.user)],components:[bot.buttons.close.openRowNormal]})
|
|
||||||
|
|
||||||
require("../core/ticketActions/ticketReopener").reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
|
||||||
|
|
||||||
log("command","someone used the 'reopen' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
APIEvents.onCommand("reopen",true,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
const DISABLE = require("../core/api/api.json").disable
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
bot.errorLog.log("debug","COMMANDS: loaded ticket.js")
|
|
||||||
|
|
||||||
/**@type {String[]} */
|
|
||||||
var msgIds = []
|
|
||||||
config.messages.forEach((msg) => {
|
|
||||||
msgIds.push(msg.id)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
if (!DISABLE.commands.text.msg) client.on("messageCreate", msg => {
|
|
||||||
if (msg.content.startsWith(config.prefix+"msg"||config.prefix+"message")){
|
|
||||||
|
|
||||||
if (!msg.guild) return
|
|
||||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(msg.author)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const id = msg.content.split(config.prefix+"msg")[1].substring(1) ? msg.content.split(config.prefix+"msg")[1].substring(1) : false
|
|
||||||
|
|
||||||
if (!id) return msg.channel.send({embeds:[bot.errorLog.invalidArgsMessage(l.errors.missingArgsDescription+" `<id>`:\n`"+config.prefix+"msg <id>`")]})
|
|
||||||
if (!msgIds.includes(id)) return msg.channel.send({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
|
||||||
|
|
||||||
|
|
||||||
const {embed,componentRows} = require("../core/utils/getEmbed").createEmbed(id)
|
|
||||||
|
|
||||||
msg.channel.send({embeds:[embed],components:componentRows})
|
|
||||||
|
|
||||||
log("command","someone used the 'message' command",[{key:"user",value:msg.author.tag},{key:"id",value:id}])
|
|
||||||
APIEvents.onCommand("message",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!DISABLE.commands.slash.msg) client.on("interactionCreate", (interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "message") return
|
|
||||||
|
|
||||||
if (!interaction.guild) return
|
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
const id = interaction.options.getString("id")
|
|
||||||
|
|
||||||
if (!msgIds.includes(id)) return interaction.reply({embeds:[bot.errorLog.invalidIdChooseFromList(msgIds)]})
|
|
||||||
|
|
||||||
const {embed,componentRows} = require("../core/utils/getEmbed").createEmbed(id)
|
|
||||||
|
|
||||||
interaction.reply({content:l.commands.ticketWarning})
|
|
||||||
interaction.channel.send({embeds:[embed],components:componentRows})
|
|
||||||
|
|
||||||
log("command","someone used the 'message' command",[{key:"user",value:interaction.user.tag},{key:"id",value:id}])
|
|
||||||
|
|
||||||
APIEvents.onCommand("message",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const permsChecker = require("../core/utils/permisssionChecker")
|
|
||||||
|
|
||||||
const APIEvents = require("../core/api/modules/events")
|
|
||||||
const DISABLE = require("../core/api/api.json").disable
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
bot.errorLog.log("debug","COMMANDS: loaded unclaim.js")
|
|
||||||
|
|
||||||
if (!DISABLE.commands.text.unclaim) client.on("messageCreate",msg => {
|
|
||||||
if (!msg.content.startsWith(config.prefix+"unclaim")) return
|
|
||||||
|
|
||||||
if (!msg.guild) return
|
|
||||||
if (!permsChecker.command(msg.author.id,msg.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(msg.author)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
msg.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return msg.channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
|
|
||||||
//msg.channel.send({embeds:[bot.embeds.commands.unclaimEmbed(msg.author)]})
|
|
||||||
msg.channel.send({embeds:[bot.errorLog.warning("Coming soon!","This feature isn't ready yet!\nIt will become active in the next update!")]})
|
|
||||||
|
|
||||||
var loguser = msg.author
|
|
||||||
log("command","someone used the 'unclaim' command",[{key:"user",value:msg.author.tag}])
|
|
||||||
log("system","user unclaimed from ticket",[{key:"user",value:msg.author.tag},{key:"ticket",value:msg.channel.name},{key:"unclaimed_user",value:msg.author.tag}])
|
|
||||||
|
|
||||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
|
||||||
//APIEvents.onTicketAdd(msg.author,loguser,msg.channel,msg.guild,new Date(),{status:"open",name:msg.channel.name,ticketOptions:ticketData})
|
|
||||||
//APIEvents.onCommand("add",permsChecker.command(msg.author.id,msg.guild.id),msg.author,msg.channel,msg.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!DISABLE.commands.slash.unclaim) client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return
|
|
||||||
if (interaction.commandName != "unclaim") return
|
|
||||||
const user = interaction.user
|
|
||||||
|
|
||||||
if (!interaction.guild) return
|
|
||||||
if (!permsChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(interaction.user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return interaction.reply({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
|
|
||||||
//interaction.reply({embeds:[bot.embeds.commands.unclaimEmbed(interaction.user)]})
|
|
||||||
interaction.reply({embeds:[bot.errorLog.warning("Coming soon!","This feature isn't ready yet!\nIt will become active in the next update!")]})
|
|
||||||
|
|
||||||
var loguser = user
|
|
||||||
log("command","someone used the 'unclaim' command",[{key:"user",value:interaction.user.tag}])
|
|
||||||
log("system","user unclaimed from ticket",[{key:"user",value:interaction.user.tag},{key:"ticket",value:interaction.channel.name},{key:"unclaimed_user",value:loguser.tag}])
|
|
||||||
|
|
||||||
const ticketData = require("../core/utils/configParser").getTicketById(ticketId,true)
|
|
||||||
//APIEvents.onTicketAdd(interaction.user,loguser,interaction.channel,interaction.guild,new Date(),{status:"open",name:interaction.channel.name,ticketOptions:ticketData})
|
|
||||||
//APIEvents.onCommand("add",permsChecker.command(interaction.user.id,interaction.guild.id),interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
-108
@@ -1,108 +0,0 @@
|
|||||||
{
|
|
||||||
"main_color":"#ffffff",
|
|
||||||
"server_id":"server id (for slash cmds)",
|
|
||||||
"auth_token":"auth token",
|
|
||||||
"main_adminroles":["discord role id"],
|
|
||||||
"prefix":"!ticket ",
|
|
||||||
"languagefile":"english",
|
|
||||||
|
|
||||||
"credits":true,
|
|
||||||
"status":{
|
|
||||||
"enabled":true,
|
|
||||||
"type":"PLAYING",
|
|
||||||
"text":"!ticket help"
|
|
||||||
},
|
|
||||||
|
|
||||||
"system":{
|
|
||||||
"ticket_channel":"channel id",
|
|
||||||
"max_allowed_tickets":3,
|
|
||||||
"enable_DM_Messages":true,
|
|
||||||
|
|
||||||
"has@everyoneaccess":false,
|
|
||||||
"member_role":"member role (doesn't have access to tickets)",
|
|
||||||
"closeMode":"adminonly|normal",
|
|
||||||
|
|
||||||
"enable_transcript":false,
|
|
||||||
"enable_DM_transcript":false,
|
|
||||||
"transcript_channel":"channel id",
|
|
||||||
|
|
||||||
"showSlashcmdsInHelp":false
|
|
||||||
},
|
|
||||||
|
|
||||||
"options":[
|
|
||||||
{
|
|
||||||
"id":"general",
|
|
||||||
"name":"Question",
|
|
||||||
"description":"Create this ticket if you have a question.",
|
|
||||||
"icon":"🎫",
|
|
||||||
"label":"question",
|
|
||||||
"type":"ticket",
|
|
||||||
|
|
||||||
"color":"gray",
|
|
||||||
"adminroles":["role id"],
|
|
||||||
"channelprefix":"question-",
|
|
||||||
"category":"category id",
|
|
||||||
"message":"You created a ticket!",
|
|
||||||
"enableDmOnOpen":true,
|
|
||||||
"ticketmessage":"The staff will help you soon!\n\n*Click on the button below to close the ticket!*",
|
|
||||||
|
|
||||||
"thumbnail":{
|
|
||||||
"enable":false,
|
|
||||||
"url":"https://www.example.com/catmemes/cat.png"
|
|
||||||
},
|
|
||||||
|
|
||||||
"closedCategory":{
|
|
||||||
"enable":false,
|
|
||||||
"id":"category id"
|
|
||||||
}
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id":"website",
|
|
||||||
"name":"Website",
|
|
||||||
"description":"Go to our website.",
|
|
||||||
"icon":"✅",
|
|
||||||
"label":"click here",
|
|
||||||
"type":"website",
|
|
||||||
|
|
||||||
"url":"https://www.dj-dj.be"
|
|
||||||
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id":"role",
|
|
||||||
"name":"Verify",
|
|
||||||
"description":"Click here to get the verify role.",
|
|
||||||
"icon":"👮🏼",
|
|
||||||
"label":"get a role",
|
|
||||||
"type":"role",
|
|
||||||
|
|
||||||
"color":"red",
|
|
||||||
"roles":["discord role id"],
|
|
||||||
"mode":"add&remove|remove|add",
|
|
||||||
"enableDmOnOpen":true
|
|
||||||
|
|
||||||
}
|
|
||||||
],
|
|
||||||
|
|
||||||
"messages":[
|
|
||||||
{
|
|
||||||
"id":"1",
|
|
||||||
"name":"Choose Your Ticket",
|
|
||||||
"description":"You can click one of the buttons below!",
|
|
||||||
"dropdown":false,
|
|
||||||
|
|
||||||
"enableFooter":false,
|
|
||||||
"footer":"Open Ticket v3.0.0 - I'm a footer!",
|
|
||||||
|
|
||||||
"enableThumbnail":false,
|
|
||||||
"thumbnail":"https://www.example.com/catmemes/cat.png",
|
|
||||||
|
|
||||||
"enableCustomColor":false,
|
|
||||||
"color":"#ffffff",
|
|
||||||
|
|
||||||
"options":["general","apply"],
|
|
||||||
"enableTicketExplaination":true,
|
|
||||||
"enableMaxTicketsWarning":true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,125 @@
|
|||||||
|
{
|
||||||
|
"_INFO":{
|
||||||
|
"support":"https://otdocs.dj-dj.be",
|
||||||
|
"discord":"https://discord.dj-dj.be",
|
||||||
|
"version":"open-ticket-v4.1.3"
|
||||||
|
},
|
||||||
|
|
||||||
|
"token":"insert your bot token here! (or leave empty when using 'tokenFromENV')",
|
||||||
|
"tokenFromENV":false,
|
||||||
|
|
||||||
|
"mainColor":"#f8ba00",
|
||||||
|
"language":"english",
|
||||||
|
"prefix":"!ticket ",
|
||||||
|
"serverId":"discord server id",
|
||||||
|
"globalAdmins":["discord role id"],
|
||||||
|
|
||||||
|
"slashCommands":true,
|
||||||
|
"textCommands":true,
|
||||||
|
|
||||||
|
"status":{
|
||||||
|
"enabled":true,
|
||||||
|
"type":"listening OR watching OR playing OR custom",
|
||||||
|
"mode":"online OR invisible OR idle OR dnd",
|
||||||
|
"text":"/help",
|
||||||
|
"state":"(additional text or leave empty)"
|
||||||
|
},
|
||||||
|
|
||||||
|
"system":{
|
||||||
|
"preferSlashOverText":true,
|
||||||
|
"sendErrorOnUnknownCommand":true,
|
||||||
|
"questionFieldsInCodeBlock":true,
|
||||||
|
"displayFieldsWithQuestions":false,
|
||||||
|
"showGlobalAdminsInPanelRoles":false,
|
||||||
|
"disableVerifyBars":false,
|
||||||
|
"useRedErrorEmbeds":true,
|
||||||
|
"alwaysShowReason":false,
|
||||||
|
"emojiStyle":"before (OR after OR double OR disabled)",
|
||||||
|
"pinEmoji":"📌",
|
||||||
|
|
||||||
|
"replyOnTicketCreation":true,
|
||||||
|
"replyOnReactionRole":true,
|
||||||
|
"askPriorityOnTicketCreation":false,
|
||||||
|
"removeParticipantsOnClose":false,
|
||||||
|
"disableAutocloseAfterReopen":true,
|
||||||
|
"autodeleteRequiresClosedTicket":true,
|
||||||
|
"adminOnlyDeleteWithoutTranscript":true,
|
||||||
|
"allowCloseBeforeMessage":false,
|
||||||
|
"allowCloseBeforeAdminMessage":true,
|
||||||
|
"useTranslatedConfigChecker":true,
|
||||||
|
"pinFirstTicketMessage":false,
|
||||||
|
|
||||||
|
"enableTicketClaimButtons":true,
|
||||||
|
"enableTicketCloseButtons":true,
|
||||||
|
"enableTicketPinButtons":true,
|
||||||
|
"enableTicketDeleteButtons":true,
|
||||||
|
"enableTicketActionWithReason":true,
|
||||||
|
"enableDeleteWithoutTranscript":true,
|
||||||
|
|
||||||
|
"logs":{
|
||||||
|
"enabled":false,
|
||||||
|
"channel":"discord channel id"
|
||||||
|
},
|
||||||
|
|
||||||
|
"limits":{
|
||||||
|
"enabled":true,
|
||||||
|
"globalMaximum":50,
|
||||||
|
"userMaximum":3
|
||||||
|
},
|
||||||
|
|
||||||
|
"channelTopic":{
|
||||||
|
"showOptionName":true,
|
||||||
|
"showOptionDescription":false,
|
||||||
|
"showOptionTopic":true,
|
||||||
|
"showPriority":false,
|
||||||
|
"showClosed":true,
|
||||||
|
"showClaimed":false,
|
||||||
|
"showPinned":false,
|
||||||
|
"showCreator":false,
|
||||||
|
"showParticipants":false
|
||||||
|
},
|
||||||
|
|
||||||
|
"permissions":{
|
||||||
|
"help":"everyone (OR admin OR none OR role id)",
|
||||||
|
"panel":"admin (OR everyone OR none OR role id)",
|
||||||
|
"ticket":"none (OR admin OR everyone OR role id)",
|
||||||
|
"close":"everyone (OR admin OR none OR role id)",
|
||||||
|
"delete":"admin (OR everyone OR none OR role id)",
|
||||||
|
"reopen":"everyone (OR admin OR none OR role id)",
|
||||||
|
"claim":"admin (OR everyone OR none OR role id)",
|
||||||
|
"unclaim":"admin (OR everyone OR none OR role id)",
|
||||||
|
"pin":"admin (OR everyone OR none OR role id)",
|
||||||
|
"unpin":"admin (OR everyone OR none OR role id)",
|
||||||
|
"move":"admin (OR everyone OR none OR role id)",
|
||||||
|
"rename":"admin (OR everyone OR none OR role id)",
|
||||||
|
"add":"admin (OR everyone OR none OR role id)",
|
||||||
|
"remove":"admin (OR everyone OR none OR role id)",
|
||||||
|
"blacklist":"admin (OR everyone OR none OR role id)",
|
||||||
|
"stats":"everyone (OR admin OR none OR role id)",
|
||||||
|
"clear":"admin (OR everyone OR none OR role id)",
|
||||||
|
"autoclose":"admin (OR everyone OR none OR role id)",
|
||||||
|
"autodelete":"admin (OR everyone OR none OR role id)",
|
||||||
|
"transfer":"admin (OR everyone OR none OR role id)",
|
||||||
|
"topic":"admin (OR everyone OR none OR role id)",
|
||||||
|
"priority":"admin (OR everyone OR none OR role id)"
|
||||||
|
},
|
||||||
|
|
||||||
|
"messages":{
|
||||||
|
"creation":{"dm":false,"logs":true},
|
||||||
|
"closing":{"dm":false,"logs":true},
|
||||||
|
"deleting":{"dm":false,"logs":true},
|
||||||
|
"reopening":{"dm":false,"logs":true},
|
||||||
|
"claiming":{"dm":false,"logs":true},
|
||||||
|
"pinning":{"dm":false,"logs":true},
|
||||||
|
"adding":{"dm":false,"logs":true},
|
||||||
|
"removing":{"dm":false,"logs":true},
|
||||||
|
"renaming":{"dm":false,"logs":true},
|
||||||
|
"moving":{"dm":false,"logs":true},
|
||||||
|
"blacklisting":{"dm":false,"logs":true},
|
||||||
|
"transferring":{"dm":false,"logs":true},
|
||||||
|
"topicChange":{"dm":false,"logs":true},
|
||||||
|
"priorityChange":{"dm":false,"logs":true},
|
||||||
|
"reactionRole":{"dm":false,"logs":true}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id":"example-ticket",
|
||||||
|
"name":"Question",
|
||||||
|
"description":"Create this ticket if you have a question! (or leave empty)",
|
||||||
|
"type":"ticket",
|
||||||
|
|
||||||
|
"button":{
|
||||||
|
"emoji":"🎫 (or leave empty)",
|
||||||
|
"label":"question (or leave empty)",
|
||||||
|
"color":"gray OR red OR green OR blue"
|
||||||
|
},
|
||||||
|
|
||||||
|
"ticketAdmins":["discord role id"],
|
||||||
|
"readonlyAdmins":["discord role id"],
|
||||||
|
"allowCreationByBlacklistedUsers":false,
|
||||||
|
"questions":["example-question-1","example-question-2"],
|
||||||
|
|
||||||
|
"channel":{
|
||||||
|
"prefix":"question-",
|
||||||
|
"suffix":"user-name OR user-id OR random-number OR random-hex OR counter-dynamic OR counter-fixed",
|
||||||
|
"category":"category id (or leave empty)",
|
||||||
|
"closedCategory":"category id (or leave empty)",
|
||||||
|
"backupCategory":"category id (or leave empty)",
|
||||||
|
"claimedCategory":[
|
||||||
|
{"user":"user id","category":"category id"}
|
||||||
|
],
|
||||||
|
"topic":"This is the topic of this ticket channel and is visible to everyone! (or leave empty)"
|
||||||
|
},
|
||||||
|
|
||||||
|
"dmMessage":{
|
||||||
|
"enabled":false,
|
||||||
|
"text":"Thank you for creating a ticket in our server! (or leave empty)",
|
||||||
|
"embed":{
|
||||||
|
"enabled":false,
|
||||||
|
"title":"Embed Title! (or leave empty)",
|
||||||
|
"description":"Description (or leave empty)",
|
||||||
|
"customColor":"#f8ab00 (or leave empty)",
|
||||||
|
|
||||||
|
"image":"https://www.example.com/image.png (or leave empty)",
|
||||||
|
"thumbnail":"https://www.example.com/image.png (or leave empty)",
|
||||||
|
"fields":[
|
||||||
|
{"name":"field name","value":"field value","inline":false}
|
||||||
|
],
|
||||||
|
"timestamp":false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"ticketMessage":{
|
||||||
|
"enabled":true,
|
||||||
|
"text":"",
|
||||||
|
"embed":{
|
||||||
|
"enabled":true,
|
||||||
|
"title":"Question Ticket",
|
||||||
|
"description":"Thank you for creating a 'Question' ticket in our server!\nOur support team will help you as soon as possible!",
|
||||||
|
"customColor":"#f8ab00 (or leave empty)",
|
||||||
|
|
||||||
|
"image":"https://www.example.com/image.png (or leave empty)",
|
||||||
|
"thumbnail":"https://www.example.com/image.png (or leave empty)",
|
||||||
|
"fields":[
|
||||||
|
{"name":"field name","value":"field value","inline":false}
|
||||||
|
],
|
||||||
|
"timestamp":false
|
||||||
|
},
|
||||||
|
"ping":{
|
||||||
|
"@here":true,
|
||||||
|
"@everyone":false,
|
||||||
|
"custom":["discord role id"]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"autoclose":{
|
||||||
|
"enableInactiveHours":false,
|
||||||
|
"inactiveHours":24,
|
||||||
|
"enableUserLeave":false,
|
||||||
|
"disableOnClaim":false
|
||||||
|
},
|
||||||
|
"autodelete":{
|
||||||
|
"enableInactiveDays":false,
|
||||||
|
"inactiveDays":7,
|
||||||
|
"enableUserLeave":false,
|
||||||
|
"disableOnClaim":false
|
||||||
|
},
|
||||||
|
"cooldown":{
|
||||||
|
"enabled":false,
|
||||||
|
"cooldownMinutes":10
|
||||||
|
},
|
||||||
|
"limits":{
|
||||||
|
"enabled":false,
|
||||||
|
"globalMaximum":20,
|
||||||
|
"userMaximum":3
|
||||||
|
},
|
||||||
|
"slowMode":{
|
||||||
|
"enabled":false,
|
||||||
|
"slowModeSeconds":20
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":"example-website",
|
||||||
|
"name":"Website",
|
||||||
|
"description":"Go to our website.",
|
||||||
|
"type":"website",
|
||||||
|
|
||||||
|
"button":{
|
||||||
|
"emoji":"😃",
|
||||||
|
"label":"Visit our website"
|
||||||
|
},
|
||||||
|
|
||||||
|
"url":"https://www.dj-dj.be"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":"example-role",
|
||||||
|
"name":"Update Ping",
|
||||||
|
"description":"Click here to get notified on updates!",
|
||||||
|
"type":"role",
|
||||||
|
|
||||||
|
"button":{
|
||||||
|
"emoji":"📢",
|
||||||
|
"label":"Update Ping",
|
||||||
|
"color":"gray OR red OR green OR blue"
|
||||||
|
},
|
||||||
|
|
||||||
|
"roles":["discord role id"],
|
||||||
|
"mode":"add&remove OR remove OR add",
|
||||||
|
"removeRolesOnAdd":["discord role id"],
|
||||||
|
"addOnMemberJoin":false
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id":"example-embed",
|
||||||
|
"name":"Example Embed",
|
||||||
|
"dropdown":false,
|
||||||
|
"options":["example-ticket","example-website","example-role"],
|
||||||
|
|
||||||
|
"text":"",
|
||||||
|
"embed":{
|
||||||
|
"enabled":true,
|
||||||
|
"title":"Tickets:",
|
||||||
|
"description":"Create a ticket by clicking one of the buttons below!",
|
||||||
|
|
||||||
|
"customColor":"#f8ab00 (or leave empty)",
|
||||||
|
"url":"https://openticket.dj-dj.be (or leave empty)",
|
||||||
|
|
||||||
|
"image":"https://www.example.com/image.png (or leave empty)",
|
||||||
|
"thumbnail":"https://www.example.com/image.png (or leave empty)",
|
||||||
|
|
||||||
|
"footer":"Open Ticket v4.1.3 (or leave empty)",
|
||||||
|
"fields":[
|
||||||
|
{"name":"field name","value":"field value","inline":false}
|
||||||
|
],
|
||||||
|
"timestamp":false
|
||||||
|
},
|
||||||
|
"settings":{
|
||||||
|
"dropdownPlaceholder":"Create a ticket!",
|
||||||
|
|
||||||
|
"enableMaxTicketsWarningInText":false,
|
||||||
|
"enableMaxTicketsWarningInEmbed":true,
|
||||||
|
|
||||||
|
"describeOptionsLayout":"simple OR normal OR detailed",
|
||||||
|
"describeOptionsCustomTitle":"",
|
||||||
|
"describeOptionsInText":false,
|
||||||
|
"describeOptionsInEmbedFields":true,
|
||||||
|
"describeOptionsInEmbedDescription":false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"id":"example-question-1",
|
||||||
|
"name":"Example Question 1",
|
||||||
|
"type":"short",
|
||||||
|
|
||||||
|
"required":true,
|
||||||
|
"placeholder":"Insert your short answer here!",
|
||||||
|
"length":{
|
||||||
|
"enabled":false,
|
||||||
|
"min":0,
|
||||||
|
"max":1000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id":"example-question-2",
|
||||||
|
"name":"Example Question 2",
|
||||||
|
"type":"paragraph",
|
||||||
|
|
||||||
|
"required":false,
|
||||||
|
"placeholder":"Insert your long answer here!",
|
||||||
|
"length":{
|
||||||
|
"enabled":false,
|
||||||
|
"min":0,
|
||||||
|
"max":1000
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
{
|
||||||
|
"general":{
|
||||||
|
"enabled":false,
|
||||||
|
|
||||||
|
"enableChannel":false,
|
||||||
|
"enableCreatorDM":false,
|
||||||
|
"enableParticipantDM":false,
|
||||||
|
"enableActiveAdminDM":false,
|
||||||
|
"enableEveryAdminDM":false,
|
||||||
|
|
||||||
|
"channel":"transcript channel id (or leave empty)",
|
||||||
|
"mode":"html OR text"
|
||||||
|
},
|
||||||
|
"embedSettings":{
|
||||||
|
"customColor":"#f8ab00 (or leave empty)",
|
||||||
|
"listAllParticipants":false,
|
||||||
|
"includeTicketStats":false
|
||||||
|
},
|
||||||
|
"textTranscriptStyle":{
|
||||||
|
"layout":"simple OR normal OR detailed",
|
||||||
|
"includeStats":true,
|
||||||
|
"includeIds":false,
|
||||||
|
"includeEmbeds":true,
|
||||||
|
"includeFiles":true,
|
||||||
|
"includeBotMessages":true,
|
||||||
|
|
||||||
|
"fileMode":"custom OR channel-name OR channel-id OR user-name OR user-id",
|
||||||
|
"customFileName":"this-is-a-transcript (or leave empty)"
|
||||||
|
},
|
||||||
|
"htmlTranscriptStyle":{
|
||||||
|
"background":{
|
||||||
|
"enableCustomBackground":false,
|
||||||
|
"backgroundColor":"#f8ba00 (or leave empty)",
|
||||||
|
"backgroundImage":"https://www.example.com/image.png (or leave empty)"
|
||||||
|
},
|
||||||
|
"header":{
|
||||||
|
"enableCustomHeader":false,
|
||||||
|
"backgroundColor":"#202225",
|
||||||
|
"decoColor":"#f8ba00",
|
||||||
|
"textColor":"#ffffff"
|
||||||
|
},
|
||||||
|
"stats":{
|
||||||
|
"enableCustomStats":false,
|
||||||
|
"backgroundColor":"#202225",
|
||||||
|
"keyTextColor":"#737373",
|
||||||
|
"valueTextColor":"#ffffff",
|
||||||
|
"hideBackgroundColor":"#40444a",
|
||||||
|
"hideTextColor":"#ffffff"
|
||||||
|
},
|
||||||
|
"favicon":{
|
||||||
|
"enableCustomFavicon":false,
|
||||||
|
"imageUrl":"https://t.dj-dj.be/favicon.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
//base
|
|
||||||
const bot = require("../../index")
|
|
||||||
|
|
||||||
exports.client = bot.client
|
|
||||||
exports.config = bot.config
|
|
||||||
exports.utils = {
|
|
||||||
log:bot.errorLog.log(),
|
|
||||||
storage:bot.storage
|
|
||||||
}
|
|
||||||
|
|
||||||
//events
|
|
||||||
const events = require("./modules/events").events
|
|
||||||
exports.events = events
|
|
||||||
|
|
||||||
//actions
|
|
||||||
const actions = require("./modules/actions").actions
|
|
||||||
//comming soon
|
|
||||||
//exports.actions = actions
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
{
|
|
||||||
"version":"1.0.0",
|
|
||||||
"enableAPIdebug":false,
|
|
||||||
"enableAPIconsolelogs":false,
|
|
||||||
|
|
||||||
"info":"If you turn these switches to true, then the feature will be turned OFF!",
|
|
||||||
"info2":"You can use this to disable some features you don't want!",
|
|
||||||
"disable":{
|
|
||||||
"messages":{
|
|
||||||
"DISCLAIMER":"the messages part doesn't work yet!",
|
|
||||||
"ticketCreated":false,
|
|
||||||
"ticketClosed":false,
|
|
||||||
"ticketDeleted":false,
|
|
||||||
"ticketReopened":false
|
|
||||||
},
|
|
||||||
"transcripts":{
|
|
||||||
"server":false,
|
|
||||||
"dm":false
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"text":{
|
|
||||||
"help":false,
|
|
||||||
"msg":false,
|
|
||||||
"close":false,
|
|
||||||
"delete":false,
|
|
||||||
"reopen":false,
|
|
||||||
"new":false,
|
|
||||||
"add":false,
|
|
||||||
"remove":false,
|
|
||||||
"rename":false,
|
|
||||||
"claim":false,
|
|
||||||
"unclaim":false
|
|
||||||
},
|
|
||||||
"slash":{
|
|
||||||
"help":false,
|
|
||||||
"msg":false,
|
|
||||||
"close":false,
|
|
||||||
"delete":false,
|
|
||||||
"reopen":false,
|
|
||||||
"new":false,
|
|
||||||
"add":false,
|
|
||||||
"remove":false,
|
|
||||||
"rename":false,
|
|
||||||
"claim":false,
|
|
||||||
"unclaim":false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"checkerjs":{
|
|
||||||
"token":false,
|
|
||||||
"all":false
|
|
||||||
},
|
|
||||||
"debug":{
|
|
||||||
"all":false,
|
|
||||||
"debuglogs":false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
//ACTIONS:
|
|
||||||
|
|
||||||
|
|
||||||
//EXPORT ACTIONS:
|
|
||||||
exports.actions = {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
/** FOR DEVELOPERS ONLY!!
|
|
||||||
* Don't change anything in this file before reading the documentation!
|
|
||||||
* visit the api documentation at https://docs.openticket.dj-dj.be
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
exports.embeddedMode = false
|
|
||||||
exports.clientLocation = require("../../../index").client
|
|
||||||
@@ -1,361 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const storage = bot.storage
|
|
||||||
|
|
||||||
|
|
||||||
//EVENT API:
|
|
||||||
const ticketOpenListeners = []
|
|
||||||
const ticketCloseListeners = []
|
|
||||||
const ticketDeleteListeners = []
|
|
||||||
const ticketReopenListeners = []
|
|
||||||
|
|
||||||
const ticketAddListeners = []
|
|
||||||
const ticketRemoveListeners = []
|
|
||||||
|
|
||||||
|
|
||||||
const transcriptCreationListeners = []
|
|
||||||
const commandListeners = []
|
|
||||||
const reactionRoleListeners = []
|
|
||||||
const errorListeners = []
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
exports.onTicketOpen = (user,channel,guild,date,ticketdata) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","new ticket created",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
|
||||||
|
|
||||||
ticketOpenListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(user,channel,guild,date,ticketdata)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
* @param {String} reason
|
|
||||||
*/
|
|
||||||
exports.onTicketClose = (user,channel,guild,date,ticketdata,reason) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","ticket closed",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)},{key:"reason",value:reason}])
|
|
||||||
|
|
||||||
ticketCloseListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(user,channel,guild,date,ticketdata,reason)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
exports.onTicketDelete = (user,channel,guild,date,ticketdata) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","ticket deleted",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
|
||||||
|
|
||||||
ticketDeleteListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(user,channel,guild,date,ticketdata)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
exports.onTicketReopen = (user,channel,guild,date,ticketdata) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","ticket reopened",[{key:"userid",value:user.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
|
||||||
|
|
||||||
ticketReopenListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(user,channel,guild,date,ticketdata)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.User} editeduser
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
exports.onTicketAdd = (user,editeduser,channel,guild,date,ticketdata) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","user added to ticket",[{key:"userid",value:user.id},{key:"editeduser",value:editeduser.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
|
||||||
|
|
||||||
ticketAddListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(user,editeduser,channel,guild,date,ticketdata)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.User} editeduser
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
exports.onTicketRemove = (user,editeduser,channel,guild,date,ticketdata) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","user removed from ticket",[{key:"userid",value:user.id},{key:"editeduser",value:editeduser.id},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id},{key:"ticketdata",value:JSON.stringify(ticketdata)}])
|
|
||||||
|
|
||||||
ticketRemoveListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(user,editeduser,channel,guild,date,ticketdata)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.Message[]} messages
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
exports.onTranscriptCreation = (messages,channel,guild,date) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","transcript created",[{key:"messages",value:JSON.stringify(messages)},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id}])
|
|
||||||
|
|
||||||
transcriptCreationListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(messages,channel,guild,date)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@typedef {"help"|"message"|"close"|"delete"|"reopen"|"rename"|"add"|"remove"} OTCommandType */
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {OTCommandType} type
|
|
||||||
* @param {Boolean} hasPerms
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
exports.onCommand = (type,hasPerms,user,channel,guild,date) => {
|
|
||||||
|
|
||||||
const newguild = guild ? guild : false
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","someone used a command",[{key:"type",value:type},{key:"hasPerms",value:hasPerms},{key:"userid",value:user},{key:"channelid",value:channel.id},{key:"guildid",value:newguild.id}])
|
|
||||||
|
|
||||||
commandListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(type,hasPerms,user,channel,newguild,date)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@typedef {"add"|"remove"|"add&remove"} OTReactionRoleType */
|
|
||||||
/**@typedef {"add"|"remove"} OTReactionRoleMode */
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {OTReactionRoleMode} mode
|
|
||||||
* @param {OTReactionRoleType} type
|
|
||||||
* @param {discord.Role} role
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
exports.onReactionRole = (mode,type,role,user,channel,guild,date) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","someone used a reaction role",[{key:"mode",value:mode},{key:"type",value:type},{key:"roleid",value:role.id},{key:"userid",value:user},{key:"channelid",value:channel.id},{key:"guildid",value:guild.id}])
|
|
||||||
|
|
||||||
reactionRoleListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(mode,type,role,user,channel,guild,date)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {String} err
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
exports.onError = (err,date) => {
|
|
||||||
//system
|
|
||||||
bot.errorLog.log("api","there is an error",[{key:"error",value:err}])
|
|
||||||
|
|
||||||
errorListeners.forEach((func) => {
|
|
||||||
try {
|
|
||||||
func(err,date)
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//EVENT CALLBACKS:
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback TicketActionEvent
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback TicketCloseEvent
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
* @param {String} reason
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback TranscriptCreationEvent
|
|
||||||
* @param {discord.Message[]} messages
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback TicketUserChangeEvent
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.User} editeduser
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
* @param {{name:String,status:"open"|"closed"|"deleted"|"reopened",ticketOptions:Object|false}} ticketdata
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback CommandEvent
|
|
||||||
* @param {OTCommandType} type
|
|
||||||
* @param {Boolean} hasPerms
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild|false} guild
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback ReactionRoleEvent
|
|
||||||
* @param {OTReactionRoleMode} mode
|
|
||||||
* @param {OTReactionRoleType} type
|
|
||||||
* @param {discord.Role} role
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @callback ErrorEvent
|
|
||||||
* @param {String} error
|
|
||||||
* @param {Date} date
|
|
||||||
*/
|
|
||||||
|
|
||||||
//EVENT EXPORT:
|
|
||||||
|
|
||||||
/**@param {TicketActionEvent} callback */
|
|
||||||
const onTicketOpen = (callback) => {
|
|
||||||
ticketOpenListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {TicketCloseEvent} callback */
|
|
||||||
const onTicketClose = (callback) => {
|
|
||||||
ticketCloseListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {TicketActionEvent} callback */
|
|
||||||
const onTicketDelete = (callback) => {
|
|
||||||
ticketDeleteListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {TicketActionEvent} callback */
|
|
||||||
const onTicketReopen = (callback) => {
|
|
||||||
ticketReopenListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {TicketUserChangeEvent} callback */
|
|
||||||
const onTicketAdd = (callback) => {
|
|
||||||
ticketAddListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {TicketUserChangeEvent} callback */
|
|
||||||
const onTicketRemove = (callback) => {
|
|
||||||
ticketRemoveListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {TranscriptCreationEvent} callback */
|
|
||||||
const onTranscriptCreation = (callback) => {
|
|
||||||
transcriptCreationListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {CommandEvent} callback */
|
|
||||||
const onCommand = (callback) => {
|
|
||||||
commandListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {ReactionRoleEvent} callback */
|
|
||||||
const onReactionRole = (callback) => {
|
|
||||||
commandListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {ErrorEvent} callback */
|
|
||||||
const onError = (callback) => {
|
|
||||||
errorListeners.push(callback)
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.events = {
|
|
||||||
onTicketOpen,
|
|
||||||
onTicketClose,
|
|
||||||
onTicketDelete,
|
|
||||||
onTicketReopen,
|
|
||||||
onTicketAdd,
|
|
||||||
onTicketRemove,
|
|
||||||
onTranscriptCreation,
|
|
||||||
onCommand,
|
|
||||||
onReactionRole,
|
|
||||||
onError
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
const fs = require("fs")
|
|
||||||
const bot = require("../../index")
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
const files = fs.readdirSync("./plugins")
|
|
||||||
const api = require("./api.json")
|
|
||||||
var totalcount = 0
|
|
||||||
var successcount = 0
|
|
||||||
var failcount = 0
|
|
||||||
files.forEach((file) => {
|
|
||||||
if (file.endsWith(".plugin.js")){
|
|
||||||
try {
|
|
||||||
require("../../plugins/"+file)()
|
|
||||||
|
|
||||||
successcount++
|
|
||||||
totalcount++
|
|
||||||
}catch(err){
|
|
||||||
/**@type {Error} */
|
|
||||||
const theError = err
|
|
||||||
if (api.enableAPIdebug){
|
|
||||||
const data = fs.readFileSync("./apiDebug.txt")
|
|
||||||
const newData = data ? data.toString() : ""
|
|
||||||
fs.writeFileSync("./apiDebug.txt",newData+"ERROR: "+theError.name+": "+theError.message+"\n"+theError.stack+"\n\n")
|
|
||||||
}
|
|
||||||
failcount++
|
|
||||||
totalcount++
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
log("info","loaded plugins",[{key:"success",value:successcount},{key:"error",value:failcount},{key:"total",value:totalcount}])
|
|
||||||
}
|
|
||||||
-463
@@ -1,463 +0,0 @@
|
|||||||
exports.checker = async () => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
|
|
||||||
if (process.argv.some((v) => v == "--nochecker")) return
|
|
||||||
if (process.argv.some((v) => v == "--devconfig")){
|
|
||||||
//console.log(chalk.blue("=> used dev config instead of normal config"))
|
|
||||||
try{
|
|
||||||
var tempconfig = require("../devConfig.json")
|
|
||||||
}catch(err){console.log(err);var tempconfig = require("../config.json")}
|
|
||||||
}else{
|
|
||||||
var tempconfig = require("../config.json")
|
|
||||||
}
|
|
||||||
|
|
||||||
const config = tempconfig
|
|
||||||
var errorList = []
|
|
||||||
var isError = false
|
|
||||||
var warnList = []
|
|
||||||
var isWarn = false
|
|
||||||
const createError = (message) => {
|
|
||||||
isError = true
|
|
||||||
errorList.push("open-ticket CONFIG ERROR: "+message)
|
|
||||||
}
|
|
||||||
const createWarn = (message) => {
|
|
||||||
isWarn = true
|
|
||||||
warnList.push("open-ticket CONFIG WARNING: "+message)
|
|
||||||
}
|
|
||||||
|
|
||||||
//validators
|
|
||||||
/**@param {"userid"|"roleid"|"channelid"|"serverid"|"categoryid"} mode @param {String} value @param {String} path */
|
|
||||||
const checkDiscord = (mode,value,path) => {
|
|
||||||
if (mode == "userid"){
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+"' | this user id is invalid")
|
|
||||||
}
|
|
||||||
}else if (mode == "channelid"){
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+"' | this channel id is invalid")
|
|
||||||
}
|
|
||||||
}else if (mode == "roleid"){
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+"' | this role id is invalid")
|
|
||||||
}
|
|
||||||
}else if (mode == "serverid"){
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+"' | this server id is invalid")
|
|
||||||
}
|
|
||||||
}else if (mode == "categoryid"){
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+"' | this category id is invalid")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**@param {String} value */
|
|
||||||
const checkToken = (value) => {
|
|
||||||
if (value.length < 40){
|
|
||||||
createError("'auth_token' | your token is invalid")
|
|
||||||
}
|
|
||||||
if (value.includes(" ")) createError("'auth_token' | your token includes spaces!")
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String} value @param {String} path */
|
|
||||||
const checkHexColor = (value,path) => {
|
|
||||||
if (!/^#[a-fA-F0-9]{3,6}$/.test(value)){
|
|
||||||
if (value.length < 4) return createError("'"+path+"' | hex color too short! (example: #123abc)")
|
|
||||||
if (value.length > 7) return createError("'"+path+"' | hex color too long! (example: #123abc)")
|
|
||||||
createError("'"+path+"' | invalid color! (example: #123abc)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String} value @param {String} path */
|
|
||||||
const checkEmbedColor = (value,path) => {
|
|
||||||
if (!['DEFAULT','WHITE','AQUA','GREEN','BLUE','YELLOW','PURPLE','LUMINOUS_VIVID_PINK','FUCHSIA','GOLD','ORANGE','RED','GREY','DARKER_GREY','NAVY','DARK_AQUA','DARK_GREEN','DARK_BLUE','DARK_PURPLE','DARK_VIVID_PINK','DARK_GOLD','DARK_ORANGE','DARK_RED','DARK_GREY','LIGHT_GREY','DARK_NAVY','BLURPLE','GREYPLE','DARK_BUT_NOT_BLACK','NOT_QUITE_BLACK','RANDOM'].includes(value)){
|
|
||||||
return createError("'"+path+"' | invalid color, must be a hex code or default color (more info in the wiki)")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String} value @param {String} path @param {Number} minLength @param {Number} maxLength @param {String} name */
|
|
||||||
const checkString = (value,minLength,maxLength,path,name) => {
|
|
||||||
if (value.length < minLength){
|
|
||||||
createError("'"+path+"' | "+name+" is too short!")
|
|
||||||
}else if (value.length > maxLength){
|
|
||||||
createError("'"+path+"' | "+name+" is too long!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {"userid"|"roleid"|"channelid"|"serverid"} mode @param {String[]} arrayValue @param {String} path */
|
|
||||||
const checkDiscordArray = (mode,arrayValue,path) => {
|
|
||||||
if (mode == "userid"){
|
|
||||||
arrayValue.forEach((value,index) => {
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+":"+index+"' | this user id is invalid")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else if (mode == "channelid"){
|
|
||||||
arrayValue.forEach((value,index) => {
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+":"+index+"' | this channel id is invalid")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else if (mode == "roleid"){
|
|
||||||
arrayValue.forEach((value,index) => {
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+":"+index+"' | this role id is invalid")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else if (mode == "serverid"){
|
|
||||||
arrayValue.forEach((value,index) => {
|
|
||||||
if (value.length < 16 || value.length > 20 || !/^\d+$/.test(value)){
|
|
||||||
createError("'"+path+":"+index+"' | this server id is invalid")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**@param {String} value @param {"string"|"boolean"|"number"} type */
|
|
||||||
const checkType = (value,type,path) => {
|
|
||||||
if (type == "boolean"){
|
|
||||||
if (typeof value != "boolean"){
|
|
||||||
createError("'"+path+"' | invalid type, this must be a boolean!")
|
|
||||||
}
|
|
||||||
}else if (type == "number"){
|
|
||||||
if (typeof value != "number"){
|
|
||||||
createError("'"+path+"' | invalid type, this must be a number!")
|
|
||||||
}
|
|
||||||
}else if (type == "string"){
|
|
||||||
if (typeof value != "string"){
|
|
||||||
createError("'"+path+"' | invalid type, this must be a string!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const checkButtonColor = (value,path) => {
|
|
||||||
if (value != "none" && value != "grey" && value != "gray" && value != "black" && value != "red" && value != "green" && value != "blue" && value != "blurple"){
|
|
||||||
createError("'"+path+"' | invalid color, it must be one of these: none, gray, red, green, blue!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const configParser = require("./utils/configParser")
|
|
||||||
/**
|
|
||||||
* @param {configParser.OTAllOptions} option
|
|
||||||
* @param {String} path
|
|
||||||
*/
|
|
||||||
|
|
||||||
const checkOption = (option,path) => {
|
|
||||||
|
|
||||||
//id
|
|
||||||
checkType(option.id,"string",path+"/id")
|
|
||||||
if (option.id.includes(" ")){
|
|
||||||
createError("'"+path+"/id' | option id can't contain space characters!")
|
|
||||||
}
|
|
||||||
if (option.id.length > 20){
|
|
||||||
createError("'"+path+"/id' | option id max lenght is 20!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//name
|
|
||||||
checkType(option.name,"string",path+"/name")
|
|
||||||
if (option.name.length > 100){
|
|
||||||
createWarn("'"+path+"/name' | if your name is too long it maybe doesn't look so good!")
|
|
||||||
}else if (option.name.length < 1){
|
|
||||||
createError("'"+path+"/name' | there is no name!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//description
|
|
||||||
checkType(option.description,"string",path+"/description")
|
|
||||||
|
|
||||||
//icon
|
|
||||||
const emojiRegex = /(\u00a9|\u00ae|[\u2000-\u3300]|\ud83c[\ud000-\udfff]|\ud83d[\ud000-\udfff]|\ud83e[\ud000-\udfff])/gi;
|
|
||||||
if (option.icon.length > 0){
|
|
||||||
|
|
||||||
const isEmoji = emojiRegex.test(option.icon)
|
|
||||||
|
|
||||||
if (isEmoji == false){
|
|
||||||
createError("'"+path+"/icon' | invalid emoji or custom discord emoji")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
checkType(option.icon,"string",path+"/icon")
|
|
||||||
|
|
||||||
//label
|
|
||||||
checkType(option.label,"string",path+"/label")
|
|
||||||
if (option.label.length < 1 && option.icon.length < 1){
|
|
||||||
createError("'"+path+"' | you need at least one of these: label, icon!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//type
|
|
||||||
checkType(option.type,"string",path+"/type")
|
|
||||||
if (option.type != "ticket" && option.type != "website" && option.type != "role"){
|
|
||||||
createError("'"+path+"/type' | the type must be one of these: ticket, website, role!")
|
|
||||||
}
|
|
||||||
/**@type {"ticket"|"website"|"role"} */
|
|
||||||
const type = option.type
|
|
||||||
|
|
||||||
if (type == "ticket"){
|
|
||||||
//color
|
|
||||||
checkType(option.color,"string",path+"/color")
|
|
||||||
checkButtonColor(option.color,path+"/color")
|
|
||||||
|
|
||||||
//adminroles
|
|
||||||
checkDiscordArray("roleid",option.adminroles,path+"/adminroles")
|
|
||||||
|
|
||||||
//channelprefix
|
|
||||||
checkType(option.channelprefix,"string",path+"/channelprefix")
|
|
||||||
if (option.channelprefix.includes(" ")){
|
|
||||||
createWarn("'"+path+"/channelprefix' | this prefix can't contain spaces!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//category
|
|
||||||
checkType(option.category,"string",path+"/category")
|
|
||||||
if (option.category.length > 0){
|
|
||||||
checkDiscord("categoryid",option.category,path+"/category")
|
|
||||||
}
|
|
||||||
|
|
||||||
//message
|
|
||||||
checkType(option.message,"string",path+"/message")
|
|
||||||
|
|
||||||
//enableDmOnOpen
|
|
||||||
checkType(option.enableDmOnOpen,"boolean",path+"/enableDmOnOpen")
|
|
||||||
|
|
||||||
//ticketmessage
|
|
||||||
checkType(option.ticketmessage,"string",path+"/ticketmessage")
|
|
||||||
|
|
||||||
//thumbnail
|
|
||||||
checkType(option.thumbnail.enable,"boolean",path/"/thumbnail/enable")
|
|
||||||
checkType(option.thumbnail.url,"string",path/"/thumbnail/url")
|
|
||||||
|
|
||||||
//closedCategory
|
|
||||||
checkType(option.closedCategory.enable,"boolean",path/"/closedCategory/enable")
|
|
||||||
checkType(option.closedCategory.id,"string",path/"/closedCategory/id")
|
|
||||||
if (option.closedCategory.enable){
|
|
||||||
checkDiscord("roleid",option.closedCategory.id,path+"/closedCategory/id")
|
|
||||||
}
|
|
||||||
|
|
||||||
}else if (type == "website"){
|
|
||||||
//url
|
|
||||||
checkType(option.url,"string",path+"/url")
|
|
||||||
if (option.url.includes(" ")){
|
|
||||||
createWarn("'"+path+"/url' | a url can't contain spaces")
|
|
||||||
}
|
|
||||||
if (option.url.length < 1){
|
|
||||||
createError("'"+path+"/url' | there is no url!")
|
|
||||||
}
|
|
||||||
if (!option.url.startsWith("https://") && !option.url.startsWith("http://") && !option.url.startsWith("discord://")){
|
|
||||||
createWarn("'"+path+"/url' | your url doesn't start with https or http!")
|
|
||||||
}
|
|
||||||
if (option.url.startsWith("http://")){
|
|
||||||
createWarn("'"+path+"/url' | your url is not a HTTPS link! discord can block this url!")
|
|
||||||
}
|
|
||||||
}else if (type == "role"){
|
|
||||||
//color
|
|
||||||
checkType(option.color,"string",path+"/color")
|
|
||||||
checkButtonColor(option.color,path+"/color")
|
|
||||||
|
|
||||||
//roles
|
|
||||||
checkDiscordArray("roleid",option.roles,path+"/roles")
|
|
||||||
|
|
||||||
//mode
|
|
||||||
checkType(option.mode,"string",path+"/mode")
|
|
||||||
if (option.mode != "add&remove" && option.mode != "add" && option.mode != "remove"){
|
|
||||||
createError("'"+path+"/mode' | mode must be one of these: add, remove, add&remove")
|
|
||||||
}
|
|
||||||
|
|
||||||
//enableDmOnOpen
|
|
||||||
checkType(option.enableDmOnOpen,"boolean",path+"/enableDmOnOpen")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {configParser.OTConfigMessage} input
|
|
||||||
* @param {String} path
|
|
||||||
*/
|
|
||||||
const checkMessage = (input,path) => {
|
|
||||||
//id
|
|
||||||
if (!input.id) createError("'"+path+"/id' | this embed doesn't have an id!")
|
|
||||||
if (input.id.length > 50) createError("'"+path+"/id' | the id can't be longer than 50")
|
|
||||||
if (input.id.includes(" ") || input.id.includes("\n")) createError("'"+path+"/id' | the id can't contain spaces!")
|
|
||||||
|
|
||||||
//name
|
|
||||||
if (input.name.length < 1){
|
|
||||||
createWarn("'"+path+"/name' | this embed has no name!")
|
|
||||||
}else if (input.name.length > 99) {
|
|
||||||
createError("'"+path+"/name' | the name can't be longer than 100")
|
|
||||||
}
|
|
||||||
|
|
||||||
//description
|
|
||||||
if (input.description.length < 0){
|
|
||||||
createWarn("'"+path+"/description' | this embed doesn't have a description!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//dropdown
|
|
||||||
checkType(input.dropdown,"boolean",path+"/dropdown")
|
|
||||||
|
|
||||||
//footer
|
|
||||||
checkType(input.enableFooter,"boolean",path+"/enableFooter")
|
|
||||||
if (input.enableFooter){
|
|
||||||
if (input.footer.length < 1) createError("'"+path+"/footer' | no footer!")
|
|
||||||
if (input.footer.length > 200) createError("'"+path+"/footer' | footer length can't be more than 200!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//thumbnail
|
|
||||||
checkType(input.enableThumbnail,"boolean",path+"/enableThumbnail")
|
|
||||||
if (input.enableThumbnail){
|
|
||||||
if (input.thumbnail.length < 1) createError("'"+path+"/thumbnail' | no thumbnail url!")
|
|
||||||
}
|
|
||||||
|
|
||||||
//customColor
|
|
||||||
checkType(input.enableCustomColor,"boolean",path+"/enableCustomColor")
|
|
||||||
if (input.enableCustomColor){
|
|
||||||
if (input.color.length < 1) createError("'"+path+"/color' | no color!")
|
|
||||||
checkHexColor(input.color,path+"/color")
|
|
||||||
}
|
|
||||||
|
|
||||||
//ticket explaination & max tickets warning
|
|
||||||
checkType(input.enableTicketExplaination,"boolean",path+"/enableTicketExplaination")
|
|
||||||
checkType(input.enableMaxTicketsWarning,"boolean",path+"/enableMaxTicketsWarning")
|
|
||||||
|
|
||||||
//OPTIONS!!!
|
|
||||||
var counter = 0
|
|
||||||
input.options.forEach((option) => {if (!configParser.optionExists(option)){counter++}})
|
|
||||||
|
|
||||||
if (counter == input.options.length){
|
|
||||||
createWarn("'"+path+"/options' | insert the option ids here!")
|
|
||||||
}else{
|
|
||||||
input.options.forEach((option,index) => {
|
|
||||||
if (!configParser.optionExists(option)){
|
|
||||||
createWarn("'"+path+"/options:"+index+"' | this option doesnt exist!")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------|
|
|
||||||
//--------------------------|
|
|
||||||
//checker => START HERE |
|
|
||||||
//--------------------------|
|
|
||||||
//--------------------------|
|
|
||||||
|
|
||||||
var configArray = ["main_color","server_id","auth_token","main_adminroles","prefix","languagefile","credits","status","system","options","messages"]
|
|
||||||
configArray.forEach((item) => {
|
|
||||||
if (config[item] == undefined){
|
|
||||||
throw new Error("\n\nMAIN ERROR: the item '"+item+"' doesn't exist in config.json")
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
checkHexColor(config.main_color,"main_color")
|
|
||||||
checkDiscord("serverid",config.server_id,"server_id")
|
|
||||||
|
|
||||||
if (!require("./api/api.json").disable.checkerjs.token) checkToken(config.auth_token)
|
|
||||||
|
|
||||||
checkDiscordArray("roleid",config.main_adminroles,"main_adminroles")
|
|
||||||
checkString(config.prefix,1,15,"prefix","prefix")
|
|
||||||
//languagefile
|
|
||||||
checkType(config.languagefile,"string","languagefile")
|
|
||||||
const lf = config.languagefile
|
|
||||||
|
|
||||||
if (!lf.startsWith("custom") && !lf.startsWith("english") && !lf.startsWith("dutch") && !lf.startsWith("romanian") && !lf.startsWith("german") && !lf.startsWith("arabic") && !lf.startsWith("spanish") && !lf.startsWith("portuguese") && !lf.startsWith("french") && !lf.startsWith("italian")){
|
|
||||||
createError("'languagefile' | invalid language, more info in the wiki")
|
|
||||||
}
|
|
||||||
|
|
||||||
checkType(config.credits,"boolean","credits")
|
|
||||||
//status:
|
|
||||||
checkType(config.status.enabled,"boolean","status/enabled")
|
|
||||||
if (config.status.enabled){
|
|
||||||
if (config.status.type != "PLAYING" && config.status.type != "LISTENING" && config.status.type != "WATCHING"){
|
|
||||||
createError("'status/type' | not a valid status type! (LISTENING,WATCHING,PLAYING)")
|
|
||||||
}
|
|
||||||
if (config.status.text.length < 1){
|
|
||||||
createError("'status/text' | there is no status text!")
|
|
||||||
}
|
|
||||||
if (config.status.text.length > 50) createError("'status/text' | text too long!")
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//system:
|
|
||||||
if (config.system.ticket_channel){
|
|
||||||
if (config.system.ticket_channel.length < 16 || config.system.ticket_channel.length > 20 || !/^\d+$/.test(config.system.ticket_channel)){
|
|
||||||
createError("'system/ticket_channel' | this channel id is invalid")
|
|
||||||
}
|
|
||||||
}else createWarn("'"+path+"' | you have no ticket channel selected!")
|
|
||||||
checkType(config.system.max_allowed_tickets,"number","system/max_allowed_tickets")
|
|
||||||
checkType(config.system.enable_DM_Messages,"boolean","system/enable_DM_Messages")
|
|
||||||
checkType(config.system["has@everyoneaccess"],"boolean","system/has@everyoneaccess")
|
|
||||||
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
|
||||||
checkDiscord("roleid",config.system.member_role,"system/member_role")
|
|
||||||
}else{
|
|
||||||
createWarn("'system/member_role' | You don't have a member role, but it's recommended!")
|
|
||||||
}
|
|
||||||
checkType(config.system.closeMode,"string","system/closeMode")
|
|
||||||
if (!["normal","adminonly"].includes(config.system.closeMode)){
|
|
||||||
createError("'system/closeMode' | the close mode must be adminonly or normal")
|
|
||||||
}
|
|
||||||
|
|
||||||
checkType(config.system.enable_transcript,"boolean","system/enable_transcript")
|
|
||||||
checkType(config.system.enable_DM_transcript,"boolean","system/enable_DM_transcript")
|
|
||||||
if (config.system.enable_transcript){
|
|
||||||
checkDiscord("channelid",config.system.transcript_channel,"system/transcript_channel")
|
|
||||||
}
|
|
||||||
checkType(config.system.showSlashcmdsInHelp,"boolean","system/showSlashcmdsInHelp")
|
|
||||||
|
|
||||||
//options
|
|
||||||
|
|
||||||
config.options.forEach((option,index) => {
|
|
||||||
checkOption(option,"options/"+index)
|
|
||||||
})
|
|
||||||
|
|
||||||
//messages
|
|
||||||
config.messages.forEach((message,index) => {
|
|
||||||
checkMessage(message,"messages/"+index)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
//discord check
|
|
||||||
/**
|
|
||||||
const discord = require("discord.js")
|
|
||||||
const {GatewayIntentBits,Partials} = discord
|
|
||||||
const client = new discord.Client({
|
|
||||||
intents:[
|
|
||||||
GatewayIntentBits.DirectMessages,
|
|
||||||
GatewayIntentBits.GuildInvites,
|
|
||||||
GatewayIntentBits.GuildMembers,
|
|
||||||
GatewayIntentBits.GuildMessages,
|
|
||||||
GatewayIntentBits.Guilds,
|
|
||||||
GatewayIntentBits.MessageContent
|
|
||||||
],
|
|
||||||
partials:[Partials.Channel,Partials.Message]
|
|
||||||
})
|
|
||||||
await client.guilds.fetch()
|
|
||||||
if (!client.guilds.cache.find(g => g.id == config.server_id)){
|
|
||||||
createError("'server_id' | i'm not in a server with this id!")
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//the end
|
|
||||||
if (errorList.length > 0 || warnList.length > 0){
|
|
||||||
console.log("REPORT:\n===========================")
|
|
||||||
}
|
|
||||||
warnList.forEach((w) => {
|
|
||||||
const splitw = w.split("'")
|
|
||||||
if (splitw.length > 1){
|
|
||||||
var splitstring = chalk.yellow(splitw[0])+chalk.blue("'"+splitw[1]+"'")+chalk.yellow(splitw[2])
|
|
||||||
}else {var splitstring = chalk.yellow(splitw[0])}
|
|
||||||
console.log(splitstring)
|
|
||||||
})
|
|
||||||
errorList.forEach((e) => {
|
|
||||||
const splite = e.split("'")
|
|
||||||
if (splite.length > 1){
|
|
||||||
var splitstring = chalk.red(splite[0])+chalk.blue("'"+splite[1]+"'")+chalk.red(splite[2])
|
|
||||||
}else {var splitstring = chalk.red(splite[0])}
|
|
||||||
console.log(splitstring)
|
|
||||||
})
|
|
||||||
if (isError){
|
|
||||||
console.log("===========================")
|
|
||||||
console.log("=> "+chalk.bgRed("your bot doesn't work if you don't fix the above errors!"))
|
|
||||||
if (isWarn){
|
|
||||||
console.log("\n=> "+chalk.bgYellow("if you ignore warns, some things may work differently than expected!"))
|
|
||||||
}
|
|
||||||
process.exit(0)
|
|
||||||
}else if (isWarn == true && isError == false){
|
|
||||||
console.log("===========================")
|
|
||||||
console.log("=> "+chalk.bgYellow("if you ignore warns, some things may work differently than expected!"))
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
const fs = require('fs')
|
|
||||||
const readline = require("readline")
|
|
||||||
const rl = readline.createInterface({
|
|
||||||
input:process.stdin,
|
|
||||||
output:process.stdout,
|
|
||||||
terminal:true
|
|
||||||
})
|
|
||||||
|
|
||||||
const ask = async () => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
rl.question(chalk.yellow("WARNING: are you sure that there are",chalk.red("no tickets open"),"at the moment? ")+chalk.green("(yes/no)")+"\n",(answer) => {
|
|
||||||
if (answer != "1" && !answer.toLowerCase().startsWith("yes")){
|
|
||||||
console.log(chalk.red("invalid answer"))
|
|
||||||
ask()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
console.log(chalk.green("clearing data..."))
|
|
||||||
runClear()
|
|
||||||
rl.close()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
ask()
|
|
||||||
|
|
||||||
const runClear = async () => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
//console.log(chalk.blue("You can get a node.js warning below, just ignore that, it's not important!"))
|
|
||||||
const dataPaths = ["./storage/dynamicDB"]
|
|
||||||
|
|
||||||
var index = 0
|
|
||||||
|
|
||||||
dataPaths.forEach((path) => {
|
|
||||||
try {
|
|
||||||
fs.rmSync(path,{recursive:true,force:true})
|
|
||||||
}catch{
|
|
||||||
//console.log(path,"doesn't exist")
|
|
||||||
}
|
|
||||||
setTimeout(() => {
|
|
||||||
try{
|
|
||||||
fs.mkdirSync(path)
|
|
||||||
}catch{
|
|
||||||
//console.log(path,"already exists")
|
|
||||||
}
|
|
||||||
index++
|
|
||||||
},500)
|
|
||||||
})
|
|
||||||
|
|
||||||
setInterval(() => {
|
|
||||||
if (index >= 1){
|
|
||||||
console.log(chalk.bgGreen("All local data is cleared!"))
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
},500)
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
const localstorage = require("node-localstorage")
|
|
||||||
|
|
||||||
const ls = new localstorage.LocalStorage("./storage/dynamicDB")
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} category
|
|
||||||
* @param {String} id
|
|
||||||
* @param {String} value
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.set = (category,id,value) => {
|
|
||||||
ls.setItem(category+"--"+id,value.toString())
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} category
|
|
||||||
* @param {String} id
|
|
||||||
* @returns {String|false}
|
|
||||||
*/
|
|
||||||
exports.get = (category,id) => {
|
|
||||||
const result = ls.getItem(category+"--"+id)
|
|
||||||
if (!result) return false
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} category
|
|
||||||
* @param {String} id
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.delete = (category,id) => {
|
|
||||||
ls.removeItem(category+"--"+id)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
//Do not change this without knowing what you are doing!!
|
|
||||||
const databaseFile = "local"
|
|
||||||
//Do not change this without knowing what you are doing!!
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
var db = require("./dynamicfiles/local")
|
|
||||||
}catch{
|
|
||||||
console.log("I couldn't find the database file! (location: ./core/dynamicdatabase/storage.js:2)")
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = db
|
|
||||||
@@ -1,140 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
const loadChalk = async () => {
|
|
||||||
return await (await import("chalk")).default
|
|
||||||
}
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const c = discord.Colors
|
|
||||||
|
|
||||||
/**@param {discord.User} user*/
|
|
||||||
exports.noPermsMessage = (user) => {
|
|
||||||
return new embed()
|
|
||||||
.setColor(c.Red)
|
|
||||||
.setTitle(":x: "+l.errors.noPermsTitle)
|
|
||||||
.setDescription(l.errors.noPermsDescription)
|
|
||||||
.setFooter({iconURL:user.displayAvatarURL(),text:user.tag})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {discord.User} user*/
|
|
||||||
exports.noPermsDelete = (user) => {
|
|
||||||
return new embed()
|
|
||||||
.setColor(c.Red)
|
|
||||||
.setTitle(":x: "+l.errors.noPermsTitle)
|
|
||||||
.setDescription(l.errors.noPermsDelete)
|
|
||||||
.setFooter({iconURL:user.displayAvatarURL(),text:user.tag})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String} message */
|
|
||||||
exports.invalidArgsMessage = (message) => {
|
|
||||||
var x = new embed()
|
|
||||||
.setColor(c.Red)
|
|
||||||
.setTitle(":x: "+l.errors.missingArgsTitle)
|
|
||||||
.setDescription(message)
|
|
||||||
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String} message */
|
|
||||||
exports.serverError = (message) => {
|
|
||||||
var x = new embed()
|
|
||||||
.setColor(c.Orange)
|
|
||||||
.setTitle(":warning: "+l.errors.boterror)
|
|
||||||
.setDescription(message)
|
|
||||||
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String[]} list */
|
|
||||||
exports.invalidIdChooseFromList = (list) => {
|
|
||||||
var x = new embed()
|
|
||||||
.setColor(c.Red)
|
|
||||||
.setTitle(":x: "+l.errors.chooseFromListTitle)
|
|
||||||
.setDescription(l.errors.chooseFromListDescription+"\n`"+list.join("`\n`")+"`")
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.notInATicket = new embed()
|
|
||||||
.setColor(c.Red)
|
|
||||||
.setTitle(":x: "+l.errors.notInTicketTitle)
|
|
||||||
.setDescription(l.errors.notInTicketDescription)
|
|
||||||
|
|
||||||
|
|
||||||
/**@param {String} message @param {String} title */
|
|
||||||
exports.success = (title,message) => {
|
|
||||||
var x = new embed()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle(":white_check_mark: "+title)
|
|
||||||
.setDescription(message)
|
|
||||||
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String} message @param {String} title */
|
|
||||||
exports.warning = (title,message) => {
|
|
||||||
var x = new embed()
|
|
||||||
.setColor(c.Orange)
|
|
||||||
.setTitle(":warning: "+title)
|
|
||||||
.setDescription(message)
|
|
||||||
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@param {String} message the message @param {String} title the title @param {String} emoji an discord emoji @param {discord.ColorResolvable} color the embed color*/
|
|
||||||
exports.custom = (title,message,emoji,color) => {
|
|
||||||
var x = new embed()
|
|
||||||
.setColor(color)
|
|
||||||
.setTitle(emoji+" "+title)
|
|
||||||
.setDescription(message)
|
|
||||||
|
|
||||||
return x
|
|
||||||
}
|
|
||||||
|
|
||||||
const normalLog = (debugString) => {
|
|
||||||
const fs = require("fs")
|
|
||||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
|
||||||
fs.writeFileSync("./openticketdebug.txt",content+"\nSYSTEM: "+debugString)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {"system"|"command"|"info"|"api"|"debug"} type
|
|
||||||
* @param {String} message
|
|
||||||
* @param {[{key:String,value:String}]} params
|
|
||||||
*/
|
|
||||||
exports.log = async (type,message,params) => {
|
|
||||||
var ptype = type
|
|
||||||
const chalk = await loadChalk()
|
|
||||||
var paramstring = ""
|
|
||||||
if (params){
|
|
||||||
if (params.length > 0){
|
|
||||||
params.forEach((p) => {
|
|
||||||
paramstring = paramstring+p.key+": "+p.value+" "
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const parameters = params ? "("+paramstring+")" : " "
|
|
||||||
|
|
||||||
if (ptype == "command"){
|
|
||||||
console.log(chalk.green("[command] ")+message+" "+chalk.yellow(parameters))
|
|
||||||
}else if (ptype == "info"){
|
|
||||||
console.log(chalk.blue("[info] ")+message+" "+chalk.yellow(parameters))
|
|
||||||
}else if (ptype == "system"){
|
|
||||||
console.log(chalk.green("[system] ")+message+" "+chalk.yellow(parameters))
|
|
||||||
}else if (ptype == "api"){
|
|
||||||
if (require("./api/api.json").enableAPIconsolelogs == true){
|
|
||||||
console.log(chalk.red("[api v"+require("./api/api.json").version+"] ")+message+" "+chalk.yellow(parameters))
|
|
||||||
}
|
|
||||||
ptype = "api v"+require("./api/api.json").version
|
|
||||||
}else if (ptype == "debug"){
|
|
||||||
if (!process.argv.some((v) => v == "--debug")) return
|
|
||||||
console.log(chalk.redBright("[DEBUG] ")+message+" "+chalk.yellow(parameters))
|
|
||||||
}
|
|
||||||
|
|
||||||
const cd = new Date()
|
|
||||||
const months = ["January","February","March","April","May","June","July","August","September","October","November","December"]
|
|
||||||
normalLog("["+cd.getDate()+" "+months[cd.getMonth()-1]+" "+cd.getFullYear()+" - "+cd.getSeconds()+":"+cd.getMinutes()+":"+cd.getHours()+"] ["+ptype+"] "+message+" "+parameters)
|
|
||||||
}
|
|
||||||
@@ -1,77 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
|
|
||||||
exports.closeCommandRow = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicket1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTsendTranscript")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setLabel(l.buttons.sendTranscript)
|
|
||||||
.setEmoji("📄")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTreopenTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Success)
|
|
||||||
.setLabel(l.buttons.reopen)
|
|
||||||
.setEmoji("✔")
|
|
||||||
)
|
|
||||||
|
|
||||||
exports.openRowNormal = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTcloseTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setLabel(l.buttons.close)
|
|
||||||
.setEmoji("🔒")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
|
|
||||||
exports.openRowDisabled = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTcloseTicket")
|
|
||||||
.setDisabled(true)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setLabel(l.buttons.close)
|
|
||||||
.setEmoji("🔒")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicket")
|
|
||||||
.setDisabled(true)
|
|
||||||
.setStyle(bs.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
|
|
||||||
exports.firstmsgRowNormal = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTcloseTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setLabel(l.buttons.close)
|
|
||||||
.setEmoji("🔒")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
|
|
||||||
exports.firstmsgRowDisabled = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTcloseTicket")
|
|
||||||
.setDisabled(true)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setLabel(l.buttons.close)
|
|
||||||
.setEmoji("🔒")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicket")
|
|
||||||
.setDisabled(true)
|
|
||||||
.setStyle(bs.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
exports.closeVerifyBar = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTcloseTicketReason")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Primary)
|
|
||||||
.setEmoji("💬")
|
|
||||||
.setLabel(l.buttons.closeWithReason)
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTcloseTicketTrue")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setEmoji("✅")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTcloseTicketFalse")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setEmoji("❌")
|
|
||||||
)
|
|
||||||
|
|
||||||
exports.deleteVerifyBar = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicketTrue")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setEmoji("✅")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicketFalse")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setEmoji("❌")
|
|
||||||
)
|
|
||||||
|
|
||||||
exports.delete1VerifyBar = new arb()
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicketTrue1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setEmoji("✅")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new button()
|
|
||||||
.setCustomId("OTdeleteTicketFalse1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(bs.Secondary)
|
|
||||||
.setEmoji("❌")
|
|
||||||
)
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} addedUser
|
|
||||||
* @param {discord.User} adder
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.addEmbed = (addedUser,adder) => {
|
|
||||||
return new embed()
|
|
||||||
.setTitle("⬆️ "+l.commands.userAddedTitle.replace("{0}",addedUser.username))
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:adder.tag,iconURL:adder.displayAvatarURL()})
|
|
||||||
.setThumbnail(addedUser.displayAvatarURL({extension:"png"}))
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} removedUser
|
|
||||||
* @param {discord.User} remover
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.removeEmbed = (removedUser,remover) => {
|
|
||||||
return new embed()
|
|
||||||
.setTitle("⬇️ "+l.commands.userRemovedTitle.replace("{0}",removedUser.username))
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:remover.tag,iconURL:remover.displayAvatarURL()})
|
|
||||||
.setThumbnail(removedUser.displayAvatarURL({extension:"png"}))
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} closer
|
|
||||||
* @param {String} description
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.closeEmbed = (closer,description) => {
|
|
||||||
const embd = new embed()
|
|
||||||
.setTitle("🔒 "+l.commands.closeTitle)
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:closer.tag,iconURL:closer.displayAvatarURL()})
|
|
||||||
|
|
||||||
if (description) embd.setDescription(description)
|
|
||||||
return embd
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} deleter
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.deleteEmbed = (deleter) => {
|
|
||||||
return new embed()
|
|
||||||
.setTitle("❌ "+l.commands.deleteTitle)
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:deleter.tag,iconURL:deleter.displayAvatarURL()})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} renamer
|
|
||||||
* @param {String} newname
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.renameEmbed = (renamer,newname) => {
|
|
||||||
return new embed()
|
|
||||||
.setTitle("🔄 "+l.commands.renameTitle.replace("{0}",newname))
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:renamer.tag,iconURL:renamer.displayAvatarURL()})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} reopener
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.reopenEmbed = (reopener) => {
|
|
||||||
return new embed()
|
|
||||||
.setTitle("🔓 "+l.commands.reopenTitle)
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:reopener.tag,iconURL:reopener.displayAvatarURL()})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} claimer
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.claimEmbed = (claimer,user) => {
|
|
||||||
return new embed()
|
|
||||||
.setTitle("📌 "+l.commands.claimTitle.replace("{0}",claimer.username))
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:user.tag,iconURL:user.displayAvatarURL()})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} unclaimer
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.unclaimEmbed = (unclaimer) => {
|
|
||||||
return new embed()
|
|
||||||
.setTitle("🆓 "+l.commands.unclaimTitle)
|
|
||||||
.setColor(mc)
|
|
||||||
.setFooter({text:unclaimer.tag,iconURL:unclaimer.displayAvatarURL()})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {Boolean} done
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.User} author
|
|
||||||
* @returns {discord.EmbedBuilder}
|
|
||||||
*/
|
|
||||||
exports.sendTranscriptEmbed = (done,channel,author) => {
|
|
||||||
if (done){
|
|
||||||
return new embed()
|
|
||||||
.setTitle("📄 "+l.messages.hereIsTheTranscript)
|
|
||||||
.setColor(mc)
|
|
||||||
.setDescription("Ticket: "+channel.name)
|
|
||||||
.setFooter({text:author.tag,iconURL:author.displayAvatarURL()})
|
|
||||||
}else{
|
|
||||||
return new embed()
|
|
||||||
.setTitle("📄 "+l.messages.hereIsTheTranscript)
|
|
||||||
.setColor(mc)
|
|
||||||
.setDescription("Loading...")
|
|
||||||
.setFooter({text:author.tag,iconURL:author.displayAvatarURL()})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
|
||||||
const storage = bot.storage
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
//CLOSE
|
|
||||||
var closeTicketButtonChecker = false
|
|
||||||
client.on("interactionCreate",async interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTcloseTicketTrue") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
if (closeTicketButtonChecker == true) return
|
|
||||||
closeTicketButtonChecker = true
|
|
||||||
|
|
||||||
const firstcomponents = interaction.message.components
|
|
||||||
|
|
||||||
if (config.system.closeMode == "adminonly"){
|
|
||||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
if (!permissionChecker.sendUserNoPerms(interaction.user)){
|
|
||||||
permissionChecker.sendChannelNoPerms(interaction.channel,interaction.user)
|
|
||||||
}
|
|
||||||
interaction.message.edit({components:[firstcomponents]})
|
|
||||||
closeTicketButtonChecker = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.message.edit({components:[bot.buttons.close.openRowDisabled]})
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {String}
|
|
||||||
*/
|
|
||||||
const name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
interaction.channel.send({embeds:[bot.embeds.commands.closeEmbed(interaction.user)],components:[bot.buttons.close.closeCommandRow]})
|
|
||||||
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close",false,true)
|
|
||||||
closeTicketButtonChecker = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,99 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
|
||||||
const storage = bot.storage
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
const modal = discord.ModalBuilder
|
|
||||||
const tis = discord.TextInputStyle
|
|
||||||
const tib = discord.TextInputBuilder
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
//theModal
|
|
||||||
const reasonModal = new modal()
|
|
||||||
.setTitle(l.buttons.closeWithReason)
|
|
||||||
.setCustomId("OTCloseReasonModal")
|
|
||||||
|
|
||||||
const reasonInput = new arb()
|
|
||||||
.addComponents([
|
|
||||||
new tib()
|
|
||||||
.setCustomId('OTreasonInput')
|
|
||||||
.setLabel(l.messages.modalreason)
|
|
||||||
.setStyle(tis.Short)
|
|
||||||
.setMaxLength(100)
|
|
||||||
.setRequired(true)
|
|
||||||
.setValue("")
|
|
||||||
.setPlaceholder("reason")
|
|
||||||
])
|
|
||||||
|
|
||||||
reasonModal.addComponents(reasonInput)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//CLOSE WITH REASON
|
|
||||||
var closeTicketButtonChecker = false
|
|
||||||
|
|
||||||
client.on("interactionCreate",async interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTcloseTicketReason") return
|
|
||||||
|
|
||||||
if (closeTicketButtonChecker == true) return interaction.deferUpdate()
|
|
||||||
closeTicketButtonChecker = true
|
|
||||||
|
|
||||||
const firstcomponents = interaction.message.components
|
|
||||||
|
|
||||||
if (config.system.closeMode == "adminonly"){
|
|
||||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
if (!permissionChecker.sendUserNoPerms(interaction.user)){
|
|
||||||
permissionChecker.sendChannelNoPerms(interaction.channel,interaction.user)
|
|
||||||
}
|
|
||||||
interaction.message.edit({components:[firstcomponents]})
|
|
||||||
closeTicketButtonChecker = false
|
|
||||||
return interaction.deferUpdate()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
interaction.message.edit({components:[bot.buttons.close.openRowDisabled]})
|
|
||||||
await interaction.showModal(reasonModal)
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
client.on("interactionCreate",async (interaction) => {
|
|
||||||
if (interaction.type != discord.InteractionType.ModalSubmit) return
|
|
||||||
if (interaction.customId != "OTCloseReasonModal") return
|
|
||||||
|
|
||||||
interaction.reply({embeds:[bot.embeds.commands.closeEmbed(interaction.user)],components:[bot.buttons.close.closeCommandRow]})
|
|
||||||
|
|
||||||
const reason = interaction.fields.getTextInputValue("OTreasonInput")
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {String}
|
|
||||||
*/
|
|
||||||
const name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
//interaction.channel.send({embeds:[bot.embeds.commands.closeEmbed(interaction.user)],components:[bot.buttons.close.closeCommandRow]})
|
|
||||||
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"close",reason,true)
|
|
||||||
closeTicketButtonChecker = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,97 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
|
||||||
const storage = bot.storage
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
//DELETE
|
|
||||||
var deleteTicketButtonChecker = false
|
|
||||||
client.on("interactionCreate",async interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTdeleteTicketTrue") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
if (deleteTicketButtonChecker == true) return
|
|
||||||
deleteTicketButtonChecker = true
|
|
||||||
|
|
||||||
const firstcomponents = bot.buttons.close.openRowNormal
|
|
||||||
|
|
||||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
if (!permissionChecker.sendUserNoDelete(interaction.user)){
|
|
||||||
permissionChecker.sendChannelNoDelete(interaction.channel,interaction.user)
|
|
||||||
}
|
|
||||||
await interaction.message.edit({components:[firstcomponents]})
|
|
||||||
deleteTicketButtonChecker = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {String}
|
|
||||||
*/
|
|
||||||
const name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
interaction.channel.send({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
|
||||||
await interaction.message.edit({components:[bot.buttons.close.openRowDisabled]})
|
|
||||||
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"delete",false,true)
|
|
||||||
deleteTicketButtonChecker = false
|
|
||||||
})
|
|
||||||
|
|
||||||
//DELETE NO TRANSCRIPT
|
|
||||||
var deleteTicketButtonChecker1 = false
|
|
||||||
client.on("interactionCreate",async interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTdeleteTicketTrue1") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
if (deleteTicketButtonChecker1 == true) return
|
|
||||||
deleteTicketButtonChecker1 = true
|
|
||||||
|
|
||||||
const firstcomponents = bot.buttons.close.closeCommandRow
|
|
||||||
|
|
||||||
if (!permissionChecker.command(interaction.user.id,interaction.guild.id)){
|
|
||||||
if (!permissionChecker.sendUserNoDelete(interaction.user)){
|
|
||||||
permissionChecker.sendChannelNoDelete(interaction.channel,interaction.user)
|
|
||||||
}
|
|
||||||
await interaction.message.edit({components:[firstcomponents]})
|
|
||||||
deleteTicketButtonChecker1 = false
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {String}
|
|
||||||
*/
|
|
||||||
const name = interaction.channel.name
|
|
||||||
var prefix = ""
|
|
||||||
const tickets = config.options
|
|
||||||
tickets.forEach((ticket) => {
|
|
||||||
if (name.startsWith(ticket.channelprefix)){
|
|
||||||
prefix = ticket.channelprefix
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
interaction.channel.send({embeds:[bot.embeds.commands.deleteEmbed(interaction.user)]})
|
|
||||||
await require("../../../ticketActions/ticketCloser").NEWcloseTicket(interaction.member,interaction.channel,prefix,"deletenotranscript",false,true)
|
|
||||||
deleteTicketButtonChecker1 = false
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const permissionChecker = require("../../../utils/permisssionChecker")
|
|
||||||
const storage = bot.storage
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
//REOPEN
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTreopenTicket") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({embeds:[bot.embeds.commands.reopenEmbed(interaction.user)],components:[bot.buttons.close.openRowNormal]})
|
|
||||||
require("../../../ticketActions/ticketReopener").reopenTicket(interaction.guild,interaction.channel,interaction.user)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const storage = bot.storage
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
module.exports = () => {
|
|
||||||
require("./firstmsg")()
|
|
||||||
require("./sendTranscript")()
|
|
||||||
require("./verifyBars")()
|
|
||||||
|
|
||||||
//accepted
|
|
||||||
require("./accepted/closing")()
|
|
||||||
require("./accepted/reopening")()
|
|
||||||
require("./accepted/deleting")()
|
|
||||||
require("./accepted/closingReason")()
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const storage = bot.storage
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
client.on("interactionCreate",async (interaction) => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTsendTranscript") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
const tsmsg = await interaction.channel.send({embeds:[bot.embeds.commands.sendTranscriptEmbed(false,interaction.channel,interaction.user)]})
|
|
||||||
|
|
||||||
const channelmessages = await interaction.channel.messages.fetch()
|
|
||||||
|
|
||||||
channelmessages.sweep((msgSweep) => {
|
|
||||||
return msgSweep.author.id == client.user.id
|
|
||||||
})
|
|
||||||
|
|
||||||
var fileattachment = await require("../../transcript").createTranscript(channelmessages,interaction.channel)
|
|
||||||
|
|
||||||
if (fileattachment == false){
|
|
||||||
log("system","internal error: transcript is not created!")
|
|
||||||
tsmsg.edit({embeds:[bot.errorLog.serverError(l.errors.somethingWentWrongTranscript)]})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
tsmsg.edit({embeds:[bot.embeds.commands.sendTranscriptEmbed(true,interaction.channel,interaction.user)],files:[fileattachment]})
|
|
||||||
}catch{}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const storage = bot.storage
|
|
||||||
const hiddendata = bot.hiddenData
|
|
||||||
const embed = discord.EmbedBuilder
|
|
||||||
const mc = config.main_color
|
|
||||||
|
|
||||||
const button = discord.ButtonBuilder
|
|
||||||
const arb = discord.ActionRowBuilder
|
|
||||||
const bs = discord.ButtonStyle
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
//CLOSE
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTcloseTicket") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[bot.buttons.verifybars.closeVerifyBar]})
|
|
||||||
|
|
||||||
})
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTcloseTicketFalse") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[bot.buttons.close.openRowNormal]})
|
|
||||||
})
|
|
||||||
|
|
||||||
//DELETE
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTdeleteTicket") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[bot.buttons.verifybars.deleteVerifyBar]})
|
|
||||||
|
|
||||||
})
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTdeleteTicketFalse") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[bot.buttons.close.openRowNormal]})
|
|
||||||
})
|
|
||||||
|
|
||||||
//DELETE NO TRANSCRIPT
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTdeleteTicket1") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[bot.buttons.verifybars.delete1VerifyBar]})
|
|
||||||
|
|
||||||
})
|
|
||||||
client.on("interactionCreate",interaction => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (interaction.customId != "OTdeleteTicketFalse1") return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
interaction.message.edit({components:[bot.buttons.close.closeCommandRow]})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
const index = require("../index")
|
|
||||||
|
|
||||||
if (index.developerConfig){
|
|
||||||
var config = require("../devConfig.json")
|
|
||||||
}else{var config = require("../config.json")}
|
|
||||||
|
|
||||||
|
|
||||||
var localLanguage = require("../language/english.json")
|
|
||||||
if (config.languagefile.startsWith("custom")) localLanguage = require("../language/custom.json")
|
|
||||||
else if (config.languagefile.startsWith("dutch")) localLanguage = require("../language/dutch.json")
|
|
||||||
else if (config.languagefile.startsWith("english")) localLanguage = require("../language/english.json")
|
|
||||||
else if (config.languagefile.startsWith("german")) localLanguage = require("../language/german.json")
|
|
||||||
else if (config.languagefile.startsWith("french")) localLanguage = require("../language/french.json")
|
|
||||||
else if (config.languagefile.startsWith("romanian")) localLanguage = require("../language/romanian.json")
|
|
||||||
else if (config.languagefile.startsWith("arabic")) localLanguage = require("../language/arabic.json")
|
|
||||||
else if (config.languagefile.startsWith("spanish")) localLanguage = require("../language/spanish.json")
|
|
||||||
else if (config.languagefile.startsWith("portuguese")) localLanguage = require("../language/portuguese.json")
|
|
||||||
else if (config.languagefile.startsWith("italian")) localLanguage = require("../language/italian.json")
|
|
||||||
|
|
||||||
|
|
||||||
const errorLog = async () => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
|
|
||||||
console.log(chalk.red("Something went wrong when loading the language!")+"\nCheck the config file or create a ticket in our server!")
|
|
||||||
}
|
|
||||||
|
|
||||||
const successLog = async (language) => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
|
|
||||||
console.log(chalk.green("loaded language "+language+"..."))
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!localLanguage){
|
|
||||||
const runError = async () => {
|
|
||||||
await errorLog()
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
runError()
|
|
||||||
}else{
|
|
||||||
exports.language = localLanguage
|
|
||||||
successLog(config.languagefile)
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const storage = bot.storage
|
|
||||||
|
|
||||||
const APIEvents = require("./api/modules/events")
|
|
||||||
|
|
||||||
module.exports = async () => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isButton()) return
|
|
||||||
if (!interaction.customId.startsWith("newR")) return
|
|
||||||
|
|
||||||
interaction.deferUpdate()
|
|
||||||
|
|
||||||
if (interaction.customId.startsWith("newR")){
|
|
||||||
const optionid = interaction.customId.split("newR")[1]
|
|
||||||
if (!optionid){
|
|
||||||
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.roleDoesntExist)]})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
const option = require("./utils/getButton").getOption(optionid)
|
|
||||||
/**@type {"add"|"remove"|"add&remove"} */
|
|
||||||
const mode = option.mode
|
|
||||||
const user = interaction.member
|
|
||||||
|
|
||||||
if (mode == "add"){
|
|
||||||
option.roles.forEach((role) => {
|
|
||||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
|
||||||
|
|
||||||
log("system","added role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
|
||||||
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
|
||||||
APIEvents.onReactionRole("add","add",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
}else if (mode == "remove"){
|
|
||||||
option.roles.forEach((role) => {
|
|
||||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.remove(role)
|
|
||||||
|
|
||||||
log("system","removed role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
|
||||||
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
|
||||||
APIEvents.onReactionRole("remove","remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
}else if (mode == "add&remove"){
|
|
||||||
option.roles.forEach((role) => {
|
|
||||||
if (interaction.guild.members.cache.find(u => u.id == user.id).roles.cache.has(role)){
|
|
||||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.remove(role)
|
|
||||||
|
|
||||||
log("system","added role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
|
||||||
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
|
||||||
APIEvents.onReactionRole("add","add&remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
}else {
|
|
||||||
interaction.guild.members.cache.find(u => u.id == user.id).roles.add(role)
|
|
||||||
|
|
||||||
log("system","removed role (reaction roles)",[{key:"user",value:interaction.user.tag},{key:"role",value:role}])
|
|
||||||
const apirole = interaction.guild.roles.cache.find(r => r.id == role)
|
|
||||||
APIEvents.onReactionRole("remove","add&remove",apirole,interaction.user,interaction.channel,interaction.guild,new Date())
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
}catch{
|
|
||||||
interaction.channel.send({embeds:[bot.errorLog.serverError(l.errors.somethingWentWrong)]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
const discord = require("discord.js")
|
|
||||||
const bot = require("../../index")
|
|
||||||
const client = require("../../index").client
|
|
||||||
const config = bot.config
|
|
||||||
|
|
||||||
module.exports = async () => {
|
|
||||||
const chalk = (await import("chalk")).default
|
|
||||||
|
|
||||||
console.log(chalk.red("\nINSTRUCTIONS:\n\n1: Run the command you want to delete in discord.\n2: You get the message 'This command is now deleted!'\n3: There is also a message in the console that says the command is deleted.\n4: reload your discord."))
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isChatInputCommand()) return console.log("this isn't a command!")
|
|
||||||
|
|
||||||
interaction.reply({content:"This command is now deleted!"})
|
|
||||||
|
|
||||||
try {
|
|
||||||
client.application.commands.delete(interaction.commandId,interaction.guild.id).then(() => {
|
|
||||||
console.log("deleted the command",chalk.blue(interaction.commandName),"(id:",interaction.commandId+")")
|
|
||||||
})
|
|
||||||
}catch{
|
|
||||||
console.log(chalk.red("something went wrong by the deleting of this command!"))
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,246 +0,0 @@
|
|||||||
const discord = require("discord.js")
|
|
||||||
const bot = require("../../index")
|
|
||||||
const client = require("../../index").client
|
|
||||||
const config = bot.config
|
|
||||||
const configParser = require("../utils/configParser")
|
|
||||||
|
|
||||||
const act = discord.ApplicationCommandType
|
|
||||||
const acot = discord.ApplicationCommandOptionType
|
|
||||||
|
|
||||||
module.exports = async () => {
|
|
||||||
const chalk = (await import("chalk")).default
|
|
||||||
const sid = config.server_id
|
|
||||||
|
|
||||||
const ids = configParser.getTicketValuesArray("id")
|
|
||||||
/**@type {[{name:String,value:String}]} */
|
|
||||||
var choices = []
|
|
||||||
ids.forEach((id) => {
|
|
||||||
const option = configParser.getTicketById(id)
|
|
||||||
if (option){
|
|
||||||
choices.push({name:option.name,value:option.id})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
/**@type {[{name:String,value:String}]} */
|
|
||||||
var msgchoices = []
|
|
||||||
config.messages.forEach((msg) => {
|
|
||||||
msgchoices.push({name:msg.id,value:msg.id})
|
|
||||||
})
|
|
||||||
|
|
||||||
var readystats = 0
|
|
||||||
|
|
||||||
//process.stdout.write("[status] there are "+chalk.blue("0 out of 10")+" commands ready! (this can take up to 40 seconds)")
|
|
||||||
setInterval(() => {
|
|
||||||
process.stdout.cursorTo(0)
|
|
||||||
process.stdout.write("[status] there are "+chalk.blue(readystats+" out of 12")+" commands ready! (this can take up to 40 seconds)")
|
|
||||||
if (readystats >= 12){
|
|
||||||
console.log(chalk.green("\nready!"))
|
|
||||||
console.log(chalk.blue("you can now start the bot with "+chalk.bgBlue("'npm start'")+"!"))
|
|
||||||
process.exit(1)
|
|
||||||
}
|
|
||||||
},100)
|
|
||||||
|
|
||||||
//slashtranslation
|
|
||||||
const ST = require("../../language/slashcmds/slash.json").data
|
|
||||||
|
|
||||||
//create a ticket (/new or /ticket)
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"ticket",
|
|
||||||
description:"Create a ticket!",
|
|
||||||
descriptionLocalizations:ST.newticket,
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput,
|
|
||||||
options:[
|
|
||||||
{
|
|
||||||
type:acot.String,
|
|
||||||
name:"type",
|
|
||||||
description:"The type of ticket.",
|
|
||||||
required:true,
|
|
||||||
choices:choices
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"new",
|
|
||||||
description:"Create a ticket!",
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput,
|
|
||||||
descriptionLocalizations:ST.newticket,
|
|
||||||
options:[
|
|
||||||
{
|
|
||||||
type:acot.String,
|
|
||||||
name:"type",
|
|
||||||
description:"The type of ticket.",
|
|
||||||
required:true,
|
|
||||||
choices:choices
|
|
||||||
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//help
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"help",
|
|
||||||
description:"View the available commands.",
|
|
||||||
defaultPermission:true,
|
|
||||||
descriptionLocalizations:ST.help,
|
|
||||||
type:act.ChatInput
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
//close
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"close",
|
|
||||||
description:"Close the current ticket.",
|
|
||||||
defaultPermission:true,
|
|
||||||
descriptionLocalizations:ST.close,
|
|
||||||
type:act.ChatInput,
|
|
||||||
options:[{
|
|
||||||
name:"reason",
|
|
||||||
type:discord.ApplicationCommandOptionType.String,
|
|
||||||
required:false,
|
|
||||||
description:"The reason to close this ticket.",
|
|
||||||
maxLength:100
|
|
||||||
}]
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//delete
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"delete",
|
|
||||||
description:"Delete the current ticket.",
|
|
||||||
defaultPermission:true,
|
|
||||||
descriptionLocalizations:ST.delete,
|
|
||||||
type:act.ChatInput
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//msg
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"message",
|
|
||||||
description:"Create a ticket message.",
|
|
||||||
defaultPermission:true,
|
|
||||||
descriptionLocalizations:ST.message,
|
|
||||||
type:act.ChatInput,
|
|
||||||
options:[
|
|
||||||
{
|
|
||||||
type:acot.String,
|
|
||||||
name:"id",
|
|
||||||
description:"The message id.",
|
|
||||||
required:true,
|
|
||||||
choices:msgchoices,
|
|
||||||
max_length:30
|
|
||||||
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//add
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"add",
|
|
||||||
description:"Add people to this ticket.",
|
|
||||||
defaultPermission:true,
|
|
||||||
descriptionLocalizations:ST.add,
|
|
||||||
type:act.ChatInput,
|
|
||||||
options:[
|
|
||||||
{
|
|
||||||
type:acot.User,
|
|
||||||
name:"user",
|
|
||||||
description:"The user to add.",
|
|
||||||
required:true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//remove
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"remove",
|
|
||||||
description:"Remove people from this ticket.",
|
|
||||||
defaultPermission:true,
|
|
||||||
descriptionLocalizations:ST.remove,
|
|
||||||
type:act.ChatInput,
|
|
||||||
options:[
|
|
||||||
{
|
|
||||||
type:acot.User,
|
|
||||||
name:"user",
|
|
||||||
description:"The user to remove.",
|
|
||||||
required:true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//rename
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"rename",
|
|
||||||
description:"Rename this ticket.",
|
|
||||||
defaultPermission:true,
|
|
||||||
descriptionLocalizations:ST.rename,
|
|
||||||
type:act.ChatInput,
|
|
||||||
options:[
|
|
||||||
{
|
|
||||||
type:acot.String,
|
|
||||||
name:"name",
|
|
||||||
description:"The new name (without prefix).",
|
|
||||||
required:true
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//reopen
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"reopen",
|
|
||||||
description:"Reopen this ticket.",
|
|
||||||
defaultPermission:true,
|
|
||||||
descriptionLocalizations:ST.reopen,
|
|
||||||
type:act.ChatInput
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//claim
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"claim",
|
|
||||||
description:"Claim this ticket / claim it for someone else.",
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput,
|
|
||||||
options:[
|
|
||||||
{
|
|
||||||
name:"user",
|
|
||||||
type:acot.User,
|
|
||||||
required:false,
|
|
||||||
description:"The user to claim for."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
//unclaim
|
|
||||||
client.application.commands.create({
|
|
||||||
name:"unclaim",
|
|
||||||
description:"Unclaim this ticket.",
|
|
||||||
defaultPermission:true,
|
|
||||||
type:act.ChatInput
|
|
||||||
},sid).then(() => {
|
|
||||||
readystats++
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,345 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const storage = bot.storage
|
|
||||||
const permsChecker = require("../utils/permisssionChecker")
|
|
||||||
|
|
||||||
const pendingDelete = []
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.GuildMember} member
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {String} prefix
|
|
||||||
* @param {"delete"|"close"|"deletenotranscript"} mode
|
|
||||||
* @param {Boolean} nomessage
|
|
||||||
* @param {String} reason only when closing, not when deleting!
|
|
||||||
*/
|
|
||||||
exports.NEWcloseTicket = async (member,channel,prefix,mode,reason,nomessage) => {
|
|
||||||
const guild = channel.guild
|
|
||||||
const user = member.user
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
const channelmessages = await channel.messages.fetch()
|
|
||||||
|
|
||||||
const newReason = reason ? reason : l.messages.none
|
|
||||||
|
|
||||||
//start code
|
|
||||||
|
|
||||||
//FIX CHANNEL COULD BE CLOSED AFTER DELETE:
|
|
||||||
if (pendingDelete.includes(channel.id)) return false
|
|
||||||
|
|
||||||
//remove ot bot from transcript
|
|
||||||
channelmessages.sweep((msgSweep) => {return msgSweep.author.id == client.user.id})
|
|
||||||
|
|
||||||
/**@type {String}*/
|
|
||||||
const channelname = channel.name
|
|
||||||
const ticketOpenerChannelName = channelname.split(prefix)[1]
|
|
||||||
|
|
||||||
//get user that opened the ticket
|
|
||||||
var getuserID = storage.get("userTicketStorage",channel.id)
|
|
||||||
try {
|
|
||||||
var ticketOpener = client.users.cache.find(u => u.id === getuserID)
|
|
||||||
var isDatabaseError = false
|
|
||||||
}catch{var isDatabaseError = true}
|
|
||||||
|
|
||||||
if (!ticketOpener){
|
|
||||||
console.log(chalk.red("[database error]"),"something went wrong when getting the data in the database.\nNo panic, this error fixes itself!")
|
|
||||||
var isDatabaseError = true
|
|
||||||
}
|
|
||||||
|
|
||||||
var enableTranscript = true
|
|
||||||
var deleteRequired = false
|
|
||||||
|
|
||||||
if (mode == "delete"){
|
|
||||||
//delete
|
|
||||||
//check perms
|
|
||||||
if (!guild) return
|
|
||||||
if (!permsChecker.command(user.id,guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
//start delete proccess
|
|
||||||
deleteRequired = true
|
|
||||||
if (!nomessage){
|
|
||||||
await channel.send({content:"**"+l.messages.gettingdeleted+"**"})
|
|
||||||
}
|
|
||||||
log("system","deleted a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
|
||||||
pendingDelete.push(channel.id)
|
|
||||||
|
|
||||||
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
|
||||||
|
|
||||||
//getID & send DM & send api event
|
|
||||||
await channel.messages.fetchPinned().then(async msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value.value
|
|
||||||
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
|
||||||
|
|
||||||
require("../api/modules/events").onTicketDelete(user,channel,guild,new Date(),{name:channel.name,status:"deleted",ticketOptions:ticketData})
|
|
||||||
|
|
||||||
const id = hiddendata.data.find(d => d.key == "openerid").value
|
|
||||||
|
|
||||||
const sphd = bot.hiddenData.removeHiddenData(firstmsg.embeds[0].description)
|
|
||||||
sphd.hiddenData.data.push({key:"pendingdelete",value:"true"})
|
|
||||||
const newEmbed = new discord.EmbedBuilder(firstmsg.embeds[0].data)
|
|
||||||
newEmbed.setDescription(sphd.description + bot.hiddenData.writeHiddenData(sphd.hiddenData.type,sphd.hiddenData.data))
|
|
||||||
await firstmsg.edit({embeds:[newEmbed]})
|
|
||||||
|
|
||||||
if (!id) return false
|
|
||||||
|
|
||||||
try{
|
|
||||||
if (config.system.enable_DM_Messages){
|
|
||||||
member.send({embeds:[bot.errorLog.custom(l.messages.deletedTicketDmTitle,l.messages.deletedTicketDmDescription,":ticket:",config.main_color)]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
|
||||||
})
|
|
||||||
|
|
||||||
}else if (mode == "close"){
|
|
||||||
//close
|
|
||||||
//check perms
|
|
||||||
if (config.system.closeMode == "adminonly"){
|
|
||||||
if (!guild) return
|
|
||||||
if (!permsChecker.command(user.id,guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//set new permissions
|
|
||||||
var permissionArray = []
|
|
||||||
const pfb = discord.PermissionFlagsBits
|
|
||||||
|
|
||||||
if (!isDatabaseError) permissionArray.push({
|
|
||||||
id:ticketOpener,
|
|
||||||
type:"member",
|
|
||||||
allow:[pfb.ViewChannel],
|
|
||||||
deny:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages]
|
|
||||||
})
|
|
||||||
|
|
||||||
permissionArray.push({
|
|
||||||
id:guild.roles.everyone,
|
|
||||||
type:"role",
|
|
||||||
deny:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
})
|
|
||||||
|
|
||||||
//add main adminroles
|
|
||||||
config.main_adminroles.forEach((role,index) => {
|
|
||||||
try {
|
|
||||||
const adminrole = guild.roles.cache.find(r => r.id == role)
|
|
||||||
if (!adminrole) return
|
|
||||||
|
|
||||||
permissionArray.push({
|
|
||||||
id:adminrole,
|
|
||||||
type:"role",
|
|
||||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
})
|
|
||||||
}catch{
|
|
||||||
log("system","invalid role! At 'config.json => main_adminroles:"+index)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
//add ticket adminroles
|
|
||||||
await channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
|
||||||
|
|
||||||
if (!ticketData) return
|
|
||||||
|
|
||||||
if (ticketData.closedCategory.enable){
|
|
||||||
/**@type {discord.CategoryChannel} */
|
|
||||||
const category = guild.channels.cache.find(c => c.id == ticketData.closedCategory.id && c.type == discord.ChannelType.GuildCategory)
|
|
||||||
try {
|
|
||||||
channel.setParent(category)
|
|
||||||
}catch{
|
|
||||||
bot.errorLog.log("system","failed to move channel to new category!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {String[]}
|
|
||||||
*/
|
|
||||||
const ticketadmin = ticketData.adminroles
|
|
||||||
ticketadmin.forEach((role,index) => {
|
|
||||||
if (!config.main_adminroles.includes(role)){
|
|
||||||
try {
|
|
||||||
const adminrole = guild.roles.cache.find(r => r.id == role)
|
|
||||||
if (!adminrole) return
|
|
||||||
|
|
||||||
permissionArray.push({
|
|
||||||
id:adminrole,
|
|
||||||
type:"role",
|
|
||||||
allow:[pfb.AddReactions,pfb.ViewChannel],
|
|
||||||
deny:[pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages]
|
|
||||||
})
|
|
||||||
}catch{
|
|
||||||
log("system","invalid role! At 'config.json => options/ticket/...:"+index)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
channel.permissionOverwrites.set(permissionArray)
|
|
||||||
|
|
||||||
if (!nomessage){
|
|
||||||
//message
|
|
||||||
var closeButtonRow = new discord.ActionRowBuilder()
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("OTdeleteTicket1")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Danger)
|
|
||||||
.setLabel(l.buttons.delete)
|
|
||||||
.setEmoji("✖️")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("OTsendTranscript")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Secondary)
|
|
||||||
.setLabel(l.buttons.sendTranscript)
|
|
||||||
.setEmoji("📄")
|
|
||||||
)
|
|
||||||
.addComponents(
|
|
||||||
new discord.ButtonBuilder()
|
|
||||||
.setCustomId("OTreopenTicket")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Success)
|
|
||||||
.setLabel(l.buttons.reopen)
|
|
||||||
.setEmoji("✔")
|
|
||||||
)
|
|
||||||
|
|
||||||
const embed = new discord.EmbedBuilder()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle(":lock: "+l.messages.closedTitle+" :lock:")
|
|
||||||
.setDescription(l.messages.closedDescription)
|
|
||||||
channel.send({embeds:[embed],components:[closeButtonRow]})
|
|
||||||
}
|
|
||||||
|
|
||||||
log("system","closed a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
|
||||||
|
|
||||||
|
|
||||||
//getID & send DM & send api event
|
|
||||||
await channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
|
||||||
|
|
||||||
require("../api/modules/events").onTicketClose(user,channel,guild,new Date(),{name:channel.name,status:"closed",ticketOptions:ticketData},newReason)
|
|
||||||
|
|
||||||
const id = hiddendata.data.find(d => d.key == "openerid").value
|
|
||||||
|
|
||||||
if (!id) return false
|
|
||||||
|
|
||||||
try{
|
|
||||||
if (config.system.enable_DM_Messages){
|
|
||||||
member.send({embeds:[bot.errorLog.custom(l.messages.closedTicketDmTitle,l.messages.closedTicketDmDescription+"\n\n**reason:** "+newReason,":ticket:",config.main_color)]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
}else if (mode == "deletenotranscript"){
|
|
||||||
//delete with no transcript
|
|
||||||
//check perms
|
|
||||||
if (!guild) return
|
|
||||||
if (!permsChecker.command(user.id,guild.id)){
|
|
||||||
permsChecker.sendUserNoPerms(user)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
//start delete proccess
|
|
||||||
enableTranscript = false
|
|
||||||
deleteRequired = true
|
|
||||||
if (!nomessage){
|
|
||||||
await channel.send({content:"**"+l.messages.gettingdeleted+"**"})
|
|
||||||
}
|
|
||||||
log("system","deleted a ticket",[{key:"user",value:user.tag},{key:"ticket",value:channel.name}])
|
|
||||||
|
|
||||||
if (!isDatabaseError) storage.set("ticketStorage",getuserID,Number(storage.get("ticketStorage",getuserID)) - 1)
|
|
||||||
|
|
||||||
//getID & send DM & send api event
|
|
||||||
await channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type").value
|
|
||||||
const ticketData = require("../utils/configParser").getTicketById(ticketId,true)
|
|
||||||
|
|
||||||
require("../api/modules/events").onTicketDelete(user,channel,guild,new Date(),{name:channel.name,status:"deleted",ticketOptions:ticketData})
|
|
||||||
|
|
||||||
const id = hiddendata.data.find(d => d.key == "openerid").value
|
|
||||||
|
|
||||||
if (!id) return false
|
|
||||||
|
|
||||||
try{
|
|
||||||
if (config.system.enable_DM_Messages){
|
|
||||||
member.send({embeds:[bot.errorLog.custom(l.messages.deletedTicketDmTitle,l.messages.deletedTicketDmDescription,":ticket:",config.main_color)]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (enableTranscript == true && mode != "deletenotranscript"){
|
|
||||||
|
|
||||||
const transcriptReason = (mode == "close") ? "**"+l.messages.reason+":** "+newReason : "**"+l.messages.reason+":** "+l.messages.none
|
|
||||||
const closedByPrefix = (mode.startsWith("delete")) ? l.messages.deletedby : l.messages.closedby
|
|
||||||
|
|
||||||
if (config.system.enable_transcript || config.system.enable_DM_transcript){
|
|
||||||
var fileattachment = await require("../transcript").createTranscript(channelmessages,channel)
|
|
||||||
|
|
||||||
if (fileattachment == false){log("system","internal error: transcript is not created!");return}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.system.enable_transcript && !require("../api/api.json").disable.transcripts.server){
|
|
||||||
const transcriptEmbed = new discord.EmbedBuilder()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle("📄 "+l.messages.newTranscriptTitle)
|
|
||||||
.setDescription(transcriptReason)
|
|
||||||
.setFooter({text:closedByPrefix+": "+user.tag+" | ticket: "+channelname,iconURL:user.displayAvatarURL()})
|
|
||||||
|
|
||||||
guild.channels.cache.find(c => c.id == config.system.transcript_channel).send({
|
|
||||||
embeds:[transcriptEmbed],
|
|
||||||
files:[fileattachment]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (config.system.enable_DM_transcript && !require("../api/api.json").disable.transcripts.dm){
|
|
||||||
const transcriptEmbed = new discord.EmbedBuilder()
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle("📄 "+l.messages.newTranscriptTitle)
|
|
||||||
.setDescription(transcriptReason)
|
|
||||||
.setFooter({text:closedByPrefix+": "+user.tag+" | ticket: "+channelname,iconURL:user.displayAvatarURL()})
|
|
||||||
|
|
||||||
if (!isDatabaseError) ticketOpener.send({
|
|
||||||
embeds:[transcriptEmbed],
|
|
||||||
files:[fileattachment]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (deleteRequired){
|
|
||||||
//const timer = () => {return new Promise((resolve,reject) => {
|
|
||||||
// setTimeout(() => {resolve(true)},7000)
|
|
||||||
//})}
|
|
||||||
//await timer()
|
|
||||||
|
|
||||||
setTimeout(async () => {
|
|
||||||
pendingDelete.shift()
|
|
||||||
await channel.delete()
|
|
||||||
},6000)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,214 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const configParser = require("../utils/configParser")
|
|
||||||
const storage = bot.storage
|
|
||||||
|
|
||||||
module.exports = () => {
|
|
||||||
//dropdown placeholder
|
|
||||||
client.on("interactionCreate",(interaction) => {
|
|
||||||
if (!interaction.isSelectMenu()) return
|
|
||||||
if (interaction.customId != "OTdropdownMenu") return
|
|
||||||
if (interaction.values.includes("OTChooseTicket")) interaction.deferUpdate()
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
var closeButton = bot.buttons.firstmsg.firstmsgRowNormal
|
|
||||||
|
|
||||||
//ticket button click / create ticket
|
|
||||||
client.on("interactionCreate",async (interaction) => {
|
|
||||||
if (interaction.isChatInputCommand() && (interaction.commandName == "new" || interaction.commandName == "ticket")){
|
|
||||||
var customId = "OTnewT"+interaction.options.getString("type")
|
|
||||||
}else if (interaction.isButton()){
|
|
||||||
var customId = interaction.customId
|
|
||||||
}else if (interaction.isSelectMenu() && (interaction.customId == "OTdropdownMenu")){
|
|
||||||
var customId = interaction.values[0]
|
|
||||||
|
|
||||||
}else return
|
|
||||||
|
|
||||||
if (interaction.isButton()){
|
|
||||||
if (interaction.customId.startsWith("OTnewT")){
|
|
||||||
const optionid = interaction.customId.split("OTnewT")[1]
|
|
||||||
if (!optionid){
|
|
||||||
interaction.reply({embeds:[bot.errorLog.serverError(l.errors.ticketDoesntExist)]})
|
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (configParser.getTicketValuesArray("id").includes(customId)){
|
|
||||||
|
|
||||||
//ticketoptions from config
|
|
||||||
const currentTicketOptions = configParser.getTicketById(customId)
|
|
||||||
|
|
||||||
if (currentTicketOptions == false) return interaction.reply({embeds:[bot.errorLog.serverError(l.errors.anotherOption)]})
|
|
||||||
|
|
||||||
if (interaction.isButton()){
|
|
||||||
interaction.deferUpdate()
|
|
||||||
}else if (interaction.isChatInputCommand()){
|
|
||||||
interaction.reply({embeds:[bot.errorLog.success(l.messages.createdTitle,l.messages.createdDescription)]})
|
|
||||||
}else if (interaction.isSelectMenu()){
|
|
||||||
await interaction.deferUpdate()
|
|
||||||
}
|
|
||||||
|
|
||||||
if (storage.get("ticketStorage",interaction.member.id) == null || storage.get("ticketStorage",interaction.member.id) == "false"|| Number(storage.get("ticketStorage",interaction.member.id)) < config.system.max_allowed_tickets){
|
|
||||||
|
|
||||||
try{
|
|
||||||
if (config.system.enable_DM_Messages){
|
|
||||||
interaction.member.send({embeds:[bot.errorLog.custom(l.messages.newTicketDmTitle,currentTicketOptions.message,":ticket:",config.main_color)]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
|
||||||
|
|
||||||
|
|
||||||
//update storage
|
|
||||||
storage.set("ticketStorage",interaction.member.id,Number(storage.get("ticketStorage",interaction.member.id))+1)
|
|
||||||
var ticketNumber = interaction.member.user.username
|
|
||||||
|
|
||||||
//set ticketName
|
|
||||||
var ticketName = currentTicketOptions.channelprefix+ticketNumber
|
|
||||||
var logsname = currentTicketOptions.name
|
|
||||||
|
|
||||||
//category
|
|
||||||
if (currentTicketOptions.category.length < 16 || currentTicketOptions.category.length > 20){
|
|
||||||
var newTicketCategory = null
|
|
||||||
}else{
|
|
||||||
var newTicketCategory = currentTicketOptions.category
|
|
||||||
}
|
|
||||||
|
|
||||||
var permissionsArray = []
|
|
||||||
const pfb = discord.PermissionFlagsBits
|
|
||||||
const guild = client.guilds.cache.find(g => g.id == interaction.guild.id)
|
|
||||||
|
|
||||||
//set everyone allowed
|
|
||||||
if (config.system['has@everyoneaccess']){
|
|
||||||
var everyoneAllowPerms = [pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
var everyoneDenyPerms = []
|
|
||||||
}else{
|
|
||||||
var everyoneAllowPerms = []
|
|
||||||
var everyoneDenyPerms = [pfb.ViewChannel]
|
|
||||||
}
|
|
||||||
permissionsArray.push({
|
|
||||||
id:interaction.guild.roles.everyone,
|
|
||||||
type:"role",
|
|
||||||
allow:everyoneAllowPerms,
|
|
||||||
deny:everyoneDenyPerms
|
|
||||||
})
|
|
||||||
|
|
||||||
//add the user that created the ticket
|
|
||||||
permissionsArray.push({
|
|
||||||
id:interaction.member.user,
|
|
||||||
type:"member",
|
|
||||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
})
|
|
||||||
|
|
||||||
//add main adminroles
|
|
||||||
config.main_adminroles.forEach((role,index) => {
|
|
||||||
try {
|
|
||||||
const adminrole = guild.roles.cache.find(r => r.id == role)
|
|
||||||
if (!adminrole) return
|
|
||||||
|
|
||||||
permissionsArray.push({
|
|
||||||
id:adminrole,
|
|
||||||
type:"role",
|
|
||||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
})
|
|
||||||
}catch{
|
|
||||||
log("system","invalid role! At 'config.json => main_adminroles:"+index)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
//add ticket adminroles
|
|
||||||
/**
|
|
||||||
* @type {String[]}
|
|
||||||
*/
|
|
||||||
const ticketadmin = currentTicketOptions.adminroles
|
|
||||||
ticketadmin.forEach((role,index) => {
|
|
||||||
if (!config.main_adminroles.includes(role)){
|
|
||||||
try {
|
|
||||||
const adminrole = guild.roles.cache.find(r => r.id == role)
|
|
||||||
if (!adminrole) return
|
|
||||||
|
|
||||||
permissionsArray.push({
|
|
||||||
id:adminrole,
|
|
||||||
type:"role",
|
|
||||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
})
|
|
||||||
}catch{
|
|
||||||
log("system","invalid role! At 'config.json => options/ticket/...:"+index)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
//add member role
|
|
||||||
if (config.system.member_role != "" && config.system.member_role != " " && config.system.member_role != "false" && config.system.member_role != "null" && config.system.member_role != "0"){
|
|
||||||
try {
|
|
||||||
const userrole = guild.roles.cache.find(r => r.id == config.system.member_role)
|
|
||||||
if (!userrole) return
|
|
||||||
permissionsArray.push({
|
|
||||||
id:userrole,
|
|
||||||
type:"role",
|
|
||||||
deny:[pfb.ViewChannel]
|
|
||||||
})
|
|
||||||
}catch{
|
|
||||||
log("system","invalid role! At 'config.json => system/member_role")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//create the channel
|
|
||||||
interaction.guild.channels.create({
|
|
||||||
name:ticketName,
|
|
||||||
type:discord.ChannelType.GuildText,
|
|
||||||
parent:newTicketCategory,
|
|
||||||
reason:"A new ticket is created",
|
|
||||||
permissionOverwrites:permissionsArray
|
|
||||||
|
|
||||||
}).then((ticketChannel) => {
|
|
||||||
storage.set("userTicketStorage",ticketChannel.id,interaction.member.id)
|
|
||||||
|
|
||||||
const hiddendata = bot.hiddenData.writeHiddenData("ticketdata",[{key:"type",value:currentTicketOptions.id},{key:"openerid",value:interaction.user.id},{key:"createdms",value:new Date().getTime()}])
|
|
||||||
|
|
||||||
var ticketEmbed = new discord.EmbedBuilder()
|
|
||||||
//.setAuthor({name:interaction.user.id})
|
|
||||||
.setColor(config.main_color)
|
|
||||||
.setTitle(currentTicketOptions.name)
|
|
||||||
//.setFooter({text:"Ticket Type: "+currentTicketOptions.id})
|
|
||||||
if (currentTicketOptions.ticketmessage.length > 0){
|
|
||||||
ticketEmbed.setDescription(currentTicketOptions.ticketmessage+hiddendata)
|
|
||||||
}else{
|
|
||||||
ticketEmbed.setDescription(hiddendata)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (currentTicketOptions.thumbnail.enable) ticketEmbed.setThumbnail(currentTicketOptions.thumbnail.url)
|
|
||||||
|
|
||||||
ticketChannel.send({
|
|
||||||
content:"<@"+interaction.member.id+"> @here",
|
|
||||||
embeds:[ticketEmbed],
|
|
||||||
components:[closeButton]
|
|
||||||
|
|
||||||
}).then(firstmsg => {
|
|
||||||
firstmsg.pin()
|
|
||||||
})
|
|
||||||
|
|
||||||
log("system","created new ticket",[{key:"ticket",value:ticketName},{key:"user",value:interaction.user.tag}])
|
|
||||||
require("../api/modules/events").onTicketOpen(interaction.user,ticketChannel,interaction.guild,new Date(),{name:ticketName,status:"open",ticketOptions:currentTicketOptions})
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
try {
|
|
||||||
if (config.system.enable_DM_Messages){
|
|
||||||
interaction.member.send({embeds:[bot.errorLog.warning(l.errors.maxAmountTitle,l.errors.maxAmountDescription)]})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch{log("system","can't send DM to member, member doesn't allow dm's")}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const storage = bot.storage
|
|
||||||
const pfb = discord.PermissionFlagsBits
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.Guild} guild
|
|
||||||
* @param {discord.TextBasedChannel} channel
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
const reopenTicket = (guild,channel,user) => {
|
|
||||||
log("system","re-opened a ticket",[{key:"ticket",value:channel.name},{key:"user",value:user.tag}])
|
|
||||||
|
|
||||||
var permissionsArray = []
|
|
||||||
|
|
||||||
//set everyone allowed
|
|
||||||
if (config.system['has@everyoneaccess']){
|
|
||||||
var everyoneAllowPerms = [pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel]
|
|
||||||
var everyoneDenyPerms = []
|
|
||||||
}else{
|
|
||||||
var everyoneAllowPerms = []
|
|
||||||
var everyoneDenyPerms = [pfb.ViewChannel]
|
|
||||||
}
|
|
||||||
permissionsArray.push({
|
|
||||||
id:guild.roles.everyone,
|
|
||||||
type:"role",
|
|
||||||
allow:everyoneAllowPerms,
|
|
||||||
deny:everyoneDenyPerms
|
|
||||||
})
|
|
||||||
|
|
||||||
channel.permissionOverwrites.cache.forEach((p) => {
|
|
||||||
if (p.type == 1){
|
|
||||||
permissionsArray.push({
|
|
||||||
id:p.id,
|
|
||||||
type:"member",
|
|
||||||
allow:[pfb.AddReactions,pfb.AttachFiles,pfb.EmbedLinks,pfb.SendMessages,pfb.ViewChannel],
|
|
||||||
deny:[]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
channel.permissionOverwrites.set(permissionsArray)
|
|
||||||
|
|
||||||
require("../api/modules/events").onTicketReopen(user,channel,guild,new Date(),{name:channel.name,status:"reopened",ticketOptions:false})
|
|
||||||
}
|
|
||||||
exports.reopenTicket = reopenTicket
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
/** @param {discord.TextBasedChannel} channel @returns {Promise<{ticketname:String,ticketopener:{discordjsuser:discord.User,name:String,id:String}>} */
|
|
||||||
const getUserInfo = (channel) => {
|
|
||||||
return new Promise((promiseresolve,reject) => {
|
|
||||||
//getID
|
|
||||||
var result = {
|
|
||||||
ticketopener:{
|
|
||||||
discordjsuser:"",
|
|
||||||
id:"/",
|
|
||||||
name:"/"
|
|
||||||
},
|
|
||||||
ticketname:"/"
|
|
||||||
}
|
|
||||||
channel.messages.fetchPinned().then(msglist => {
|
|
||||||
var firstmsg = msglist.last()
|
|
||||||
if (firstmsg == undefined || firstmsg.author.id != client.user.id) return false
|
|
||||||
const hiddendata = bot.hiddenData.readHiddenData(firstmsg.embeds[0].description)
|
|
||||||
const ticketId = hiddendata.data.find(d => d.key == "type")
|
|
||||||
|
|
||||||
const id = hiddendata.data.find(d => d.key == "openerid").value
|
|
||||||
|
|
||||||
result.ticketopener.id = id
|
|
||||||
|
|
||||||
const ticketopener = client.users.cache.find(u => u.id == id)
|
|
||||||
const name = ticketopener.tag
|
|
||||||
|
|
||||||
const channelname = channel.name
|
|
||||||
|
|
||||||
promiseresolve({ticketname:channelname,ticketopener:{discordjsuser:ticketopener,name:name,id:id}})
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.Message[]} messagecollection
|
|
||||||
* @param {discord.Channel} channel
|
|
||||||
* @returns new `discord.attachmentBuilder`
|
|
||||||
*/
|
|
||||||
|
|
||||||
exports.createTranscript = async (messagecollection,channel) => {
|
|
||||||
const ticketuserdata = await getUserInfo(channel)
|
|
||||||
|
|
||||||
require("./api/modules/events").onTranscriptCreation(messagecollection,channel,channel.guild,new Date())
|
|
||||||
try {
|
|
||||||
const cd = new Date()
|
|
||||||
const months = ["January","February","March","April","May","June","July","August","September","October","November","December"]
|
|
||||||
const dateString = cd.getDate()+" "+months[cd.getMonth()-1]+" "+cd.getFullYear()+" - "+cd.getHours()+":"+cd.getMinutes()+":"+cd.getSeconds()
|
|
||||||
const filearray = ["open ticket transcript:\ntranscript creation: "+dateString+"\nticket name: "+ticketuserdata.ticketname+"\nticket opener: "+ticketuserdata.ticketopener.name,"\nTRANSCRIPT START:"]
|
|
||||||
|
|
||||||
messagecollection.reverse()
|
|
||||||
|
|
||||||
messagecollection.forEach((msg) => {
|
|
||||||
const timestamp = new Date(msg.createdTimestamp)
|
|
||||||
|
|
||||||
if (msg.content){var content = msg.content}else{var content = "*empty message*"}
|
|
||||||
|
|
||||||
const msgstats = "files: "+msg.attachments.size+", embeds: "+msg.embeds.length
|
|
||||||
filearray.push("["+timestamp.getDate()+"/"+timestamp.getMonth()+"/"+timestamp.getFullYear()+", "+timestamp.getHours()+":"+timestamp.getMinutes()+":"+timestamp.getSeconds()+"|"+msg.author.tag+"] ["+msgstats+"]\n"+content+"\n")
|
|
||||||
})
|
|
||||||
|
|
||||||
if (filearray.length < 2) filearray.push("transcript is empty")
|
|
||||||
const filestring = filearray.join("\n")
|
|
||||||
const filebuff = Buffer.from(filestring,"utf-8")
|
|
||||||
return new discord.AttachmentBuilder(filebuff,{name:"transcript_"+ticketuserdata.ticketname+".txt",description:"An Open Ticket transcript"})
|
|
||||||
}catch(err){
|
|
||||||
console.log("[error] "+err)
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,187 +0,0 @@
|
|||||||
const bot = require("../../index")
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
//TYPEDEFS:
|
|
||||||
//==================
|
|
||||||
|
|
||||||
//OTTicketOptions
|
|
||||||
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",color: "red"|"green"|"blue"|"gray",adminroles: String[],channelprefix: String,category: String,message: String,enableDmOnOpen: Boolean,ticketmessage: String, thumbnail:{enable:Boolean,url:String}, closedCategory:{enable:Boolean,id:String}}} OTTicketOptions */
|
|
||||||
|
|
||||||
//OTRoleOptions
|
|
||||||
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",color:"red"|"green"|"blue"|"gray"|"none",roles:String[],mode:"add&remove"|"remove"|"add",enableDmOnOpen:Boolean}} OTRoleOptions */
|
|
||||||
|
|
||||||
//OTWebsiteOptions
|
|
||||||
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",url:String}} OTWebsiteOptions */
|
|
||||||
|
|
||||||
|
|
||||||
//OTConfigMessage
|
|
||||||
/**@typedef {{id: string, name: string, description: string, dropdown: boolean, enableFooter: boolean, footer: string, enableThumbnail: boolean, thumbnail: string, enableCustomColor: boolean, color: string, options: string[], enableTicketExplaination: boolean, enableMaxTicketsWarning: boolean}} OTConfigMessage*/
|
|
||||||
|
|
||||||
//StringOptions
|
|
||||||
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"adminroles"|"channelprefix"|"category"|"message"|"enableDmOnOpen"|"ticketmessage"|"thumbnail"|"closedCategory"} OTTicketStringOptions */
|
|
||||||
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"color"|"roles"|"mode"|"enableDmOnOpen"} OTRoleStringOptions */
|
|
||||||
/**@typedef {"id"|"name"|"description"|"icon"|"label"|"type"|"url"} OTWebsiteStringOptions */
|
|
||||||
|
|
||||||
//FUNCTIONS:
|
|
||||||
//==================
|
|
||||||
|
|
||||||
/** @param {String} id the id of the embed @returns {OTConfigMessage}*/
|
|
||||||
exports.getConfigMessage = (id) => {
|
|
||||||
var returned = config.messages.find(a => a.id == id)
|
|
||||||
if (returned){
|
|
||||||
return returned
|
|
||||||
}
|
|
||||||
var result = config.messages[0]
|
|
||||||
if (!result){
|
|
||||||
throw new Error("'messages' object in config.json is empty")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} id
|
|
||||||
* @param {Boolean} withoutOTnewT
|
|
||||||
* @returns {OTTicketOptions|false}
|
|
||||||
*/
|
|
||||||
exports.getTicketById = (id,withoutOTnewT) => {
|
|
||||||
var result = false
|
|
||||||
if (withoutOTnewT){
|
|
||||||
config.options.forEach((option) => {
|
|
||||||
if (option.id == id && option.type == "ticket"){
|
|
||||||
result = option
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
config.options.forEach((option) => {
|
|
||||||
if ("OTnewT"+option.id == id && option.type == "ticket"){
|
|
||||||
result = option
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} id
|
|
||||||
* @param {Boolean} withoutOTnewR
|
|
||||||
* @returns {OTRoleOptions|false}
|
|
||||||
*/
|
|
||||||
exports.getRoleById = (id,withoutOTnewR) => {
|
|
||||||
var result = false
|
|
||||||
if (withoutOTnewR){
|
|
||||||
config.options.forEach((option) => {
|
|
||||||
if (option.id == id && option.type == "role"){
|
|
||||||
result = option
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else{
|
|
||||||
config.options.forEach((option) => {
|
|
||||||
if ("OTnewR"+option.id == id && option.type == "role"){
|
|
||||||
result = option
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} id
|
|
||||||
* @returns {OTWebsiteOptions|false}
|
|
||||||
*/
|
|
||||||
exports.getWebsiteById = (id) => {
|
|
||||||
var result = false
|
|
||||||
config.options.forEach((option) => {
|
|
||||||
if (option.id == id && option.type == "website"){
|
|
||||||
result = option
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {OTTicketStringOptions} value
|
|
||||||
* @returns {String[]}
|
|
||||||
*/
|
|
||||||
exports.getTicketValuesArray = (value,idWithoutOTnewT) => {
|
|
||||||
var result = []
|
|
||||||
const prefix = idWithoutOTnewT ? "" : "OTnewT"
|
|
||||||
config.options.forEach((opt) => {
|
|
||||||
if (opt.type == "ticket"){
|
|
||||||
if (value == "id"){
|
|
||||||
result.push(prefix+opt[value])
|
|
||||||
}else{
|
|
||||||
result.push(opt[value])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {OTRoleStringOptions} value
|
|
||||||
* @returns {String[]}
|
|
||||||
*/
|
|
||||||
exports.getRoleValuesArray = (value,idWithoutOTnewR) => {
|
|
||||||
var result = []
|
|
||||||
const prefix = idWithoutOTnewR ? "" : "OTnewR"
|
|
||||||
config.options.forEach((opt) => {
|
|
||||||
if (o.type == "role"){
|
|
||||||
if (value == "id"){
|
|
||||||
result.push(prefix+opt[value])
|
|
||||||
}else{
|
|
||||||
result.push(opt[value])
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {OTWebsiteStringOptions} value
|
|
||||||
* @returns {String[]}
|
|
||||||
*/
|
|
||||||
exports.getWebsiteValuesArray = (value) => {
|
|
||||||
var result = []
|
|
||||||
config.options.forEach((opt) => {
|
|
||||||
if (o.type == "website"){
|
|
||||||
result.push(opt[value])
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**@type {OTTicketOptions} */
|
|
||||||
this.ticketType = {}
|
|
||||||
|
|
||||||
/**@type {OTRoleOptions} */
|
|
||||||
this.roleType = {}
|
|
||||||
|
|
||||||
/**@type {OTWebsiteOptions} */
|
|
||||||
this.websiteType = {}
|
|
||||||
|
|
||||||
/**@type {OTConfigMessage} */
|
|
||||||
this.messageType = {}
|
|
||||||
|
|
||||||
|
|
||||||
//OTAllOptions
|
|
||||||
/**@typedef {{id: String,name: String,description: String,icon: String,label: String,type: "ticket"|"role"|"website",color:"red"|"green"|"blue"|"gray"|"none",roles:String[],mode:"add&remove"|"remove"|"add",adminroles: String[],channelprefix: String,category: String,message: String,enableDmOnOpen: Boolean,ticketmessage: String, thumbnail:{enable:Boolean,url:String}, url:String, closedCategory:{enable:Boolean,id:String}}} OTAllOptions */
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} id
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.optionExists = (id) => {
|
|
||||||
var result = false
|
|
||||||
config.options.forEach((option) => {
|
|
||||||
if (option.id == id){
|
|
||||||
result = true
|
|
||||||
}
|
|
||||||
})
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
const discord = require("discord.js")
|
|
||||||
const bot = require("../../index")
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
/**@returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
|
|
||||||
const getColor = (color) => {
|
|
||||||
const b = discord.ButtonStyle
|
|
||||||
if (color.toLowerCase() == "red"){
|
|
||||||
return b.Danger
|
|
||||||
}else if (color.toLowerCase() == "green"){
|
|
||||||
return b.Success
|
|
||||||
}else if (color.toLowerCase() == "blue" || color.toLowerCase() == "blurple"){
|
|
||||||
return b.Primary
|
|
||||||
}else if (color.toLowerCase() == "black" || color.toLowerCase() == "gray" || color.toLowerCase() == "grey"){
|
|
||||||
return b.Secondary
|
|
||||||
}else if (color == "DANGER" || color == "SECONDARY" || color == "SUCCESS" || color == "PRIMARY"){
|
|
||||||
return color
|
|
||||||
}else if (color.toLowerCase() == "none" || color.toLowerCase() == "false" || color.toLowerCase() == ""){
|
|
||||||
return b.Secondary
|
|
||||||
}else return b.Secondary
|
|
||||||
}
|
|
||||||
|
|
||||||
const getOption = (id) => {
|
|
||||||
const result = config.options.find((option) => option.id == id)
|
|
||||||
if (!result){return false}else return result
|
|
||||||
}
|
|
||||||
exports.getOption = getOption
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} id
|
|
||||||
* @returns {discord.ButtonBuilder|false}
|
|
||||||
*/
|
|
||||||
exports.getButton = (id) => {
|
|
||||||
const option = getOption(id)
|
|
||||||
if (!option) return false
|
|
||||||
if (option.type == "ticket"){
|
|
||||||
var button = new discord.ButtonBuilder()
|
|
||||||
.setCustomId("OTnewT"+option.id)
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(getColor(option.color))
|
|
||||||
|
|
||||||
if (option.label){button.setLabel(option.label)}
|
|
||||||
if (option.icon){button.setEmoji(option.icon)}
|
|
||||||
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
|
||||||
|
|
||||||
}else if (option.type == "website"){
|
|
||||||
var button = new discord.ButtonBuilder()
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(discord.ButtonStyle.Link)
|
|
||||||
.setURL(option.url)
|
|
||||||
|
|
||||||
if (option.label){button.setLabel(option.label)}
|
|
||||||
if (option.icon){button.setEmoji(option.icon)}
|
|
||||||
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
|
||||||
|
|
||||||
}else if (option.type == "role"){
|
|
||||||
var button = new discord.ButtonBuilder()
|
|
||||||
.setCustomId("newR"+option.id)
|
|
||||||
.setDisabled(false)
|
|
||||||
.setStyle(getColor(option.color))
|
|
||||||
|
|
||||||
if (option.label){button.setLabel(option.label)}
|
|
||||||
if (option.icon){button.setEmoji(option.icon)}
|
|
||||||
if (!option.label && !option.icon){button.setLabel("no label or emoji")}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return button
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
exports.rawButtonData = class {
|
|
||||||
constructor() {
|
|
||||||
this.id = ""
|
|
||||||
this.name = ""
|
|
||||||
this.description = ""
|
|
||||||
this.icon = ""
|
|
||||||
this.label = ""
|
|
||||||
this.type = ""
|
|
||||||
|
|
||||||
this.color = ""
|
|
||||||
this.enableDmOnOpen = true
|
|
||||||
this.url = ""
|
|
||||||
this.roles = ["",""]
|
|
||||||
this.mode = ""
|
|
||||||
this.adminroles = ["",""]
|
|
||||||
this.channelprefix = ""
|
|
||||||
this.category = ""
|
|
||||||
this.message = ""
|
|
||||||
this.ticketmessage = ""
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,46 +0,0 @@
|
|||||||
const discord = require("discord.js")
|
|
||||||
const bot = require("../../index")
|
|
||||||
const config = bot.config
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
const configParser = require("./configParser")
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String[]} ids
|
|
||||||
* @returns {discord.SelectMenuBuilder|false}
|
|
||||||
*/
|
|
||||||
exports.getDropdown = (ids) => {
|
|
||||||
const dropdown = new discord.SelectMenuBuilder()
|
|
||||||
.setCustomId("OTdropdownMenu")
|
|
||||||
.setDisabled(false)
|
|
||||||
.setMaxValues(1)
|
|
||||||
.setMinValues(1)
|
|
||||||
.setPlaceholder(l.messages.chooseATicket)
|
|
||||||
.addOptions(
|
|
||||||
new discord.SelectMenuOptionBuilder()
|
|
||||||
.setDefault(true)
|
|
||||||
.setLabel(l.messages.chooseATicket)
|
|
||||||
.setValue("OTChooseTicket")
|
|
||||||
)
|
|
||||||
|
|
||||||
ids.forEach((id) => {
|
|
||||||
const option = configParser.getTicketById(id,true)
|
|
||||||
if (option){
|
|
||||||
const selectComponent = new discord.SelectMenuOptionBuilder()
|
|
||||||
.setDefault(false)
|
|
||||||
.setValue("OTnewT"+option.id)
|
|
||||||
|
|
||||||
if (!option.label && !option.icon){
|
|
||||||
selectComponent.setLabel("OT ERROR: no description/emoji")
|
|
||||||
}else{
|
|
||||||
if (option.label) selectComponent.setLabel(option.label)
|
|
||||||
if (option.icon) selectComponent.setEmoji(option.icon)
|
|
||||||
}
|
|
||||||
|
|
||||||
dropdown.addOptions(selectComponent)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
return dropdown
|
|
||||||
}
|
|
||||||
@@ -1,111 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const getButton = require("./getButton")
|
|
||||||
const l = bot.language
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} id the id from an open-ticket embed
|
|
||||||
* @returns {{embed:discord.EmbedBuilder,componentRows:discord.MessageActionRow[]}} discord embed
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
exports.createEmbed = (id) => {
|
|
||||||
//-----------------------------------
|
|
||||||
//general importing
|
|
||||||
const data = require("./configParser").getConfigMessage(id)
|
|
||||||
/**@type {discord.ButtonBuilder[]}*/
|
|
||||||
var buttons = []
|
|
||||||
/**@type {getButton.rawButtonData[]} */
|
|
||||||
var buttonData = []
|
|
||||||
|
|
||||||
data.options.forEach((option) => {
|
|
||||||
var button = getButton.getButton(option)
|
|
||||||
var localButtonData = getButton.getOption(option)
|
|
||||||
if (button) buttons.push(button)
|
|
||||||
if (localButtonData) buttonData.push(localButtonData)
|
|
||||||
})
|
|
||||||
//-----------------------------------
|
|
||||||
|
|
||||||
//-----------------------------------
|
|
||||||
//create the embed
|
|
||||||
const embed = new discord.EmbedBuilder()
|
|
||||||
.setTitle(data.name)
|
|
||||||
if (data.enableFooter) embed.setFooter({text:data.footer})
|
|
||||||
if (data.enableThumbnail) embed.setThumbnail(data.thumbnail)
|
|
||||||
|
|
||||||
if (data.enableCustomColor){
|
|
||||||
embed.setColor(data.color)
|
|
||||||
}else{
|
|
||||||
embed.setColor(config.main_color)
|
|
||||||
}
|
|
||||||
|
|
||||||
var description = data.description
|
|
||||||
if (data.enableTicketExplaination){
|
|
||||||
description = description+"\n\n__"+l.messages.chooseCategory+"__\n"
|
|
||||||
|
|
||||||
var ticketExplainations = []
|
|
||||||
buttonData.forEach((button) => {
|
|
||||||
var explaination = button.icon+" **"+button.name+":**\n"+button.description
|
|
||||||
ticketExplainations.push(explaination)
|
|
||||||
})
|
|
||||||
|
|
||||||
description = description+ticketExplainations.join("\n\n")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (data.enableMaxTicketsWarning){
|
|
||||||
description = description+"\n\n"+l.commands.maxTicketWarning.replace("{0}",config.system.max_allowed_tickets)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (description) embed.setDescription(description)
|
|
||||||
|
|
||||||
//-----------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------
|
|
||||||
//create the components IF DROPDOWN IS FALSE
|
|
||||||
if (!data.dropdown){
|
|
||||||
var AmountOfRows = Math.ceil(buttons.length / 4)
|
|
||||||
var currentRow = 0
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @type {discord.MessageActionRow[]}
|
|
||||||
*/
|
|
||||||
var componentRows = []
|
|
||||||
|
|
||||||
for (let i = AmountOfRows; i > 0; i--){
|
|
||||||
|
|
||||||
componentRows.push(new discord.ActionRowBuilder())
|
|
||||||
}
|
|
||||||
|
|
||||||
buttons.forEach((button,index) => {
|
|
||||||
componentRows[currentRow].addComponents([button])
|
|
||||||
|
|
||||||
if (index == 3 || index == 7 || index == 11 || index == 15 || index == 19 || index == 23 || index == 27 || index == 31 || index == 35 || index == 39){
|
|
||||||
currentRow = currentRow + 1
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
//create the component IF DROPDOWN is true
|
|
||||||
}else{
|
|
||||||
const ids = data.options
|
|
||||||
const dropdown = require("./getDropdown").getDropdown(ids)
|
|
||||||
var componentRows = [
|
|
||||||
new discord.ActionRowBuilder()
|
|
||||||
.setComponents(dropdown)
|
|
||||||
]
|
|
||||||
}
|
|
||||||
//-----------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//return everything
|
|
||||||
/**
|
|
||||||
* @type {{embed:discord.EmbedBuilder,componentRows:discord.MessageActionRow[]}}
|
|
||||||
*/
|
|
||||||
const returnedData = {embed:embed,componentRows:componentRows}
|
|
||||||
return returnedData
|
|
||||||
}
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
|
|
||||||
/**@typedef {{type:String,data:[{key:String,value:String}]}} hiddenData */
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} messageContent
|
|
||||||
* @returns {hiddenData}
|
|
||||||
*/
|
|
||||||
|
|
||||||
exports.readHiddenData = (messageContent) => {
|
|
||||||
//ticketdata//type:123|userid:456)
|
|
||||||
const rawhidden = messageContent.split("[ ](OTDATA|")[1]
|
|
||||||
const rawhidden2 = rawhidden.split("//")
|
|
||||||
|
|
||||||
const datatype = rawhidden2[0]
|
|
||||||
var rawhiddendata = rawhidden2[1]
|
|
||||||
var rawhiddendataArray = rawhiddendata.split("")
|
|
||||||
rawhiddendataArray.pop()
|
|
||||||
|
|
||||||
rawhiddendata = rawhiddendataArray.join("")
|
|
||||||
|
|
||||||
const splittedData = rawhiddendata.split("|")
|
|
||||||
|
|
||||||
const resultData = []
|
|
||||||
splittedData.forEach((data) => {
|
|
||||||
// type:123
|
|
||||||
const dataresult = data.split(":")
|
|
||||||
|
|
||||||
resultData.push({key:dataresult[0],value:dataresult[1]})
|
|
||||||
})
|
|
||||||
|
|
||||||
return {type:datatype,data:resultData}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} type
|
|
||||||
* @param {[{key:String,value:String}]} data
|
|
||||||
* @returns {String}
|
|
||||||
*/
|
|
||||||
exports.writeHiddenData = (type,data) => {
|
|
||||||
const dataValues = []
|
|
||||||
data.forEach((d) => {
|
|
||||||
dataValues.push(d.key+":"+d.value)
|
|
||||||
})
|
|
||||||
|
|
||||||
const datastring = dataValues.join("|")
|
|
||||||
|
|
||||||
const result = "[ ](OTDATA|"+type+"//"+datastring+")"
|
|
||||||
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} description
|
|
||||||
* @returns {{description:String,hiddenData:hiddenData}}
|
|
||||||
*/
|
|
||||||
exports.removeHiddenData = (description) => {
|
|
||||||
const hiddenData = this.readHiddenData(description)
|
|
||||||
|
|
||||||
const splitted = description.split("[ ](OTDATA")
|
|
||||||
const original = splitted[0]
|
|
||||||
|
|
||||||
return {description:original,hiddenData:hiddenData}
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
|
|
||||||
const loadChalk = async () => {
|
|
||||||
return await (await import("chalk")).default
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = async () => {
|
|
||||||
const chalk = await loadChalk()
|
|
||||||
|
|
||||||
//LIVESTATUS SOON
|
|
||||||
}
|
|
||||||
@@ -1,107 +0,0 @@
|
|||||||
const discord = require('discord.js')
|
|
||||||
const bot = require('../../index')
|
|
||||||
const client = bot.client
|
|
||||||
const config = bot.config
|
|
||||||
const log = bot.errorLog.log
|
|
||||||
const l = bot.language
|
|
||||||
const storage = bot.storage
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {String} memberid
|
|
||||||
* @param {String} guildid
|
|
||||||
* @returns {Boolean} has permissions?
|
|
||||||
*/
|
|
||||||
exports.command = (memberid,guildid) => {
|
|
||||||
const permsmember = client.guilds.cache.find(g => g.id == guildid).members.cache.find(m => m.id == memberid)
|
|
||||||
if (config.main_adminroles.some((item)=>{return permsmember.roles.cache.has(item)}) == false && !permsmember.permissions.has("Administrator") && !permsmember.permissions.has("ManageGuild")){
|
|
||||||
return false
|
|
||||||
}else {return true}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.sendUserNoPerms = (user) => {
|
|
||||||
try {
|
|
||||||
user.send({embeds:[bot.errorLog.noPermsMessage(user)]})
|
|
||||||
return true
|
|
||||||
}catch{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.sendUserNoTicket = (user) => {
|
|
||||||
try {
|
|
||||||
user.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
return true
|
|
||||||
}catch{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.sendUserNoDelete = (user) => {
|
|
||||||
try {
|
|
||||||
user.send({embeds:[bot.errorLog.noPermsDelete(user)]})
|
|
||||||
return true
|
|
||||||
}catch{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.sendChannelNoPerms = (channel,user) => {
|
|
||||||
try {
|
|
||||||
channel.send({embeds:[bot.errorLog.noPermsMessage(user)]})
|
|
||||||
return true
|
|
||||||
}catch{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.sendChannelNoTicket = (channel,user) => {
|
|
||||||
try {
|
|
||||||
channel.send({embeds:[bot.errorLog.notInATicket]})
|
|
||||||
return true
|
|
||||||
}catch{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @param {discord.TextChannel} channel
|
|
||||||
* @param {discord.User} user
|
|
||||||
* @returns {Boolean}
|
|
||||||
*/
|
|
||||||
exports.sendChannelNoDelete = (channel,user) => {
|
|
||||||
try {
|
|
||||||
channel.send({embeds:[bot.errorLog.noPermsDelete(user)]})
|
|
||||||
return true
|
|
||||||
}catch{
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
[]
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
# Docker Compose for Open Ticket v4
|
||||||
|
version: '3'
|
||||||
|
services:
|
||||||
|
openticket:
|
||||||
|
build: .
|
||||||
|
volumes:
|
||||||
|
- openticket:/home/container
|
||||||
|
restart: no
|
||||||
|
container_name: open-ticket
|
||||||
|
volumes:
|
||||||
|
openticket:
|
||||||
+18
@@ -0,0 +1,18 @@
|
|||||||
|
# Docker File for Open Ticket v4
|
||||||
|
# Use the official Node.js 20 image from Docker Hub
|
||||||
|
FROM node:20-alpine
|
||||||
|
|
||||||
|
# Set pterodactyl working directory inside the container
|
||||||
|
WORKDIR /home/container
|
||||||
|
|
||||||
|
# Copy package.json and package-lock.json into the container
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
# Copy the rest of your app's source code into the container
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Run the bot from index.js
|
||||||
|
CMD ["node", "index.js"]
|
||||||
@@ -1,243 +1,183 @@
|
|||||||
// __________ __________ ___________ ____ ____
|
/////////////// STARTUP FLAGS ///////////////
|
||||||
// / ____ \ / ______ \ / | | \ | |
|
const flags = [
|
||||||
// | / \ | | | | | | |_______| | \ | |
|
// Edit flags here when being unable to use the flags in the command prompt.
|
||||||
// | | | | | |____| | | | | |\ \ | |
|
//PTERODACTYL PANEL
|
||||||
// | | | | | ________/ | |______ | | \ \ | |
|
//add startup flags here (e.g. "--no-compile") when running via the panel
|
||||||
// | | | | | | | _____| | | \ \ | |
|
]
|
||||||
// | | | | | | | | | | \ \ | |
|
process.argv.push(...flags)
|
||||||
// | | | | | | | |________ | | \ \| |
|
/////////////// STARTUP FLAGS ///////////////
|
||||||
// | \____/ | | | | | | | \ |
|
|
||||||
// \__________/ |__| \__________| |__| \___|
|
|
||||||
|
|
||||||
const discord = require("discord.js")
|
/*
|
||||||
const fs = require('fs')
|
██████╗ ██████╗ ███████╗███╗ ██╗ ████████╗██╗ ██████╗██╗ ██╗███████╗████████╗
|
||||||
const {GatewayIntentBits,Partials} = discord
|
██╔═══██╗██╔══██╗██╔════╝████╗ ██║ ╚══██╔══╝██║██╔════╝██║ ██╔╝██╔════╝╚══██╔══╝
|
||||||
const APIBase = require("./core/api/modules/base")
|
██║ ██║██████╔╝█████╗ ██╔██╗ ██║ ██║ ██║██║ █████╔╝ █████╗ ██║
|
||||||
if (APIBase.embeddedMode){
|
██║ ██║██╔═══╝ ██╔══╝ ██║╚██╗██║ ██║ ██║██║ ██╔═██╗ ██╔══╝ ██║
|
||||||
var tempClient = APIBase.clientLocation
|
╚██████╔╝██║ ███████╗██║ ╚████║ ██║ ██║╚██████╗██║ ██╗███████╗ ██║
|
||||||
}else{
|
╚═════╝ ╚═╝ ╚══════╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═════╝╚═╝ ╚═╝╚══════╝ ╚═╝
|
||||||
var tempClient = new discord.Client({
|
v4.1.3 - Made by DJj123dj & Contributors
|
||||||
intents:[
|
|
||||||
GatewayIntentBits.DirectMessages,
|
Discord: https://discord.dj-dj.be
|
||||||
GatewayIntentBits.GuildInvites,
|
Docs: https://otdocs.dj-dj.be
|
||||||
GatewayIntentBits.GuildMembers,
|
Support Us: https://github.com/sponsors/DJj123dj/
|
||||||
GatewayIntentBits.GuildMessages,
|
|
||||||
GatewayIntentBits.Guilds,
|
*/
|
||||||
GatewayIntentBits.MessageContent
|
///////////////////////////////////////////
|
||||||
],
|
////////// COMPILATION + STARTUP //////////
|
||||||
partials:[Partials.Channel,Partials.Message]
|
///////////////////////////////////////////
|
||||||
})
|
const fs = require("fs")
|
||||||
|
const ts = require("typescript")
|
||||||
|
const {createHash,Hash} = require("crypto")
|
||||||
|
const nodepath = require('path')
|
||||||
|
const ansis = require("ansis")
|
||||||
|
|
||||||
|
/** ## What is this?
|
||||||
|
* This is a function which compares `./src/` with a hash stored in `./dist/hash.txt`.
|
||||||
|
* The hash is based on the modified date & file metadata of all files in `./src/`.
|
||||||
|
*
|
||||||
|
* If the hash is different, the bot will automatically re-compile.
|
||||||
|
* This will help you save CPU resources because the bot shouldn't re-compile when nothing has been changed :)
|
||||||
|
*
|
||||||
|
* @param {string} dir
|
||||||
|
* @param {Hash|null} upperHash
|
||||||
|
*/
|
||||||
|
function computeSourceHash(dir,upperHash){
|
||||||
|
const hash = upperHash ? upperHash : createHash("sha256")
|
||||||
|
const info = fs.readdirSync(dir,{withFileTypes:true})
|
||||||
|
|
||||||
|
for (const file of info) {
|
||||||
|
const fullPath = nodepath.join(dir,file.name)
|
||||||
|
if (file.isFile() && [".js",".ts",".jsx",".tsx"].some((ext) => file.name.endsWith(ext))){
|
||||||
|
const statInfo = fs.statSync(fullPath)
|
||||||
|
//compute hash using file metadata
|
||||||
|
const fileInfo = `${fullPath}:${statInfo.size}:${statInfo.mtimeMs}`
|
||||||
|
hash.update(fileInfo)
|
||||||
|
|
||||||
|
}else if (file.isDirectory()){
|
||||||
|
//recursively compute all folders
|
||||||
|
computeSourceHash(fullPath,hash)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//return when not being called recursively
|
||||||
|
if (!upperHash) {
|
||||||
|
return hash.digest("hex")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/**@type {discord.Client} */
|
function requiresCompilation(){
|
||||||
const client = tempClient
|
//check hashes when not using "--compile-only" flag
|
||||||
exports.client = client
|
if (process.argv.includes("--compile-only")) return true
|
||||||
client.setMaxListeners(50)
|
|
||||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","created client")
|
|
||||||
|
|
||||||
var tempconfig = require("./config.json")
|
console.log("OT: Comparing prebuilds with source...")
|
||||||
/**@type {Boolean} */
|
const sourceHash = computeSourceHash("./src/")
|
||||||
var isDevConfig = false
|
const pluginHash = computeSourceHash("./plugins/")
|
||||||
|
const hash = sourceHash+":"+pluginHash
|
||||||
|
|
||||||
if (process.argv.some((v) => v == "--devconfig")){
|
if (fs.existsSync("./dist/hash.txt")){
|
||||||
async function logFLAGS(){
|
const distHash = fs.readFileSync("./dist/hash.txt").toString()
|
||||||
const chalk = await (await import("chalk")).default
|
if (distHash === hash) return false
|
||||||
console.log(chalk.blue("[FLAGS] => used dev config instead of normal config"))
|
else return true
|
||||||
}; logFLAGS()
|
}else return true
|
||||||
isDevConfig = true
|
}
|
||||||
|
function saveNewCompilationHash(){
|
||||||
|
const sourceHash = computeSourceHash("./src/")
|
||||||
|
const pluginHash = computeSourceHash("./plugins/")
|
||||||
|
const hash = sourceHash+":"+pluginHash
|
||||||
|
fs.writeFileSync("./dist/hash.txt",hash)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!process.argv.includes("--no-compile")){
|
||||||
|
const requiredDependencies = new Set()
|
||||||
|
if (fs.existsSync("./plugins")){
|
||||||
|
console.log("OT: Reading plugin.json files...")
|
||||||
|
for (const pluginDir of fs.readdirSync("./plugins")){
|
||||||
|
if (pluginDir === ".DS_Store") continue
|
||||||
|
const pluginPath = nodepath.join("./plugins", pluginDir)
|
||||||
|
if (!fs.statSync(pluginPath).isDirectory()) continue
|
||||||
|
|
||||||
|
const pluginJsonPath = nodepath.join(pluginPath, "plugin.json")
|
||||||
|
if (fs.existsSync(pluginJsonPath)){
|
||||||
try{
|
try{
|
||||||
tempconfig = require("./devConfig.json")
|
const pluginData = JSON.parse(fs.readFileSync(pluginJsonPath).toString())
|
||||||
}catch{tempconfig = require("./config.json")}
|
if (pluginData.npmDependencies && Array.isArray(pluginData.npmDependencies)){
|
||||||
}else{
|
pluginData.npmDependencies.forEach((dep) => {
|
||||||
tempconfig = require("./config.json")
|
if (typeof dep === "string" && dep.trim()){
|
||||||
}
|
requiredDependencies.add(dep.trim())
|
||||||
if (process.argv.some((v) => v == "--nochecker")){
|
|
||||||
async function logFLAGS(){
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
console.log(chalk.blue("[FLAGS] => disabled checker.js"))
|
|
||||||
}; logFLAGS()
|
|
||||||
}
|
|
||||||
if (process.argv.some((v) => v == "--debug")){
|
|
||||||
async function logFLAGS(){
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
console.log(chalk.blue("[FLAGS] => enabled DEBUG mode"))
|
|
||||||
}; logFLAGS()
|
|
||||||
}
|
|
||||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded flags")
|
|
||||||
|
|
||||||
exports.developerConfig = isDevConfig
|
|
||||||
const language = require("./core/languageManager").language
|
|
||||||
exports.language = language
|
|
||||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded language")
|
|
||||||
|
|
||||||
const config = tempconfig
|
|
||||||
exports.config = config
|
|
||||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded config")
|
|
||||||
exports.storage = require('./core/dynamicdatabase/storage')
|
|
||||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","loaded storage")
|
|
||||||
|
|
||||||
exports.errorLog = require("./core/errorLogSystem")
|
|
||||||
const log = this.errorLog.log
|
|
||||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","LOADED LOGGING SYSTEM")
|
|
||||||
if (process.argv.some((v) => v == "--debug")) console.log("[TEMP_DEBUG]","switching to new logs")
|
|
||||||
this.errorLog.log("debug","loaded new logs")
|
|
||||||
|
|
||||||
exports.hiddenData = require("./core/utils/hiddendata")
|
|
||||||
this.errorLog.log("debug","loaded hiddendataTM")
|
|
||||||
|
|
||||||
exports.embeds = {
|
|
||||||
commands:require("./core/interactionHandlers/embeds/commands")
|
|
||||||
}
|
|
||||||
exports.buttons = {
|
|
||||||
close:require("./core/interactionHandlers/buttons/close"),
|
|
||||||
firstmsg:require("./core/interactionHandlers/buttons/firstmsg"),
|
|
||||||
verifybars:require("./core/interactionHandlers/buttons/verifyBars")
|
|
||||||
}
|
|
||||||
this.errorLog.log("debug","loaded buttons & embeds")
|
|
||||||
|
|
||||||
client.on('ready',async () => {
|
|
||||||
this.errorLog.log("debug","client logged in")
|
|
||||||
var statusSet = false
|
|
||||||
const setStatus = (type,text) => {
|
|
||||||
if (statusSet == true) return
|
|
||||||
const getTypeEnum = (text) => {
|
|
||||||
if (text.toLowerCase() == "playing") return discord.ActivityType.Playing
|
|
||||||
else if (text.toLowerCase() == "listening") return discord.ActivityType.Listening
|
|
||||||
else if (text.toLowerCase() == "watching") return discord.ActivityType.Watching
|
|
||||||
else return discord.ActivityType.Listening
|
|
||||||
}
|
}
|
||||||
client.user.setActivity(text,{type:getTypeEnum(type)})
|
})
|
||||||
statusSet = true
|
|
||||||
log("system","loaded status",[{key:"type",value:type},{key:"text",value:text}])
|
|
||||||
}
|
}
|
||||||
this.errorLog.log("debug","bot status loaded")
|
}catch(err){
|
||||||
|
// skip invalid plugin.json files, will be caught later
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
|
|
||||||
if (!process.argv[2]){
|
|
||||||
console.log(chalk.red("WELCOME TO OPEN TICKET!"))
|
|
||||||
this.errorLog.log("debug","loaded console interface")
|
|
||||||
log("info","open ticket ready",[{key:"version",value:require("./package.json").version},{key:"language",value:config.languagefile}])
|
|
||||||
require("./core/utils/liveStatus")()
|
|
||||||
|
|
||||||
console.log(chalk.blue("\n\nlogs:")+"\n============")
|
|
||||||
if (config.status.enabled){
|
|
||||||
setStatus(config.status.type,config.status.text)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
log("system","bot logged in!")
|
|
||||||
|
|
||||||
await client.guilds.cache.find((g) => g.id == config.server_id).members.fetch()
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process.argv[2] == "d"){
|
|
||||||
if (config.status.enabled){
|
|
||||||
setStatus(config.status.type,config.status.text)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!process.argv[2].startsWith("slash")){
|
if (requiredDependencies.size > 0){
|
||||||
console.log(chalk.red("WELCOME TO OPEN TICKET!"))
|
console.log("OT: Checking plugin npm dependencies...")
|
||||||
this.errorLog.log("debug","loaded console interface")
|
/**@type {string[]} */
|
||||||
log("info","open ticket ready",[{key:"version",value:require("./package.json").version},{key:"language",value:config.languagefile}])
|
const missingDeps = []
|
||||||
require("./core/utils/liveStatus")()
|
for (const dep of requiredDependencies){
|
||||||
|
try{
|
||||||
console.log(chalk.blue("\n\nlogs:")+"\n============")
|
require.resolve(dep)
|
||||||
if (config.status.enabled){
|
}catch(err){
|
||||||
setStatus(config.status.type,config.status.text)
|
missingDeps.push(dep)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log("system","bot logged in!")
|
if (missingDeps.length > 0){
|
||||||
|
console.log(ansis.red("OT: ❌ Fatal Error --> Missing npm dependencies required by plugins:\n\n")+ansis.cyan(missingDeps.map((dep) => " - "+dep).join("\n")+"\n"))
|
||||||
await client.guilds.cache.find((g) => g.id == config.server_id).members.fetch()
|
console.log("OT: Please install missing dependencies using the following command:\n> "+ansis.bold.green("npm install " + missingDeps.join(" "))+"\n")
|
||||||
}else{
|
|
||||||
console.log(chalk.red("STARTING IN ")+chalk.blue("SLASH MODE")+chalk.red("..."))
|
|
||||||
this.errorLog.log("debug","slashmode activated")
|
|
||||||
console.log("logs:\n================")
|
|
||||||
console.log("client logged in...")
|
|
||||||
console.log("loading files...")
|
|
||||||
if (process.argv[3] == "enable"){
|
|
||||||
console.log(chalk.green("switching to slashEnable.js"))
|
|
||||||
require("./core/slashSystem/slashEnable")()
|
|
||||||
}else if (process.argv[3] == "disable"){
|
|
||||||
console.log(chalk.green("switching to slashDisable.js"))
|
|
||||||
require("./core/slashSystem/slashDisable")()
|
|
||||||
}else{
|
|
||||||
console.log(chalk.red("Internal Error: unknown slash mode!"))
|
|
||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//load plugins
|
if (requiresCompilation()){
|
||||||
require("./core/api/pluginlauncher")()
|
console.log("OT: Compilation Required...")
|
||||||
this.errorLog.log("debug","loading plugins")
|
|
||||||
})
|
|
||||||
if (!require("./core/api/api.json").disable.checkerjs.all) require("./core/checker").checker()
|
|
||||||
this.errorLog.log("debug","loading checker.js")
|
|
||||||
this.errorLog.log("debug","checking config...")
|
|
||||||
|
|
||||||
if (process.argv[2] && process.argv[2].startsWith("slash")){
|
//REMOVE EXISTING BUILDS
|
||||||
//do nothing
|
console.log("OT: Removing Prebuilds...")
|
||||||
}else{
|
fs.rmSync("./dist",{recursive:true,force:true})
|
||||||
|
|
||||||
this.errorLog.log("debug","LOADING COMMANDS")
|
//COMPILE TYPESCRIPT
|
||||||
//commands
|
console.log("OT: Compiling Typescript...")
|
||||||
require('./commands/ticket')()
|
const configPath = nodepath.resolve('./tsconfig.json')
|
||||||
require("./commands/help")()
|
const configFile = ts.readConfigFile(configPath,ts.sys.readFile)
|
||||||
require("./commands/close")()
|
|
||||||
require("./commands/delete")()
|
|
||||||
require("./commands/rename")()
|
|
||||||
require("./commands/add")()
|
|
||||||
require("./commands/remove")()
|
|
||||||
require("./commands/reopen")()
|
|
||||||
require("./commands/claim")()
|
|
||||||
require("./commands/unclaim")()
|
|
||||||
|
|
||||||
this.errorLog.log("debug","LOADING CORE")
|
//check for tsconfig errors
|
||||||
//core
|
if (configFile.error){
|
||||||
require('./core/ticketActions/ticketOpener')()
|
const message = ts.formatDiagnosticsWithColorAndContext([configFile.error],ts.createCompilerHost({}))
|
||||||
require("./core/reactionRoles")()
|
console.error(message)
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
|
||||||
this.errorLog.log("debug","LOADING INTERACTION HANDLERS")
|
//parse tsconfig file
|
||||||
//InteractionHandlers
|
const parsedConfig = ts.parseJsonConfigFileContent(configFile.config,ts.sys,nodepath.dirname(configPath))
|
||||||
require("./core/interactionHandlers/handlers/handlers")()
|
|
||||||
|
|
||||||
//require("./test")()
|
//create program/compiler
|
||||||
|
const program = ts.createProgram({
|
||||||
|
rootNames:parsedConfig.fileNames,
|
||||||
|
options:parsedConfig.options
|
||||||
|
})
|
||||||
|
|
||||||
|
//emit all compiled files
|
||||||
|
const emitResult = program.emit()
|
||||||
|
|
||||||
|
//print emit errors/warnings (type errors)
|
||||||
|
const allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics)
|
||||||
|
const formattedDiagnostics = ts.formatDiagnosticsWithColorAndContext(allDiagnostics, ts.createCompilerHost(parsedConfig.options))
|
||||||
|
console.log(formattedDiagnostics)
|
||||||
|
|
||||||
|
if (emitResult.emitSkipped || allDiagnostics.find((d) => d.category == ts.DiagnosticCategory.Error || d.category == ts.DiagnosticCategory.Warning)){
|
||||||
|
console.log("OT: Compilation Failed!")
|
||||||
|
process.exit(1)
|
||||||
|
}
|
||||||
|
}else console.log("OT: No Compilation Required...")
|
||||||
|
|
||||||
|
//save new compilation hash
|
||||||
|
saveNewCompilationHash()
|
||||||
}
|
}
|
||||||
|
|
||||||
this.errorLog.log("debug","loading api")
|
//START BOT
|
||||||
const APIEvents = require("./core/api/modules/events")
|
console.log("OT: Compilation Succeeded!")
|
||||||
const APIConfig = require("./core/api/api.json")
|
if (process.argv.includes("--compile-only")) process.exit(0) //exit when only compile is required!
|
||||||
|
console.log("OT: Starting Bot!")
|
||||||
const debugLog = (debugString) => {
|
require("./dist/src/index.js")
|
||||||
if (!APIConfig.disable.debug.all && !APIConfig.disable.debug.debuglogs){
|
|
||||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
|
||||||
fs.writeFileSync("./openticketdebug.txt",content+"\nDEBUG: "+debugString)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const errorLog = (errorString,stack) => {
|
|
||||||
if (!APIConfig.disable.debug.all){
|
|
||||||
const content = fs.existsSync("./openticketdebug.txt") ? fs.readFileSync("./openticketdebug.txt").toString() : "==========================\n<OPEN TICKET DEBUG FILE:>\n=========================="
|
|
||||||
fs.writeFileSync("./openticketdebug.txt",content+"\nERROR: "+errorString+" STACK: "+stack)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
this.errorLog.log("debug","OT error system loaded successfully")
|
|
||||||
|
|
||||||
client.on("debug", async (message) => {
|
|
||||||
if (message.startsWith("Provided token:")){
|
|
||||||
debugLog("Provided token: ***********bot token is invisible**************...")
|
|
||||||
return
|
|
||||||
}
|
|
||||||
debugLog(message)
|
|
||||||
});
|
|
||||||
|
|
||||||
process.on("uncaughtException",async (error,origin) => {
|
|
||||||
const chalk = await (await import("chalk")).default
|
|
||||||
console.log(chalk.red("\nOPEN TICKET ERROR: ")+error+"\n"+chalk.green("\nCreate a ticket in our support server for more information!\nIf you do this, you might help us to avoid a future bug!\n"))
|
|
||||||
errorLog(error.name+": "+error.message+" | origin: "+origin,error.stack)
|
|
||||||
|
|
||||||
APIEvents.onError(error.name+": "+error.message,new Date())
|
|
||||||
})
|
|
||||||
|
|
||||||
if (!APIBase.embeddedMode) client.login(config.auth_token)
|
|
||||||
this.errorLog.log("debug","login with token")
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
{
|
|
||||||
"errors": {
|
|
||||||
"missingArgsTitle": "قيمة غير صالحة!",
|
|
||||||
"missingArgsDescription": "قيمة مفقودة",
|
|
||||||
"noPermsTitle": "ليس لديك برمشنات !",
|
|
||||||
"noPermsDescription": "أنت بحاجة الى برمشن `ADMINISTRATOR` او أن تكون في قائمة المسموح بهم!",
|
|
||||||
"noPermsDelete": "فقط الإداريين يمكنهم حذف التكت!",
|
|
||||||
"chooseFromListTitle": "Invalid ID",
|
|
||||||
"chooseFromListDescription": "قم بأختيار أحد من الأيديات من الأسفل:",
|
|
||||||
"boterror": "خلل في البوت !",
|
|
||||||
"notInTicketTitle": "انت لست في تكت!",
|
|
||||||
"notInTicketDescription": "هذا الأمر لا يعمل خارج التكت!",
|
|
||||||
"ticketDoesntExist": "هذا التكت لم يعد فعال!",
|
|
||||||
"roleDoesntExist": "خطاً ,لم تعد الرتبة موجوده!",
|
|
||||||
"anotherOption": "هذا الخيار ليس التكت و لكنه شيء أخر!",
|
|
||||||
"maxAmountTitle": "خطأ , تم الوصول الى الحد الأقصى!",
|
|
||||||
"maxAmountDescription": "لقد وصلت الى الحد الأقصى لعدد التكتات المسموحة بها!\nSo لا يمكنك فتح واحدة أخرى!",
|
|
||||||
"somethingWentWrong": "**هناك خطاً!**\nأعد المحاولة لاحقاً!",
|
|
||||||
"somethingWentWrongTranscript": "هناك خطاً في محاولة طبع التكت!**\nأعد المحاولة لاحقاً!"
|
|
||||||
},
|
|
||||||
"commands": {
|
|
||||||
"userAddedTitle": "تم أضافة {0} من المستخدمين في التكت!",
|
|
||||||
"userRemovedTitle": "تم أزالة {0} من المستخدمين من التكت!",
|
|
||||||
"renameTitle": "تم تغيير أسم التكت الى {0}!",
|
|
||||||
"closeTitle": "تم أغلاق التكت!",
|
|
||||||
"deleteTitle": " جاري حذف التكت...",
|
|
||||||
"reopenTitle": "إعادة فتح التكت!",
|
|
||||||
"claimTitle":"This ticket is now claimed to {0}",
|
|
||||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
|
||||||
|
|
||||||
"ticketWarning": "هذا الأمبد موجود بالفعل في الرسالة بالأسفل!",
|
|
||||||
"maxTicketWarning": "**تحذير:** _يمكنك فقط فتح {0} تكت في الوقت!_"
|
|
||||||
},
|
|
||||||
"helpMenu": {
|
|
||||||
"title": "الأوامر المتاحة:",
|
|
||||||
"header1": "**أذهب الى {0} لإنشاء تذكرة!**\n\n",
|
|
||||||
"header2": "**قم بكتابة أمر `/new` او `/ticket` لفتح تكت!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd": "أنشاء أيمبد مع الأزرار. (الأداريين فقط)",
|
|
||||||
"renameCmd": "إعادة تسمية التكت. (بدون مسافات)",
|
|
||||||
"closeCmd": "أغلاق التكت.",
|
|
||||||
"deleteCmd": "حذف التكت.",
|
|
||||||
"addCmd": "إضافة مستخدم الى التكت.",
|
|
||||||
"removeCmd": "إزالة مستخدم من التكت.",
|
|
||||||
"reopenCmd": "إعادة فتح تكت بعد إغلاقة."
|
|
||||||
},
|
|
||||||
"buttons": {
|
|
||||||
"close": "إغلاق التكت",
|
|
||||||
"delete": "حذف التكت",
|
|
||||||
"reopen": "إعادة فتح التكت",
|
|
||||||
"sendTranscript": "طبع التكت",
|
|
||||||
"closeWithReason":"close with reason"
|
|
||||||
},
|
|
||||||
"messages": {
|
|
||||||
"reopenTitle": "تم إعادة فتح التكت بنجاح!",
|
|
||||||
"reopenDescription": "لا تتردد في فتح التكت مرة أخرى , حظاً موفقاً!",
|
|
||||||
"closedTitle": "تم إغلاق التكت!",
|
|
||||||
"closedDescription": "فقط الأداريين يمكنهم التحدث في هذا التكت الأن!\n\n*أضغط على الزر بالأسفل لحذف التكت او إعادة فتحة مجدداً!*",
|
|
||||||
"createdTitle": "تم إنشاء تكت!",
|
|
||||||
"createdDescription": "تم أنشاء تكت , قم بأنتظار الدعم في الطريق!",
|
|
||||||
|
|
||||||
"newTicketDmTitle": "تكت جديد!",
|
|
||||||
"closedTicketDmTitle": "تم إغلاق التكت!",
|
|
||||||
"deletedTicketDmTitle": "تم حذف التكت!",
|
|
||||||
"closedTicketDmDescription": "تم أغلاق تذكرتك من قبل إداري",
|
|
||||||
"deletedTicketDmDescription": "تم حذف تذكرتك من قبل إداري!",
|
|
||||||
"reopenTicketDmTitle": "تم إعادة فتح تذكرتك!",
|
|
||||||
"reopenTicketDmDescription": "تم إعادة فتح التكت!",
|
|
||||||
"newTranscriptTitle": "توجد نسخة تكت جديدة هنا!",
|
|
||||||
"hereIsTheTranscript": "هذا هي النسخة:",
|
|
||||||
|
|
||||||
"chooseCategory": "أختر الكتقاجوري:",
|
|
||||||
"gettingdeleted": "يتم حذف التكت...",
|
|
||||||
|
|
||||||
"none": "لا يوجد",
|
|
||||||
"reason": "سبب",
|
|
||||||
|
|
||||||
"deletedby":"deleted by",
|
|
||||||
"closedby":"closed by",
|
|
||||||
"modalreason":"What is the reason for closing this ticket?",
|
|
||||||
"chooseATicket": "Choose a ticket"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Invalid Arguments!",
|
|
||||||
"missingArgsDescription":"Missing Argument",
|
|
||||||
"noPermsTitle":"No Permissions!",
|
|
||||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
|
||||||
"noPermsDelete":"Only admins can delete a ticket!",
|
|
||||||
"chooseFromListTitle":"Invalid ID",
|
|
||||||
"chooseFromListDescription":"Choose one of the id's below:",
|
|
||||||
"boterror":"Bot Error!",
|
|
||||||
"notInTicketTitle":"You are not in a ticket!",
|
|
||||||
"notInTicketDescription":"This command doesn't work outside tickets!",
|
|
||||||
"ticketDoesntExist":"This ticket doesn't exist anymore!",
|
|
||||||
"roleDoesntExist":"This role doesn't exist anymore!",
|
|
||||||
"anotherOption":"This option is not a ticket but another type!",
|
|
||||||
"maxAmountTitle":"Max amount reached!",
|
|
||||||
"maxAmountDescription":"You reached the maximum number of tickets allowed!\nSo you can't create a new one!",
|
|
||||||
"somethingWentWrong":"**Something went wrong!**\nPlease try again another time!",
|
|
||||||
"somethingWentWrongTranscript":"Something went wrong while making the transcript!**\nPlease try again another time!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"Added {0} to this ticket!",
|
|
||||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
|
||||||
"renameTitle":"Changed the name to {0}!",
|
|
||||||
"closeTitle":"Closed this ticket!",
|
|
||||||
"deleteTitle":"Deleting this ticket...",
|
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
|
||||||
"claimTitle":"This ticket is now claimed to {0}",
|
|
||||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
|
||||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Available Commands:",
|
|
||||||
"header1":"**Go to {0} to create a ticket!**\n\n",
|
|
||||||
"header2":"**Run the command `/new` or `/ticket` to create a ticket!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Spawn an embed with buttons. (admins only)",
|
|
||||||
"renameCmd":"Rename a ticket. (no spaces)",
|
|
||||||
"closeCmd":"Close a ticket.",
|
|
||||||
"deleteCmd":"Delete a ticket.",
|
|
||||||
"addCmd":"Add a user to the ticket.",
|
|
||||||
"removeCmd":"Remove a user from the ticket.",
|
|
||||||
"reopenCmd":"Re-Open a ticket after it was closed."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Close Ticket",
|
|
||||||
"delete":"Delete Ticket",
|
|
||||||
"reopen":"Re-Open Ticket",
|
|
||||||
"sendTranscript":"Transcript",
|
|
||||||
"closeWithReason":"close with reason"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
|
||||||
"reopenDescription":"Feel free to talk again!",
|
|
||||||
"closedTitle":"Closed this ticket!",
|
|
||||||
"closedDescription":"Only admins can talk in this ticket now!\n\n*Click on the button below to delete or to re-open this ticket!*",
|
|
||||||
"createdTitle":"Ticket Created!",
|
|
||||||
"createdDescription":"Your ticket is created, you can detect it by a ping!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"New Ticket!",
|
|
||||||
"closedTicketDmTitle":"Ticket Closed!",
|
|
||||||
"deletedTicketDmTitle":"Ticket Deleted!",
|
|
||||||
"closedTicketDmDescription":"Your ticket is closed!",
|
|
||||||
"deletedTicketDmDescription":"Your ticket is deleted!",
|
|
||||||
"reopenTicketDmTitle":"Ticket Re-opened!",
|
|
||||||
"reopenTicketDmDescription":"Your ticket is re-opened!",
|
|
||||||
"newTranscriptTitle":"A new transcript is here!",
|
|
||||||
"hereIsTheTranscript":"Here is the transcript:",
|
|
||||||
|
|
||||||
"chooseCategory":"choose a category:",
|
|
||||||
"gettingdeleted":"Ticket is getting deleted...",
|
|
||||||
|
|
||||||
"none":"none",
|
|
||||||
"reason":"reason",
|
|
||||||
|
|
||||||
"deletedby":"deleted by",
|
|
||||||
"closedby":"closed by",
|
|
||||||
"modalreason":"What is the reason for closing this ticket?",
|
|
||||||
"chooseATicket": "Choose a ticket"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Neplatné argumenty",
|
|
||||||
"missingArgsDescription":"Chybí argumenty",
|
|
||||||
"noPermsTitle":"Nemáš práva!",
|
|
||||||
"noPermsDescription":"Nemáš dostatečné práva na tento příkaz!\n Potřebuješ ADMINISTRATOR aby jsi mohl provést příkaz!",
|
|
||||||
"noPermsDelete":"Pouze admin může smazat ticket!",
|
|
||||||
"chooseFromListTitle":"Neplatné ID",
|
|
||||||
"chooseFromListDescription":"Vyber si z těchto ID:",
|
|
||||||
"boterror":"Error!",
|
|
||||||
"notInTicketTitle":"Nejsi v ticketu!",
|
|
||||||
"notInTicketDescription":"Tento příkaz nefunguje mimo tickety!",
|
|
||||||
"ticketDoesntExist":"Tento ticket už bohužel neexistuje!",
|
|
||||||
"roleDoesntExist":"Tato role bohužel neexistuje!",
|
|
||||||
"anotherOption":"Tato možnost není ticket ale něco jiného!",
|
|
||||||
"maxAmountTitle":"Maximální počet ticketů dosažen!",
|
|
||||||
"maxAmountDescription":"Dosáhl jsi maximálního povoleného počtu ticketů!\n Nemůžeš si vytvořit nový!",
|
|
||||||
"somethingWentWrong":"**Něco je špatně**\nProsím zkus to příště znovu!",
|
|
||||||
"somethingWentWrongTranscript":"Něco je špatně s transcriptem!**\nProsím zkus to příště znovu!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"{0} byl přidán do ticketu!",
|
|
||||||
"userRemovedTitle":"{0} byl odebrám z ticketu!",
|
|
||||||
"renameTitle":"Jméno bylo změněno!",
|
|
||||||
"closeTitle":"Zavři tento ticket!",
|
|
||||||
"deleteTitle":"Smaž tento ticket!",
|
|
||||||
"reopenTitle":"Znovu otevři ticket!",
|
|
||||||
"claimTitle":"This ticket is now claimed to {0}",
|
|
||||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
|
||||||
"maxTicketWarning":"**Varovaní:** _Můžeš si vytvořit použe {0} ticket(s) v jednu chvíli!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Příkazy:",
|
|
||||||
"header1":"**Běž {0} vytvořit si ticket!**\n\n",
|
|
||||||
"header2":"**Použij příkaz `/new` nebo `/ticket` k vytvoření ticketu!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Vytvoř možnost otevírat tickety přes tlačítko. (ADMIN)",
|
|
||||||
"renameCmd":"Přejmenovat ticket. (Žádné mezery)",
|
|
||||||
"closeCmd":"Zavři ticket.",
|
|
||||||
"deleteCmd":"Smaž ticket.",
|
|
||||||
"addCmd":"Přidej člena do ticketu.",
|
|
||||||
"removeCmd":"Odebere člena z ticketu.",
|
|
||||||
"reopenCmd":"Znovu otevři ticket po uzavření."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Zavři ticket",
|
|
||||||
"delete":"Smaž ticket",
|
|
||||||
"reopen":"Znovu otevři ticket",
|
|
||||||
"sendTranscript":"Odešli log ticketu",
|
|
||||||
"closeWithReason":"close with reason"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"Ticket znovu otevřen!",
|
|
||||||
"reopenDescription":"Cítím se skvěle že si můžeme zase povídat!",
|
|
||||||
"closedTitle":"Zavřený ticket!",
|
|
||||||
"closedDescription":"Pouze admin team zde může nyní komunikovat!\n\n*Klikni na tlačítko níže pro smazání nebo znovu otevření ticketu!*",
|
|
||||||
"createdTitle":"Ticket vytvořen!",
|
|
||||||
"createdDescription":"Váš tiket je vytvořen, můžete ho zjistit pomocí pingu!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"Nový ticket!",
|
|
||||||
"closedTicketDmTitle":"Ticket uzavřen!",
|
|
||||||
"deletedTicketDmTitle":"Ticket smazán!",
|
|
||||||
"closedTicketDmDescription":"Tvůj ticket byl uzavřen!",
|
|
||||||
"deletedTicketDmDescription":"Tvůj ticket byl smazán!",
|
|
||||||
"reopenTicketDmTitle":"Ticket znovu otevřen!",
|
|
||||||
"reopenTicketDmDescription":"Tvůj ticket byl znovu otevřen!",
|
|
||||||
"newTranscriptTitle":"Nový log ticketu je zde!",
|
|
||||||
"hereIsTheTranscript":"Zde je log:",
|
|
||||||
|
|
||||||
"chooseCategory":"Vyber kategorii:",
|
|
||||||
"gettingdeleted":"Ticket bude smazán",
|
|
||||||
|
|
||||||
"none":"nic",
|
|
||||||
"reason":"důvod",
|
|
||||||
|
|
||||||
"deletedby":"deleted by",
|
|
||||||
"closedby":"closed by",
|
|
||||||
"modalreason":"What is the reason for closing this ticket?",
|
|
||||||
"chooseATicket": "Choose a ticket"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Onjuiste parameters!",
|
|
||||||
"missingArgsDescription":"Er missen parameters",
|
|
||||||
"noPermsTitle":"Geen permissies!",
|
|
||||||
"noPermsDescription":"Je hebt de `ADMINISTRATOR` permissie nodig of je moet in de lijst van toegestane users staan!",
|
|
||||||
"noPermsDelete":"Alleen admins kunnen een ticket verwijderen!",
|
|
||||||
"chooseFromListTitle":"Onjuist ID",
|
|
||||||
"chooseFromListDescription":"Kies een van de id's hier onder:",
|
|
||||||
"boterror":"Bot Error!",
|
|
||||||
"notInTicketTitle":"Je bent niet in een ticket!",
|
|
||||||
"notInTicketDescription":"Deze command werkt niet buiten tickets!",
|
|
||||||
"ticketDoesntExist":"Dit ticket bestaat niet meer!",
|
|
||||||
"roleDoesntExist":"Deze rol bestaat niet meer!",
|
|
||||||
"anotherOption":"Deze optie is niet een ticket, maar een ander type!",
|
|
||||||
"maxAmountTitle":"Maximum numer bereikt!",
|
|
||||||
"maxAmountDescription":"Je hebt het maximum aantal openstaande tickets bereikt!\nDus je kan geen nieuwe meer maken!",
|
|
||||||
"somethingWentWrong":"**Iets ging fout!**\nProbeer een andere keer opnieuw!",
|
|
||||||
"somethingWentWrongTranscript":"Iets ging fout terwijl het transcript gemaakt werd!**\nProbeer een andere keer opnieuw!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"{0} is toegevoegd aan dit ticket!",
|
|
||||||
"userRemovedTitle":"{0} is verwijderd van dit ticket!",
|
|
||||||
"renameTitle":"De naam is veranderd naar {0}!",
|
|
||||||
"closeTitle":"Ticket gesloten!",
|
|
||||||
"deleteTitle":"Ticket aan het verwijderen...",
|
|
||||||
"reopenTitle":"Ticket heropend!",
|
|
||||||
"claimTitle":"This ticket is now claimed to {0}",
|
|
||||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
|
||||||
|
|
||||||
"ticketWarning":"De embed is in het bericht hier onder!",
|
|
||||||
"maxTicketWarning":"**Waarschuwing:** _Je kan maar {0} ticket(s) tegelijkertijd maken!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Beschikbare Commands:",
|
|
||||||
"header1":"**Ga naar {0} om een ticket te maken!**\n\n",
|
|
||||||
"header2":"**Run de command `/new` of `/ticket` om een ticket te maken!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Spawn een embed met knoppen. (alleen admins)",
|
|
||||||
"renameCmd":"Hernoem een ticket. (geen spaties)",
|
|
||||||
"closeCmd":"Sluit een ticket.",
|
|
||||||
"deleteCmd":"Verijder een ticket.",
|
|
||||||
"addCmd":"Voeg een user aan een ticket.",
|
|
||||||
"removeCmd":"Verwijder een user van een ticket.",
|
|
||||||
"reopenCmd":"Heropen een ticket nadat het gesloten is."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Sluit Ticket",
|
|
||||||
"delete":"Verwijder Ticket",
|
|
||||||
"reopen":"Heropen Ticket",
|
|
||||||
"sendTranscript":"Transcript",
|
|
||||||
"closeWithReason":"sluit met reden"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"Ticket heropend!",
|
|
||||||
"reopenDescription":"Voel vrij om weer te praten!",
|
|
||||||
"closedTitle":"Ticket gesloten!",
|
|
||||||
"closedDescription":"Alleen admins kunnen nog praten.\n\n*Klik op de knoppen hieronder voor meer acties!*",
|
|
||||||
"createdTitle":"Ticket Aangemaakt!",
|
|
||||||
"createdDescription":"U ticket is gemaakt, je kan het detecteren bij een ping!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"Nieuw Ticket!",
|
|
||||||
"closedTicketDmTitle":"Ticket Gesloten!",
|
|
||||||
"deletedTicketDmTitle":"Ticket Verwijderd!",
|
|
||||||
"closedTicketDmDescription":"Je ticket is gesloten!",
|
|
||||||
"deletedTicketDmDescription":"Je ticket is verwijderd!",
|
|
||||||
"reopenTicketDmTitle":"Ticket Heropend!",
|
|
||||||
"reopenTicketDmDescription":"Je ticket is heropend!",
|
|
||||||
"newTranscriptTitle":"Er is een nieuw transcript!",
|
|
||||||
"hereIsTheTranscript":"Hier is het transcript:",
|
|
||||||
|
|
||||||
"chooseCategory":"kies een categorie:",
|
|
||||||
"gettingdeleted":"Ticket wordt verwijderd...",
|
|
||||||
|
|
||||||
"none":"geen",
|
|
||||||
"reason":"reden",
|
|
||||||
|
|
||||||
"deletedby":"verwijderd door",
|
|
||||||
"closedby":"gesloten door",
|
|
||||||
"modalreason":"Wat is de reden om dit ticket te sluiten?",
|
|
||||||
"chooseATicket": "Kies een ticket"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Invalid Arguments!",
|
|
||||||
"missingArgsDescription":"Missing Argument",
|
|
||||||
"noPermsTitle":"No Permissions!",
|
|
||||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
|
||||||
"noPermsDelete":"Only admins can delete a ticket!",
|
|
||||||
"chooseFromListTitle":"Invalid ID",
|
|
||||||
"chooseFromListDescription":"Choose one of the id's below:",
|
|
||||||
"boterror":"Bot Error!",
|
|
||||||
"notInTicketTitle":"You are not in a ticket!",
|
|
||||||
"notInTicketDescription":"This command doesn't work outside tickets!",
|
|
||||||
"ticketDoesntExist":"This ticket doesn't exist anymore!",
|
|
||||||
"roleDoesntExist":"This role doesn't exist anymore!",
|
|
||||||
"anotherOption":"This option is not a ticket but another type!",
|
|
||||||
"maxAmountTitle":"Max amount reached!",
|
|
||||||
"maxAmountDescription":"You reached the maximum number of tickets allowed!\nSo you can't create a new one!",
|
|
||||||
"somethingWentWrong":"**Something went wrong!**\nPlease try again another time!",
|
|
||||||
"somethingWentWrongTranscript":"Something went wrong while making the transcript!**\nPlease try again another time!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"Added {0} to this ticket!",
|
|
||||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
|
||||||
"renameTitle":"Changed the name to {0}!",
|
|
||||||
"closeTitle":"Closed this ticket!",
|
|
||||||
"deleteTitle":"Deleting this ticket...",
|
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
|
||||||
"claimTitle":"This ticket is now claimed to {0}",
|
|
||||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
|
||||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Available Commands:",
|
|
||||||
"header1":"**Go to {0} to create a ticket!**\n\n",
|
|
||||||
"header2":"**Run the command `/new` or `/ticket` to create a ticket!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Spawn an embed with buttons. (admins only)",
|
|
||||||
"renameCmd":"Rename a ticket. (no spaces)",
|
|
||||||
"closeCmd":"Close a ticket.",
|
|
||||||
"deleteCmd":"Delete a ticket.",
|
|
||||||
"addCmd":"Add a user to the ticket.",
|
|
||||||
"removeCmd":"Remove a user from the ticket.",
|
|
||||||
"reopenCmd":"Re-Open a ticket after it was closed."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Close Ticket",
|
|
||||||
"delete":"Delete Ticket",
|
|
||||||
"reopen":"Re-Open Ticket",
|
|
||||||
"sendTranscript":"Transcript",
|
|
||||||
"closeWithReason":"close with reason"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
|
||||||
"reopenDescription":"Feel free to talk again!",
|
|
||||||
"closedTitle":"Closed this ticket!",
|
|
||||||
"closedDescription":"Only admins can talk in this ticket now!\n\n*Click on the button below to delete or to re-open this ticket!*",
|
|
||||||
"createdTitle":"Ticket Created!",
|
|
||||||
"createdDescription":"Your ticket is created, you can detect it by a ping!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"New Ticket!",
|
|
||||||
"closedTicketDmTitle":"Ticket Closed!",
|
|
||||||
"deletedTicketDmTitle":"Ticket Deleted!",
|
|
||||||
"closedTicketDmDescription":"Your ticket is closed!",
|
|
||||||
"deletedTicketDmDescription":"Your ticket is deleted!",
|
|
||||||
"reopenTicketDmTitle":"Ticket Re-opened!",
|
|
||||||
"reopenTicketDmDescription":"Your ticket is re-opened!",
|
|
||||||
"newTranscriptTitle":"A new transcript is here!",
|
|
||||||
"hereIsTheTranscript":"Here is the transcript:",
|
|
||||||
|
|
||||||
"chooseCategory":"choose a category:",
|
|
||||||
"gettingdeleted":"Ticket is getting deleted...",
|
|
||||||
|
|
||||||
"none":"none",
|
|
||||||
"reason":"reason",
|
|
||||||
|
|
||||||
"deletedby":"deleted by",
|
|
||||||
"closedby":"closed by",
|
|
||||||
"modalreason":"What is the reason for closing this ticket?",
|
|
||||||
"chooseATicket": "Choose a ticket"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Arguments invalides!",
|
|
||||||
"missingArgsDescription":"Argument manquant",
|
|
||||||
"noPermsTitle":"Pas de permissions!",
|
|
||||||
"noPermsDescription":"Vous avez besoin de la permission `ADMINISTRATOR` ou être dans la liste des rôles autorisés!",
|
|
||||||
"noPermsDelete":"Seuls les administrateurs peuvent supprimer un ticket!",
|
|
||||||
"chooseFromListTitle":"Invalid ID",
|
|
||||||
"chooseFromListDescription":"Choisissez l'un des identifiants ci-dessous:",
|
|
||||||
"boterror":"Bot Error!",
|
|
||||||
"notInTicketTitle":"Vous n'êtes pas dans un ticket!",
|
|
||||||
"notInTicketDescription":"Cette commande ne fonctionne pas en dehors des tickets!",
|
|
||||||
"ticketDoesntExist":"Ce ticket n'existe plus!",
|
|
||||||
"roleDoesntExist":"Ce rôle n'existe plus!",
|
|
||||||
"anotherOption":"Cette option n'est pas un ticket mais un autre type!",
|
|
||||||
"maxAmountTitle":"Montant maximum atteint!",
|
|
||||||
"maxAmountDescription":"Vous avez atteint le nombre maximum de tickets autorisés!\nVous ne pouvez donc pas en créer un nouveau!",
|
|
||||||
"somethingWentWrong":"**Quelque chose s'est mal passé!**\nVeuillez réessayer une autre fois!",
|
|
||||||
"somethingWentWrongTranscript":"Une erreur s'est produite lors de la création de la transcription!**\nVeuillez réessayer une autre fois!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"{0} a été ajouté à ce ticket!",
|
|
||||||
"userRemovedTitle":"Supprimé {0} de ce ticket!",
|
|
||||||
"renameTitle":"Changement du nom en {0}!",
|
|
||||||
"closeTitle":"Fermé ce ticket!",
|
|
||||||
"deleteTitle":"Suppression de ce ticket...",
|
|
||||||
"reopenTitle":"A rouvert ce ticket!",
|
|
||||||
"claimTitle":"This ticket is now claimed to {0}",
|
|
||||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
|
||||||
|
|
||||||
"ticketWarning":"L'intégration est dans le message ci-dessous!",
|
|
||||||
"maxTicketWarning":"**Attention :** _Vous ne pouvez créer que {0} ticket(s) à la fois !_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Commandes disponibles :",
|
|
||||||
"header1":"**Allez à {0} pour créer un ticket !**\n\n",
|
|
||||||
"header2":"**Exécutez la commande `/new` ou `/ticket` pour créer un ticket !**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Faire apparaître une intégration avec des boutons. (administrateurs uniquement)",
|
|
||||||
"renameCmd":"Renommer un ticket. (sans espaces)",
|
|
||||||
"closeCmd":"Fermer un ticket.",
|
|
||||||
"deleteCmd":"Supprimer un billet.",
|
|
||||||
"addCmd":"Ajouter un utilisateur au ticket.",
|
|
||||||
"removeCmd":"Supprimer un utilisateur du ticket.",
|
|
||||||
"reopenCmd":"Rouvrir un ticket après sa clôture."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Fermer le ticket",
|
|
||||||
"delete":"Supprimer le billet",
|
|
||||||
"reopen":"Billet de réouverture",
|
|
||||||
"sendTranscript":"Transcript",
|
|
||||||
"closeWithReason":"fermer avec une raison"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"A rouvert ce ticket!",
|
|
||||||
"reopenDescription":"N'hésitez pas à reparler!",
|
|
||||||
"closedTitle":"Fermé ce ticket!",
|
|
||||||
"closedDescription":"Seuls les administrateurs peuvent parler dans ce ticket maintenant !\n\n*Cliquez sur le bouton ci-dessous pour supprimer ou rouvrir ce ticket !*",
|
|
||||||
"createdTitle":"Ticket créé !",
|
|
||||||
"createdDescription":"Votre ticket est créé, vous pouvez le détecter par un ping !",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"Nouveau billet!",
|
|
||||||
"closedTicketDmTitle":"Billet fermé!",
|
|
||||||
"deletedTicketDmTitle":"Billet supprimé !",
|
|
||||||
"closedTicketDmDescription":"Votre billet est fermé !",
|
|
||||||
"deletedTicketDmDescription":"Votre billet est supprimé !",
|
|
||||||
"reopenTicketDmTitle":"Billet rouvert!",
|
|
||||||
"reopenTicketDmDescription":"Votre billet est rouvert !",
|
|
||||||
"newTranscriptTitle":"Une nouvelle transcription est ici!",
|
|
||||||
"hereIsTheTranscript":"Voici la transcription :",
|
|
||||||
|
|
||||||
"chooseCategory":"choisissez une catégorie:",
|
|
||||||
"gettingdeleted":"Le ticket est en cours de suppression...",
|
|
||||||
|
|
||||||
"none":"rien",
|
|
||||||
"reason":"raison",
|
|
||||||
|
|
||||||
"deletedby":"supprimé par",
|
|
||||||
"closedby":"fermé par",
|
|
||||||
"modalreason":"Qu’elle est la raison pour fermer ce ticket?",
|
|
||||||
"chooseATicket": "Choisir un ticket"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Ungültiges Argument!",
|
|
||||||
"missingArgsDescription":"Fehlendes Argument!",
|
|
||||||
"noPermsTitle":"Du hast keine Rechte!",
|
|
||||||
"noPermsDescription":"You need the `ADMINISTRATOR` permission or be in the list of allowed roles!",
|
|
||||||
"noPermsDelete":"Only admins can delete a ticket!",
|
|
||||||
"chooseFromListTitle":"Ungültige ID",
|
|
||||||
"chooseFromListDescription":"Wählen Sie eine der folgenden ID:",
|
|
||||||
"boterror":"Bot Fehler!",
|
|
||||||
"notInTicketTitle":"Du bist ein kein Ticket!",
|
|
||||||
"notInTicketDescription":"Der Befehl funktioniert nicht außerhalb eines Tickets!",
|
|
||||||
"ticketDoesntExist":"Das Ticket Exisitert nicht mehr!",
|
|
||||||
"roleDoesntExist":"Die Rolle Exisitiert nicht mehr!",
|
|
||||||
"anotherOption":"Diese Option ist kein Ticket, sondern eine andere Art!",
|
|
||||||
"maxAmountTitle":"Das Limit wurde erreicht!",
|
|
||||||
"maxAmountDescription":"Sie haben die maximal zulässige Anzahl von Tickets erreicht!\nSie können also keine neue erstellen.!",
|
|
||||||
"somethingWentWrong":"**Etwas ist schief gelaufen!**\nBitte versuchen Sie es ein anderes Mal!",
|
|
||||||
"somethingWentWrongTranscript":"Bei der Erstellung der Transcript ist etwas schief gelaufen!**\nBitte versuchen Sie es ein anderes Mal!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"Added {0} to this ticket!",
|
|
||||||
"userRemovedTitle":"Removed {0} from this ticket!",
|
|
||||||
"renameTitle":"Changed the name to {0}!",
|
|
||||||
"closeTitle":"Closed this ticket!",
|
|
||||||
"deleteTitle":"Deleting this ticket...",
|
|
||||||
"reopenTitle":"Re-Opened this ticket!",
|
|
||||||
"claimTitle":"This ticket is now claimed to {0}",
|
|
||||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
|
||||||
|
|
||||||
"ticketWarning":"The embed is in the message below!",
|
|
||||||
"maxTicketWarning":"**Warning:** _You can only create {0} ticket(s) at a time!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Available Commands:",
|
|
||||||
"header1":"**Gehe zu {0} um ein Ticket zu erstellen!**\n\n",
|
|
||||||
"header2":"**Führen Sie den Befehl `/new` oder `/ticket` um ein Ticket zu erstellen!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Eine Einbettung mit Schaltflächen erzeugen. (nur admins)",
|
|
||||||
"renameCmd":"Ein Ticket umbenennen. (keine Leerzeichen)",
|
|
||||||
"closeCmd":"Schließen Sie ein Ticket.",
|
|
||||||
"deleteCmd":"Ein Ticket löschen.",
|
|
||||||
"addCmd":"Fügen Sie dem Ticket einen Benutzer hinzu.",
|
|
||||||
"removeCmd":"Entfernen eines Benutzers aus dem Ticket.",
|
|
||||||
"reopenCmd":"Öffnen Sie ein Ticket erneut, nachdem es geschlossen wurde."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Ticket schließen",
|
|
||||||
"delete":"Ticket löschen",
|
|
||||||
"reopen":"Ticket wieder öffnen",
|
|
||||||
"sendTranscript":"Transcript-Datei senden",
|
|
||||||
"closeWithReason":"Geschlossen mit dem Grund"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"Dieses Ticket wiedereröffnet!",
|
|
||||||
"reopenDescription":"Sie können gerne weiterreden!",
|
|
||||||
"closedTitle":"Dieses Ticket geschlossen!",
|
|
||||||
"closedDescription":"Nur Admins können jetzt in diesem Ticket sprechen!\n\n*Klicken Sie auf die Schaltfläche unten, um dieses Ticket zu löschen oder erneut zu öffnen!*",
|
|
||||||
"createdTitle":"Ticket erstellt!",
|
|
||||||
"createdDescription":"Ihr Ticket ist erstellt, Sie können es durch einen Ping erkennen!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"Neues Ticket!",
|
|
||||||
"closedTicketDmTitle":"Ticket schließen!",
|
|
||||||
"deletedTicketDmTitle":"Ticket löschen!",
|
|
||||||
"closedTicketDmDescription":"Ihr Ticket ist geschlossen!",
|
|
||||||
"deletedTicketDmDescription":"Ihr Ticket ist gelöscht!",
|
|
||||||
"reopenTicketDmTitle":"Ticket neu Eröffnen!",
|
|
||||||
"reopenTicketDmDescription":"Dein Ticket ist Neu eröffnet!",
|
|
||||||
"newTranscriptTitle":"Eine neue Transscript finden Sie hier!",
|
|
||||||
"hereIsTheTranscript":"Hier ist das Transscript:",
|
|
||||||
|
|
||||||
"chooseCategory":"Wähle eine Kategorie:",
|
|
||||||
"gettingdeleted":"Ticket wird gelöscht...",
|
|
||||||
|
|
||||||
"none":"none",
|
|
||||||
"reason":"reason",
|
|
||||||
|
|
||||||
"deletedby":"Gelöscht von",
|
|
||||||
"closedby":"Geschlossen von",
|
|
||||||
"modalreason":"Was ist der Grund für das schließen des Tickets?",
|
|
||||||
"chooseATicket": "Wähle ein Ticket"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Argomenti non validi!",
|
|
||||||
"missingArgsDescription":"Argomento mancante",
|
|
||||||
"noPermsTitle":"Permessi mancanti!",
|
|
||||||
"noPermsDescription":"Hai bisogno del permesso `ADMINISTRATOR` e essere nella lista dei ruoli accettati!",
|
|
||||||
"noPermsDelete":"Solo gli amministratori possono chiudere un ticket!",
|
|
||||||
"chooseFromListTitle":"ID non valido",
|
|
||||||
"chooseFromListDescription":"Scegli uno degli ID sotto:",
|
|
||||||
"boterror":"Errore del bot!",
|
|
||||||
"notInTicketTitle":"Non sei in un ticket!",
|
|
||||||
"notInTicketDescription":"Questo comando non funziona fuori da un ticket!",
|
|
||||||
"ticketDoesntExist":"Questo ticket non esiste più!",
|
|
||||||
"roleDoesntExist":"Questo ruolo non esiste più!",
|
|
||||||
"anotherOption":"Questa opzione non è di un ticket!",
|
|
||||||
"maxAmountTitle":"Massimo numero raggiunto!",
|
|
||||||
"maxAmountDescription":"Hai raggiunto il massimo numero di ticket consentiti!\nNon puoi crearne altri!",
|
|
||||||
"somethingWentWrong":"**Qualcosa è andato storto!**\nPerfavore riprova un'altra volta!",
|
|
||||||
"somethingWentWrongTranscript":"Qualcosa è andata storta durante la trascrizione!**\nPerfavore riprova un'altra volta!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"Aggiunto {0} al ticket!",
|
|
||||||
"userRemovedTitle":"Rimosso {0} da questo ticket!",
|
|
||||||
"renameTitle":"Cambia il nome in {0}!",
|
|
||||||
"closeTitle":"Chiudo questo ticket!",
|
|
||||||
"deleteTitle":"Eliminando questo ticket...",
|
|
||||||
"reopenTitle":"Ri-Aperto questo ticket!",
|
|
||||||
"claimTitle":"This ticket is now claimed to {0}",
|
|
||||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
|
||||||
|
|
||||||
"ticketWarning":"L'embed è nel messaggio sotto!",
|
|
||||||
"maxTicketWarning":"**Attenzione:** _Tu puoi creare solo {0} ticket(s) per volta!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Comandi disponibili:",
|
|
||||||
"header1":"**Vai a {0} per creare un ticket!**\n\n",
|
|
||||||
"header2":"**Esegui il comando `/new` o `/ticket` per creare un ticket!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Crea un embed con pulsanti. (solo amministratori)",
|
|
||||||
"renameCmd":"Rinomina un ticket. (senza spazi)",
|
|
||||||
"closeCmd":"Chiudi un ticket.",
|
|
||||||
"deleteCmd":"Elimina un ticket.",
|
|
||||||
"addCmd":"Aggiungi un membro al ticket.",
|
|
||||||
"removeCmd":"Rimuovi un membro dal ticket.",
|
|
||||||
"reopenCmd":"Riapri un ticket dopo averlo chiuso."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Chiudi il ticket",
|
|
||||||
"delete":"Elimina il ticket",
|
|
||||||
"reopen":"Riapri il ticket",
|
|
||||||
"sendTranscript":"Trascrizione",
|
|
||||||
"closeWithReason":"chiudi con un motivo"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"Riaperto questo ticket!",
|
|
||||||
"reopenDescription":"Sentiti libero di parlare di nuovo!",
|
|
||||||
"closedTitle":"Chiudo questo ticket!",
|
|
||||||
"closedDescription":"Solo gli amministratori possono parlare in questo ticket ora!\n\n*Clicca sul bottone sotto per chiudere o riaprire questo ticket!*",
|
|
||||||
"createdTitle":"Ticket creato!",
|
|
||||||
"createdDescription":"Il tuo ticket è stato creato, puoi capirlo dal ping!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"Nuovo ticket!",
|
|
||||||
"closedTicketDmTitle":"Ticket chiuso!",
|
|
||||||
"deletedTicketDmTitle":"Ticket eliminato!",
|
|
||||||
"closedTicketDmDescription":"Il tuo ticket è chiuso!",
|
|
||||||
"deletedTicketDmDescription":"Il tuo ticket è stato eliminato!",
|
|
||||||
"reopenTicketDmTitle":"Ticket riaperto!",
|
|
||||||
"reopenTicketDmDescription":"Il tuo ticket è stato riaperto!",
|
|
||||||
"newTranscriptTitle":"Un nuova trascrizione è qui!",
|
|
||||||
"hereIsTheTranscript":"Qui è la trascrizione:",
|
|
||||||
|
|
||||||
"chooseCategory":"scegli una categoria:",
|
|
||||||
"gettingdeleted":"Il ticket sta per essere chiuso...",
|
|
||||||
|
|
||||||
"none":"nessuno",
|
|
||||||
"reason":"motivo",
|
|
||||||
|
|
||||||
"deletedby":"eliminato da",
|
|
||||||
"closedby":"chiuso da",
|
|
||||||
"modalreason":"Quale'è il motivo per chiudere il ticket?",
|
|
||||||
"chooseATicket": "Scegli un ticket"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,83 +0,0 @@
|
|||||||
{
|
|
||||||
"errors":{
|
|
||||||
"missingArgsTitle":"Argumentos inválidos!",
|
|
||||||
"missingArgsDescription":"Argumento ausente",
|
|
||||||
"noPermsTitle":"Sem permissões!",
|
|
||||||
"noPermsDescription":"Você precisa da permissão `ADMINISTRATOR` ou estar na lista de funções permitidas!",
|
|
||||||
"noPermsDelete":"Somente administradores podem deletar um ticket!",
|
|
||||||
"chooseFromListTitle":"ID inválido",
|
|
||||||
"chooseFromListDescription":"Escolha um dos IDs abaixo:",
|
|
||||||
"boterror":"Erro de bot!",
|
|
||||||
"notInTicketTitle":"Você não está em um ticket!",
|
|
||||||
"notInTicketDescription":"Este comando não funciona fora dos tickets!",
|
|
||||||
"ticketDoesntExist":"Este ticket não existe mais!",
|
|
||||||
"roleDoesntExist":"Esta função não existe mais!",
|
|
||||||
"anotherOption":"Esta opção não é um ticket, mas sim outro tipo!",
|
|
||||||
"maxAmountTitle":"Quantidade máxima atingida!",
|
|
||||||
"maxAmountDescription":"Você atingiu o número máximo de tickets permitidos!\nEntão você não pode criar um novo!",
|
|
||||||
"somethingWentWrong":"**Algo deu errado!**\nPor favor, tente novamente outra vez!",
|
|
||||||
"somethingWentWrongTranscript":"Algo deu errado ao fazer a transcrição!**\nPor favor, tente novamente outra vez!"
|
|
||||||
},
|
|
||||||
"commands":{
|
|
||||||
"userAddedTitle":"Adicionado {0} a este ticket!",
|
|
||||||
"userRemovedTitle":"Removido {0} deste ticket!",
|
|
||||||
"renameTitle":"Mudou o nome para {0}!",
|
|
||||||
"closeTitle":"Fechado este ticket!",
|
|
||||||
"deleteTitle":"Excluindo este ticket...",
|
|
||||||
"reopenTitle":"Reabriu este ticket!",
|
|
||||||
"claimTitle":"This ticket is now claimed to {0}",
|
|
||||||
"unclaimTitle":"This ticket isn't claimed anymore!",
|
|
||||||
|
|
||||||
"ticketWarning":"A incorporação está na mensagem abaixo!",
|
|
||||||
"maxTicketWarning":"**Cuidado:** _Você só pode criar {0} ticket(s) de cada vez!!_"
|
|
||||||
},
|
|
||||||
"helpMenu":{
|
|
||||||
"title":"Comandos Disponíveis:",
|
|
||||||
"header1":"**Vá para {0} para criar um ticket!**\n\n",
|
|
||||||
"header2":"**Execute o comando `/new` ou `/ticket` para criar um ticket!**\n\n",
|
|
||||||
|
|
||||||
"msgCmd":"Gerar uma incorporação com botões. (somente administradores)",
|
|
||||||
"renameCmd":"Renomear um ticket. (sem espaços)",
|
|
||||||
"closeCmd":"Fechar um ticket.",
|
|
||||||
"deleteCmd":"Excluir um ticket.",
|
|
||||||
"addCmd":"Adicionar um usuário ao ticket.",
|
|
||||||
"removeCmd":"Remover um usuário do ticket.",
|
|
||||||
"reopenCmd":"Reabra um ticket depois que ele foi fechado."
|
|
||||||
},
|
|
||||||
"buttons":{
|
|
||||||
"close":"Fechar Ticket",
|
|
||||||
"delete":"Excluir Ticket",
|
|
||||||
"reopen":"Reabrir Ticket",
|
|
||||||
"sendTranscript":"Transcrição",
|
|
||||||
"closeWithReason":"close with reason"
|
|
||||||
},
|
|
||||||
"messages":{
|
|
||||||
"reopenTitle":"Reabriu este ticket!",
|
|
||||||
"reopenDescription":"Sinta-se à vontade para falar novamente!",
|
|
||||||
"closedTitle":"Fechado este ticket!",
|
|
||||||
"closedDescription":"Somente administradores podem falar neste ticket agora!\n\n*Clique no botão abaixo para excluir ou reabrir este ticket!*",
|
|
||||||
"createdTitle":"Ticket criado!",
|
|
||||||
"createdDescription":"Seu ticket foi criado, você pode detectá-lo com um ping!",
|
|
||||||
|
|
||||||
"newTicketDmTitle":"Novo Ticket!",
|
|
||||||
"closedTicketDmTitle":"Ticket fechado!",
|
|
||||||
"deletedTicketDmTitle":"Ticket excluído!",
|
|
||||||
"closedTicketDmDescription":"Seu ticket está fechado!",
|
|
||||||
"deletedTicketDmDescription":"Seu bilhete foi excluído!",
|
|
||||||
"reopenTicketDmTitle":"Ticket reaberto!",
|
|
||||||
"reopenTicketDmDescription":"Seu ticket foi reaberto!",
|
|
||||||
"newTranscriptTitle":"Uma nova transcrição está aqui!",
|
|
||||||
"hereIsTheTranscript":"Aqui está a transcrição:",
|
|
||||||
|
|
||||||
"chooseCategory":"Escolha a categoria:",
|
|
||||||
"gettingdeleted":"Ticket está sendo deletado...",
|
|
||||||
|
|
||||||
"none":"none",
|
|
||||||
"reason":"reason",
|
|
||||||
|
|
||||||
"deletedby":"deleted by",
|
|
||||||
"closedby":"closed by",
|
|
||||||
"modalreason":"What is the reason for closing this ticket?",
|
|
||||||
"chooseATicket": "Choose a ticket"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user