Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d8d9e4bee | ||
|
|
dcbddf9f23 | ||
|
|
7449c0a61a | ||
|
|
c95b8ccb32 | ||
|
|
2c5bfe8e33 | ||
|
|
a3bbd97333 | ||
|
|
4ea488951d | ||
|
|
481424d5a6 | ||
|
|
fe82e96cc1 | ||
|
|
976258c959 | ||
|
|
83cf0689e2 | ||
|
|
c911cb4423 | ||
|
|
4eadef8b65 | ||
|
|
4e081358ff | ||
|
|
209ec0b435 | ||
|
|
6d363abb54 | ||
|
|
6f8b84aeda | ||
|
|
5b8c5da33a | ||
|
|
b6ef0f95cb | ||
|
|
cce1480a42 | ||
|
|
44fbe9f2d6 | ||
|
|
29db6c7d67 | ||
|
|
26e9b56961 | ||
|
|
979271cfb5 | ||
|
|
69f0b00ed3 | ||
|
|
c1a1839457 | ||
|
|
dd4b53800e | ||
|
|
1fc94528fc | ||
|
|
bb1a817980 | ||
|
|
53305acbc7 | ||
|
|
d0f1bae0bd | ||
|
|
c0cf3b1bb7 | ||
|
|
ce67b668d5 | ||
|
|
3273cfd0e1 | ||
|
|
fd992a6514 | ||
|
|
550d681fe1 | ||
|
|
7d29226953 | ||
|
|
38da72ca91 | ||
|
|
eab11361cb | ||
|
|
b281bba36f | ||
|
|
5e38573aed | ||
|
|
da7b6d487c | ||
|
|
6bf4e5f4bb | ||
|
|
213f532a3c | ||
|
|
45bd88e4d2 | ||
|
|
4eb8658459 | ||
|
|
b37118fee2 | ||
|
|
026caba68a | ||
|
|
2003f8801a | ||
|
|
473bacf13a | ||
|
|
8b3f2bc61a | ||
|
|
3aa373c33c | ||
|
|
9b6263e583 | ||
|
|
3e066d08ce | ||
|
|
aa48e28162 | ||
|
|
dc660ed94a | ||
|
|
e02ecf9553 | ||
|
|
23acc0926f | ||
|
|
3fc1cd18d5 | ||
|
|
ebe29b403e | ||
|
|
dcba3312dd | ||
|
|
7fddeeec37 | ||
|
|
b5341b023f | ||
|
|
bbb7443ef2 | ||
|
|
22df347bb9 | ||
|
|
9aed6b8f35 | ||
|
|
9e7ec9f1bd | ||
|
|
373f43eac5 | ||
|
|
6c91b2791a | ||
|
|
bde62a431f | ||
|
|
615a074540 | ||
|
|
09b335ac46 | ||
|
|
2701880c77 | ||
|
|
24c8f2fb38 | ||
|
|
c3ec158ac3 | ||
|
|
b3690222d0 | ||
|
|
4d7583785b | ||
|
|
17ad1a15db | ||
|
|
4c89de9e76 | ||
|
|
5f25af41f9 | ||
|
|
3a3ee357fc | ||
|
|
08a6d27903 | ||
|
|
33f7675aac | ||
|
|
1178a0a611 | ||
|
|
96ded77bec | ||
|
|
e83ca8cb2b | ||
|
|
e507176d39 | ||
|
|
4e554b8bee | ||
|
|
bc649caa99 | ||
|
|
f7a4c7b616 | ||
|
|
2c7be5882c | ||
|
|
6107d268f7 | ||
|
|
7760699155 | ||
|
|
acf349c72e | ||
|
|
8096e5b882 | ||
|
|
873cfc7dc2 | ||
|
|
038174bc7e | ||
|
|
14881096bb | ||
|
|
ed1905d8f4 | ||
|
|
72c0a2efa3 | ||
|
|
e599d48713 | ||
|
|
7f44634d4f | ||
|
|
44170caac6 | ||
|
|
adedfadd92 | ||
|
|
6b01d0c8fe | ||
|
|
d4d96f59ab | ||
|
|
a1bf7ed6bd | ||
|
|
306e20efc9 | ||
|
|
f593f6e0a8 | ||
|
|
74646a4318 | ||
|
|
8bfcba8832 | ||
|
|
4ba5621a4d | ||
|
|
1f928324c2 | ||
|
|
3771872cd2 | ||
|
|
f359a60343 | ||
|
|
f53afd7bc9 | ||
|
|
e7dcc2ab29 | ||
|
|
0118b9e591 | ||
|
|
ffe42f9777 | ||
|
|
5a467599e9 | ||
|
|
c56e78484a | ||
|
|
1ee0d4a09e | ||
|
|
ffdce5820b | ||
|
|
9fed504f37 | ||
|
|
6c5799be0d | ||
|
|
b6747a0340 | ||
|
|
cd6df02e30 | ||
|
|
edbef6a36f | ||
|
|
b6a0016f5f | ||
|
|
e740c17837 | ||
|
|
7eb949f109 | ||
|
|
02394e310d | ||
|
|
ef83832819 | ||
|
|
a82101ab30 | ||
|
|
007c78930e | ||
|
|
300c83512c | ||
|
|
b674872c56 | ||
|
|
12a7680275 | ||
|
|
c9cf7c942b | ||
|
|
8e0326c8f8 | ||
|
|
13972119a8 | ||
|
|
acf165a119 | ||
|
|
bdff7c6069 | ||
|
|
e2e3376c87 | ||
|
|
3c613088e5 | ||
|
|
7e9ece50a0 | ||
|
|
af81b6536a | ||
|
|
4cd3ecf81f | ||
|
|
31f6b9e08e | ||
|
|
02de920cb3 | ||
|
|
84c0905297 | ||
|
|
250583f859 | ||
|
|
ee7d42196d | ||
|
|
a397de2b9f | ||
|
|
0610df9400 | ||
|
|
ed583deb31 | ||
|
|
e039048fc6 | ||
|
|
f2ea9650c4 | ||
|
|
1e89057006 | ||
|
|
019bb4842f | ||
|
|
4cb45beded | ||
|
|
8a2059f087 | ||
|
|
a6b105a2e1 | ||
|
|
6c14a6a06c | ||
|
|
cddd5d0026 | ||
|
|
78dea91e1d | ||
|
|
3df591ec52 | ||
|
|
1c4032caa6 | ||
|
|
465c422171 | ||
|
|
284e8dc6f5 | ||
|
|
3fc905c82e | ||
|
|
55a42b88ae | ||
|
|
bd26162e4a | ||
|
|
62e7e33406 | ||
|
|
2f0ddcec3f | ||
|
|
7cdfa68e0e | ||
|
|
f8939a964d | ||
|
|
7830e5dda5 | ||
|
|
6aa2f22294 | ||
|
|
50b14e3d44 | ||
|
|
e09c2192c2 | ||
|
|
b725d2cc62 | ||
|
|
abf3f617a4 | ||
|
|
1eda7e66fe | ||
|
|
b5000531c4 | ||
|
|
d4f95e752b | ||
|
|
e31c611f70 | ||
|
|
085481bee6 | ||
|
|
cf610fbe49 | ||
|
|
b681eb3cd2 | ||
|
|
f8ffdf0e81 | ||
|
|
ba38bce1da | ||
|
|
3a39b05fe4 | ||
|
|
27d2982b28 | ||
|
|
33e4d97be5 | ||
|
|
654064d7c5 | ||
|
|
aeb0da9e0d | ||
|
|
cb1a2fe067 | ||
|
|
85667ddfad | ||
|
|
7ad5016966 | ||
|
|
45c3315fd0 | ||
|
|
c5f550dd00 | ||
|
|
37c870c7ab | ||
|
|
155b768f73 | ||
|
|
09f0873f27 | ||
|
|
19a12f6c8f | ||
|
|
79a498d1d6 | ||
|
|
12a03c36f3 | ||
|
|
ddc8bcab9b | ||
|
|
35dacfd48a | ||
|
|
611cef34ab | ||
|
|
8a8f9fe890 | ||
|
|
5a65b70c80 | ||
|
|
8bea3faa1f | ||
|
|
4125954d53 | ||
|
|
3d9c5a729e | ||
|
|
51d775ea6d | ||
|
|
e461c47c4b | ||
|
|
bbdb38e45a | ||
|
|
083e047aec | ||
|
|
84e0b504ab | ||
|
|
bedff6832c | ||
|
|
6c29e04de2 | ||
|
|
ba674323e1 | ||
|
|
6d756a161e | ||
|
|
66a5cd95ec | ||
|
|
9f70648264 | ||
|
|
b975b79691 | ||
|
|
3cab896954 | ||
|
|
b9680e5b35 | ||
|
|
43a003ca7d | ||
|
|
fbe1cf2009 | ||
|
|
fdee61cc11 | ||
|
|
8b51200d9c | ||
|
|
0631ab536a | ||
|
|
0d76e76519 | ||
|
|
9e9f83d211 | ||
|
|
0829d477d9 | ||
|
|
1b7109fa23 | ||
|
|
366669ccd8 | ||
|
|
e05edd89fa | ||
|
|
a405df66c9 | ||
|
|
28a57ead9f | ||
|
|
72bfacae75 | ||
|
|
10f8821b3b | ||
|
|
92a3745ce1 | ||
|
|
aff7ff1451 | ||
|
|
9e63e0ff09 | ||
|
|
2c5ebd8620 | ||
|
|
e6d63db3a9 | ||
|
|
2cc316aafb | ||
|
|
4f25cfa0dd | ||
|
|
0385de3882 | ||
|
|
2e1253c54e | ||
|
|
14df15caeb | ||
|
|
af481a2ec8 | ||
|
|
96c1d80844 | ||
|
|
57ea2e25bd | ||
|
|
cd17b0a6d7 | ||
|
|
c5dd8823f6 | ||
|
|
c27f16f753 | ||
|
|
4842610229 | ||
|
|
bd33669dba | ||
|
|
e81684d322 | ||
|
|
8209dfa26c | ||
|
|
0a82c62a4e | ||
|
|
4399dfe6b8 | ||
|
|
defd0cc78c | ||
|
|
fd5fc8294c | ||
|
|
10823b416c | ||
|
|
4490920ac6 | ||
|
|
e0b8ad4a32 | ||
|
|
e11063832b | ||
|
|
d598fdd753 | ||
|
|
157b93239a | ||
|
|
3d7058dccd | ||
|
|
1ec654d1ea | ||
|
|
8ce2d4269d | ||
|
|
49e8aa7869 | ||
|
|
0827f55d43 | ||
|
|
ba6ff8c342 | ||
|
|
c0b7dc2737 | ||
|
|
ab6abd453b | ||
|
|
77921aca75 | ||
|
|
a8f91c4814 | ||
|
|
7780fa792c | ||
|
|
41e4c376ec | ||
|
|
09aad61cfe | ||
|
|
31ac81428f | ||
|
|
60daab82d2 | ||
|
|
e7a0544004 | ||
|
|
ff0364bba8 | ||
|
|
a3b64be351 | ||
|
|
eae370e346 | ||
|
|
0d86b50a83 | ||
|
|
543b9028a3 | ||
|
|
867f12d11f | ||
|
|
462781ea6a | ||
|
|
c300ab6459 | ||
|
|
448d8f3007 | ||
|
|
faa53b0af1 | ||
|
|
8e53b8d9a6 | ||
|
|
5678567baa | ||
|
|
1c30f73bb1 | ||
|
|
bd3dbc3033 | ||
|
|
3c312ab8d3 | ||
|
|
7284785db0 | ||
|
|
4e543ea490 | ||
|
|
4d3540126f | ||
|
|
6c29f0d792 | ||
|
|
c85df7c40f | ||
|
|
4f6ff575ce | ||
|
|
aaf3890f71 | ||
|
|
4f9837d991 | ||
|
|
2e2eb008c6 | ||
|
|
fa7074bb59 | ||
|
|
18a7def050 | ||
|
|
40e9cf5fe5 | ||
|
|
6ce049a57e | ||
|
|
d4c4eac710 | ||
|
|
28ec96e5e8 | ||
|
|
a20fe8eb06 | ||
|
|
7d1d9b881d | ||
|
|
c116e6cbb0 | ||
|
|
a3ebf0a33b | ||
|
|
ea6ef022e7 | ||
|
|
683e29196a | ||
|
|
71694d7082 | ||
|
|
c5d5656fb6 | ||
|
|
b1fdbee5f8 | ||
|
|
70405a1cd0 | ||
|
|
3d7e81169f | ||
|
|
fa7c8c7219 | ||
|
|
358a25f522 | ||
|
|
690169a409 | ||
|
|
0ec4cc5a51 | ||
|
|
0b7dbaf368 | ||
|
|
940c445182 | ||
|
|
d8a90c9aa5 | ||
|
|
89ee8fceca | ||
|
|
68b55a2d33 | ||
|
|
8cc2e7747f | ||
|
|
4e6ac3a294 | ||
|
|
732e22ea7b | ||
|
|
ac0d9981f8 | ||
|
|
23f7310760 | ||
|
|
02a9ce6bac | ||
|
|
069665358f | ||
|
|
2cf6d69127 | ||
|
|
870435061d | ||
|
|
53ad906491 | ||
|
|
01399e343b | ||
|
|
a0bdec4c42 | ||
|
|
914f2057d8 | ||
|
|
ed9b9dca79 | ||
|
|
f6d4383ff6 | ||
|
|
b6ccf30ae4 | ||
|
|
48e44a0d38 | ||
|
|
735998b48c | ||
|
|
d94eefddb7 | ||
|
|
5a65b4df17 | ||
|
|
15a839a310 | ||
|
|
9730c61962 | ||
|
|
1805c041a6 | ||
|
|
f0bde93d5f | ||
|
|
1ed7412f92 | ||
|
|
1f5ea2d25b | ||
|
|
ff4c8f0e85 | ||
|
|
5c3dd878b8 | ||
|
|
20f0d91c75 | ||
|
|
894e48756f | ||
|
|
aef199b292 | ||
|
|
9b884cd941 | ||
|
|
b22d813cee | ||
|
|
0981566cbe | ||
|
|
0647aa435a | ||
|
|
58179f98e9 | ||
|
|
05fe62536b | ||
|
|
241d41e220 | ||
|
|
34d6134c24 | ||
|
|
702d1d1998 | ||
|
|
e43a5fd5a3 | ||
|
|
4ed9a7b7f5 | ||
|
|
d8ba76e395 | ||
|
|
448004abca | ||
|
|
7b0db34fb1 | ||
|
|
a7e7d5b372 | ||
|
|
9768628e8b | ||
|
|
6c0328b2fd | ||
|
|
6bf7d879e2 | ||
|
|
f25490f1ad | ||
|
|
31eee78535 | ||
|
|
4ed2aff1b7 | ||
|
|
6f05545be6 | ||
|
|
dfec8a0e4f | ||
|
|
47b730111b | ||
|
|
59ba27c36f | ||
|
|
b501164c38 | ||
|
|
1b795087bf | ||
|
|
7063edc10f | ||
|
|
c02abcb760 | ||
|
|
2d1a20dcc6 | ||
|
|
65156d4b20 | ||
|
|
951cedb190 | ||
|
|
11442f320d | ||
|
|
33df21f656 | ||
|
|
19ab208678 | ||
|
|
59b9651575 | ||
|
|
c1c1f1767a | ||
|
|
dda8a5180c | ||
|
|
34d558412f | ||
|
|
be77ee1903 | ||
|
|
fc571d6c73 | ||
|
|
7ca5a97535 | ||
|
|
730239ba8d | ||
|
|
9069e23188 | ||
|
|
366203fe21 | ||
|
|
f23f15c972 | ||
|
|
8432290a70 | ||
|
|
ceddd503f8 | ||
|
|
51ad35f72b | ||
|
|
5631b24a14 | ||
|
|
f9da25643d | ||
|
|
75bed3f5dd | ||
|
|
d4576dfc21 | ||
|
|
31bad3c2e5 | ||
|
|
a3c0e81e04 | ||
|
|
b5cf721efb | ||
|
|
95063398aa | ||
|
|
2da25c5566 | ||
|
|
a72c1ab380 | ||
|
|
87b9301e20 | ||
|
|
d0a6bed727 | ||
|
|
29881fbf28 | ||
|
|
4f05ad6546 | ||
|
|
36fc9aae6c | ||
|
|
fb3f87c685 | ||
|
|
a4c0eeb9b3 | ||
|
|
c64f249fd0 | ||
|
|
48b542293f | ||
|
|
95e92970c9 | ||
|
|
afdb16da07 | ||
|
|
0a230cfab9 | ||
|
|
c752a07ad0 | ||
|
|
cc5a6b7317 | ||
|
|
d93991ad86 | ||
|
|
5c98376a8c | ||
|
|
28699f0ff0 | ||
|
|
e3576b17b1 | ||
|
|
17c49b2b03 | ||
|
|
dcc00d8d1f | ||
|
|
05a772eee2 | ||
|
|
59dd291dc6 | ||
|
|
f0a791e354 | ||
|
|
94db6cff7b | ||
|
|
72a02bf6d2 | ||
|
|
cf99209887 | ||
|
|
ff7ed49905 | ||
|
|
ecd17a51df | ||
|
|
63b08f8c12 | ||
|
|
3077772aff | ||
|
|
f40aa9ed14 | ||
|
|
4ae6dc3a69 | ||
|
|
bdb8389d8d | ||
|
|
f7254c7ec7 | ||
|
|
3701156362 | ||
|
|
575d25f5ad | ||
|
|
698b82c7d3 | ||
|
|
eaa9da6d2e | ||
|
|
ca7294a0e3 | ||
|
|
5281ffce60 | ||
|
|
2f84fd3b33 | ||
|
|
bef270da74 | ||
|
|
bdf839ffca | ||
|
|
b1b2ead0d8 | ||
|
|
0b74473c64 | ||
|
|
2fb189cf5c | ||
|
|
24a29639e9 | ||
|
|
50258dc359 | ||
|
|
d9c6b7698f | ||
|
|
f042f34ae2 | ||
|
|
c087edc14f | ||
|
|
d96ccc3265 | ||
|
|
018ef19efd | ||
|
|
159317a15a | ||
|
|
34583c96bf | ||
|
|
887d3d3ab4 | ||
|
|
f2de39de33 | ||
|
|
8173c31a60 | ||
|
|
80a2871741 | ||
|
|
3b37e9c420 | ||
|
|
730ba561bc | ||
|
|
4d7ddc9d6f | ||
|
|
680f71a602 | ||
|
|
170a7b50b9 | ||
|
|
805c48c1bb | ||
|
|
7d92ed51bb | ||
|
|
f849897f29 | ||
|
|
75e0f1ad1e | ||
|
|
2f015aff2b | ||
|
|
bb322adb2f | ||
|
|
6ee0981885 | ||
|
|
877fb0f201 | ||
|
|
ded4b9094a | ||
|
|
36ab931998 | ||
|
|
20baddfcca | ||
|
|
d180c147db | ||
|
|
86fa91cc52 | ||
|
|
b8c12a0307 | ||
|
|
eff2f9c195 | ||
|
|
8a8597afef | ||
|
|
067e619488 | ||
|
|
f7f8bc8c55 | ||
|
|
0c71fd7e59 | ||
|
|
5b2bd21c06 | ||
|
|
9ac68f68e2 | ||
|
|
aa32f00b0d | ||
|
|
bd5f5dffad | ||
|
|
645ad63f4f | ||
|
|
c83c6afecc | ||
|
|
689a191d4c | ||
|
|
5767ba0de5 | ||
|
|
cdf78f2598 | ||
|
|
d23f46ad9e | ||
|
|
8453fa5007 | ||
|
|
0bd990a9e3 | ||
|
|
9c8ee1471b | ||
|
|
87262e82a3 | ||
|
|
953db88ed2 | ||
|
|
a44bb949eb | ||
|
|
9d11369059 | ||
|
|
8c92f39349 | ||
|
|
bce9d733d3 | ||
|
|
525c216401 | ||
|
|
c145e9f11d | ||
|
|
53700003f1 | ||
|
|
03094a4c35 | ||
|
|
934ebed24f | ||
|
|
9f469e1637 | ||
|
|
77fe39774d | ||
|
|
186d688ec8 | ||
|
|
de3181b5c7 | ||
|
|
6d53234f7a | ||
|
|
b0d3673f4b | ||
|
|
e40083f585 | ||
|
|
f7b702fa29 | ||
|
|
5089a19a56 | ||
|
|
d77e9842aa | ||
|
|
88ae76a25a | ||
|
|
9b0b0d10a1 | ||
|
|
68340a8b02 | ||
|
|
d14f0966d5 | ||
|
|
e4b83f28c4 | ||
|
|
1925deec90 | ||
|
|
e9ba960b29 | ||
|
|
821f0f5b60 | ||
|
|
8fa8915673 | ||
|
|
5405aa469e | ||
|
|
cfa50b4e8c | ||
|
|
c5014baeb4 | ||
|
|
c14f120ec2 | ||
|
|
b72fcf39da | ||
|
|
6da3b0cba0 | ||
|
|
752387a02d | ||
|
|
32d3e1b957 | ||
|
|
a029dff202 | ||
|
|
89e1b85a56 | ||
|
|
4350eb709c | ||
|
|
2b1b6e916e | ||
|
|
3f6f9045bd | ||
|
|
8294496faa | ||
|
|
9f58118ecd | ||
|
|
3ba9d42587 | ||
|
|
e496a5f3d0 | ||
|
|
04e2bb29b0 | ||
|
|
131a7a015c | ||
|
|
6f430f5f14 | ||
|
|
0154c106ef | ||
|
|
04de6e6fc0 | ||
|
|
2b17e5f842 | ||
|
|
0dc8c1e68a | ||
|
|
67b291eb09 | ||
|
|
d7865a5a4e | ||
|
|
d1809587a8 | ||
|
|
64ec4dfd53 | ||
|
|
6e07d21a3d | ||
|
|
018e47bd53 | ||
|
|
065a2e9347 | ||
|
|
b53307c7fd | ||
|
|
e4cc0d960e | ||
|
|
3336824df7 | ||
|
|
166173d53c | ||
|
|
45da2d7924 | ||
|
|
af14a65ef5 | ||
|
|
9049a4b9ad | ||
|
|
2f4873ab9a | ||
|
|
0fb25d71dc | ||
|
|
34b6901434 | ||
|
|
a90b43aba3 | ||
|
|
0ac5c2c300 | ||
|
|
6290fee7bd | ||
|
|
320992f3fa | ||
|
|
bd714f0c93 | ||
|
|
45d3867c1f | ||
|
|
deafa66565 | ||
|
|
ce8fcdaa7a | ||
|
|
b83965c144 | ||
|
|
2505a8cab8 | ||
|
|
21e598bb31 | ||
|
|
ee2f3c0dfc | ||
|
|
197bda14b8 | ||
|
|
d416c2e421 | ||
|
|
6bc2e669e4 | ||
|
|
9accb65256 | ||
|
|
d9212584ca | ||
|
|
1a7effb422 | ||
|
|
1480435f15 | ||
|
|
64c6a97657 | ||
|
|
7ae2ff9837 | ||
|
|
f19dec405d | ||
|
|
bbd4e9d162 | ||
|
|
58deff0869 | ||
|
|
628632f43e | ||
|
|
436586117c | ||
|
|
7234ec728c | ||
|
|
fc4d68be39 | ||
|
|
bcf2df4bff | ||
|
|
70a469a951 | ||
|
|
981995cb32 | ||
|
|
406c7d368b | ||
|
|
5c266d8b8d | ||
|
|
4f5b94a491 | ||
|
|
284c83cc1d | ||
|
|
23f06af202 |
No files matched your search
@@ -1,2 +0,0 @@
|
|||||||
# Auto detect text files and perform LF normalization
|
|
||||||
* text=auto
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a bug report to help us improve SupportBot.
|
|
||||||
title: "[BUG]"
|
|
||||||
labels: bug
|
|
||||||
assignees: EmeraldRusher
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
**Describe the bug**
|
|
||||||
A clear and concise description of the bug you found and how you found it.
|
|
||||||
|
|
||||||
**How did you find it**
|
|
||||||
Please could explain what you did to find the bug?
|
|
||||||
|
|
||||||
**Expected behavior**
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Feel free to notify with us with anything else about the problem here.
|
|
||||||
-76
@@ -1,76 +0,0 @@
|
|||||||
# Logs
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
yarn-debug.log*
|
|
||||||
yarn-error.log*
|
|
||||||
|
|
||||||
# Runtime data
|
|
||||||
pids
|
|
||||||
*.pid
|
|
||||||
*.seed
|
|
||||||
*.pid.lock
|
|
||||||
|
|
||||||
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
||||||
lib-cov
|
|
||||||
|
|
||||||
# Coverage directory used by tools like istanbul
|
|
||||||
coverage
|
|
||||||
|
|
||||||
# nyc test coverage
|
|
||||||
.nyc_output
|
|
||||||
|
|
||||||
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
||||||
.grunt
|
|
||||||
|
|
||||||
# Bower dependency directory (https://bower.io/)
|
|
||||||
bower_components
|
|
||||||
|
|
||||||
# node-waf configuration
|
|
||||||
.lock-wscript
|
|
||||||
|
|
||||||
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
||||||
build/Release
|
|
||||||
|
|
||||||
# Dependency directories
|
|
||||||
node_modules/
|
|
||||||
jspm_packages/
|
|
||||||
|
|
||||||
# TypeScript v1 declaration files
|
|
||||||
typings/
|
|
||||||
|
|
||||||
# Optional npm cache directory
|
|
||||||
.npm
|
|
||||||
|
|
||||||
# Optional eslint cache
|
|
||||||
.eslintcache
|
|
||||||
|
|
||||||
# Optional REPL history
|
|
||||||
.node_repl_history
|
|
||||||
|
|
||||||
# Output of 'npm pack'
|
|
||||||
*.tgz
|
|
||||||
|
|
||||||
# Yarn Integrity file
|
|
||||||
.yarn-integrity
|
|
||||||
|
|
||||||
# dotenv environment variables file
|
|
||||||
.env
|
|
||||||
|
|
||||||
# parcel-bundler cache (https://parceljs.org/)
|
|
||||||
.cache
|
|
||||||
|
|
||||||
# next.js build output
|
|
||||||
.next
|
|
||||||
|
|
||||||
# nuxt.js build output
|
|
||||||
.nuxt
|
|
||||||
|
|
||||||
# vuepress build output
|
|
||||||
.vuepress/dist
|
|
||||||
|
|
||||||
# Serverless directories
|
|
||||||
.serverless
|
|
||||||
|
|
||||||
# FuseBox cache
|
|
||||||
.fusebox/
|
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
# Contributor Covenant Code of Conduct
|
||||||
|
|
||||||
|
## Our Pledge
|
||||||
|
|
||||||
|
We as members, contributors, and leaders pledge to make participation in our
|
||||||
|
community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, visible or invisible disability, ethnicity, sex characteristics, gender
|
||||||
|
identity and expression, level of experience, education, socio-economic status,
|
||||||
|
nationality, personal appearance, race, religion, or sexual identity
|
||||||
|
and orientation.
|
||||||
|
|
||||||
|
We pledge to act and interact in ways that contribute to an open, welcoming,
|
||||||
|
diverse, inclusive, and healthy community.
|
||||||
|
|
||||||
|
## Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to a positive environment for our
|
||||||
|
community include:
|
||||||
|
|
||||||
|
* Demonstrating empathy and kindness toward other people
|
||||||
|
* Being respectful of differing opinions, viewpoints, and experiences
|
||||||
|
* Giving and gracefully accepting constructive feedback
|
||||||
|
* Accepting responsibility and apologizing to those affected by our mistakes,
|
||||||
|
and learning from the experience
|
||||||
|
* Focusing on what is best not just for us as individuals, but for the
|
||||||
|
overall community
|
||||||
|
|
||||||
|
Examples of unacceptable behavior include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery, and sexual attention or
|
||||||
|
advances of any kind
|
||||||
|
* Trolling, insulting or derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or email
|
||||||
|
address, without their explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
## Enforcement Responsibilities
|
||||||
|
|
||||||
|
Community leaders are responsible for clarifying and enforcing our standards of
|
||||||
|
acceptable behavior and will take appropriate and fair corrective action in
|
||||||
|
response to any behavior that they deem inappropriate, threatening, offensive,
|
||||||
|
or harmful.
|
||||||
|
|
||||||
|
Community leaders have the right and responsibility to remove, edit, or reject
|
||||||
|
comments, commits, code, wiki edits, issues, and other contributions that are
|
||||||
|
not aligned to this Code of Conduct, and will communicate reasons for moderation
|
||||||
|
decisions when appropriate.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies within all community spaces, and also applies when
|
||||||
|
an individual is officially representing the community in public spaces.
|
||||||
|
Examples of representing our community include using an official e-mail address,
|
||||||
|
posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported to the community leaders responsible for enforcement at
|
||||||
|
our discord.
|
||||||
|
All complaints will be reviewed and investigated promptly and fairly.
|
||||||
|
|
||||||
|
All community leaders are obligated to respect the privacy and security of the
|
||||||
|
reporter of any incident.
|
||||||
|
|
||||||
|
## Enforcement Guidelines
|
||||||
|
|
||||||
|
Community leaders will follow these Community Impact Guidelines in determining
|
||||||
|
the consequences for any action they deem in violation of this Code of Conduct:
|
||||||
|
|
||||||
|
### 1. Correction
|
||||||
|
|
||||||
|
**Community Impact**: Use of inappropriate language or other behavior deemed
|
||||||
|
unprofessional or unwelcome in the community.
|
||||||
|
|
||||||
|
**Consequence**: A private, written warning from community leaders, providing
|
||||||
|
clarity around the nature of the violation and an explanation of why the
|
||||||
|
behavior was inappropriate. A public apology may be requested.
|
||||||
|
|
||||||
|
### 2. Warning
|
||||||
|
|
||||||
|
**Community Impact**: A violation through a single incident or series
|
||||||
|
of actions.
|
||||||
|
|
||||||
|
**Consequence**: A warning with consequences for continued behavior. No
|
||||||
|
interaction with the people involved, including unsolicited interaction with
|
||||||
|
those enforcing the Code of Conduct, for a specified period of time. This
|
||||||
|
includes avoiding interactions in community spaces as well as external channels
|
||||||
|
like social media. Violating these terms may lead to a temporary or
|
||||||
|
permanent ban.
|
||||||
|
|
||||||
|
### 3. Temporary Ban
|
||||||
|
|
||||||
|
**Community Impact**: A serious violation of community standards, including
|
||||||
|
sustained inappropriate behavior.
|
||||||
|
|
||||||
|
**Consequence**: A temporary ban from any sort of interaction or public
|
||||||
|
communication with the community for a specified period of time. No public or
|
||||||
|
private interaction with the people involved, including unsolicited interaction
|
||||||
|
with those enforcing the Code of Conduct, is allowed during this period.
|
||||||
|
Violating these terms may lead to a permanent ban.
|
||||||
|
|
||||||
|
### 4. Permanent Ban
|
||||||
|
|
||||||
|
**Community Impact**: Demonstrating a pattern of violation of community
|
||||||
|
standards, including sustained inappropriate behavior, harassment of an
|
||||||
|
individual, or aggression toward or disparagement of classes of individuals.
|
||||||
|
|
||||||
|
**Consequence**: A permanent ban from any sort of public interaction within
|
||||||
|
the community.
|
||||||
|
|
||||||
|
## Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||||
|
version 2.0, available at
|
||||||
|
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
|
||||||
|
|
||||||
|
Community Impact Guidelines were inspired by [Mozilla's code of conduct
|
||||||
|
enforcement ladder](https://github.com/mozilla/diversity).
|
||||||
|
|
||||||
|
[homepage]: https://www.contributor-covenant.org
|
||||||
|
|
||||||
|
For answers to common questions about this code of conduct, see the FAQ at
|
||||||
|
https://www.contributor-covenant.org/faq. Translations are available at
|
||||||
|
https://www.contributor-covenant.org/translations.
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
# Contributing
|
||||||
|
|
||||||
|
When contributing to this repository, please first discuss the change you wish to make via issue,
|
||||||
|
email, or any other method with the owners of this repository before making a change.
|
||||||
|
|
||||||
|
Please note we have a code of conduct, please follow it in all your interactions with the project.
|
||||||
|
|
||||||
|
## Pull Request Process
|
||||||
|
|
||||||
|
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
|
||||||
|
build.
|
||||||
|
2. Update the README.md with details of changes to the interface, this includes new environment
|
||||||
|
variables, exposed ports, useful file locations and container parameters.
|
||||||
|
3. Increase the version numbers in any examples files and the README.md to the new version that this
|
||||||
|
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
|
||||||
|
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
|
||||||
|
do not have permission to do that, you may request the second reviewer to merge it for you.
|
||||||
|
|
||||||
|
## Code of Conduct
|
||||||
|
|
||||||
|
### Our Pledge
|
||||||
|
|
||||||
|
In the interest of fostering an open and welcoming environment, we as
|
||||||
|
contributors and maintainers pledge to making participation in our project and
|
||||||
|
our community a harassment-free experience for everyone, regardless of age, body
|
||||||
|
size, disability, ethnicity, gender identity and expression, level of experience,
|
||||||
|
nationality, personal appearance, race, religion, or sexual identity and
|
||||||
|
orientation.
|
||||||
|
|
||||||
|
### Our Standards
|
||||||
|
|
||||||
|
Examples of behavior that contributes to creating a positive environment
|
||||||
|
include:
|
||||||
|
|
||||||
|
* Using welcoming and inclusive language
|
||||||
|
* Being respectful of differing viewpoints and experiences
|
||||||
|
* Gracefully accepting constructive criticism
|
||||||
|
* Focusing on what is best for the community
|
||||||
|
* Showing empathy towards other community members
|
||||||
|
|
||||||
|
Examples of unacceptable behavior by participants include:
|
||||||
|
|
||||||
|
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||||
|
advances
|
||||||
|
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||||
|
* Public or private harassment
|
||||||
|
* Publishing others' private information, such as a physical or electronic
|
||||||
|
address, without explicit permission
|
||||||
|
* Other conduct which could reasonably be considered inappropriate in a
|
||||||
|
professional setting
|
||||||
|
|
||||||
|
### Our Responsibilities
|
||||||
|
|
||||||
|
Project maintainers are responsible for clarifying the standards of acceptable
|
||||||
|
behavior and are expected to take appropriate and fair corrective action in
|
||||||
|
response to any instances of unacceptable behavior.
|
||||||
|
|
||||||
|
Project maintainers have the right and responsibility to remove, edit, or
|
||||||
|
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||||
|
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||||
|
permanently any contributor for other behaviors that they deem inappropriate,
|
||||||
|
threatening, offensive, or harmful.
|
||||||
|
|
||||||
|
### Scope
|
||||||
|
|
||||||
|
This Code of Conduct applies both within project spaces and in public spaces
|
||||||
|
when an individual is representing the project or its community. Examples of
|
||||||
|
representing a project or community include using an official project e-mail
|
||||||
|
address, posting via an official social media account, or acting as an appointed
|
||||||
|
representative at an online or offline event. Representation of a project may be
|
||||||
|
further defined and clarified by project maintainers.
|
||||||
|
|
||||||
|
### Enforcement
|
||||||
|
|
||||||
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||||
|
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
|
||||||
|
complaints will be reviewed and investigated and will result in a response that
|
||||||
|
is deemed necessary and appropriate to the circumstances. The project team is
|
||||||
|
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||||
|
Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
|
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||||
|
faith may face temporary or permanent repercussions as determined by other
|
||||||
|
members of the project's leadership.
|
||||||
|
|
||||||
|
### Attribution
|
||||||
|
|
||||||
|
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||||
|
available at [http://contributor-covenant.org/version/1/4][version]
|
||||||
|
|
||||||
|
[homepage]: http://contributor-covenant.org
|
||||||
|
[version]: http://contributor-covenant.org/version/1/4/
|
||||||
@@ -0,0 +1,335 @@
|
|||||||
|
const fs = require("fs");
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/commands.yml", "utf8")
|
||||||
|
);
|
||||||
|
const msgconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/messages.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.CloseTicket.Command,
|
||||||
|
description: cmdconfig.CloseTicket.Description,
|
||||||
|
type: Discord.ApplicationCommandType.ChatInput,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: "reason",
|
||||||
|
description: "Ticket Close Reason",
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
permissions: cmdconfig.CloseTicket.Permission,
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const { getRole, getChannel } = interaction.client;
|
||||||
|
|
||||||
|
if (supportbot.Ticket.Close.StaffOnly) {
|
||||||
|
let SupportStaff = await getRole(supportbot.Roles.StaffMember.Staff, interaction.guild);
|
||||||
|
let Admin = await getRole(supportbot.Roles.StaffMember.Admin, interaction.guild);
|
||||||
|
|
||||||
|
if (!SupportStaff || !Admin)
|
||||||
|
return interaction.reply(
|
||||||
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
|
);
|
||||||
|
|
||||||
|
const NoPerms = new Discord.EmbedBuilder()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(
|
||||||
|
`${msgconfig.Error.IncorrectPerms}\n\nRole Required: \`${supportbot.Roles.StaffMember.Staff}\` or \`${supportbot.Roles.StaffMember.Admin}\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.Warn);
|
||||||
|
|
||||||
|
if (
|
||||||
|
!interaction.member.roles.cache.has(SupportStaff.id) &&
|
||||||
|
!interaction.member.roles.cache.has(Admin.id)
|
||||||
|
)
|
||||||
|
return interaction.reply({ embeds: [NoPerms] });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (interaction.channel.type !== Discord.ChannelType.PrivateThread) {
|
||||||
|
const NotTicketChannel = new Discord.EmbedBuilder()
|
||||||
|
.setTitle("Invalid Channel!")
|
||||||
|
.setDescription("This command can only be used in a ticket thread.")
|
||||||
|
.setColor(supportbot.Embed.Colours.Warn);
|
||||||
|
|
||||||
|
return interaction.reply({ embeds: [NotTicketChannel], ephemeral: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
await interaction.deferReply();
|
||||||
|
|
||||||
|
let tickets = JSON.parse(fs.readFileSync("./Data/TicketData.json", "utf8"));
|
||||||
|
let TicketData = tickets.tickets.findIndex((t) => t.id === interaction.channel.id);
|
||||||
|
let ticket = tickets.tickets[TicketData];
|
||||||
|
|
||||||
|
if (TicketData === -1) {
|
||||||
|
const Exists = new Discord.EmbedBuilder()
|
||||||
|
.setTitle("No Ticket Found!")
|
||||||
|
.setDescription(msgconfig.Error.NoValidTicket)
|
||||||
|
.setColor(supportbot.Embed.Colours.Warn);
|
||||||
|
return interaction.followUp({ embeds: [Exists] });
|
||||||
|
}
|
||||||
|
|
||||||
|
let reason = interaction.options?.getString("reason") || "No Reason Provided.";
|
||||||
|
|
||||||
|
const CloseButton = new Discord.ButtonBuilder()
|
||||||
|
.setCustomId("confirmCloseTicket")
|
||||||
|
.setLabel(supportbot.Ticket.Close.Confirmation_Button)
|
||||||
|
.setStyle(Discord.ButtonStyle.Danger);
|
||||||
|
|
||||||
|
const row = new Discord.ActionRowBuilder().addComponents(CloseButton);
|
||||||
|
|
||||||
|
const CloseTicketRequest = new Discord.EmbedBuilder()
|
||||||
|
.setTitle(`**${supportbot.Ticket.Close.Title}**`)
|
||||||
|
.setDescription(
|
||||||
|
`${msgconfig.Ticket.ConfirmClose}`
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.General);
|
||||||
|
|
||||||
|
await interaction.followUp({
|
||||||
|
embeds: [CloseTicketRequest],
|
||||||
|
components: [row],
|
||||||
|
});
|
||||||
|
|
||||||
|
const filter = (btnInteraction) => btnInteraction.customId === "confirmCloseTicket" && btnInteraction.user.id === interaction.user.id;
|
||||||
|
|
||||||
|
interaction.channel.awaitMessageComponent({ filter, time: 20000 })
|
||||||
|
.then(async (btnInteraction) => {
|
||||||
|
await handleCloseTicket(interaction, reason, ticket, TicketData);
|
||||||
|
await btnInteraction.reply({ content: "Ticket successfully closed.", ephemeral: true });
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
interaction.followUp(`${msgconfig.Ticket.CloseTimeout}`);
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
async function handleCloseTicket(interaction, reason, ticket, TicketData) {
|
||||||
|
const { getChannel } = interaction.client;
|
||||||
|
|
||||||
|
let tickets = JSON.parse(fs.readFileSync("./Data/TicketData.json", "utf8"));
|
||||||
|
let tUser = interaction.client.users.cache.get(ticket.user);
|
||||||
|
let transcriptChannel = await getChannel(supportbot.Ticket.Log.TranscriptLog, interaction.guild);
|
||||||
|
let logChannel = await getChannel(supportbot.Ticket.Log.TicketLog, interaction.guild);
|
||||||
|
|
||||||
|
if (!transcriptChannel || !logChannel)
|
||||||
|
return interaction.followUp("Some Channels seem to be missing!");
|
||||||
|
|
||||||
|
try {
|
||||||
|
tickets.tickets[TicketData].open = false;
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/TicketData.json",
|
||||||
|
JSON.stringify(tickets, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const transcriptEmbed = new Discord.EmbedBuilder()
|
||||||
|
.setTitle(supportbot.Ticket.Log.TranscriptTitle)
|
||||||
|
.setColor(supportbot.Embed.Colours.General)
|
||||||
|
.setFooter({
|
||||||
|
text: supportbot.Embed.Footer,
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
})
|
||||||
|
.addFields(
|
||||||
|
{ name: "Ticket", value: `${interaction.channel.name} (${interaction.channel.id})` },
|
||||||
|
{ name: "User", value: `${tUser?.username || "N/A"}#${tUser?.discriminator || "N/A"} (${tUser?.id || ticket.user})` },
|
||||||
|
{ name: "Closed By", value: interaction.user.tag },
|
||||||
|
{ name: "Reason", value: reason }
|
||||||
|
);
|
||||||
|
|
||||||
|
const logEmbed = new Discord.EmbedBuilder()
|
||||||
|
.setTitle(supportbot.Ticket.Log.TicketLog_Title)
|
||||||
|
.setColor(supportbot.Embed.Colours.General)
|
||||||
|
.setFooter({
|
||||||
|
text: supportbot.Embed.Footer,
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
})
|
||||||
|
.addFields(
|
||||||
|
{ name: "Ticket", value: `${interaction.channel.name} (${interaction.channel.id})` },
|
||||||
|
{ name: "User", value: `${tUser?.username || "N/A"}#${tUser?.discriminator || "N/A"} (${tUser?.id || ticket.user})` },
|
||||||
|
{ name: "Closed By", value: interaction.user.tag },
|
||||||
|
{ name: "Reason", value: reason }
|
||||||
|
);
|
||||||
|
|
||||||
|
let msgs = await interaction.channel.messages.fetch({ limit: 100 });
|
||||||
|
let html = `
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
background-color: #1a1a1a;
|
||||||
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
||||||
|
color: white;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
backdrop-filter: blur(10px);
|
||||||
|
background-color: rgba(0, 128, 0, 0.3);
|
||||||
|
border-radius: 15px;
|
||||||
|
padding: 20px;
|
||||||
|
margin: 20px;
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
|
||||||
|
flex-grow: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
max-width: 1000px;
|
||||||
|
width: 100%;
|
||||||
|
margin: auto;
|
||||||
|
}
|
||||||
|
.message {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
padding: 10px;
|
||||||
|
background-color: rgba(255, 255, 255, 0.1);
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
.avatar {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 50%;
|
||||||
|
margin-right: 10px;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
.username {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.timestamp {
|
||||||
|
font-size: 0.8em;
|
||||||
|
color: #bbb;
|
||||||
|
}
|
||||||
|
.download-button {
|
||||||
|
background-color: #4CAF50;
|
||||||
|
color: white;
|
||||||
|
padding: 10px 20px;
|
||||||
|
text-align: center;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 16px;
|
||||||
|
margin-top: 20px;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<h1 class="text-2xl font-bold mb-4">Ticket Transcript</h1>
|
||||||
|
<p><strong>Server Name:</strong> ${interaction.guild.name}</p>
|
||||||
|
<p><strong>Ticket:</strong> ${interaction.channel.name}</p>
|
||||||
|
<p><strong>Messages:</strong> ${msgs.size} Messages</p>
|
||||||
|
<div class="mt-4">
|
||||||
|
`;
|
||||||
|
|
||||||
|
msgs = msgs.sort((a, b) => a.createdTimestamp - b.createdTimestamp);
|
||||||
|
msgs.forEach((msg) => {
|
||||||
|
if (msg.content) {
|
||||||
|
html += `
|
||||||
|
<div class="message">
|
||||||
|
<img class="avatar" src="${msg.author.displayAvatarURL()}" alt="Avatar">
|
||||||
|
<div class="content">
|
||||||
|
<p class="username">${msg.author.tag}</p>
|
||||||
|
<p class="timestamp">${msg.createdAt.toLocaleString()}</p>
|
||||||
|
<p>${convertMarkdownToHTML(msg.content)}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const fileName = `${interaction.channel.name}.html`;
|
||||||
|
|
||||||
|
html += `
|
||||||
|
</div>
|
||||||
|
<a href="${fileName}" download class="download-button">Download Transcript</a>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
`;
|
||||||
|
|
||||||
|
if (!supportbot.Ticket.Log.DisableTicketLogChannel) {
|
||||||
|
await logChannel.send({ embeds: [logEmbed] }).catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let file = new Discord.AttachmentBuilder(
|
||||||
|
Buffer.from(html),
|
||||||
|
{ name: fileName }
|
||||||
|
);
|
||||||
|
|
||||||
|
await transcriptChannel
|
||||||
|
.send({ embeds: [transcriptEmbed], files: [file] })
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (supportbot.Ticket.DMTranscripts) {
|
||||||
|
await tUser
|
||||||
|
?.send({ embeds: [transcriptEmbed], files: [file] })
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (ticket.subUsers) {
|
||||||
|
ticket.subUsers.forEach(async (subUser) => {
|
||||||
|
await interaction.client.users.cache
|
||||||
|
.get(subUser)
|
||||||
|
?.send({ embeds: [transcriptEmbed], files: [file] });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await interaction.channel.delete().catch((error) => {
|
||||||
|
console.error(error);
|
||||||
|
if (error.code !== Discord.Constants.APIErrors.UNKNOWN_CHANNEL) {
|
||||||
|
console.error("Failed to delete the interaction:", error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertMarkdownToHTML(text) {
|
||||||
|
// Convert **bold** to <strong>bold</strong>
|
||||||
|
text = text.replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>');
|
||||||
|
|
||||||
|
// Convert *italic* to <em>italic</em>
|
||||||
|
text = text.replace(/\*(.*?)\*/g, '<em>$1</em>');
|
||||||
|
|
||||||
|
// Convert __underline__ to <u>underline</u>
|
||||||
|
text = text.replace(/__(.*?)__/g, '<u>$1</u>');
|
||||||
|
|
||||||
|
// Convert ~~strikethrough~~ to <s>strikethrough</s>
|
||||||
|
text = text.replace(/~~(.*?)~~/g, '<s>$1</s>');
|
||||||
|
|
||||||
|
// Convert inline code `code` to <code>code</code>
|
||||||
|
text = text.replace(/`(.*?)`/g, '<code>$1</code>');
|
||||||
|
|
||||||
|
// Convert blockquotes > quote to <blockquote>quote</blockquote>
|
||||||
|
text = text.replace(/^> (.*?$)/gm, '<blockquote>$1</blockquote>');
|
||||||
|
|
||||||
|
// Convert multiline code blocks ```code``` to <pre><code>code</code></pre>
|
||||||
|
text = text.replace(/```(.*?)```/gs, '<pre><code>$1</code></pre>');
|
||||||
|
|
||||||
|
// Convert line breaks to <br>
|
||||||
|
text = text.replace(/\n/g, '<br>');
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}
|
||||||
@@ -0,0 +1,167 @@
|
|||||||
|
// File path: ./commands/embed.js
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
const msgconfig = yaml.load(fs.readFileSync("./Configs/messages.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.Embed.Command,
|
||||||
|
description: cmdconfig.Embed.Description,
|
||||||
|
type: Discord.ApplicationCommandType.ChatInput,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: "title",
|
||||||
|
description: "Embed Title",
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "message",
|
||||||
|
description: "Embed Message",
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "color",
|
||||||
|
description: "Embed HEX Color",
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "fields",
|
||||||
|
description: "Embed Fields (title|content;title|content;...)",
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "thumbnail",
|
||||||
|
description: "Embed Thumbnail URL",
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "image",
|
||||||
|
description: "Embed Image URL",
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "footer",
|
||||||
|
description: "Embed Footer Text",
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "footericon",
|
||||||
|
description: "Embed Footer Icon URL",
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "author",
|
||||||
|
description: "Embed Author Name",
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "authoricon",
|
||||||
|
description: "Embed Author Icon URL",
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "authorurl",
|
||||||
|
description: "Embed Author URL",
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "timestamp",
|
||||||
|
description: "Include Timestamp",
|
||||||
|
type: Discord.ApplicationCommandOptionType.Boolean,
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "inline",
|
||||||
|
description: "Make Fields Inline",
|
||||||
|
type: Discord.ApplicationCommandOptionType.Boolean,
|
||||||
|
required: false,
|
||||||
|
}
|
||||||
|
],
|
||||||
|
permissions: cmdconfig.Embed.Permission,
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const { getRole } = interaction.client;
|
||||||
|
let SupportStaff = await getRole(supportbot.Roles.StaffMember.Staff, interaction.guild);
|
||||||
|
let Admin = await getRole(supportbot.Roles.StaffMember.Admin, interaction.guild);
|
||||||
|
|
||||||
|
if (!SupportStaff || !Admin) {
|
||||||
|
return interaction.reply("Some roles seem to be missing!\nPlease check for errors when starting the bot.");
|
||||||
|
}
|
||||||
|
|
||||||
|
const NoPerms = new Discord.EmbedBuilder()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(`${msgconfig.Error.IncorrectPerms}\n\nRole Required: \`${supportbot.Roles.StaffMember.Staff}\` or \`${supportbot.Roles.StaffMember.Admin}\``)
|
||||||
|
.setColor(supportbot.Embed.Colours.Warn);
|
||||||
|
|
||||||
|
if (
|
||||||
|
interaction.member.roles.cache.has(SupportStaff.id) ||
|
||||||
|
interaction.member.roles.cache.has(Admin.id)
|
||||||
|
) {
|
||||||
|
const EmbedTitle = interaction.options.getString("title").replace(/\\n/g, '\n');
|
||||||
|
const EmbedSubject = interaction.options.getString("message").replace(/\\n/g, '\n');
|
||||||
|
const GeneralColour = interaction.options.getString("color") || supportbot.Embed.Colours.Default;
|
||||||
|
const EmbedThumbnail = interaction.options.getString("thumbnail");
|
||||||
|
const EmbedImage = interaction.options.getString("image");
|
||||||
|
const EmbedFields = interaction.options.getString("fields");
|
||||||
|
const EmbedFooter = interaction.options.getString("footer")?.replace(/\\n/g, '\n');
|
||||||
|
const EmbedFooterIcon = interaction.options.getString("footericon");
|
||||||
|
const EmbedAuthor = interaction.options.getString("author")?.replace(/\\n/g, '\n');
|
||||||
|
const EmbedAuthorIcon = interaction.options.getString("authoricon");
|
||||||
|
const EmbedAuthorURL = interaction.options.getString("authorurl");
|
||||||
|
const EmbedTimestamp = interaction.options.getBoolean("timestamp");
|
||||||
|
const InlineFields = interaction.options.getBoolean("inline");
|
||||||
|
|
||||||
|
const EmbedMsg = new Discord.EmbedBuilder()
|
||||||
|
.setTitle(EmbedTitle)
|
||||||
|
.setDescription(EmbedSubject)
|
||||||
|
.setColor(GeneralColour)
|
||||||
|
.setThumbnail(EmbedThumbnail)
|
||||||
|
.setImage(EmbedImage);
|
||||||
|
|
||||||
|
if (EmbedFields) {
|
||||||
|
const fieldsArray = EmbedFields.split(';');
|
||||||
|
fieldsArray.forEach(field => {
|
||||||
|
const [title, value] = field.split('|');
|
||||||
|
if (title && value) {
|
||||||
|
EmbedMsg.addFields({ name: title.replace(/\\n/g, '\n'), value: value.replace(/\\n/g, '\n'), inline: InlineFields || false });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EmbedFooter) {
|
||||||
|
EmbedMsg.setFooter({ text: EmbedFooter, iconURL: EmbedFooterIcon });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EmbedAuthor) {
|
||||||
|
EmbedMsg.setAuthor({ name: EmbedAuthor, iconURL: EmbedAuthorIcon, url: EmbedAuthorURL });
|
||||||
|
}
|
||||||
|
|
||||||
|
if (EmbedTimestamp) {
|
||||||
|
EmbedMsg.setTimestamp();
|
||||||
|
}
|
||||||
|
|
||||||
|
interaction.reply({
|
||||||
|
embeds: [EmbedMsg],
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return interaction.reply({ embeds: [NoPerms] });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,73 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Help Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const cmdconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/commands.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.Help.Command,
|
||||||
|
description: cmdconfig.Help.Description,
|
||||||
|
type: Discord.ApplicationCommandType.ChatInput,
|
||||||
|
options: [],
|
||||||
|
permissions: cmdconfig.Help.Permission,
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const { getRole } = interaction.client;
|
||||||
|
let SupportStaff = await getRole(supportbot.Roles.StaffMember.Staff, interaction.guild);
|
||||||
|
let Admin = await getRole(supportbot.Roles.StaffMember.Admin, interaction.guild);
|
||||||
|
if (!SupportStaff || !Admin) {
|
||||||
|
return interaction.reply(
|
||||||
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fetch all commands from the client's commands collection
|
||||||
|
let botCommands = "";
|
||||||
|
interaction.client.commands.forEach((command) => {
|
||||||
|
if (command.permissions) {
|
||||||
|
botCommands += `\`${command.name}\` `;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Create embed
|
||||||
|
const HelpEmbed1 = new Discord.EmbedBuilder()
|
||||||
|
.setTitle(supportbot.General.Name + " Commands")
|
||||||
|
.setThumbnail(interaction.user.displayAvatarURL())
|
||||||
|
.setColor(supportbot.Embed.Colours.General)
|
||||||
|
.addFields({
|
||||||
|
name: "🖥️ Commands\n",
|
||||||
|
value: botCommands || "No commands available.",
|
||||||
|
inline: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
// Conditionally add Addons section
|
||||||
|
if (supportbot.General.Addons.Enabled) {
|
||||||
|
HelpEmbed1.addFields({
|
||||||
|
name: "🛠️ Addons\n",
|
||||||
|
value: "No addons available.",
|
||||||
|
inline: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
HelpEmbed1.setFooter({
|
||||||
|
text: supportbot.Embed.Footer,
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
});
|
||||||
|
|
||||||
|
interaction.reply({
|
||||||
|
ephemeral: true,
|
||||||
|
embeds: [HelpEmbed1],
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,51 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Info Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const cmdconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/commands.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const msgconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/messages.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.Info.Command,
|
||||||
|
description: cmdconfig.Info.Description,
|
||||||
|
options: [],
|
||||||
|
permissions: cmdconfig.Info.Permission,
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
let disableCommand = true;
|
||||||
|
|
||||||
|
const InfoButton = new Discord.ButtonBuilder()
|
||||||
|
.setLabel(msgconfig.Info.Button)
|
||||||
|
.setURL(msgconfig.Info.URL)
|
||||||
|
.setStyle("Link");
|
||||||
|
|
||||||
|
const inforow = new Discord.ActionRowBuilder().addComponents(InfoButton);
|
||||||
|
|
||||||
|
const InfoEmbed = new Discord.EmbedBuilder()
|
||||||
|
.setURL(msgconfig.Info.URL)
|
||||||
|
.setTitle(msgconfig.Info.Title)
|
||||||
|
.setDescription(msgconfig.Info.Description)
|
||||||
|
.setColor(msgconfig.Info.Colour)
|
||||||
|
|
||||||
|
interaction.reply({
|
||||||
|
embeds: [InfoEmbed],
|
||||||
|
components: [inforow],
|
||||||
|
});
|
||||||
|
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Ping Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.Ping.Command,
|
||||||
|
description: cmdconfig.Ping.Description,
|
||||||
|
options: [],
|
||||||
|
permissions: cmdconfig.Ping.Permission,
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
let disableCommand = true;
|
||||||
|
|
||||||
|
const PingEmbed = new Discord.EmbedBuilder()
|
||||||
|
.setDescription(
|
||||||
|
`:ping_pong: **Ping:** \`${interaction.client.ws.ping} ms\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.General);
|
||||||
|
|
||||||
|
interaction.reply({
|
||||||
|
embeds: [PingEmbed],
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
const fs = require("fs");
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
// Load configurations
|
||||||
|
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
const msgconfig = yaml.load(fs.readFileSync("./Configs/messages.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
// Ensure suggestions file exists and is correctly loaded
|
||||||
|
let suggestions;
|
||||||
|
try {
|
||||||
|
suggestions = require("../Data/SuggestionData.json");
|
||||||
|
} catch (error) {
|
||||||
|
suggestions = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.Suggestion.Command,
|
||||||
|
description: cmdconfig.Suggestion.Description,
|
||||||
|
type: Discord.ApplicationCommandType.ChatInput,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: "suggestion",
|
||||||
|
description: "Create a Suggestion",
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
permissions: cmdconfig.Suggestion.Permission,
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const { getChannel } = interaction.client;
|
||||||
|
|
||||||
|
const suggestChannel = await getChannel(
|
||||||
|
supportbot.Suggestions.Channel,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
|
||||||
|
const NoChannel = new Discord.EmbedBuilder()
|
||||||
|
.setTitle("Missing Channel!")
|
||||||
|
.setDescription(msgconfig.Error.InvalidChannel)
|
||||||
|
.setColor(supportbot.Embed.Colours.Error);
|
||||||
|
|
||||||
|
if (!suggestChannel) return interaction.reply({ embeds: [NoChannel] });
|
||||||
|
|
||||||
|
let suggestion = interaction.options.getString("suggestion");
|
||||||
|
|
||||||
|
const SuggestEmbed = new Discord.EmbedBuilder()
|
||||||
|
.addFields(
|
||||||
|
{ name: "Suggestion", value: suggestion, inline: true },
|
||||||
|
{ name: "From", value: `<@${interaction.user.id}>` },
|
||||||
|
{ name: `${supportbot.Suggestions.UpvoteEmoji} ${supportbot.Suggestions.UpvoteTitle}`, value: "0", inline: true },
|
||||||
|
{ name: `${supportbot.Suggestions.DownvoteEmoji} ${supportbot.Suggestions.DownvoteTitle}`, value: "0", inline: true }
|
||||||
|
)
|
||||||
|
.setThumbnail(interaction.user.displayAvatarURL())
|
||||||
|
.setFooter({
|
||||||
|
text: supportbot.Embed.Footer,
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
})
|
||||||
|
.setColor(supportbot.Embed.Colours.General);
|
||||||
|
|
||||||
|
const UpvoteButton = new Discord.ButtonBuilder()
|
||||||
|
.setCustomId("upvote")
|
||||||
|
.setEmoji(supportbot.Suggestions.UpvoteEmoji)
|
||||||
|
.setStyle(supportbot.Suggestions.Buttons.Upvote);
|
||||||
|
|
||||||
|
const DownvoteButton = new Discord.ButtonBuilder()
|
||||||
|
.setCustomId("downvote")
|
||||||
|
.setEmoji(supportbot.Suggestions.DownvoteEmoji)
|
||||||
|
.setStyle(supportbot.Suggestions.Buttons.Downvote);
|
||||||
|
|
||||||
|
const RemoveVoteButton = new Discord.ButtonBuilder()
|
||||||
|
.setCustomId("removevote")
|
||||||
|
.setLabel(supportbot.Suggestions.Buttons.RemoveVote_Title)
|
||||||
|
.setStyle(supportbot.Suggestions.Buttons.RemoveVote); // Red button
|
||||||
|
|
||||||
|
const row = new Discord.ActionRowBuilder().addComponents(UpvoteButton, DownvoteButton, RemoveVoteButton);
|
||||||
|
|
||||||
|
const suggestionMsg = await suggestChannel.send({ embeds: [SuggestEmbed], components: [row] });
|
||||||
|
|
||||||
|
suggestions[suggestionMsg.id] = {
|
||||||
|
suggestion: suggestion,
|
||||||
|
author: interaction.user.id,
|
||||||
|
upvotes: [],
|
||||||
|
downvotes: []
|
||||||
|
};
|
||||||
|
|
||||||
|
fs.writeFileSync("./Data/SuggestionData.json", JSON.stringify(suggestions, null, 2));
|
||||||
|
|
||||||
|
if (supportbot.Suggestions.Threads.Enabled) {
|
||||||
|
await suggestionMsg.startThread({
|
||||||
|
name: supportbot.Suggestions.Threads.Title,
|
||||||
|
autoArchiveDuration: 60,
|
||||||
|
type: Discord.ChannelType.PublicThread,
|
||||||
|
reason: supportbot.Suggestions.Threads.Reason,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const Submitted = new Discord.EmbedBuilder()
|
||||||
|
.setTitle(`${msgconfig.Suggestions.Sent_Title}`)
|
||||||
|
.setDescription(`${msgconfig.Suggestions.Sent}`)
|
||||||
|
.addFields(
|
||||||
|
{ name: "Sent to:", value: `<#${suggestChannel.id}>` },
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.Success);
|
||||||
|
|
||||||
|
await interaction.reply({
|
||||||
|
ephemeral: true,
|
||||||
|
embeds: [Submitted]
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,308 @@
|
|||||||
|
const fs = require("fs");
|
||||||
|
const {
|
||||||
|
EmbedBuilder,
|
||||||
|
ApplicationCommandOptionType,
|
||||||
|
ApplicationCommandType,
|
||||||
|
ChannelType,
|
||||||
|
ActionRowBuilder,
|
||||||
|
ButtonBuilder,
|
||||||
|
StringSelectMenuBuilder,
|
||||||
|
StringSelectMenuOptionBuilder,
|
||||||
|
GuildMemberRoleManager,
|
||||||
|
} = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const panelconfig = yaml.load(fs.readFileSync("./Configs/ticket-panel.yml", "utf8"));
|
||||||
|
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
const msgconfig = yaml.load(fs.readFileSync("./Configs/messages.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
const TicketNumberID = require("../Structures/TicketID.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.OpenTicket.Command,
|
||||||
|
description: cmdconfig.OpenTicket.Description,
|
||||||
|
type: ApplicationCommandType.ChatInput,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: "reason",
|
||||||
|
description: "Ticket Reason",
|
||||||
|
type: ApplicationCommandOptionType.String,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
permissions: cmdconfig.OpenTicket.Permission,
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
let department = interaction.customId?.split("-")[1] || null;
|
||||||
|
let TicketData = JSON.parse(fs.readFileSync("./Data/TicketData.json", "utf8"));
|
||||||
|
const { getRole, getChannel } = interaction.client;
|
||||||
|
let User = interaction.guild.members.cache.get(interaction.user.id);
|
||||||
|
|
||||||
|
if (
|
||||||
|
supportbot.Ticket.TicketsPerUser &&
|
||||||
|
TicketData.tickets.filter((t) => t.user === interaction.user.id && t.open).length >= supportbot.Ticket.TicketsPerUser
|
||||||
|
) {
|
||||||
|
return interaction.reply({
|
||||||
|
embeds: [
|
||||||
|
{
|
||||||
|
title: "Too Many Tickets!",
|
||||||
|
description: `You can't have more than ${supportbot.Ticket.TicketsPerUser} open tickets!`,
|
||||||
|
color: supportbot.Embed.Colours.Warn,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (User.roles.cache.has(supportbot.Roles.ModRoles.Blacklisted)) {
|
||||||
|
return interaction.reply({
|
||||||
|
content: msgconfig.Ticket.Blacklisted,
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (User.roles.cache.has(supportbot.Roles.ModRoles.Muted)) {
|
||||||
|
return interaction.reply({
|
||||||
|
content: msgconfig.Ticket.Muted,
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
let ticketNumberID = await TicketNumberID.pad();
|
||||||
|
const TicketSubject = interaction.options?.getString("reason") || msgconfig.Ticket.InvalidSubject;
|
||||||
|
|
||||||
|
const TicketExists = new EmbedBuilder()
|
||||||
|
.setTitle("Ticket Exists!")
|
||||||
|
.setDescription(msgconfig.Ticket.TicketExists);
|
||||||
|
|
||||||
|
if (
|
||||||
|
await interaction.guild.channels.cache.find(
|
||||||
|
(ticketChannel) => ticketChannel.name === `${supportbot.Ticket.Channel}${ticketNumberID}`
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return await interaction.reply({
|
||||||
|
embeds: [TicketExists],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const Staff = await getRole(supportbot.Roles.StaffMember.Staff, interaction.guild);
|
||||||
|
const Admin = await getRole(supportbot.Roles.StaffMember.Admin, interaction.guild);
|
||||||
|
|
||||||
|
if (!Staff || !Admin)
|
||||||
|
return interaction.reply({
|
||||||
|
content: "Some roles seem to be missing!\nPlease check for errors when starting the bot.",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
const TicketCategory = interaction.guild.channels.cache.find(
|
||||||
|
(c) => c.name === supportbot.Ticket.TicketCategory || c.id === supportbot.Ticket.TicketCategory
|
||||||
|
);
|
||||||
|
|
||||||
|
const channel = await getChannel(supportbot.Ticket.TicketCategory, interaction.guild);
|
||||||
|
const ticketChannel = await channel.threads.create({
|
||||||
|
name: `${supportbot.Ticket.Channel}${ticketNumberID}`,
|
||||||
|
type: ChannelType.PrivateThread,
|
||||||
|
parent: TicketCategory,
|
||||||
|
autoArchiveDuration: 60,
|
||||||
|
reason: 'support ticket',
|
||||||
|
});
|
||||||
|
|
||||||
|
if (supportbot.Ticket.ClaimTickets.Enabled === false) {
|
||||||
|
const InvStaff = await ticketChannel.send(`<@&${Staff.id}> <@&${Admin.id}>`)
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
InvStaff.delete();
|
||||||
|
}, 2000)
|
||||||
|
}
|
||||||
|
|
||||||
|
// TICKET CLAIMING SYSTEM [START]
|
||||||
|
|
||||||
|
if (supportbot.Ticket.ClaimTickets.Enabled) {
|
||||||
|
const InvStaff1 = await ticketChannel.send(`<@&${Admin.id}>`)
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
InvStaff1.delete();
|
||||||
|
}, 2000)
|
||||||
|
|
||||||
|
const claimChannel = await getChannel(
|
||||||
|
supportbot.Ticket.ClaimTickets.Channel,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
|
||||||
|
const claimEmbed = new EmbedBuilder()
|
||||||
|
.setTitle(msgconfig.Ticket.ClaimTickets.ClaimTitle)
|
||||||
|
.setDescription(msgconfig.Ticket.ClaimTickets.ClaimMessage
|
||||||
|
.replace('%user%', interaction.user.id)
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.General);
|
||||||
|
|
||||||
|
const claimButton = new ButtonBuilder()
|
||||||
|
.setCustomId(`claimticket-${ticketChannel.id}`)
|
||||||
|
.setLabel(supportbot.Ticket.ClaimTickets.ButtonTitle)
|
||||||
|
.setStyle(supportbot.Ticket.ClaimTickets.Button);
|
||||||
|
|
||||||
|
const row = new ActionRowBuilder().addComponents(claimButton);
|
||||||
|
|
||||||
|
await claimChannel.send({
|
||||||
|
content: `<@&${Staff.id}>`,
|
||||||
|
embeds: [claimEmbed],
|
||||||
|
components: [row]
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// TICKET CLAIMING SYSTEM [END]
|
||||||
|
|
||||||
|
if (!department) {
|
||||||
|
await ticketChannel.members.add(interaction.user.id);
|
||||||
|
}
|
||||||
|
|
||||||
|
TicketData.tickets.push({
|
||||||
|
id: ticketChannel.id,
|
||||||
|
name: ticketChannel.name,
|
||||||
|
user: interaction.user.id,
|
||||||
|
number: ticketNumberID,
|
||||||
|
reason: TicketSubject,
|
||||||
|
open: true,
|
||||||
|
subUsers: [],
|
||||||
|
createdAt: new Date().toISOString(),
|
||||||
|
claimedAt: null, // Will be updated when claimed
|
||||||
|
});
|
||||||
|
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/TicketData.json",
|
||||||
|
JSON.stringify(TicketData, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const CreatedTicket = new EmbedBuilder()
|
||||||
|
.setDescription(
|
||||||
|
msgconfig.Ticket.TicketCreatedAlert.replace(/%ticketauthor%/g, interaction.user.id)
|
||||||
|
.replace(/%ticketid%/g, ticketChannel.id)
|
||||||
|
.replace(/%ticketusername%/g, interaction.user.username)
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.General);
|
||||||
|
await interaction.reply({ embeds: [CreatedTicket], ephemeral: true });
|
||||||
|
|
||||||
|
if (supportbot.Ticket.AllowMentions) {
|
||||||
|
await ticketChannel.send(`${interaction.user}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const TicketMessage = new EmbedBuilder()
|
||||||
|
.setAuthor({
|
||||||
|
name: msgconfig.Ticket.TicketAuthorTitle.replace(/%ticketauthor%/g, interaction.user.id)
|
||||||
|
.replace(/%ticketid%/g, ticketChannel.id)
|
||||||
|
.replace(/%ticketusername%/g, interaction.user.username),
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
})
|
||||||
|
.setTitle(
|
||||||
|
msgconfig.Ticket.TicketTitle.replace(/%ticketauthor%/g, interaction.user.id)
|
||||||
|
.replace(/%ticketid%/g, ticketChannel.id)
|
||||||
|
.replace(/%ticketusername%/g, interaction.user.username)
|
||||||
|
)
|
||||||
|
.setDescription(
|
||||||
|
msgconfig.Ticket.TicketMessage.replace(/%ticketauthor%/g, interaction.user.id)
|
||||||
|
.replace(/%ticketid%/g, ticketChannel.id)
|
||||||
|
.replace(/%ticketusername%/g, interaction.user.username)
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.General);
|
||||||
|
|
||||||
|
const SelectMenus = new StringSelectMenuBuilder()
|
||||||
|
.setCustomId("ticketcontrolpanel")
|
||||||
|
.setPlaceholder("Ticket Control Panel")
|
||||||
|
.addOptions(
|
||||||
|
new StringSelectMenuOptionBuilder()
|
||||||
|
.setLabel("Add User")
|
||||||
|
.setDescription("Add a user to the ticket.")
|
||||||
|
.setEmoji(supportbot.SelectMenus.Tickets.AddUserEmoji)
|
||||||
|
.setValue("ticketadduser"),
|
||||||
|
new StringSelectMenuOptionBuilder()
|
||||||
|
.setLabel("Remove User")
|
||||||
|
.setDescription("Remove a user from the ticket.")
|
||||||
|
.setEmoji(supportbot.SelectMenus.Tickets.RemoveUserEmoji)
|
||||||
|
.setValue("ticketremoveuser"),
|
||||||
|
new StringSelectMenuOptionBuilder()
|
||||||
|
.setLabel("Close")
|
||||||
|
.setDescription("Close the ticket.")
|
||||||
|
.setEmoji(supportbot.SelectMenus.Tickets.CloseEmoji)
|
||||||
|
.setValue("ticketclose"),
|
||||||
|
new StringSelectMenuOptionBuilder()
|
||||||
|
.setLabel("Enable Invites")
|
||||||
|
.setDescription("Enable invites.")
|
||||||
|
.setEmoji(supportbot.SelectMenus.Tickets.EnableInvitesEmoji)
|
||||||
|
.setValue("enableinvites"),
|
||||||
|
new StringSelectMenuOptionBuilder()
|
||||||
|
.setLabel("Disable Invites")
|
||||||
|
.setDescription("Disable invites.")
|
||||||
|
.setEmoji(supportbot.SelectMenus.Tickets.DisableInvitesEmoji)
|
||||||
|
.setValue("disableinvites"),
|
||||||
|
);
|
||||||
|
|
||||||
|
const row2 = new ActionRowBuilder().addComponents(SelectMenus);
|
||||||
|
|
||||||
|
if (!department) {
|
||||||
|
try {
|
||||||
|
let buttons = supportbot.Departments.map((x) =>
|
||||||
|
new ButtonBuilder()
|
||||||
|
.setCustomId("Department" + supportbot.Departments.indexOf(x))
|
||||||
|
.setLabel(x.title)
|
||||||
|
.setStyle(x.color)
|
||||||
|
.setEmoji(x.emoji)
|
||||||
|
);
|
||||||
|
|
||||||
|
if (supportbot.Ticket.AllowMentions) {
|
||||||
|
await ticketChannel.send("<@&" + supportbot.Ticket.RoleMention + ">");
|
||||||
|
}
|
||||||
|
|
||||||
|
const row = new ActionRowBuilder().addComponents(buttons);
|
||||||
|
const m = await ticketChannel.send({
|
||||||
|
embeds: [TicketMessage],
|
||||||
|
components: [row2],
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
const filter = (i) => i.user.id === interaction.user.id;
|
||||||
|
await m.awaitMessageComponent({
|
||||||
|
filter,
|
||||||
|
max: 1,
|
||||||
|
componentType: "BUTTON",
|
||||||
|
time: supportbot.Ticket.Timeout * 60000,
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (e.code === "COLLECTOR_ERROR") {
|
||||||
|
try {
|
||||||
|
let ticket = TicketData.tickets.findIndex((t) => t.id === ticketChannel.id);
|
||||||
|
TicketData.tickets[ticket].open = false;
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/TicketData.json",
|
||||||
|
JSON.stringify(TicketData, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
interaction.user.send(
|
||||||
|
"Your ticket has timed out. Please open a new one, and select a department."
|
||||||
|
);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("An error occurred while handling collector:", error);
|
||||||
|
}
|
||||||
|
return await ticketChannel.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error sending message:", error);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
await ticketChannel.send({
|
||||||
|
embeds: [TicketMessage],
|
||||||
|
components: [row2],
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,115 @@
|
|||||||
|
// ticketpanel.js
|
||||||
|
const fs = require("fs");
|
||||||
|
const {
|
||||||
|
EmbedBuilder,
|
||||||
|
ApplicationCommandType,
|
||||||
|
ActionRowBuilder,
|
||||||
|
ButtonBuilder,
|
||||||
|
} = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const panelconfig = yaml.load(fs.readFileSync("./Configs/ticket-panel.yml", "utf8"));
|
||||||
|
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.TicketPanel.Command,
|
||||||
|
description: cmdconfig.TicketPanel.Description,
|
||||||
|
type: ApplicationCommandType.ChatInput,
|
||||||
|
options: [],
|
||||||
|
permissions: cmdconfig.TicketPanel.Permission,
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
if (!panelconfig.Panel) {
|
||||||
|
console.log(
|
||||||
|
"\u001b[31m",
|
||||||
|
`[TICKET PANEL]`,
|
||||||
|
"\u001b[33m",
|
||||||
|
"Ticket Panel is not setup, You can set this in", `\u001b[31m`, '/Configs/ticket-panel.yml', `\n `,
|
||||||
|
);
|
||||||
|
return interaction.reply({
|
||||||
|
content: "Ticket Panel is not set up. Please configure it in `/Configs/ticket-panel.yml`.",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const channelName = panelconfig.Channel;
|
||||||
|
const channel = interaction.guild.channels.cache.find(ch => ch.name === channelName);
|
||||||
|
if (!channel) {
|
||||||
|
console.log(`[TICKET PANEL] ${channelName} channel not found. Please check your config file.`);
|
||||||
|
return interaction.reply({
|
||||||
|
content: `${channelName} channel not found. Please check your config file.`,
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const panelid = JSON.parse(fs.readFileSync("./Data/ticket-panel-id.json", "utf8"));
|
||||||
|
|
||||||
|
try {
|
||||||
|
await channel.messages.fetch(panelid.TicketPanelID);
|
||||||
|
return interaction.reply({
|
||||||
|
content: "Ticket panel message already exists.",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
let embed = new EmbedBuilder()
|
||||||
|
.setTitle(panelconfig.PanelTitle)
|
||||||
|
.setColor(panelconfig.PanelColour)
|
||||||
|
.setFooter({
|
||||||
|
text: supportbot.Embed.Footer,
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
});
|
||||||
|
|
||||||
|
if (panelconfig.TicketPanel_Description) {
|
||||||
|
embed.setDescription(panelconfig.PanelMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (panelconfig.TicketPanel_Thumbnail) {
|
||||||
|
embed.setThumbnail(panelconfig.PanelThumbnail);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (panelconfig.TicketPanel_Image) {
|
||||||
|
embed.setImage(panelconfig.PanelImage);
|
||||||
|
}
|
||||||
|
|
||||||
|
const createTicketButton = new ButtonBuilder()
|
||||||
|
.setCustomId("createticket")
|
||||||
|
.setLabel(panelconfig.Button.Text)
|
||||||
|
.setEmoji(panelconfig.Button.Emoji)
|
||||||
|
.setStyle(panelconfig.Button.Color);
|
||||||
|
|
||||||
|
let row = new ActionRowBuilder().addComponents(createTicketButton);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const message = await channel.send({
|
||||||
|
embeds: [embed],
|
||||||
|
components: [row],
|
||||||
|
});
|
||||||
|
|
||||||
|
let data = {
|
||||||
|
id: panelid.id,
|
||||||
|
TicketPanelID: message.id,
|
||||||
|
};
|
||||||
|
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/ticket-panel-id.json",
|
||||||
|
JSON.stringify(data),
|
||||||
|
"utf8"
|
||||||
|
);
|
||||||
|
|
||||||
|
return interaction.reply({
|
||||||
|
content: "Ticket panel message has been sent!",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
console.log("Error sending message:", e);
|
||||||
|
return interaction.reply({
|
||||||
|
content: "An error occurred while sending the ticket panel message.",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,56 @@
|
|||||||
|
const { EmbedBuilder, ApplicationCommandType } = require("discord.js");
|
||||||
|
const fs = require("fs");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
const msgconfig = yaml.load(fs.readFileSync("./Configs/messages.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.TicketStats.Command,
|
||||||
|
description: cmdconfig.TicketStats.Description,
|
||||||
|
type: ApplicationCommandType.ChatInput,
|
||||||
|
permissions: ["SendMessages"], // Adjust permissions as needed
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
|
||||||
|
if (supportbot.Ticket.ClaimTickets.Enabled) {
|
||||||
|
|
||||||
|
const TicketData = JSON.parse(fs.readFileSync("./Data/TicketData.json", "utf8"));
|
||||||
|
const userId = interaction.user.id;
|
||||||
|
|
||||||
|
const ticketsClaimed = TicketData.tickets.filter(t => t.claimedBy === userId);
|
||||||
|
const ticketsOpen = ticketsClaimed.filter(t => t.open);
|
||||||
|
const totalTickets = ticketsClaimed.length;
|
||||||
|
|
||||||
|
let totalResponseTime = 0;
|
||||||
|
let responseCount = 0;
|
||||||
|
|
||||||
|
ticketsClaimed.forEach(ticket => {
|
||||||
|
if (ticket.claimedAt && ticket.createdAt) {
|
||||||
|
const responseTime = new Date(ticket.claimedAt) - new Date(ticket.createdAt);
|
||||||
|
totalResponseTime += responseTime;
|
||||||
|
responseCount++;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const averageResponseTime = responseCount ? totalResponseTime / responseCount : 0;
|
||||||
|
const averageResponseTimeMinutes = Math.round(averageResponseTime / 60000); // Convert to minutes
|
||||||
|
|
||||||
|
const statsEmbed = new EmbedBuilder()
|
||||||
|
.setTitle(msgconfig.TicketStats.Title)
|
||||||
|
.setDescription(`> Ticket stats for <@${interaction.user.id}>`)
|
||||||
|
.setColor(supportbot.Embed.Colours.General)
|
||||||
|
.addFields(
|
||||||
|
{ name: msgconfig.TicketStats.OpenTickets, value: `${ticketsOpen.length}`, inline: true },
|
||||||
|
{ name: msgconfig.TicketStats.TotalTickets, value: `${totalTickets}`, inline: true },
|
||||||
|
{ name: msgconfig.TicketStats.ResponseTime, value: `${averageResponseTimeMinutes} minutes`, inline: false }
|
||||||
|
);
|
||||||
|
|
||||||
|
await interaction.reply({ embeds: [statsEmbed], ephemeral: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -0,0 +1,117 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Translate Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const cmdconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/commands.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const msgconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/messages.yml", "utf8")
|
||||||
|
)
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
const translate = require("@vitalets/google-translate-api");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.Translate.Command,
|
||||||
|
description: cmdconfig.Translate.Description,
|
||||||
|
type: Discord.ApplicationCommandType.ChatInput,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
name: "language",
|
||||||
|
description: "A 2 letter language code",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
|
name: "text",
|
||||||
|
description: "The text to translate",
|
||||||
|
required: true,
|
||||||
|
}, // The input text for the translation
|
||||||
|
],
|
||||||
|
permissions: cmdconfig.Translate.Permission, // The permission the user/role at least requires
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
let disableCommand = true;
|
||||||
|
|
||||||
|
const { getRole } = interaction.client;
|
||||||
|
let SupportStaff = await getRole(supportbot.Roles.StaffMember.Staff, interaction.guild);
|
||||||
|
let Admin = await getRole(supportbot.Roles.StaffMember.Admin, interaction.guild);
|
||||||
|
if (!SupportStaff || !Admin)
|
||||||
|
|
||||||
|
return interaction.reply(
|
||||||
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
|
);
|
||||||
|
|
||||||
|
const NoPerms = new Discord.EmbedBuilder()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(
|
||||||
|
`${msgconfig.Error.IncorrectPerms}\n\nRole Required: \`${supportbot.Roles.StaffMember.Staff}\` or \`${supportbot.Roles.StaffMember.Admin}\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.Warn);
|
||||||
|
|
||||||
|
if (
|
||||||
|
!interaction.member.roles.cache.has(SupportStaff.id) &&
|
||||||
|
!interaction.member.roles.cache.has(Admin.id)
|
||||||
|
)
|
||||||
|
return interaction.reply({ embeds: [NoPerms] });
|
||||||
|
|
||||||
|
const { getChannel } = interaction.client;
|
||||||
|
let lang = interaction.options.getString("language"); // Grab choice of language code by user
|
||||||
|
let url = "https://www.science.co.il/language/Codes.php"; // URL to all available language codes
|
||||||
|
let text = await interaction.options.getString("text"); // Grab the text to translate by the user
|
||||||
|
let translatelog = await getChannel(
|
||||||
|
supportbot.Translate.Log,
|
||||||
|
interaction.guild
|
||||||
|
); // Grab the set logging channel for translations
|
||||||
|
|
||||||
|
|
||||||
|
// Return message if user has provided an invalid language code
|
||||||
|
const result = await translate(text, { to: lang }).catch(async (err) => {
|
||||||
|
if (err && err.code == 400) {
|
||||||
|
await interaction.reply({
|
||||||
|
embeds: [
|
||||||
|
new Discord.EmbedBuilder()
|
||||||
|
.setColor(supportbot.Embed.Colours.Warn)
|
||||||
|
.setTitle("Valid Language Codes")
|
||||||
|
.setURL(url)
|
||||||
|
.setDescription(
|
||||||
|
"Click the title to see which 2 letter language codes are valid."
|
||||||
|
),
|
||||||
|
],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!result) return;
|
||||||
|
|
||||||
|
// Embed containing language code, original text and translated text
|
||||||
|
let transembed = new Discord.EmbedBuilder()
|
||||||
|
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.displayAvatarURL({ dynamic: true }) })
|
||||||
|
.setColor(supportbot.Embed.Colours.Success)
|
||||||
|
.setDescription(`**Translation to ${lang}**`)
|
||||||
|
.addFields(
|
||||||
|
{ name: "Original text", value: text },
|
||||||
|
{ name: "Translated text", value: result.text },
|
||||||
|
)
|
||||||
|
.setFooter({ text: `Author: ${interaction.user.id}` })
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
// Send embed [transembed] with translated message to channel
|
||||||
|
await interaction.reply({ embeds: [transembed] });
|
||||||
|
|
||||||
|
// Send embed [transembed] to logging channel
|
||||||
|
await translatelog.send({ embeds: [transembed] });
|
||||||
|
},
|
||||||
|
|
||||||
|
})
|
||||||
@@ -0,0 +1,137 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// User Info Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const moment = require("moment");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const cmdconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/commands.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const msgconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/messages.yml", "utf8")
|
||||||
|
)
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.UserInfo.Command,
|
||||||
|
description: cmdconfig.UserInfo.Description,
|
||||||
|
type: Discord.ApplicationCommandType.ChatInput,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
type: Discord.ApplicationCommandOptionType.User,
|
||||||
|
name: "user",
|
||||||
|
description: "The user you want to get info about.",
|
||||||
|
required: true,
|
||||||
|
}, // The user input
|
||||||
|
],
|
||||||
|
permissions: cmdconfig.UserInfo.Permission,
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
let disableCommand = true;
|
||||||
|
|
||||||
|
const { getRole } = interaction.client;
|
||||||
|
let SupportStaff = await getRole(supportbot.Roles.StaffMember.Staff, interaction.guild);
|
||||||
|
let Admin = await getRole(supportbot.Roles.StaffMember.Admin, interaction.guild);
|
||||||
|
if (!SupportStaff || !Admin)
|
||||||
|
|
||||||
|
return interaction.reply(
|
||||||
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
|
);
|
||||||
|
|
||||||
|
const NoPerms = new Discord.EmbedBuilder()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(
|
||||||
|
`${msgconfig.Error.IncorrectPerms}\n\nRole Required: \`${supportbot.Roles.StaffMember.Staff}\` or \`${supportbot.Roles.StaffMember.Admin}\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.Warn);
|
||||||
|
|
||||||
|
if (
|
||||||
|
!interaction.member.roles.cache.has(SupportStaff.id) &&
|
||||||
|
!interaction.member.roles.cache.has(Admin.id)
|
||||||
|
)
|
||||||
|
return interaction.reply({ embeds: [NoPerms] });
|
||||||
|
|
||||||
|
let user = await interaction.options.getUser("user") || interaction.author; // Grab the mentioned user
|
||||||
|
let member = await interaction.guild.members.cache.get(user.id) // Check for user and his ID
|
||||||
|
|
||||||
|
const UserNotExist = new Discord.EmbedBuilder()
|
||||||
|
.setTitle("User Not Found!")
|
||||||
|
.setDescription(
|
||||||
|
`${msgconfig.Error.UserNotFound}\n\nTry Again:\`/${cmdconfig.UserInfoCommand} <@!User_ID> or @User\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
|
if (!user) return interaction.reply({ embeds: [UserNotExist] });
|
||||||
|
|
||||||
|
// Flags a user/bot can have
|
||||||
|
const flags = {
|
||||||
|
DISCORD_EMPLOYEE: 'Discord Employee',
|
||||||
|
DISCORD_PARTNER: 'Discord Partner',
|
||||||
|
BUGHUNTER_LEVEL_1: 'Bug Hunter (Level 1)',
|
||||||
|
BUGHUNTER_LEVEL_2: 'Bug Hunter (Level 2)',
|
||||||
|
HYPESQUAD_EVENTS: 'HypeSquad Events',
|
||||||
|
HOUSE_BRAVERY: 'House of Bravery',
|
||||||
|
HOUSE_BRILLIANCE: 'House of Brilliance',
|
||||||
|
HOUSE_BALANCE: 'House of Balance',
|
||||||
|
EARLY_SUPPORTER: 'Early Supporter',
|
||||||
|
TEAM_USER: 'Team User',
|
||||||
|
SYSTEM: 'System',
|
||||||
|
VERIFIED_BOT: 'Verified Bot',
|
||||||
|
VERIFIED_DEVELOPER: 'Verified Bot Developer'
|
||||||
|
};
|
||||||
|
|
||||||
|
// Status message with icon
|
||||||
|
let status = {
|
||||||
|
online: "🟢Online",
|
||||||
|
idle: "🟡Idle",
|
||||||
|
dnd: "🔴Do Not Disturb",
|
||||||
|
offline: "⚫Offline"
|
||||||
|
};
|
||||||
|
|
||||||
|
const userFlags = user.flags.toArray();
|
||||||
|
|
||||||
|
// Embed containing the userinfo
|
||||||
|
let userembed = new Discord.EmbedBuilder()
|
||||||
|
.setTitle(`User Info for User: ${user.tag}`)
|
||||||
|
.setThumbnail(member.displayAvatarURL({ dynamic: true, size: 512 }))
|
||||||
|
.setColor(member.roles.highest.hexColor)
|
||||||
|
.addFields(
|
||||||
|
{ name: "Name:", value: `${user.tag}\n<@${member.id}>`, inline: true },
|
||||||
|
{ name: "ID:", value: `${member.id}`, inline: true },
|
||||||
|
{ name: "Is Bot:", value: user.bot ? "Yes" : "No", inline: true },
|
||||||
|
{ name: "House/Badge:", value: `${userFlags.length ? userFlags.map(flag => flags[flag]).join("\n") : "None"}`, inline: true },
|
||||||
|
{ name: "Current Status:", value: `${status[member.presence ? member.presence.status : "offline"]}`, inline: true },
|
||||||
|
{ name: "Avatar URL:", value: `[Click Here](${member.displayAvatarURL()})`, inline: true },
|
||||||
|
{ name: "\u200b", value: "\u200b", inline: false}
|
||||||
|
)
|
||||||
|
.addFields(
|
||||||
|
{ name: "Creation Date:", value: `${moment(user.createdAt).format("MMMM Do YYYY, h:mm:ss a")}\n> ${moment(user.createdAt).startOf("day").fromNow()}`, inline: true },
|
||||||
|
{ name: "Joined Date:", value: `${moment(member.joinedAt).format("MMMM Do YYYY, h:mm:ss a")}\n> ${moment(member.joinedAt).startOf("day").fromNow()}`, inline: true },
|
||||||
|
{ name: "Roles Total:", value: `${member.roles.cache.size -1}`, inline: false },
|
||||||
|
{ name: "Highest Role:", value: `${member.roles.highest.id === interaction.guild.id ? "None" : member.roles.highest.toString()}`, inline: true },
|
||||||
|
{ name: "Roles:", value: `${member.roles.cache.map(r => r).join(" ").replace("@everyone", " ") || "None"}`, inline: false },
|
||||||
|
)
|
||||||
|
.setFooter({ text: supportbot.Footer })
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
// Send embed [userembed]
|
||||||
|
await interaction.reply({ embeds: [userembed] }).catch((err) => console.error("An error has occured: ", err));
|
||||||
|
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @INFO
|
||||||
|
* UserInfo command by Sypher#3415 | 321332200668790786
|
||||||
|
* @INFO
|
||||||
|
* Solely created for SupportBot | https://github.com/Emerald-Services/SupportBot/
|
||||||
|
**/
|
||||||
@@ -0,0 +1,109 @@
|
|||||||
|
# ___ _ ___ _
|
||||||
|
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||||
|
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||||
|
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||||
|
# |_| |_|
|
||||||
|
#
|
||||||
|
# SupportBot created by Emerald Services
|
||||||
|
# Installed with MIT License
|
||||||
|
#
|
||||||
|
# Discord Support: https://dsc.gg/emerald-dev
|
||||||
|
# Official Documentation: https://emeraldsrv.dev/wiki
|
||||||
|
# Third-Party Documentation: https://emeraldsrv.dev/third-party
|
||||||
|
#
|
||||||
|
# Command Configuration
|
||||||
|
|
||||||
|
Help:
|
||||||
|
Command: "help"
|
||||||
|
Description: "Get a list of all the commands."
|
||||||
|
Permission: ["SendMessages"]
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
EnableAI:
|
||||||
|
Command: "enableai"
|
||||||
|
Description: "Talk with SupportBot"
|
||||||
|
Permission: ["SendMessages"]
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Info:
|
||||||
|
Command: "info"
|
||||||
|
Description: "Get information about the **ServerName**."
|
||||||
|
Permission: ["SendMessages"]
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
TicketPanel:
|
||||||
|
Command: "ticketpanel"
|
||||||
|
Description: "Create the ticket creation panel"
|
||||||
|
Permission: ["Administrator"]
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
TicketStats:
|
||||||
|
Command: "ticketstats"
|
||||||
|
Description: "Shows staff members their ticket statistics"
|
||||||
|
Permission: ["SendMessages"]
|
||||||
|
# Command is automatically disabled when the TicketClaims is disabled.
|
||||||
|
|
||||||
|
OpenTicket:
|
||||||
|
Command: "ticket"
|
||||||
|
Description: "Create a support ticket."
|
||||||
|
Permission: ["SendMessages"]
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Add:
|
||||||
|
Command: "add"
|
||||||
|
Description: "Add a user to the ticket."
|
||||||
|
Permission: ["SendMessages"]
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
CloseTicket:
|
||||||
|
Command: "close"
|
||||||
|
Description: "Close a support ticket"
|
||||||
|
Permission: ["SendMessages"]
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Suggestion:
|
||||||
|
Command: "suggest"
|
||||||
|
Description: "Create a suggestion."
|
||||||
|
Permission: ["SendMessages"]
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Embed:
|
||||||
|
Command: "embed"
|
||||||
|
Description: "Build a discord embed."
|
||||||
|
Permission: ["SendMessages"]
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Translate:
|
||||||
|
Command: "translate"
|
||||||
|
Description: "Translate something to english"
|
||||||
|
Permission: ["SendMessages"]
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
UserInfo:
|
||||||
|
Command: "userinfo"
|
||||||
|
Description: "Get info about a user."
|
||||||
|
Permission: ["SendMessages"]
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
Ping:
|
||||||
|
Command: "ping"
|
||||||
|
Description: "Pong."
|
||||||
|
Permission: ["SendMessages"]
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
# ---------------------------------------
|
||||||
|
# Command Description Configuration
|
||||||
|
# ---------------------------------------
|
||||||
|
|
||||||
|
BlacklistDesc: "Blacklist a user from creating Tickets."
|
||||||
|
TicketAddDesc: "Add a user to a support ticket."
|
||||||
|
TicketRemoveDesc: "Remove a user from a support ticket."
|
||||||
|
TranslateCommandDesc: "Translates the language provided, along with the abbreviation (2 char) long language code"
|
||||||
|
OpenTicketDesc: "Open a new support ticket."
|
||||||
|
CloseTicketDesc: "Close your support ticket."
|
||||||
|
InfoCommandDesc: "Get information about the brand."
|
||||||
|
PingCommandDesc: "Pong!"
|
||||||
|
HelpCommandDesc: "Get a list of all the commands."
|
||||||
|
EmbedCommandDesc: "Send a message as an embed."
|
||||||
|
SuggestCommandDesc: "Suggest a feature for the server."
|
||||||
|
UserInfoCommandDesc: "Get info about a user."
|
||||||
@@ -0,0 +1,118 @@
|
|||||||
|
# ___ _ ___ _
|
||||||
|
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||||
|
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||||
|
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||||
|
# |_| |_|
|
||||||
|
#
|
||||||
|
# SupportBot created by Emerald Services
|
||||||
|
# Installed with MIT License
|
||||||
|
#
|
||||||
|
# Discord Support: https://dsc.gg/emerald-dev
|
||||||
|
# Official Documentation: https://emeraldsrv.com/wiki
|
||||||
|
# Third-Party Documentation: https://emeraldsrv.com/third-party
|
||||||
|
#
|
||||||
|
# Messages Configuration
|
||||||
|
|
||||||
|
Info:
|
||||||
|
Title: "About Us"
|
||||||
|
Description: "SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customization to match your own brand."
|
||||||
|
Button: "Visit Site"
|
||||||
|
URL: "https://emeraldsrv.com"
|
||||||
|
Colour: "#f74343"
|
||||||
|
|
||||||
|
Welcome:
|
||||||
|
Embed:
|
||||||
|
Colour: "#f74343"
|
||||||
|
Title: "Welcome to ServerName"
|
||||||
|
Message: "> :smile: %joined_user% has just landed!"
|
||||||
|
Thumbnail: "BOT"
|
||||||
|
|
||||||
|
ImageEnabled: false
|
||||||
|
ImageURL: "https://animagelink.png/"
|
||||||
|
|
||||||
|
Leave:
|
||||||
|
Embed:
|
||||||
|
Colour: "#f74343"
|
||||||
|
Title: "Goodbye!"
|
||||||
|
Message: "> :slight_frown: %joined_user% has recently dropped out!"
|
||||||
|
Thumbnail: "BOT"
|
||||||
|
|
||||||
|
ImageEnabled: false
|
||||||
|
ImageURL: "https://animagelink.png/"
|
||||||
|
|
||||||
|
Suggestions:
|
||||||
|
Sent_Title: "Suggestion Sent!"
|
||||||
|
Sent: "> :white_check_mark: **You have successfully sent a suggestion.**"
|
||||||
|
NoSelfVote: "> :x: **You cannot vote on your own suggestion.**"
|
||||||
|
RemoveVoteButton: "Remove Vote"
|
||||||
|
|
||||||
|
Ticket:
|
||||||
|
|
||||||
|
# Available Placeholders:
|
||||||
|
|
||||||
|
# %ticketusername% - User who created the ticket.
|
||||||
|
# <@%ticketauthor%> - Tags the user who created the ticket.
|
||||||
|
# <#%ticketid%> - Mentions the ticket channel.
|
||||||
|
|
||||||
|
TicketAuthorTitle: "%ticketusername%'s Ticket"
|
||||||
|
TicketTitle: "Support Ticket"
|
||||||
|
TicketMessage: "> Hello <@%ticketauthor%>, Thank you for creating a support ticket\nPlease wait patiently whilst a member of our team reaches out to you."
|
||||||
|
TicketThumbnail: "https://images.emojiterra.com/google/android-pie/512px/1f39f.png"
|
||||||
|
TicketCreatedAlert: "> :ticket: Ticked Created: <#%ticketid%>"
|
||||||
|
TicketExists: "> ❌ Ticket already exists"
|
||||||
|
TicketClaim: "> :white_check_mark: Ticket claimed by" #The user who claimed the ticket will be added to the end of this message
|
||||||
|
TicketUnclaim: "> :white_check_mark: Ticket unclaimed by" #The user who claimed the ticket will be added to the end of this message
|
||||||
|
|
||||||
|
DisableInvites: "> 🔒 Invites have been disabled for this ticket."
|
||||||
|
EnableInvites: "> 🔓 Invites have been enabled for this ticket."
|
||||||
|
|
||||||
|
# Available Placeholders:
|
||||||
|
|
||||||
|
# <@%user%> - Tags the user who was added to the ticket.
|
||||||
|
|
||||||
|
AddUserToTicket_Title: "➕ Add User!"
|
||||||
|
AddUserToTicket: "> To add a user to this ticket, Tag them."
|
||||||
|
|
||||||
|
RemovedUserFromTicket_Title: "➖ Removed User!"
|
||||||
|
RemovedUserFromTicket: "> <@%user%> has been `Removed` from this ticket"
|
||||||
|
|
||||||
|
Blacklisted: "> :x: You are not allowed to open a ticket"
|
||||||
|
Muted: "> :x: You are `Muted` and therefore not allowed to open any tickets"
|
||||||
|
InvalidSubject: "> No Reason Provided!"
|
||||||
|
|
||||||
|
TranscriptSavedMessage: "📝 **Transcript Saved!**"
|
||||||
|
TicketLockMessage: "❌ **Ticket Locked!**"
|
||||||
|
TicketDeleteMessage: "⚠ **Ticket Deleting!**"
|
||||||
|
|
||||||
|
ClosingTicket: "> :warning: You have requested to close your support ticket."
|
||||||
|
ConfirmClose: "> Please confirm closing the ticket by clicking the button below."
|
||||||
|
CloseTimeout: "> Ticket close confirmation timed out."
|
||||||
|
|
||||||
|
ClaimTickets:
|
||||||
|
ClaimTitle: "Incoming Support Request!"
|
||||||
|
ClaimMessage: "> A new ticket has been created by <@!%user%>. Click the button below to claim this ticket."
|
||||||
|
ClaimMessage_Edit: "> <#%channel%> was claimed by <@!%user%>."
|
||||||
|
|
||||||
|
ClaimedTitle: "Ticket Claimed!"
|
||||||
|
Claimed: "> You have successfully claimed this ticket. <#%channel%>"
|
||||||
|
NoPermsToClaimTitle: "Error, no permissions!"
|
||||||
|
NoPermsToClaim: "> :x: **Err!** You do not permissions to claim this ticket."
|
||||||
|
|
||||||
|
TicketStats:
|
||||||
|
OpenTickets: "✅ Open Tickets"
|
||||||
|
TotalTickets: "🎫 Total Tickets"
|
||||||
|
ResponseTime: "⏱️ Average Response Time"
|
||||||
|
|
||||||
|
Title: "Your Ticket Stats"
|
||||||
|
|
||||||
|
Error:
|
||||||
|
IncorrectPerms: "> :x: **Err!** You do not have the correct permissions to use this."
|
||||||
|
InvalidChannel: "> :x: **Err!** Channel not found. Please create it!"
|
||||||
|
UserNotFound: "> :x: **Err!** This user doesn't exist, Are they in this server?"
|
||||||
|
NoValidTicket: "> :warning: You cannot execute this command here."
|
||||||
|
TicketExists: "> :warning: This ticket cannot be opened, It already exists!"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
# -------------------------
|
||||||
|
# SupportBot AI
|
||||||
|
#
|
||||||
|
# In order to use the SupportBot AI, You need to setup an OpenAI Account.
|
||||||
|
# this can be done at https://platform.openai.com/
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
|
General:
|
||||||
|
Name: "SupportBot AI"
|
||||||
|
# What would you like to call your AI
|
||||||
|
Model: "gpt-4o"
|
||||||
|
# You can see a list of OpenAI Models here: https://platform.openai.com/docs/models
|
||||||
|
|
||||||
|
Tokens: 400
|
||||||
|
# Max tokens you can set is 400
|
||||||
|
# For more information about tokens, go to https://openai.com/api/pricing/
|
||||||
|
|
||||||
|
OpenAI_Key: "OPEN_AI_API_KEY"
|
||||||
|
# To create an OpenAI API key, go to https://platform.openai.com/api-keys
|
||||||
|
|
||||||
|
|
||||||
|
PastebinAPI_Key: "PASTEBIN_API_KEY"
|
||||||
|
# You can get your Pastebin API Key from https://pastebin.com
|
||||||
|
PastebinAPI_URL: "https://pastebin.com/api/api_post.php"
|
||||||
|
|
||||||
|
Channels:
|
||||||
|
AIChannel: "0000000000000000000"
|
||||||
|
# This is the channel where AI will respond in without needing to mention the bot.
|
||||||
|
|
||||||
|
Embed:
|
||||||
|
Color: 0x0cc559 # 0x<hexcode>
|
||||||
|
Footer: "SupportBot | Developed by Emerald Development"
|
||||||
|
|
||||||
|
Messages:
|
||||||
|
MessageTooLong: "The response was too long, so I've posted it here: {pastebin}"
|
||||||
|
ErrorResponse: "I didn't receive a proper response from OpenAI. Please try again later."
|
||||||
|
OpenAIError: "I'm having some trouble talking to SupportBot AI's Model, OpenAI. Please try again later."
|
||||||
|
AIDisabled: "I am disabled, You have enable me in `supportbot-ai.yml`"
|
||||||
@@ -0,0 +1,216 @@
|
|||||||
|
# ___ _ ___ _
|
||||||
|
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||||
|
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||||
|
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||||
|
# |_| |_|
|
||||||
|
#
|
||||||
|
# SupportBot created by Emerald Development
|
||||||
|
# Installed with MIT License
|
||||||
|
#
|
||||||
|
# Discord Support: https://dsc.gg/emerald-dev
|
||||||
|
# Official Documentation: https://github.com/Emerald-Services/SupportBot/wiki
|
||||||
|
# Third-Party Documentation: COMING SOON
|
||||||
|
|
||||||
|
SupportBot_Version: "v8.0"
|
||||||
|
# Do not change the version number
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# General
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
General:
|
||||||
|
Name: "SupportBot"
|
||||||
|
Token: "BOT_TOKEN_HERE"
|
||||||
|
# To get your Discord Bot Token, Go to https://discord.com/developers/applications
|
||||||
|
|
||||||
|
Addons:
|
||||||
|
Enabled: false
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Activity
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Activity:
|
||||||
|
Status: "SupportBot v8"
|
||||||
|
Type: "Competing"
|
||||||
|
# The Type can either be Playing, Watching, Listening or Competing
|
||||||
|
StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME"
|
||||||
|
# Set The Type to "Streaming" for a streaming status!
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Embeds
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Embed:
|
||||||
|
Colours:
|
||||||
|
General: 0x0cc559 # 0x<hexcode>
|
||||||
|
Success: 0x04b545 # 0x<hexcode>
|
||||||
|
Error: 0xd13030 # 0x<hexcode>
|
||||||
|
Warn: 0xfca117 # 0x<hexcode>
|
||||||
|
|
||||||
|
Footer: "SupportBot | Developed by Emerald Development"
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Roles
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Roles:
|
||||||
|
AutoRole:
|
||||||
|
Enabled: true
|
||||||
|
Role: "Member"
|
||||||
|
|
||||||
|
StaffMember:
|
||||||
|
Staff: "Staff"
|
||||||
|
Admin: "Admin"
|
||||||
|
|
||||||
|
ModRoles:
|
||||||
|
Muted: "Muted"
|
||||||
|
Blacklisted: "Blacklisted"
|
||||||
|
|
||||||
|
# ----------------------------
|
||||||
|
# System Messages
|
||||||
|
# ----------------------------
|
||||||
|
|
||||||
|
Welcome:
|
||||||
|
Enabled: true
|
||||||
|
Channel: "🚨┃join-leave-logs"
|
||||||
|
|
||||||
|
Leave:
|
||||||
|
Enabled: true
|
||||||
|
Channel: "🚨┃join-leave-logs"
|
||||||
|
|
||||||
|
# ----------------------------
|
||||||
|
# Suggestions
|
||||||
|
# ----------------------------
|
||||||
|
|
||||||
|
Suggestions:
|
||||||
|
Channel: "📗┃suggestions"
|
||||||
|
UpvoteEmoji: "✅"
|
||||||
|
DownvoteEmoji: "❌"
|
||||||
|
|
||||||
|
UpvoteTitle: "Yes"
|
||||||
|
DownvoteTitle: "No"
|
||||||
|
|
||||||
|
OwnSuggestion: true
|
||||||
|
# If false this will not allow the user to vote for a suggestion they created
|
||||||
|
# If true this will allow the user to vote for a suggestion they created
|
||||||
|
|
||||||
|
ShowUsers: true
|
||||||
|
|
||||||
|
Threads:
|
||||||
|
Enabled: true
|
||||||
|
Title: "Suggestion-releated Thread"
|
||||||
|
Reason: "A thread releted to this suggestion"
|
||||||
|
|
||||||
|
Buttons:
|
||||||
|
Upvote: "2"
|
||||||
|
Downvote: "2"
|
||||||
|
RemoveVote: "4"
|
||||||
|
RemoveVote_Title: "Remove Vote"
|
||||||
|
|
||||||
|
# Available Button Styles
|
||||||
|
# 1 - Blurple
|
||||||
|
# 2 - Grey
|
||||||
|
# 3 - Green
|
||||||
|
# 4 - Red
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Tickets
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Ticket:
|
||||||
|
TicketCategory: "📗┃tickets" #Where tickets normally go with the /ticket command
|
||||||
|
# This is the channel name for the ticket threads to be created, NOT A DISCORD CATEGORY!
|
||||||
|
|
||||||
|
Channel: "ticket-" # The prefix for ticket channel names
|
||||||
|
TicketsPerUser: 100
|
||||||
|
DMTranscripts: true
|
||||||
|
TicketReason: true
|
||||||
|
# If ticket reason is set to false, It will not prompt to create a reason
|
||||||
|
TicketSubject: "description"
|
||||||
|
# "description" will display the ticket reason within the channel description
|
||||||
|
# "embed" will display the ticket reason within the ticket embed
|
||||||
|
Timeout: 5
|
||||||
|
# Set to true to allow all staff to access the ticket
|
||||||
|
|
||||||
|
Log:
|
||||||
|
TicketLog: "🚨┃ticket-data"
|
||||||
|
TicketLog_Title: "Ticket Closed"
|
||||||
|
DisableTicketLogChannel: false
|
||||||
|
|
||||||
|
TranscriptLog: "🚨┃ticket-data"
|
||||||
|
TranscriptTitle: "Ticket Transcript"
|
||||||
|
|
||||||
|
Close:
|
||||||
|
StaffOnly: true
|
||||||
|
# Set to false is anyone is able to close a ticket.
|
||||||
|
Confirmation_Button: "Confirm Close"
|
||||||
|
Title: "Are you sure you want to close this ticket?"
|
||||||
|
|
||||||
|
Invites:
|
||||||
|
StaffOnly: true
|
||||||
|
|
||||||
|
ClaimTickets:
|
||||||
|
Enabled: true
|
||||||
|
Channel: "1249723473757077624"
|
||||||
|
# Channel name or Channel ID
|
||||||
|
|
||||||
|
ButtonTitle: "Claim Ticket"
|
||||||
|
Button: "1"
|
||||||
|
|
||||||
|
# Available Button Styles
|
||||||
|
# 1 - Blurple
|
||||||
|
# 2 - Grey
|
||||||
|
# 3 - Green
|
||||||
|
# 4 - Red
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Departments - NOT IN THIS UPDATE
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Departments:
|
||||||
|
- title: "Create Ticket"
|
||||||
|
role: "Staff"
|
||||||
|
color: "2"
|
||||||
|
emoji: "🎫"
|
||||||
|
category: "TICKETS"
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Buttons
|
||||||
|
# -------------------------
|
||||||
|
Buttons:
|
||||||
|
Tickets:
|
||||||
|
ClaimEmoji: "🧑💻"
|
||||||
|
ClaimStyle: "1"
|
||||||
|
|
||||||
|
# Available Button Styles
|
||||||
|
# 1 - Blurple
|
||||||
|
# 2 - Grey
|
||||||
|
# 3 - Green
|
||||||
|
# 4 - Red
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Select Menus
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
SelectMenus:
|
||||||
|
Tickets:
|
||||||
|
PanelEmoji: "⚙️"
|
||||||
|
CloseEmoji: "🗑️"
|
||||||
|
ArchiveEmoji: "♻️"
|
||||||
|
LockTicketEmoji: "🔒"
|
||||||
|
UnLockTicketEmoji: "🔓"
|
||||||
|
EnableInvitesEmoji: "🔒"
|
||||||
|
DisableInvitesEmoji: "🔓"
|
||||||
|
AddUserEmoji: "➕"
|
||||||
|
RemoveUserEmoji: "➖"
|
||||||
|
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Misc
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Translate:
|
||||||
|
Log: "🚨┃logs"
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
# ___ _ ___ _
|
||||||
|
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||||
|
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||||
|
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||||
|
# |_| |_|
|
||||||
|
#
|
||||||
|
# SupportBot created by Emerald Services
|
||||||
|
# Installed with MIT License
|
||||||
|
#
|
||||||
|
# Discord Support: https://emeraldsrv.dev/discord
|
||||||
|
# Community Resources: https://emeraldsrv.dev/resources
|
||||||
|
|
||||||
|
# -------------------------------
|
||||||
|
# Ticket Panel Configuration
|
||||||
|
# -------------------------------
|
||||||
|
|
||||||
|
Panel: true
|
||||||
|
|
||||||
|
# ----------------------------------------
|
||||||
|
# Ticket Panel Message Configuration #2b2d31
|
||||||
|
# ----------------------------------------
|
||||||
|
|
||||||
|
Channel: "📗┃tickets"
|
||||||
|
# The channel used to create the ticket panel, Use command /ticketpanel to generate it.
|
||||||
|
|
||||||
|
PanelTitle: "SupportBot"
|
||||||
|
PanelColour: "#0cc559"
|
||||||
|
|
||||||
|
Button:
|
||||||
|
Text: "Create Ticket"
|
||||||
|
Emoji: "🎫"
|
||||||
|
Color: "2"
|
||||||
|
|
||||||
|
# Available Button Styles
|
||||||
|
# 1 - Blurple
|
||||||
|
# 2 - Grey
|
||||||
|
# 3 - Red
|
||||||
|
# 4 - Green
|
||||||
|
|
||||||
|
TicketPanel_Description: true
|
||||||
|
TicketPanel_Thumbnail: false
|
||||||
|
TicketPanel_Image: true
|
||||||
|
|
||||||
|
PanelMessage: "Click on the button to file a `Ticket` and our team will try their best to assist you in the best way we can!"
|
||||||
|
PanelThumbnail: "https://i.imgur.com/ieeZejl.png"
|
||||||
|
PanelImage: "https://i.imgur.com/dejQvkg.png"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"tickets": [
|
||||||
|
{}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"TicketPanelID": "0000000000000000000"
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
module.exports = new Event("guildCreate", async (client) => {
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`${client.user.username} is not in the correct server set in your config. Please leave all other servers and restart the bot.`
|
||||||
|
);
|
||||||
|
console.log(`\u001b[31m`, `${client.user.username} will now exit.`);
|
||||||
|
return process.exit(1);
|
||||||
|
});
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
|
||||||
|
module.exports = new Event("guildDelete", async (client) => {
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`${client.user.username} is not in the correct server set in your config. Please join the server and restart the bot.`
|
||||||
|
);
|
||||||
|
console.log(`\u001b[31m`, `${client.user.username} will now exit.`);
|
||||||
|
return process.exit(1);
|
||||||
|
});
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
|
||||||
|
const Discord = require('discord.js');
|
||||||
|
const fs = require("fs");
|
||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const cmdconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/commands.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const msgconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/messages.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = new Event("guildMemberAdd", async (client, member, interaction, guild) => {
|
||||||
|
|
||||||
|
if (supportbot.Welcome.Enabled) {
|
||||||
|
const WelcomeChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.Welcome.Channel)
|
||||||
|
|
||||||
|
const WelcomeEmbed = new Discord.EmbedBuilder()
|
||||||
|
.setColor(msgconfig.Welcome.Embed.Colour)
|
||||||
|
.setTitle(msgconfig.Welcome.Embed.Title)
|
||||||
|
.setDescription(msgconfig.Welcome.Embed.Message.replace(/%joined_user%/g, member.user))
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
if (msgconfig.Welcome.Embed.Thumbnail === "BOT") {
|
||||||
|
WelcomeEmbed.setThumbnail(client.user.displayAvatarURL())
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msgconfig.Welcome.Embed.Thumbnail === "USER") {
|
||||||
|
WelcomeEmbed.setThumbnail(member.user.displayAvatarURL())
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msgconfig.Welcome.Embed.ImageEnabled) {
|
||||||
|
WelcomeEmbed.setImage(msgconfig.Welcome.Embed.ImageURL)
|
||||||
|
}
|
||||||
|
|
||||||
|
WelcomeChannel.send({
|
||||||
|
embeds: [WelcomeEmbed]
|
||||||
|
})
|
||||||
|
|
||||||
|
if (supportbot.Roles.AutoRole.Enabled) {
|
||||||
|
var role = member.guild.roles.cache.find(role => role.name === supportbot.Roles.AutoRole.Role);
|
||||||
|
member.roles.add(role);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`\u001b[32m`, `[+]`, `\u001b[33m`, `${member.user.username} joined the server!`)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
|
||||||
|
const Discord = require('discord.js');
|
||||||
|
const fs = require("fs");
|
||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const cmdconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/commands.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const msgconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/messages.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = new Event("guildMemberRemove", async (client, member, interaction, guild) => {
|
||||||
|
|
||||||
|
if (supportbot.Leave.Enabled) {
|
||||||
|
const LeaveChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.Leave.Channel)
|
||||||
|
|
||||||
|
const LeaveEmbed = new Discord.EmbedBuilder()
|
||||||
|
.setColor(msgconfig.Leave.Embed.Colour)
|
||||||
|
.setTitle(msgconfig.Leave.Embed.Title)
|
||||||
|
.setDescription(msgconfig.Leave.Embed.Message.replace(/%joined_user%/g, member.user))
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
if (msgconfig.Leave.Embed.Thumbnail === "BOT") {
|
||||||
|
LeaveEmbed.setThumbnail(client.user.displayAvatarURL())
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msgconfig.Leave.Embed.Thumbnail === "USER") {
|
||||||
|
LeaveEmbed.setThumbnail(member.user.displayAvatarURL())
|
||||||
|
}
|
||||||
|
|
||||||
|
if (msgconfig.Leave.Embed.ImageEnabled) {
|
||||||
|
LeaveEmbed.setImage(msgconfig.Leave.Embed.ImageURL)
|
||||||
|
}
|
||||||
|
|
||||||
|
LeaveChannel.send({
|
||||||
|
embeds: [LeaveEmbed]
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(`\u001b[31m`, `[-]`, `\u001b[33m`, `${member.user.username} left the server!`)
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
@@ -0,0 +1,278 @@
|
|||||||
|
const fs = require("fs");
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
const msgconfig = yaml.load(fs.readFileSync("./Configs/messages.yml", "utf8"));
|
||||||
|
|
||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
|
||||||
|
let suggestions;
|
||||||
|
try {
|
||||||
|
suggestions = require("../Data/SuggestionData.json");
|
||||||
|
} catch (error) {
|
||||||
|
suggestions = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||||
|
if (interaction.type == Discord.InteractionType.ApplicationCommand) {
|
||||||
|
const command = client.commands.find(
|
||||||
|
(cmd) => cmd.name.toLowerCase() === interaction.commandName
|
||||||
|
);
|
||||||
|
|
||||||
|
if (interaction.user.bot || !interaction.guild) return;
|
||||||
|
|
||||||
|
const NotValid = new Discord.EmbedBuilder()
|
||||||
|
.setDescription(`:x: \`Invalid Command\` `)
|
||||||
|
.setColor(supportbot.Embed.Colours.Error);
|
||||||
|
|
||||||
|
if (!command)
|
||||||
|
return interaction.reply({
|
||||||
|
embeds: [NotValid],
|
||||||
|
});
|
||||||
|
|
||||||
|
const permission = interaction.member.permissions.has(command.permissions);
|
||||||
|
|
||||||
|
const ValidPerms = new Discord.EmbedBuilder()
|
||||||
|
.setDescription(
|
||||||
|
"> :x: `Invalid Permissions` Do you have the correct permissions to execute this command?"
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.Error);
|
||||||
|
|
||||||
|
if (!permission)
|
||||||
|
return interaction.reply({
|
||||||
|
embeds: [ValidPerms],
|
||||||
|
});
|
||||||
|
command.run(interaction);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (interaction.isStringSelectMenu()) {
|
||||||
|
if (interaction.customId === "ticketcontrolpanel") {
|
||||||
|
const selectedOption = interaction.values[0];
|
||||||
|
const { getRole, getChannel } = interaction.client;
|
||||||
|
switch (selectedOption) {
|
||||||
|
case "ticketadduser":
|
||||||
|
const AddUserThreadTicket = new Discord.EmbedBuilder()
|
||||||
|
.setTitle(`${msgconfig.Ticket.AddUserToTicket}`)
|
||||||
|
.setDescription(`${msgconfig.Ticket.AddUserToTicket}`)
|
||||||
|
.setColor(supportbot.Embed.Colours.General);
|
||||||
|
|
||||||
|
await interaction.reply({
|
||||||
|
embeds: [AddUserThreadTicket],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "ticketremoveuser":
|
||||||
|
await removeUserFromThread(interaction);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "ticketclose":
|
||||||
|
const closeCommand = client.commands.get(cmdconfig.CloseTicket.Command);
|
||||||
|
if (closeCommand) {
|
||||||
|
closeCommand.run(interaction);
|
||||||
|
} else {
|
||||||
|
console.error("[X] Close Command Not Found");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "enableinvites":
|
||||||
|
await handleInvites(interaction, true);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "disableinvites":
|
||||||
|
await handleInvites(interaction, false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (interaction.isButton()) {
|
||||||
|
if (interaction.customId === 'createticket') {
|
||||||
|
try {
|
||||||
|
const cmd = client.commands.get(cmdconfig.OpenTicket.Command);
|
||||||
|
if (!cmd) return;
|
||||||
|
cmd.run(interaction);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error executing the ticket command:", error);
|
||||||
|
await interaction.reply({
|
||||||
|
content: "An error occurred while creating the ticket.",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (interaction.customId === "openticket") {
|
||||||
|
try {
|
||||||
|
const cmd = client.commands.get(cmdconfig.OpenTicket);
|
||||||
|
if (!cmd) return;
|
||||||
|
cmd.run(interaction);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (interaction.customId.startsWith('claimticket-')) {
|
||||||
|
const ticketChannelId = interaction.customId.split('-')[1];
|
||||||
|
const ticketChannel = interaction.guild.channels.cache.get(ticketChannelId);
|
||||||
|
if (!ticketChannel) {
|
||||||
|
return interaction.reply({
|
||||||
|
content: "Ticket channel not found.",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const { getRole, getChannel } = interaction.client;
|
||||||
|
const Staff = await getRole(supportbot.Roles.StaffMember.Staff, interaction.guild);
|
||||||
|
const Admin = await getRole(supportbot.Roles.StaffMember.Admin, interaction.guild);
|
||||||
|
|
||||||
|
const RolePerms = new Discord.EmbedBuilder()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(
|
||||||
|
`${msgconfig.Error.IncorrectPerms}\n\nRole Required: \`${supportbot.Roles.StaffMember.Staff}\` or \`${supportbot.Roles.StaffMember.Admin}\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.Warn);
|
||||||
|
|
||||||
|
if (!Staff || !Admin) {
|
||||||
|
return interaction.reply({
|
||||||
|
embeds: [RolePerms],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const NoPermsClaim = new Discord.EmbedBuilder()
|
||||||
|
.setTitle(msgconfig.Ticket.ClaimTickets.NoPermsToClaimTitle)
|
||||||
|
.setDescription(
|
||||||
|
msgconfig.Ticket.ClaimTickets.NoPermsToClaim.replace('%channel%', ticketChannel.name)
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.Error);
|
||||||
|
|
||||||
|
if (!interaction.member.roles.cache.has(Staff.id) && !interaction.member.roles.cache.has(Admin.id)) {
|
||||||
|
return interaction.reply({
|
||||||
|
embeds: [NoPermsClaim],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
await ticketChannel.members.add(interaction.user.id);
|
||||||
|
const pingclaimedstaff = await ticketChannel.send(`<@${interaction.user.id}>`);
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
pingclaimedstaff.delete();
|
||||||
|
}, 2000)
|
||||||
|
|
||||||
|
const TicketData = JSON.parse(fs.readFileSync("./Data/TicketData.json", "utf8"));
|
||||||
|
const ticketIndex = TicketData.tickets.findIndex((t) => t.id === ticketChannelId);
|
||||||
|
if (ticketIndex !== -1) {
|
||||||
|
TicketData.tickets[ticketIndex].claimedBy = interaction.user.id;
|
||||||
|
TicketData.tickets[ticketIndex].claimedAt = new Date().toISOString();
|
||||||
|
fs.writeFileSync("./Data/TicketData.json", JSON.stringify(TicketData, null, 4));
|
||||||
|
}
|
||||||
|
|
||||||
|
const claimMessage = await interaction.message.fetch();
|
||||||
|
const claimedEmbed = new Discord.EmbedBuilder(claimMessage.embeds[0].data)
|
||||||
|
.setTitle(msgconfig.Ticket.ClaimTickets.ClaimedTitle)
|
||||||
|
.setDescription(
|
||||||
|
msgconfig.Ticket.ClaimTickets.ClaimMessage_Edit.replace('%user%', interaction.user.id).replace('%channel%', ticketChannel.id)
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.Success);
|
||||||
|
|
||||||
|
const successfullyClaimed = new Discord.EmbedBuilder()
|
||||||
|
.setTitle(msgconfig.Ticket.ClaimTickets.ClaimedTitle)
|
||||||
|
.setDescription(msgconfig.Ticket.ClaimTickets.Claimed.replace('%channel%', ticketChannel.id))
|
||||||
|
.setColor(supportbot.Embed.Colours.Success);
|
||||||
|
|
||||||
|
await claimMessage.edit({ embeds: [claimedEmbed], components: [] });
|
||||||
|
await interaction.reply({
|
||||||
|
embeds: [successfullyClaimed],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// SUGGESTION INTERACTIONS [START]
|
||||||
|
|
||||||
|
if (interaction.customId === 'upvote' || interaction.customId === 'downvote' || interaction.customId === 'removevote') {
|
||||||
|
const suggestion = suggestions[interaction.message.id];
|
||||||
|
if (!suggestion) return interaction.reply({ content: 'Suggestion not found.', ephemeral: true });
|
||||||
|
|
||||||
|
const userId = interaction.user.id;
|
||||||
|
const hasUpvoted = suggestion.upvotes.includes(userId);
|
||||||
|
const hasDownvoted = suggestion.downvotes.includes(userId);
|
||||||
|
|
||||||
|
if (interaction.customId === 'upvote') {
|
||||||
|
if (hasUpvoted) {
|
||||||
|
suggestion.upvotes = suggestion.upvotes.filter(id => id !== userId);
|
||||||
|
} else {
|
||||||
|
suggestion.upvotes.push(userId);
|
||||||
|
if (hasDownvoted) {
|
||||||
|
suggestion.downvotes = suggestion.downvotes.filter(id => id !== userId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (interaction.customId === 'downvote') {
|
||||||
|
if (hasDownvoted) {
|
||||||
|
suggestion.downvotes = suggestion.downvotes.filter(id => id !== userId);
|
||||||
|
} else {
|
||||||
|
suggestion.downvotes.push(userId);
|
||||||
|
if (hasUpvoted) {
|
||||||
|
suggestion.upvotes = suggestion.upvotes.filter(id => id !== userId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (interaction.customId === 'removevote') {
|
||||||
|
suggestion.upvotes = suggestion.upvotes.filter(id => id !== userId);
|
||||||
|
suggestion.downvotes = suggestion.downvotes.filter(id => id !== userId);
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync("./Data/SuggestionData.json", JSON.stringify(suggestions, null, 2));
|
||||||
|
|
||||||
|
const upvoteCount = suggestion.upvotes.length;
|
||||||
|
const downvoteCount = suggestion.downvotes.length;
|
||||||
|
|
||||||
|
const updatedEmbed = new Discord.EmbedBuilder(interaction.message.embeds[0].data)
|
||||||
|
.setFields([
|
||||||
|
{ name: 'Suggestion', value: suggestion.suggestion, inline: true },
|
||||||
|
{ name: 'From', value: `<@${suggestion.author}>` },
|
||||||
|
{ name: `${supportbot.Suggestions.UpvoteEmoji} ${supportbot.Suggestions.UpvoteTitle}`, value: `${upvoteCount}`, inline: true },
|
||||||
|
{ name: `${supportbot.Suggestions.DownvoteEmoji} ${supportbot.Suggestions.DownvoteTitle}`, value: `${downvoteCount}`, inline: true }
|
||||||
|
]);
|
||||||
|
|
||||||
|
await interaction.update({ embeds: [updatedEmbed] });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async function handleInvites(interaction, enable) {
|
||||||
|
if (supportbot.Ticket.Invites.StaffOnly) {
|
||||||
|
const SupportStaff = await getRole(supportbot.Roles.StaffMember.Staff, interaction.guild);
|
||||||
|
const Admin = await getRole(supportbot.Roles.StaffMember.Admin, interaction.guild);
|
||||||
|
|
||||||
|
if (!SupportStaff || !Admin) {
|
||||||
|
return interaction.reply("Some roles seem to be missing!\nPlease check for errors when starting the bot.");
|
||||||
|
}
|
||||||
|
|
||||||
|
const NoPerms = new Discord.EmbedBuilder()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(
|
||||||
|
`${msgconfig.Error.IncorrectPerms}\n\nRole Required: \`${supportbot.Roles.StaffMember.Staff}\` or \`${supportbot.Roles.StaffMember.Admin}\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.Embed.Colours.Warn);
|
||||||
|
|
||||||
|
if (!interaction.member.roles.cache.has(SupportStaff.id) && !interaction.member.roles.cache.has(Admin.id)) {
|
||||||
|
return interaction.reply({ embeds: [NoPerms] });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await interaction.channel.setInvitable(enable);
|
||||||
|
|
||||||
|
const message = enable ? msgconfig.Ticket.EnableInvites : msgconfig.Ticket.DisableInvites;
|
||||||
|
const embed = new Discord.EmbedBuilder()
|
||||||
|
.setDescription(message)
|
||||||
|
.setColor(supportbot.Embed.Colours.General);
|
||||||
|
|
||||||
|
await interaction.reply({
|
||||||
|
embeds: [embed],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
@@ -0,0 +1,166 @@
|
|||||||
|
const fs = require("fs");
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const axios = require("axios");
|
||||||
|
const { OpenAI } = require('openai');
|
||||||
|
|
||||||
|
// Load configuration files with validation
|
||||||
|
function loadConfig(path) {
|
||||||
|
try {
|
||||||
|
return yaml.load(fs.readFileSync(path, "utf8"));
|
||||||
|
} catch (error) {
|
||||||
|
console.error(`Error loading config file at ${path}:`, error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const supportbotai = yaml.load(fs.readFileSync("./Configs/supportbot-ai.yml"));
|
||||||
|
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
const msgconfig = yaml.load(fs.readFileSync("./Configs/messages.yml", "utf8"));
|
||||||
|
// Validate configuration values
|
||||||
|
function validateConfig(config, keys) {
|
||||||
|
keys.forEach(key => {
|
||||||
|
if (!config[key]) {
|
||||||
|
throw new Error(`Missing configuration key: ${key}`);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const CHANNELS = [supportbotai.Channels.AIChannel];
|
||||||
|
|
||||||
|
// Initialize Discord client
|
||||||
|
const client = new Discord.Client({
|
||||||
|
intents: ['Guilds', 'GuildMembers', 'GuildMessages']
|
||||||
|
});
|
||||||
|
|
||||||
|
// Load custom Event structure
|
||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
|
||||||
|
// Initialize OpenAI client
|
||||||
|
const openai = new OpenAI({
|
||||||
|
apiKey: supportbotai.General.OpenAI_Key,
|
||||||
|
});
|
||||||
|
|
||||||
|
const PASTEBIN_API_KEY = supportbotai.General.PastebinAPI_Key;
|
||||||
|
const PASTEBIN_API_URL = supportbotai.General.PastebinAPI_URL;
|
||||||
|
|
||||||
|
// Function to create a paste on Pastebin
|
||||||
|
async function createPaste(content) {
|
||||||
|
try {
|
||||||
|
const response = await axios.post(PASTEBIN_API_URL, new URLSearchParams({
|
||||||
|
api_dev_key: PASTEBIN_API_KEY,
|
||||||
|
api_option: 'paste',
|
||||||
|
api_paste_code: content,
|
||||||
|
api_paste_private: 1, // 0 = public, 1 = unlisted, 2 = private
|
||||||
|
api_paste_expire_date: '1D', // Expire in 1 day
|
||||||
|
api_paste_format: 'text'
|
||||||
|
}));
|
||||||
|
return response.data;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Pastebin Error:', error);
|
||||||
|
throw error;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Event handler for message creation
|
||||||
|
module.exports = new Event("messageCreate", async (client, message) => {
|
||||||
|
if (message.author.bot || !message.guild) return;
|
||||||
|
if (!CHANNELS.includes(message.channelId) && !message.mentions.users.has(client.user.id)) return;
|
||||||
|
|
||||||
|
if (supportbotai.Enabled) {
|
||||||
|
|
||||||
|
const sendTypingInterval = setInterval(() => {
|
||||||
|
message.channel.sendTyping();
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
|
let conversation = [{
|
||||||
|
role: "system",
|
||||||
|
content: "SupportBot is your friendly neighbourhood support bot."
|
||||||
|
}];
|
||||||
|
|
||||||
|
let prevMessages = await message.channel.messages.fetch({ limit: 10 });
|
||||||
|
prevMessages = prevMessages.reverse().filter(msg => !msg.author.bot || msg.author.id === client.user.id);
|
||||||
|
|
||||||
|
prevMessages.forEach((msg) => {
|
||||||
|
const username = msg.author.username.replace(/\s+/g, '_').replace(/[^\w\s]/gi, '');
|
||||||
|
|
||||||
|
conversation.push({
|
||||||
|
role: msg.author.id === client.user.id ? "assistant" : "user",
|
||||||
|
name: username,
|
||||||
|
content: msg.content,
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
|
const response = await openai.chat.completions.create({
|
||||||
|
model: supportbotai.General.Model,
|
||||||
|
messages: conversation,
|
||||||
|
max_tokens: supportbotai.General.Tokens,
|
||||||
|
});
|
||||||
|
|
||||||
|
clearInterval(sendTypingInterval);
|
||||||
|
|
||||||
|
if (response.choices && response.choices.length > 0) {
|
||||||
|
const replyContent = response.choices[0].message.content;
|
||||||
|
|
||||||
|
const SupportBotAI = new Discord.EmbedBuilder()
|
||||||
|
.setAuthor({ name: supportbotai.General.Name, iconURL: client.user.displayAvatarURL() })
|
||||||
|
.setDescription(replyContent)
|
||||||
|
.setColor(supportbotai.Embed.Color)
|
||||||
|
.setFooter({ text: supportbotai.Embed.Footer, iconURL: message.author.displayAvatarURL() })
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
if (replyContent.length > 2000) {
|
||||||
|
const pasteLink = await createPaste(replyContent);
|
||||||
|
|
||||||
|
const SupportBotAIPastebin = new Discord.EmbedBuilder()
|
||||||
|
.setAuthor({ name: supportbotai.General.Name, iconURL: client.user.displayAvatarURL() })
|
||||||
|
.setDescription(supportbotai.Messages.MessageTooLong.replace("{pastebin}", pasteLink))
|
||||||
|
.setColor(supportbotai.Embed.Color)
|
||||||
|
.setFooter({ text: supportbotai.Embed.Footer, iconURL: message.author.displayAvatarURL() })
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
message.reply({ embeds: [SupportBotAIPastebin] });
|
||||||
|
} else {
|
||||||
|
message.reply({ embeds: [SupportBotAI] });
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
const SupportBotAIErrorResponse = new Discord.EmbedBuilder()
|
||||||
|
.setAuthor({ name: supportbotai.General.Name, iconURL: client.user.displayAvatarURL() })
|
||||||
|
.setDescription(supportbotai.Messages.ErrorResponse)
|
||||||
|
.setColor(supportbotai.Embed.Color)
|
||||||
|
.setFooter({ text: supportbotai.Embed.Footer, iconURL: message.author.displayAvatarURL() })
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
message.reply({ embeds: [SupportBotAIErrorResponse], ephemeral: true });
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
clearInterval(sendTypingInterval);
|
||||||
|
|
||||||
|
const SupportBotAIErrorResponse = new Discord.EmbedBuilder()
|
||||||
|
.setAuthor({ name: supportbotai.General.Name, iconURL: client.user.displayAvatarURL() })
|
||||||
|
.setDescription(supportbotai.Messages.OpenAIError)
|
||||||
|
.setColor(supportbot.Embed.Colours.Error)
|
||||||
|
.setFooter({ text: supportbotai.Embed.Footer, iconURL: message.author.displayAvatarURL() })
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
console.error('OpenAI Error:', error);
|
||||||
|
message.reply({ embeds: [SupportBotAIErrorResponse], ephemeral: true });
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbotai.Enabled === false) {
|
||||||
|
const AIDisabled = new Discord.EmbedBuilder()
|
||||||
|
.setAuthor({ name: supportbotai.General.Name, iconURL: client.user.displayAvatarURL() })
|
||||||
|
.setDescription(supportbotai.Messages.AIDisabled)
|
||||||
|
.setColor(supportbot.Embed.Colours.Error)
|
||||||
|
.setFooter({ text: supportbotai.Embed.Footer, iconURL: message.author.displayAvatarURL() })
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
message.reply({ embeds: [AIDisabled], ephemeral: true })
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
+202
@@ -0,0 +1,202 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Ready Event
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const { Client, GatewayIntentBits, ActivityType } = require('discord.js');
|
||||||
|
const client = new Discord.Client({intents: 32767})
|
||||||
|
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const panelconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/ticket-panel.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const cmdconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/commands.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const msgconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/messages.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
|
||||||
|
let chan1 = client.channels.cache.get(panelconfig.Channel);
|
||||||
|
|
||||||
|
module.exports = new Event("ready", async (client, interaction) => {
|
||||||
|
const { getRole, getChannel, getCategory } = client;
|
||||||
|
|
||||||
|
if (supportbot.Activity.Type === "Playing", "playing") {
|
||||||
|
client.user.setPresence({
|
||||||
|
activities: [{ name: supportbot.Activity.Status, type: Discord.ActivityType.Playing }],
|
||||||
|
status: supportbot.Activity.Type,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.Activity.Type === "Watching", "watching") {
|
||||||
|
client.user.setPresence({
|
||||||
|
activities: [{ name: supportbot.Activity.Status, type: Discord.ActivityType.Watching }],
|
||||||
|
status: supportbot.Activity.Type,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.Activity.Type === "Listening", "listening") {
|
||||||
|
client.user.setPresence({
|
||||||
|
activities: [{ name: supportbot.Activity.Status, type: Discord.ActivityType.Listening }],
|
||||||
|
status: supportbot.Activity.Type,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.Activity.Type === "Competing", "competing") {
|
||||||
|
client.user.setPresence({
|
||||||
|
activities: [{ name: supportbot.Activity.Status, type: Discord.ActivityType.Competing }],
|
||||||
|
status: supportbot.Activity.Type,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`\u001b[32m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||||
|
console.log(` `);
|
||||||
|
console.log(`\u001b[31m`, `┏━━━┓╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓┏━━┓╋╋╋┏┓`);
|
||||||
|
console.log(`\u001b[31m`, `┃┏━┓┃╋╋╋╋╋╋╋╋╋╋╋╋┏┛┗┫┏┓┃╋╋┏┛┗┓`);
|
||||||
|
console.log(`\u001b[31m`, `┃┗━━┳┓┏┳━━┳━━┳━━┳┻┓┏┫┗┛┗┳━┻┓┏┛`);
|
||||||
|
console.log(`\u001b[31m`, `┗━━┓┃┃┃┃┏┓┃┏┓┃┏┓┃┏┫┃┃┏━┓┃┏┓┃┃`);
|
||||||
|
console.log(`\u001b[31m`, `┃┗━┛┃┗┛┃┗┛┃┗┛┃┗┛┃┃┃┗┫┗━┛┃┗┛┃┗┓`);
|
||||||
|
console.log(`\u001b[31m`, `┗━━━┻━━┫┏━┫┏━┻━━┻┛┗━┻━━━┻━━┻━┛`);
|
||||||
|
console.log(`\u001b[31m`, `┗╋╋╋╋╋╋╋┃┃╋┃┃`);
|
||||||
|
console.log(`\u001b[31m`, `╋╋╋╋╋╋╋┗┛╋┗┛`);
|
||||||
|
console.log(` `);
|
||||||
|
console.log(`\u001b[32m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||||
|
console.log(` `);
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`${supportbot.General.Name} | [${supportbot.SupportBot_Version}]`,
|
||||||
|
`\u001b[32m`,
|
||||||
|
`Connected to Discord`,
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(`\u001b[31m`, `SupportBot proudly created by Emerald Development`);
|
||||||
|
|
||||||
|
console.log(` `);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`Discord`,
|
||||||
|
`\u001b[32m`,
|
||||||
|
`https://dsc.gg/emerald-dev`,
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`Website`,
|
||||||
|
`\u001b[32m`,
|
||||||
|
`https://emeraldsrv.com`,
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`Marketplace`,
|
||||||
|
`\u001b[32m`,
|
||||||
|
`https://market.emeraldsrv.com`,
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`Documentation`,
|
||||||
|
`\u001b[32m`,
|
||||||
|
`https://emeraldsrv.com/third-party`,
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(` `);
|
||||||
|
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`Invite URL:`,
|
||||||
|
`\u001b[36m`,
|
||||||
|
`https://discord.com/api/oauth2/authorize?client_id=` +
|
||||||
|
client.user.id +
|
||||||
|
`&permissions=8&scope=bot%20applications.commands`
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(` `);
|
||||||
|
console.log(`\u001b[32m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||||
|
|
||||||
|
const roles = [
|
||||||
|
supportbot.Roles.StaffMember.Admin,
|
||||||
|
supportbot.Roles.StaffMember.Staff,
|
||||||
|
supportbot.Roles.ModRoles.Blacklisted,
|
||||||
|
supportbot.Roles.ModRoles.Muted
|
||||||
|
];
|
||||||
|
|
||||||
|
supportbot.Departments.forEach((department) => roles.push(department.role));
|
||||||
|
|
||||||
|
if (supportbot.Roles.AutoRole.Role) roles.push(supportbot.Roles.AutoRole.Role);
|
||||||
|
|
||||||
|
const channels = [
|
||||||
|
supportbot.Suggestions.Channel,
|
||||||
|
supportbot.Ticket.Log.TicketLog,
|
||||||
|
supportbot.Ticket.Log.TranscriptLog,
|
||||||
|
panelconfig.Channel,
|
||||||
|
supportbot.Welcome.Channel,
|
||||||
|
supportbot.Leave.Channel,
|
||||||
|
supportbot.Translate.Log
|
||||||
|
];
|
||||||
|
//const categories = [supportbot.TicketCategory];
|
||||||
|
|
||||||
|
if (!channels) {
|
||||||
|
console.log("\u001b[31m", `[MISSING CHANNEL]`, `\u001b[37;1m`, `${channels}`, "\u001b[31m", `channel not found. Please check your config file.`);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// else {
|
||||||
|
// console.log(`\u001b[32m`, `[CHANNEL LOCATED]`, `\u001b[37;1m`, `${channels}`, `\u001b[32;1m`, `channel has been found.`);
|
||||||
|
// }
|
||||||
|
|
||||||
|
const missingC = [];
|
||||||
|
const missingR = [];
|
||||||
|
const missingCat = [];
|
||||||
|
|
||||||
|
for (let r of roles) {
|
||||||
|
const find = await getRole(r, client.guilds.cache.first());
|
||||||
|
if (!find) missingR.push(r);
|
||||||
|
}
|
||||||
|
// for (let cat of categories) {
|
||||||
|
// const find = await getCategory(cat, client.guilds.cache.first());
|
||||||
|
// if (!find) missingCat.push(cat);
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (missingR.length > 0) {
|
||||||
|
console.log(
|
||||||
|
"\u001b[31m",
|
||||||
|
`[MISSING CONFIGURATION]`,
|
||||||
|
"\u001b[33m",
|
||||||
|
`The following Roles could not be found in your server.\n`, `\u001b[31m`, `[${missingR.join(
|
||||||
|
", "
|
||||||
|
)}]`, `\n `,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (missingC.length > 0) {
|
||||||
|
console.log(
|
||||||
|
"\u001b[31m",
|
||||||
|
`[MISSING CONFIGURATION]`,
|
||||||
|
"\u001b[33m",
|
||||||
|
`The following Channels could not be found in your server.\n`, `\u001b[31m`, `[${missingC.join(
|
||||||
|
", "
|
||||||
|
)}]`, `\n `
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (missingCat.length > 0) {
|
||||||
|
console.log(
|
||||||
|
"\u001b[31m",
|
||||||
|
`[MISSING CONFIGURATION]`,
|
||||||
|
"\u001b[33m",
|
||||||
|
`The following Categories could not be found in your server.\n`, `\u001b[31m`, `[${missingCat.join(
|
||||||
|
", "
|
||||||
|
)}]`, `\n `,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2022 Emerald Services
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -1,135 +1,88 @@
|
|||||||
<h1 align="center">SupportBot v4.0.1</h1>
|
<h1 align="center">
|
||||||
<h4 align="center">A Self Hosted discord application</h4>
|
<br>
|
||||||
|
<a href="https://github.com/Emerald-Services/SupportBot"><img src="https://i.imgur.com/cuadAYv.png"></a>
|
||||||
|
<br>
|
||||||
|
SupportBot
|
||||||
|
<br>
|
||||||
|
</h1>
|
||||||
|
|
||||||
|
<div align="center">
|
||||||
|
|
||||||
|
<a href="https://opensource.org/licenses/MIT">
|
||||||
|
<img src="https://img.shields.io/badge/license-MIT-green?style=for-the-badge" alt="shield.png">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://github.com/discordjs">
|
||||||
|
<img src="https://img.shields.io/badge/discord.js-v13.6.x-blue.svg?style=for-the-badge&logo=javascript.svg" alt="shield.png">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://github.com/nodejs/node">
|
||||||
|
<img src="https://img.shields.io/badge/node.js-v16.14.x-green.svg?style=for-the-badge&logo=node" alt="shield.png">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
<a href="https://github.com/Emerald-Services/SupportBot/releases">
|
||||||
|
<img src="https://img.shields.io/github/downloads/Emerald-Services/SupportBot/total?style=for-the-badge" alt="shield.png">
|
||||||
|
</a>
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
| SupportBot | Node.JS | Discord.JS | Supported |
|
||||||
|
|------------|---------|------------|------------|
|
||||||
|
| 8.x | 20.x | 14.x. | ✅ Yes
|
||||||
|
| 7.7.3 | 16.x | 13.x. | ✅ Yes
|
||||||
|
| 7.x | 16.x | 13.x. | ❌ No
|
||||||
|
| 6.x | 14.x | 13.x. | ❌ No
|
||||||
|
| 5.x | 12.x | 13.x. | ❌ No
|
||||||
|
| 4.x | 11.x | 13.x. | ❌ No
|
||||||
|
| Older | 10.x | 13.x. | ❌ No
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<a href="https://discord.gg/hmWgxdF">
|
<a href="https://emeraldsrv.com/">Website</a>
|
||||||
<img src="https://discordapp.com/api/guilds/516345301985132552/widget.png?style=shield" alt="Discord Server">
|
•
|
||||||
</a>
|
<a href="https://github.com/Emerald-Services/SupportBot/wiki">Wiki</a>
|
||||||
<img src="https://img.shields.io/badge/Made%20with-NodeJS-blue.svg" alt="Made with NodeJS">
|
<br>
|
||||||
<img src="https://img.shields.io/github/release/EmeraldRusher/SupportBot.svg" alt="GitHub release">
|
<a href="#about">About</a>
|
||||||
<img src="https://img.shields.io/github/package-json/dependency-version/EmeraldRusher/SupportBot/discord.js.svg" alt="GitHub package.json dependency version (prod)">
|
•
|
||||||
|
<a href="#support">Support</a>
|
||||||
|
•
|
||||||
|
<a href="#license">License</a>
|
||||||
|
•
|
||||||
|
<a href="https://github.com/Emerald-Services/SupportBot/wiki/Third-Party-Developer">Third-Party</a>
|
||||||
|
•
|
||||||
|
<a href="#contributors">Contributors</a>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
SupportBot is a free & open source discord bot for your server that has the capability to control & manage your servers support.
|
## About
|
||||||
|
|
||||||
| Version | Supported | Status |
|
SupportBot is an Open-Source discord bot built with [discord.js](https://github.com/discordjs/discord.js). It's primarily focused to help servers organise and manage their support system in a unique way with full customisation to match your brand.
|
||||||
| ------- | ------------------ |--------------------|
|
|
||||||
| 1.x | 🚫 | Discontinued |
|
|
||||||
| 2.x | 🚫 | Discontinued |
|
|
||||||
| 3.x | ✔️ | Supported |
|
|
||||||
| 4.x | ✔️ | Supported |
|
|
||||||
| Premium | ❌ | Not released yet |
|
|
||||||
|
|
||||||
# Getting Started
|
## Support
|
||||||
Firstly you will need to download the resource, Once you have downloaded the resource open a new tab in your browser and go to https://discordapp.com/developers/applications/. Create a new application and then open your app and select bot and then create your bot. Copy the bot token and paste it where it says ``"token": "BOT TOKEN HERE",`` in the ``settings.json`` file.
|
|
||||||
|
|
||||||
# Invite the bot
|
<a href="https://emeraldsrv.com/discord">
|
||||||
Head back to discord developers portal where your application is and head into the ``OAuth`` tab and select bot and then below select ``Administrator`` then copy the link and paste into your browser and it should as your to invite the bot to a server.
|
<img alt="Discord" src="https://img.shields.io/discord/597779408295821323?logo=discord&logoColor=white&style=for-the-badge">
|
||||||
|
</a>
|
||||||
|
|
||||||
# Help
|
|
||||||
If you don't understand something, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [Emerald Services Server](https://discord.gg/u47MQJ).
|
|
||||||
|
|
||||||
# Configurating SupportBot
|
## License
|
||||||
Once you have setup your discord application such as invited the bot and added your bot token to the ``settings.json`` we can begin configurating your bot. Firstly open up the ``settings.json`` file and you will see loads of different things to config. You will see the following below:
|
|
||||||
|
|
||||||
```
|
Released under the [MIT](https://opensource.org/licenses/MIT) license.
|
||||||
{
|
|
||||||
"SupportBot": "v4.0.0",
|
|
||||||
|
|
||||||
"token": "BOT_TOKEN_HERE",
|
|
||||||
"prefix": "!",
|
|
||||||
"botname": "SupportBot",
|
|
||||||
"colour": "#13bd2a",
|
|
||||||
"footer": "Support Bot, By Emerald Services",
|
|
||||||
|
|
||||||
"BotStatus": "Support Bot",
|
|
||||||
|
|
||||||
"staff": "Staff",
|
|
||||||
"support": "Support",
|
|
||||||
"everyone": "@everyone",
|
|
||||||
"Auto_Role": "Member",
|
|
||||||
|
|
||||||
"LINKS": {
|
|
||||||
"Discord": "https://discord.gg/",
|
|
||||||
"Twitter": "https://twitter.com/",
|
|
||||||
"Website": "https://example.com/",
|
|
||||||
"AddMore": "AddMoreIfYouWant"
|
|
||||||
},
|
|
||||||
|
|
||||||
"LINKS_TITLE": "SupportBot Links",
|
|
||||||
|
|
||||||
"category": "Tickets",
|
|
||||||
"Ticket_Message": "Your support ticket has been opened successfully\nPlease allow us some time to reach out to you.",
|
|
||||||
"Ticket_Logs": "ticket-logs",
|
|
||||||
"Default_Ticket_Reason": "No Subject",
|
|
||||||
"Ticket_React_Message": ":mailbox: React to create your support ticket.",
|
|
||||||
|
|
||||||
"Commands_Log_Title": "SupportBot Logs",
|
|
||||||
"Command_Log_Channel": "command-logs",
|
|
||||||
|
|
||||||
"Announcement_Title": "SupportBot Announcement",
|
## Third-Party
|
||||||
"Announcement_Channel": "announcements",
|
|
||||||
"Announcement_Tag_Role": "@everyone",
|
|
||||||
|
|
||||||
"Welcome_Message": "Welcome to the server!",
|
|
||||||
"Welcome_Channel": "welcome",
|
|
||||||
|
|
||||||
"Leave_Message": "Thank you for visiting us!",
|
|
||||||
"Leave_Channel": "welcome",
|
|
||||||
|
|
||||||
"Poll_Channel": "polls",
|
- [Official addons repository](https://github.com/Emerald-Services/Addons/)
|
||||||
"Poll_Title": "📊 Polls",
|
- [Syphers Addons](https://github.com/SypherRed/SB_Addons_Unofficial)
|
||||||
"Reaction_Poll_1": "✅",
|
- [BuiltByBit](https://builtbybit.com/supportbot)
|
||||||
"Reaction_Poll_2": "❎",
|
- [Polymart](https://polymart.org/resource/supportbot-1-discord-ticket-bot.518)
|
||||||
|
|
||||||
"Suggestion_Title": "SupportBot Suggestions",
|
|
||||||
"Suggestion_Channel": "suggestions",
|
|
||||||
"suggestyes": "✅",
|
|
||||||
"suggestno": "❎",
|
|
||||||
|
|
||||||
"Report_Channel": "reports",
|
|
||||||
"Report_Title": "SupportBot Report",
|
|
||||||
|
|
||||||
|
|
||||||
"Announcement_Command": "announce",
|
|
||||||
"Say_Command": "say",
|
|
||||||
"Suggest_Command": "suggest",
|
|
||||||
"Ping_Command": "ping",
|
|
||||||
"Ticket_Command": "ticket",
|
|
||||||
"Remove_Command": "remove",
|
|
||||||
"Add_Command": "add",
|
|
||||||
"Close_Command": "close",
|
|
||||||
"Forceclose_Command": "forceclose",
|
|
||||||
"Rename_Command": "rename",
|
|
||||||
"Help_Command": "help",
|
|
||||||
"Link_Command": "links",
|
|
||||||
"Lockchat_Command": "lock",
|
|
||||||
"UnLockchat_Command": "unlock",
|
|
||||||
"Poll_Command": "poll",
|
|
||||||
"Report_Command": "report"
|
|
||||||
}
|
|
||||||
|
|
||||||
```
|
## Contributors
|
||||||
|
|
||||||
|
<a href="https://github.com/Emerald-Services/SupportBot/graphs/contributors">
|
||||||
|
<img src="https://contrib.rocks/image?repo=Emerald-Services/SupportBot">
|
||||||
|
</a>
|
||||||
|
|
||||||
# Contributors List
|
|
||||||
<p>
|
|
||||||
<a href="https://github.com/iJosGCS">
|
|
||||||
<img src="https://cdn.discordapp.com/avatars/199237487648833556/cdd7d976b75698b19e3c6b64e1dcdceb.png?size=32" alt="iJosGCS Profile">
|
|
||||||
<strong>@iJosGCS</strong>
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="https://github.com/RedstoneGamez">
|
|
||||||
<img src="https://cdn.discordapp.com/avatars/282610987801247744/9567e0674a5a6d371bb5d6efb956d57b.png?size=32" alt="RedstoneGamez Profile">
|
|
||||||
<strong>@RedstoneGamez</strong>
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
# Donators List
|
|
||||||
|
|
||||||
# Community
|
|
||||||
<p align="center">
|
|
||||||
<a href="https://discord.gg/hmWgxdF">
|
|
||||||
<img src="https://discordapp.com/api/guilds/516345301985132552/widget.png?style=banner1" alt="Discord Server">
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
+20
@@ -0,0 +1,20 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Supported Versions
|
||||||
|
|
||||||
|
Use this section to tell people about which versions of your project are
|
||||||
|
currently being supported with security updates.
|
||||||
|
|
||||||
|
| Version | Supported |
|
||||||
|
| ------- | ------------------ |
|
||||||
|
| 7.7.2 | :white_check_mark: |
|
||||||
|
| 7.7.1 | :white_check_mark: |
|
||||||
|
| < 4.0 | :x: |
|
||||||
|
|
||||||
|
## Reporting a Vulnerability
|
||||||
|
|
||||||
|
Use this section to tell people how to report a vulnerability.
|
||||||
|
|
||||||
|
Tell them where to go, how often they can expect to get an update on a
|
||||||
|
reported vulnerability, what to expect if the vulnerability is accepted or
|
||||||
|
declined, etc.
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Addon Structure
|
||||||
|
|
||||||
|
class Command {
|
||||||
|
constructor(options) {
|
||||||
|
this.name = options.name;
|
||||||
|
this.description = options.description;
|
||||||
|
this.permissions = options.permissions;
|
||||||
|
this.options = options.options || [];
|
||||||
|
this.run = options.run;
|
||||||
|
this.defaultPermission = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class Event {
|
||||||
|
constructor(event, run) {
|
||||||
|
this.event = event;
|
||||||
|
this.run = run;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { Command, Event };
|
||||||
@@ -0,0 +1,179 @@
|
|||||||
|
// C:\Users\ollie\Documents\GitHub\SupportBot\Structures\Client.js
|
||||||
|
|
||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Client Structure
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const { GatewayIntentBits, Partials } = require('discord.js');
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
|
||||||
|
const supportbot = yaml.load(fs.readFileSync("./Configs/supportbot.yml", "utf8"));
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
class Client extends Discord.Client {
|
||||||
|
constructor() {
|
||||||
|
super({
|
||||||
|
intents: [
|
||||||
|
GatewayIntentBits.Guilds,
|
||||||
|
GatewayIntentBits.GuildMembers,
|
||||||
|
GatewayIntentBits.GuildMessages
|
||||||
|
],
|
||||||
|
partials: [Partials.Channel]
|
||||||
|
});
|
||||||
|
|
||||||
|
this.commands = new Discord.Collection();
|
||||||
|
}
|
||||||
|
|
||||||
|
async getChannel(channel, guild) {
|
||||||
|
if (!channel) return null; // Add check for undefined channel
|
||||||
|
return guild.channels.cache.find(
|
||||||
|
(c) =>
|
||||||
|
(c.type === Discord.ChannelType.GuildText || c.type === Discord.ChannelType.GuildNews) &&
|
||||||
|
(c.id === channel || (c.name && c.name.toLowerCase() === channel.toLowerCase()))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getRole(role, guild) {
|
||||||
|
if (!role) return null; // Add check for undefined role
|
||||||
|
return guild.roles.cache.find(
|
||||||
|
(r) => r.id === role || (r.name && r.name.toLowerCase() === role.toLowerCase())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async getCategory(category, guild) {
|
||||||
|
if (!category) return null; // Add check for undefined category
|
||||||
|
return guild.channels.cache.find(
|
||||||
|
(c) =>
|
||||||
|
c.type === Discord.ChannelType.GuildCategory &&
|
||||||
|
(c.id === category || (c.name && c.name.toLowerCase() === category.toLowerCase()))
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async start(token) {
|
||||||
|
let tempCommandFiles = fs.readdirSync("./Commands").filter((file) => file.endsWith(".js"));
|
||||||
|
|
||||||
|
if (cmdconfig.Suggestion.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "suggest.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.Help.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "help.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.Info.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "info.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.OpenTicket.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "ticket.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.CloseTicket.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "close.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.Embed.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "embed.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.Translate.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "translate.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.UserInfo.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "userinfo.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.Ping.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "Ping.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.Ping.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "Ping.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.Ticket.ClaimTickets.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "ticketstats.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
const commandFiles = tempCommandFiles;
|
||||||
|
const commands = commandFiles.map((file) => require(`../Commands/${file}`));
|
||||||
|
|
||||||
|
// Commands
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
|
commands.forEach((cmd) => {
|
||||||
|
console.log(`\u001b[32m`, `[CMD]`, `\u001b[37;1m`, `${cmd.name}`, `\u001b[32;1m`, "Loaded");
|
||||||
|
this.commands.set(cmd.name, cmd);
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
|
if (supportbot.General.Addons.Enabled) {
|
||||||
|
const addonFiles = fs.readdirSync("./Addons").filter((file) => file.endsWith(".js"));
|
||||||
|
|
||||||
|
const addons = addonFiles.map((file) => {
|
||||||
|
let addon = require(`../Addons/${file}`);
|
||||||
|
addon.name = file.split(".")[0];
|
||||||
|
return addon;
|
||||||
|
});
|
||||||
|
|
||||||
|
// Addons
|
||||||
|
console.log(" ");
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
|
addons.forEach((addon) => {
|
||||||
|
console.log(
|
||||||
|
`\u001b[32m`,
|
||||||
|
`[ADDON]`,
|
||||||
|
`\u001b[37;1m`,
|
||||||
|
`${addon.name}`,
|
||||||
|
`\u001b[32;1m`,
|
||||||
|
"Loaded"
|
||||||
|
);
|
||||||
|
addon.commands?.forEach((command) => {
|
||||||
|
this.commands.set(command.name, command);
|
||||||
|
});
|
||||||
|
addon.events?.forEach((event) => {
|
||||||
|
this.on(event.event, (...args) => event.run(this, ...args));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Slash Commands
|
||||||
|
|
||||||
|
this.once("ready", async () => {
|
||||||
|
await this.guilds.cache.first()?.commands.set(this.commands);
|
||||||
|
console.log(
|
||||||
|
"\u001b[32m",
|
||||||
|
`[SUCCESS]`,
|
||||||
|
`\u001b[37;1m`,
|
||||||
|
`Slash Commands Registered for ${this.guilds.cache.first().name}`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(" ");
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
|
fs.readdirSync("./Events").filter((file) => file.endsWith(".js")).forEach((file) => {
|
||||||
|
const event = require(`../Events/${file}`);
|
||||||
|
console.log(`\u001b[32m`, `[EVENT]`, `\u001b[37;1m`, `${event.event}`, `\u001b[32;1m`, "Loaded");
|
||||||
|
this.on(event.event, (...args) => event.run(this, ...args));
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
|
||||||
|
if (process.argv[2] !== "test") {
|
||||||
|
await this.login(token);
|
||||||
|
} else {
|
||||||
|
console.log(
|
||||||
|
`\u001b[31;1m`,
|
||||||
|
"RUNNING IN TEST MODE, IF NOT INTENDED, PLEASE USE npm start"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Client;
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Command Structure
|
||||||
|
|
||||||
|
class Command {
|
||||||
|
constructor(options) {
|
||||||
|
this.name = options.name;
|
||||||
|
this.description = options.description;
|
||||||
|
this.permissions = options.permissions || [];
|
||||||
|
this.options = options.options || [];
|
||||||
|
this.run = options.run;
|
||||||
|
this.defaultPermission = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports = Command;
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Event Structure
|
||||||
|
class Event {
|
||||||
|
constructor(event, run) {
|
||||||
|
this.event = event;
|
||||||
|
this.run = run;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Event;
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Ticket ID Structure
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
class TicketNumberID {
|
||||||
|
static async pad() {
|
||||||
|
let num = await this.get();
|
||||||
|
let n = num + "";
|
||||||
|
await this.set(num + 1);
|
||||||
|
return n.length >= 4 ? n : new Array(4 - n.length + 1).join("0") + n;
|
||||||
|
}
|
||||||
|
|
||||||
|
static async get() {
|
||||||
|
let ticketnumberID = await JSON.parse(
|
||||||
|
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
||||||
|
);
|
||||||
|
if (!ticketnumberID.id) {
|
||||||
|
return this.set(0);
|
||||||
|
} else {
|
||||||
|
return ticketnumberID.id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static async set(value) {
|
||||||
|
let ticketnumberID = await JSON.parse(
|
||||||
|
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
ticketnumberID.id = value;
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/ticket-panel-id.json",
|
||||||
|
JSON.stringify(ticketnumberID, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
static async reset() {
|
||||||
|
return await this.set(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = TicketNumberID;
|
||||||
@@ -1 +0,0 @@
|
|||||||
theme: jekyll-theme-cayman
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Add User
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
module.exports.run = async (bot, message, args) => {
|
|
||||||
message.delete()
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Add_Command}`)
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.staff)
|
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
|
||||||
|
|
||||||
const outsideticket = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
|
|
||||||
|
|
||||||
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
|
|
||||||
|
|
||||||
const cantfinduser = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Hmm! Does that user exist? I cannot find the user.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if(!rUser) return message.channel.send({embed: cantfinduser});
|
|
||||||
|
|
||||||
const channel = message.guild.channels.find(channel => channel.name === message.channel.name);
|
|
||||||
|
|
||||||
const cantfindchannel = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Hmm! Does that ticket exist? I cannot find the ticket channel.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if(!channel) return message.channel.send({embed: cantfindchannel});
|
|
||||||
message.delete().catch(O_o=>{});
|
|
||||||
|
|
||||||
message.channel.overwritePermissions(rUser, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
|
||||||
|
|
||||||
const useradded = new Discord.RichEmbed()
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setDescription(`:white_check_mark: Successfully Added ${rUser} to the ticket.`)
|
|
||||||
.setTimestamp();
|
|
||||||
|
|
||||||
message.channel.send({embed: useradded});
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has successfully added ${rUser} to ${message.channel}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Add_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Add_Command,
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Say
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = async(bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
|
||||||
.setTitle(`${bot.settings.Announcement_Title}`)
|
|
||||||
.setDescription(args.join(" "))
|
|
||||||
.setTimestamp()
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
|
|
||||||
|
|
||||||
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${bot.settings.Announcement_Channel}`)
|
|
||||||
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Announcement_Channel}**`)
|
|
||||||
|
|
||||||
ac.send("@everyone").then((msg) => {
|
|
||||||
ac.send(embed);
|
|
||||||
});
|
|
||||||
|
|
||||||
const SuggestionSuccessEmbed = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:white_check_mark: You have successfully created an announcement. <#${ac.id}>`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
message.channel.send(SuggestionSuccessEmbed);
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Announcement_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Announcement_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Announcement_Command,
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Close Ticket
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
const outsideticket = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
|
|
||||||
const close1 = new Discord.RichEmbed()
|
|
||||||
.setDescription(`Looks like you have come to the end of your support ticket\nPlease confirm that you want to close your ticket by saying ||**confirm**||`)
|
|
||||||
.setFooter("Your request will be avoided in 20 seconds")
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
message.channel.send({embed: close1}).then(m => {
|
|
||||||
message.channel.awaitMessages(response => response.content === `confirm`, {
|
|
||||||
max: 1,
|
|
||||||
time: 10000,
|
|
||||||
errors: ['time'],
|
|
||||||
|
|
||||||
}).then((collected) => {
|
|
||||||
message.channel.delete();
|
|
||||||
|
|
||||||
}).catch(() => {
|
|
||||||
m.edit('Close ticket request, timedout').then(m2 => {
|
|
||||||
m2.delete();
|
|
||||||
}, 3000);
|
|
||||||
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Close_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Close_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Close_Command,
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Forceclose Ticket
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
|
||||||
|
|
||||||
const outsideticket = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
|
|
||||||
message.channel.delete();
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Forceclose_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Forceclose_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Forceclose_Command,
|
|
||||||
}
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Help
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let userCommands = "";
|
|
||||||
userCommands += `**${bot.settings.prefix}${bot.settings.Link_Command}**: Get some important links!\n`;
|
|
||||||
userCommands += `**${bot.settings.prefix}${bot.settings.Ping_Command}**: Check the bots ping. Pong!\n`;
|
|
||||||
userCommands += `**${bot.settings.prefix}${bot.settings.Ticket_Command} <reason>**: Create a support ticket\n`;
|
|
||||||
userCommands += `**${bot.settings.prefix}${bot.settings.Close_Command}**: Close your support ticket\n`;
|
|
||||||
userCommands += `**${bot.settings.prefix}${bot.settings.Suggest_Command} <suggestion>**: Create a server suggestion\n`;
|
|
||||||
userCommands += `**${bot.settings.prefix}${bot.settings.Report_Command} <user> <reason>**: Create a server suggestion\n`;
|
|
||||||
|
|
||||||
let supportCommands = "";
|
|
||||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Add_Command} <user>**: Adds a user to a ticket\n`;
|
|
||||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Remove_Command} <user>**: Removes a user from a ticket\n`;
|
|
||||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Forceclose_Command}**: Forceclose a support ticket\n`;
|
|
||||||
supportCommands += `**${bot.settings.prefix}${bot.settings.Rename_Command}**: Rename a support ticket\n`;
|
|
||||||
|
|
||||||
let staffCommands = "";
|
|
||||||
staffCommands += `**${bot.settings.prefix}${bot.settings.Announcement_Command} <message>**: Create a bot announcement\n`;
|
|
||||||
staffCommands += `**${bot.settings.prefix}${bot.settings.Say_Command} <message>**: Send a message as the bot\n`;
|
|
||||||
staffCommands += `**${bot.settings.prefix}${bot.settings.Lockchat_Command}**: Lock the chat channel\n`;
|
|
||||||
staffCommands += `**${bot.settings.prefix}${bot.settings.UnLockchat_Command}**: UnLock the chat channel\n`;
|
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.botname)
|
|
||||||
.addField(":ticket: Support Commands", userCommands)
|
|
||||||
.addField(":pushpin: Support Commands", supportCommands, true)
|
|
||||||
.addField(":pushpin: Staff Commands", staffCommands, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer, message.author.displayAvatarURL);
|
|
||||||
|
|
||||||
message.channel.send(embed)
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Help_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Help_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via settings.json`);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Help_Command,
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Help
|
|
||||||
|
|
||||||
const Discord = require( "discord.js" );
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require( "../settings.json" );
|
|
||||||
|
|
||||||
exports.run = ( bot, message, args ) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let botLinks = bot.settings.LINKS;
|
|
||||||
|
|
||||||
let links = '';
|
|
||||||
|
|
||||||
for ( let name in botLinks ) {
|
|
||||||
links += `[${name}](${botLinks[ name ]})\n`;
|
|
||||||
}
|
|
||||||
|
|
||||||
let embed = new Discord.RichEmbed()
|
|
||||||
.setTitle( bot.settings.LINKS_TITLE )
|
|
||||||
.setDescription( links )
|
|
||||||
.setColor( bot.settings.colour )
|
|
||||||
.setFooter( bot.settings.footer )
|
|
||||||
|
|
||||||
message.channel.send( embed );
|
|
||||||
|
|
||||||
console.log( `\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Link_Command}` )
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Link_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Link_Command,
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Lockchat
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = async(bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
|
||||||
let lockedRole = message.guild.roles.find(lc => lc.name === `${bot.settings.locked_role}`)
|
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
|
||||||
|
|
||||||
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: false, SEND_MESSAGES: false });
|
|
||||||
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
|
||||||
|
|
||||||
const lockmsg = new Discord.RichEmbed()
|
|
||||||
.setDescription(":white_check_mark: **Chat Locked**")
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
message.channel.send(lockmsg)
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Lockchat_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Lockchat_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Lockchat_Command,
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Ping
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:ping_pong: **Pong!** \`${bot.ping}ms\` `)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
message.channel.send(embed).catch(console.error);
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Ping_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Ping_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Ping_Command,
|
|
||||||
}
|
|
||||||
@@ -1,60 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Poll
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
|
||||||
.setTitle(`${bot.settings.Poll_Title}`)
|
|
||||||
.setDescription(args.join(" "))
|
|
||||||
.setTimestamp()
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer, message.author.displayAvatarURL)
|
|
||||||
|
|
||||||
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${bot.settings.Poll_Channel}`)
|
|
||||||
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Poll_Channel}**`)
|
|
||||||
|
|
||||||
ac.send(embed)
|
|
||||||
|
|
||||||
.then(async function(msg) {
|
|
||||||
msg.react(bot.settings.Reaction_Poll_1).then(() => msg.react(bot.settings.Reaction_Poll_2));
|
|
||||||
});
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Poll_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Close_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Poll_Command,
|
|
||||||
}
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Remove User
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
module.exports.run = async (bot, message, args) => {
|
|
||||||
message.delete()
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Add_Command}`)
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.staff)
|
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
|
||||||
|
|
||||||
const outsideticket = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
|
|
||||||
|
|
||||||
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
|
|
||||||
|
|
||||||
const cantfinduser = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Hmm! Does that user exist? I cannot find the user.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if(!rUser) return message.channel.send({embed: cantfinduser});
|
|
||||||
|
|
||||||
const channel = message.guild.channels.find(channel => channel.name === message.channel.name);
|
|
||||||
|
|
||||||
const cantfindchannel = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Hmm! Does that ticket exist? I cannot find the ticket channel.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if(!channel) return message.channel.send({embed: cantfindchannel});
|
|
||||||
message.delete().catch(O_o=>{});
|
|
||||||
|
|
||||||
message.channel.overwritePermissions(rUser, { READ_MESSAGES: false, SEND_MESSAGES: false });
|
|
||||||
|
|
||||||
const useradded = new Discord.RichEmbed()
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setDescription(`:white_check_mark: Successfully remove ${rUser} from the ticket.`)
|
|
||||||
.setTimestamp();
|
|
||||||
|
|
||||||
message.channel.send({embed: useradded});
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has successfully removed ${rUser} from ${message.channel}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Remove_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Remove_Command,
|
|
||||||
}
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Close Ticket
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === bot.settings.staff)
|
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply({embed: donothaverole});
|
|
||||||
|
|
||||||
const outsideticket = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.channel.name.startsWith(`ticket-`)) return message.channel.send({embed: outsideticket});
|
|
||||||
const renameto = args.join(" ")
|
|
||||||
message.channel.setName(`ticket-${renameto}-${message.author.username}`)
|
|
||||||
|
|
||||||
// Renamed Ticket Logistic
|
|
||||||
const logEmbed = new Discord.RichEmbed()
|
|
||||||
.setTitle(":ticket: Ticket Renamed")
|
|
||||||
.setDescription(`<@${message.author.id}> has renamed a ticket to ${renameto}`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${bot.settings.Ticket_Logs}`);
|
|
||||||
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Ticket_Logs}**`);
|
|
||||||
|
|
||||||
logChannel.send({embed: logEmbed})
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Rename_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Rename_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Rename_Command,
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Report
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`);
|
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour);
|
|
||||||
|
|
||||||
if(!staffGroup) {
|
|
||||||
message.reply(rolemissing).catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if(!message.member.roles.has(staffGroup.id)) {
|
|
||||||
message.reply(donothaverole);
|
|
||||||
} else {
|
|
||||||
if(!args[0]) {
|
|
||||||
message.reply(":x: Sorry! Please specify the user to report.");
|
|
||||||
} else {
|
|
||||||
if(!args[1]) {
|
|
||||||
message.reply(":x: Sorry! Specify the reason of your report.");
|
|
||||||
} else {
|
|
||||||
let reportDesc = args.slice(1).join(" ");
|
|
||||||
const embed = new Discord.RichEmbed()
|
|
||||||
.setTitle(`${bot.settings.Report_Title}`)
|
|
||||||
.setThumbnail(message.author.avatarURL)
|
|
||||||
.addField("Report by:", `<@${message.author.id}>`, false)
|
|
||||||
.addField("Description:", `${reportDesc}`, false)
|
|
||||||
.addField("Reported User:", `${args[0]}`, false)
|
|
||||||
.setTimestamp(new Date())
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL);
|
|
||||||
let rc = message.guild.channels.find(ReportChannel => ReportChannel.name === `${bot.settings.Report_Channel}`)
|
|
||||||
if(!rc) {
|
|
||||||
message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Report_Channel}**`);
|
|
||||||
} else {
|
|
||||||
rc.send(embed);
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Report_Command}`);
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Report_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Report_Command
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Say
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
|
||||||
.setTitle(`${bot.settings.Announcement_Title}`)
|
|
||||||
.setDescription(args.join(" "))
|
|
||||||
.setTimestamp()
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
|
|
||||||
|
|
||||||
message.channel.send(embed);
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Say_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Say_Command, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Say_Command,
|
|
||||||
}
|
|
||||||
@@ -1,294 +0,0 @@
|
|||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = async (bot, message, args) => {
|
|
||||||
if (message.guild.owner === message.member) {
|
|
||||||
message.delete(1000);
|
|
||||||
|
|
||||||
const embed = new Discord.RichEmbed()
|
|
||||||
.setTitle("SupportBot Setup Mode")
|
|
||||||
.setColor("#fff")
|
|
||||||
.setDescription(`${bot.settings.botname} is about to enter **Setup Mode**.\nThis means that all the roles & channels that are\nrequired to allow supportbot to work will be created.`)
|
|
||||||
.setFooter("Setup mode will expire in 60 seconds")
|
|
||||||
message.channel.send(embed).then((msg) => {
|
|
||||||
msg.react("✅");
|
|
||||||
const filter = (reaction, user) => reaction.emoji.name === "✅" && user.id === message.author.id;
|
|
||||||
msg.awaitReactions(filter, {
|
|
||||||
max: 1,
|
|
||||||
time: 60000,
|
|
||||||
errors: ["time"]
|
|
||||||
}).then(async (collected) => {
|
|
||||||
msg.clearReactions();
|
|
||||||
|
|
||||||
const embed1 = new Discord.RichEmbed()
|
|
||||||
.setTitle("SupportBot Setup Mode")
|
|
||||||
.setColor("#fff")
|
|
||||||
.setDescription(`${bot.settings.botname} has activated **Setup Mode**\nPlease allow a couple minutes for the process to be complete.`)
|
|
||||||
msg.edit(embed1).then((m) => {
|
|
||||||
m.delete(5000);
|
|
||||||
m.edit(":white_check_mark: **Success!** You\'r server is ready, thanks for using SupportBot by Emerald Services.");
|
|
||||||
});
|
|
||||||
const reaction = collected.first();
|
|
||||||
if (reaction.emoji.name === "✅") {
|
|
||||||
// Roles
|
|
||||||
let supportRole = bot.settings.support;
|
|
||||||
let staffRole = bot.settings.staff;
|
|
||||||
let autoRole = bot.settings.Auto_Role;
|
|
||||||
let Department_Role_1 = bot.settings.Department_Role_1
|
|
||||||
let Department_Role_2 = bot.settings.Department_Role_2
|
|
||||||
let Department_Role_3 = bot.settings.Department_Role_3
|
|
||||||
|
|
||||||
|
|
||||||
// Channels & Categories
|
|
||||||
let generalCategory = bot.settings.General_Category;
|
|
||||||
let informationCategory = bot.settings.InformationCategory;
|
|
||||||
let ticketCategory = bot.settings.category;
|
|
||||||
let staffCategory = bot.settings.StaffCategory;
|
|
||||||
let accessChannel = bot.settings.Access_Channel;
|
|
||||||
let announceChannel = bot.settings.Announcement_Channel;
|
|
||||||
let suggestChannel = bot.settings.Suggestion_Channel;
|
|
||||||
let reportsChannel = bot.settings.Report_Channel;
|
|
||||||
let ticketsChannel = bot.settings.Tickets_Channel;
|
|
||||||
let ticketsVoice1 = bot.settings.TicketsVoice1;
|
|
||||||
let ticketsVoice2 = bot.settings.TicketsVoice2;
|
|
||||||
let generalChannel = bot.settings.GeneralChannel;
|
|
||||||
let pollsChannel = bot.settings.Poll_Channel;
|
|
||||||
let botSpam = bot.settings.BotSpam_Channel;
|
|
||||||
let staffGeneral = bot.settings.StaffChat;
|
|
||||||
let staffCommands = bot.settings.StaffCmds;
|
|
||||||
let staffVoice = bot.settings.StaffVoice;
|
|
||||||
let ticketLogs = bot.settings.Ticket_Logs;
|
|
||||||
let commandLogs = bot.settings.Command_Log_Channel;
|
|
||||||
|
|
||||||
// Information Category
|
|
||||||
await message.guild.createChannel(`${informationCategory}`, {
|
|
||||||
type: "category",
|
|
||||||
position: 1
|
|
||||||
}).then(async (cat) => {
|
|
||||||
await message.guild.createChannel(`${accessChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 1,
|
|
||||||
topic: `${bot.settings.Access_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${announceChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 2,
|
|
||||||
topic: `${bot.settings.Announcement_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${pollsChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 3,
|
|
||||||
topic: `${bot.settings.Poll_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${suggestChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 4,
|
|
||||||
topic: `${bot.settings.Suggestion_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${reportsChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 5,
|
|
||||||
topic: `${bot.settings.Report_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// General Category
|
|
||||||
await message.guild.createChannel(`${generalCategory}`, {
|
|
||||||
type: "category",
|
|
||||||
position: 2
|
|
||||||
}).then(async (cat) => {
|
|
||||||
await message.guild.createChannel(`${generalChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 1,
|
|
||||||
topic: `${bot.settings.GeneralTopic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${botSpam}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 2,
|
|
||||||
topic: `${bot.settings.BotSpam_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// Support Category
|
|
||||||
await message.guild.createChannel(`${ticketCategory}`, {
|
|
||||||
type: "category",
|
|
||||||
position: 3
|
|
||||||
}).then(async (cat) => {
|
|
||||||
await message.guild.createChannel(`${ticketsChannel}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 1,
|
|
||||||
topic: `${bot.settings.Tickets_Topic}`,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${ticketsVoice1}`, {
|
|
||||||
type: "voice",
|
|
||||||
position: 2,
|
|
||||||
parent: cat,
|
|
||||||
userLimit: 2,
|
|
||||||
speakable: true,
|
|
||||||
joineable: true
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${ticketsVoice2}`, {
|
|
||||||
type: "voice",
|
|
||||||
position: 3,
|
|
||||||
parent: cat,
|
|
||||||
userLimit: 2,
|
|
||||||
speakable: true,
|
|
||||||
joineable: true
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// Staff Category (Private)
|
|
||||||
await message.guild.createChannel(`${staffCategory}`, {
|
|
||||||
type: "category",
|
|
||||||
position: 4
|
|
||||||
}).then(async (cat) => {
|
|
||||||
await message.guild.createChannel(`${staffGeneral}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 1,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${staffCommands}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 2,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${staffVoice}`, {
|
|
||||||
type: "voice",
|
|
||||||
position: 3,
|
|
||||||
parent: cat,
|
|
||||||
joineable: true,
|
|
||||||
speakable: true
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${ticketLogs}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 4,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
await message.guild.createChannel(`${commandLogs}`, {
|
|
||||||
type: "text",
|
|
||||||
position: 5,
|
|
||||||
parent: cat
|
|
||||||
});
|
|
||||||
|
|
||||||
await message.guild.createRole({
|
|
||||||
name: `${staffRole}`,
|
|
||||||
color: "#ff0000",
|
|
||||||
position: 1,
|
|
||||||
permissions: {
|
|
||||||
"MANAGE_CHANNELS": true,
|
|
||||||
"MANAGE_GUILD": true,
|
|
||||||
"MENTION_EVERYONE": true,
|
|
||||||
"CREATE_INSTANT_INVITE": true,
|
|
||||||
"KICK_MEMBERS": true,
|
|
||||||
"VIEW_AUDIT_LOG": true,
|
|
||||||
"MANAGE_NICKNAMES": true,
|
|
||||||
"CONNECT": true,
|
|
||||||
"SPEAK": true,
|
|
||||||
"USE_EXTERNAL_EMOJIS": true,
|
|
||||||
"MANAGE_MESSAGES": true,
|
|
||||||
"PRIORITY_SPEAKER": true
|
|
||||||
},
|
|
||||||
mentionable: true
|
|
||||||
});
|
|
||||||
await message.guild.createRole({
|
|
||||||
name: `${autoRole}`,
|
|
||||||
color: "#ffffff",
|
|
||||||
position: 2,
|
|
||||||
permissions: {
|
|
||||||
"MANAGE_CHANNELS": false,
|
|
||||||
"MANAGE_GUILD": false,
|
|
||||||
"MENTION_EVERYONE": false,
|
|
||||||
"CREATE_INSTANT_INVITE": true,
|
|
||||||
"KICK_MEMBERS": false,
|
|
||||||
"VIEW_AUDIT_LOG": false,
|
|
||||||
"MANAGE_NICKNAMES": false,
|
|
||||||
"CONNECT": true,
|
|
||||||
"SPEAK": true,
|
|
||||||
"USE_EXTERNAL_EMOJIS": true,
|
|
||||||
"MANAGE_MESSAGES": false,
|
|
||||||
"PRIORITY_SPEAKER": false
|
|
||||||
},
|
|
||||||
mentionable: false
|
|
||||||
});
|
|
||||||
await message.guild.createRole({
|
|
||||||
name: `${Department_Role_1}`,
|
|
||||||
color: "#ffffff",
|
|
||||||
position: 2,
|
|
||||||
permissions: {
|
|
||||||
"MANAGE_CHANNELS": false,
|
|
||||||
"MANAGE_GUILD": false,
|
|
||||||
"MENTION_EVERYONE": false,
|
|
||||||
"CREATE_INSTANT_INVITE": true,
|
|
||||||
"KICK_MEMBERS": true,
|
|
||||||
"VIEW_AUDIT_LOG": true,
|
|
||||||
"MANAGE_NICKNAMES": true,
|
|
||||||
"CONNECT": true,
|
|
||||||
"SPEAK": true,
|
|
||||||
"USE_EXTERNAL_EMOJIS": true,
|
|
||||||
"MANAGE_MESSAGES": true,
|
|
||||||
"PRIORITY_SPEAKER": true
|
|
||||||
},
|
|
||||||
mentionable: false
|
|
||||||
});
|
|
||||||
await message.guild.createRole({
|
|
||||||
name: `${Department_Role_2}`,
|
|
||||||
color: "#ffffff",
|
|
||||||
position: 2,
|
|
||||||
permissions: {
|
|
||||||
"MANAGE_CHANNELS": false,
|
|
||||||
"MANAGE_GUILD": false,
|
|
||||||
"MENTION_EVERYONE": false,
|
|
||||||
"CREATE_INSTANT_INVITE": true,
|
|
||||||
"KICK_MEMBERS": true,
|
|
||||||
"VIEW_AUDIT_LOG": true,
|
|
||||||
"MANAGE_NICKNAMES": true,
|
|
||||||
"CONNECT": true,
|
|
||||||
"SPEAK": true,
|
|
||||||
"USE_EXTERNAL_EMOJIS": true,
|
|
||||||
"MANAGE_MESSAGES": true,
|
|
||||||
"PRIORITY_SPEAKER": true
|
|
||||||
},
|
|
||||||
mentionable: false
|
|
||||||
});
|
|
||||||
await message.guild.createRole({
|
|
||||||
name: `${Department_Role_3}`,
|
|
||||||
color: "#ffffff",
|
|
||||||
position: 2,
|
|
||||||
permissions: {
|
|
||||||
"MANAGE_CHANNELS": false,
|
|
||||||
"MANAGE_GUILD": false,
|
|
||||||
"MENTION_EVERYONE": false,
|
|
||||||
"CREATE_INSTANT_INVITE": true,
|
|
||||||
"KICK_MEMBERS": true,
|
|
||||||
"VIEW_AUDIT_LOG": true,
|
|
||||||
"MANAGE_NICKNAMES": true,
|
|
||||||
"CONNECT": true,
|
|
||||||
"SPEAK": true,
|
|
||||||
"USE_EXTERNAL_EMOJIS": true,
|
|
||||||
"MANAGE_MESSAGES": true,
|
|
||||||
"PRIORITY_SPEAKER": true
|
|
||||||
},
|
|
||||||
mentionable: false
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
message.channel.send(":x: **Error:** You don't have permissions to use this command.").then((msg) => {
|
|
||||||
msg.delete(5000);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Setup_Command
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Suggest
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = async(bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
const SuggestionEmbed = new Discord.RichEmbed()
|
|
||||||
.setTitle(`${bot.settings.Suggestion_Title}`)
|
|
||||||
.setDescription(`\`\`\`${args.join(" ")}\`\`\`\nFrom <@${message.author.id}>`)
|
|
||||||
.setFooter(`${bot.settings.footer}`, message.author.avatarURL)
|
|
||||||
.setTimestamp(new Date())
|
|
||||||
.setColor(bot.settings.colour);
|
|
||||||
|
|
||||||
let sc = message.guild.channels.find(SuggestionChannel => SuggestionChannel.name === `${bot.settings.Suggestion_Channel}`);
|
|
||||||
if(!sc) return message.channel.send(`:x: Error! Could not find the suggestion channel **${bot.settings.Suggestion_Channel}**`);
|
|
||||||
|
|
||||||
sc.send(SuggestionEmbed)
|
|
||||||
|
|
||||||
.then(async function(msg) {
|
|
||||||
msg.react(bot.settings.suggestyes).then(() => msg.react(bot.settings.suggestno));
|
|
||||||
});
|
|
||||||
|
|
||||||
const SuggestionSuccessEmbed = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:white_check_mark: You have successfully created your suggestion. <#${sc.id}>`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
message.channel.send(SuggestionSuccessEmbed);
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Suggest_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Suggest_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**`);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Suggest_Command,
|
|
||||||
}
|
|
||||||
@@ -1,186 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Ticket
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = (bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
const ID = Math.floor(Math.random() * 10) + 2000;
|
|
||||||
const subject = args.join(" ") || `${bot.settings.Default_Ticket_Reason}`;
|
|
||||||
|
|
||||||
// Ticket Reactions
|
|
||||||
const reactembed = new Discord.RichEmbed()
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setDescription(`${bot.settings.Ticket_React_Message}`);
|
|
||||||
message.channel.send(reactembed)
|
|
||||||
.then(function(msg) {
|
|
||||||
|
|
||||||
msg.react('✅').then(() => msg.react('❎'));
|
|
||||||
|
|
||||||
const filter = (reaction, user) => {
|
|
||||||
return ['✅', '❎'].includes(reaction.emoji.name) && user.id !== msg.author.id;
|
|
||||||
};
|
|
||||||
|
|
||||||
msg.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
|
|
||||||
.then(collected => {
|
|
||||||
const reaction = collected.first();
|
|
||||||
|
|
||||||
if (reaction.emoji.name === '❎') {
|
|
||||||
|
|
||||||
const successEmbed = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:tickets: <@${message.author.id}> You have canceled your support request.`)
|
|
||||||
.setColor(bot.settings.colour);
|
|
||||||
message.channel.send(successEmbed);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reaction.emoji.name === '✅') {
|
|
||||||
|
|
||||||
const alreadyopen = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Cannot create a ticket because **ticket-${message.author.username}** already exists.`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (message.guild.channels.find(TicketChannel => TicketChannel.name === 'ticket-' + message.author.username)) return message.channel.send(alreadyopen);
|
|
||||||
message.guild.createChannel(`ticket-${message.author.username}`, {
|
|
||||||
type: 'text',
|
|
||||||
}).then(TicketChannel => {
|
|
||||||
|
|
||||||
// Roles
|
|
||||||
let staff = message.guild.roles.find(supportRole => supportRole.name === `${bot.settings.staff}`)
|
|
||||||
let everyone = message.guild.roles.find(everyoneRole => everyoneRole.name === "@everyone")
|
|
||||||
let department = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${bot.settings.Department_Role_1}`)
|
|
||||||
let department2 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${bot.settings.Department_Role_2}`)
|
|
||||||
let department3 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${bot.settings.Department_Role_3}`)
|
|
||||||
|
|
||||||
// Permissions
|
|
||||||
TicketChannel.overwritePermissions(everyone, { SEND_MESSAGES: false, READ_MESSAGES: false })
|
|
||||||
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: false, READ_MESSAGES: false })
|
|
||||||
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: false, READ_MESSAGES: false })
|
|
||||||
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: false, READ_MESSAGES: false })
|
|
||||||
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
|
||||||
TicketChannel.overwritePermissions(message.author, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
|
||||||
TicketChannel.overwritePermissions(bot.user, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
|
||||||
|
|
||||||
// Category
|
|
||||||
let category = message.guild.channels.find(c => c.name === bot.settings.category);
|
|
||||||
if (category) {
|
|
||||||
TicketChannel.setParent(category.id);
|
|
||||||
} else {
|
|
||||||
if (message.guild.channels.get(bot.settings.category)) {
|
|
||||||
TicketChannel.setParent(message.guild.channels.get(bot.settings.category).id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const ticketopened = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:white_check_mark: <@${message.author.id}> You ticket has been created <#${TicketChannel.id}>`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
message.channel.send({embed: ticketopened});
|
|
||||||
|
|
||||||
// Ticket Message - ( Able to edit this message via the settings.json file )
|
|
||||||
const ticketMessage = `Hi! <@${message.author.id}>\n${bot.settings.Ticket_Message}`;
|
|
||||||
|
|
||||||
const Department_1 = bot.settings.Ticket_Department_1;
|
|
||||||
const Department_2 = bot.settings.Ticket_Department_2;
|
|
||||||
const Department_3 = bot.settings.Ticket_Department_3;
|
|
||||||
|
|
||||||
const Emoji_1 = bot.settings.Ticket_Department_Emoji_1;
|
|
||||||
const Emoji_2 = bot.settings.Ticket_Department_Emoji_2;
|
|
||||||
const Emoji_3 = bot.settings.Ticket_Department_Emoji_3;
|
|
||||||
|
|
||||||
const TicketMessage = new Discord.RichEmbed()
|
|
||||||
.setDescription(ticketMessage, true)
|
|
||||||
.addField("Available Departments", `${Emoji_1} ${Department_1}\n${Emoji_2} ${Department_2}\n${Emoji_3} ${Department_3}`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
if (subject != 'No Subject.') {
|
|
||||||
TicketChannel.setTopic(subject);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
TicketChannel.send({embed: TicketMessage}).then(function(msg) {
|
|
||||||
|
|
||||||
msg.react(Emoji_1).then(() => msg.react(Emoji_2)).then(() => msg.react(Emoji_3));
|
|
||||||
|
|
||||||
const filter = (reaction, user) => {
|
|
||||||
return [Emoji_1, Emoji_2, Emoji_3].includes(reaction.emoji.name) && user.id !== msg.author.id;
|
|
||||||
};
|
|
||||||
|
|
||||||
msg.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
|
|
||||||
.then(collected => {
|
|
||||||
const reaction = collected.first();
|
|
||||||
|
|
||||||
if (reaction.emoji.name === `${Emoji_1}`) {
|
|
||||||
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
|
||||||
TicketChannel.overwritePermissions(department, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
|
||||||
|
|
||||||
msg.channel.send("You have contacted out " + department + "\nPlease wait patiently for somone to reach out to you.")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reaction.emoji.name === `${Emoji_2}`) {
|
|
||||||
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
|
||||||
TicketChannel.overwritePermissions(department2, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
|
||||||
|
|
||||||
msg.channel.send("You have contacted out " + department2 + "\nPlease wait patiently for somone to reach out to you.")
|
|
||||||
}
|
|
||||||
|
|
||||||
if (reaction.emoji.name === `${Emoji_3}`) {
|
|
||||||
TicketChannel.overwritePermissions(staff, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
|
||||||
TicketChannel.overwritePermissions(department3, { SEND_MESSAGES: true, READ_MESSAGES: true })
|
|
||||||
|
|
||||||
msg.channel.send("You have contacted out " + department3 + "\nPlease wait patiently for somone to reach out to you.")
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// Ticket Logging
|
|
||||||
const logEmbed = new Discord.RichEmbed()
|
|
||||||
.setTitle(":ticket: Logistics of your Ticket")
|
|
||||||
.addField("Ticket ID", ID, true)
|
|
||||||
.addField("User", `<@${message.author.id}>`, true)
|
|
||||||
.addField("Channel", `ticket#${ID}`, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
if (subject != 'No Subject.') {
|
|
||||||
logEmbed.addField('Subject', subject, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${bot.settings.Ticket_Logs}`);
|
|
||||||
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${bot.settings.Ticket_Logs}**`);
|
|
||||||
|
|
||||||
logChannel.send({embed: logEmbed})
|
|
||||||
|
|
||||||
}).catch(err=>{console.error(err)});
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.Ticket_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.Ticket_Command, true)
|
|
||||||
.addField(`Channel`, message.channel, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.Ticket_Command,
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
// SupportBot
|
|
||||||
// Command: Lockchat
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = async(bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${bot.settings.staff}`)
|
|
||||||
let lockedRole = message.guild.roles.find(lc => lc.name === `${bot.settings.locked_role}`)
|
|
||||||
|
|
||||||
const rolemissing = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Looks like this server doesn't have the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
|
||||||
|
|
||||||
const donothaverole = new Discord.RichEmbed()
|
|
||||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${bot.settings.staff}**`)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
|
||||||
|
|
||||||
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
|
||||||
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
|
||||||
const lockmsg = new Discord.RichEmbed()
|
|
||||||
.setDescription(":white_check_mark: **Chat Un-Locked**")
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
message.channel.send(lockmsg)
|
|
||||||
|
|
||||||
console.log(`\x1b[36m`, `${message.author} has executed ${bot.settings.prefix}${bot.settings.UnLockchat_Command}`)
|
|
||||||
|
|
||||||
const CMDLog = new Discord.RichEmbed()
|
|
||||||
.setTitle(bot.settings.Commands_Log_Title)
|
|
||||||
.addField(`User`, `<@${message.author.id}>`)
|
|
||||||
.addField(`Command`, bot.settings.UnLockchat_Command, true)
|
|
||||||
.addField(`Executed At`, message.createdAt, true)
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setFooter(bot.settings.footer)
|
|
||||||
|
|
||||||
let CommandLog = message.guild.channels.find(LogsChannel => LogsChannel.name === `${bot.settings.Command_Log_Channel}`);
|
|
||||||
if(!CommandLog) return message.channel.send(`:x: Error! Could not find the logs channel. **${bot.settings.Command_Log_Channel}**\nThis can be changed via ``settings.json```);
|
|
||||||
|
|
||||||
CommandLog.send(CMDLog);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: bot.settings.UnLockchat_Command,
|
|
||||||
}
|
|
||||||
@@ -1,119 +1,44 @@
|
|||||||
// ____ _ ____ _
|
// ___ _ ___ _
|
||||||
// / ___| _ _ _ __ _ __ ___ _ __| |_| __ ) ___ | |_
|
// / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||||
// \___ \| | | | '_ \| '_ \ / _ \| '__| __| _ \ / _ \| __|
|
// \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||||
// ___) | |_| | |_) | |_) | (_) | | | |_| |_) | (_) | |_
|
// <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||||
// |____/ \__,_| .__/| .__/ \___/|_| \__|____/ \___/ \__|
|
// |_| |_|
|
||||||
// |_| |_|
|
//
|
||||||
|
// SupportBot created by Emerald Services
|
||||||
|
// Installed with MIT License
|
||||||
|
//
|
||||||
|
// Discord Support: https://emeraldsrv.dev/discord
|
||||||
|
// Community Resources: https://emeraldsrv.dev/resources
|
||||||
|
|
||||||
// Resource: SupportBot
|
|
||||||
// Developed by Emerald Services
|
|
||||||
// Version: 4.2.0
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
bot.commands = new Discord.Collection();
|
const yaml = require("js-yaml");
|
||||||
bot.settings = require("./settings.json");
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
fs.readdir("./commands/", (err, files) => {
|
);
|
||||||
if(err) console.log(err);
|
|
||||||
|
|
||||||
let jsfile = files.filter(f => f.split(".").pop() === "js")
|
|
||||||
if(jsfile.length <= 0) return console.log(`${bot.settings.botname} No commands found. Try to Re-download the resource`);
|
|
||||||
|
|
||||||
jsfile.forEach((f, i) =>{
|
|
||||||
let props = require(`./commands/${f}`);
|
|
||||||
console.log(`[${bot.settings.botname}] > Command Loaded > ${f}`);
|
|
||||||
bot.commands.set(props.help.name, props);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.addons = new Discord.Collection();
|
|
||||||
|
|
||||||
fs.readdir("./sb-addons/", (err, files) => {
|
|
||||||
if(err) console.log(err);
|
|
||||||
|
|
||||||
let jsfile = files.filter(f => f.split(".").pop() === "js")
|
|
||||||
if(jsfile.length <= 0) return console.log(`${bot.settings.botname} No addons detected nor default! Either download addons from https://itzemerald.tk/`);
|
|
||||||
|
|
||||||
jsfile.forEach((f, i) =>{
|
|
||||||
let props = require(`./sb-addons/${f}`);
|
|
||||||
console.log(`[${bot.settings.botname}] > Addons Loaded > ${f}`);
|
|
||||||
bot.addons.set(props.help.name, props);
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.on("ready", async () => {
|
|
||||||
bot.user.setActivity(bot.settings.BotStatus, {type:"PLAYING"});
|
|
||||||
console.log(`\u001b[31m`, `------------[ SupportBot ]------------`)
|
|
||||||
console.log(`\u001b[32m`, `Thank you for using SupportBot\n If you have any issues\n contact our team and we will\n give you furthur instructions\nContact us on discord if you require any support discord.gg/SPKDBX9`)
|
|
||||||
console.log(`\u001b[31m`, `------------[ SupportBot ]------------`)
|
|
||||||
|
|
||||||
console.log(`\u001b[31m`, `\n\n------------[ SupportBot Stats ]------------`)
|
|
||||||
console.log(`\u001b[32m`, `Bot Username: ${bot.user.username}\nInvite Link: https://discordapp.com/api/oauth2/authorize?client_id=${bot.user.username}&permissions=8&scope=bot`)
|
|
||||||
console.log(`\u001b[31m`, `------------[ SupportBot Stats ]------------`)
|
|
||||||
|
|
||||||
|
const Client = require("./Structures/Client.js");
|
||||||
|
const client = new Client({
|
||||||
|
intents: ['Guilds', 'GuildMembers', 'GuildMessages']
|
||||||
});
|
});
|
||||||
|
|
||||||
bot.on("message", async message => {
|
client.start(supportbot.General.Token);
|
||||||
if(message.author.bot) return;
|
|
||||||
if(message.channel.type === "dm") return;
|
|
||||||
if (message.content.indexOf(bot.settings.prefix) !== 0) return;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
let messageArray = message.content.split(" ");
|
|
||||||
const args = message.content.slice(bot.settings.prefix.length).trim().split(/ +/g);
|
|
||||||
const command = args.shift().toLowerCase();
|
|
||||||
|
|
||||||
const cmd = bot.commands.get(command);
|
|
||||||
if(!cmd) return;
|
|
||||||
cmd.run(bot, message, args);
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.on("message", async message => {
|
|
||||||
if(message.author.bot) return;
|
|
||||||
if(message.channel.type === "dm") return;
|
|
||||||
if (message.content.indexOf(bot.settings.prefix) !== 0) return;
|
|
||||||
|
|
||||||
let messageArray = message.content.split(" ");
|
|
||||||
const args = message.content.slice(bot.settings.prefix.length).trim().split(/ +/g);
|
|
||||||
const addon = args.shift().toLowerCase();
|
|
||||||
|
|
||||||
const cmd = bot.addons.get(addon);
|
|
||||||
if(!cmd) return;
|
|
||||||
cmd.run(bot, message, args);
|
|
||||||
});
|
|
||||||
|
|
||||||
// [SupportBot] Welcome Message && Auto Join Role
|
|
||||||
|
|
||||||
bot.on("guildMemberAdd", (member) => {
|
|
||||||
let channel = member.guild.channels.find(channel => channel.name === `${bot.settings.Welcome_Channel}`)
|
|
||||||
let autorole = member.guild.roles.find(autorole => autorole.name === `${bot.settings.Auto_Role}`)
|
|
||||||
|
|
||||||
const WelcomeMsg= new Discord.RichEmbed()
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setThumbnail(member.user.avatarURL)
|
|
||||||
.setDescription(`:wave: ${member.user.username}\n${bot.settings.Welcome_Message}`)
|
|
||||||
|
|
||||||
channel.send(WelcomeMsg);
|
|
||||||
member.addRole(autorole).catch(console.error);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
// [SupportBot] Leave Message
|
|
||||||
|
|
||||||
bot.on("guildMemberRemove", (member) => {
|
|
||||||
let channel = member.guild.channels.find(channel => channel.name === `${bot.settings.Leave_Channel}`)
|
|
||||||
|
|
||||||
const LeaveMsg= new Discord.RichEmbed()
|
|
||||||
.setColor(bot.settings.colour)
|
|
||||||
.setThumbnail(member.user.avatarURL)
|
|
||||||
.setDescription(`:wave: ${member.user.username}\n${bot.settings.Leave_Message}`)
|
|
||||||
|
|
||||||
channel.send(LeaveMsg);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.login(bot.settings.token);
|
|
||||||
Generated
-5
@@ -1,5 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "SupportBot",
|
|
||||||
"version": "4.0",
|
|
||||||
"lockfileVersion": 1
|
|
||||||
}
|
|
||||||
+17
-25
@@ -1,37 +1,29 @@
|
|||||||
{
|
{
|
||||||
"name": "SupportBot",
|
"name": "supportbot",
|
||||||
"version": "4.0",
|
"version": "8.0.1",
|
||||||
"description": "SupportBot",
|
"description": "SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customization to match your own brand.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"private": "true",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1",
|
"setup": "npm i && node index.js",
|
||||||
"start": "node index.js"
|
"start": "node index.js"
|
||||||
},
|
},
|
||||||
"engines": {
|
|
||||||
"node": "12.6.0",
|
|
||||||
"npm": "6.9.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"array-sort": "^1.0.0",
|
|
||||||
"discord.js": "^11.5.1",
|
|
||||||
"table": "^5.4.4"
|
|
||||||
},
|
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/EmeraldRusher/SupportBot.git"
|
"url": "git+https://github.com/Emerald-Services/SupportBot.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
|
||||||
"SupportBot",
|
|
||||||
"Emerald Services"
|
|
||||||
],
|
|
||||||
"author": "Emerald Services",
|
"author": "Emerald Services",
|
||||||
|
"license": "MIT",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
"url": "https://github.com/EmeraldRusher/SupportBot/issues"
|
"url": "https://github.com/Emerald-Services/SupportBot/issues"
|
||||||
},
|
},
|
||||||
"homepage": "https://discord.gg/hmWgxdF",
|
"homepage": "https://github.com/Emerald-Services/SupportBot#readme",
|
||||||
"contributors": [
|
"dependencies": {
|
||||||
"iJosGCS",
|
"@vitalets/google-translate-api": "^8.0.0",
|
||||||
"RedstoneGamez"
|
"axios": "^1.7.2",
|
||||||
]
|
"chatgpt": "^5.2.5",
|
||||||
|
"discord.js": "^14.13.0",
|
||||||
|
"js-yaml": "^4.1.0",
|
||||||
|
"moment": "^2.29.3",
|
||||||
|
"openai": "^4.50.0"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
// SupportBot Addons
|
|
||||||
// Default Addon
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const bot = new Discord.Client()
|
|
||||||
|
|
||||||
bot.settings = require("../settings.json");
|
|
||||||
|
|
||||||
exports.run = async(bot, message, args) => {
|
|
||||||
message.delete();
|
|
||||||
|
|
||||||
message.channel.send(":white_check_mark: **SupportBot Addon**\nThis addon is here by default.\nWe are currently working on some super amazing addons for SupportBot\nHowever, If you would like to start creating your own support bot addon\ncontact us at EmeraldServices.\n")
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
exports.help = {
|
|
||||||
name: 'addon',
|
|
||||||
}
|
|
||||||
-101
@@ -1,101 +0,0 @@
|
|||||||
{
|
|
||||||
"SupportBot": "v4.2.0",
|
|
||||||
|
|
||||||
"token": "BOT_TOKEN_HERE",
|
|
||||||
"prefix": "dev-",
|
|
||||||
"botname": "SupportBot",
|
|
||||||
"colour": "#13bd2a",
|
|
||||||
"footer": "Support Bot, By Emerald Services",
|
|
||||||
"BotStatus": "Support Bot",
|
|
||||||
|
|
||||||
"staff": "Staff",
|
|
||||||
|
|
||||||
"locked_role": "@everyone",
|
|
||||||
"everyone": "@everyone",
|
|
||||||
"Auto_Role": "Member",
|
|
||||||
|
|
||||||
"Department_Role_1": "Support",
|
|
||||||
"Department_Role_2": "Security",
|
|
||||||
"Department_Role_3": "Sales",
|
|
||||||
|
|
||||||
"category": "Tickets",
|
|
||||||
"Ticket_Message": "Your support ticket has been opened successfully\nPlease allow us some time to reach out to you.",
|
|
||||||
"Ticket_Logs": "ticket-logs",
|
|
||||||
"Default_Ticket_Reason": "No Subject",
|
|
||||||
"Ticket_React_Message": ":mailbox: React to create your support ticket.",
|
|
||||||
|
|
||||||
"Ticket_Department_1": "Support",
|
|
||||||
"Ticket_Department_2": "Security",
|
|
||||||
"Ticket_Department_3": "Sales",
|
|
||||||
|
|
||||||
"Ticket_Department_Emoji_1": "🎧",
|
|
||||||
"Ticket_Department_Emoji_2": "🔐",
|
|
||||||
"Ticket_Department_Emoji_3": "💵",
|
|
||||||
|
|
||||||
"General_Category": "General",
|
|
||||||
"InformationCategory": "Information",
|
|
||||||
"StaffCategory": "Staff",
|
|
||||||
|
|
||||||
"Access_Channel": "welcome",
|
|
||||||
"GeneralChannel": "general",
|
|
||||||
"BotSpam_Channel": "bot-spam",
|
|
||||||
"Tickets_Channel": "open-a-ticket",
|
|
||||||
"StaffChat": "staff-chat",
|
|
||||||
"StaffCmds": "staff-commands",
|
|
||||||
"StaffVoice": "Staff Room",
|
|
||||||
"TicketsVoice1": "Support Lounge",
|
|
||||||
"TicketsVoice2": "Support Lounge",
|
|
||||||
|
|
||||||
"Commands_Log_Title": "SupportBot Logs",
|
|
||||||
"Command_Log_Channel": "command-logs",
|
|
||||||
|
|
||||||
"Announcement_Title": "SupportBot Announcement",
|
|
||||||
"Announcement_Channel": "announcements",
|
|
||||||
"Announcement_Tag_Role": "@everyone",
|
|
||||||
|
|
||||||
"Welcome_Message": "Welcome to the server!",
|
|
||||||
"Welcome_Channel": "welcome",
|
|
||||||
|
|
||||||
"Leave_Message": "Thank you for visiting us!",
|
|
||||||
"Leave_Channel": "welcome",
|
|
||||||
|
|
||||||
"Poll_Channel": "polls",
|
|
||||||
"Poll_Title": "📊 Polls",
|
|
||||||
"Reaction_Poll_1": "✅",
|
|
||||||
"Reaction_Poll_2": "❎",
|
|
||||||
|
|
||||||
"Suggestion_Title": "SupportBot Suggestions",
|
|
||||||
"Suggestion_Channel": "suggestions",
|
|
||||||
"suggestyes": "✅",
|
|
||||||
"suggestno": "❎",
|
|
||||||
|
|
||||||
"Report_Channel": "reports",
|
|
||||||
"Report_Title": "SupportBot Report",
|
|
||||||
|
|
||||||
"LINKS_TITLE": "SupportBot Links",
|
|
||||||
|
|
||||||
"LINKS": {
|
|
||||||
"Discord": "https://discord.gg/",
|
|
||||||
"Twitter": "https://twitter.com/",
|
|
||||||
"Website": "https://example.com/",
|
|
||||||
"AddMore": "AddMoreIfYouWant"
|
|
||||||
},
|
|
||||||
|
|
||||||
"Announcement_Command": "announce",
|
|
||||||
"Say_Command": "say",
|
|
||||||
"Suggest_Command": "suggest",
|
|
||||||
"Ping_Command": "ping",
|
|
||||||
"Ticket_Command": "ticket",
|
|
||||||
"Remove_Command": "remove",
|
|
||||||
"Add_Command": "add",
|
|
||||||
"Close_Command": "close",
|
|
||||||
"Forceclose_Command": "forceclose",
|
|
||||||
"Rename_Command": "rename",
|
|
||||||
"Help_Command": "help",
|
|
||||||
"Link_Command": "links",
|
|
||||||
"Lockchat_Command": "lock",
|
|
||||||
"UnLockchat_Command": "unlock",
|
|
||||||
"Poll_Command": "poll",
|
|
||||||
"Report_Command": "report",
|
|
||||||
"Setup_Command": "setup"
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
node index.js
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
node index.js
|
|
||||||
Reference in new issue
Block a user