Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
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.
|
||||
@@ -0,0 +1,31 @@
|
||||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [10.x, 12.x, 14.x, 15.x]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
- run: npm ci
|
||||
- run: npm install discord.js --save
|
||||
- run: npm install js-yaml
|
||||
- run: npm run build --if-present
|
||||
- run: node index.js
|
||||
+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/
|
||||
@@ -0,0 +1,31 @@
|
||||
// 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("./Data/supportbot.yml", "utf8"));
|
||||
const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
|
||||
|
||||
// Your Addon Config file! Saved in /Addons/Settings/YourAddonConfig.yml
|
||||
// const exampleaddon = yaml.load(fs.readFileSync('./Addons/Settings/YourAddonConfig.yml', 'utf8'));
|
||||
|
||||
const Command = require("../Structures/Command.js");
|
||||
|
||||
module.exports = new Command({
|
||||
name: "hello",
|
||||
description: "hello",
|
||||
slashCommandOptions: [],
|
||||
permission: "SEND_MESSAGES",
|
||||
|
||||
async run(interaction) {
|
||||
const Embed = new Discord.MessageEmbed()
|
||||
.setDescription("Hello World!")
|
||||
.setColor(supportbot.InfoColour);
|
||||
|
||||
interaction.reply({
|
||||
embeds: [Embed],
|
||||
});
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,95 @@
|
||||
// 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("./Data/supportbot.yml", "utf8"));
|
||||
const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
|
||||
|
||||
const Command = require("../Structures/Command.js");
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.TicketAdd,
|
||||
description: cmdconfig.TicketAddDesc,
|
||||
slashCommandOptions: [
|
||||
{
|
||||
name: "user",
|
||||
description: "User to add",
|
||||
type: "USER",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
permission: "SEND_MESSAGES",
|
||||
|
||||
async run(interaction) {
|
||||
let SupportStaff =
|
||||
interaction.guild.roles.cache.find(
|
||||
(SupportTeam) => SupportTeam.name === supportbot.Staff
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(SupportTeam) => SupportTeam.id === supportbot.Staff
|
||||
);
|
||||
let Admins =
|
||||
interaction.guild.roles.cache.find(
|
||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
||||
);
|
||||
|
||||
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(Admins.id)
|
||||
) {
|
||||
if (
|
||||
!interaction.channel.name.startsWith(`${supportbot.TicketChannel}-`)
|
||||
) {
|
||||
const Exists = new Discord.MessageEmbed()
|
||||
.setTitle("No Ticket Found!")
|
||||
.setDescription(`${supportbot.NoValidTicket}`)
|
||||
.setColor(supportbot.WarningColour);
|
||||
return interaction.reply({ 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] });
|
||||
|
||||
interaction.channel.permissionOverwrites.edit(uMember, {
|
||||
VIEW_CHANNEL: true,
|
||||
READ_MESSAGE_HISTORY: true,
|
||||
SEND_MESSAGES: 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] });
|
||||
} else {
|
||||
return interaction.reply({ embeds: [NoPerms] });
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,95 @@
|
||||
// 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("./Data/supportbot.yml", "utf8"));
|
||||
const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
|
||||
|
||||
const Command = require("../Structures/Command.js");
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.TicketRemove,
|
||||
description: cmdconfig.TicketRemoveDesc,
|
||||
slashCommandOptions: [
|
||||
{
|
||||
name: "user",
|
||||
description: "User to remove",
|
||||
type: "USER",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
permission: "SEND_MESSAGES",
|
||||
|
||||
async run(interaction) {
|
||||
let SupportStaff =
|
||||
interaction.guild.roles.cache.find(
|
||||
(SupportTeam) => SupportTeam.name === supportbot.Staff
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(SupportTeam) => SupportTeam.id === supportbot.Staff
|
||||
);
|
||||
let Admins =
|
||||
interaction.guild.roles.cache.find(
|
||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
||||
);
|
||||
|
||||
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(Admins.id)
|
||||
) {
|
||||
if (
|
||||
!interaction.channel.name.startsWith(`${supportbot.TicketChannel}-`)
|
||||
) {
|
||||
const Exists = new Discord.MessageEmbed()
|
||||
.setTitle("No Ticket Found!")
|
||||
.setDescription(`${supportbot.NoValidTicket}`)
|
||||
.setColor(supportbot.WarningColour);
|
||||
return interaction.reply({ 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({ embeds: [UserNotExist] });
|
||||
|
||||
interaction.channel.permissionOverwrites.edit(uMember, {
|
||||
VIEW_CHANNEL: false,
|
||||
READ_MESSAGE_HISTORY: false,
|
||||
SEND_MESSAGES: 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] });
|
||||
} else {
|
||||
return interaction.reply({ embeds: [NoPerms] });
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,227 @@
|
||||
// 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("./Data/supportbot.yml", "utf8"));
|
||||
const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
|
||||
|
||||
const Command = require("../Structures/Command.js");
|
||||
const TicketNumberID = require("../Structures/TicketID.js");
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.CloseTicket,
|
||||
description: cmdconfig.CloseTicketDesc,
|
||||
slashCommandOptions: [
|
||||
{
|
||||
name: "reason",
|
||||
description: "Ticket Close Reason",
|
||||
type: "STRING",
|
||||
},
|
||||
],
|
||||
permission: "SEND_MESSAGES",
|
||||
|
||||
async run(interaction) {
|
||||
if (!interaction.channel.name.startsWith(`${supportbot.TicketChannel}-`)) {
|
||||
const Exists = new Discord.MessageEmbed()
|
||||
.setTitle("No Ticket Found!")
|
||||
.setDescription(`${supportbot.NoValidTicket}`)
|
||||
.setColor(supportbot.WarningColour);
|
||||
return interaction.reply({ embed: Exists });
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
interaction
|
||||
.reply(CloseTicketRequest)
|
||||
.then((m) => {
|
||||
interaction.channel
|
||||
.awaitMessages(
|
||||
(response) =>
|
||||
response.content.toLowerCase() ===
|
||||
supportbot.ClosingConfirmation_Word,
|
||||
{
|
||||
max: 1,
|
||||
time: 20000,
|
||||
errors: ["time"],
|
||||
}
|
||||
)
|
||||
.then((collected) => {
|
||||
let logChannel =
|
||||
interaction.guild.channels.cache.find(
|
||||
(channel) => channel.name === supportbot.TranscriptLog
|
||||
) ||
|
||||
interaction.guild.channels.cache.find(
|
||||
(channel) => channel.id === supportbot.TranscriptLog
|
||||
);
|
||||
let user = interaction.user;
|
||||
let reason =
|
||||
interaction.options.getString("reason") ||
|
||||
"No Reason Provided.";
|
||||
|
||||
let name = interaction.channel.name;
|
||||
let ticketChannel = interaction.channel;
|
||||
|
||||
interaction
|
||||
.reply(`**${supportbot.ClosingTicket}**`)
|
||||
|
||||
.then(() => {
|
||||
const logEmbed = new Discord.MessageEmbed()
|
||||
.setTitle(supportbot.TranscriptTitle)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(supportbot.EmbedFooter)
|
||||
.addField("Closed By", interaction.user.tag)
|
||||
.addField("Reason", reason);
|
||||
|
||||
interaction.channel.interactions
|
||||
.fetch({ limit: 100 })
|
||||
.then((msgs) => {
|
||||
let html = "";
|
||||
|
||||
msgs = msgs.sort(
|
||||
(a, b) => a.createdTimestamp - b.createdTimestamp
|
||||
);
|
||||
html += `<strong>Server Name:</strong> ${interaction.guild.name}<br>`;
|
||||
html += `<strong>Ticket:</strong> ${ticketChannel.name}<br>`;
|
||||
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
||||
|
||||
msgs.forEach((msg) => {
|
||||
if (msg.content) {
|
||||
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
|
||||
html += `<strong>Message:</strong> ${msg.content}<br>`;
|
||||
html += `-----<br><br>`;
|
||||
}
|
||||
});
|
||||
|
||||
logChannel.send({ embeds: [logEmbed] }).catch((err) => {
|
||||
interaction.reply(err);
|
||||
});
|
||||
|
||||
let file = new Discord.MessageAttachment(
|
||||
Buffer.from(html),
|
||||
`${name}.html`
|
||||
);
|
||||
logChannel
|
||||
.send({ embeds: [logEmbed], files: [file] })
|
||||
.catch((err) => {
|
||||
interaction.reply(err);
|
||||
});
|
||||
|
||||
interaction.channel.delete().catch((error) => {
|
||||
if (
|
||||
error.code !==
|
||||
Discord.Constants.APIErrors.UNKNOWN_CHANNEL
|
||||
) {
|
||||
console.error(
|
||||
"Failed to delete the interaction:",
|
||||
error
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
interaction
|
||||
.followUp({
|
||||
content: "The request to close the ticket has timed out.",
|
||||
})
|
||||
.then((m2) => setTimeout(() => interaction.channel.delete(3000)));
|
||||
});
|
||||
}
|
||||
|
||||
if (!supportbot.CloseConfirmation) {
|
||||
let logChannel =
|
||||
interaction.guild.channels.cache.find(
|
||||
(channel) => channel.name === supportbot.TranscriptLog
|
||||
) ||
|
||||
interaction.guild.channels.cache.find(
|
||||
(channel) => channel.id === supportbot.TranscriptLog
|
||||
);
|
||||
let user = interaction.user;
|
||||
let reason =
|
||||
(await interaction.options.getString("reason")) ||
|
||||
"No Reason Provided.";
|
||||
|
||||
let name = interaction.channel.name;
|
||||
let ticketChannel = interaction.channel;
|
||||
|
||||
interaction
|
||||
.reply(`**${supportbot.ClosingTicket}**`)
|
||||
|
||||
.then(() => {
|
||||
const logEmbed = new Discord.MessageEmbed()
|
||||
.setTitle(supportbot.TranscriptTitle)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(supportbot.EmbedFooter)
|
||||
.addField("Closed By", interaction.user.tag)
|
||||
.addField("Reason", reason);
|
||||
|
||||
interaction.channel.interactions
|
||||
.fetch({ limit: 100 })
|
||||
.then((msgs) => {
|
||||
let html = "";
|
||||
|
||||
msgs = msgs.sort(
|
||||
(a, b) => a.createdTimestamp - b.createdTimestamp
|
||||
);
|
||||
html += `<strong>Server Name:</strong> ${interaction.guild.name}<br>`;
|
||||
html += `<strong>Ticket:</strong> ${ticketChannel.name}<br>`;
|
||||
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
||||
|
||||
msgs.forEach((msg) => {
|
||||
if (msg.content) {
|
||||
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
|
||||
html += `<strong>Message:</strong> ${msg.content}<br>`;
|
||||
html += `-----<br><br>`;
|
||||
}
|
||||
});
|
||||
|
||||
logChannel.send({ embeds: [logEmbed] }).catch((err) => {
|
||||
interaction.reply(err);
|
||||
});
|
||||
|
||||
let file = new Discord.MessageAttachment(
|
||||
Buffer.from(html),
|
||||
`${name}.html`
|
||||
);
|
||||
logChannel
|
||||
.send({ embeds: [logEmbed], files: [file] })
|
||||
.catch((err) => {
|
||||
interaction.reply(err);
|
||||
});
|
||||
|
||||
interaction.channel.delete().catch((error) => {
|
||||
if (
|
||||
error.code !== Discord.Constants.APIErrors.UNKNOWN_CHANNEL
|
||||
) {
|
||||
console.error("Failed to delete the interaction:", error);
|
||||
}
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(() => {
|
||||
interaction
|
||||
.followUp({
|
||||
content: "The request to close the ticket has timed out.",
|
||||
})
|
||||
.then((m2) => setTimeout(() => interaction.channel.delete(3000)));
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,78 @@
|
||||
// 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("./Data/supportbot.yml", "utf8"));
|
||||
const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
|
||||
|
||||
const Command = require("../Structures/Command.js");
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.EmbedCommand,
|
||||
description: cmdconfig.EmbedCommandDesc,
|
||||
slashCommandOptions: [
|
||||
{
|
||||
name: "title",
|
||||
description: "Embed Title",
|
||||
type: "STRING",
|
||||
},
|
||||
|
||||
{
|
||||
name: "message",
|
||||
description: "Embed Message",
|
||||
type: "STRING",
|
||||
},
|
||||
|
||||
],
|
||||
permission: "SEND_MESSAGES",
|
||||
|
||||
async run(interaction) {
|
||||
|
||||
let SupportStaff =
|
||||
interaction.guild.roles.cache.find(
|
||||
(SupportTeam) => SupportTeam.name === supportbot.Staff
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(SupportTeam) => SupportTeam.id === supportbot.Staff
|
||||
);
|
||||
let Admins =
|
||||
interaction.guild.roles.cache.find(
|
||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
||||
);
|
||||
|
||||
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(Admins.id)
|
||||
) {
|
||||
|
||||
const EmbedTitle = interaction.options.getString("title")
|
||||
const EmbedSubject = interaction.options.getString("message")
|
||||
|
||||
const EmbedMsg = new Discord.MessageEmbed()
|
||||
.setTitle(EmbedTitle)
|
||||
.setDescription(EmbedSubject)
|
||||
|
||||
interaction.reply({
|
||||
embeds: [EmbedMsg],
|
||||
});
|
||||
|
||||
} else {
|
||||
return interaction.reply({ embeds: [NoPerms] });
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
});
|
||||
@@ -0,0 +1,104 @@
|
||||
// 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("./Data/supportbot.yml", "utf8"));
|
||||
const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
|
||||
|
||||
const Command = require("../Structures/Command.js");
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.HelpCommand,
|
||||
description: cmdconfig.HelpCommandDesc,
|
||||
slashCommandOptions: [],
|
||||
permission: "SEND_MESSAGES",
|
||||
|
||||
async run(interaction) {
|
||||
let SupportStaff =
|
||||
interaction.guild.roles.cache.find(
|
||||
(adminRole) => adminRole.name === supportbot.Staff
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(staffRole) => staffRole.id === supportbot.Staff
|
||||
);
|
||||
let AdminStaff =
|
||||
interaction.guild.roles.cache.find(
|
||||
(adminRole) => adminRole.name === supportbot.Admin
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(adminRole) => adminRole.id === supportbot.Admin
|
||||
);
|
||||
|
||||
if (supportbot.HelpMenu) {
|
||||
let botCommands = "";
|
||||
botCommands += `**/${cmdconfig.HelpCommand}** ${cmdconfig.HelpCommandDesc}\n`;
|
||||
botCommands += `**/${cmdconfig.InfoCommand}** ${cmdconfig.InfoCommandDesc}\n`;
|
||||
botCommands += `**/${cmdconfig.PingCommand}** ${cmdconfig.PingCommandDesc}\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`;
|
||||
|
||||
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(supportbot.EmbedFooter, interaction.user.displayAvatarURL());
|
||||
|
||||
if (interaction.member.roles.cache.has(SupportStaff.id)) {
|
||||
HelpEmbed1.addFields({
|
||||
name: "🔐 Staff Commands\n",
|
||||
value: `${staffCommands}\n`,
|
||||
inline: false,
|
||||
});
|
||||
} else {
|
||||
if (interaction.member.roles.cache.has(AdminStaff.id)) {
|
||||
HelpEmbed1.addFields({
|
||||
name: "🔐 Staff Commands\n",
|
||||
value: `${staffCommands}\n`,
|
||||
inline: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (supportbot.SendHelpPage === "dm") {
|
||||
interaction.user.reply({
|
||||
embeds: [HelpEmbed1],
|
||||
});
|
||||
}
|
||||
|
||||
if (supportbot.SendHelpPage === "channel") {
|
||||
interaction.reply({
|
||||
embeds: [HelpEmbed1],
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1,38 @@
|
||||
// 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("./Data/supportbot.yml", "utf8"));
|
||||
const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
|
||||
|
||||
const Command = require("../Structures/Command.js");
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.InfoCommand,
|
||||
description: cmdconfig.InfoCommandDesc,
|
||||
slashCommandOptions: [],
|
||||
permission: "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,30 @@
|
||||
// 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("./Data/supportbot.yml", "utf8"));
|
||||
const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
|
||||
|
||||
const Command = require("../Structures/Command.js");
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.PingCommand,
|
||||
description: cmdconfig.PingCommandDesc,
|
||||
slashCommandOptions: [],
|
||||
permission: "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,361 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Ticket Command
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const yaml = require("js-yaml");
|
||||
const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
|
||||
const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
|
||||
|
||||
const Command = require("../Structures/Command.js");
|
||||
const TicketNumberID = require("../Structures/TicketID.js");
|
||||
|
||||
async function asyncForEach(array, callback) {
|
||||
for (let index = 0; index < array.length; index++) {
|
||||
await callback(array[index], index, array);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = new Command({
|
||||
name: cmdconfig.OpenTicket,
|
||||
description: cmdconfig.OpenTicketDesc,
|
||||
slashCommandOptions: [
|
||||
{
|
||||
name: "reason",
|
||||
description: "Ticket Reason",
|
||||
type: "STRING",
|
||||
},
|
||||
],
|
||||
permission: "SEND_MESSAGES",
|
||||
|
||||
async run(interaction) {
|
||||
let reactionUser = interaction.guild.members.cache.get(interaction.user.id);
|
||||
|
||||
if (
|
||||
reactionUser.roles.cache.find(
|
||||
(role) => role.name === supportbot.TicketBlackListRole
|
||||
) ||
|
||||
reactionUser.roles.cache.find(
|
||||
(role) => role.id === supportbot.TicketBlackListRole
|
||||
)
|
||||
) {
|
||||
return interaction
|
||||
.reply({
|
||||
content: `<@${interaction.user.id}> ${supportbot.TicketBlackListMessage}`,
|
||||
})
|
||||
.then((msg) => {
|
||||
setTimeout(() => msg.delete(), 3500);
|
||||
});
|
||||
}
|
||||
|
||||
// Ticket ID
|
||||
let ticketNumberID = TicketNumberID.pad(interaction.guild.id);
|
||||
|
||||
// Ticket Subject
|
||||
const TicketSubject =
|
||||
interaction.options?.getString("reason") || supportbot.NoTicketSubject;
|
||||
|
||||
const TicketExists = new Discord.MessageEmbed()
|
||||
.setTitle("Ticket Exists!")
|
||||
.setDescription(`${supportbot.TicketExists}`)
|
||||
.setColor(supportbot.WarningColour);
|
||||
|
||||
if (
|
||||
interaction.guild.channels.cache.find(
|
||||
(ticketChannel) =>
|
||||
ticketChannel.name === `${supportbot.TicketChannel}-${ticketNumberID}`
|
||||
)
|
||||
) {
|
||||
return interaction.reply({ embeds: [TicketExists] });
|
||||
}
|
||||
const Staff =
|
||||
interaction.guild.roles.cache.find(
|
||||
(SupportTeam) => SupportTeam.name === supportbot.Staff
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(SupportTeam) => SupportTeam.id === supportbot.Staff
|
||||
);
|
||||
const Admins =
|
||||
interaction.guild.roles.cache.find(
|
||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
||||
);
|
||||
const DeptRole1 =
|
||||
interaction.guild.roles.cache.find(
|
||||
(DepartmentRole) =>
|
||||
DepartmentRole.name === `${supportbot.DepartmentRole_1}`
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(DepartmentRole) =>
|
||||
DepartmentRole.id === `${supportbot.DepartmentRole_1}`
|
||||
);
|
||||
const DeptRole2 =
|
||||
interaction.guild.roles.cache.find(
|
||||
(DepartmentRole) =>
|
||||
DepartmentRole.name === `${supportbot.DepartmentRole_2}`
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(DepartmentRole) =>
|
||||
DepartmentRole.id === `${supportbot.DepartmentRole_2}`
|
||||
);
|
||||
const DeptRole3 =
|
||||
interaction.guild.roles.cache.find(
|
||||
(DepartmentRole) =>
|
||||
DepartmentRole.name === `${supportbot.DepartmentRole_3}`
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(DepartmentRole) =>
|
||||
DepartmentRole.id === `${supportbot.DepartmentRole_3}`
|
||||
);
|
||||
const Author = interaction.user;
|
||||
const Everyone = interaction.guild.id;
|
||||
const ticketChannel = await interaction.guild.channels.create(
|
||||
`${supportbot.TicketChannel}-${ticketNumberID}`,
|
||||
{
|
||||
type: "GUILD_TEXT",
|
||||
}
|
||||
);
|
||||
|
||||
if (
|
||||
interaction.channel.name === supportbot.ReactionChannel ||
|
||||
interaction.channel.id === supportbot.ReactionChannel
|
||||
) {
|
||||
const CreatedTicket = new Discord.MessageEmbed()
|
||||
.setDescription(
|
||||
supportbot.TicketCreatedAlert.replace(
|
||||
/%ticketauthor%/g,
|
||||
interaction.user.id
|
||||
)
|
||||
.replace(/%ticketid%/g, ticketChannel.id)
|
||||
.replace(/%ticketusername%/g, interaction.user.username)
|
||||
)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
interaction.reply({ embeds: [CreatedTicket], ephemeral: true });
|
||||
} else {
|
||||
const CreatedTicket = new Discord.MessageEmbed()
|
||||
.setDescription(
|
||||
supportbot.TicketCreatedAlert.replace(
|
||||
/%ticketauthor%/g,
|
||||
interaction.user.id
|
||||
)
|
||||
.replace(/%ticketid%/g, ticketChannel.id)
|
||||
.replace(/%ticketusername%/g, interaction.user.username)
|
||||
)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
interaction.reply({ embeds: [CreatedTicket], ephemeral: true });
|
||||
}
|
||||
let AllowArr = [Staff, Staff, Admins, Author];
|
||||
await asyncForEach(AllowArr, (index) => {
|
||||
ticketChannel.permissionOverwrites.create(index, { VIEW_CHANNEL: true });
|
||||
});
|
||||
|
||||
let DenyArr = [Everyone];
|
||||
await asyncForEach(DenyArr, (index) => {
|
||||
ticketChannel.permissionOverwrites.create(index, { VIEW_CHANNEL: false });
|
||||
});
|
||||
|
||||
let TicketCategory =
|
||||
interaction.guild.channels.cache.find(
|
||||
(category) => category.name === supportbot.TicketCategory
|
||||
) ||
|
||||
interaction.guild.channels.cache.find(
|
||||
(category) => category.id === supportbot.TicketCategory
|
||||
);
|
||||
if (TicketCategory) {
|
||||
ticketChannel.setParent(TicketCategory.id);
|
||||
}
|
||||
|
||||
if (supportbot.AllowTicketMentions) {
|
||||
ticketChannel.send({ content: `${interaction.user}` });
|
||||
}
|
||||
|
||||
const TicketMessage = new Discord.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.") {
|
||||
ticketChannel.setTopic(
|
||||
`Reason: ${TicketSubject} - User ID: ${interaction.user.id} - Ticket: ${ticketChannel.name}`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (supportbot.TicketDepartments) {
|
||||
TicketMessage.addFields({
|
||||
name: "Departments",
|
||||
value: ` **${supportbot.DepartmentTitle_1}**\n **${supportbot.DepartmentTitle_2}**\n **${supportbot.DepartmentTitle_3}**`,
|
||||
});
|
||||
}
|
||||
const CloseButton = new Discord.MessageButton()
|
||||
.setCustomId("ticketclose")
|
||||
.setLabel("Close")
|
||||
.setStyle(supportbot.TicketCloseColour)
|
||||
.setEmoji(supportbot.TicketCloseEmoji);
|
||||
|
||||
const LockButton = new Discord.MessageButton()
|
||||
.setCustomId("ticketlock")
|
||||
.setLabel("Lock")
|
||||
.setStyle(supportbot.TicketLockColour)
|
||||
.setEmoji(supportbot.TicketLockEmoji);
|
||||
|
||||
const row2 = new Discord.MessageActionRow().addComponents(
|
||||
CloseButton,
|
||||
LockButton
|
||||
);
|
||||
|
||||
if (supportbot.TicketDepartments) {
|
||||
let DenyArr = [DeptRole1, DeptRole2, DeptRole3];
|
||||
await asyncForEach(DenyArr, (index) => {
|
||||
ticketChannel.permissionOverwrites.create(index, {
|
||||
VIEW_CHANNEL: false,
|
||||
});
|
||||
});
|
||||
const Department1Button = new Discord.MessageButton()
|
||||
.setCustomId("Department1")
|
||||
.setLabel(`${supportbot.DepartmentTitle_1}`)
|
||||
.setStyle(supportbot.TicketDept1Colour)
|
||||
.setEmoji(supportbot.TicketDept1Emoji);
|
||||
|
||||
const Department2Button = new Discord.MessageButton()
|
||||
.setCustomId("Department2")
|
||||
.setLabel(`${supportbot.DepartmentTitle_2}`)
|
||||
.setStyle(supportbot.TicketDept2Colour)
|
||||
.setEmoji(supportbot.TicketDept2Emoji);
|
||||
|
||||
const Department3Button = new Discord.MessageButton()
|
||||
.setCustomId("Department3")
|
||||
.setLabel(`${supportbot.DepartmentTitle_3}`)
|
||||
.setStyle(supportbot.TicketDept3Colour)
|
||||
.setEmoji(supportbot.TicketDept3Emoji);
|
||||
|
||||
const row = new Discord.MessageActionRow().addComponents(
|
||||
Department1Button,
|
||||
Department2Button,
|
||||
Department3Button
|
||||
);
|
||||
|
||||
const m = await ticketChannel.send({
|
||||
embeds: [TicketMessage],
|
||||
components: [row],
|
||||
});
|
||||
|
||||
const filter = (i) => {
|
||||
i.deferUpdate();
|
||||
return i.user.id === interaction.user.id;
|
||||
};
|
||||
const collector = m.createMessageComponentCollector({
|
||||
filter,
|
||||
max: 1,
|
||||
componentType: "BUTTON",
|
||||
time: 60000,
|
||||
});
|
||||
|
||||
collector.on("collect", async (i) => {
|
||||
if (i.customId === "Department1") {
|
||||
ticketChannel.permissionOverwrites.edit(DeptRole1, {
|
||||
VIEW_CHANNEL: true,
|
||||
READ_MESSAGE_HISTORY: true,
|
||||
SEND_MESSAGES: true,
|
||||
});
|
||||
|
||||
if (!supportbot.AllowStaff) {
|
||||
ticketChannel.permissionOverwrites.edit(Staff, {
|
||||
VIEW_CHANNEL: false,
|
||||
READ_MESSAGE_HISTORY: false,
|
||||
SEND_MESSAGES: false,
|
||||
});
|
||||
}
|
||||
|
||||
const Department1 = new Discord.MessageEmbed()
|
||||
.setDescription(
|
||||
`> Thank for reaching out to the **${supportbot.DepartmentTitle_1} Department**. Please provide us information regarding your query.`
|
||||
)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
ticketChannel.send({ embeds: [Department1] });
|
||||
|
||||
if (supportbot.AllowTicketMentions) {
|
||||
ticketChannel.send({ content: `@here` });
|
||||
}
|
||||
}
|
||||
i.message.edit({ embeds: [TicketMessage], components: [row2] });
|
||||
|
||||
if (i.customId === "Department2") {
|
||||
ticketChannel.permissionOverwrites.edit(DeptRole2, {
|
||||
VIEW_CHANNEL: true,
|
||||
READ_MESSAGE_HISTORY: true,
|
||||
SEND_MESSAGES: true,
|
||||
});
|
||||
|
||||
if (!supportbot.AllowStaff) {
|
||||
ticketChannel.permissionOverwrites.edit(Staff, {
|
||||
VIEW_CHANNEL: false,
|
||||
READ_MESSAGE_HISTORY: false,
|
||||
SEND_MESSAGES: false,
|
||||
});
|
||||
}
|
||||
|
||||
const Department2 = new Discord.MessageEmbed()
|
||||
.setDescription(
|
||||
`> Thank for reaching out to the **${supportbot.DepartmentTitle_2} Department**. Please provide us information regarding your query.`
|
||||
)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
ticketChannel.send({ embeds: [Department2] });
|
||||
|
||||
if (supportbot.AllowTicketMentions) {
|
||||
ticketChannel.send({ content: `@here` });
|
||||
}
|
||||
|
||||
i.message.edit({ embeds: [TicketMessage], components: [row2] });
|
||||
}
|
||||
if (i.customId === "Department3") {
|
||||
ticketChannel.permissionOverwrites.edit(DeptRole3, {
|
||||
VIEW_CHANNEL: true,
|
||||
READ_MESSAGE_HISTORY: true,
|
||||
SEND_MESSAGES: true,
|
||||
});
|
||||
|
||||
if (!supportbot.AllowStaff) {
|
||||
ticketChannel.permissionOverwrites.edit(Staff, {
|
||||
VIEW_CHANNEL: false,
|
||||
READ_MESSAGE_HISTORY: false,
|
||||
SEND_MESSAGES: false,
|
||||
});
|
||||
}
|
||||
|
||||
const Department3 = new Discord.MessageEmbed()
|
||||
.setDescription(
|
||||
`> Thank for reaching out to the **${supportbot.DepartmentTitle_3} Department**. Please provide us information regarding your query.`
|
||||
)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
ticketChannel.send({ embeds: [Department3] });
|
||||
|
||||
if (supportbot.AllowTicketMentions) {
|
||||
ticketChannel.send({ content: `@here` });
|
||||
}
|
||||
i.message.edit({ embeds: [TicketMessage], components: [row2] });
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ticketChannel.send({ embeds: [TicketMessage], components: [row2] });
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1,39 @@
|
||||
# ___ _ ___ _
|
||||
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||
# |_| |_|
|
||||
#
|
||||
# SupportBot created by Emerald Services
|
||||
# Installed with MIT License
|
||||
#
|
||||
# Discord Support: https:#emeraldsrv.dev/discord
|
||||
# Community Resources: https:#emeraldsrv.dev/resources
|
||||
|
||||
# -------------------------------
|
||||
# Command Name Configuration
|
||||
# -------------------------------
|
||||
|
||||
TicketAdd: "add"
|
||||
TicketRemove: "remove"
|
||||
OpenTicket: "ticket"
|
||||
CloseTicket: "close"
|
||||
InfoCommand: "info"
|
||||
PingCommand: "ping"
|
||||
HelpCommand: "help"
|
||||
EmbedCommand: "embed"
|
||||
|
||||
# ---------------------------------------
|
||||
# Command Description Configuration
|
||||
# ---------------------------------------
|
||||
|
||||
TicketAddDesc: "Add a user to a support ticket."
|
||||
TicketRemoveDesc: "Remove a user from a support ticket."
|
||||
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."
|
||||
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
# ___ _ ___ _
|
||||
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||
# |_| |_|
|
||||
#
|
||||
# SupportBot created by Emerald Services
|
||||
# Installed with MIT License
|
||||
#
|
||||
# Discord Support: https:#emeraldsrv.dev/discord
|
||||
# Community Resources: https:#emeraldsrv.dev/resources
|
||||
|
||||
SupportBot_Version: "7.2 pre-3"
|
||||
|
||||
# -------------------------
|
||||
# General Configuration
|
||||
# -------------------------
|
||||
|
||||
Name: "SupportBot"
|
||||
Prefix: "!" # Everything uses the new Slash (/) Commands feature!
|
||||
Token: "BOT_TOKEN"
|
||||
|
||||
# -------------------------
|
||||
# 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"
|
||||
|
||||
# -------------------------
|
||||
# Help Configuration
|
||||
# -------------------------
|
||||
|
||||
HelpMenu: true # Do not change!
|
||||
SendHelpPage: "channel" # Set to channel or dm
|
||||
|
||||
# -------------------------
|
||||
# Role Configuration
|
||||
# -------------------------
|
||||
|
||||
AutoRole: true
|
||||
AutoRole_Role: "Member"
|
||||
LockdownRole: "@everyone"
|
||||
|
||||
Staff: "Support Team"
|
||||
Admin: "Project Developer"
|
||||
TicketBlackListRole: "Blacklisted"
|
||||
|
||||
# -------------------------
|
||||
# Tickets Configuration
|
||||
# -------------------------
|
||||
|
||||
TicketCategory: "▬▬ TICKETS ▬▬"
|
||||
TicketChannel: "ticket"
|
||||
|
||||
TicketLog: "ticket-log"
|
||||
TranscriptLog: "ticket-data"
|
||||
|
||||
TranscriptTitle: "Ticket Transcript"
|
||||
TicketLog_Title: "Ticket Log"
|
||||
TicketBlackListMessage: "You are not allowed to open a ticket"
|
||||
|
||||
TicketSubject: "description"
|
||||
# "description" will displays the ticket reason within the channel description
|
||||
# "embed" will displays 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 to false to dis-allow mentions within tickets.
|
||||
|
||||
# --- 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 - Blurple
|
||||
# DANGER - Red
|
||||
# SUCCESS - Green
|
||||
# Secondary - Grey
|
||||
|
||||
TicketLockReaction: "🔒"
|
||||
TicketDeleteReaction: "⛔"
|
||||
LockTicketCategory: "Archive"
|
||||
|
||||
TicketCloseEmoji: "❌"
|
||||
TicketDeleteEmoji: "⛔"
|
||||
TicketLockEmoji: "🔒"
|
||||
|
||||
TicketCloseColour: "DANGER"
|
||||
TicketDeleteColour: "DANGER"
|
||||
TicketLockColour: "PRIMARY"
|
||||
|
||||
TicketDept1Colour: "PRIMARY"
|
||||
TicketDept2Colour: "PRIMARY"
|
||||
TicketDept3Colour: "PRIMARY"
|
||||
|
||||
TicketDept1Emoji: "1️⃣"
|
||||
TicketDept2Emoji: "2️⃣"
|
||||
TicketDept3Emoji: "3️⃣"
|
||||
|
||||
TranscriptSavedMessage: "📝 **Transcript Saved!**"
|
||||
TicketLockMessage: "❌ **Ticket Locked!**"
|
||||
TicketDeleteMessage: "⚠ **Ticket Deleting!**" # Tickets deleting after 5 seconds by default.
|
||||
TicketDeleteTime: 5000 # Time must be set in milliseconds.
|
||||
|
||||
# --- Departments Config ---
|
||||
# --- Start ---
|
||||
|
||||
TicketDepartments: true
|
||||
|
||||
AllowStaff: true
|
||||
# If set to false users with the "Staff" role will not be able to view tickets
|
||||
# without a valid department role set below.
|
||||
|
||||
# Set to false to allow "Staff" to see tickets whether its a department for them or not.
|
||||
|
||||
DepartmentTitle_1: "General Support"
|
||||
DepartmentTitle_2: "Billing Support"
|
||||
DepartmentTitle_3: "Admin Team"
|
||||
# Ticket department title, This is the title for a ticket department to help users know what is available.
|
||||
|
||||
DepartmentRole_1: "Support Team"
|
||||
DepartmentRole_2: "Support Team"
|
||||
DepartmentRole_3: "Project Developer"
|
||||
# Ticket roles are the roles that will be able to gain access to tickets depending on what department has been chosen.
|
||||
|
||||
# --- Closing Config ---
|
||||
# --- Start ---
|
||||
|
||||
ClosingTicket: ":warning: You have requested to close your support ticket."
|
||||
ClosingConfirmation_Word: "confirm"
|
||||
CloseConfirmation: false
|
||||
|
||||
# ---------------------------
|
||||
# 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 @@
|
||||
TicketPanelID: ''
|
||||
@@ -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: "create-ticket"
|
||||
ButtonEmoji: "📩"
|
||||
ButtonLabel: "Open Ticket"
|
||||
ButtonColour: "SUCCESS"
|
||||
# Colour Options:
|
||||
# -> PRIMARY - Blurple
|
||||
# -> SECONDARY - Grey
|
||||
# -> SUCCESS - Green
|
||||
# -> DANGER - Red
|
||||
|
||||
PanelTitle: "Need Help? Create a Support Ticket."
|
||||
|
||||
TicketPanel_Description: true
|
||||
TicketPanel_Thumbnail: false
|
||||
TicketPanel_Image: false
|
||||
|
||||
PanelMessage: "Click the button to open a new support ticket."
|
||||
PanelThumbnail: "https://i.imgur.com/ieeZejl.png"
|
||||
PanelImage: "https://i.imgur.com/5NkcmDq.png"
|
||||
-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,180 @@
|
||||
// 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("./Data/supportbot.yml", "utf8"));
|
||||
const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
|
||||
|
||||
const Event = require("../Structures/Event.js");
|
||||
|
||||
module.exports = new Event("interactionCreate", (client, interaction) => {
|
||||
if (interaction.isCommand()) {
|
||||
const command = client.commands.find(
|
||||
(cmd) => cmd.name.toLowerCase() == interaction.commandName
|
||||
);
|
||||
|
||||
if (interaction.user.bot || !interaction.isCommand() || !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.permission);
|
||||
|
||||
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],
|
||||
});
|
||||
interaction.user = interaction.user;
|
||||
command.run(interaction);
|
||||
}
|
||||
if (interaction.isButton()) {
|
||||
if (interaction.customId === "openticket") {
|
||||
try {
|
||||
const cmd = client.commands.get(cmdconfig.OpenTicket);
|
||||
if (!cmd) return;
|
||||
cmd.run(interaction);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
if (interaction.customId === "ticketclose") {
|
||||
if (interaction.channel.name.startsWith(`${supportbot.TicketChannel}-`)) {
|
||||
interaction.message.fetch();
|
||||
interaction.deferUpdate();
|
||||
const DeleteTicketEmbed = new Discord.MessageEmbed()
|
||||
.setDescription(supportbot.TicketDeleteMessage)
|
||||
.setColor(supportbot.EmbedColour);
|
||||
interaction.channel.send({ embeds: [DeleteTicketEmbed] });
|
||||
|
||||
let logChannel =
|
||||
interaction.guild.channels.cache.find(
|
||||
(channel) => channel.name === supportbot.TranscriptLog
|
||||
) ||
|
||||
interaction.guild.channels.cache.find(
|
||||
(channel) => channel.id === supportbot.TranscriptLog
|
||||
);
|
||||
|
||||
let user = interaction.user;
|
||||
let name = interaction.channel.name;
|
||||
let ticketChannel = interaction.channel;
|
||||
let reason = "No Reason Provided.";
|
||||
|
||||
interaction.channel
|
||||
.send({ content: `**${supportbot.ClosingTicket}**` })
|
||||
.then(() => {
|
||||
const logEmbed = new Discord.MessageEmbed()
|
||||
.setTitle(supportbot.TranscriptTitle)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(supportbot.EmbedFooter)
|
||||
.addField("Closed By", user.username)
|
||||
.addField("Reason", reason);
|
||||
|
||||
interaction.channel.messages.fetch({ limit: 100 }).then((msgs) => {
|
||||
let html = "";
|
||||
|
||||
msgs = msgs.sort(
|
||||
(a, b) => a.createdTimestamp - b.createdTimestamp
|
||||
);
|
||||
html += `<strong>Server Name:</strong> ${interaction.guild.name}<br>`;
|
||||
html += `<strong>Ticket:</strong> ${ticketChannel.name}<br>`;
|
||||
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
||||
|
||||
msgs.forEach((msg) => {
|
||||
if (msg.content) {
|
||||
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
|
||||
html += `<strong>Message:</strong> ${msg.content}<br>`;
|
||||
html += `-----<br><br>`;
|
||||
}
|
||||
});
|
||||
|
||||
const TranscriptSavedEmbed = new Discord.MessageEmbed()
|
||||
.setDescription(supportbot.TranscriptSavedMessage)
|
||||
.setColor(supportbot.SuccessColour);
|
||||
interaction.channel.send({ embeds: [TranscriptSavedEmbed] });
|
||||
|
||||
let file = new Discord.MessageAttachment(
|
||||
Buffer.from(html),
|
||||
`${name}.html`
|
||||
);
|
||||
logChannel.send({ embeds: [logEmbed], files: [file] });
|
||||
|
||||
setTimeout(
|
||||
() => interaction.channel.delete(),
|
||||
supportbot.TicketDeleteTime
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
if (interaction.customId === "ticketlock") {
|
||||
if (interaction.channel.name.startsWith(`${supportbot.TicketChannel}`)) {
|
||||
interaction.message.fetch();
|
||||
interaction.deferUpdate();
|
||||
let Admin =
|
||||
interaction.guild.roles.cache.find(
|
||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
||||
) ||
|
||||
interaction.guild.roles.cache.find(
|
||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
||||
);
|
||||
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) {
|
||||
interaction.channel.setParent(parent.id);
|
||||
}
|
||||
|
||||
all.forEach((perm) => {
|
||||
interaction.channel.permissionOverwrites.delete(perm.id);
|
||||
});
|
||||
interaction.channel.permissionOverwrites.create(Admin.id, {
|
||||
VIEW_CHANNEL: true,
|
||||
});
|
||||
|
||||
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.channel.send({ embeds: [ArchiveEmbed] });
|
||||
interaction.message.edit({ components: [row] });
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,43 @@
|
||||
// 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("./Data/supportbot.yml", "utf8"));
|
||||
const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
|
||||
const panelconfig = yaml.load(
|
||||
fs.readFileSync("./Data/ticket-panel.yml", "utf8")
|
||||
);
|
||||
|
||||
const Event = require("../Structures/Event.js");
|
||||
|
||||
module.exports = new Event("messageReactionAdd", async (client) => {
|
||||
let message = {
|
||||
guild: reaction.message.channel.guild,
|
||||
author: user,
|
||||
content: "N/A",
|
||||
channel: reaction.message.channel,
|
||||
};
|
||||
|
||||
if (panelconfig.TicketPanel) {
|
||||
if (reaction.message.id === panelconfig.TicketPanelID) {
|
||||
if (
|
||||
reaction.emoji.name == panelconfig.ButtonEmoji ||
|
||||
reaction.emoji.id == panelconfig.ButtonEmoji
|
||||
) {
|
||||
await reaction.users.remove(user.id);
|
||||
|
||||
try {
|
||||
const cmd = client.commands.get(cmdconfig.OpenTicket);
|
||||
if (!cmd) return;
|
||||
|
||||
cmd.run(message, message.content);
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
+126
@@ -0,0 +1,126 @@
|
||||
// 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("./Data/supportbot.yml", "utf8"));
|
||||
const panelconfig = yaml.load(
|
||||
fs.readFileSync("./Data/ticket-panel.yml", "utf8")
|
||||
);
|
||||
|
||||
const Event = require("../Structures/Event.js");
|
||||
|
||||
module.exports = new Event("ready", (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`,
|
||||
`Resources:`,
|
||||
`\u001b[36m`,
|
||||
`https://emeraldsrv.dev/resources`
|
||||
);
|
||||
console.log(
|
||||
`\u001b[33m`,
|
||||
`Documentation:`,
|
||||
`\u001b[36m`,
|
||||
`https://supportbot.emeraldsrv.dev`
|
||||
);
|
||||
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`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||
|
||||
if (panelconfig.TicketPanel) {
|
||||
let chan1 = client.channels.cache.find(
|
||||
(channel) => channel.name === panelconfig.Channel
|
||||
);
|
||||
|
||||
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 = yaml.load(
|
||||
fs.readFileSync("./Data/ticket-panel-id.yml", "utf8")
|
||||
);
|
||||
|
||||
chan1.messages.fetch(panelid.TicketPanelID).catch(async (r) => {
|
||||
let embed = new Discord.MessageEmbed()
|
||||
.setTitle(`${panelconfig.PanelTitle}`)
|
||||
.setColor(supportbot.SuccessColour)
|
||||
.setFooter(supportbot.EmbedFooter);
|
||||
|
||||
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 = new Discord.MessageButton()
|
||||
.setLabel(panelconfig.ButtonLabel)
|
||||
.setCustomId("openticket")
|
||||
.setStyle(panelconfig.ButtonColour);
|
||||
|
||||
let row = new Discord.MessageActionRow().addComponents(button);
|
||||
|
||||
await chan1
|
||||
.send({
|
||||
embeds: [embed],
|
||||
components: [row],
|
||||
})
|
||||
.then((r) => {
|
||||
let data = {
|
||||
TicketPanelID: `${r.id}`,
|
||||
};
|
||||
let yamlStr = yaml.dump(data);
|
||||
fs.writeFileSync("./Data/ticket-panel-id.yml", yamlStr, "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,5 +0,0 @@
|
||||
<h1 align="center">SupportBot</h1>
|
||||
<p align="center">Created by Emerald SRV</p>
|
||||
<p align="center"> SupportBot is a free self-hosted discord that is developed/designed to help control and manage the support that takes place throughout your discord server(s). SupportBot has been going around since late-2018 and it's still being constantly, updated and supported today. Alongside the core features of SupportBot which is support related features such as tickets etc.. we also allow additional addons which are made by both 3rd-party and official developers. If something goes wrong with SupportBot you can simply come to our discord server and contact us. We will be happy to help. Also! if anyone ever tells you that "nothing is free" then tell them to think again. Sometimes you just have to look a little harder to find what you want.</p>
|
||||
Version 5.2
|
||||
<hr>
|
||||
@@ -0,0 +1,23 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Addon Structure
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
const Discord = require("discord.js");
|
||||
|
||||
const yaml = require("js-yaml");
|
||||
const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
|
||||
|
||||
function RunFunction(interaction) {}
|
||||
|
||||
class Addon {
|
||||
constructor(options) {
|
||||
this.name = options.name;
|
||||
this.description = options.description;
|
||||
this.permission = options.permission;
|
||||
this.slashCommandOptions = options.slashCommandOptions || [];
|
||||
this.run = options.run;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Addon;
|
||||
@@ -0,0 +1,99 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Client Structure
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const Command = require("./Command.js");
|
||||
const Event = require("./Event.js");
|
||||
const intents = new Discord.Intents(32767);
|
||||
|
||||
const yaml = require("js-yaml");
|
||||
const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
|
||||
|
||||
class Client extends Discord.Client {
|
||||
constructor() {
|
||||
super({ intents });
|
||||
|
||||
this.commands = new Discord.Collection();
|
||||
}
|
||||
|
||||
start(token) {
|
||||
const commandFiles = fs
|
||||
.readdirSync("./Commands")
|
||||
.filter((file) => file.endsWith(".js"));
|
||||
|
||||
const commands = commandFiles.map((file) => require(`../Commands/${file}`));
|
||||
|
||||
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
|
||||
|
||||
const addonFiles = fs
|
||||
.readdirSync("./Addons")
|
||||
.filter((file) => file.endsWith(".js"));
|
||||
|
||||
const addons = addonFiles.map((file) => require(`../Addons/${file}`));
|
||||
|
||||
console.log(" ");
|
||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬");
|
||||
|
||||
addons.forEach((addon) => {
|
||||
console.log(`\u001b[31;1m`, `${addon.name}`, `\u001b[32;1m`, "Loaded");
|
||||
this.commands.set(addon.name, addon);
|
||||
});
|
||||
|
||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬");
|
||||
console.log(" ");
|
||||
|
||||
// Slash Commands
|
||||
|
||||
const slashCommands = commands.map((cmd) => ({
|
||||
name: cmd.name.toLowerCase(),
|
||||
description: cmd.description,
|
||||
permissions: [],
|
||||
options: cmd.slashCommandOptions,
|
||||
defaultPermission: true,
|
||||
}));
|
||||
|
||||
this.removeAllListeners();
|
||||
|
||||
this.on("ready", async () => {
|
||||
const cmds = await this.application?.commands.set(slashCommands);
|
||||
|
||||
console.log(" ");
|
||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Slash Command ▬▬▬▬▬▬▬"),
|
||||
console.log(" ");
|
||||
|
||||
cmds.forEach((cmd) =>
|
||||
console.log(`Slash Command ${cmd.name} registered`)
|
||||
);
|
||||
});
|
||||
|
||||
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, event.run.bind(null, this));
|
||||
});
|
||||
|
||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
|
||||
console.log(" ");
|
||||
|
||||
this.login(token);
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Client;
|
||||
@@ -0,0 +1,23 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Command Structure
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
const Discord = require("discord.js");
|
||||
|
||||
const yaml = require("js-yaml");
|
||||
const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
|
||||
|
||||
function RunFunction(interaction) {}
|
||||
|
||||
class Command {
|
||||
constructor(options) {
|
||||
this.name = options.name;
|
||||
this.description = options.description;
|
||||
this.permission = options.permission;
|
||||
this.slashCommandOptions = options.slashCommandOptions || [];
|
||||
this.run = options.run;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Command;
|
||||
@@ -0,0 +1,20 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Event Structure
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
const Discord = require("discord.js");
|
||||
|
||||
const yaml = require("js-yaml");
|
||||
const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
|
||||
|
||||
function RunFunction(client, ...eventArgs) {}
|
||||
|
||||
class Event {
|
||||
constructor(event, runFunction) {
|
||||
this.event = event;
|
||||
this.run = runFunction;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Event;
|
||||
@@ -0,0 +1,90 @@
|
||||
// SupportBot | Emerald Services
|
||||
// Ticket ID Structure
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const Command = require("./Command.js");
|
||||
const Client = require("./Client.js");
|
||||
const Event = require("./Event.js");
|
||||
|
||||
const yaml = require("js-yaml");
|
||||
const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.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("./Data/TicketData.json", "utf8")
|
||||
);
|
||||
|
||||
if (!ticketnumberID[guildId]) {
|
||||
ticketnumberID[guildId] = {
|
||||
id: 0,
|
||||
};
|
||||
|
||||
fs.writeFileSync(
|
||||
"./Data/TicketData.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("./Data/TicketData.json", "utf8")
|
||||
);
|
||||
|
||||
ticketnumberID[guildId] = {
|
||||
id: value,
|
||||
};
|
||||
|
||||
fs.writeFileSync(
|
||||
"./Data/TicketData.json",
|
||||
JSON.stringify(ticketnumberID, null, 4),
|
||||
(err) => {
|
||||
if (err) console.log(err);
|
||||
}
|
||||
);
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
static reset(guildId) {
|
||||
let ticketnumberID = JSON.parse(
|
||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||
);
|
||||
|
||||
ticketnumberID[guildId] = {
|
||||
id: 0,
|
||||
};
|
||||
|
||||
fs.writeFileSync(
|
||||
"./Data/TicketData.json",
|
||||
JSON.stringify(ticketnumberID, null, 4),
|
||||
(err) => {
|
||||
if (err) console.log(err);
|
||||
}
|
||||
);
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = TicketNumberID;
|
||||
@@ -1 +0,0 @@
|
||||
theme: jekyll-theme-cayman
|
||||
@@ -1,52 +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.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
|
||||
|
||||
const rolerequired = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
|
||||
|
||||
const outsideticket = new Discord.MessageEmbed()
|
||||
.setTitle("Incorrect Channel")
|
||||
.setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
|
||||
.setColor(supportbot.WarningColour);
|
||||
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.cache.get(args[0]));
|
||||
|
||||
const cantfinduser = new Discord.MessageEmbed()
|
||||
.setTitle("Invalid User!")
|
||||
.setDescription(`:warning: This user doesn't exist, Are they in this server?\n\nTry Again:\`${supportbot.Prefix}${supportbot.Add_Command} <user#0000>\``)
|
||||
.setColor(supportbot.WarningColour);
|
||||
if(!rUser) return message.channel.send({embed: cantfinduser});
|
||||
|
||||
message.channel.updateOverwrite(rUser, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
|
||||
const useradded = new Discord.MessageEmbed()
|
||||
.setColor(supportbot.SuccessColour)
|
||||
.setTitle("User Added")
|
||||
.setDescription(`👍 ${rUser} has been added to this ticket`)
|
||||
.setTimestamp();
|
||||
message.channel.send({embed: useradded});
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Add_Command,
|
||||
};
|
||||
@@ -1,55 +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) => {
|
||||
|
||||
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.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
|
||||
|
||||
const rolerequired = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setTitle(`${supportbot.Announcement_Title}`)
|
||||
.setDescription(args.join(" "))
|
||||
.setTimestamp()
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(`${message.author.username}#${message.author.discriminator}`, message.author.displayAvatarURL)
|
||||
|
||||
let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Announcement_Channel}`)
|
||||
|
||||
const errornochannel = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.Announcement_Channel}\`\n\nError Code: \`SB-03\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if(!locateChannel) return message.channel.send(errornochannel);
|
||||
|
||||
locateChannel.send(supportbot.everyone).then((msg) => {
|
||||
locateChannel.send(embed);
|
||||
});
|
||||
|
||||
|
||||
const AccSuccessEmbed = new Discord.MessageEmbed()
|
||||
.setTitle("Announcement Created")
|
||||
.setDescription(`👍 Successfully sent your announcement to <#${locateChannel.id}>`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
message.channel.send({embed: AccSuccessEmbed});
|
||||
|
||||
}
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Announcement_Command,
|
||||
}
|
||||
@@ -1,116 +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.MessageEmbed()
|
||||
.setTitle("Incorrect Channel")
|
||||
.setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
|
||||
.setColor(supportbot.WarningColour);
|
||||
message.channel.send(embed);
|
||||
return;
|
||||
}
|
||||
|
||||
const closeRequestEmbed = new Discord.MessageEmbed()
|
||||
.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.cache.find(channel => channel.name === supportbot.Transcript_Log);
|
||||
|
||||
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.MessageEmbed()
|
||||
.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.messages.fetch({ 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).catch(err => {
|
||||
message.reply(err)
|
||||
})
|
||||
logChannel.send( new Discord.MessageAttachment( Buffer.from( txt ), `${name}.txt` ) );
|
||||
|
||||
message.channel.delete();
|
||||
|
||||
// message.channel.messages.fetch( { 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,70 +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.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
|
||||
|
||||
const rolerequired = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
|
||||
|
||||
const outsideticket = new Discord.MessageEmbed()
|
||||
.setTitle("Incorrect Channel")
|
||||
.setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
|
||||
.setColor(supportbot.WarningColour);
|
||||
if (!message.channel.name.startsWith(`${supportbot.Ticket_Channel_Name}-`)) return message.channel.send({embed: outsideticket});
|
||||
|
||||
const log = message.guild.channels.cache.find(channel => channel.name === supportbot.Transcript_Log)
|
||||
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.MessageEmbed()
|
||||
.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.messages.fetch({ limit: 100 })
|
||||
|
||||
.then(msgs => {
|
||||
message.channel.messages.fetch({ 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,52 +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.MessageEmbed()
|
||||
.setTitle(supportbot.Bot_Name)
|
||||
.addField("🟨 User Commands", userCommands)
|
||||
.addField("🎫 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.MessageEmbed()
|
||||
.setTitle(supportbot.LINKS_TITLE)
|
||||
.setDescription(links)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(supportbot.EmbedFooter);
|
||||
message.channel.send(embed);
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Link_Command,
|
||||
};
|
||||
@@ -1,38 +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.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
||||
let lockedRole = message.guild.roles.cache.find(lc => lc.name === `${supportbot.locked_role}`)
|
||||
|
||||
const rolerequired = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
|
||||
|
||||
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: false, SEND_MESSAGES: false });
|
||||
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
||||
|
||||
const lockmsg = new Discord.MessageEmbed()
|
||||
.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.MessageEmbed()
|
||||
.setDescription(`:ping_pong: **Pong!** \`${bot.ping}ms\` `)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
message.channel.send(embed).catch(console.error);
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Ping_Command,
|
||||
}
|
||||
@@ -1,50 +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.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
||||
|
||||
const rolerequired = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.setTitle(`${supportbot.Poll_Title}`)
|
||||
.setDescription(args.join(" "))
|
||||
.setTimestamp()
|
||||
.setColor(supportbot.EmbedColour)
|
||||
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL)
|
||||
|
||||
let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Poll_Channel}`)
|
||||
|
||||
const errornochannel = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.Poll_Channel}\`\n\nError Code: \`SB-03\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if(!locateChannel) return message.channel.send(errornochannel);
|
||||
|
||||
locateChannel.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,53 +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.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
|
||||
|
||||
const rolerequired = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
|
||||
|
||||
const outsideticket = new Discord.MessageEmbed()
|
||||
.setTitle("Incorrect Channel")
|
||||
.setDescription(`:warning: You cannot execute this command here. This command is used when closing a ticket.`)
|
||||
.setColor(supportbot.WarningColour);
|
||||
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.cache.get(args[0]));
|
||||
|
||||
const cantfinduser = new Discord.MessageEmbed()
|
||||
.setTitle("Invalid User!")
|
||||
.setDescription(`:warning: This user doesn't exist, Are they in this server?\n\nTry Again:\`${supportbot.Prefix}${supportbot.Remove_Command} <user#0000>\``)
|
||||
.setColor(supportbot.WarningColour);
|
||||
if(!rUser) return message.channel.send({embed: cantfinduser});
|
||||
|
||||
message.channel.updateOverwrite(rUser, { VIEW_CHANNEL: false, CREATE_INVITE: false, SEND_MESSAGES: false, READ_MESSAGES: false });
|
||||
|
||||
const useradded = new Discord.MessageEmbed()
|
||||
.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,53 +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.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
|
||||
|
||||
const rolerequired = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
|
||||
|
||||
const outsideticket = new Discord.MessageEmbed()
|
||||
.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.MessageEmbed()
|
||||
.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 locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Ticket_Logs}`)
|
||||
|
||||
const errornochannel = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.Ticket_Logs}\`\n\nError Code: \`SB-03\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if(!locateChannel) return message.channel.send(errornochannel);
|
||||
|
||||
locateChannel.send(logEmbed)
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Rename_Command,
|
||||
}
|
||||
@@ -1,69 +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.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`);
|
||||
|
||||
if(!staffGroup) {
|
||||
message.reply(rolemissing).catch(err => {
|
||||
console.error(err);
|
||||
});
|
||||
} else {
|
||||
const rolerequired = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
|
||||
.setColor(supportbot.ErrorColour)
|
||||
|
||||
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
|
||||
if(!message.member.roles.cache.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.MessageEmbed()
|
||||
.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 locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Report_Channel}`)
|
||||
if(!locateChannel) {
|
||||
const errornochannel = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.Report_Channel}\`\n\nError Code: \`SB-03\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if(!locateChannel) return message.channel.send(errornochannel);
|
||||
|
||||
} else {
|
||||
locateChannel.send(embed);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Report_Command
|
||||
}
|
||||
@@ -1,38 +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.cache.find(staffRole => staffRole.name === supportbot.StaffRole);
|
||||
|
||||
const rolerequired = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
|
||||
|
||||
const embed = new Discord.MessageEmbed()
|
||||
.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,48 +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.MessageEmbed()
|
||||
.setTitle(`${supportbot.Suggestion_Title}`)
|
||||
.setDescription(`\`\`\`${args.join(" ")}\`\`\`\nFrom <@${message.author.id}>`)
|
||||
.setFooter(`${supportbot.EmbedFooter}`, message.author.avatarURL)
|
||||
.setTimestamp(new Date())
|
||||
.setColor(supportbot.EmbedColour)
|
||||
|
||||
let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Suggestion_Channel}`)
|
||||
|
||||
const errornochannel = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.Suggestion_Channel}\`\n\nError Code: \`SB-03\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if(!locateChannel) return message.channel.send(errornochannel);
|
||||
|
||||
locateChannel.send(SuggestionEmbed)
|
||||
|
||||
.then(async function(msg) {
|
||||
msg.react(supportbot.suggestyes).then(() => msg.react(supportbot.suggestno));
|
||||
});
|
||||
|
||||
const SuggestionSuccessEmbed = new Discord.MessageEmbed()
|
||||
.setDescription(`👍 Suggestion has been successfully created\nYou can view your suggestion in <#${locateChannel.id}>`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
message.channel.send(SuggestionSuccessEmbed);
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Suggest_Command,
|
||||
}
|
||||
@@ -1,166 +0,0 @@
|
||||
// SupportBot
|
||||
// Created by © 2020 Emerald Services
|
||||
// Command: Ticket
|
||||
|
||||
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.MessageEmbed()
|
||||
.setDescription(`:x: Cannot create a ticket because **${supportbot.Ticket_Channel_Name}-${ticketNumberID}** already exists.`)
|
||||
.setColor(supportbot.EmbedColour)
|
||||
|
||||
// Ticket Creation
|
||||
if (message.guild.channels.cache.find(TicketChannel => TicketChannel.name === `${supportbot.Ticket_Channel_Name}-` + message.author.username)) return message.channel.send(alreadyopen);
|
||||
message.guild.channels.create(`${supportbot.Ticket_Channel_Name}-${ticketNumberID}`, {
|
||||
type: 'text',
|
||||
}).then(TicketChannel => {
|
||||
|
||||
// Roles
|
||||
let staff = message.guild.roles.cache.find(supportRole => supportRole.name === `${supportbot.StaffRole}`)
|
||||
let everyone = message.guild.roles.cache.find(everyoneRole => everyoneRole.name === supportbot.everyone)
|
||||
let department = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_1}`)
|
||||
let department2 = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_2}`)
|
||||
let department3 = message.guild.roles.cache.find(DepartmentRole => DepartmentRole.name === `${supportbot.Department_Role_3}`)
|
||||
|
||||
// Permissions
|
||||
TicketChannel.updateOverwrite(everyone, { VIEW_CHANNEL: false });
|
||||
TicketChannel.updateOverwrite(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: false, READ_MESSAGES: true });
|
||||
TicketChannel.updateOverwrite(staff, { VIEW_CHANNEL: true, CREATE_INVITE: false, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
TicketChannel.updateOverwrite(department, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
TicketChannel.updateOverwrite(department2, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
TicketChannel.updateOverwrite(department3, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
|
||||
// Category
|
||||
let category = message.guild.channels.cache.find(c => c.name === supportbot.category);
|
||||
if (category) {
|
||||
TicketChannel.setParent(category.id);
|
||||
} else {
|
||||
if (message.guild.channels.cache.get(supportbot.category)) {
|
||||
TicketChannel.setParent(message.guild.channels.cache.get(supportbot.category).id);
|
||||
}
|
||||
}
|
||||
|
||||
const ticketopened = new Discord.MessageEmbed()
|
||||
.setTitle(":white_check_mark: Support Ticket Created")
|
||||
.setDescription(`<@${message.author.id}> your support ticket created successfully`)
|
||||
.addField("Your Ticket:", `<#${TicketChannel.id}>`)
|
||||
.setColor(supportbot.SuccessColour)
|
||||
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.MessageEmbed()
|
||||
.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.updateOverwrite(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
TicketChannel.updateOverwrite(staff, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
TicketChannel.updateOverwrite(department, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
|
||||
const dept1 = new Discord.MessageEmbed()
|
||||
.setDescription(`You have requested to contact ${department}. Please wait patiently for someone to reach out to you.`)
|
||||
.setColor(supportbot.SuccessColour)
|
||||
TicketChannel.send(dept1)
|
||||
}
|
||||
|
||||
if (reaction.emoji.name === `${Emoji_2}`) {
|
||||
TicketChannel.updateOverwrite(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
TicketChannel.updateOverwrite(staff, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
TicketChannel.updateOverwrite(department2, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
|
||||
const dept2 = new Discord.MessageEmbed()
|
||||
.setDescription(`You have requested to contact ${department2}. Please wait patiently for someone to reach out to you.`)
|
||||
.setColor(supportbot.SuccessColour)
|
||||
TicketChannel.send(dept2)
|
||||
}
|
||||
|
||||
if (reaction.emoji.name === `${Emoji_3}`) {
|
||||
TicketChannel.updateOverwrite(message.author, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
TicketChannel.updateOverwrite(staff, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
TicketChannel.updateOverwrite(department3, { VIEW_CHANNEL: true, CREATE_INVITE: false, SEND_MESSAGES: true, READ_MESSAGES: true });
|
||||
|
||||
const dept3 = new Discord.MessageEmbed()
|
||||
.setDescription(`You have requested to contact ${department3}. Please wait patiently for someone to reach out to you.`)
|
||||
.setColor(supportbot.SuccessColour)
|
||||
TicketChannel.send(dept3)
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Ticket Logging
|
||||
const logEmbed = new Discord.MessageEmbed()
|
||||
.setTitle(":ticket: Ticket Log")
|
||||
.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 locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === `${supportbot.Ticket_Logs}`)
|
||||
|
||||
const errornochannel = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Channel not Found, This command cannot be executed proberbly as their is no channel within this server.\nThis is configurable via **supportbot-config.yml**\n\nChannel Required: \`${supportbot.Ticket_Logs}\`\n\nError Code: \`SB-03\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if(!locateChannel) return message.channel.send(errornochannel);
|
||||
|
||||
locateChannel.send(logEmbed)
|
||||
|
||||
}).catch(err=>{console.error(err)});
|
||||
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: supportbot.Ticket_Command,
|
||||
};
|
||||
@@ -1,38 +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.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
||||
let lockedRole = message.guild.roles.cache.find(lc => lc.name === `${supportbot.locked_role}`)
|
||||
|
||||
const rolerequired = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Incorrect Permissions, You cannot execute this command as you do not have the required role.\n\nRole Required: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-02\``)
|
||||
.setColor(supportbot.ErrorColour);
|
||||
if (!message.member.roles.cache.has(staffGroup.id)) return message.reply({embed: rolerequired});
|
||||
|
||||
message.channel.overwritePermissions(lockedRole, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
||||
message.channel.overwritePermissions(staffGroup, { READ_MESSAGES: true, SEND_MESSAGES: true });
|
||||
|
||||
const lockmsg = new Discord.MessageEmbed()
|
||||
.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,157 +1,22 @@
|
||||
// ____ _ ____ _
|
||||
// / ___| _ _ _ __ _ __ ___ _ __| |_| __ ) ___ | |_
|
||||
// \___ \| | | | '_ \| '_ \ / _ \| '__| __| _ \ / _ \| __|
|
||||
// ___) | |_| | |_) | |_) | (_) | | | |_| |_) | (_) | |_
|
||||
// |____/ \__,_| .__/| .__/ \___/|_| \__|____/ \___/ \__|
|
||||
// |_| |_|
|
||||
// © 2020 Created by Emerald Services
|
||||
// Licnese: MIT
|
||||
// SupportBot v5.2
|
||||
// ___ _ ___ _
|
||||
// / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||
// \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||
// <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||
// |_| |_|
|
||||
//
|
||||
// SupportBot created by Emerald Services
|
||||
// Installed with MIT License
|
||||
//
|
||||
// Discord Support: https://emeraldsrv.dev/discord
|
||||
// Community Resources: https://emeraldsrv.dev/resources
|
||||
|
||||
const fs = require("fs");
|
||||
|
||||
const Discord = require("discord.js");
|
||||
const fs = require("fs");
|
||||
const bot = new Discord.Client();
|
||||
const yaml = require("js-yaml");
|
||||
const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
|
||||
|
||||
bot.commands = new Discord.Collection();
|
||||
const Client = require("./Structures/Client.js");
|
||||
const client = new Client({});
|
||||
|
||||
const yaml = require('js-yaml');
|
||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
||||
|
||||
fs.readdir("./commands/", (err, files) => {
|
||||
if(err) console.log(err);
|
||||
|
||||
let jsfile = files.filter(f => f.split(".").pop() === "js")
|
||||
if(jsfile.length <= 0) return console.log(`${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://emeraldservices.xyz/`);
|
||||
|
||||
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`, `${supportbot.Bot_Name} has successfully connected to discord`)
|
||||
console.log(`\u001b[37m`, `You can download additional features from our marketplace https://emeraldservices.xyz/`)
|
||||
console.log(`\u001b[37m`, `Invite your bot with https://discordapp.com/api/oauth2/authorize?client_id=${bot.user.id}&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();
|
||||
|
||||
let staffGroup = message.guild.roles.cache.find(staffRole => staffRole.name === `${supportbot.StaffRole}`)
|
||||
let autoGroup = message.guild.roles.cache.find(autoRole => autoRole.name === `${supportbot.AutoRole}`)
|
||||
let deptGroup1 = message.guild.roles.cache.find(deptRole1 => deptRole1.name === `${supportbot.Department_Role_1}`)
|
||||
let deptGroup2 = message.guild.roles.cache.find(deptRole2 => deptRole2.name === `${supportbot.Department_Role_2}`)
|
||||
let deptGroup3 = message.guild.roles.cache.find(deptRole3 => deptRole3.name === `${supportbot.Department_Role_3}`)
|
||||
|
||||
const rolemissing = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Staff role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.StaffRole}\`\n\nError Code: \`SB-01\``)
|
||||
.setColor(supportbot.ErrorColour)
|
||||
if (!staffGroup) return message.reply(rolemissing).catch(err=>{console.error(err)})
|
||||
|
||||
const rolemissing1 = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Auto Role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.AutoRole}\`\n\nError Code: \`SB-01\``)
|
||||
.setColor(supportbot.ErrorColour)
|
||||
if (!autoGroup) return message.reply(rolemissing1).catch(err=>{console.error(err)})
|
||||
|
||||
const rolemissing2 = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Department Role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.Department_Role_1}\`\n\nError Code: \`SB-01\``)
|
||||
.setColor(supportbot.ErrorColour)
|
||||
if (!deptGroup1) return message.reply(rolemissing2).catch(err=>{console.error(err)})
|
||||
|
||||
const rolemissing3 = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Department Role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.Department_Role_2}\`\n\nError Code: \`SB-01\``)
|
||||
.setColor(supportbot.ErrorColour)
|
||||
if (!deptGroup2) return message.reply(rolemissing3).catch(err=>{console.error(err)})
|
||||
|
||||
const rolemissing4 = new Discord.MessageEmbed()
|
||||
.setTitle("SupportBot Error!")
|
||||
.setDescription(`:x: **Error!** Department Role missing, You cannot execute any commands as the following role does not exist with this server.\nThis role is configurable via **supportbot-config.yml**\n\nPlease create the role: \`${supportbot.Department_Role_3}\`\n\nError Code: \`SB-01\` `)
|
||||
.setColor(supportbot.ErrorColour)
|
||||
if (!deptGroup3) return message.reply(rolemissing4).catch(err=>{console.error(err)})
|
||||
|
||||
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.MessageEmbed()
|
||||
.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.MessageEmbed()
|
||||
.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
+526
@@ -0,0 +1,526 @@
|
||||
{
|
||||
"name": "supportbot",
|
||||
"version": "7.2.0",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "supportbot",
|
||||
"version": "7.2.0",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"discord.js": "^13.2.0",
|
||||
"js-yaml": "^4.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/builders": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.6.0.tgz",
|
||||
"integrity": "sha512-mH3Gx61LKk2CD05laCI9K5wp+a3NyASHDUGx83DGJFkqJlRlSV5WMJNY6RS37A5SjqDtGMF4wVR9jzFaqShe6Q==",
|
||||
"dependencies": {
|
||||
"@sindresorhus/is": "^4.0.1",
|
||||
"discord-api-types": "^0.22.0",
|
||||
"ow": "^0.27.0",
|
||||
"ts-mixer": "^6.0.0",
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=14.0.0",
|
||||
"npm": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/builders/node_modules/discord-api-types": {
|
||||
"version": "0.22.0",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/collection": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
|
||||
"integrity": "sha512-vhxqzzM8gkomw0TYRF3tgx7SwElzUlXT/Aa41O7mOcyN6wIJfj5JmDWaO5XGKsGSsNx7F3i5oIlrucCCWV1Nog==",
|
||||
"engines": {
|
||||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@discordjs/form-data": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
||||
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/@sapphire/async-queue": {
|
||||
"version": "1.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.7.tgz",
|
||||
"integrity": "sha512-EBRERa9NqK/EV6DIPBVtjjdHBsu/DSdMuYAydmoIyIPONzp0UAxf2G6JGJ52WkiONtPRx6KNuqB5Q8dm14fwyw==",
|
||||
"engines": {
|
||||
"node": ">=v14.0.0",
|
||||
"npm": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@sindresorhus/is": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz",
|
||||
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sindresorhus/is?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "16.11.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.4.tgz",
|
||||
"integrity": "sha512-TMgXmy0v2xWyuCSCJM6NCna2snndD8yvQF67J29ipdzMcsPa9u+o0tjF5+EQNdhcuZplYuouYqpc4zcd5I6amQ=="
|
||||
},
|
||||
"node_modules/@types/ws": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.0.tgz",
|
||||
"integrity": "sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg==",
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/argparse": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
|
||||
},
|
||||
"node_modules/asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||
},
|
||||
"node_modules/callsites": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"dependencies": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/discord-api-types": {
|
||||
"version": "0.23.1",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
|
||||
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ==",
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/discord.js": {
|
||||
"version": "13.2.0",
|
||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.2.0.tgz",
|
||||
"integrity": "sha512-nyxUvL8wuQG38zx13wUMkpcA8koFszyiXdkSLwwM9opKW2LC2H5gD0cTZxImeJ6GtEnKPWT8xBiE8lLBmbNIhw==",
|
||||
"dependencies": {
|
||||
"@discordjs/builders": "^0.6.0",
|
||||
"@discordjs/collection": "^0.2.1",
|
||||
"@discordjs/form-data": "^3.0.1",
|
||||
"@sapphire/async-queue": "^1.1.5",
|
||||
"@types/ws": "^8.2.0",
|
||||
"discord-api-types": "^0.23.1",
|
||||
"node-fetch": "^2.6.1",
|
||||
"ws": "^8.2.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.6.0",
|
||||
"npm": ">=7.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/dot-prop": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
|
||||
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
|
||||
"dependencies": {
|
||||
"is-obj": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/is-obj": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
|
||||
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==",
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"node_modules/js-yaml": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
||||
"dependencies": {
|
||||
"argparse": "^2.0.1"
|
||||
},
|
||||
"bin": {
|
||||
"js-yaml": "bin/js-yaml.js"
|
||||
}
|
||||
},
|
||||
"node_modules/lodash.isequal": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
|
||||
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.50.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz",
|
||||
"integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "2.1.33",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz",
|
||||
"integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==",
|
||||
"dependencies": {
|
||||
"mime-db": "1.50.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/node-fetch": {
|
||||
"version": "2.6.5",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
|
||||
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
|
||||
"dependencies": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": "4.x || >=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ow": {
|
||||
"version": "0.27.0",
|
||||
"resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz",
|
||||
"integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==",
|
||||
"dependencies": {
|
||||
"@sindresorhus/is": "^4.0.1",
|
||||
"callsites": "^3.1.0",
|
||||
"dot-prop": "^6.0.1",
|
||||
"lodash.isequal": "^4.5.0",
|
||||
"type-fest": "^1.2.1",
|
||||
"vali-date": "^1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
||||
},
|
||||
"node_modules/ts-mixer": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz",
|
||||
"integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ=="
|
||||
},
|
||||
"node_modules/tslib": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||
},
|
||||
"node_modules/type-fest": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
|
||||
"integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==",
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/vali-date": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
|
||||
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
|
||||
},
|
||||
"node_modules/whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||
"dependencies": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/ws": {
|
||||
"version": "8.2.3",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
|
||||
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"bufferutil": "^4.0.1",
|
||||
"utf-8-validate": "^5.0.2"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"bufferutil": {
|
||||
"optional": true
|
||||
},
|
||||
"utf-8-validate": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"@discordjs/builders": {
|
||||
"version": "0.6.0",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.6.0.tgz",
|
||||
"integrity": "sha512-mH3Gx61LKk2CD05laCI9K5wp+a3NyASHDUGx83DGJFkqJlRlSV5WMJNY6RS37A5SjqDtGMF4wVR9jzFaqShe6Q==",
|
||||
"requires": {
|
||||
"@sindresorhus/is": "^4.0.1",
|
||||
"discord-api-types": "^0.22.0",
|
||||
"ow": "^0.27.0",
|
||||
"ts-mixer": "^6.0.0",
|
||||
"tslib": "^2.3.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"discord-api-types": {
|
||||
"version": "0.22.0",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@discordjs/collection": {
|
||||
"version": "0.2.1",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
|
||||
"integrity": "sha512-vhxqzzM8gkomw0TYRF3tgx7SwElzUlXT/Aa41O7mOcyN6wIJfj5JmDWaO5XGKsGSsNx7F3i5oIlrucCCWV1Nog=="
|
||||
},
|
||||
"@discordjs/form-data": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
||||
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
||||
"requires": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
}
|
||||
},
|
||||
"@sapphire/async-queue": {
|
||||
"version": "1.1.7",
|
||||
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.7.tgz",
|
||||
"integrity": "sha512-EBRERa9NqK/EV6DIPBVtjjdHBsu/DSdMuYAydmoIyIPONzp0UAxf2G6JGJ52WkiONtPRx6KNuqB5Q8dm14fwyw=="
|
||||
},
|
||||
"@sindresorhus/is": {
|
||||
"version": "4.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz",
|
||||
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw=="
|
||||
},
|
||||
"@types/node": {
|
||||
"version": "16.11.4",
|
||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.4.tgz",
|
||||
"integrity": "sha512-TMgXmy0v2xWyuCSCJM6NCna2snndD8yvQF67J29ipdzMcsPa9u+o0tjF5+EQNdhcuZplYuouYqpc4zcd5I6amQ=="
|
||||
},
|
||||
"@types/ws": {
|
||||
"version": "8.2.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.0.tgz",
|
||||
"integrity": "sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg==",
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"argparse": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
||||
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q=="
|
||||
},
|
||||
"asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||
},
|
||||
"callsites": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
||||
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
|
||||
},
|
||||
"combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"requires": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
||||
},
|
||||
"discord-api-types": {
|
||||
"version": "0.23.1",
|
||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
|
||||
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ=="
|
||||
},
|
||||
"discord.js": {
|
||||
"version": "13.2.0",
|
||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.2.0.tgz",
|
||||
"integrity": "sha512-nyxUvL8wuQG38zx13wUMkpcA8koFszyiXdkSLwwM9opKW2LC2H5gD0cTZxImeJ6GtEnKPWT8xBiE8lLBmbNIhw==",
|
||||
"requires": {
|
||||
"@discordjs/builders": "^0.6.0",
|
||||
"@discordjs/collection": "^0.2.1",
|
||||
"@discordjs/form-data": "^3.0.1",
|
||||
"@sapphire/async-queue": "^1.1.5",
|
||||
"@types/ws": "^8.2.0",
|
||||
"discord-api-types": "^0.23.1",
|
||||
"node-fetch": "^2.6.1",
|
||||
"ws": "^8.2.3"
|
||||
}
|
||||
},
|
||||
"dot-prop": {
|
||||
"version": "6.0.1",
|
||||
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
|
||||
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
|
||||
"requires": {
|
||||
"is-obj": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"is-obj": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
|
||||
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w=="
|
||||
},
|
||||
"js-yaml": {
|
||||
"version": "4.1.0",
|
||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
||||
"requires": {
|
||||
"argparse": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"lodash.isequal": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
|
||||
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.50.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz",
|
||||
"integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A=="
|
||||
},
|
||||
"mime-types": {
|
||||
"version": "2.1.33",
|
||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz",
|
||||
"integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==",
|
||||
"requires": {
|
||||
"mime-db": "1.50.0"
|
||||
}
|
||||
},
|
||||
"node-fetch": {
|
||||
"version": "2.6.5",
|
||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
|
||||
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
|
||||
"requires": {
|
||||
"whatwg-url": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"ow": {
|
||||
"version": "0.27.0",
|
||||
"resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz",
|
||||
"integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==",
|
||||
"requires": {
|
||||
"@sindresorhus/is": "^4.0.1",
|
||||
"callsites": "^3.1.0",
|
||||
"dot-prop": "^6.0.1",
|
||||
"lodash.isequal": "^4.5.0",
|
||||
"type-fest": "^1.2.1",
|
||||
"vali-date": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"tr46": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
||||
},
|
||||
"ts-mixer": {
|
||||
"version": "6.0.0",
|
||||
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz",
|
||||
"integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ=="
|
||||
},
|
||||
"tslib": {
|
||||
"version": "2.3.1",
|
||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||
},
|
||||
"type-fest": {
|
||||
"version": "1.4.0",
|
||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
|
||||
"integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA=="
|
||||
},
|
||||
"vali-date": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
|
||||
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY="
|
||||
},
|
||||
"webidl-conversions": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
|
||||
},
|
||||
"whatwg-url": {
|
||||
"version": "5.0.0",
|
||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||
"requires": {
|
||||
"tr46": "~0.0.3",
|
||||
"webidl-conversions": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"ws": {
|
||||
"version": "8.2.3",
|
||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
|
||||
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
|
||||
"requires": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
+14
-6
@@ -1,15 +1,23 @@
|
||||
{
|
||||
"name": "supportbot",
|
||||
"version": "5.1.0",
|
||||
"description": "a discord dbot that can you help with your servers support",
|
||||
"version": "7.2.0",
|
||||
"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",
|
||||
"scripts": {
|
||||
"test": "-help"
|
||||
"start": "npm i && node index.js"
|
||||
},
|
||||
"author": "Emerald SRV",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/1tzemerald/SupportBot.git"
|
||||
},
|
||||
"author": "Emerald Services",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/1tzemerald/SupportBot/issues"
|
||||
},
|
||||
"homepage": "https://github.com/1tzemerald/SupportBot#readme",
|
||||
"dependencies": {
|
||||
"discord.js": "^12.1.1",
|
||||
"js-yaml": "^3.13.1"
|
||||
"discord.js": "^13.2.0",
|
||||
"js-yaml": "^4.1.0"
|
||||
}
|
||||
}
|
||||
@@ -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**\nYou can download addons from our marketplace. https://emeraldservices.xyz/")
|
||||
|
||||
}
|
||||
|
||||
exports.help = {
|
||||
name: someaddon.settings.Addon_Example_Command,
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
{
|
||||
|
||||
"Addon_Example_Command": "addonexample"
|
||||
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
{}
|
||||
@@ -1,120 +0,0 @@
|
||||
# _________ __ __________ __
|
||||
# / _____/__ ________ ______ ____________/ |\______ \ _____/ |_
|
||||
# \_____ \| | \____ \\____ \ / _ \_ __ \ __\ | _// _ \ __\
|
||||
# / \ | / |_> > |_> > <_> ) | \/| | | | ( <_> ) |
|
||||
# /_______ /____/| __/| __/ \____/|__| |__| |______ /\____/|__|
|
||||
# \/ |__| |__| \/
|
||||
#
|
||||
# SupportBot v5.2
|
||||
# Created by © 2020 Emerald Services
|
||||
# License: MIT
|
||||
|
||||
#Bot Indentification
|
||||
Token: "BOT_TOKEN_HERE"
|
||||
Prefix: "!"
|
||||
Bot_Name: "SupportBot"
|
||||
|
||||
BotActivity: "SupportBot v5.2"
|
||||
ActivityType: "PLAYING"
|
||||
|
||||
EmbedColour: "#4bbf5c"
|
||||
EmbedFooter: "SupportBot | The #1 Supportive Discord Bot"
|
||||
|
||||
# Colour Settings
|
||||
ErrorColour: "#ff3030"
|
||||
SuccessColour: "#4bbf5c"
|
||||
WarningColour: "#fca117"
|
||||
|
||||
# Role Settings
|
||||
AutoRole: "Member"
|
||||
StaffRole: "Support"
|
||||
|
||||
locked_role: "@everyone"
|
||||
everyone: "@everyone"
|
||||
|
||||
Department_Role_1: "Support"
|
||||
Department_Role_2: "Sales"
|
||||
Department_Role_3: "Support"
|
||||
|
||||
# Ticket Department Settings
|
||||
Ticket_Department_1: "Support"
|
||||
Ticket_Department_2: "Sales"
|
||||
Ticket_Department_3: "Other"
|
||||
|
||||
Ticket_Department_Emoji_1: "🟢"
|
||||
Ticket_Department_Emoji_2: "🔵"
|
||||
Ticket_Department_Emoji_3: "🔴"
|
||||
|
||||
# Ticket Settings
|
||||
category: "Tickets"
|
||||
Ticket_Colour: "#4bbf5c"
|
||||
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"
|
||||
|
||||
# Welcome & Leave
|
||||
WelcomeChannel: "welcome"
|
||||
WelcomeMessage: "Welcome to the server!"
|
||||
|
||||
LeaveChannel: "welcome"
|
||||
LeaveMessage: "Thank you for visiting us!"
|
||||
|
||||
# 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