Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
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.
|
||||
+1
-76
@@ -1,76 +1 @@
|
||||
# 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/
|
||||
node_modules/
|
||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,45 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Example (default) Addon
|
||||
|
||||
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"));
|
||||
|
||||
// Your Addon Config file! Saved in /Addons/Configs/YourAddonConfig.yml
|
||||
// const config = yaml.load(fs.readFileSync('./Addons/Configs/YourAddonConfig.yml', 'utf8'));
|
||||
|
||||
const { Command, Event } = require("../Structures/Addon");
|
||||
|
||||
module.exports.commands = [
|
||||
/*
|
||||
// EXAMPLE COMMAND
|
||||
new Command({
|
||||
name: "hello",
|
||||
description: "hello",
|
||||
options: [],
|
||||
permissions: ["SEND_MESSAGES"],
|
||||
async run(interaction) {
|
||||
const Embed = new Discord.MessageEmbed()
|
||||
.setDescription("Hello World!")
|
||||
.setColor(supportbot.InfoColour);
|
||||
|
||||
interaction.reply({
|
||||
embeds: [Embed],
|
||||
});
|
||||
},
|
||||
}),
|
||||
*/
|
||||
];
|
||||
module.exports.events = [
|
||||
/*
|
||||
// EXAMPLE EVENT
|
||||
new Event("ready", async (client) => {
|
||||
console.log("Bot started!");
|
||||
}),
|
||||
*/
|
||||
];
|
||||
@@ -0,0 +1,92 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Ticket Add 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.TicketAdd,
|
||||
description: cmdconfig.TicketAddDesc,
|
||||
options: [
|
||||
{
|
||||
name: "user",
|
||||
description: "User to add",
|
||||
type: "USER",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
permissions: ["SEND_MESSAGES"],
|
||||
|
||||
async run(interaction) {
|
||||
const { getRole } = interaction.client;
|
||||
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||
let Admin = await getRole(supportbot.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.MessageEmbed()
|
||||
.setTitle("Invalid Permissions!")
|
||||
.setDescription(
|
||||
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
|
||||
)
|
||||
.setColor(supportbot.WarningColour);
|
||||
|
||||
if (
|
||||
!interaction.member.roles.cache.has(SupportStaff.id) &&
|
||||
!interaction.member.roles.cache.has(Admin.id)
|
||||
)
|
||||
return interaction.reply({ ephemeral: true, embeds: [NoPerms] });
|
||||
|
||||
let TicketData = await JSON.parse(
|
||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||
);
|
||||
let ticket = await TicketData.tickets.findIndex(
|
||||
(t) => t.id === interaction.channel.id
|
||||
);
|
||||
if (ticket === -1) {
|
||||
const Exists = new Discord.MessageEmbed()
|
||||
.setTitle("No Ticket Found!")
|
||||
.setDescription(supportbot.NoValidTicket)
|
||||
.setColor(supportbot.WarningColour);
|
||||
return interaction.reply({ ephemeral: true, embeds: [Exists] });
|
||||
}
|
||||
|
||||
let uMember = interaction.options.getUser("user");
|
||||
const UserNotExist = new Discord.MessageEmbed()
|
||||
.setTitle("User Not Found!")
|
||||
.setDescription(
|
||||
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.TicketAdd} <user#0000>\``
|
||||
)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
|
||||
if (!uMember) return interaction.reply({ embeds: [UserNotExist] });
|
||||
|
||||
await interaction.channel.permissionOverwrites.edit(uMember.id, {
|
||||
VIEW_CHANNEL: true,
|
||||
});
|
||||
const Complete = new Discord.MessageEmbed()
|
||||
.setTitle("User Added!")
|
||||
.setDescription(supportbot.AddedUser.replace(/%user%/g, uMember.id))
|
||||
.setTimestamp()
|
||||
.setColor(supportbot.EmbedColour);
|
||||
interaction.reply({ embeds: [Complete] });
|
||||
TicketData.tickets[ticket].subUsers.push(uMember.id);
|
||||
fs.writeFileSync(
|
||||
"./Data/TicketData.json",
|
||||
JSON.stringify(TicketData, null, 4),
|
||||
(err) => {
|
||||
if (err) console.error(err);
|
||||
}
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,199 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Close Ticket 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.CloseTicket,
|
||||
description: cmdconfig.CloseTicketDesc,
|
||||
options: [
|
||||
{
|
||||
name: "reason",
|
||||
description: "Ticket Close Reason",
|
||||
type: "STRING",
|
||||
},
|
||||
],
|
||||
permissions: ["SEND_MESSAGES"],
|
||||
|
||||
async run(interaction) {
|
||||
const { getRole, getChannel } = interaction.client;
|
||||
if (supportbot.StaffOnly) {
|
||||
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||
let Admin = await getRole(supportbot.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.MessageEmbed()
|
||||
.setTitle("Invalid Permissions!")
|
||||
.setDescription(
|
||||
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
|
||||
)
|
||||
.setColor(supportbot.WarningColour);
|
||||
|
||||
if (
|
||||
!interaction.member.roles.cache.has(SupportStaff.id) &&
|
||||
!interaction.member.roles.cache.has(Admin.id)
|
||||
)
|
||||
return interaction.reply({ embeds: [NoPerms] });
|
||||
}
|
||||
await interaction.deferReply();
|
||||
let tickets = await JSON.parse(
|
||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||
);
|
||||
let TicketData = await tickets.tickets.findIndex(
|
||||
(t) => t.id === interaction.channel.id
|
||||
);
|
||||
let ticket = tickets.tickets[TicketData];
|
||||
if (TicketData === -1) {
|
||||
const Exists = new Discord.MessageEmbed()
|
||||
.setTitle("No Ticket Found!")
|
||||
.setDescription(supportbot.NoValidTicket)
|
||||
.setColor(supportbot.WarningColour);
|
||||
return interaction.followUp({ embeds: [Exists] });
|
||||
}
|
||||
let tUser = interaction.client.users.cache.get(ticket.user);
|
||||
let transcriptChannel = await getChannel(
|
||||
supportbot.TranscriptLog,
|
||||
interaction.guild
|
||||
);
|
||||
let logChannel = await getChannel(supportbot.TicketLog, interaction.guild);
|
||||
let reason =
|
||||
(await interaction.options?.getString("reason")) || "No Reason Provided.";
|
||||
|
||||
if (!transcriptChannel || !logChannel)
|
||||
return interaction.followUp("Some Channels seem to be missing!");
|
||||
if (supportbot.CloseConfirmation) {
|
||||
const CloseTicketRequest = new Discord.MessageEmbed()
|
||||
.setTitle(`**${supportbot.ClosingTicket}**`)
|
||||
.setDescription(
|
||||
`Please confirm by repeating the following word.. \`${supportbot.ClosingConfirmation_Word}\` `
|
||||
)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
await interaction.followUp({ embeds: [CloseTicketRequest] });
|
||||
let filter = (m) =>
|
||||
m.content.toLowerCase() === supportbot.ClosingConfirmation_Word &&
|
||||
m.author.id === interaction.user.id;
|
||||
await interaction.channel.awaitMessages({
|
||||
filter,
|
||||
max: 1,
|
||||
time: 20000,
|
||||
errors: ["time"],
|
||||
});
|
||||
}
|
||||
try {
|
||||
tickets.tickets[TicketData].open = false;
|
||||
fs.writeFileSync(
|
||||
"./Data/TicketData.json",
|
||||
JSON.stringify(tickets, null, 4),
|
||||
(err) => {
|
||||
if (err) console.error(err);
|
||||
}
|
||||
);
|
||||
await interaction.followUp(`**${supportbot.ClosingTicket}**`);
|
||||
const transcriptEmbed = new Discord.MessageEmbed()
|
||||
.setTitle(supportbot.TranscriptTitle)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter({
|
||||
text: supportbot.EmbedFooter,
|
||||
iconURL: interaction.user.displayAvatarURL(),
|
||||
})
|
||||
.addField(
|
||||
"Ticket",
|
||||
`${interaction.channel.name} (${interaction.channel.id})`
|
||||
)
|
||||
.addField(
|
||||
"User",
|
||||
`${tUser?.username || "N/A"}#${tUser?.discriminator || "N/A"} (${
|
||||
tUser?.id || ticket.user
|
||||
})`
|
||||
)
|
||||
.addField("Closed By", interaction.user.tag)
|
||||
.addField("Reason", reason);
|
||||
const logEmbed = new Discord.MessageEmbed()
|
||||
.setTitle(supportbot.TicketLog_Title)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter({
|
||||
text: supportbot.EmbedFooter,
|
||||
iconURL: interaction.user.displayAvatarURL(),
|
||||
})
|
||||
.addField(
|
||||
"Ticket",
|
||||
`${interaction.channel.name} (${interaction.channel.id})`
|
||||
)
|
||||
.addField(
|
||||
"User",
|
||||
`${tUser?.username || "N/A"}#${tUser?.discriminator || "N/A"} (${
|
||||
tUser?.id || ticket.user
|
||||
})`
|
||||
)
|
||||
.addField("Closed By", interaction.user.tag)
|
||||
.addField("Reason", reason);
|
||||
let msgs = await interaction.channel.messages.fetch({ limit: 100 });
|
||||
let html = "";
|
||||
|
||||
msgs = msgs.sort((a, b) => a.createdTimestamp - b.createdTimestamp);
|
||||
html += `<style>* {background-color: #2c2f33;color: #fff;font-family: Arial, Helvetica, sans-serif;}</style>`;
|
||||
html += `<strong>Server Name:</strong> ${interaction.guild.name}<br>`;
|
||||
html += `<strong>Ticket:</strong> ${interaction.channel.name}<br>`;
|
||||
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
||||
|
||||
await msgs.forEach((msg) => {
|
||||
if (msg.content) {
|
||||
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
|
||||
html += `<strong>Message:</strong> ${msg.content}<br>`;
|
||||
html += `-----<br><br>`;
|
||||
}
|
||||
});
|
||||
if (!(supportbot.DisableTicketLogChannel)) {
|
||||
await logChannel.send({ embeds: [logEmbed] }).catch((err) => {
|
||||
console.error(err);
|
||||
});
|
||||
}
|
||||
let file = new Discord.MessageAttachment(
|
||||
Buffer.from(html),
|
||||
`${interaction.channel.name}.html`
|
||||
);
|
||||
await transcriptChannel
|
||||
.send({ embeds: [transcriptEmbed], files: [file] })
|
||||
.catch(async (err) => {
|
||||
console.error(err);
|
||||
});
|
||||
|
||||
if (supportbot.DMTranscripts) {
|
||||
|
||||
await tUser
|
||||
?.send({ embeds: [transcriptEmbed], files: [file] })
|
||||
.catch(async (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(async (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);
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,113 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Embed 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.EmbedCommand,
|
||||
description: cmdconfig.EmbedCommandDesc,
|
||||
options: [
|
||||
{
|
||||
name: "title",
|
||||
description: "Embed Title",
|
||||
type: "STRING",
|
||||
required: true,
|
||||
},
|
||||
|
||||
{
|
||||
name: "message",
|
||||
description: "Embed Message",
|
||||
type: "STRING",
|
||||
required: true,
|
||||
},
|
||||
|
||||
{
|
||||
name: "color",
|
||||
description: "Embed HEX Color",
|
||||
type: "STRING",
|
||||
required: false,
|
||||
},
|
||||
|
||||
{
|
||||
name: "fieldtitle",
|
||||
description: "Add an additional Embed Field",
|
||||
type: "STRING",
|
||||
required: false,
|
||||
},
|
||||
|
||||
{
|
||||
name: "fieldcontent",
|
||||
description: "Add an additional Embed Field",
|
||||
type: "STRING",
|
||||
required: false,
|
||||
},
|
||||
|
||||
{
|
||||
name: "thumbnail",
|
||||
description: "Embed Thumbnail URL",
|
||||
type: "STRING",
|
||||
required: false,
|
||||
},
|
||||
|
||||
{
|
||||
name: "image",
|
||||
description: "Embed Image URL",
|
||||
type: "STRING",
|
||||
required: false,
|
||||
},
|
||||
],
|
||||
permissions: ["SEND_MESSAGES"],
|
||||
|
||||
async run(interaction) {
|
||||
const { getRole } = interaction.client;
|
||||
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||
let Admin = await getRole(supportbot.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.MessageEmbed()
|
||||
.setTitle("Invalid Permissions!")
|
||||
.setDescription(
|
||||
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
|
||||
)
|
||||
.setColor(supportbot.WarningColour);
|
||||
|
||||
if (
|
||||
interaction.member.roles.cache.has(SupportStaff.id) ||
|
||||
interaction.member.roles.cache.has(Admin.id)
|
||||
) {
|
||||
const EmbedTitle = interaction.options.getString("title");
|
||||
const EmbedSubject = interaction.options.getString("message");
|
||||
const EmbedColour = interaction.options.getString("color");
|
||||
const EmbedThumbnail = interaction.options.getString("thumbnail");
|
||||
const EmbedImage = interaction.options.getString("image");
|
||||
const EmbedFieldContent = interaction.options.getString("fieldcontent");
|
||||
const EmbedFieldTitle = interaction.options.getString("fieldtitle");
|
||||
|
||||
const EmbedMsg = new Discord.MessageEmbed()
|
||||
.setTitle(EmbedTitle)
|
||||
.setDescription(EmbedSubject)
|
||||
.addField(EmbedFieldTitle, EmbedFieldContent)
|
||||
.setColor(EmbedColour)
|
||||
.setThumbnail(EmbedThumbnail)
|
||||
.setImage(EmbedImage);
|
||||
|
||||
interaction.reply({
|
||||
embeds: [EmbedMsg],
|
||||
});
|
||||
} else {
|
||||
return interaction.reply({ embeds: [NoPerms] });
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,89 @@
|
||||
// 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.HelpCommand,
|
||||
description: cmdconfig.HelpCommandDesc,
|
||||
options: [],
|
||||
permissions: ["SEND_MESSAGES"],
|
||||
|
||||
async run(interaction) {
|
||||
const { getRole } = interaction.client;
|
||||
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||
if (!SupportStaff || !Admin)
|
||||
return interaction.reply(
|
||||
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||
);
|
||||
|
||||
let botCommands = "";
|
||||
botCommands += `**/${cmdconfig.HelpCommand}** ${cmdconfig.HelpCommandDesc}\n`;
|
||||
botCommands += `**/${cmdconfig.InfoCommand}** ${cmdconfig.InfoCommandDesc}\n`;
|
||||
botCommands += `**/${cmdconfig.PingCommand}** ${cmdconfig.PingCommandDesc}\n`;
|
||||
botCommands += `**/${cmdconfig.UserInfoCommand}** ${cmdconfig.UserInfoCommandDesc}\n`;
|
||||
|
||||
if (supportbot.DisableSuggestions === false) {
|
||||
botCommands += `**/${cmdconfig.SuggestCommand}** ${cmdconfig.SuggestCommandDesc}\n`;
|
||||
}
|
||||
|
||||
let ticketCommands = "";
|
||||
ticketCommands += `**/${cmdconfig.OpenTicket}** ${cmdconfig.OpenTicketDesc}\n`;
|
||||
ticketCommands += `**/${cmdconfig.CloseTicket}** ${cmdconfig.CloseTicketDesc}\n`;
|
||||
|
||||
let staffCommands = "";
|
||||
staffCommands += `**/${cmdconfig.TicketAdd}** ${cmdconfig.TicketAddDesc}\n`;
|
||||
staffCommands += `**/${cmdconfig.TicketRemove}** ${cmdconfig.TicketRemoveDesc}\n`;
|
||||
staffCommands += `**/${cmdconfig.UserInfoCommand}** ${cmdconfig.UserInfoCommandDesc}\n`;
|
||||
staffCommands += `**/${cmdconfig.TranslateCommand}** ${cmdconfig.TranslateCommandDesc}\n`;
|
||||
|
||||
const HelpEmbed1 = new Discord.MessageEmbed()
|
||||
.setTitle(supportbot.Name + " Commands")
|
||||
.setThumbnail(interaction.user.displayAvatarURL())
|
||||
|
||||
.addFields(
|
||||
{
|
||||
name: "🖥️ General Commands\n",
|
||||
value: `${botCommands}\n`,
|
||||
inline: false,
|
||||
},
|
||||
{
|
||||
name: "🎫 Support Commands\n",
|
||||
value: `${ticketCommands}\n`,
|
||||
inline: false,
|
||||
}
|
||||
)
|
||||
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter({
|
||||
text: supportbot.EmbedFooter,
|
||||
iconURL: interaction.user.displayAvatarURL(),
|
||||
});
|
||||
|
||||
if (
|
||||
interaction.member.roles.cache.has(SupportStaff.id) ||
|
||||
interaction.member.roles.cache.has(Admin.id)
|
||||
) {
|
||||
HelpEmbed1.addFields({
|
||||
name: "🔐 Staff Commands\n",
|
||||
value: `${staffCommands}\n`,
|
||||
inline: false,
|
||||
});
|
||||
}
|
||||
|
||||
interaction.reply({
|
||||
ephemeral: true,
|
||||
embeds: [HelpEmbed1],
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,40 @@
|
||||
// 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 Command = require("../Structures/Command.js");
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.InfoCommand,
|
||||
description: cmdconfig.InfoCommandDesc,
|
||||
options: [],
|
||||
permissions: ["SEND_MESSAGES"],
|
||||
|
||||
async run(interaction) {
|
||||
const InfoButton = new Discord.MessageButton()
|
||||
.setLabel(supportbot.InfoButtonText)
|
||||
.setURL(supportbot.InfoURL)
|
||||
.setStyle("LINK");
|
||||
|
||||
const inforow = new Discord.MessageActionRow().addComponents(InfoButton);
|
||||
|
||||
const InfoEmbed = new Discord.MessageEmbed()
|
||||
.setURL(supportbot.InfoURL)
|
||||
.setTitle(supportbot.InfoTitle)
|
||||
.setDescription(supportbot.AboutMe)
|
||||
.setColor(supportbot.InfoColour);
|
||||
|
||||
interaction.reply({
|
||||
embeds: [InfoEmbed],
|
||||
components: [inforow],
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,32 @@
|
||||
// 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.PingCommand,
|
||||
description: cmdconfig.PingCommandDesc,
|
||||
options: [],
|
||||
permissions: ["SEND_MESSAGES"],
|
||||
|
||||
async run(interaction) {
|
||||
const PingEmbed = new Discord.MessageEmbed()
|
||||
.setDescription(
|
||||
`:ping_pong: **Ping:** \`${interaction.client.ws.ping} ms\``
|
||||
)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
|
||||
interaction.reply({
|
||||
embeds: [PingEmbed],
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,94 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Ticket Remove 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.TicketRemove,
|
||||
description: cmdconfig.TicketRemoveDesc,
|
||||
options: [
|
||||
{
|
||||
name: "user",
|
||||
description: "User to remove",
|
||||
type: "USER",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
permissions: ["SEND_MESSAGES"],
|
||||
|
||||
async run(interaction) {
|
||||
const { getRole } = interaction.client;
|
||||
let Staff = await getRole(supportbot.Staff, interaction.guild);
|
||||
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||
if (!Staff || !Admin)
|
||||
return interaction.reply(
|
||||
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||
);
|
||||
|
||||
const NoPerms = new Discord.MessageEmbed()
|
||||
.setTitle("Invalid Permissions!")
|
||||
.setDescription(
|
||||
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
|
||||
)
|
||||
.setColor(supportbot.WarningColour);
|
||||
|
||||
if (
|
||||
!interaction.member.roles.cache.has(Staff.id) &&
|
||||
!interaction.member.roles.cache.has(Admin.id)
|
||||
)
|
||||
return interaction.reply({ embeds: [NoPerms] });
|
||||
let TicketData = await JSON.parse(
|
||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||
);
|
||||
let ticket = await TicketData.tickets.findIndex(
|
||||
(t) => t.id === interaction.channel.id
|
||||
);
|
||||
if (ticket === -1) {
|
||||
const Exists = new Discord.MessageEmbed()
|
||||
.setTitle("No Ticket Found!")
|
||||
.setDescription(supportbot.NoValidTicket)
|
||||
.setColor(supportbot.WarningColour);
|
||||
return interaction.reply({ ephemeral: true, embeds: [Exists] });
|
||||
}
|
||||
|
||||
let uMember = interaction.options.getUser("user");
|
||||
const UserNotExist = new Discord.MessageEmbed()
|
||||
.setTitle("User Not Found!")
|
||||
.setDescription(
|
||||
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.TicketRemove} <user#0000>\``
|
||||
)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
|
||||
if (!uMember) return interaction.reply({ ephemeral: true, embeds: [UserNotExist] });
|
||||
|
||||
await interaction.channel.permissionOverwrites.edit(uMember.id, {
|
||||
VIEW_CHANNEL: false,
|
||||
});
|
||||
|
||||
const Complete = new Discord.MessageEmbed()
|
||||
.setTitle("User Removed!")
|
||||
.setDescription(supportbot.RemovedUser.replace(/%user%/g, uMember.id))
|
||||
.setTimestamp()
|
||||
.setColor(supportbot.EmbedColour);
|
||||
interaction.reply({ embeds: [Complete] });
|
||||
TicketData.tickets[ticket].subUsers = TicketData.tickets[
|
||||
ticket
|
||||
].subUsers.filter((u) => u !== uMember.id);
|
||||
fs.writeFileSync(
|
||||
"./Data/TicketData.json",
|
||||
JSON.stringify(TicketData, null, 4),
|
||||
(err) => {
|
||||
if (err) console.error(err);
|
||||
}
|
||||
);
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,84 @@
|
||||
// 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.SuggestCommand,
|
||||
description: cmdconfig.SuggestCommandDesc,
|
||||
options: [
|
||||
{
|
||||
name: "suggestion",
|
||||
description: "Create a Suggestion",
|
||||
type: "STRING",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
permissions: ["SEND_MESSAGES"],
|
||||
|
||||
async run(interaction) {
|
||||
const { getChannel } = interaction.client;
|
||||
const suggestChannel = await getChannel(
|
||||
supportbot.SuggestionChannel,
|
||||
interaction.guild
|
||||
);
|
||||
|
||||
const NoChannel = new Discord.MessageEmbed()
|
||||
.setTitle("Missing Channel!")
|
||||
.setDescription(supportbot.InvalidChannel)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
|
||||
if (!suggestChannel) return interaction.reply({ embeds: [NoChannel] });
|
||||
|
||||
let suggestion = interaction.options.getString("suggestion");
|
||||
|
||||
const SuggestEmbed = new Discord.MessageEmbed()
|
||||
.addField("Suggestion", suggestion, true)
|
||||
.addField("From", `<@${interaction.user.id}>`)
|
||||
.setThumbnail(interaction.user.displayAvatarURL())
|
||||
.setFooter({
|
||||
text: supportbot.EmbedFooter,
|
||||
iconURL: interaction.user.displayAvatarURL(),
|
||||
})
|
||||
.setColor(supportbot.EmbedColour);
|
||||
|
||||
const suggestionMsg = await suggestChannel.send({ embeds: [SuggestEmbed] });
|
||||
if (supportbot.SuggestionUpvote && supportbot.SuggestionDownvote) {
|
||||
await suggestionMsg.react(supportbot.SuggestionUpvote);
|
||||
await suggestionMsg.react(supportbot.SuggestionDownvote);
|
||||
|
||||
if (supportbot.SuggestionThreads) {
|
||||
await suggestionMsg.startThread({
|
||||
name: `Suggestion-releated Thread`,
|
||||
autoArchiveDuration: 60,
|
||||
type: 'GUILD_PUBLIC_THREAD',
|
||||
reason: 'Suggestion-releated thread',
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
const Submitted = new Discord.MessageEmbed()
|
||||
.setTitle("Suggestion Submitted!")
|
||||
.setDescription(
|
||||
`:white_check_mark: You have successfully submitted a suggestion.`
|
||||
)
|
||||
.addField("Sent to:", `<#${suggestChannel.id}>`)
|
||||
.setColor(supportbot.SuccessColour);
|
||||
|
||||
return interaction.reply({
|
||||
ephemeral: true,
|
||||
embeds: [Submitted]
|
||||
})
|
||||
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,330 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Ticket Command
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
const {
|
||||
MessageEmbed,
|
||||
Permissions,
|
||||
MessageButton,
|
||||
MessageActionRow,
|
||||
} = 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");
|
||||
const TicketNumberID = require("../Structures/TicketID.js");
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.OpenTicket,
|
||||
description: cmdconfig.OpenTicketDesc,
|
||||
options: [
|
||||
{
|
||||
name: "reason",
|
||||
description: "Ticket Reason",
|
||||
type: "STRING",
|
||||
},
|
||||
],
|
||||
permissions: ["SEND_MESSAGES"],
|
||||
|
||||
async run(interaction) {
|
||||
let disableCommand = true;
|
||||
if (interaction.isCommand() && disableCommand)
|
||||
return interaction.reply({
|
||||
content: "This command is disabled",
|
||||
ephemeral: true,
|
||||
});
|
||||
let department = interaction.customId?.split("-")[1] || null;
|
||||
let TicketData = await JSON.parse(
|
||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||
);
|
||||
const { getRole, getCategory } = interaction.client;
|
||||
let User = interaction.guild.members.cache.get(interaction.user.id);
|
||||
|
||||
if (
|
||||
supportbot.MaxAllowedTickets &&
|
||||
TicketData.tickets.filter((t) => t.user === interaction.user.id && t.open)
|
||||
.length >= supportbot.MaxAllowedTickets
|
||||
) {
|
||||
return interaction.reply({
|
||||
embeds: [
|
||||
{
|
||||
title: "Too Many Tickets!",
|
||||
description: `You can't have more than ${supportbot.MaxAllowedTickets} open tickets!`,
|
||||
color: supportbot.WarningColour,
|
||||
},
|
||||
],
|
||||
ephemeral: true,
|
||||
});
|
||||
}
|
||||
if (
|
||||
User.roles.cache.has(
|
||||
getRole(supportbot.TicketBlackListRole, interaction.guild).id
|
||||
)
|
||||
) {
|
||||
return interaction.reply({
|
||||
content: supportbot.TicketBlackListMessage,
|
||||
ephemeral: true,
|
||||
});
|
||||
}
|
||||
|
||||
// Ticket ID
|
||||
let ticketNumberID = await TicketNumberID.pad();
|
||||
|
||||
// Ticket Subject
|
||||
const TicketSubject =
|
||||
interaction.options?.getString("reason") || supportbot.NoTicketSubject;
|
||||
|
||||
const TicketExists = new MessageEmbed()
|
||||
.setTitle("Ticket Exists!")
|
||||
.setDescription(supportbot.TicketExists);
|
||||
|
||||
if (
|
||||
await interaction.guild.channels.cache.find(
|
||||
(ticketChannel) =>
|
||||
ticketChannel.name === `${supportbot.TicketPrefix}${ticketNumberID}`
|
||||
)
|
||||
) {
|
||||
return await interaction.reply({
|
||||
embeds: [TicketExists],
|
||||
ephemeral: true,
|
||||
});
|
||||
}
|
||||
const Staff = await getRole(supportbot.Staff, interaction.guild);
|
||||
const Admin = await getRole(supportbot.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,
|
||||
});
|
||||
let TicketCategory = await getCategory(
|
||||
supportbot.Departments[department].category || supportbot.TicketCategory,
|
||||
interaction.guild
|
||||
);
|
||||
const ticketChannel = await interaction.guild.channels.create(
|
||||
`${supportbot.TicketPrefix}${ticketNumberID}`,
|
||||
{
|
||||
type: "GUILD_TEXT",
|
||||
parent: TicketCategory.id,
|
||||
permissionOverwrites: [
|
||||
{
|
||||
id: Admin.id,
|
||||
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||
},
|
||||
{
|
||||
id: interaction.user.id,
|
||||
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||
},
|
||||
{
|
||||
id: interaction.guild.id,
|
||||
deny: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||
},
|
||||
],
|
||||
}
|
||||
);
|
||||
if (supportbot.AllowAllStaff) {
|
||||
await ticketChannel.permissionOverwrites.edit(Staff.id, {
|
||||
VIEW_CHANNEL: true,
|
||||
});
|
||||
}
|
||||
if (supportbot.TicketDepartments && !department) {
|
||||
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
||||
SEND_MESSAGES: false,
|
||||
});
|
||||
}
|
||||
await TicketData.tickets.push({
|
||||
id: ticketChannel.id,
|
||||
name: ticketChannel.name,
|
||||
user: interaction.user.id,
|
||||
number: ticketNumberID,
|
||||
reason: TicketSubject,
|
||||
open: true,
|
||||
subUsers: [],
|
||||
});
|
||||
fs.writeFileSync(
|
||||
"./Data/TicketData.json",
|
||||
JSON.stringify(TicketData, null, 4),
|
||||
(err) => {
|
||||
if (err) console.error(err);
|
||||
}
|
||||
);
|
||||
|
||||
const CreatedTicket = new MessageEmbed()
|
||||
.setDescription(
|
||||
supportbot.TicketCreatedAlert.replace(
|
||||
/%ticketauthor%/g,
|
||||
interaction.user.id
|
||||
)
|
||||
.replace(/%ticketid%/g, ticketChannel.id)
|
||||
.replace(/%ticketusername%/g, interaction.user.username)
|
||||
)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
await interaction.reply({ embeds: [CreatedTicket], ephemeral: true });
|
||||
|
||||
if (supportbot.AllowTicketMentions) {
|
||||
await ticketChannel.send(`${interaction.user}`);
|
||||
}
|
||||
|
||||
const TicketMessage = new MessageEmbed()
|
||||
.setTitle(
|
||||
supportbot.Ticket_Title.replace(/%ticketauthor%/g, interaction.user.id)
|
||||
.replace(/%ticketid%/g, ticketChannel.id)
|
||||
.replace(/%ticketusername%/g, interaction.user.username)
|
||||
)
|
||||
.setDescription(
|
||||
supportbot.TicketMessage.replace(/%ticketauthor%/g, interaction.user.id)
|
||||
.replace(/%ticketid%/g, ticketChannel.id)
|
||||
.replace(/%ticketusername%/g, interaction.user.username)
|
||||
)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
|
||||
if (supportbot.TicketSubject === "embed") {
|
||||
if (TicketSubject !== "No Reason Provided.") {
|
||||
TicketMessage.addFields({ name: "Reason", value: TicketSubject });
|
||||
}
|
||||
}
|
||||
|
||||
if (supportbot.TicketSubject === "description") {
|
||||
if (TicketSubject !== "No Reason Provided.") {
|
||||
await ticketChannel.setTopic(
|
||||
`Reason: ${TicketSubject} - User ID: ${interaction.user.id} - Ticket: ${ticketChannel.name}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (supportbot.TicketDepartments && !department) {
|
||||
TicketMessage.addFields({
|
||||
name: "Departments",
|
||||
value: ` **${supportbot.Departments.map((X) => X.title).join("\n")}**`,
|
||||
});
|
||||
}
|
||||
const CloseButton = new MessageButton()
|
||||
.setCustomId("ticketclose")
|
||||
.setLabel("Close")
|
||||
.setStyle(supportbot.TicketCloseColour)
|
||||
.setEmoji(supportbot.TicketCloseEmoji);
|
||||
|
||||
const LockButton = new MessageButton()
|
||||
.setCustomId("ticketlock")
|
||||
.setLabel("Lock")
|
||||
.setStyle(supportbot.TicketLockColour)
|
||||
.setEmoji(supportbot.TicketLockEmoji);
|
||||
|
||||
const row2 = new MessageActionRow().addComponents(CloseButton, LockButton);
|
||||
if (supportbot.TicketDepartments && !department) {
|
||||
try {
|
||||
let buttons = await supportbot.Departments.map((x) =>
|
||||
new MessageButton()
|
||||
.setCustomId("Department" + supportbot.Departments.indexOf(x))
|
||||
.setLabel(x.title)
|
||||
.setStyle(x.color)
|
||||
.setEmoji(x.emoji)
|
||||
);
|
||||
const row = new MessageActionRow().addComponents(buttons);
|
||||
const m = await ticketChannel.send({
|
||||
embeds: [TicketMessage],
|
||||
components: [row],
|
||||
});
|
||||
|
||||
let collector;
|
||||
try {
|
||||
const filter = (i) => i.user.id === interaction.user.id;
|
||||
collector = await m.awaitMessageComponent({
|
||||
filter,
|
||||
max: 1,
|
||||
componentType: "BUTTON",
|
||||
time: supportbot.Timeout * 60000,
|
||||
});
|
||||
} catch (e) {
|
||||
if (e.code === "INTERACTION_COLLECTOR_ERROR") {
|
||||
try {
|
||||
TicketData = await JSON.parse(
|
||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||
);
|
||||
let ticket = await 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 (e) {}
|
||||
return await ticketChannel.delete();
|
||||
}
|
||||
}
|
||||
let num = collector.customId.split("Department")[1];
|
||||
let role = getRole(supportbot.Departments[num].role, interaction.guild);
|
||||
let title = supportbot.Departments[num].title;
|
||||
|
||||
await ticketChannel.permissionOverwrites.edit(role.id, {
|
||||
VIEW_CHANNEL: true,
|
||||
});
|
||||
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
||||
SEND_MESSAGES: true,
|
||||
});
|
||||
|
||||
await collector.reply({
|
||||
embeds: [
|
||||
{
|
||||
description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`,
|
||||
color: supportbot.EmbedColour,
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
if (supportbot.AllowTicketMentions) {
|
||||
await ticketChannel.send("@here");
|
||||
}
|
||||
await collector.message.edit({
|
||||
embeds: [TicketMessage],
|
||||
components: [row2],
|
||||
});
|
||||
} catch (error) {}
|
||||
} else {
|
||||
await ticketChannel.send({
|
||||
embeds: [TicketMessage],
|
||||
components: [row2],
|
||||
});
|
||||
if (department) {
|
||||
let role = await getRole(
|
||||
supportbot.Departments[department].role,
|
||||
interaction.guild
|
||||
);
|
||||
let title = supportbot.Departments[department].title;
|
||||
await ticketChannel.permissionOverwrites.edit(role.id, {
|
||||
VIEW_CHANNEL: true,
|
||||
});
|
||||
let TicketCat = await getCategory(
|
||||
supportbot.Departments[department].category ||
|
||||
supportbot.TicketCategory,
|
||||
interaction.guild
|
||||
);
|
||||
await ticketChannel.setParent(TicketCat.id, { lockPermissions: false });
|
||||
if (supportbot.AllowThanksForReachingOutMessage) {
|
||||
await ticketChannel.send({
|
||||
embeds: [
|
||||
{
|
||||
description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`,
|
||||
color: supportbot.EmbedColour,
|
||||
},
|
||||
],
|
||||
});
|
||||
}
|
||||
}
|
||||
if (supportbot.AllowTicketMentions) {
|
||||
await ticketChannel.send("@here");
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,108 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Ticket Add 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");
|
||||
const translate = require("@vitalets/google-translate-api");
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.TranslateCommand, // Name of command
|
||||
description: cmdconfig.TranslateCommandDesc, // Description of command
|
||||
options: [
|
||||
{
|
||||
type: "STRING",
|
||||
name: "language",
|
||||
description: "A 2 letter language code",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
type: "STRING",
|
||||
name: "text",
|
||||
description: "The text to translate",
|
||||
required: true,
|
||||
}, // The input text for the translation
|
||||
],
|
||||
permissions: ["SEND_MESSAGES"], // The permission the user/role at least requires
|
||||
|
||||
async run(interaction) {
|
||||
|
||||
const { getRole } = interaction.client;
|
||||
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||
if (!SupportStaff || !Admin)
|
||||
return interaction.reply(
|
||||
"Some roles seem to be missing!\nPlease check the error logs."
|
||||
);
|
||||
|
||||
const NoPerms = new Discord.MessageEmbed()
|
||||
.setTitle("Invalid Permissions!")
|
||||
.setDescription(
|
||||
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
|
||||
)
|
||||
.setColor(supportbot.WarningColour);
|
||||
|
||||
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.TranslateLogChannel,
|
||||
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.MessageEmbed()
|
||||
.setColor(supportbot.WarningColour)
|
||||
.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.MessageEmbed()
|
||||
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.displayAvatarURL({ dynamic: true }) })
|
||||
.setColor(supportbot.SuccessColour)
|
||||
.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,127 @@
|
||||
// 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 Command = require("../Structures/Command.js");
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.UserInfoCommand, // Name of command
|
||||
description: cmdconfig.UserInfoCommandDesc, // Description of command
|
||||
options: [
|
||||
{
|
||||
type: "USER",
|
||||
name: "user",
|
||||
description: "The user you want to get info about.",
|
||||
required: true,
|
||||
}, // The user input
|
||||
],
|
||||
permissions: ["SEND_MESSAGES"], // The permission the user/role at least requires
|
||||
|
||||
async run(interaction) {
|
||||
const { getRole } = interaction.client;
|
||||
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||
if (!SupportStaff || !Admin)
|
||||
return interaction.reply(
|
||||
"Some roles seem to be missing!\nPlease check the error logs."
|
||||
);
|
||||
|
||||
const NoPerms = new Discord.MessageEmbed()
|
||||
.setTitle("Invalid Permissions!")
|
||||
.setDescription(
|
||||
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
|
||||
)
|
||||
.setColor(supportbot.WarningColour);
|
||||
|
||||
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.MessageEmbed()
|
||||
.setTitle("User Not Found!")
|
||||
.setDescription(
|
||||
`${supportbot.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.MessageEmbed()
|
||||
.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.EmbedFooter })
|
||||
.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,45 @@
|
||||
# ___ _ ___ _
|
||||
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||
# |_| |_|
|
||||
#
|
||||
# SupportBot created by Emerald Services
|
||||
# Installed with MIT License
|
||||
#
|
||||
# Discord Support: https://emeraldsrv.dev/discord
|
||||
# Community Resources: https://emeraldsrv.dev/resources
|
||||
|
||||
# -------------------------------
|
||||
# Command Name Configuration
|
||||
# -------------------------------
|
||||
|
||||
Blacklist: "blacklist"
|
||||
TicketAdd: "add"
|
||||
TicketRemove: "remove"
|
||||
OpenTicket: "ticket"
|
||||
CloseTicket: "close"
|
||||
InfoCommand: "info"
|
||||
PingCommand: "ping"
|
||||
HelpCommand: "help"
|
||||
EmbedCommand: "embed"
|
||||
SuggestCommand: "suggestion"
|
||||
TranslateCommand: "translate"
|
||||
UserInfoCommand: "userinfo"
|
||||
|
||||
# ---------------------------------------
|
||||
# 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,259 @@
|
||||
# ___ _ ___ _
|
||||
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||
# |_| |_|
|
||||
#
|
||||
# SupportBot created by Emerald Services
|
||||
# Installed with MIT License
|
||||
#
|
||||
# Discord Support: https://emeraldsrv.dev/discord
|
||||
# Community Resources: https://emeraldsrv.dev/resources
|
||||
|
||||
SupportBot_Version: "7.7 BETA-v2"
|
||||
|
||||
# -------------------------
|
||||
# General Configuration
|
||||
# -------------------------
|
||||
|
||||
Name: "SupportBot"
|
||||
Token: "BOT_TOKEN_HERE"
|
||||
|
||||
# -------------------------
|
||||
# Activity Configuration
|
||||
# -------------------------
|
||||
|
||||
BotActivity: "Need Help? /ticket"
|
||||
|
||||
StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME"
|
||||
# Set The ActivityType to "STREAMING" for a streaming status!
|
||||
|
||||
ActivityType: "PLAYING"
|
||||
# Activity status can either be PLAYING, WATCHING, LISTENING or STREAMING.
|
||||
|
||||
# -------------------------
|
||||
# Embed Configuration
|
||||
# -------------------------
|
||||
|
||||
EmbedColour: "#f74343"
|
||||
EmbedFooter: "SupportBot | An Advanced Ticket System"
|
||||
|
||||
ErrorColour: "#d12519"
|
||||
SuccessColour: "#04b545"
|
||||
WarningColour: "#fca117"
|
||||
|
||||
# -------------------------
|
||||
# Information Configuration
|
||||
# -------------------------
|
||||
|
||||
InfoTitle: "Information"
|
||||
AboutMe: "Hi, I'm SupportBot an advanced discord ticket bot with 100% customization! [Download](https://emeraldsrv.dev/download)"
|
||||
|
||||
InfoButtonText: "Visit Site"
|
||||
InfoURL: "https://emeraldsrv.dev"
|
||||
InfoColour: "#f74343"
|
||||
|
||||
# -------------------------
|
||||
# Role Configuration
|
||||
# -------------------------
|
||||
|
||||
AutoRole: true
|
||||
JoinRole: "Member"
|
||||
|
||||
Staff: "Staff"
|
||||
Admin: "Admin"
|
||||
TicketBlackListRole: "Blacklisted"
|
||||
|
||||
# ----------------------------
|
||||
# Join/Leave Configuration
|
||||
# ----------------------------
|
||||
|
||||
Welcome: true
|
||||
# set to false to disable joining logs
|
||||
|
||||
WelcomeChannel: "join-leave-logs"
|
||||
WelcomeColour: "#f74343"
|
||||
WelcomeTitle: "User Joined!"
|
||||
WelcomeMessage: "%joined_user% has joined the server!"
|
||||
# Available Placeholders:
|
||||
# %joined_user% - Mentions the user who joined
|
||||
|
||||
EmbedWelcomeImage: true
|
||||
EmbedWelcomeImageURL: "https://media.discordapp.net/attachments/958247876344025108/986777740738986094/unknown.png"
|
||||
|
||||
EmbedWelcomeThumbnail: "BOT"
|
||||
# "USER" will display the user's profile picture.
|
||||
# "BOT" will display the bot's profile picture.
|
||||
# false to disable
|
||||
|
||||
Leave: true
|
||||
# set to false to disable leaving logs
|
||||
|
||||
LeaveChannel: "join-leave-logs"
|
||||
LeaveColour: "#f74343"
|
||||
LeaveTitle: "User Left!"
|
||||
LeaveMessage: "%joined_user% has left the server!"
|
||||
# Available Placeholders:
|
||||
# %joined_user% - Mentions the user who joined
|
||||
|
||||
EmbedLeaveImage: true
|
||||
EmbedLeaveImageURL: "https://cdn.discordapp.com/attachments/958247876344025108/986778170223120384/unknown.png"
|
||||
|
||||
EmbedLeaveThumbnail: false
|
||||
# "USER" will display the user's profile picture.
|
||||
# "BOT" will display the bot's profile picture.
|
||||
# false to disable
|
||||
|
||||
|
||||
# ----------------------------
|
||||
# Suggestions Configuration
|
||||
# ----------------------------
|
||||
|
||||
SuggestionChannel: "suggestions"
|
||||
SuggestionUpvote: "✅"
|
||||
SuggestionDownvote: "❌"
|
||||
|
||||
SuggestionThreads: true
|
||||
# set to false to disable threads being created from suggestions.
|
||||
|
||||
DisableSuggestions: false
|
||||
# Set to true to disable the suggestiosn feature.
|
||||
|
||||
# -------------------------
|
||||
# Translate Configuration
|
||||
# -------------------------
|
||||
|
||||
TranslateLogChannel: "translations-log"
|
||||
|
||||
# -------------------------
|
||||
# Tickets Configuration
|
||||
# -------------------------
|
||||
|
||||
TicketCategory: "Tickets" # Only for tickets without a category
|
||||
TicketPrefix: "ticket-" # The prefix for ticket channel names
|
||||
|
||||
TicketLog: "ticket-data"
|
||||
TranscriptLog: "ticket-data"
|
||||
|
||||
DMTranscripts: true
|
||||
TranscriptTitle: "Ticket Transcript"
|
||||
TicketLog_Title: "Ticket Closed"
|
||||
TicketBlackListMessage: "You are not allowed to open a ticket"
|
||||
|
||||
MaxAllowedTickets: 2
|
||||
|
||||
TicketSubject: "description"
|
||||
# "description" will display the ticket reason within the channel description
|
||||
# "embed" will display the ticket reason within the ticket embed
|
||||
|
||||
AllowTicketMentions: true
|
||||
# Set to true to allow the ticket to mention the author and the support team.
|
||||
# Set false to dis-allow mentions within tickets.
|
||||
|
||||
AllowThanksForReachingOutMessage: true
|
||||
# Set to true to allow the "Thanks for reaching out Message" to be sent when the ticket is created
|
||||
DisableTicketLogChannel: false
|
||||
# Set to true to disable the requirement of the "TicketLog"
|
||||
# Set to true to also disable the ticket logs to be sent in the "TicketLogs" channel
|
||||
|
||||
# --- Creation Config ---
|
||||
# --- Start ---
|
||||
|
||||
# Available Placeholders:
|
||||
|
||||
# %ticketusername% - User who created the ticket.
|
||||
# <@%ticketauthor%> - Tags the user who created the ticket.
|
||||
# <#%ticketid%> - Mentions the ticket channel.
|
||||
|
||||
Ticket_Title: "Server Support | %ticketusername%"
|
||||
TicketMessage: "Hello <@%ticketauthor%>, Thank you for creating a support ticket\nPlease wait patiently whilst a member of our team reaches out to you."
|
||||
|
||||
Ticket_Thumbnail: "https://images.emojiterra.com/google/android-pie/512px/1f39f.png"
|
||||
NoTicketSubject: "No Reason Provided!"
|
||||
|
||||
TicketCreatedAlert: ":ticket: Your support ticket has been created: <#%ticketid%>"
|
||||
|
||||
AddedUser: "👍 <@%user%> has been added to this ticket"
|
||||
RemovedUser: "👍 <@%user%> has been removed from this ticket"
|
||||
|
||||
# --- Buttons Config ---
|
||||
# --- Start ---
|
||||
|
||||
# Discord Button Colour Selection
|
||||
# PRIMARY - Blue
|
||||
# SECONDARY - Grey
|
||||
# DANGER - Red
|
||||
# SUCCESS - Green
|
||||
|
||||
LockTicketCategory: "Archive"
|
||||
|
||||
TicketCloseEmoji: "❌"
|
||||
TicketDeleteEmoji: "⛔"
|
||||
TicketLockEmoji: "🔒"
|
||||
|
||||
TicketCloseColour: "DANGER"
|
||||
TicketDeleteColour: "DANGER"
|
||||
TicketLockColour: "PRIMARY"
|
||||
|
||||
TranscriptSavedMessage: "📝 **Transcript Saved!**"
|
||||
TicketLockMessage: "❌ **Ticket Locked!**"
|
||||
TicketDeleteMessage: "⚠ **Ticket Deleting!**" # Tickets deleting after 5 seconds by default.
|
||||
|
||||
# --- Departments Config ---
|
||||
# --- Start ---
|
||||
|
||||
TicketDepartments: true
|
||||
# Delete the ticket if no department selected. TIME IN MINUTES
|
||||
Timeout: 5
|
||||
# Set to true to allow all staff to access the ticket
|
||||
AllowAllStaff: false
|
||||
|
||||
# Ticket roles are the roles that will be able to gain access to tickets depending on what department has been chosen.
|
||||
|
||||
Departments:
|
||||
- title: "Support"
|
||||
role: "Staff"
|
||||
color: "SECONDARY"
|
||||
emoji: "1️⃣"
|
||||
category: "Billing Support"
|
||||
|
||||
- title: "Billing Support"
|
||||
role: "Staff"
|
||||
color: "SECONDARY"
|
||||
emoji: "2️⃣"
|
||||
category: "Admin Team"
|
||||
|
||||
- title: "Admin Team"
|
||||
role: "Admin"
|
||||
color: "SECONDARY"
|
||||
emoji: "3️⃣"
|
||||
category: "Admin Support"
|
||||
# - title: "Other"
|
||||
# role: "Staff"
|
||||
# color: "SECONDARY"
|
||||
# emoji: "3️⃣"
|
||||
# category: "Tickets"
|
||||
|
||||
# Discord Button Colour Selection
|
||||
# PRIMARY - Blurple
|
||||
# SECONDARY - Grey
|
||||
# DANGER - Red
|
||||
# SUCCESS - Green
|
||||
|
||||
# --- Closing Config ---
|
||||
# --- Start ---
|
||||
|
||||
StaffOnly: true
|
||||
ClosingTicket: ":warning: You have requested to close your support ticket."
|
||||
ClosingConfirmation_Word: "confirm"
|
||||
CloseConfirmation: true
|
||||
|
||||
# ---------------------------
|
||||
# Error / Warning Messages
|
||||
# ---------------------------
|
||||
|
||||
IncorrectPerms: ":x: **Err!** You do not have the correct permissions to use this command."
|
||||
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,41 @@
|
||||
# ___ _ ___ _
|
||||
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||
# |_| |_|
|
||||
#
|
||||
# SupportBot created by Emerald Services
|
||||
# Installed with MIT License
|
||||
#
|
||||
# Discord Support: https://emeraldsrv.dev/discord
|
||||
# Community Resources: https://emeraldsrv.dev/resources
|
||||
|
||||
# -------------------------------
|
||||
# Ticket Panel Configuration
|
||||
# -------------------------------
|
||||
|
||||
TicketPanel: true
|
||||
|
||||
# ----------------------------------------
|
||||
# Ticket Panel Message Configuration
|
||||
# ----------------------------------------
|
||||
|
||||
Channel: "▣┃ticket-creation"
|
||||
ButtonEmoji: "📩"
|
||||
ButtonLabel: "Create Ticket"
|
||||
ButtonColour: "SUCCESS"
|
||||
# Colour Options:
|
||||
# -> PRIMARY - Purple
|
||||
# -> SECONDARY - Grey
|
||||
# -> SUCCESS - Green
|
||||
# -> DANGER - Red
|
||||
|
||||
PanelTitle: "Need Help? Create a Support Ticket."
|
||||
|
||||
TicketPanel_Description: true
|
||||
TicketPanel_Thumbnail: true
|
||||
TicketPanel_Image: true
|
||||
|
||||
PanelMessage: "Click the button to open a new support ticket."
|
||||
PanelThumbnail: "https://i.imgur.com/ieeZejl.png"
|
||||
PanelImage: "https://i.imgur.com/5NkcmDq.png"
|
||||
Vendored
BIN
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"tickets": []
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"id":0,"TicketPanelID":""}
|
||||
-18
@@ -1,18 +0,0 @@
|
||||
FROM node:alpine
|
||||
|
||||
MAINTAINER Thien Tran, <contact@thientran.io>
|
||||
|
||||
RUN apk update \
|
||||
&& apk upgrade
|
||||
|
||||
RUN apk add --no-cache git && \
|
||||
adduser -D -h /home/container container
|
||||
|
||||
# Ensure UTF-8
|
||||
ENV LANG en_US.UTF-8
|
||||
ENV LC_ALL en_US.UTF-8
|
||||
|
||||
WORKDIR /home/container
|
||||
|
||||
COPY ./entrypoint.sh /entrypoint.sh
|
||||
CMD ["/bin/ash", "/entrypoint.sh"]
|
||||
@@ -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,46 @@
|
||||
|
||||
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")
|
||||
);
|
||||
|
||||
module.exports = new Event("guildMemberAdd", async (client, member, interaction, guild) => {
|
||||
|
||||
if (supportbot.Welcome) {
|
||||
const WelcomeChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.WelcomeChannel)
|
||||
|
||||
const WelcomeEmbed = new Discord.MessageEmbed()
|
||||
.setColor(supportbot.WelcomeColour)
|
||||
.setTitle(supportbot.WelcomeTitle)
|
||||
.setDescription(supportbot.WelcomeMessage.replace(/%joined_user%/g, member.user))
|
||||
.setTimestamp();
|
||||
|
||||
if (supportbot.EmbedWelcomeThumbnail === "BOT") {
|
||||
WelcomeEmbed.setThumbnail(client.user.displayAvatarURL())
|
||||
}
|
||||
|
||||
if (supportbot.EmbedWelcomeThumbnail === "USER") {
|
||||
WelcomeEmbed.setThumbnail(member.user.displayAvatarURL())
|
||||
}
|
||||
|
||||
if (supportbot.EmbedWelcomeImage) {
|
||||
WelcomeEmbed.setImage(supportbot.EmbedWelcomeImageURL)
|
||||
}
|
||||
|
||||
WelcomeChannel.send({
|
||||
embeds: [WelcomeEmbed]
|
||||
})
|
||||
|
||||
if (supportbot.AutoRole) {
|
||||
var role = member.guild.roles.cache.find(role => role.name === supportbot.JoinRole);
|
||||
member.roles.add(role);
|
||||
}
|
||||
|
||||
console.log(`\u001b[32m`, `[+]`, `\u001b[33m`, `${member.user.username} joined the server!`)
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
@@ -0,0 +1,41 @@
|
||||
|
||||
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")
|
||||
);
|
||||
|
||||
module.exports = new Event("guildMemberRemove", async (client, member, interaction, guild) => {
|
||||
|
||||
if (supportbot.Leave) {
|
||||
const LeaveChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.LeaveChannel)
|
||||
|
||||
const LeaveEmbed = new Discord.MessageEmbed()
|
||||
.setColor(supportbot.LeaveColour)
|
||||
.setTitle(supportbot.LeaveTitle)
|
||||
.setDescription(supportbot.LeaveMessage.replace(/%joined_user%/g, member.user))
|
||||
.setTimestamp();
|
||||
|
||||
if (supportbot.EmbedLeaveThumbnail === "BOT") {
|
||||
LeaveEmbed.setThumbnail(client.user.displayAvatarURL())
|
||||
}
|
||||
|
||||
if (supportbot.EmbedLeaveThumbnail === "USER") {
|
||||
LeaveEmbed.setThumbnail(member.user.displayAvatarURL())
|
||||
}
|
||||
|
||||
if (supportbot.EmbedLeaveImage) {
|
||||
LeaveEmbed.setImage(supportbot.EmbedLeaveImageURL)
|
||||
}
|
||||
|
||||
LeaveChannel.send({
|
||||
embeds: [LeaveEmbed]
|
||||
})
|
||||
|
||||
console.log(`\u001b[31m`, `[-]`, `\u001b[33m`, `${member.user.username} joined the server!`)
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Interaction Create Event
|
||||
|
||||
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 Event = require("../Structures/Event.js");
|
||||
|
||||
module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||
if (interaction.isCommand()) {
|
||||
const command = client.commands.find(
|
||||
(cmd) => cmd.name.toLowerCase() === interaction.commandName
|
||||
);
|
||||
|
||||
if (interaction.user.bot || !interaction.guild) return;
|
||||
|
||||
const NotValid = new Discord.MessageEmbed()
|
||||
.setDescription(`:x: \`Invalid Command\` `)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
|
||||
if (!command)
|
||||
return interaction.reply({
|
||||
embeds: [NotValid],
|
||||
});
|
||||
|
||||
const permission = interaction.member.permissions.has(command.permissions);
|
||||
|
||||
const ValidPerms = new Discord.MessageEmbed()
|
||||
.setDescription(
|
||||
":x: `Invalid Permissions` Do you have the correct permissions to execute this command?"
|
||||
)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
|
||||
if (!permission)
|
||||
return interaction.reply({
|
||||
embeds: [ValidPerms],
|
||||
});
|
||||
command.run(interaction);
|
||||
}
|
||||
if (interaction.isButton()) {
|
||||
if (
|
||||
interaction.customId === "openticket" ||
|
||||
interaction.customId.includes("department-")
|
||||
) {
|
||||
try {
|
||||
const cmd = client.commands.get(cmdconfig.OpenTicket);
|
||||
if (!cmd) return;
|
||||
cmd.run(interaction);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
if (interaction.customId === "ticketclose") {
|
||||
try {
|
||||
const cmd = client.commands.get(cmdconfig.CloseTicket);
|
||||
if (!cmd) return;
|
||||
cmd.run(interaction);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
if (interaction.customId === "ticketlock") {
|
||||
if (interaction.channel.name.startsWith(supportbot.TicketPrefix)) {
|
||||
interaction.message.fetch();
|
||||
let Admin =
|
||||
interaction.guild.roles.cache.find(
|
||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
||||
);
|
||||
if (!interaction.member.roles.cache.has(Admin.id)) {
|
||||
return await interaction.reply({
|
||||
content: "You don't have permission to do that.",
|
||||
ephemeral: true,
|
||||
});
|
||||
}
|
||||
let all = interaction.channel.permissionOverwrites.cache;
|
||||
|
||||
let parent =
|
||||
interaction.guild.channels.cache.find(
|
||||
(c) => c.name === supportbot.LockTicketCategory
|
||||
) ||
|
||||
interaction.guild.channels.cache.find(
|
||||
(c) => c.id === supportbot.LockTicketCategory
|
||||
);
|
||||
if (parent) {
|
||||
await interaction.channel.setParent(parent.id);
|
||||
}
|
||||
|
||||
all.forEach((perm) => {
|
||||
interaction.channel.permissionOverwrites.delete(perm.id);
|
||||
});
|
||||
await interaction.channel.permissionOverwrites.create(Admin.id, {
|
||||
VIEW_CHANNEL: true,
|
||||
});
|
||||
|
||||
await interaction.channel.permissionOverwrites.create(
|
||||
interaction.guild.id,
|
||||
{
|
||||
VIEW_CHANNEL: false,
|
||||
}
|
||||
);
|
||||
|
||||
const ticketDeleteButton = new Discord.MessageButton()
|
||||
.setCustomId("ticketclose")
|
||||
.setLabel("Close")
|
||||
.setStyle(supportbot.TicketDeleteColour)
|
||||
.setEmoji(supportbot.TicketDeleteEmoji);
|
||||
|
||||
const row = new Discord.MessageActionRow().addComponents(
|
||||
ticketDeleteButton
|
||||
);
|
||||
const ArchiveEmbed = new Discord.MessageEmbed()
|
||||
.setTitle("Archived")
|
||||
.setDescription(`Archived ${interaction.channel.name}`)
|
||||
.setColor(supportbot.SuccessColour);
|
||||
|
||||
interaction.reply({ embeds: [ArchiveEmbed] });
|
||||
interaction.message.edit({ components: [row] });
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
+222
@@ -0,0 +1,222 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Ready Event
|
||||
|
||||
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 panelconfig = yaml.load(
|
||||
fs.readFileSync("./Configs/ticket-panel.yml", "utf8")
|
||||
);
|
||||
|
||||
const Event = require("../Structures/Event.js");
|
||||
|
||||
module.exports = new Event("ready", async (client, interaction) => {
|
||||
const { getRole, getChannel, getCategory } = client;
|
||||
client.user.setActivity(supportbot.BotActivity, {
|
||||
type: supportbot.ActivityType,
|
||||
url: supportbot.StreamingURL,
|
||||
});
|
||||
|
||||
console.log(`\u001b[32m`, `┏━━━┓╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓┏━━┓╋╋╋┏┓`);
|
||||
console.log(`\u001b[32m`, `┃┏━┓┃╋╋╋╋╋╋╋╋╋╋╋╋┏┛┗┫┏┓┃╋╋┏┛┗┓`);
|
||||
console.log(`\u001b[32m`, `┃┗━━┳┓┏┳━━┳━━┳━━┳┻┓┏┫┗┛┗┳━┻┓┏┛`);
|
||||
console.log(`\u001b[32m`, `┗━━┓┃┃┃┃┏┓┃┏┓┃┏┓┃┏┫┃┃┏━┓┃┏┓┃┃`);
|
||||
console.log(`\u001b[32m`, `┃┗━┛┃┗┛┃┗┛┃┗┛┃┗┛┃┃┃┗┫┗━┛┃┗┛┃┗┓`);
|
||||
console.log(`\u001b[32m`, `┗━━━┻━━┫┏━┫┏━┻━━┻┛┗━┻━━━┻━━┻━┛`);
|
||||
console.log(`\u001b[32m`, `┗╋╋╋╋╋╋╋┃┃╋┃┃`);
|
||||
console.log(`\u001b[32m`, `╋╋╋╋╋╋╋┗┛╋┗┛`);
|
||||
console.log(` `);
|
||||
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||
console.log(` `);
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`${supportbot.Name} | v${supportbot.SupportBot_Version}`,
|
||||
`\u001b[36m`,
|
||||
`Connected to Discord`
|
||||
);
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`Invite to your server:`,
|
||||
`\u001b[36m`,
|
||||
`https://discord.com/api/oauth2/authorize?client_id=` +
|
||||
client.user.id +
|
||||
`&permissions=8&scope=bot%20applications.commands`
|
||||
);
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`Resources:`,
|
||||
`\u001b[36m`,
|
||||
`https://emeraldsrv.dev/resources`
|
||||
);
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`Documentation:`,
|
||||
`\u001b[36m`,
|
||||
`https://emeraldsrv.dev/wiki/supportbot`
|
||||
);
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`Discord:`,
|
||||
`\u001b[36m`,
|
||||
`https://emeraldsrv.dev/discord`
|
||||
);
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`Hosting:`,
|
||||
`\u001b[36m`,
|
||||
`https://emeraldsrv.dev/hosting`
|
||||
);
|
||||
console.log(` `);
|
||||
console.log(`\u001b[37m`, `SupportBot proudly created by Emerald Services`);
|
||||
console.log(` `);
|
||||
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||
|
||||
|
||||
|
||||
|
||||
const roles = [
|
||||
supportbot.Admin,
|
||||
supportbot.Staff,
|
||||
supportbot.TicketBlackListRole,
|
||||
];
|
||||
if (supportbot.TicketDepartments) {
|
||||
supportbot.Departments.forEach((department) => roles.push(department.role));
|
||||
}
|
||||
if (supportbot.AutoRole) roles.push(supportbot.JoinRole);
|
||||
const channels = [
|
||||
supportbot.SuggestionChannel,
|
||||
supportbot.TicketLog,
|
||||
supportbot.TranscriptLog,
|
||||
panelconfig.Channel,
|
||||
supportbot.WelcomeChannel,
|
||||
supportbot.LeaveChannel,
|
||||
supportbot.TranslateLogChannel
|
||||
];
|
||||
const categories = [supportbot.TicketCategory];
|
||||
|
||||
const missingC = [];
|
||||
const missingR = [];
|
||||
const missingCat = [];
|
||||
for (let c of channels) {
|
||||
if ((c === supportbot.SuggestionChannel && supportbot.DisableSuggestionsChannel) || c === supportbot.TicketLog && supportbot.DisableTicketLogChannel) {
|
||||
continue;
|
||||
}
|
||||
const find = await getChannel(c, client.guilds.cache.first());
|
||||
if (!find) missingC.push(c);
|
||||
}
|
||||
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[33m",
|
||||
`[WARN] The following Roles could not be found! Please check your configs!\n${missingR.join(
|
||||
", "
|
||||
)}`
|
||||
);
|
||||
}
|
||||
|
||||
if (missingC.length > 0) {
|
||||
console.log(
|
||||
"\u001b[33m",
|
||||
`[WARN] The following Channels could not be found! Please check your configs!\n${missingC.join(
|
||||
", "
|
||||
)}`
|
||||
);
|
||||
}
|
||||
if (missingCat.length > 0) {
|
||||
console.log(
|
||||
"\u001b[33m",
|
||||
`[WARN] The following Categories could not be found! Please check your configs!\n${missingCat.join(
|
||||
", "
|
||||
)}`
|
||||
);
|
||||
}
|
||||
if (panelconfig.TicketPanel) {
|
||||
let chan1 = await client.getChannel(
|
||||
panelconfig.Channel,
|
||||
client.guilds.cache.first()
|
||||
);
|
||||
|
||||
if (!chan1) {
|
||||
console.log(
|
||||
"\u001b[33m",
|
||||
"[WARN] Ticket reaction panel is not setup, You can do so via the configuration file!"
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
const panelid = JSON.parse(
|
||||
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
||||
);
|
||||
|
||||
chan1.messages.fetch(panelid.TicketPanelID).catch(async () => {
|
||||
let embed = new Discord.MessageEmbed()
|
||||
.setTitle(panelconfig.PanelTitle)
|
||||
.setColor(supportbot.SuccessColour)
|
||||
.setFooter({
|
||||
text: supportbot.EmbedFooter,
|
||||
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);
|
||||
}
|
||||
let button;
|
||||
if (supportbot.TicketDepartments) {
|
||||
button = supportbot.Departments.map((x) =>
|
||||
new Discord.MessageButton()
|
||||
.setCustomId("department-" + supportbot.Departments.indexOf(x))
|
||||
.setLabel(x.title)
|
||||
.setStyle(x.color)
|
||||
.setEmoji(x.emoji)
|
||||
);
|
||||
} else {
|
||||
button = new Discord.MessageButton()
|
||||
.setLabel(panelconfig.ButtonLabel)
|
||||
.setCustomId("openticket")
|
||||
.setStyle(panelconfig.ButtonColour)
|
||||
.setEmoji(panelconfig.ButtonEmoji);
|
||||
}
|
||||
let row = new Discord.MessageActionRow().addComponents(button);
|
||||
|
||||
await chan1
|
||||
.send({
|
||||
embeds: [embed],
|
||||
components: [row],
|
||||
})
|
||||
.then((r) => {
|
||||
let data = {
|
||||
id: panelid.id,
|
||||
TicketPanelID: r.id,
|
||||
};
|
||||
fs.writeFileSync(
|
||||
"./Data/ticket-panel-id.json",
|
||||
JSON.stringify(data),
|
||||
"utf8"
|
||||
);
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log("Raw: " + e);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 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,3 +1,12 @@
|
||||
<h1 align="center">SupportBot</h1>
|
||||
<p align="center">Created by Emerald Services</p>
|
||||
<h4 align="center">Our documentation is currently being rewritten, This will be updated once we push the next update (5.1). If you require our assitance please contact us in discord. https://discord.gg/bXjdkr8</h4>
|
||||

|
||||
|
||||
## What is SupportBot?
|
||||
|
||||
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.
|
||||
|
||||
## Quick Links
|
||||
|
||||
**|** [Discord](https://emeraldsrv.dev/discord) **|**
|
||||
[Hosting](https://emeraldsrv.dev/hosting) **|**
|
||||
[Documentation](https://emeraldsrv.dev/wiki/supportbot) **|**
|
||||
[Download via MC-Market](https://www.mc-market.org/resources/8940/) **|**
|
||||
@@ -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,126 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Client Structure
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const intents = new Discord.Intents(32767);
|
||||
|
||||
const yaml = require("js-yaml");
|
||||
const supportbot = yaml.load(
|
||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||
);
|
||||
|
||||
class Client extends Discord.Client {
|
||||
constructor() {
|
||||
super({ intents });
|
||||
|
||||
this.commands = new Discord.Collection();
|
||||
}
|
||||
async getChannel(channel, guild) {
|
||||
return guild.channels.cache.find(
|
||||
(c) =>
|
||||
(c.type === "GUILD_TEXT" || c.type === "GUILD_NEWS") &&
|
||||
(c.id === channel || c.name.toLowerCase() === channel.toLowerCase())
|
||||
);
|
||||
}
|
||||
async getRole(role, guild) {
|
||||
return guild.roles.cache.find(
|
||||
(r) => r.id === role || r.name.toLowerCase() === role.toLowerCase()
|
||||
);
|
||||
}
|
||||
async getCategory(category, guild) {
|
||||
return guild.channels.cache.find(
|
||||
(c) =>
|
||||
c.type === "GUILD_CATEGORY" &&
|
||||
(c.id === category || c.name.toLowerCase() === category.toLowerCase())
|
||||
);
|
||||
}
|
||||
|
||||
async start(token) {
|
||||
var tempCommandFiles = fs.readdirSync("./Commands").filter((file) => file.endsWith(".js"));
|
||||
|
||||
if (supportbot.DisableSuggestions) {
|
||||
tempCommandFiles = tempCommandFiles.filter(item => item !== "suggest.js");
|
||||
}
|
||||
|
||||
const commandFiles = tempCommandFiles;
|
||||
|
||||
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;
|
||||
});
|
||||
|
||||
const commands = commandFiles.map((file) => require(`../Commands/${file}`));
|
||||
|
||||
// Commands
|
||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
||||
|
||||
commands.forEach((cmd) => {
|
||||
console.log(`\u001b[31;1m`, `${cmd.name}`, `\u001b[32;1m`, "Loaded");
|
||||
this.commands.set(cmd.name, cmd);
|
||||
});
|
||||
|
||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
||||
// Addons
|
||||
console.log(" ");
|
||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬");
|
||||
|
||||
addons.forEach((addon) => {
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`[ADDON]`,
|
||||
`\u001b[31;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[32;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[31;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,62 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Add
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client()
|
||||
|
||||
const fs = require("fs")
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = (bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Add_Command}`);
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === supportbot.StaffRole);
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||
|
||||
const donothaverole = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
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(supportbot.EmbedColour);
|
||||
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) 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(supportbot.EmbedColour);
|
||||
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(supportbot.EmbedColour);
|
||||
|
||||
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(supportbot.EmbedColour)
|
||||
.setTitle("User Added")
|
||||
.setDescription(`👍 ${rUser} has been added to this ticket`)
|
||||
.setTimestamp();
|
||||
message.channel.send({embed: useradded});
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Add_Command,
|
||||
};
|
||||
@@ -1,54 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Announce (including @everyone)
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
const fs = require("fs")
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = (bot, message, args) => {
|
||||
message.delete();
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Announcement_Command}`);
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
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 **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
||||
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle(`${supportbot.Announcement_Title}`)
|
||||
.setDescription(args.join(" "))
|
||||
.setTimestamp()
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
|
||||
|
||||
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${supportbot.Announcement_Channel}`)
|
||||
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Announcement_Channel}**`)
|
||||
|
||||
ac.send("@everyone").then((msg) => {
|
||||
ac.send(embed);
|
||||
});
|
||||
|
||||
const AccSuccessEmbed = new Discord.RichEmbed()
|
||||
.setTitle("Announcement Created")
|
||||
.setDescription(`👍 Successfully sent your announcement to <#${ac.id}>`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
message.channel.send({embed: AccSuccessEmbed});
|
||||
|
||||
}
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Announcement_Command,
|
||||
}
|
||||
@@ -1,114 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Close
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
const fs = require("fs");
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
/**
|
||||
* @param {Discord.Message} message
|
||||
*/
|
||||
|
||||
exports.run = (bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Close_Command}`);
|
||||
|
||||
if ( !message.channel.name.startsWith( `${supportbot.Ticket_Channel_Name}-` ) ) {
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Cannot use this command becase you are outside a ticket channel.`)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
|
||||
message.channel.send(embed);
|
||||
return;
|
||||
}
|
||||
|
||||
const closeRequestEmbed = new Discord.RichEmbed()
|
||||
.setDescription(`**${supportbot.Ticket_Closure}**`)
|
||||
.addField("Please confirm by repeating the following word..", `||**${supportbot.Closure_Confirm_Word}**||`)
|
||||
.setFooter("Your request will be avoided in 20 seconds")
|
||||
.setColor(supportbot.EmbedColour)
|
||||
|
||||
|
||||
message.channel.send(closeRequestEmbed).then( m => {
|
||||
message.channel.awaitMessages( response => response.content.toLowerCase() === supportbot.Closure_Confirm_Word, {
|
||||
max: 1,
|
||||
time: 20000,
|
||||
errors: [ 'time' ],
|
||||
|
||||
} ).then( collected => {
|
||||
let logChannel = message.guild.channels.find( channel => channel.name === supportbot.Transcript_Logs );
|
||||
|
||||
let user = message.author;
|
||||
|
||||
let reason = args.join(" ") || "No reason provided.";
|
||||
|
||||
let name = message.channel.name;
|
||||
let ticketChannel = message.channel;
|
||||
|
||||
message.channel.send(`**${supportbot.Ticket_Closing}**`)
|
||||
.then( () => {
|
||||
const logEmbed = new Discord.RichEmbed()
|
||||
.setTitle(supportbot.Transcript_Title)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(supportbot.EmbedFooter)
|
||||
.addField("Ticket Author", user)
|
||||
.addField("Closed By", message.author.tag)
|
||||
.addField("Reason", reason);
|
||||
|
||||
message.channel.fetchMessages({ limit: 100 })
|
||||
.then( msgs => {
|
||||
let txt = '';
|
||||
|
||||
msgs = msgs.sort( ( a, b ) => a.createdTimestamp - b.createdTimestamp );
|
||||
|
||||
txt += `${message.guild.name}\n`;
|
||||
txt += `#${ticketChannel.name}\n`;
|
||||
txt += `${msgs.size} messages\n\n\n`;
|
||||
|
||||
msgs.forEach( msg => {
|
||||
if ( msg.content ) {
|
||||
txt += `----- ${msg.author.tag} at ${msg.createdAt}\n`;
|
||||
txt += `${msg.content}\n`;
|
||||
txt += `-----\n\n`;
|
||||
}
|
||||
} );
|
||||
|
||||
// message.author.send( `A transcript has been generated for the ticket you closed.` );
|
||||
// message.author.send( new Discord.Attachment( Buffer.from( txt ), `${name}.txt` ) );
|
||||
|
||||
logChannel.send(logEmbed)
|
||||
logChannel.send( new Discord.Attachment( Buffer.from( txt ), `${name}.txt` ) );
|
||||
|
||||
message.channel.delete();
|
||||
|
||||
// message.channel.fetchMessages( { limit: 100, before: msgs.last().id } )
|
||||
|
||||
// .then( msg => {
|
||||
// const merged = msgs.concat( msg );
|
||||
// const output = merged.reduce( ( out, msg ) => {
|
||||
// out += `[${message.createdAt}] ${message.author.tag}: ${message.cleanContent ? message.cleanContent.replace( /\n/g, '\r\n' ) : ''}\r\n`;
|
||||
// return out;
|
||||
// }, '' );
|
||||
|
||||
// log.send( { files: [ { attachment: Buffer.from( output, 'utf8' ), name: `${name}.txt` } ] } ).then( c.delete() ).catch( console.error ); // sends the file to logs
|
||||
// return log.send( embed1 ).catch( console.error );
|
||||
// } )
|
||||
});
|
||||
})
|
||||
|
||||
}).catch( () => {
|
||||
m.edit('The request to close the ticket has timed out.').then( m2 => m2.delete( 3000 ) );
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Close_Command,
|
||||
}
|
||||
@@ -1,73 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Forceclose
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client()
|
||||
|
||||
const fs = require("fs")
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = async (bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Forceclose_Command}`);
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||
|
||||
const donothaverole = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
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(supportbot.EmbedColour)
|
||||
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
|
||||
|
||||
const log = message.guild.channels.find(channel => channel.name === supportbot.Transcript_Logs)
|
||||
const uID = message.author
|
||||
const reason = args.join(" ") || "No Reason Provided.";
|
||||
const name = message.channel.name;
|
||||
const c = message.channel;
|
||||
|
||||
message.channel.send(`Your ticket is currently closing`)
|
||||
|
||||
.then(() => {
|
||||
|
||||
const embed1 = new Discord.RichEmbed()
|
||||
.setTitle(supportbot.Transcript_Title)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(supportbot.EmbedFooter)
|
||||
.addField("Ticket Author", uID)
|
||||
.addField("Closed By", message.author.tag)
|
||||
.addField("Reason", reason)
|
||||
message.channel.fetchMessages({ limit: 100 })
|
||||
|
||||
.then(msgs => {
|
||||
message.channel.fetchMessages({ limit: 100, before: msgs.last().id })
|
||||
|
||||
.then(msg => {
|
||||
const merged = msgs.concat(msg);
|
||||
const output = merged.reduce((out, msg) => {
|
||||
out += `[${message.createdAt}] ${message.author.tag}: ${message.cleanContent ? message.cleanContent.replace(/\n/g, '\r\n') : ''}\r\n`;
|
||||
return out;
|
||||
}, '');
|
||||
|
||||
log.send({ files: [{ attachment: Buffer.from(output, 'utf8'), name: `${name}.txt` }] }).then(c.delete()).catch(console.error); // sends the file to logs
|
||||
return log.send(embed1).catch(console.error);
|
||||
})
|
||||
});
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Forceclose_Command,
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Help
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client()
|
||||
|
||||
const fs = require("fs")
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = (bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Help_Command}`);
|
||||
|
||||
let userCommands = "";
|
||||
userCommands += `**${supportbot.Prefix}${supportbot.Ticket_Command} <reason>**: Create a support ticket\n`;
|
||||
userCommands += `**${supportbot.Prefix}${supportbot.Close_Command}**: Close your support ticket\n`;
|
||||
userCommands += `**${supportbot.Prefix}${supportbot.Suggest_Command} <suggestion>**: Create a server suggestion\n`;
|
||||
userCommands += `**${supportbot.Prefix}${supportbot.Report_Command} <user> <reason>**: Report a valid user\n`;
|
||||
userCommands += `**${supportbot.Prefix}${supportbot.Link_Command}**: Get some important links!\n`;
|
||||
userCommands += `**${supportbot.Prefix}${supportbot.Ping_Command}**: Check the bots ping. Pong!\n`;
|
||||
|
||||
let supportCommands = "";
|
||||
supportCommands += `**${supportbot.Prefix}${supportbot.Add_Command} <user>**: Adds a user to a ticket\n`;
|
||||
supportCommands += `**${supportbot.Prefix}${supportbot.Remove_Command} <user>**: Removes a user from a ticket\n`;
|
||||
supportCommands += `**${supportbot.Prefix}${supportbot.Forceclose_Command}**: Forceclose a support ticket\n`;
|
||||
supportCommands += `**${supportbot.Prefix}${supportbot.Rename_Command}**: Rename a support ticket\n`;
|
||||
|
||||
let staffCommands = "";
|
||||
staffCommands += `**${supportbot.Prefix}${supportbot.Announcement_Command} <message>**: Create a bot announcement\n`;
|
||||
staffCommands += `**${supportbot.Prefix}${supportbot.Say_Command} <message>**: Send a message as the bot\n`;
|
||||
staffCommands += `**${supportbot.Prefix}${supportbot.Lockchat_Command}**: Lock the chat channel\n`;
|
||||
staffCommands += `**${supportbot.Prefix}${supportbot.UnLockchat_Command}**: UnLock the chat channel\n`;
|
||||
staffCommands += `**${supportbot.Prefix}${supportbot.Poll_Command}**: Create a poll\n`;
|
||||
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle(supportbot.Bot_Name)
|
||||
.addField("👨 User Commands", userCommands)
|
||||
.addField(":pushpin: Support Commands", supportCommands)
|
||||
.addField("🔑 Staff Commands", staffCommands)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL);
|
||||
message.channel.send(embed);
|
||||
|
||||
}
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Help_Command,
|
||||
};
|
||||
@@ -1,36 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Links
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
const fs = require("fs");
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = ( bot, message, args ) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Link_Command}`);
|
||||
|
||||
let botLinks = supportbot.LINKS;
|
||||
|
||||
let links = '';
|
||||
|
||||
for ( let name in botLinks ) {
|
||||
links += `[${name}](${botLinks[ name ]})\n`;
|
||||
};
|
||||
|
||||
let embed = new Discord.RichEmbed()
|
||||
.setTitle(supportbot.LINKS_TITLE)
|
||||
.setDescription(links)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(supportbot.EmbedFooter);
|
||||
message.channel.send(embed);
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Link_Command,
|
||||
};
|
||||
@@ -1,42 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Close
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
const fs = require("fs");
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = async(bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Lockchat_Command}`);
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
||||
let lockedRole = message.guild.roles.find(lc => lc.name === `${supportbot.locked_role}`)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
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 **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
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(supportbot.EmbedColour)
|
||||
message.channel.send(lockmsg);
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Lockchat_Command,
|
||||
};
|
||||
@@ -1,26 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Ping
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
const fs = require("fs");
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = (bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Ping_Command}`);
|
||||
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setDescription(`:ping_pong: **Pong!** \`${bot.ping}ms\` `)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
message.channel.send(embed).catch(console.error);
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Ping_Command,
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Poll
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
const fs = require("fs");
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = (bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Poll_Command}`);
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
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 **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
||||
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle(`${supportbot.Poll_Title}`)
|
||||
.setDescription(args.join(" "))
|
||||
.setTimestamp()
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL)
|
||||
|
||||
let ac = message.guild.channels.find(AnnounceChannel => AnnounceChannel.name === `${supportbot.Poll_Channel}`)
|
||||
if(!ac) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Poll_Channel}**`)
|
||||
|
||||
ac.send(embed)
|
||||
|
||||
.then(async function(msg) {
|
||||
msg.react(supportbot.Reaction_Poll_1).then(() => msg.react(supportbot.Reaction_Poll_2));
|
||||
});
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Poll_Command,
|
||||
};
|
||||
@@ -1,63 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Remove
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
const fs = require("fs");
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = async (bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Remove_Command}`);
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === supportbot.StaffRole)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||
|
||||
const donothaverole = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
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(supportbot.EmbedColour)
|
||||
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) 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(supportbot.EmbedColour)
|
||||
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(supportbot.EmbedColour)
|
||||
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(supportbot.EmbedColour)
|
||||
.setTitle("User Removed")
|
||||
.setDescription(`👍 ${rUser} has been removed from this ticket`)
|
||||
.setTimestamp();
|
||||
|
||||
message.channel.send({embed: useradded});
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Remove_Command,
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Rename
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
const fs = require("fs");
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = async (bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Rename_Command}`);
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === supportbot.StaffRole)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.colour)
|
||||
if (!staffGroup) return message.reply({embed: rolemissing});
|
||||
|
||||
const donothaverole = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Sorry! You cannot use this command with the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.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(supportbot.colour)
|
||||
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
|
||||
const renameto = args.join(" ")
|
||||
message.channel.setName(`${supportbot.Ticket_Channel_Name}-${renameto}`)
|
||||
|
||||
// Renamed Ticket Logistic
|
||||
const logEmbed = new Discord.RichEmbed()
|
||||
.setTitle(":ticket: Ticket Renamed")
|
||||
.setDescription(`<@${message.author.id}> has renamed a ticket to ${supportbot.Ticket_Channel_Name}-${renameto}`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(supportbot.EmbedFooter)
|
||||
|
||||
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Logs}`);
|
||||
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Ticket_Logs}**`);
|
||||
|
||||
logChannel.send({embed: logEmbed});
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Rename_Command,
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Report
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
const fs = require("fs");
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = (bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Report_Command}`);
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`);
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
|
||||
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 **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
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(`${supportbot.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(supportbot.EmbedColour)
|
||||
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL);
|
||||
let rc = message.guild.channels.find(ReportChannel => ReportChannel.name === `${supportbot.Report_Channel}`)
|
||||
if(!rc) {
|
||||
message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Report_Channel}**`);
|
||||
} else {
|
||||
rc.send(embed);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Report_Command
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Say
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
const fs = require("fs");
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = (bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Say_Command}`);
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
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 **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
if (!message.member.roles.has(staffGroup.id)) return message.reply(donothaverole)
|
||||
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setTitle(`${supportbot.Announcement_Title}`)
|
||||
.setDescription(args.join(" "))
|
||||
.setTimestamp()
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
|
||||
|
||||
message.channel.send(embed);
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Say_Command,
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Say
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
const fs = require("fs");
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = async(bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Suggest_Command}`);
|
||||
|
||||
const SuggestionEmbed = new Discord.RichEmbed()
|
||||
.setTitle(`${supportbot.Suggestion_Title}`)
|
||||
.setDescription(`\`\`\`${args.join(" ")}\`\`\`\nFrom <@${message.author.id}>`)
|
||||
.setFooter(`${supportbot.footer}`, message.author.avatarURL)
|
||||
.setTimestamp(new Date())
|
||||
.setColor(supportbot.EmbedColour)
|
||||
|
||||
let sc = message.guild.channels.find(SuggestionChannel => SuggestionChannel.name === `${supportbot.Suggestion_Channel}`);
|
||||
if(!sc) return message.channel.send(`:x: Error! Could not find the suggestion channel **${supportbot.Suggestion_Channel}**`);
|
||||
|
||||
sc.send(SuggestionEmbed)
|
||||
|
||||
.then(async function(msg) {
|
||||
msg.react(supportbot.suggestyes).then(() => msg.react(supportbot.suggestno));
|
||||
});
|
||||
|
||||
const SuggestionSuccessEmbed = new Discord.RichEmbed()
|
||||
.setDescription(`👍 Suggestion has been successfully created\nYou can view your suggestion in <#${sc.id}>`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
message.channel.send(SuggestionSuccessEmbed);
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Suggest_Command,
|
||||
}
|
||||
@@ -1,150 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Say
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
const fs = require("fs");
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
const TicketNumberID = require('../utility/TicketNumber');
|
||||
|
||||
exports.run = async (bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.Ticket_Command}`);
|
||||
|
||||
// Ticket Number ID Settings
|
||||
let ticketNumberID = TicketNumberID.pad(message.guild.id);
|
||||
|
||||
// Ticket Subject Settings
|
||||
const subject = args.join(" ") || `${supportbot.Default_Ticket_Reason}`;
|
||||
|
||||
// Ticket Limitiations
|
||||
const alreadyopen = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Cannot create a ticket because **${supportbot.Ticket_Channel_Name}-${ticketNumberID}** already exists.`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
|
||||
// Ticket Creation
|
||||
if (message.guild.channels.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Channel_Name}-` + message.author.username)) return message.channel.send(alreadyopen);
|
||||
message.guild.createChannel(`${supportbot.Ticket_Channel_Name}-${ticketNumberID}`, {
|
||||
type: 'text',
|
||||
}).then(TicketChannel => {
|
||||
|
||||
// Roles
|
||||
let staff = message.guild.roles.find(supportRole => supportRole.name === `${supportbot.StaffRole}`)
|
||||
let everyone = message.guild.roles.find(everyoneRole => everyoneRole.name === "@everyone")
|
||||
let department = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_1}`)
|
||||
let department2 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_2}`)
|
||||
let department3 = message.guild.roles.find(DepartmentRole => DepartmentRole.name === `${supportbot.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 === supportbot.category);
|
||||
if (category) {
|
||||
TicketChannel.setParent(category.id);
|
||||
} else {
|
||||
if (message.guild.channels.get(supportbot.category)) {
|
||||
TicketChannel.setParent(message.guild.channels.get(supportbot.category).id);
|
||||
}
|
||||
}
|
||||
|
||||
const ticketopened = new Discord.RichEmbed()
|
||||
.setTitle(":white_check_mark: Support Ticket Created")
|
||||
.setDescription(`<@${message.author.id}> your support ticket created successfully`)
|
||||
.addField("Your Ticket:", `<#${TicketChannel.id}>`)
|
||||
.setColor(supportbot.Ticket_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${supportbot.Ticket_Message}`;
|
||||
|
||||
const Department_1 = supportbot.Ticket_Department_1;
|
||||
const Department_2 = supportbot.Ticket_Department_2;
|
||||
const Department_3 = supportbot.Ticket_Department_3;
|
||||
|
||||
const Emoji_1 = supportbot.Ticket_Department_Emoji_1;
|
||||
const Emoji_2 = supportbot.Ticket_Department_Emoji_2;
|
||||
const Emoji_3 = supportbot.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(supportbot.Ticket_Colour)
|
||||
.setFooter(supportbot.EmbedFooter)
|
||||
|
||||
if (subject != 'No Subject.') {
|
||||
TicketMessage.addField("Reason", 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 someone 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 someone 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 someone to reach out to you.")
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Ticket Logging
|
||||
const logEmbed = new Discord.RichEmbed()
|
||||
.setTitle(":ticket: Logistics of your Ticket")
|
||||
.addField("Ticket ID", ticketNumberID, true)
|
||||
.addField("User", `<@${message.author.id}>`, true)
|
||||
.addField("Channel", `ticket#${ticketNumberID}`, true)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(supportbot.EmbedFooter)
|
||||
|
||||
if (subject != 'No Subject.') {
|
||||
logEmbed.addField('Subject', subject, true);
|
||||
}
|
||||
|
||||
let logChannel = message.guild.channels.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Logs}`);
|
||||
if(!logChannel) return message.channel.send(`:x: Error! Could not find the logs channel **${supportbot.Ticket_Logs}**`);
|
||||
|
||||
logChannel.send({embed: logEmbed})
|
||||
|
||||
}).catch(err=>{console.error(err)});
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Ticket_Command,
|
||||
};
|
||||
@@ -1,42 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Say
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
const fs = require("fs");
|
||||
const yaml = require('js-yaml');
|
||||
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
exports.run = async(bot, message, args) => {
|
||||
|
||||
console.log(`\u001b[33m`, `[${supportbot.Bot_Name}] > `, `\u001b[31;1m`, `${message.author.tag}`, `\u001b[32;1m`, `has executed`, `\u001b[31;1m`, `${supportbot.Prefix}${supportbot.UnLockchat_Command}`);
|
||||
|
||||
let staffGroup = message.guild.roles.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
||||
let lockedRole = message.guild.roles.find(lc => lc.name === `${supportbot.locked_role}`)
|
||||
|
||||
const rolemissing = new Discord.RichEmbed()
|
||||
.setDescription(`:x: Looks like this server doesn't have the role **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
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 **${supportbot.StaffRole}**`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
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(supportbot.EmbedColour);
|
||||
message.channel.send(lockmsg);
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.UnLockchat_Command,
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
cd /home/container
|
||||
|
||||
if [ "${GIT_CLONE}" == "true" ] || [ "${GIT_CLONE}" == "1" ]; then
|
||||
if [ "$(ls -A /home/container)" ]; then
|
||||
echo "Pulling Updates"
|
||||
git pull
|
||||
else
|
||||
echo -e "/home/container is empty.\nCloning files into the directory."
|
||||
git clone https://github.com/1tzemerald/SupportBot.git
|
||||
fi
|
||||
fi
|
||||
|
||||
sed -i '/s/BOT_TOKEN_HERE/${BOT_TOKEN}/g' settings.json
|
||||
MODIFIED_STARTUP=`eval echo $(echo ${STARTUP} | sed -e 's/{{/${/g' -e 's/}}/}/g')`
|
||||
${MODIFIED_STARTUP}
|
||||
@@ -1,120 +1,23 @@
|
||||
// ____ _ ____ _
|
||||
// / ___| _ _ _ __ _ __ ___ _ __| |_| __ ) ___ | |_
|
||||
// \___ \| | | | '_ \| '_ \ / _ \| '__| __| _ \ / _ \| __|
|
||||
// ___) | |_| | |_) | |_) | (_) | | | |_| |_) | (_) | |_
|
||||
// |____/ \__,_| .__/| .__/ \___/|_| \__|____/ \___/ \__|
|
||||
// |_| |_|
|
||||
// © 2020 Created by Emerald Services
|
||||
// Licnese: MIT
|
||||
// SupportBot v5.1.0
|
||||
// ___ _ ___ _
|
||||
// / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||
// \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||
// <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||
// |_| |_|
|
||||
//
|
||||
// SupportBot created by Emerald Services
|
||||
// Installed with MIT License
|
||||
//
|
||||
// Discord Support: https://emeraldsrv.dev/discord
|
||||
// Community Resources: https://emeraldsrv.dev/resources
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const fs = require("fs");
|
||||
const bot = new Discord.Client();
|
||||
|
||||
bot.commands = new Discord.Collection();
|
||||
const yaml = require("js-yaml");
|
||||
const supportbot = yaml.load(
|
||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||
);
|
||||
|
||||
const yaml = require('js-yaml');
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
const Client = require("./Structures/Client.js");
|
||||
const client = new Client({});
|
||||
|
||||
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(`${supportbot.Bot_Name} No commands found. Try to Re-download the resource`);
|
||||
|
||||
jsfile.forEach((f, i) =>{
|
||||
let props = require(`./commands/${f}`);
|
||||
console.log(`[${supportbot.Bot_Name}] > 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(`${supportbot.Bot_Name} No addons detected nor default! Either download addons from https://itzemerald.tk/`);
|
||||
|
||||
jsfile.forEach((f, i) =>{
|
||||
let props = require(`./sb-addons/${f}`);
|
||||
console.log(`[${supportbot.Bot_Name}] > Addons Loaded > ${f}`);
|
||||
bot.addons.set(props.help.name, props);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
bot.on("ready", async () => {
|
||||
bot.user.setActivity(supportbot.BotActivity, {type: supportbot.ActvityType});
|
||||
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
|
||||
console.log(`\u001b[37m`, `Emerald Services has successfully connected to discord`)
|
||||
console.log(`\u001b[37m`, `Invite your bot with https://discordapp.com/api/oauth2/authorize?client_id=516372960110444574&permissions=8&scope=bot`)
|
||||
console.log(`\u001b[37m`, `© ️SupportBot created by Emerald Services`)
|
||||
console.log(`\u001b[32m`, `―――――――――――――――――― SupportBot ――――――――――――――――――`)
|
||||
|
||||
});
|
||||
|
||||
bot.on("message", async message => {
|
||||
if(message.author.bot) return;
|
||||
if(message.channel.type === "dm") return;
|
||||
if (message.content.indexOf(supportbot.Prefix) !== 0) return;
|
||||
|
||||
let messageArray = message.content.split(" ");
|
||||
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
|
||||
const command = args.shift().toLowerCase();
|
||||
|
||||
const cmd = bot.commands.get(command);
|
||||
if(!cmd) return;
|
||||
cmd.run(bot, message, args);
|
||||
message.delete();
|
||||
});
|
||||
|
||||
bot.on("message", async message => {
|
||||
if(message.author.bot) return;
|
||||
if(message.channel.type === "dm") return;
|
||||
if (message.content.indexOf(supportbot.Prefix) !== 0) return;
|
||||
|
||||
let messageArray = message.content.split(" ");
|
||||
const args = message.content.slice(supportbot.Prefix.length).trim().split(/ +/g);
|
||||
const addon = args.shift().toLowerCase();
|
||||
|
||||
const cmd = bot.addons.get(addon);
|
||||
if(!cmd) return;
|
||||
cmd.run(bot, message, args);
|
||||
message.delete();
|
||||
});
|
||||
|
||||
// [SupportBot] Welcome Message && Auto Join Role
|
||||
|
||||
bot.on("guildMemberAdd", (member) => {
|
||||
let channel = member.guild.channels.find(channel => channel.name === `${supportbot.WelcomeChannel}`)
|
||||
let autorole = member.guild.roles.find(autorole => autorole.name === `${supportbot.AutoRole}`)
|
||||
|
||||
const WelcomeMsg= new Discord.RichEmbed()
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setThumbnail(member.user.avatarURL)
|
||||
.setDescription(`:wave: ${member.user.username}\n${supportbot.WelcomeMessage}`)
|
||||
|
||||
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 === `${supportbot.LeaveChannel}`)
|
||||
|
||||
const LeaveMsg= new Discord.RichEmbed()
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setThumbnail(member.user.avatarURL)
|
||||
.setDescription(`:wave: ${member.user.username}\n${supportbot.LeaveMessage}`)
|
||||
|
||||
channel.send(LeaveMsg);
|
||||
|
||||
});
|
||||
|
||||
bot.login(supportbot.Token);
|
||||
client.start(supportbot.Token);
|
||||
Generated
+5319
-53
File diff suppressed because it is too large.
Load diff
+17
-27
@@ -1,38 +1,28 @@
|
||||
{
|
||||
"name": "SupportBot",
|
||||
"version": "4.0",
|
||||
"description": "SupportBot",
|
||||
"name": "supportbot",
|
||||
"version": "7.4.2",
|
||||
"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",
|
||||
"private": "true",
|
||||
"scripts": {
|
||||
"test": "echo \"Error: no test specified\" && exit 1",
|
||||
"start": "node index.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": "12.6.0",
|
||||
"npm": "6.9.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"array-sort": "^1.0.0",
|
||||
"discord.js": "^11.5.1",
|
||||
"js-yaml": "^3.13.1",
|
||||
"table": "^5.4.4"
|
||||
"start": "npm i && node index.js",
|
||||
"test": "node index.js test"
|
||||
},
|
||||
"repository": {
|
||||
"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",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/EmeraldRusher/SupportBot/issues"
|
||||
"url": "https://github.com/Emerald-Services/SupportBot/issues"
|
||||
},
|
||||
"homepage": "https://discord.gg/hmWgxdF",
|
||||
"contributors": [
|
||||
"iJosGCS",
|
||||
"RedstoneGamez"
|
||||
]
|
||||
"homepage": "https://github.com/Emerald-Services/SupportBot#readme",
|
||||
"dependencies": {
|
||||
"@vitalets/google-translate-api": "^8.0.0",
|
||||
"discord.js": "^13.6.0",
|
||||
"js-yaml": "^4.1.0",
|
||||
"moment": "^2.29.3",
|
||||
"translate": "^1.4.1",
|
||||
"twitter": "^1.7.1"
|
||||
}
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
// SupportBot Addons
|
||||
// Default Addon
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const bot = new Discord.Client()
|
||||
const someaddon = new Discord.Client()
|
||||
|
||||
someaddon.settings = require("./settings/someaddon.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: someaddon.settings.Addon_Example_Command,
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
|
||||
"Addon_Example_Command": "addonexample"
|
||||
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1,115 +0,0 @@
|
||||
# _________ __ __________ __
|
||||
# / _____/__ ________ ______ ____________/ |\______ \ _____/ |_
|
||||
# \_____ \| | \____ \\____ \ / _ \_ __ \ __\ | _// _ \ __\
|
||||
# / \ | / |_> > |_> > <_> ) | \/| | | | ( <_> ) |
|
||||
# /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
|
||||
# \/ |__| |__| \/
|
||||
#
|
||||
# SupportBot v5.1.0
|
||||
# Created by © 2020 Emerald Services
|
||||
# License: MIT
|
||||
|
||||
#Bot Indentification
|
||||
Token: "Bot_Token_Here"
|
||||
Prefix: "!"
|
||||
Bot_Name: "SupportBot"
|
||||
|
||||
BotActivity: "SupportBot v5.1"
|
||||
ActivityType: "PLAYING"
|
||||
|
||||
EmbedColour: "#4bbf5c"
|
||||
EmbedFooter: "SupportBot | The #1 Supportive Discord Bot"
|
||||
|
||||
# Role Settings
|
||||
AutoRole: "Member"
|
||||
StaffRole: "Support"
|
||||
|
||||
locked_role: "@everyone"
|
||||
everyone: "@everyone"
|
||||
|
||||
Department_Role_1: "Support"
|
||||
Department_Role_2: "Security"
|
||||
Department_Role_3: "Sales"
|
||||
|
||||
# Welcome & Leave
|
||||
WelcomeChannel: "welcome"
|
||||
WelcomeMessage: "Welcome to the server!"
|
||||
|
||||
LeaveChannel: "welcome"
|
||||
LeaveMessage: "Thank you for visiting us!"
|
||||
|
||||
# Ticket Settings
|
||||
category: "Tickets"
|
||||
Ticket_Colour: "#000e42"
|
||||
Ticket_Channel_Name: "ticket"
|
||||
Ticket_Logs: "ticket-logs"
|
||||
|
||||
Transcript_Log: "ticket-data"
|
||||
Transcript_Title: "Support Transcript"
|
||||
|
||||
Ticket_Closing: "⚠ Your ticket is now closing!"
|
||||
Ticket_Closure: "Looks like you have come to the end of your support ticket\nPlease confirm that you want to close your ticket."
|
||||
Closure_Confirm_Word: "confirm"
|
||||
|
||||
Ticket_Message: "Your support ticket has been opened successfully\nPlease allow us some time to reach out to you."
|
||||
Default_Ticket_Reason: "No Subject"
|
||||
|
||||
# Ticket Department Settings
|
||||
Ticket_Department_1: "Support"
|
||||
Ticket_Department_2: "Security"
|
||||
Ticket_Department_3: "Sales"
|
||||
|
||||
Ticket_Department_Emoji_1: "🎧"
|
||||
Ticket_Department_Emoji_2: "🔐"
|
||||
Ticket_Department_Emoji_3: "💵"
|
||||
|
||||
# Announcement Settings
|
||||
Announcement_Title: "SupportBot Announcement"
|
||||
Announcement_Channel: "announcements"
|
||||
Announcement_Tag_Role: "@everyone"
|
||||
|
||||
# Poll Settings
|
||||
Poll_Channel": "polls"
|
||||
Poll_Title": "📊 Polls"
|
||||
|
||||
Reaction_Poll_1": "✅"
|
||||
Reaction_Poll_2": "❎"
|
||||
|
||||
# Suggestion Settings
|
||||
Suggestion_Title: "SupportBot Suggestions"
|
||||
Suggestion_Channel: "suggestions"
|
||||
|
||||
suggestyes: "✅"
|
||||
suggestno: "❎"
|
||||
|
||||
# Report Settings
|
||||
Report_Channel: "reports"
|
||||
Report_Title: "SupportBot Report"
|
||||
|
||||
# Link Settings
|
||||
LINKS_TITLE: "SupportBot Links"
|
||||
|
||||
LINKS:
|
||||
"Discord": "https://discord.gg/"
|
||||
"Twitter": "https://twitter.com/"
|
||||
"Website": "https://example.com/"
|
||||
"AddMore": "AddMoreIfYouWant"
|
||||
|
||||
# Bot Command Settings
|
||||
Add_Command: "add"
|
||||
Remove_Command: "remove"
|
||||
Ticket_Command: "ticket"
|
||||
Close_Command: "close"
|
||||
Forceclose_Command: "forceclose"
|
||||
Rename_Command: "rename"
|
||||
Lockchat_Command: "lock"
|
||||
UnLockchat_Command: "unlock"
|
||||
Announcement_Command: "announce"
|
||||
Say_Command: "say"
|
||||
Suggest_Command: "suggest"
|
||||
Ping_Command: "ping"
|
||||
Help_Command: "help"
|
||||
Link_Command: "links"
|
||||
Poll_Command: "poll"
|
||||
Report_Command: "report"
|
||||
Setup_Command: "setup"
|
||||
@@ -1,72 +0,0 @@
|
||||
// SupportBot Utility
|
||||
// Ticket Numbers
|
||||
|
||||
const discord = require("discord.js")
|
||||
const fs = require("fs");
|
||||
|
||||
const yaml = require('js-yaml');
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
class TicketNumberID {
|
||||
|
||||
static pad(guildId) {
|
||||
let n = this.get(guildId) + '';
|
||||
let z = '0';
|
||||
let width = 4;
|
||||
setTimeout(() => {
|
||||
this.set(guildId, this.get(guildId) + 1);
|
||||
}, 50);
|
||||
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
|
||||
}
|
||||
|
||||
static get(guildId) {
|
||||
|
||||
let ticketnumberID = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8"));
|
||||
|
||||
if (!ticketnumberID[guildId]) {
|
||||
ticketnumberID[guildId] = {
|
||||
id: 0
|
||||
}
|
||||
|
||||
fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
||||
if (err) console.log(err);
|
||||
});
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
} else {
|
||||
return ticketnumberID[guildId].id;
|
||||
}
|
||||
}
|
||||
|
||||
static set(guildId, value) {
|
||||
let ticketnumberID = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8"));
|
||||
|
||||
ticketnumberID[guildId] = {
|
||||
id: value
|
||||
}
|
||||
|
||||
fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
||||
if (err) console.log(err);
|
||||
});
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
static reset(guildId) {
|
||||
let ticketnumberID = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8"));
|
||||
|
||||
ticketnumberID[guildId] = {
|
||||
id: 0
|
||||
}
|
||||
|
||||
fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
||||
if (err) console.log(err);
|
||||
});
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = TicketNumberID;
|
||||
Reference in new issue
Block a user