Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3fc1cd18d5 | ||
|
|
ebe29b403e | ||
|
|
dcba3312dd | ||
|
|
7fddeeec37 | ||
|
|
b5341b023f | ||
|
|
bbb7443ef2 | ||
|
|
22df347bb9 | ||
|
|
9aed6b8f35 | ||
|
|
9e7ec9f1bd | ||
|
|
373f43eac5 | ||
|
|
6c91b2791a | ||
|
|
bde62a431f | ||
|
|
615a074540 | ||
|
|
09b335ac46 | ||
|
|
2701880c77 | ||
|
|
24c8f2fb38 | ||
|
|
c3ec158ac3 | ||
|
|
b3690222d0 | ||
|
|
4d7583785b | ||
|
|
17ad1a15db | ||
|
|
4c89de9e76 | ||
|
|
5f25af41f9 | ||
|
|
3a3ee357fc | ||
|
|
08a6d27903 | ||
|
|
33f7675aac | ||
|
|
1178a0a611 | ||
|
|
96ded77bec | ||
|
|
e83ca8cb2b | ||
|
|
e507176d39 | ||
|
|
4e554b8bee | ||
|
|
bc649caa99 | ||
|
|
f7a4c7b616 | ||
|
|
2c7be5882c | ||
|
|
6107d268f7 | ||
|
|
7760699155 | ||
|
|
acf349c72e | ||
|
|
8096e5b882 | ||
|
|
873cfc7dc2 | ||
|
|
038174bc7e | ||
|
|
14881096bb | ||
|
|
ed1905d8f4 | ||
|
|
72c0a2efa3 | ||
|
|
e599d48713 | ||
|
|
7f44634d4f | ||
|
|
44170caac6 | ||
|
|
adedfadd92 | ||
|
|
6b01d0c8fe | ||
|
|
d4d96f59ab | ||
|
|
a1bf7ed6bd | ||
|
|
306e20efc9 | ||
|
|
f593f6e0a8 | ||
|
|
74646a4318 | ||
|
|
8bfcba8832 | ||
|
|
4ba5621a4d | ||
|
|
1f928324c2 | ||
|
|
3771872cd2 | ||
|
|
f359a60343 | ||
|
|
f53afd7bc9 | ||
|
|
e7dcc2ab29 | ||
|
|
0118b9e591 | ||
|
|
ffe42f9777 | ||
|
|
5a467599e9 | ||
|
|
c56e78484a | ||
|
|
1ee0d4a09e | ||
|
|
ffdce5820b | ||
|
|
9fed504f37 | ||
|
|
6c5799be0d | ||
|
|
b6747a0340 | ||
|
|
cd6df02e30 | ||
|
|
edbef6a36f | ||
|
|
b6a0016f5f | ||
|
|
e740c17837 | ||
|
|
7eb949f109 | ||
|
|
02394e310d | ||
|
|
ef83832819 | ||
|
|
a82101ab30 | ||
|
|
007c78930e | ||
|
|
300c83512c | ||
|
|
b674872c56 | ||
|
|
12a7680275 | ||
|
|
c9cf7c942b | ||
|
|
8e0326c8f8 | ||
|
|
13972119a8 | ||
|
|
acf165a119 | ||
|
|
bdff7c6069 | ||
|
|
e2e3376c87 | ||
|
|
3c613088e5 | ||
|
|
7e9ece50a0 | ||
|
|
af81b6536a | ||
|
|
4cd3ecf81f | ||
|
|
31f6b9e08e | ||
|
|
02de920cb3 | ||
|
|
84c0905297 | ||
|
|
250583f859 | ||
|
|
ee7d42196d | ||
|
|
a397de2b9f | ||
|
|
0610df9400 | ||
|
|
ed583deb31 | ||
|
|
e039048fc6 | ||
|
|
f2ea9650c4 | ||
|
|
1e89057006 | ||
|
|
019bb4842f | ||
|
|
4cb45beded | ||
|
|
8a2059f087 | ||
|
|
a6b105a2e1 | ||
|
|
6c14a6a06c | ||
|
|
cddd5d0026 | ||
|
|
78dea91e1d | ||
|
|
3df591ec52 | ||
|
|
1c4032caa6 | ||
|
|
465c422171 | ||
|
|
284e8dc6f5 | ||
|
|
3fc905c82e | ||
|
|
55a42b88ae | ||
|
|
bd26162e4a | ||
|
|
62e7e33406 | ||
|
|
2f0ddcec3f | ||
|
|
7cdfa68e0e | ||
|
|
f8939a964d | ||
|
|
7830e5dda5 | ||
|
|
6aa2f22294 | ||
|
|
50b14e3d44 | ||
|
|
e09c2192c2 | ||
|
|
b725d2cc62 | ||
|
|
abf3f617a4 | ||
|
|
1eda7e66fe | ||
|
|
b5000531c4 | ||
|
|
d4f95e752b | ||
|
|
e31c611f70 | ||
|
|
085481bee6 | ||
|
|
cf610fbe49 | ||
|
|
b681eb3cd2 | ||
|
|
f8ffdf0e81 | ||
|
|
ba38bce1da | ||
|
|
3a39b05fe4 | ||
|
|
27d2982b28 | ||
|
|
33e4d97be5 | ||
|
|
654064d7c5 | ||
|
|
aeb0da9e0d | ||
|
|
cb1a2fe067 | ||
|
|
85667ddfad | ||
|
|
7ad5016966 | ||
|
|
45c3315fd0 | ||
|
|
c5f550dd00 | ||
|
|
37c870c7ab | ||
|
|
155b768f73 | ||
|
|
09f0873f27 | ||
|
|
19a12f6c8f | ||
|
|
79a498d1d6 |
No files matched your search
@@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
name: "\U0001F41B Bug report"
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: "[BUG]"
|
||||||
|
labels: Bug
|
||||||
|
assignees: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Desktop (please complete the following information):**
|
||||||
|
|
||||||
|
- OS: [e.g. iOS]
|
||||||
|
- Browser [e.g. chrome, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
|
**Smartphone (please complete the following information):**
|
||||||
|
|
||||||
|
- Device: [e.g. iPhone6]
|
||||||
|
- OS: [e.g. iOS8.1]
|
||||||
|
- Browser [e.g. stock browser, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
name: "❓Suggest an Idea?"
|
||||||
|
about: Suggest an idea for SupportBot?
|
||||||
|
title: "[SUGGESTION]"
|
||||||
|
labels: Suggestion
|
||||||
|
assignees: ""
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
@@ -1,32 +1,28 @@
|
|||||||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
# This workflow will do a clean installation 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
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||||
|
|
||||||
name: Node.js CI
|
name: Node.js CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ master ]
|
branches: [dev, release]
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ master ]
|
branches: [dev, release]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
node-version: [10.x, 12.x, 14.x, 15.x]
|
node-version: [16.x, 17.x]
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
- name: Use Node.js ${{ matrix.node-version }}
|
||||||
uses: actions/setup-node@v1
|
uses: actions/setup-node@v1
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
- run: npm ci
|
- run: npm ci
|
||||||
- run: npm install discord.js --save
|
- run: npm test
|
||||||
- run: npm install js-yaml
|
|
||||||
- run: npm run build --if-present
|
|
||||||
- run: node index.js
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
node_modules/
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Example (default) Addon
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
// Your Addon Config file! Saved in /Addons/Configs/YourAddonConfig.yml
|
||||||
|
// const config = yaml.load(fs.readFileSync('./Addons/Configs/YourAddonConfig.yml', 'utf8'));
|
||||||
|
|
||||||
|
const { Command, Event } = require("../Structures/Addon");
|
||||||
|
|
||||||
|
module.exports.commands = [
|
||||||
|
/*
|
||||||
|
// EXAMPLE COMMAND
|
||||||
|
new Command({
|
||||||
|
name: "hello",
|
||||||
|
description: "hello",
|
||||||
|
options: [],
|
||||||
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
async run(interaction) {
|
||||||
|
const Embed = new Discord.MessageEmbed()
|
||||||
|
.setDescription("Hello World!")
|
||||||
|
.setColor(supportbot.InfoColour);
|
||||||
|
|
||||||
|
interaction.reply({
|
||||||
|
embeds: [Embed],
|
||||||
|
});
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
*/
|
||||||
|
];
|
||||||
|
module.exports.events = [
|
||||||
|
/*
|
||||||
|
// EXAMPLE EVENT
|
||||||
|
new Event("ready", async (client) => {
|
||||||
|
console.log("Bot started!");
|
||||||
|
}),
|
||||||
|
*/
|
||||||
|
];
|
||||||
@@ -0,0 +1,92 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Ticket Add Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.TicketAdd,
|
||||||
|
description: cmdconfig.TicketAddDesc,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: "user",
|
||||||
|
description: "User to add",
|
||||||
|
type: "USER",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const { getRole } = interaction.client;
|
||||||
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
|
if (!SupportStaff || !Admin)
|
||||||
|
return interaction.reply(
|
||||||
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
|
);
|
||||||
|
|
||||||
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(
|
||||||
|
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
|
||||||
|
if (
|
||||||
|
!interaction.member.roles.cache.has(SupportStaff.id) &&
|
||||||
|
!interaction.member.roles.cache.has(Admin.id)
|
||||||
|
)
|
||||||
|
return interaction.reply({ embeds: [NoPerms] });
|
||||||
|
|
||||||
|
let TicketData = await JSON.parse(
|
||||||
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
|
);
|
||||||
|
let ticket = await TicketData.tickets.findIndex(
|
||||||
|
(t) => t.id === interaction.channel.id
|
||||||
|
);
|
||||||
|
if (ticket === -1) {
|
||||||
|
const Exists = new Discord.MessageEmbed()
|
||||||
|
.setTitle("No Ticket Found!")
|
||||||
|
.setDescription(`${supportbot.NoValidTicket}`)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
return interaction.reply({ embeds: [Exists] });
|
||||||
|
}
|
||||||
|
|
||||||
|
let uMember = interaction.options.getUser("user");
|
||||||
|
const UserNotExist = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Not Found!")
|
||||||
|
.setDescription(
|
||||||
|
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.TicketAdd} <user#0000>\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
|
if (!uMember) return interaction.reply({ embeds: [UserNotExist] });
|
||||||
|
|
||||||
|
await interaction.channel.permissionOverwrites.edit(uMember.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
});
|
||||||
|
const Complete = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Added!")
|
||||||
|
.setDescription(supportbot.AddedUser.replace(/%user%/g, uMember.id))
|
||||||
|
.setTimestamp()
|
||||||
|
.setColor(supportbot.EmbedColour);
|
||||||
|
interaction.reply({ embeds: [Complete] });
|
||||||
|
TicketData.tickets[ticket].subUsers.push(uMember.id);
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/TicketData.json",
|
||||||
|
JSON.stringify(TicketData, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,180 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Close Ticket Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.CloseTicket,
|
||||||
|
description: cmdconfig.CloseTicketDesc,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: "reason",
|
||||||
|
description: "Ticket Close Reason",
|
||||||
|
type: "STRING",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const { getRole, getChannel } = interaction.client;
|
||||||
|
if (supportbot.StaffOnly) {
|
||||||
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
|
if (!SupportStaff || !Admin)
|
||||||
|
return interaction.reply(
|
||||||
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
|
);
|
||||||
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(
|
||||||
|
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
|
||||||
|
if (
|
||||||
|
!interaction.member.roles.cache.has(SupportStaff.id) &&
|
||||||
|
!interaction.member.roles.cache.has(Admin.id)
|
||||||
|
)
|
||||||
|
return interaction.reply({ embeds: [NoPerms] });
|
||||||
|
}
|
||||||
|
await interaction.deferReply();
|
||||||
|
let tickets = await JSON.parse(
|
||||||
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
|
);
|
||||||
|
let TicketData = await tickets.tickets.findIndex(
|
||||||
|
(t) => t.id === interaction.channel.id
|
||||||
|
);
|
||||||
|
let ticket = tickets.tickets[TicketData];
|
||||||
|
if (TicketData === -1) {
|
||||||
|
const Exists = new Discord.MessageEmbed()
|
||||||
|
.setTitle("No Ticket Found!")
|
||||||
|
.setDescription(`${supportbot.NoValidTicket}`)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
return interaction.followUp({ embeds: [Exists] });
|
||||||
|
}
|
||||||
|
let tUser = interaction.client.users.cache.get(ticket.user);
|
||||||
|
let transcriptChannel = await getChannel(
|
||||||
|
supportbot.TranscriptLog,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
let logChannel = await getChannel(supportbot.TicketLog, interaction.guild);
|
||||||
|
let reason =
|
||||||
|
(await interaction.options?.getString("reason")) || "No Reason Provided.";
|
||||||
|
|
||||||
|
if (!transcriptChannel || !logChannel)
|
||||||
|
return interaction.followUp("Some Channels seem to be missing!");
|
||||||
|
if (supportbot.CloseConfirmation) {
|
||||||
|
const CloseTicketRequest = new Discord.MessageEmbed()
|
||||||
|
.setTitle(`**${supportbot.ClosingTicket}**`)
|
||||||
|
.setDescription(
|
||||||
|
`Please confirm by repeating the following word.. \`${supportbot.ClosingConfirmation_Word}\` `
|
||||||
|
)
|
||||||
|
.setColor(supportbot.EmbedColour);
|
||||||
|
await interaction.followUp({ embeds: [CloseTicketRequest] });
|
||||||
|
let filter = (m) =>
|
||||||
|
m.content.toLowerCase() === supportbot.ClosingConfirmation_Word &&
|
||||||
|
m.author.id === interaction.user.id;
|
||||||
|
await interaction.channel.awaitMessages({
|
||||||
|
filter,
|
||||||
|
max: 1,
|
||||||
|
time: 20000,
|
||||||
|
errors: ["time"],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
tickets.tickets[TicketData].open = false;
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/TicketData.json",
|
||||||
|
JSON.stringify(tickets, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
await interaction.followUp(`**${supportbot.ClosingTicket}**`);
|
||||||
|
const transcriptEmbed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.TranscriptTitle)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setFooter(supportbot.EmbedFooter)
|
||||||
|
.addField(
|
||||||
|
"Ticket",
|
||||||
|
`${interaction.channel.name} (${interaction.channel.id})`
|
||||||
|
)
|
||||||
|
.addField("User", `${tUser}#${tUser.discriminator} (${tUser.id})`)
|
||||||
|
.addField("Closed By", interaction.user.tag)
|
||||||
|
.addField("Reason", reason);
|
||||||
|
const logEmbed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.TicketLog_Title)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setFooter(supportbot.EmbedFooter)
|
||||||
|
.addField(
|
||||||
|
"Ticket",
|
||||||
|
`${interaction.channel.name} (${interaction.channel.id})`
|
||||||
|
)
|
||||||
|
.addField(
|
||||||
|
"User",
|
||||||
|
`${tUser.username}#${tUser.discriminator} (${tUser.id})`
|
||||||
|
)
|
||||||
|
.addField("Closed By", interaction.user.tag)
|
||||||
|
.addField("Reason", reason);
|
||||||
|
let msgs = await interaction.channel.messages.fetch({ limit: 100 });
|
||||||
|
let html = "";
|
||||||
|
|
||||||
|
msgs = msgs.sort((a, b) => a.createdTimestamp - b.createdTimestamp);
|
||||||
|
html += `<style>* {background-color: #2c2f33;color: #fff;font-family: Arial, Helvetica, sans-serif;}</style>`;
|
||||||
|
html += `<strong>Server Name:</strong> ${interaction.guild.name}<br>`;
|
||||||
|
html += `<strong>Ticket:</strong> ${interaction.channel.name}<br>`;
|
||||||
|
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
||||||
|
|
||||||
|
await msgs.forEach((msg) => {
|
||||||
|
if (msg.content) {
|
||||||
|
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
|
||||||
|
html += `<strong>Message:</strong> ${msg.content}<br>`;
|
||||||
|
html += `-----<br><br>`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await logChannel.send({ embeds: [logEmbed] }).catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
let file = new Discord.MessageAttachment(
|
||||||
|
Buffer.from(html),
|
||||||
|
`${interaction.channel.name}.html`
|
||||||
|
);
|
||||||
|
await transcriptChannel
|
||||||
|
.send({ embeds: [transcriptEmbed], files: [file] })
|
||||||
|
.catch(async (err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
await tUser
|
||||||
|
.send({ embeds: [transcriptEmbed], files: [file] })
|
||||||
|
.catch(async (err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
if (ticket.subUsers) {
|
||||||
|
ticket.subUsers.forEach(async (subUser) => {
|
||||||
|
await interaction.client.users.cache
|
||||||
|
.get(subUser)
|
||||||
|
.send({ embeds: [transcriptEmbed], files: [file] });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
await interaction.channel.delete().catch(async (error) => {
|
||||||
|
console.error(error);
|
||||||
|
if (error.code !== Discord.Constants.APIErrors.UNKNOWN_CHANNEL) {
|
||||||
|
console.error("Failed to delete the interaction:", error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,69 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Embed Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.EmbedCommand,
|
||||||
|
description: cmdconfig.EmbedCommandDesc,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: "title",
|
||||||
|
description: "Embed Title",
|
||||||
|
type: "STRING",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "message",
|
||||||
|
description: "Embed Message",
|
||||||
|
type: "STRING",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const { getRole } = interaction.client;
|
||||||
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
|
|
||||||
|
if (!SupportStaff || !Admin)
|
||||||
|
return interaction.reply(
|
||||||
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
|
);
|
||||||
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(
|
||||||
|
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
|
||||||
|
if (
|
||||||
|
interaction.member.roles.cache.has(SupportStaff.id) ||
|
||||||
|
interaction.member.roles.cache.has(Admin.id)
|
||||||
|
) {
|
||||||
|
const EmbedTitle = interaction.options.getString("title");
|
||||||
|
const EmbedSubject = interaction.options.getString("message");
|
||||||
|
|
||||||
|
const EmbedMsg = new Discord.MessageEmbed()
|
||||||
|
.setTitle(EmbedTitle)
|
||||||
|
.setDescription(EmbedSubject);
|
||||||
|
|
||||||
|
interaction.reply({
|
||||||
|
embeds: [EmbedMsg],
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
return interaction.reply({ embeds: [NoPerms] });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Help Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.HelpCommand,
|
||||||
|
description: cmdconfig.HelpCommandDesc,
|
||||||
|
options: [],
|
||||||
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const { getRole } = interaction.client;
|
||||||
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
|
if (!SupportStaff || !Admin)
|
||||||
|
return interaction.reply(
|
||||||
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
|
);
|
||||||
|
|
||||||
|
let botCommands = "";
|
||||||
|
botCommands += `**/${cmdconfig.HelpCommand}** ${cmdconfig.HelpCommandDesc}\n`;
|
||||||
|
botCommands += `**/${cmdconfig.InfoCommand}** ${cmdconfig.InfoCommandDesc}\n`;
|
||||||
|
botCommands += `**/${cmdconfig.PingCommand}** ${cmdconfig.PingCommandDesc}\n`;
|
||||||
|
|
||||||
|
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) ||
|
||||||
|
interaction.member.roles.cache.has(Admin.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,40 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Info Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.InfoCommand,
|
||||||
|
description: cmdconfig.InfoCommandDesc,
|
||||||
|
options: [],
|
||||||
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const InfoButton = new Discord.MessageButton()
|
||||||
|
.setLabel(supportbot.InfoButtonText)
|
||||||
|
.setURL(supportbot.InfoURL)
|
||||||
|
.setStyle("LINK");
|
||||||
|
|
||||||
|
const inforow = new Discord.MessageActionRow().addComponents(InfoButton);
|
||||||
|
|
||||||
|
const InfoEmbed = new Discord.MessageEmbed()
|
||||||
|
.setURL(supportbot.InfoURL)
|
||||||
|
.setTitle(supportbot.InfoTitle)
|
||||||
|
.setDescription(supportbot.AboutMe)
|
||||||
|
.setColor(supportbot.InfoColour);
|
||||||
|
|
||||||
|
interaction.reply({
|
||||||
|
embeds: [InfoEmbed],
|
||||||
|
components: [inforow],
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Ping Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.PingCommand,
|
||||||
|
description: cmdconfig.PingCommandDesc,
|
||||||
|
options: [],
|
||||||
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const PingEmbed = new Discord.MessageEmbed()
|
||||||
|
.setDescription(
|
||||||
|
`:ping_pong: **Ping:** \`${interaction.client.ws.ping} ms\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.EmbedColour);
|
||||||
|
|
||||||
|
interaction.reply({
|
||||||
|
embeds: [PingEmbed],
|
||||||
|
});
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,94 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Ticket Remove Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.TicketRemove,
|
||||||
|
description: cmdconfig.TicketRemoveDesc,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: "user",
|
||||||
|
description: "User to remove",
|
||||||
|
type: "USER",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const { getRole } = interaction.client;
|
||||||
|
let Staff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
|
if (!Staff || !Admin)
|
||||||
|
return interaction.reply(
|
||||||
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
|
);
|
||||||
|
|
||||||
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(
|
||||||
|
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
|
||||||
|
if (
|
||||||
|
!interaction.member.roles.cache.has(Staff.id) &&
|
||||||
|
!interaction.member.roles.cache.has(Admin.id)
|
||||||
|
)
|
||||||
|
return interaction.reply({ embeds: [NoPerms] });
|
||||||
|
let TicketData = await JSON.parse(
|
||||||
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
|
);
|
||||||
|
let ticket = await TicketData.tickets.findIndex(
|
||||||
|
(t) => t.id === interaction.channel.id
|
||||||
|
);
|
||||||
|
if (ticket === -1) {
|
||||||
|
const Exists = new Discord.MessageEmbed()
|
||||||
|
.setTitle("No Ticket Found!")
|
||||||
|
.setDescription(`${supportbot.NoValidTicket}`)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
return interaction.reply({ 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] });
|
||||||
|
|
||||||
|
await interaction.channel.permissionOverwrites.edit(uMember.id, {
|
||||||
|
VIEW_CHANNEL: false,
|
||||||
|
});
|
||||||
|
|
||||||
|
const Complete = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Removed!")
|
||||||
|
.setDescription(supportbot.RemovedUser.replace(/%user%/g, uMember.id))
|
||||||
|
.setTimestamp()
|
||||||
|
.setColor(supportbot.EmbedColour);
|
||||||
|
interaction.reply({ embeds: [Complete] });
|
||||||
|
TicketData.tickets[ticket].subUsers = TicketData.tickets[
|
||||||
|
ticket
|
||||||
|
].subUsers.filter((u) => u !== uMember.id);
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/TicketData.json",
|
||||||
|
JSON.stringify(TicketData, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,67 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Ping Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.SuggestCommand,
|
||||||
|
description: cmdconfig.SuggestCommandDesc,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: "suggestion",
|
||||||
|
description: "Create a Suggestion",
|
||||||
|
type: "STRING",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const { getChannel } = interaction.client;
|
||||||
|
const suggestChannel = await getChannel(
|
||||||
|
supportbot.SuggestionChannel,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
|
||||||
|
const NoChannel = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Missing Channel!")
|
||||||
|
.setDescription(`${supportbot.InvalidChannel}`)
|
||||||
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
|
if (!suggestChannel) return interaction.reply({ embeds: [NoChannel] });
|
||||||
|
|
||||||
|
let suggestion = interaction.options.getString("suggestion");
|
||||||
|
|
||||||
|
const SuggestEmbed = new Discord.MessageEmbed()
|
||||||
|
.addField("Suggestion", suggestion, true)
|
||||||
|
.addField("From", `<@${interaction.user.id}>`)
|
||||||
|
.setThumbnail(interaction.user.displayAvatarURL())
|
||||||
|
.setFooter(supportbot.EmbedFooter, interaction.user.displayAvatarURL())
|
||||||
|
.setColor(supportbot.EmbedColour);
|
||||||
|
|
||||||
|
const suggestionMsg = await suggestChannel.send({ embeds: [SuggestEmbed] });
|
||||||
|
if (supportbot.SuggestionUpvote && supportbot.SuggestionDownvote) {
|
||||||
|
await suggestionMsg.react(supportbot.SuggestionUpvote);
|
||||||
|
await suggestionMsg.react(supportbot.SuggestionDownvote);
|
||||||
|
}
|
||||||
|
|
||||||
|
const Submitted = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Suggestion Submitted!")
|
||||||
|
.setDescription(
|
||||||
|
`:white_check_mark: You have successfully submitted a suggestion.`
|
||||||
|
)
|
||||||
|
.addField("Sent to:", `<#${suggestChannel.id}>`)
|
||||||
|
.setColor(supportbot.SuccessColour);
|
||||||
|
|
||||||
|
return interaction.reply({ embeds: [Submitted] });
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -0,0 +1,329 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Ticket Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const {
|
||||||
|
MessageEmbed,
|
||||||
|
Permissions,
|
||||||
|
MessageButton,
|
||||||
|
MessageActionRow,
|
||||||
|
} = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
const TicketNumberID = require("../Structures/TicketID.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.OpenTicket,
|
||||||
|
description: cmdconfig.OpenTicketDesc,
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: "reason",
|
||||||
|
description: "Ticket Reason",
|
||||||
|
type: "STRING",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
let TicketData = await JSON.parse(
|
||||||
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
|
);
|
||||||
|
const { getRole, getChannel, getCategory } = interaction.client;
|
||||||
|
let User = interaction.guild.members.cache.get(interaction.user.id);
|
||||||
|
|
||||||
|
if (
|
||||||
|
supportbot.MaxAllowedTickets &&
|
||||||
|
TicketData.tickets.filter((t) => t.user == interaction.user.id && t.open)
|
||||||
|
.length >= supportbot.MaxAllowedTickets
|
||||||
|
) {
|
||||||
|
return interaction.reply({
|
||||||
|
embeds: [
|
||||||
|
{
|
||||||
|
title: "Too Many Tickets!",
|
||||||
|
description: `You can't have more than ${supportbot.MaxAllowedTickets} open tickets!`,
|
||||||
|
color: supportbot.WarningColour,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
User.roles.cache.has(
|
||||||
|
getRole(supportbot.TicketBlackListRole, interaction.guild).id
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
return interaction.reply({
|
||||||
|
content: supportbot.TicketBlackListMessage,
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ticket ID
|
||||||
|
let ticketNumberID = await TicketNumberID.pad();
|
||||||
|
|
||||||
|
// Ticket Subject
|
||||||
|
const TicketSubject =
|
||||||
|
interaction.options?.getString("reason") || supportbot.NoTicketSubject;
|
||||||
|
|
||||||
|
const TicketExists = new MessageEmbed()
|
||||||
|
.setTitle("Ticket Exists!")
|
||||||
|
.setDescription(`${supportbot.TicketExists}`)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
|
||||||
|
if (
|
||||||
|
await interaction.guild.channels.cache.find((ticketChannel) => {
|
||||||
|
ticketChannel.name === `${supportbot.TicketPrefix}${ticketNumberID}`;
|
||||||
|
})
|
||||||
|
) {
|
||||||
|
return await interaction.reply({ embeds: [TicketExists] });
|
||||||
|
}
|
||||||
|
const Staff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
|
const Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
|
const DeptRole1 = await getRole(
|
||||||
|
supportbot.DepartmentRole_1,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
const DeptRole2 = await getRole(
|
||||||
|
supportbot.DepartmentRole_2,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
const DeptRole3 = await getRole(
|
||||||
|
supportbot.DepartmentRole_3,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
if (!Staff || !Admin || !DeptRole1 || !DeptRole2 || !DeptRole3)
|
||||||
|
return interaction.reply({
|
||||||
|
content:
|
||||||
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot.",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
const Author = interaction.user;
|
||||||
|
let TicketCategory = await getCategory(
|
||||||
|
supportbot.TicketCategory,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
const ticketChannel = await interaction.guild.channels.create(
|
||||||
|
`${supportbot.TicketPrefix}${ticketNumberID}`,
|
||||||
|
{
|
||||||
|
type: "GUILD_TEXT",
|
||||||
|
parent: TicketCategory.id,
|
||||||
|
permissionOverwrites: [
|
||||||
|
{
|
||||||
|
id: Admin.id,
|
||||||
|
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: Author.id,
|
||||||
|
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: interaction.guild.id,
|
||||||
|
deny: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (supportbot.AllowStaff) {
|
||||||
|
ticketChannel.permissionOverwrites.edit(Staff.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (supportbot.TicketDepartments) {
|
||||||
|
ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
||||||
|
SEND_MESSAGES: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
await TicketData.tickets.push({
|
||||||
|
id: ticketChannel.id,
|
||||||
|
name: ticketChannel.name,
|
||||||
|
user: Author.id,
|
||||||
|
number: ticketNumberID,
|
||||||
|
reason: TicketSubject,
|
||||||
|
open: true,
|
||||||
|
subUsers: [],
|
||||||
|
});
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/TicketData.json",
|
||||||
|
JSON.stringify(TicketData, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
const CreatedTicket = new MessageEmbed()
|
||||||
|
.setDescription(
|
||||||
|
supportbot.TicketCreatedAlert.replace(
|
||||||
|
/%ticketauthor%/g,
|
||||||
|
interaction.user.id
|
||||||
|
)
|
||||||
|
.replace(/%ticketid%/g, ticketChannel.id)
|
||||||
|
.replace(/%ticketusername%/g, interaction.user.username)
|
||||||
|
)
|
||||||
|
.setColor(supportbot.EmbedColour);
|
||||||
|
await interaction.reply({ embeds: [CreatedTicket], ephemeral: true });
|
||||||
|
|
||||||
|
if (supportbot.AllowTicketMentions) {
|
||||||
|
await ticketChannel.send(`${interaction.user}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
const TicketMessage = new MessageEmbed()
|
||||||
|
.setTitle(
|
||||||
|
supportbot.Ticket_Title.replace(/%ticketauthor%/g, interaction.user.id)
|
||||||
|
.replace(/%ticketid%/g, ticketChannel.id)
|
||||||
|
.replace(/%ticketusername%/g, interaction.user.username)
|
||||||
|
)
|
||||||
|
.setDescription(
|
||||||
|
supportbot.TicketMessage.replace(/%ticketauthor%/g, interaction.user.id)
|
||||||
|
.replace(/%ticketid%/g, ticketChannel.id)
|
||||||
|
.replace(/%ticketusername%/g, interaction.user.username)
|
||||||
|
)
|
||||||
|
.setColor(supportbot.EmbedColour);
|
||||||
|
|
||||||
|
if (supportbot.TicketSubject === "embed") {
|
||||||
|
if (TicketSubject != "No Reason Provided.") {
|
||||||
|
TicketMessage.addFields({ name: "Reason", value: TicketSubject });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.TicketSubject === "description") {
|
||||||
|
if (TicketSubject != "No Reason Provided.") {
|
||||||
|
await ticketChannel.setTopic(
|
||||||
|
`Reason: ${TicketSubject} - User ID: ${interaction.user.id} - Ticket: ${ticketChannel.name}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.TicketDepartments) {
|
||||||
|
TicketMessage.addFields({
|
||||||
|
name: "Departments",
|
||||||
|
value: ` **${supportbot.DepartmentTitle_1}**\n **${supportbot.DepartmentTitle_2}**\n **${supportbot.DepartmentTitle_3}**`,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
const CloseButton = new MessageButton()
|
||||||
|
.setCustomId("ticketclose")
|
||||||
|
.setLabel("Close")
|
||||||
|
.setStyle(supportbot.TicketCloseColour)
|
||||||
|
.setEmoji(supportbot.TicketCloseEmoji);
|
||||||
|
|
||||||
|
const LockButton = new MessageButton()
|
||||||
|
.setCustomId("ticketlock")
|
||||||
|
.setLabel("Lock")
|
||||||
|
.setStyle(supportbot.TicketLockColour)
|
||||||
|
.setEmoji(supportbot.TicketLockEmoji);
|
||||||
|
|
||||||
|
const row2 = new MessageActionRow().addComponents(CloseButton, LockButton);
|
||||||
|
|
||||||
|
if (supportbot.TicketDepartments) {
|
||||||
|
try {
|
||||||
|
const Department1Button = new MessageButton()
|
||||||
|
.setCustomId("Department1")
|
||||||
|
.setLabel(supportbot.DepartmentTitle_1)
|
||||||
|
.setStyle(supportbot.TicketDept1Colour)
|
||||||
|
.setEmoji(supportbot.TicketDept1Emoji);
|
||||||
|
|
||||||
|
const Department2Button = new MessageButton()
|
||||||
|
.setCustomId("Department2")
|
||||||
|
.setLabel(supportbot.DepartmentTitle_2)
|
||||||
|
.setStyle(supportbot.TicketDept2Colour)
|
||||||
|
.setEmoji(supportbot.TicketDept2Emoji);
|
||||||
|
|
||||||
|
const Department3Button = new MessageButton()
|
||||||
|
.setCustomId("Department3")
|
||||||
|
.setLabel(supportbot.DepartmentTitle_3)
|
||||||
|
.setStyle(supportbot.TicketDept3Colour)
|
||||||
|
.setEmoji(supportbot.TicketDept3Emoji);
|
||||||
|
|
||||||
|
const row = new MessageActionRow().addComponents(
|
||||||
|
Department1Button,
|
||||||
|
Department2Button,
|
||||||
|
Department3Button
|
||||||
|
);
|
||||||
|
|
||||||
|
const m = await ticketChannel.send({
|
||||||
|
embeds: [TicketMessage],
|
||||||
|
components: [row],
|
||||||
|
});
|
||||||
|
|
||||||
|
let collector;
|
||||||
|
try {
|
||||||
|
const filter = (i) => i.user.id === interaction.user.id;
|
||||||
|
collector = await m.awaitMessageComponent({
|
||||||
|
filter,
|
||||||
|
max: 1,
|
||||||
|
componentType: "BUTTON",
|
||||||
|
time: supportbot.Timeout * 60000,
|
||||||
|
});
|
||||||
|
} catch (e) {
|
||||||
|
if (e.code == "INTERACTION_COLLECTOR_ERROR") {
|
||||||
|
try {
|
||||||
|
TicketData = await JSON.parse(
|
||||||
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
|
);
|
||||||
|
let ticket = await TicketData.tickets.findIndex(
|
||||||
|
(t) => t.id == ticketChannel.id
|
||||||
|
);
|
||||||
|
TicketData.tickets[ticket].open = false;
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/TicketData.json",
|
||||||
|
JSON.stringify(TicketData, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
interaction.user.send(
|
||||||
|
"Your ticket has timed out. Please open a new one, and select a department."
|
||||||
|
);
|
||||||
|
} catch (e) {}
|
||||||
|
return await ticketChannel.delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let role;
|
||||||
|
let title;
|
||||||
|
if (collector.customId === "Department1") {
|
||||||
|
role = DeptRole1;
|
||||||
|
title = supportbot.DepartmentTitle_1;
|
||||||
|
}
|
||||||
|
if (collector.customId === "Department2") {
|
||||||
|
role = DeptRole2;
|
||||||
|
title = supportbot.DepartmentTitle_2;
|
||||||
|
}
|
||||||
|
if (collector.customId === "Department3") {
|
||||||
|
role = DeptRole3;
|
||||||
|
title = supportbot.DepartmentTitle_3;
|
||||||
|
}
|
||||||
|
|
||||||
|
ticketChannel.permissionOverwrites.edit(role.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
});
|
||||||
|
ticketChannel.permissionOverwrites.edit(Author.id, {
|
||||||
|
SEND_MESSAGES: true,
|
||||||
|
});
|
||||||
|
|
||||||
|
await collector.reply({
|
||||||
|
embeds: [
|
||||||
|
{
|
||||||
|
description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`,
|
||||||
|
color: supportbot.EmbedColour,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
|
||||||
|
if (supportbot.AllowTicketMentions) {
|
||||||
|
await ticketChannel.send("@here");
|
||||||
|
}
|
||||||
|
await collector.message.edit({
|
||||||
|
embeds: [TicketMessage],
|
||||||
|
components: [row2],
|
||||||
|
});
|
||||||
|
} catch (error) {}
|
||||||
|
} else {
|
||||||
|
await ticketChannel.send({ embeds: [TicketMessage], components: [row2] });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
});
|
||||||
@@ -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"
|
||||||
|
SuggestCommand: "suggest"
|
||||||
|
|
||||||
|
# ---------------------------------------
|
||||||
|
# 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."
|
||||||
|
SuggestCommandDesc: "Suggest a feature for the server."
|
||||||
@@ -0,0 +1,196 @@
|
|||||||
|
# ___ _ ___ _
|
||||||
|
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||||
|
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||||
|
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||||
|
# |_| |_|
|
||||||
|
#
|
||||||
|
# SupportBot created by Emerald Services
|
||||||
|
# Installed with MIT License
|
||||||
|
#
|
||||||
|
# Discord Support: https://emeraldsrv.dev/discord
|
||||||
|
# Community Resources: https://emeraldsrv.dev/resources
|
||||||
|
|
||||||
|
SupportBot_Version: "7.4.2"
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# General Configuration
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Name: "SupportBot"
|
||||||
|
Token: "BOT_TOKEN"
|
||||||
|
# Guild ID Ex: 123456789123456789
|
||||||
|
Guild: ""
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# 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
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
SendHelpPage: "channel" # Set to channel or dm
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Role Configuration
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
AutoRole: true
|
||||||
|
AutoRole_Role: "Member"
|
||||||
|
|
||||||
|
Staff: "Staff"
|
||||||
|
Admin: "Admin"
|
||||||
|
TicketBlackListRole: "Blacklisted"
|
||||||
|
|
||||||
|
# ----------------------------
|
||||||
|
# Suggestions Configuration
|
||||||
|
# ----------------------------
|
||||||
|
|
||||||
|
SuggestionChannel: "suggestions"
|
||||||
|
SuggestionUpvote: "✅"
|
||||||
|
SuggestionDownvote: "❌"
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Tickets Configuration
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
TicketCategory: "Tickets"
|
||||||
|
TicketPrefix: "ticket-" # The prefix for ticket channel names
|
||||||
|
|
||||||
|
TicketLog: "logs"
|
||||||
|
TranscriptLog: "transcripts"
|
||||||
|
|
||||||
|
TranscriptTitle: "Ticket Transcript"
|
||||||
|
TicketLog_Title: "Ticket Closed"
|
||||||
|
TicketBlackListMessage: "You are not allowed to open a ticket"
|
||||||
|
|
||||||
|
MaxAllowedTickets: 2
|
||||||
|
|
||||||
|
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 - Blue
|
||||||
|
# SECONDARY - Grey
|
||||||
|
# DANGER - Red
|
||||||
|
# SUCCESS - Green
|
||||||
|
|
||||||
|
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.
|
||||||
|
|
||||||
|
# --- Departments Config ---
|
||||||
|
# --- Start ---
|
||||||
|
|
||||||
|
TicketDepartments: true
|
||||||
|
# Delete the ticket if no department selected. TIME IN MINUTES
|
||||||
|
Timeout: 5
|
||||||
|
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"
|
||||||
|
DepartmentRole_2: "Support"
|
||||||
|
DepartmentRole_3: "Admin"
|
||||||
|
# Ticket roles are the roles that will be able to gain access to tickets depending on what department has been chosen.
|
||||||
|
|
||||||
|
# --- Closing Config ---
|
||||||
|
# --- Start ---
|
||||||
|
|
||||||
|
StaffOnly: true
|
||||||
|
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,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 - Purple
|
||||||
|
# -> 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"
|
||||||
BIN
Binary file not shown.
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"tickets": []
|
||||||
|
}
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"id": 0,
|
||||||
|
"TicketPanelID": ""
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
module.exports = new Event("guildCreate", async (client) => {
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`${client.user.username} is not in the correct server set in your config. Please leave all other servers and restart the bot.`
|
||||||
|
);
|
||||||
|
console.log(`\u001b[31m`, `${client.user.username} will now exit.`);
|
||||||
|
return process.exit(1);
|
||||||
|
});
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
|
||||||
|
module.exports = new Event("guildDelete", async (client) => {
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`${client.user.username} is not in the correct server set in your config. Please join the server and restart the bot.`
|
||||||
|
);
|
||||||
|
console.log(`\u001b[31m`, `${client.user.username} will now exit.`);
|
||||||
|
return process.exit(1);
|
||||||
|
});
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Interaction Create Event
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
|
||||||
|
module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||||
|
if (interaction.isCommand()) {
|
||||||
|
const command = client.commands.find(
|
||||||
|
(cmd) => cmd.name.toLowerCase() == interaction.commandName
|
||||||
|
);
|
||||||
|
|
||||||
|
if (interaction.user.bot || !interaction.guild) return;
|
||||||
|
|
||||||
|
const NotValid = new Discord.MessageEmbed()
|
||||||
|
.setDescription(`:x: \`Invalid Command\` `)
|
||||||
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
|
if (!command)
|
||||||
|
return interaction.reply({
|
||||||
|
embeds: [NotValid],
|
||||||
|
});
|
||||||
|
|
||||||
|
const permission = interaction.member.permissions.has(command.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") {
|
||||||
|
try {
|
||||||
|
const cmd = client.commands.get(cmdconfig.CloseTicket);
|
||||||
|
if (!cmd) return;
|
||||||
|
cmd.run(interaction);
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (interaction.customId === "ticketlock") {
|
||||||
|
if (interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
|
||||||
|
interaction.message.fetch();
|
||||||
|
let Admin =
|
||||||
|
interaction.guild.roles.cache.find(
|
||||||
|
(AdminUser) => AdminUser.name === supportbot.Admin
|
||||||
|
) ||
|
||||||
|
interaction.guild.roles.cache.find(
|
||||||
|
(AdminUser) => AdminUser.id === supportbot.Admin
|
||||||
|
);
|
||||||
|
if (!interaction.member.roles.cache.has(Admin.id)) {
|
||||||
|
return await interaction.reply({
|
||||||
|
content: "You don't have permission to do that.",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
let all = interaction.channel.permissionOverwrites.cache;
|
||||||
|
|
||||||
|
let parent =
|
||||||
|
interaction.guild.channels.cache.find(
|
||||||
|
(c) => c.name === `${supportbot.LockTicketCategory}`
|
||||||
|
) ||
|
||||||
|
interaction.guild.channels.cache.find(
|
||||||
|
(c) => c.id === `${supportbot.LockTicketCategory}`
|
||||||
|
);
|
||||||
|
if (parent) {
|
||||||
|
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.reply({ embeds: [ArchiveEmbed] });
|
||||||
|
interaction.message.edit({ components: [row] });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
+210
@@ -0,0 +1,210 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Ready Event
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const panelconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/ticket-panel.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
|
||||||
|
module.exports = new Event("ready", async (client) => {
|
||||||
|
const { getRole, getChannel, getCategory } = client;
|
||||||
|
client.user.setActivity(supportbot.BotActivity, {
|
||||||
|
type: supportbot.ActivityType,
|
||||||
|
url: supportbot.StreamingURL,
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`\u001b[32m`, `┏━━━┓╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓┏━━┓╋╋╋┏┓`);
|
||||||
|
console.log(`\u001b[32m`, `┃┏━┓┃╋╋╋╋╋╋╋╋╋╋╋╋┏┛┗┫┏┓┃╋╋┏┛┗┓`);
|
||||||
|
console.log(`\u001b[32m`, `┃┗━━┳┓┏┳━━┳━━┳━━┳┻┓┏┫┗┛┗┳━┻┓┏┛`);
|
||||||
|
console.log(`\u001b[32m`, `┗━━┓┃┃┃┃┏┓┃┏┓┃┏┓┃┏┫┃┃┏━┓┃┏┓┃┃`);
|
||||||
|
console.log(`\u001b[32m`, `┃┗━┛┃┗┛┃┗┛┃┗┛┃┗┛┃┃┃┗┫┗━┛┃┗┛┃┗┓`);
|
||||||
|
console.log(`\u001b[32m`, `┗━━━┻━━┫┏━┫┏━┻━━┻┛┗━┻━━━┻━━┻━┛`);
|
||||||
|
console.log(`\u001b[32m`, `┗╋╋╋╋╋╋╋┃┃╋┃┃`);
|
||||||
|
console.log(`\u001b[32m`, `╋╋╋╋╋╋╋┗┛╋┗┛`);
|
||||||
|
console.log(` `);
|
||||||
|
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||||
|
console.log(` `);
|
||||||
|
console.log(
|
||||||
|
`\u001b[33m`,
|
||||||
|
`${supportbot.Name} v${supportbot.SupportBot_Version}`,
|
||||||
|
`\u001b[36m`,
|
||||||
|
`Connected to Discord`
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
`\u001b[33m`,
|
||||||
|
`Invite to your server:`,
|
||||||
|
`\u001b[36m`,
|
||||||
|
`https://discord.com/api/oauth2/authorize?client_id=` + client.user.id + `&permissions=8&scope=bot%20applications.commands`
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
`\u001b[33m`,
|
||||||
|
`Resources:`,
|
||||||
|
`\u001b[36m`,
|
||||||
|
`https://emeraldsrv.dev/resources`
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
`\u001b[33m`,
|
||||||
|
`Documentation:`,
|
||||||
|
`\u001b[36m`,
|
||||||
|
`https://emeraldsrv.dev/wiki/supportbot`
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
`\u001b[33m`,
|
||||||
|
`Discord:`,
|
||||||
|
`\u001b[36m`,
|
||||||
|
`https://emeraldsrv.dev/discord`
|
||||||
|
);
|
||||||
|
console.log(
|
||||||
|
`\u001b[33m`,
|
||||||
|
`Hosting:`,
|
||||||
|
`\u001b[36m`,
|
||||||
|
`https://emeraldsrv.dev/hosting`
|
||||||
|
);
|
||||||
|
console.log(` `);
|
||||||
|
console.log(`\u001b[37m`, `SupportBot proudly created by Emerald Services`);
|
||||||
|
console.log(` `);
|
||||||
|
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||||
|
if (
|
||||||
|
!supportbot.Guild ||
|
||||||
|
(await client.guilds.cache.size) !== 1 ||
|
||||||
|
(await client.guilds.cache.first().id) !== supportbot.Guild
|
||||||
|
) {
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`${client.user.username} is not in the correct server set in your config. Please join the server and restart the bot.`
|
||||||
|
);
|
||||||
|
console.log(`\u001b[31m`, `${client.user.username} will now exit.`);
|
||||||
|
return process.exit(1);
|
||||||
|
}
|
||||||
|
const roles = [
|
||||||
|
supportbot.Admin,
|
||||||
|
supportbot.Staff,
|
||||||
|
supportbot.TicketBlackListRole,
|
||||||
|
supportbot.DepartmentRole_1,
|
||||||
|
supportbot.DepartmentRole_2,
|
||||||
|
supportbot.DepartmentRole_3,
|
||||||
|
];
|
||||||
|
if (supportbot.AutoRole) roles.push(supportbot.AutoRole_Role);
|
||||||
|
const channels = [
|
||||||
|
supportbot.SuggestionChannel,
|
||||||
|
supportbot.TicketLog,
|
||||||
|
supportbot.TranscriptLog,
|
||||||
|
panelconfig.Channel,
|
||||||
|
];
|
||||||
|
const categories = [supportbot.TicketCategory];
|
||||||
|
|
||||||
|
const missingC = [];
|
||||||
|
const missingR = [];
|
||||||
|
const missingCat = [];
|
||||||
|
for (let c of channels) {
|
||||||
|
const find = await getChannel(c, client.guilds.cache.first());
|
||||||
|
if (!find) missingC.push(c);
|
||||||
|
}
|
||||||
|
for (let r of roles) {
|
||||||
|
const find = await getRole(r, client.guilds.cache.first());
|
||||||
|
if (!find) missingR.push(r);
|
||||||
|
}
|
||||||
|
for (let cat of categories) {
|
||||||
|
const find = await getCategory(cat, client.guilds.cache.first());
|
||||||
|
if (!find) missingCat.push(cat);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (missingR.length > 0) {
|
||||||
|
console.log(
|
||||||
|
"\u001b[33m",
|
||||||
|
`[WARN] The following Roles could not be found! Please check your configs!\n${missingR.join(
|
||||||
|
", "
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (missingC.length > 0) {
|
||||||
|
console.log(
|
||||||
|
"\u001b[33m",
|
||||||
|
`[WARN] The following Channels could not be found! Please check your configs!\n${missingC.join(
|
||||||
|
", "
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (missingCat.length > 0) {
|
||||||
|
console.log(
|
||||||
|
"\u001b[33m",
|
||||||
|
`[WARN] The following Categories could not be found! Please check your configs!\n${missingCat.join(
|
||||||
|
", "
|
||||||
|
)}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (panelconfig.TicketPanel) {
|
||||||
|
let chan1 = await client.getChannel(
|
||||||
|
panelconfig.Channel,
|
||||||
|
client.guilds.cache.first()
|
||||||
|
);
|
||||||
|
|
||||||
|
if (!chan1) {
|
||||||
|
console.log(
|
||||||
|
"\u001b[33m",
|
||||||
|
"[WARN] Ticket reaction panel is not setup, You can do so via the configuration file!"
|
||||||
|
);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
const panelid = JSON.parse(
|
||||||
|
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
chan1.messages.fetch(panelid.TicketPanelID).catch(async (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)
|
||||||
|
.setEmoji(panelconfig.ButtonEmoji);
|
||||||
|
|
||||||
|
let row = new Discord.MessageActionRow().addComponents(button);
|
||||||
|
|
||||||
|
await chan1
|
||||||
|
.send({
|
||||||
|
embeds: [embed],
|
||||||
|
components: [row],
|
||||||
|
})
|
||||||
|
.then((r) => {
|
||||||
|
let data = {
|
||||||
|
id: panelid.id,
|
||||||
|
TicketPanelID: `${r.id}`,
|
||||||
|
};
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/ticket-panel-id.json",
|
||||||
|
JSON.stringify(data),
|
||||||
|
"utf8"
|
||||||
|
);
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
console.log("Raw" + e);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
MIT License
|
|
||||||
|
|
||||||
Copyright (c) 2021 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
|
|
||||||
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,13 +1,13 @@
|
|||||||

|

|
||||||
|
|
||||||
## What is SupportBot?
|
## What is SupportBot?
|
||||||
|
|
||||||
SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customisation to match your own brand.
|
SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customization to match your own brand.
|
||||||
|
|
||||||
## Quick Links
|
## Quick Links
|
||||||
|
|
||||||
**|** [Discord](https://emeraldsrv.dev/discord) **|**
|
**|** [Discord](https://emeraldsrv.dev/discord) **|**
|
||||||
[Hosting](https://emeraldsrv.dev/hosting) **|**
|
[Hosting](https://emeraldsrv.dev/hosting) **|**
|
||||||
[Documentation](https://docs.emeraldsrv.dev) **|**
|
[Documentation](https://emeraldsrv.dev/wiki/supportbot) **|**
|
||||||
[Download via Polymart](https://polymart.org/resource/supportbot-1-discord-ticket-bot.518) **|**
|
[Download via Polymart](https://polymart.org/resource/supportbot-1-discord-ticket-bot.518) **|**
|
||||||
[Download via MC-Market](https://www.mc-market.org/resources/8940/) **|**
|
[Download via MC-Market](https://www.mc-market.org/resources/8940/) **|**
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Addon Structure
|
||||||
|
|
||||||
|
class Command {
|
||||||
|
constructor(options) {
|
||||||
|
this.name = options.name;
|
||||||
|
this.description = options.description;
|
||||||
|
this.permissions = options.permissions;
|
||||||
|
this.options = options.options || [];
|
||||||
|
this.run = options.run;
|
||||||
|
this.defaultPermission = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
class Event {
|
||||||
|
constructor(event, run) {
|
||||||
|
this.event = event;
|
||||||
|
this.run = run;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = { Command, Event };
|
||||||
@@ -0,0 +1,122 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Client Structure
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const intents = new Discord.Intents(32767);
|
||||||
|
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
class Client extends Discord.Client {
|
||||||
|
constructor() {
|
||||||
|
super({ intents });
|
||||||
|
|
||||||
|
this.commands = new Discord.Collection();
|
||||||
|
}
|
||||||
|
async getChannel(channel, guild) {
|
||||||
|
return guild.channels.cache.find(
|
||||||
|
(c) =>
|
||||||
|
(c.type === "GUILD_TEXT" || c.type === "GUILD_NEWS") &&
|
||||||
|
(c.id === channel || c.name.toLowerCase() === channel.toLowerCase())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
async getRole(role, guild) {
|
||||||
|
return guild.roles.cache.find(
|
||||||
|
(r) => r.id === role || r.name.toLowerCase() === role.toLowerCase()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
async getCategory(category, guild) {
|
||||||
|
return guild.channels.cache.find(
|
||||||
|
(c) =>
|
||||||
|
c.type === "GUILD_CATEGORY" &&
|
||||||
|
(c.id === category || c.name.toLowerCase() === category.toLowerCase())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
async start(token) {
|
||||||
|
const commandFiles = fs
|
||||||
|
.readdirSync("./Commands")
|
||||||
|
.filter((file) => file.endsWith(".js"));
|
||||||
|
|
||||||
|
const addonFiles = fs
|
||||||
|
.readdirSync("./Addons")
|
||||||
|
.filter((file) => file.endsWith(".js"));
|
||||||
|
|
||||||
|
const addons = addonFiles.map((file) => {
|
||||||
|
let addon = require(`../Addons/${file}`);
|
||||||
|
addon.name = file.split(".")[0];
|
||||||
|
return addon;
|
||||||
|
});
|
||||||
|
|
||||||
|
const commands = commandFiles.map((file) => require(`../Commands/${file}`));
|
||||||
|
|
||||||
|
// Commands
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
|
commands.forEach((cmd) => {
|
||||||
|
console.log(`\u001b[31;1m`, `${cmd.name}`, `\u001b[32;1m`, "Loaded");
|
||||||
|
this.commands.set(cmd.name, cmd);
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
||||||
|
// Addons
|
||||||
|
console.log(" ");
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
|
addons.forEach((addon) => {
|
||||||
|
console.log(
|
||||||
|
`\u001b[33m`,
|
||||||
|
`[ADDON]`,
|
||||||
|
`\u001b[31;1m`,
|
||||||
|
`${addon.name}`,
|
||||||
|
`\u001b[32;1m`,
|
||||||
|
"Loaded"
|
||||||
|
);
|
||||||
|
addon.commands.forEach((command) => {
|
||||||
|
this.commands.set(command.name, command);
|
||||||
|
});
|
||||||
|
addon.events.forEach((event) => {
|
||||||
|
this.on(event.event, (...args) => event.run(this, ...args));
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
|
// Slash Commands
|
||||||
|
|
||||||
|
this.once("ready", async () => {
|
||||||
|
await this.application?.commands.set(this.commands, supportbot.Guild);
|
||||||
|
console.log(
|
||||||
|
`\u001b[32;1m`,
|
||||||
|
`Slash Commands Registered for ${this.guilds.cache.first().name}`
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(" ");
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
|
fs.readdirSync("./Events")
|
||||||
|
.filter((file) => file.endsWith(".js"))
|
||||||
|
.forEach((file) => {
|
||||||
|
const event = require(`../Events/${file}`);
|
||||||
|
console.log(`\u001b[31;1m`, `${event.event}`, `\u001b[32;1m`, "Loaded");
|
||||||
|
this.on(event.event, (...args) => event.run(this, ...args));
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
|
||||||
|
if (process.argv[2] !== "test") {
|
||||||
|
await this.login(token);
|
||||||
|
} else {
|
||||||
|
console.log(
|
||||||
|
`\u001b[31;1m`,
|
||||||
|
"RUNNING IN TEST MODE, IF NOT INTENDED, PLEASE USE npm start"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Client;
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Command Structure
|
||||||
|
|
||||||
|
class Command {
|
||||||
|
constructor(options) {
|
||||||
|
this.name = options.name;
|
||||||
|
this.description = options.description;
|
||||||
|
this.permissions = options.permissions;
|
||||||
|
this.options = options.options || [];
|
||||||
|
this.run = options.run;
|
||||||
|
this.defaultPermission = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
module.exports = Command;
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Event Structure
|
||||||
|
class Event {
|
||||||
|
constructor(event, run) {
|
||||||
|
this.event = event;
|
||||||
|
this.run = run;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = Event;
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Ticket ID Structure
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
class TicketNumberID {
|
||||||
|
static async pad() {
|
||||||
|
let num = await this.get();
|
||||||
|
let n = num + "";
|
||||||
|
await this.set(num + 1);
|
||||||
|
return n.length >= 4 ? n : new Array(4 - n.length + 1).join("0") + n;
|
||||||
|
}
|
||||||
|
|
||||||
|
static async get() {
|
||||||
|
let ticketnumberID = await JSON.parse(
|
||||||
|
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
||||||
|
);
|
||||||
|
if (!ticketnumberID.id) {
|
||||||
|
return this.set(0);
|
||||||
|
} else {
|
||||||
|
return ticketnumberID.id;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static async set(value) {
|
||||||
|
let ticketnumberID = await JSON.parse(
|
||||||
|
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
ticketnumberID.id = value;
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/ticket-panel-id.json",
|
||||||
|
JSON.stringify(ticketnumberID, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
static async reset() {
|
||||||
|
return await this.set(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
module.exports = TicketNumberID;
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Help Command
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
|
|
||||||
// location for the addons configuration, to keep it simple we generate a settings folder within the addons directory.
|
|
||||||
const example = yaml.load(fs.readFileSync('./addons/settings/exampleaddon.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: example.ExampleAddonCommand,
|
|
||||||
description: example.ExampleAddonDesc,
|
|
||||||
|
|
||||||
execute(message, args) {
|
|
||||||
if (supportbot.DeleteMessages == "true") message.delete();
|
|
||||||
message.channel.send(example.ExampleAddonMessage)
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#
|
|
||||||
# SupportBot, Created by Emerald Services
|
|
||||||
# Example Addon
|
|
||||||
#
|
|
||||||
|
|
||||||
ExampleAddonCommand: "exampleaddon"
|
|
||||||
ExampleAddonDesc: "This is the default/example addon for SupportBot."
|
|
||||||
|
|
||||||
ExampleAddonMessage: "> :white_check_mark: This is the **default** addon for SupportBot. You can download addons from our website, https://emeraldservices.xyz/"
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Add User
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.AddUser,
|
|
||||||
description: supportbot.AddUserDesc,
|
|
||||||
|
|
||||||
execute(message, args) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
let SupportStaff = message.guild.roles.cache.find(SupportTeam => SupportTeam.name === supportbot.Staff) || message.guild.roles.cache.find(SupportTeam => SupportTeam.id === supportbot.Staff)
|
|
||||||
let Admins = message.guild.roles.cache.find(AdminUser => AdminUser.name === supportbot.Admin) || message.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 (message.member.roles.cache.has(SupportStaff.id) || message.member.roles.cache.has(Admins.id)) {
|
|
||||||
if (!message.channel.name.startsWith( `${supportbot.TicketChannel}-` )) {
|
|
||||||
const Exists = new Discord.MessageEmbed()
|
|
||||||
.setTitle("No Ticket Found!")
|
|
||||||
.setDescription(`${supportbot.NoValidTicket}`)
|
|
||||||
.setColor(supportbot.WarningColour);
|
|
||||||
message.channel.send({ embed: Exists });
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[0]));
|
|
||||||
const UserNotExist = new Discord.MessageEmbed()
|
|
||||||
.setTitle("User Not Found!")
|
|
||||||
.setDescription(`${supportbot.UserNotFound}\n\nTry Again:\`${supportbot.Prefix}${supportbot.AddUser} <user#0000>\``)
|
|
||||||
.setColor(supportbot.ErrorColour)
|
|
||||||
|
|
||||||
if (!rUser) return message.channel.send({ embed: UserNotExist });
|
|
||||||
|
|
||||||
message.channel.updateOverwrite(rUser, {
|
|
||||||
VIEW_CHANNEL: true,
|
|
||||||
CREATE_INVITE: false,
|
|
||||||
SEND_MESSAGES: true,
|
|
||||||
READ_MESSAGES: true
|
|
||||||
});
|
|
||||||
|
|
||||||
const Complete = new Discord.MessageEmbed()
|
|
||||||
.setTitle("User Added!")
|
|
||||||
.setDescription(supportbot.AddedUser.replace(/%user%/g, rUser.id))
|
|
||||||
.setTimestamp()
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
message.channel.send({ embed: Complete });
|
|
||||||
} else {
|
|
||||||
|
|
||||||
return message.channel.send({ embed: NoPerms });
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,71 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Announce
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const { execute } = require("./help");
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.AnnounceCommand,
|
|
||||||
description: supportbot.AnnounceDesc,
|
|
||||||
|
|
||||||
execute(message, args) {
|
|
||||||
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
let locateChannel = message.guild.channels.cache.find(AnnouncementChannel => AnnouncementChannel.name === supportbot.AnnouncementChannel) || message.guild.channels.cache.find(AnnouncementChannel => AnnouncementChannel.id === supportbot.AnnouncementChannel)
|
|
||||||
|
|
||||||
const errornochannel = new Discord.MessageEmbed()
|
|
||||||
.setTitle("Invalid Channel")
|
|
||||||
.setDescription(`${supportbot.InvalidChannel}\n\nChannel Required: \`${supportbot.AnnouncementChannel}`)
|
|
||||||
.setColor(supportbot.ErrorColour);
|
|
||||||
|
|
||||||
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
|
||||||
|
|
||||||
let Admins = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Admin) || message.guild.roles.cache.find(adminRole => adminRole.id === supportbot.Admin)
|
|
||||||
|
|
||||||
const NoPerms = new Discord.MessageEmbed()
|
|
||||||
.setTitle("Invalid Permissions!")
|
|
||||||
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${Admins.name}\``)
|
|
||||||
.setColor(supportbot.WarningColour)
|
|
||||||
|
|
||||||
if (!message.member.roles.cache.has(Admins.id))
|
|
||||||
return message.channel.send({ embed: NoPerms });
|
|
||||||
|
|
||||||
|
|
||||||
const embed = new Discord.MessageEmbed()
|
|
||||||
.setDescription(`> **${supportbot.AnnouncementStarter}**`)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
message.channel.send({ embed: embed });
|
|
||||||
|
|
||||||
let announcement = []
|
|
||||||
message.channel.awaitMessages(response => response.content.length > 2, {
|
|
||||||
max: 1,
|
|
||||||
time: 500000,
|
|
||||||
errors: ['time'],
|
|
||||||
}).then((collected) => {
|
|
||||||
announcement.push(collected.map(r => r.content));
|
|
||||||
|
|
||||||
locateChannel.send('@everyone')
|
|
||||||
const AnnouncementEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.AnnouncementTitle)
|
|
||||||
.setThumbnail(supportbot.AnnouncementIcon)
|
|
||||||
.setDescription(announcement)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL());
|
|
||||||
|
|
||||||
locateChannel.send({ embed: AnnouncementEmbed }).then(async function(msg) {
|
|
||||||
const AnnouncementComplete = new Discord.MessageEmbed()
|
|
||||||
.setColor(supportbot.SuccessColour)
|
|
||||||
.setDescription(`:white_check_mark: You have successfully created an announcement. <#${locateChannel.id}>`)
|
|
||||||
message.channel.send({ embed: AnnouncementComplete })
|
|
||||||
})
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
-108
@@ -1,108 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Say Command
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const { execute } = require("./help");
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.BanUser,
|
|
||||||
description: supportbot.BanDesc,
|
|
||||||
|
|
||||||
execute(message, args, member) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
let SupportStaff = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Admin) || message.guild.roles.cache.find(adminRole => adminRole.id === supportbot.Admin)
|
|
||||||
|
|
||||||
const NoPerms = new Discord.MessageEmbed()
|
|
||||||
.setTitle("Invalid Permissions!")
|
|
||||||
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${SupportStaff.name}\``)
|
|
||||||
.setColor(supportbot.WarningColour)
|
|
||||||
|
|
||||||
if (!message.member.roles.cache.has(SupportStaff.id))
|
|
||||||
return message.channel.send({ embed: NoPerms });
|
|
||||||
|
|
||||||
let locateChannel = message.guild.channels.cache.find(ModLogChannel => ModLogChannel.name === supportbot.ModLogChannel) || message.guild.channels.cache.find(ModLogChannel => ModLogChannel.id === supportbot.ModLogChannel)
|
|
||||||
|
|
||||||
const errornochannel = new Discord.MessageEmbed()
|
|
||||||
.setTitle("Invalid Channel")
|
|
||||||
.setDescription(`${supportbot.InvalidChannel}\n\nChannel Required: \`${supportbot.ModLogChannel}\``)
|
|
||||||
.setColor(supportbot.ErrorColour);
|
|
||||||
|
|
||||||
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
|
||||||
|
|
||||||
const user = message.mentions.members.first() || message.guild.members.cache.get(args[0]);
|
|
||||||
|
|
||||||
const embed1 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :x: Please provide a reason to ban.\n\n`Try Again!`")
|
|
||||||
.setColor(supportbot.ErrorColour)
|
|
||||||
|
|
||||||
if (!args[0]) return message.channel.send({
|
|
||||||
embed: embed1
|
|
||||||
});
|
|
||||||
|
|
||||||
const embed2 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :detective: **Hmm!** Can\'t seem tp find this user.\n\n`Are they in the server?`")
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
if (!user) return message.channel.send({
|
|
||||||
embed: embed2
|
|
||||||
})
|
|
||||||
|
|
||||||
const embed3 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :x: **Err No!** Cannot punish this user!\n\n`Reason: Their permissions and or roles are greater than mine.`")
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
if(!user.bannable) return message.channel.send({
|
|
||||||
embed: embed3
|
|
||||||
});
|
|
||||||
|
|
||||||
const embed4 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :joy: **OML!** Did you really just try to ban yourself!")
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
if(user.id === message.author.id) return message.channel.send({
|
|
||||||
embed: embed4
|
|
||||||
});
|
|
||||||
|
|
||||||
let reason = args.slice(1).join(" ");
|
|
||||||
|
|
||||||
if(!reason) reason = 'No Reason Provided.';
|
|
||||||
|
|
||||||
const embed5 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :thinking: **Hmm** Something seems to have gone wrong.\n\n`Check your system for errors!`")
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
user.ban({ days: supportbot.DaysBannedFor, reason: `${reason}` }).catch(err => {
|
|
||||||
message.channel.send({ embed: embed5 })
|
|
||||||
console.log(err)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
const successEmbed = new Discord.MessageEmbed()
|
|
||||||
.setDescription(`> :white_check_mark: **OOF!** ${user} has been banned!`)
|
|
||||||
.setColor(supportbot.SuccessColour)
|
|
||||||
message.channel.send({
|
|
||||||
embed: successEmbed
|
|
||||||
})
|
|
||||||
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.BanTitle)
|
|
||||||
.setThumbnail(supportbot.ModThumbnail)
|
|
||||||
.addField('Banned User:', user)
|
|
||||||
.addField('Staff Member', message.author)
|
|
||||||
.addField('Reason:', reason)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.setColor(supportbot.BanLogColour)
|
|
||||||
.setTimestamp()
|
|
||||||
|
|
||||||
locateChannel.send({ embed: logEmbed })
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Blacklist Command
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const { execute } = require("./help");
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.BlacklistUser,
|
|
||||||
description: supportbot.BlacklistDesc,
|
|
||||||
|
|
||||||
execute(message, args) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
let SupportStaff = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Admin) || message.guild.roles.cache.find(adminRole => adminRole.id === supportbot.Admin)
|
|
||||||
|
|
||||||
const NoPerms = new Discord.MessageEmbed()
|
|
||||||
.setTitle("Invalid Permissions!")
|
|
||||||
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${SupportStaff.name}\``)
|
|
||||||
.setColor(supportbot.WarningColour)
|
|
||||||
|
|
||||||
if (!message.member.roles.cache.has(SupportStaff.id)) {
|
|
||||||
return message.channel.send({ embed: NoPerms });
|
|
||||||
}
|
|
||||||
|
|
||||||
let locateChannel = message.guild.channels.cache.find(ModLogChannel => ModLogChannel.name === supportbot.ModLogChannel) || message.guild.channels.cache.find(ModLogChannel => ModLogChannel.id === supportbot.ModLogChannel)
|
|
||||||
|
|
||||||
const user = message.mentions.members.first() || message.guild.members.cache.get(args[0]);
|
|
||||||
|
|
||||||
const errornochannel = new Discord.MessageEmbed()
|
|
||||||
.setTitle("Invalid Channel")
|
|
||||||
.setDescription(`${supportbot.InvalidChannel}\n\nChannel Required: \`${supportbot.ModLogChannel}\``)
|
|
||||||
.setColor(supportbot.ErrorColour);
|
|
||||||
|
|
||||||
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
|
||||||
|
|
||||||
const embed1 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :x: Please mention or write an ID\n\n`Try Again!`")
|
|
||||||
.setColor(supportbot.ErrorColour)
|
|
||||||
|
|
||||||
if (!args[0]) return message.channel.send({
|
|
||||||
embed: embed1
|
|
||||||
});
|
|
||||||
|
|
||||||
const embed2 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :detective: **Hmm!** Can\'t seem tp find this user.\n\n`Are they in the server?`")
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
if (!user) return message.channel.send({
|
|
||||||
embed: embed2
|
|
||||||
});
|
|
||||||
|
|
||||||
let role = message.guild.roles.cache.find(role => role.name === supportbot.TicketBlackListRole) || message.guild.roles.cache.find(role => role.id === supportbot.TicketBlackListRole)
|
|
||||||
|
|
||||||
const embed3 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :detective: **Hmm!** Can\'t seem to find the blacklist role.\n\n`Did you created it?")
|
|
||||||
.setColor(supportbot.ErrorColour)
|
|
||||||
|
|
||||||
|
|
||||||
if (!role) return message.channel.send({
|
|
||||||
embed: embed3
|
|
||||||
});
|
|
||||||
|
|
||||||
const embed4 = new Discord.MessageEmbed()
|
|
||||||
.setDescription(`${user} is already blacklisted`)
|
|
||||||
.setColor(supportbot.ErrorColour)
|
|
||||||
|
|
||||||
if(user.roles.cache.find(role => role.name === supportbot.TicketBlackListRole) || user.roles.cache.find(role => role.id === supportbot.TicketBlackListRole)) {
|
|
||||||
return message.channel.send({
|
|
||||||
embed: embed4
|
|
||||||
})
|
|
||||||
};
|
|
||||||
|
|
||||||
user.roles.add(role);
|
|
||||||
|
|
||||||
const embed5 = new Discord.MessageEmbed()
|
|
||||||
.setDescription(`Blacklisted ${user} successfully from creating a ticket`)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
message.channel.send({
|
|
||||||
embed: embed5
|
|
||||||
});
|
|
||||||
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.BlacklistTitle)
|
|
||||||
.setThumbnail(supportbot.ModThumbnail)
|
|
||||||
.addField('Banned User:', user)
|
|
||||||
.addField('Staff Member', message.author)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.setColor(supportbot.BlacklistColour)
|
|
||||||
.setTimestamp()
|
|
||||||
|
|
||||||
locateChannel.send({ embed: logEmbed });
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,51 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Say Command
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const { execute } = require("./help");
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.BotSay,
|
|
||||||
description: supportbot.BotSayDesc,
|
|
||||||
|
|
||||||
execute(message, args) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
let SupportStaff = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Staff) || message.guild.roles.cache.find(adminRole => adminRole.id === supportbot.Staff)
|
|
||||||
|
|
||||||
const NoPerms = new Discord.MessageEmbed()
|
|
||||||
.setTitle("Invalid Permissions!")
|
|
||||||
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${SupportStaff.name}\``)
|
|
||||||
.setColor(supportbot.WarningColour)
|
|
||||||
|
|
||||||
if (!message.member.roles.cache.has(SupportStaff.id))
|
|
||||||
return message.channel.send({ embed: NoPerms });
|
|
||||||
|
|
||||||
|
|
||||||
const embed = new Discord.MessageEmbed()
|
|
||||||
.setDescription(`> **What would you like me to say!**`)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
message.channel.send({ embed: embed });
|
|
||||||
|
|
||||||
let announcement = []
|
|
||||||
message.channel.awaitMessages(response => response.content.length > 2, {
|
|
||||||
max: 1,
|
|
||||||
time: 500000,
|
|
||||||
errors: ['time'],
|
|
||||||
}).then((collected) => {
|
|
||||||
announcement.push(collected.map(r => r.content));
|
|
||||||
|
|
||||||
const AnnouncementEmbed = new Discord.MessageEmbed()
|
|
||||||
.setDescription(announcement)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
message.channel.send({ embed: AnnouncementEmbed })
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,147 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Close Command
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const { execute } = require("./help");
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.CloseTicket,
|
|
||||||
description: supportbot.CloseTicketDesc,
|
|
||||||
|
|
||||||
execute(message, args) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
if (!message.channel.name.startsWith( `${supportbot.TicketChannel}-` )) {
|
|
||||||
const Exists = new Discord.MessageEmbed()
|
|
||||||
.setTitle("No Ticket Found!")
|
|
||||||
.setDescription(`${supportbot.NoValidTicket}`)
|
|
||||||
.setColor(supportbot.WarningColour);
|
|
||||||
message.channel.send({ embed: Exists });
|
|
||||||
|
|
||||||
return;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
|
||||||
|
|
||||||
message.channel.send(CloseTicketRequest).then(m => {
|
|
||||||
message.channel.awaitMessages( response => response.content.toLowerCase() === supportbot.ClosingConfirmation_Word, {
|
|
||||||
max: 1,
|
|
||||||
time: 20000,
|
|
||||||
errors: [ 'time' ],
|
|
||||||
|
|
||||||
|
|
||||||
}).then( collected => {
|
|
||||||
let logChannel = message.guild.channels.cache.find(channel => channel.name === supportbot.TranscriptLog) || message.guild.channels.cache.find(channel => channel.id === supportbot.TranscriptLog)
|
|
||||||
let user = message.author;
|
|
||||||
let reason = args.join(" ") || "No Reason Provided.";
|
|
||||||
|
|
||||||
let name = message.channel.name;
|
|
||||||
let ticketChannel = message.channel;
|
|
||||||
|
|
||||||
message.channel.send(`**${supportbot.ClosingTicket}**`)
|
|
||||||
|
|
||||||
.then(() => {
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.TranscriptTitle)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.addField("Closed By", message.author.tag)
|
|
||||||
.addField("Reason", reason);
|
|
||||||
|
|
||||||
message.channel.messages.fetch({ limit: 100 }).then( msgs => {
|
|
||||||
let html = '';
|
|
||||||
|
|
||||||
msgs = msgs.sort( ( a, b ) => a.createdTimestamp - b.createdTimestamp );
|
|
||||||
html += `<strong>Server Name:</strong> ${message.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(logEmbed).catch(err => {
|
|
||||||
message.reply(err)
|
|
||||||
})
|
|
||||||
|
|
||||||
logChannel.send( new Discord.MessageAttachment( Buffer.from( html ), `${name}.html` ) );
|
|
||||||
|
|
||||||
message.channel.delete();
|
|
||||||
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
}).catch( () => {
|
|
||||||
m.edit('The request to close the ticket has timed out.').then( m2 => m2.delete( 3000 ) );
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!supportbot.CloseConfirmation) {
|
|
||||||
|
|
||||||
let logChannel = message.guild.channels.cache.find(channel => channel.name === supportbot.TranscriptLog) || message.guild.channels.cache.find(channel => channel.id === supportbot.TranscriptLog)
|
|
||||||
let user = message.author;
|
|
||||||
let reason = args.join(" ") || "No Reason Provided.";
|
|
||||||
|
|
||||||
let name = message.channel.name;
|
|
||||||
let ticketChannel = message.channel;
|
|
||||||
|
|
||||||
message.channel.send(`**${supportbot.ClosingTicket}**`)
|
|
||||||
|
|
||||||
.then(() => {
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.TranscriptTitle)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.addField("Closed By", message.author.tag)
|
|
||||||
.addField("Reason", reason);
|
|
||||||
|
|
||||||
message.channel.messages.fetch({ limit: 100 }).then( msgs => {
|
|
||||||
let html = '';
|
|
||||||
|
|
||||||
msgs = msgs.sort( ( a, b ) => a.createdTimestamp - b.createdTimestamp );
|
|
||||||
html += `<strong>Server Name:</strong> ${message.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(logEmbed).catch(err => {
|
|
||||||
message.reply(err)
|
|
||||||
})
|
|
||||||
|
|
||||||
logChannel.send( new Discord.MessageAttachment( Buffer.from( html ), `${name}.html` ) );
|
|
||||||
|
|
||||||
message.channel.delete();
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
}).catch( () => {
|
|
||||||
m.edit('The request to close the ticket has timed out.').then( m2 => m2.delete( 3000 ) );
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Help Command
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.HelpCommand,
|
|
||||||
description: supportbot.HelpDesc,
|
|
||||||
|
|
||||||
execute(message, args) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
let SupportStaff = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Staff) || message.guild.roles.cache.find(staffRole => staffRole.id === supportbot.Staff);
|
|
||||||
let AdminStaff = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Admin) || message.guild.roles.cache.find(adminRole => adminRole.id === supportbot.Admin);
|
|
||||||
|
|
||||||
if (supportbot.HelpMenu) {
|
|
||||||
let generalCommands = "";
|
|
||||||
generalCommands += `**${supportbot.Prefix}${supportbot.HelpCommand}** ${supportbot.HelpDesc}\n`;
|
|
||||||
generalCommands += `**${supportbot.Prefix}${supportbot.LinksCommand}** ${supportbot.LinksDesc}\n`;
|
|
||||||
generalCommands += `**${supportbot.Prefix}${supportbot.SuggestCommand}** ${supportbot.SuggestionDesc}\n`;
|
|
||||||
generalCommands += `**${supportbot.Prefix}${supportbot.PingCommand}** ${supportbot.PingDesc}\n`;
|
|
||||||
|
|
||||||
let supportCommands = "";
|
|
||||||
supportCommands += `**${supportbot.Prefix}${supportbot.NewTicket} [reason]** ${supportbot.NewTicketDesc}\n`
|
|
||||||
supportCommands += `**${supportbot.Prefix}${supportbot.CloseTicket} [reason]** ${supportbot.CloseTicketDesc}\n`
|
|
||||||
|
|
||||||
let staffCommands = "";
|
|
||||||
staffCommands += `**${supportbot.Prefix}${supportbot.AddUser} <user#0000>** ${supportbot.AddUserDesc}\n`
|
|
||||||
staffCommands += `**${supportbot.Prefix}${supportbot.RemoveUser} <user#0000>** ${supportbot.RemoveUserDesc}\n`
|
|
||||||
staffCommands += `**${supportbot.Prefix}${supportbot.BotSay}** ${supportbot.BotSayDesc}\n`
|
|
||||||
staffCommands += `**${supportbot.Prefix}${supportbot.PurgeMessage}** ${supportbot.PurgeDesc}\n`
|
|
||||||
staffCommands += `**${supportbot.Prefix}${supportbot.ChatLog}** ${supportbot.ChatLogDesc}\n`
|
|
||||||
|
|
||||||
let adminCommands = "";
|
|
||||||
adminCommands += `**${supportbot.Prefix}${supportbot.AnnounceCommand}** ${supportbot.AnnounceDesc} \`Admin Only\`\n`
|
|
||||||
adminCommands += `**${supportbot.Prefix}${supportbot.BanUser}** ${supportbot.BanDesc} \`Admin Only\` \n`
|
|
||||||
adminCommands += `**${supportbot.Prefix}${supportbot.KickUser}** ${supportbot.KickDesc} \`Admin Only\` \n`
|
|
||||||
adminCommands += `**${supportbot.Prefix}${supportbot.BlacklistUser}** ${supportbot.BlacklistDesc} \`Admin Only\` \n`
|
|
||||||
|
|
||||||
const HelpEmbed1 = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.Bot_Name)
|
|
||||||
.setThumbnail(message.author.displayAvatarURL())
|
|
||||||
|
|
||||||
.addFields(
|
|
||||||
{ name: '🖥️ General Commands\n', value: `${generalCommands}\n`, inline: false },
|
|
||||||
{ name: '🎫 Support Commands\n', value: `${supportCommands}\n`, inline: false },
|
|
||||||
)
|
|
||||||
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter, message.author.displayAvatarURL());
|
|
||||||
|
|
||||||
if (message.member.roles.cache.has(SupportStaff.id)) {
|
|
||||||
HelpEmbed1.addFields(
|
|
||||||
{ name: '🔐 Staff Commands\n', value: `${staffCommands}\n`, inline: false },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (message.member.roles.cache.has(AdminStaff.id)) {
|
|
||||||
HelpEmbed1.addFields(
|
|
||||||
{ name: '🔐 Admin Commands\n', value: `${adminCommands}\n`, inline: false },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.SendHelpPage === "dm") {
|
|
||||||
message.author.send({
|
|
||||||
embed: HelpEmbed1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.SendHelpPage === "channel") {
|
|
||||||
message.channel.send({
|
|
||||||
embed: HelpEmbed1
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,109 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Say Command
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const { execute } = require("./help");
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.KickUser,
|
|
||||||
description: supportbot.KickDesc,
|
|
||||||
|
|
||||||
execute(message, args, member) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
let SupportStaff = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Admin) || message.guild.roles.cache.find(adminRole => adminRole.id === supportbot.Admin)
|
|
||||||
|
|
||||||
const NoPerms = new Discord.MessageEmbed()
|
|
||||||
.setTitle("Invalid Permissions!")
|
|
||||||
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${SupportStaff.name}\``)
|
|
||||||
.setColor(supportbot.WarningColour)
|
|
||||||
|
|
||||||
if (!message.member.roles.cache.has(SupportStaff.id))
|
|
||||||
return message.channel.send({ embed: NoPerms });
|
|
||||||
|
|
||||||
let locateChannel = message.guild.channels.cache.find(ModLogChannel => ModLogChannel.name === supportbot.ModLogChannel) || message.guild.channels.cache.find(ModLogChannel => ModLogChannel.id === supportbot.ModLogChannel)
|
|
||||||
|
|
||||||
const errornochannel = new Discord.MessageEmbed()
|
|
||||||
.setTitle("Invalid Channel")
|
|
||||||
.setDescription(`${supportbot.InvalidChannel}\n\nChannel Required: \`${supportbot.ModLogChannel}\``)
|
|
||||||
.setColor(supportbot.ErrorColour);
|
|
||||||
|
|
||||||
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
|
||||||
|
|
||||||
const user = message.mentions.members.first() || message.guild.members.cache.get(args[0]);
|
|
||||||
|
|
||||||
const embed1 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :x: Please provide a reason to kick.\n\n`Try Again!`")
|
|
||||||
.setColor(supportbot.ErrorColour)
|
|
||||||
|
|
||||||
if (!args[0]) return message.channel.send({
|
|
||||||
embed: embed1
|
|
||||||
});
|
|
||||||
|
|
||||||
const embed2 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :detective: **Hmm!** Can\'t seem tp find this user.\n\n`Are they in the server?`")
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
if (!user) return message.channel.send({
|
|
||||||
embed: embed2
|
|
||||||
})
|
|
||||||
|
|
||||||
const embed3 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :x: **Err No!** Cannot punish this user!\n\n`Reason: Their permissions and or roles are greater than mine.`")
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
if(!user.kickable) return message.channel.send({
|
|
||||||
embed: embed3
|
|
||||||
});
|
|
||||||
|
|
||||||
const embed4 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :joy: **OML!** Did you really just try to kick yourself!")
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
if(user.id === message.author.id) return message.channel.send({
|
|
||||||
embed: embed4
|
|
||||||
});
|
|
||||||
|
|
||||||
let reason = args.slice(1).join(" ");
|
|
||||||
|
|
||||||
if(!reason) reason = 'No Reason Provided.';
|
|
||||||
|
|
||||||
const embed5 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :thinking: **Hmm** Something seems to have gone wrong.\n\n`Check your system for errors!`")
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
user.kick({ reason: `${reason}` }).catch(err => {
|
|
||||||
message.channel.send({ embed: embed5 })
|
|
||||||
console.log(err)
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
const successEmbed = new Discord.MessageEmbed()
|
|
||||||
.setDescription(`> :white_check_mark: **OOF!** ${user} has been kicked!`)
|
|
||||||
.setColor(supportbot.SuccessColour)
|
|
||||||
|
|
||||||
message.channel.send({
|
|
||||||
embed: successEmbed
|
|
||||||
})
|
|
||||||
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.KickTitle)
|
|
||||||
.setThumbnail(supportbot.ModThumbnail)
|
|
||||||
.addField('Kicked User:', user)
|
|
||||||
.addField('Staff Member', message.author)
|
|
||||||
.addField('Reason:', reason)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.setColor(supportbot.KickLogColour)
|
|
||||||
.setTimestamp()
|
|
||||||
|
|
||||||
locateChannel.send({ embed: logEmbed })
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Links Command
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const { execute } = require("./help");
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.LinksCommand,
|
|
||||||
description: supportbot.LinksDesc,
|
|
||||||
|
|
||||||
execute(message, args) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
const LinksEmbed = new Discord.MessageEmbed()
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
let botLinks = supportbot.LINKS;
|
|
||||||
|
|
||||||
let links = '';
|
|
||||||
|
|
||||||
for ( let name in botLinks ) {
|
|
||||||
links += `[${name}](${botLinks[ name ]})\n`;
|
|
||||||
};
|
|
||||||
|
|
||||||
LinksEmbed.addField(supportbot.LinksTitle, links)
|
|
||||||
|
|
||||||
message.channel.send({ embed: LinksEmbed });
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Ping Command
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.PingCommand,
|
|
||||||
description: supportbot.PingDesc,
|
|
||||||
|
|
||||||
execute(message, args) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
let ping = Date.now() - message.createdTimestamp + " ms";
|
|
||||||
|
|
||||||
const PingCommandEmbed = new Discord.MessageEmbed()
|
|
||||||
.setDescription(`🏓 **Pong!** \`${Date.now() - message.createdTimestamp}ms\``)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
message.channel.send({ embed: PingCommandEmbed });
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Say Command
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const { execute } = require("./help");
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.PurgeMessage,
|
|
||||||
description: supportbot.PurgeDesc,
|
|
||||||
|
|
||||||
execute(message, args, member) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
let SupportStaff = message.guild.roles.cache.find(adminRole => adminRole.name === supportbot.Staff) || message.guild.roles.cache.find(adminRole => adminRole.id === supportbot.Staff)
|
|
||||||
|
|
||||||
const NoPerms = new Discord.MessageEmbed()
|
|
||||||
.setTitle("Invalid Permissions!")
|
|
||||||
.setDescription(`${supportbot.IncorrectPerms}\n\nRole Required: \`${SupportStaff.name}\``)
|
|
||||||
.setColor(supportbot.WarningColour)
|
|
||||||
|
|
||||||
if (!message.member.roles.cache.has(SupportStaff.id))
|
|
||||||
return message.channel.send({ embed: NoPerms });
|
|
||||||
|
|
||||||
let locateChannel = message.guild.channels.cache.find(ModLogChannel => ModLogChannel.name === supportbot.ModLogChannel) || message.guild.channels.cache.find(ModLogChannel => ModLogChannel.id === supportbot.ModLogChannel)
|
|
||||||
|
|
||||||
const errornochannel = new Discord.MessageEmbed()
|
|
||||||
.setTitle("Invalid Channel")
|
|
||||||
.setDescription(`${supportbot.InvalidChannel}\n\nChannel Required: \`${supportbot.ModLogChannel}\``)
|
|
||||||
.setColor(supportbot.ErrorColour);
|
|
||||||
|
|
||||||
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
|
||||||
|
|
||||||
const embed1 = new Discord.MessageEmbed()
|
|
||||||
.setDescription(`> :thinking: **Hmm!** Please enter a valid number of message to purge!\n\n\`${supportbot.Prefix}${supportbot.PurgeMessage} <message count>\` `)
|
|
||||||
.setColor(supportbot.WarningColour)
|
|
||||||
|
|
||||||
if (!args[0]) return message.channel.send({
|
|
||||||
embed: embed1
|
|
||||||
});
|
|
||||||
|
|
||||||
const messagePrune = parseInt(args[0])
|
|
||||||
|
|
||||||
const embed2 = new Discord.MessageEmbed()
|
|
||||||
.setDescription("> :person_facepalming: **Grr!** Can you count? That ain't a number :joy:")
|
|
||||||
.setColor(supportbot.ErrorColour)
|
|
||||||
|
|
||||||
if (isNaN(messagePrune)) return message.reply({
|
|
||||||
embed: embed2
|
|
||||||
})
|
|
||||||
|
|
||||||
message.channel.bulkDelete(messagePrune).then(() => {
|
|
||||||
|
|
||||||
const embed3 = new Discord.MessageEmbed()
|
|
||||||
.setDescription(`> :recycle: \`${args[0]} messages\` **have been purged!** `)
|
|
||||||
.setColor(supportbot.ErrorColour)
|
|
||||||
message.channel.send({
|
|
||||||
embed: embed3
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.PruneLogTitle)
|
|
||||||
.setThumbnail(supportbot.PruneThumbnail)
|
|
||||||
.addField('Messages Purged', `\`${args[0]} messages\``)
|
|
||||||
.addField('Staff Member', message.author)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.setColor(supportbot.PruneColour)
|
|
||||||
.setTimestamp()
|
|
||||||
|
|
||||||
locateChannel.send({ embed: logEmbed })
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Remove User
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.RemoveUser,
|
|
||||||
description: supportbot.RemoveUserDesc,
|
|
||||||
|
|
||||||
execute(message, args) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
let SupportStaff = message.guild.roles.cache.find(SupportTeam => SupportTeam.name === supportbot.Staff) || message.guild.roles.cache.find(SupportTeam => SupportTeam.id === supportbot.Staff)
|
|
||||||
let Admins = message.guild.roles.cache.find(AdminUser => AdminUser.name === supportbot.Admin) || message.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 (message.member.roles.cache.has(SupportStaff.id) || message.member.roles.cache.has(Admins.id)) {
|
|
||||||
if (!message.channel.name.startsWith( `${supportbot.TicketChannel}-` )) {
|
|
||||||
const Exists = new Discord.MessageEmbed()
|
|
||||||
.setTitle("No Ticket Found!")
|
|
||||||
.setDescription(`${supportbot.NoValidTicket}`)
|
|
||||||
.setColor(supportbot.WarningColour);
|
|
||||||
message.channel.send({ embed: Exists });
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let rUser = message.guild.member(message.mentions.users.first() || message.guild.members.cache.get(args[0]));
|
|
||||||
const UserNotExist = new Discord.MessageEmbed()
|
|
||||||
.setTitle("User Not Found!")
|
|
||||||
.setDescription(`${supportbot.UserNotFound}\n\nTry Again:\`${supportbot.Prefix}${supportbot.RemoveUser} <user#0000>\``)
|
|
||||||
.setColor(supportbot.ErrorColour)
|
|
||||||
|
|
||||||
if (!rUser) return message.channel.send({ embed: UserNotExist });
|
|
||||||
|
|
||||||
message.channel.updateOverwrite(rUser, {
|
|
||||||
VIEW_CHANNEL: false,
|
|
||||||
CREATE_INVITE: false,
|
|
||||||
SEND_MESSAGES: false,
|
|
||||||
READ_MESSAGES: false
|
|
||||||
});
|
|
||||||
|
|
||||||
const Complete = new Discord.MessageEmbed()
|
|
||||||
.setTitle("User Removed!")
|
|
||||||
.setDescription(supportbot.RemovedUser.replace(/%user%/g, rUser.id))
|
|
||||||
.setTimestamp()
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
message.channel.send({ embed: Complete });
|
|
||||||
} else {
|
|
||||||
return message.channel.send({ embed: NoPerms });
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Suggest Command
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.SuggestCommand,
|
|
||||||
description: supportbot.SuggestionDesc,
|
|
||||||
|
|
||||||
execute(message, args) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
let locateChannel = message.guild.channels.cache.find(SuggestionChannel => SuggestionChannel.name === supportbot.SuggestionChannel) || message.guild.channels.cache.find(SuggestionChannel => SuggestionChannel.id === supportbot.SuggestionChannel)
|
|
||||||
|
|
||||||
const errornochannel = new Discord.MessageEmbed()
|
|
||||||
.setTitle("Invalid Channel")
|
|
||||||
.setDescription(`${supportbot.InvalidChannel}\n\nChannel Required: \`${supportbot.SuggestionChannel}\``)
|
|
||||||
.setColor(supportbot.ErrorColour);
|
|
||||||
|
|
||||||
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
|
||||||
|
|
||||||
const embed = new Discord.MessageEmbed()
|
|
||||||
.setDescription(`> **${supportbot.SuggestionStarter}**`)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
message.channel.send({ embed: embed });
|
|
||||||
|
|
||||||
let suggestion = []
|
|
||||||
message.channel.awaitMessages(response => response.content.length > 2, {
|
|
||||||
max: 1,
|
|
||||||
time: 500000,
|
|
||||||
errors: ['time'],
|
|
||||||
}).then((collected) => {
|
|
||||||
suggestion.push(collected.map(r => r.content));
|
|
||||||
|
|
||||||
const SuggestionMessage = new Discord.MessageEmbed()
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
|
|
||||||
.addField(supportbot.SuggestionTitle, suggestion, true)
|
|
||||||
.addField("From", `<@${message.author.id}>`, true)
|
|
||||||
|
|
||||||
if (supportbot.SuggestionMessage_Icon === "BOT") {
|
|
||||||
SuggestionMessage.setThumbnail(bot.user.displayAvatarURL())
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.SuggestionMessage_Icon === "USER") {
|
|
||||||
SuggestionMessage.setThumbnail(message.author.displayAvatarURL())
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.SuggestionMessage_Icon === "CUSTOM") {
|
|
||||||
SuggestionMessage.setThumbnail(supportbot.SuggestionIcon_URL)
|
|
||||||
}
|
|
||||||
|
|
||||||
locateChannel.send({ embed: SuggestionMessage }).then(async function(msg) {
|
|
||||||
msg.react(supportbot.SuggestReact_1).then(() => msg.react(supportbot.SuggestReact_2));
|
|
||||||
});
|
|
||||||
|
|
||||||
const SuggestionComplete = new Discord.MessageEmbed()
|
|
||||||
.setColor(supportbot.SuccessColour)
|
|
||||||
.setDescription(`:white_check_mark: Your suggestion has been successfully created. <#${locateChannel.id}>`)
|
|
||||||
message.channel.send({ embed: SuggestionComplete })
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,230 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Ticket Command
|
|
||||||
|
|
||||||
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('../utils/TicketNumber.js');
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.NewTicket,
|
|
||||||
description: supportbot.NewTicketDesc,
|
|
||||||
|
|
||||||
async execute(message, args) {
|
|
||||||
if (!message.channel.name === supportbot.ReactionChannel || !message.channel.id === supportbot.ReactionChannel) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
let reactionUser = message.guild.members.cache.get(message.author.id)
|
|
||||||
|
|
||||||
if (reactionUser.roles.cache.find(role => role.name === supportbot.TicketBlackListRole) || reactionUser.roles.cache.find(role => role.id === supportbot.TicketBlackListRole)) {
|
|
||||||
return message.channel.send(`<@${message.author.id}> ${supportbot.TicketBlackListMessage}`).then(msg => {
|
|
||||||
msg.delete({timeout: 3500})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ticket ID
|
|
||||||
let ticketNumberID = TicketNumberID.pad(message.guild.id);
|
|
||||||
|
|
||||||
// Ticket Subject
|
|
||||||
const TicketSubject = args || supportbot.NoTicketSubject;
|
|
||||||
|
|
||||||
const channel = await message.guild.channels.create(`${supportbot.TicketChannel}-${ticketNumberID}`);
|
|
||||||
|
|
||||||
if (message.channel.name === supportbot.ReactionChannel || message.channel.id === supportbot.ReactionChannel) {
|
|
||||||
const CreatedTicket = new Discord.MessageEmbed()
|
|
||||||
.setDescription(supportbot.TicketCreatedAlert.replace(/%ticketauthor%/g, message.author.id).replace(/%ticketid%/g, channel.id).replace(/%ticketusername%/g, message.author.username))
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
message.channel.send({embed: CreatedTicket}).then((r) => {
|
|
||||||
r.delete({ timeout:5000 })
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
const CreatedTicket = new Discord.MessageEmbed()
|
|
||||||
.setDescription(supportbot.TicketCreatedAlert.replace(/%ticketauthor%/g, message.author.id).replace(/%ticketid%/g, channel.id).replace(/%ticketusername%/g, message.author.username))
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
message.channel.send({embed: CreatedTicket});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ticket Category
|
|
||||||
let TicketCategory = message.guild.channels.cache.find(category => category.name === supportbot.TicketCategory) || message.guild.channels.cache.find(category => category.id === supportbot.TicketCategory)
|
|
||||||
|
|
||||||
// Locate Roles
|
|
||||||
let StaffMember = message.guild.roles.cache.find(SupportTeam => SupportTeam.name === supportbot.Staff) || message.guild.roles.cache.find(SupportTeam => SupportTeam.id === supportbot.Staff)
|
|
||||||
let ServerAdmins = message.guild.roles.cache.find(AdminUser => AdminUser.name === supportbot.Admin) || message.guild.roles.cache.find(AdminUser => AdminUser.id === supportbot.Admin)
|
|
||||||
|
|
||||||
if (TicketCategory) {
|
|
||||||
channel.setParent(TicketCategory.id)
|
|
||||||
}
|
|
||||||
|
|
||||||
channel.updateOverwrite(message.guild.id, {
|
|
||||||
SEND_MESSAGES: false,
|
|
||||||
VIEW_CHANNEL: false
|
|
||||||
})
|
|
||||||
|
|
||||||
channel.updateOverwrite(message.author, {
|
|
||||||
SEND_MESSAGES: true,
|
|
||||||
VIEW_CHANNEL: true
|
|
||||||
})
|
|
||||||
|
|
||||||
channel.updateOverwrite(StaffMember, {
|
|
||||||
SEND_MESSAGES: true,
|
|
||||||
VIEW_CHANNEL: true
|
|
||||||
})
|
|
||||||
|
|
||||||
channel.updateOverwrite(ServerAdmins, {
|
|
||||||
SEND_MESSAGES: true,
|
|
||||||
VIEW_CHANNEL: true
|
|
||||||
})
|
|
||||||
|
|
||||||
// Ticket Created, Message Sent
|
|
||||||
|
|
||||||
if (supportbot.AllowTicketMentions) {
|
|
||||||
channel.send(`<@${message.author.id}>`)
|
|
||||||
}
|
|
||||||
|
|
||||||
const TicketMessage = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.Ticket_Title.replace(/%ticketauthor%/g, message.author.id).replace(/%ticketid%/g, channel.id).replace(/%ticketusername%/g, message.author.username))
|
|
||||||
.setDescription(supportbot.TicketMessage.replace(/%ticketauthor%/g, message.author.id).replace(/%ticketid%/g, channel.id).replace(/%ticketusername%/g, message.author.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.') {
|
|
||||||
channel.setTopic(`Reason: ${TicketSubject} - User ID: ${message.author.id} - Ticket: ${channel.name}`)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
const reactionMessage = await channel.send({
|
|
||||||
embed: TicketMessage
|
|
||||||
}).then( async function(ticketmsg) {
|
|
||||||
await ticketmsg.react(supportbot.TicketLockReaction)
|
|
||||||
await ticketmsg.react(supportbot.TicketDeleteReaction)
|
|
||||||
|
|
||||||
const collector = ticketmsg.createReactionCollector(
|
|
||||||
(reaction, user) => message.guild.roles.cache.find((staff) => staff.name === supportbot.Staff),
|
|
||||||
{ dispose: true }
|
|
||||||
);
|
|
||||||
|
|
||||||
collector.on('collect', (reaction, user) => {
|
|
||||||
switch (reaction.emoji.name) {
|
|
||||||
case supportbot.TicketLockReaction:
|
|
||||||
|
|
||||||
channel.updateOverwrite(message.author, {
|
|
||||||
SEND_MESSAGES: false,
|
|
||||||
VIEW_CHANNEL: true
|
|
||||||
});
|
|
||||||
|
|
||||||
const LockTicketEmbed = new Discord.MessageEmbed()
|
|
||||||
.setDescription(supportbot.TicketLockMessage)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
channel.send({embed: LockTicketEmbed})
|
|
||||||
break;
|
|
||||||
|
|
||||||
case supportbot.TicketDeleteReaction:
|
|
||||||
const DeleteTicketEmbed = new Discord.MessageEmbed()
|
|
||||||
.setDescription(supportbot.TicketDeleteMessage)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
channel.send({embed: DeleteTicketEmbed})
|
|
||||||
|
|
||||||
let logChannel = message.guild.channels.cache.find(channel => channel.name === supportbot.TranscriptLog) || message.guild.channels.cache.find(channel => channel.id === supportbot.TranscriptLog)
|
|
||||||
let user = message.author;
|
|
||||||
let reason = args.join(" ") || "No Reason Provided.";
|
|
||||||
|
|
||||||
let name = message.channel.name;
|
|
||||||
let ticketChannel = message.channel;
|
|
||||||
|
|
||||||
message.channel.send(`**${supportbot.ClosingTicket}**`)
|
|
||||||
|
|
||||||
.then(() => {
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.TranscriptTitle)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.addField("Closed By", message.author.tag)
|
|
||||||
.addField("Reason", reason);
|
|
||||||
|
|
||||||
message.channel.messages.fetch({ limit: 100 }).then( msgs => {
|
|
||||||
let html = '';
|
|
||||||
|
|
||||||
msgs = msgs.sort( ( a, b ) => a.createdTimestamp - b.createdTimestamp );
|
|
||||||
html += `<strong>Server Name:</strong> ${message.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(logEmbed).catch(err => {
|
|
||||||
message.reply(err)
|
|
||||||
})
|
|
||||||
|
|
||||||
const TranscriptSavedEmbed = new Discord.MessageEmbed()
|
|
||||||
.setDescription(supportbot.TranscriptSavedMessage)
|
|
||||||
.setColor(supportbot.SuccessColour)
|
|
||||||
channel.send({embed: TranscriptSavedEmbed})
|
|
||||||
|
|
||||||
logChannel.send( new Discord.MessageAttachment( Buffer.from( html ), `${name}.html` ) );
|
|
||||||
setTimeout(() => channel.delete(), supportbot.TicketDeleteTime);
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
}).catch( () => {
|
|
||||||
m.edit('The request to close the ticket has timed out.').then( m2 => m2.delete( 3000 ) );
|
|
||||||
});
|
|
||||||
break;
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
fs.writeFileSync("./storage/SupportTickets.json", '{\n "ticket": "' + channel.name + '", \n "id":' + message.author.id + "\n}", (err) => {
|
|
||||||
if (!err) return;
|
|
||||||
console.error(err)
|
|
||||||
})
|
|
||||||
// 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.TicketLog}\`\n\nError Code: \`SB-03\``)
|
|
||||||
.setColor(supportbot.ErrorColour);
|
|
||||||
|
|
||||||
const TicketLogs = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.TicketLog_Title)
|
|
||||||
.setThumbnail(supportbot.Ticket_Thumbnail)
|
|
||||||
.addFields(
|
|
||||||
{ name: 'Ticket', value: `<#${channel.id}>` },
|
|
||||||
{ name: 'User', value: `<@${message.author.id}>` },
|
|
||||||
)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
|
|
||||||
let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === supportbot.TicketLog) || message.guild.channels.cache.find(LocateChannel => LocateChannel.id === supportbot.TicketLog)
|
|
||||||
|
|
||||||
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
|
||||||
|
|
||||||
locateChannel.send({ embed: TicketLogs });
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
// SupportBot, Created by Emerald Services
|
|
||||||
// Announce
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const { execute } = require("./help");
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
name: supportbot.ChatLog,
|
|
||||||
description: supportbot.ChatLogDesc,
|
|
||||||
|
|
||||||
execute(message, args) {
|
|
||||||
if (supportbot.DeleteMessages) message.delete();
|
|
||||||
|
|
||||||
let name = message.channel.name;
|
|
||||||
|
|
||||||
message.channel.messages.fetch({ limit: 100 }).then( msgs => {
|
|
||||||
let html = '';
|
|
||||||
|
|
||||||
msgs = msgs.sort( ( a, b ) => a.createdTimestamp - b.createdTimestamp );
|
|
||||||
html += `<strong>--- Channel Transcript ---</strong><br>`;
|
|
||||||
html += `<strong>Server Name:</strong> ${message.guild.name}<br>`;
|
|
||||||
html += `<strong>Channel:</strong> ${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.ChatLogSavedMessage)
|
|
||||||
.setColor(supportbot.SuccessColour)
|
|
||||||
message.channel.send({embed: TranscriptSavedEmbed})
|
|
||||||
|
|
||||||
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.TicketLog}\`\n\nError Code: \`SB-03\``)
|
|
||||||
.setColor(supportbot.ErrorColour);
|
|
||||||
|
|
||||||
const ChatLogs = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.ChatLog_Title)
|
|
||||||
.setThumbnail(supportbot.ChatLog_Thumbnail)
|
|
||||||
.addFields(
|
|
||||||
{ name: 'Channel', value: `<#${message.channel.id}>` },
|
|
||||||
{ name: 'User', value: `<@${message.author.id}>` },
|
|
||||||
)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
|
|
||||||
let locateChannel = message.guild.channels.cache.find(LocateChannel => LocateChannel.name === supportbot.ChatLogChannel) || message.guild.channels.cache.find(LocateChannel => LocateChannel.id === supportbot.ChatLogChannel)
|
|
||||||
|
|
||||||
if(!locateChannel) return message.channel.send({ embed: errornochannel });
|
|
||||||
|
|
||||||
locateChannel.send( new Discord.MessageAttachment( Buffer.from( html ), `${name}.html` ) );
|
|
||||||
locateChannel.send({ embed: ChatLogs });
|
|
||||||
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
// SupportBot 6.0, Created by Emerald Services
|
|
||||||
// Ready Event
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = async (bot, member) => {
|
|
||||||
|
|
||||||
if (supportbot.SystemMessages) {
|
|
||||||
const SystemChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.SystemMessage_Channel) || member.guild.channels.cache.get(supportbot.SystemMessage_Channel)
|
|
||||||
|
|
||||||
if (!SystemChannel) return;
|
|
||||||
|
|
||||||
console.log(`[${supportbot.Bot_Name}]: ${member.user.username} has joined ${member.guild.name}!`)
|
|
||||||
console.log(supportbot.AutoRole_Role)
|
|
||||||
|
|
||||||
const role = member.guild.roles.cache.find(role => role.name === supportbot.AutoRole_Role) || member.guild.roles.cache.find(role => role.id === supportbot.AutoRole_Role)
|
|
||||||
|
|
||||||
member.roles.add(role).catch(console.error);
|
|
||||||
|
|
||||||
if (supportbot.SystemMessage_Type === "embed") {
|
|
||||||
|
|
||||||
const GuildAddMember = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.Welcome_Title)
|
|
||||||
.setDescription(supportbot.WelcomeMessage.replace(/%member%/g, `<@!${member.user.id}>`).replace(/%guildname%/g, member.guild.name))
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
if (supportbot.SystemMessage_Icon === "BOT") {
|
|
||||||
GuildAddMember.setThumbnail(bot.user.displayAvatarURL())
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.SystemMessage_Icon === "USER") {
|
|
||||||
GuildAddMember.setThumbnail(member.user.displayAvatarURL())
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.SystemMessage_Icon === "CUSTOM") {
|
|
||||||
SuggestionMessage.setThumbnail(supportbot.SystemMessageIcon_URL)
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (supportbot.SystemMessage_EmbedFooter) {
|
|
||||||
GuildAddMember.setFooter(supportbot.EmbedFooter)
|
|
||||||
}
|
|
||||||
|
|
||||||
SystemChannel.send({ embed: GuildAddMember });
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.SystemMessage_Type === "normal") {
|
|
||||||
SystemChannel.send(supportbot.WelcomeMessage.replace(/%member%/g, member.user.username).replace(/%guildname%/g, member.guild.name))
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
// SupportBot 6.0, Created by Emerald Services
|
|
||||||
// Ready Event
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = async (bot, member) => {
|
|
||||||
|
|
||||||
if (supportbot.SystemMessages) {
|
|
||||||
const SystemChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.SystemMessage_Channel) || member.guild.channels.cache.get(supportbot.SystemMessage_Channel)
|
|
||||||
|
|
||||||
if (!SystemChannel) return;
|
|
||||||
|
|
||||||
console.log(`[${supportbot.Bot_Name}]: ${member.user.username} has left ${member.guild.name}!`)
|
|
||||||
|
|
||||||
if (supportbot.SystemMessage_Type === "embed") {
|
|
||||||
const GuildRemoveMember = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.Leave_Title)
|
|
||||||
.setDescription(supportbot.LeaveMessage.replace(/%member%/g, member.user.username).replace(/%guildname%/g, member.guild.name))
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
|
|
||||||
if (supportbot.SystemMessage_Icon === "BOT") {
|
|
||||||
GuildRemoveMember.setThumbnail(bot.user.displayAvatarURL())
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.SystemMessage_Icon === "USER") {
|
|
||||||
GuildRemoveMember.setThumbnail(member.user.displayAvatarURL())
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (supportbot.SystemMessage_EmbedFooter === "true") {
|
|
||||||
GuildRemoveMember.setFooter(supportbot.EmbedFooter)
|
|
||||||
}
|
|
||||||
|
|
||||||
SystemChannel.send({ embed: GuildRemoveMember });
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.SystemMessage_Type === "normal") {
|
|
||||||
SystemChannel.send(supportbot.LeaveMessage.replace(/%member%/g, member.user.username).replace(/%guildname%/g, member.guild.name))
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
// SupportBot 6.0, Created by Emerald Services
|
|
||||||
// Message Event
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = async (bot, 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();
|
|
||||||
|
|
||||||
console.log(`\u001b[32m`, `[${supportbot.Bot_Name}]`, `\u001b[36m`, `${message.author.tag}`, `\u001b[33m`, `has executed the command`, `\u001b[36m`,`${supportbot.Prefix}${command}`)
|
|
||||||
|
|
||||||
const cmd = bot.commands.get(command);
|
|
||||||
if(!cmd) return;
|
|
||||||
cmd.execute(message, args);
|
|
||||||
};
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
// SupportBot 6.0, Created by Emerald Services
|
|
||||||
// Message Reaction Event
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
const tickets = yaml.load(fs.readFileSync('./storage/ticketreaction.yml', 'utf8'));
|
|
||||||
|
|
||||||
module.exports = async (client, reaction, user) => {
|
|
||||||
|
|
||||||
let message = {
|
|
||||||
guild: reaction.message.channel.guild,
|
|
||||||
author: user,
|
|
||||||
content: "N/A",
|
|
||||||
channel: reaction.message.channel
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.ReactionTickets) {
|
|
||||||
if (reaction.message.id === tickets.ReactionMessage_ID) {
|
|
||||||
if (reaction.emoji.name == supportbot.ReactionEmoji || reaction.emoji.id == supportbot.ReactionEmoji) {
|
|
||||||
await reaction.users.remove(user.id)
|
|
||||||
|
|
||||||
try {
|
|
||||||
const cmd = client.commands.get(supportbot.NewTicket);
|
|
||||||
if(!cmd) return;
|
|
||||||
|
|
||||||
cmd.execute(message, message.content);
|
|
||||||
} catch (error) {
|
|
||||||
console.error(error);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = async (bot, message, packet) => {
|
|
||||||
if (!['MESSAGE_REACTION_ADD', 'MESSAGE_REACTION_REMOVE'].includes(packet.t)) return;
|
|
||||||
|
|
||||||
const channel = bot.channels.cache.get(packet.d.channel_id);
|
|
||||||
if (channel.messages.has(packet.d.message_id)) return;
|
|
||||||
|
|
||||||
channel.messages.fetch(packet.d.message_id).then(message => {
|
|
||||||
const emoji = packet.d.emoji.id ? `${packet.d.emoji.name}:${packet.d.emoji.id}` : packet.d.emoji.name;
|
|
||||||
const reaction = message.reactions.get(emoji);
|
|
||||||
if (reaction) reaction.users.set(packet.d.user_id, bot.users.get(packet.d.user_id));
|
|
||||||
if (packet.t === 'MESSAGE_REACTION_ADD') {
|
|
||||||
bot.emit('messageReactionAdd', reaction, bot.users.get(packet.d.user_id));
|
|
||||||
}
|
|
||||||
if (packet.t === 'MESSAGE_REACTION_REMOVE') {
|
|
||||||
bot.emit('messageReactionRemove', reaction, bot.users.get(packet.d.user_id));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,84 +0,0 @@
|
|||||||
// SupportBot 6.0, Created by Emerald Services
|
|
||||||
// Ready Event
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
|
||||||
const tickets = yaml.load(fs.readFileSync('./storage/ticketreaction.yml', 'utf8'));
|
|
||||||
|
|
||||||
|
|
||||||
module.exports = async (bot) => {
|
|
||||||
bot.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.Bot_Name} v${supportbot.SupportBot_Version}`, `\u001b[36m`, `Connected to Discord`)
|
|
||||||
console.log(`\u001b[33m`, `Documentation:`, `\u001b[36m`, `https://docs.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 (supportbot.ReactionTickets === true) {
|
|
||||||
let chan1 = bot.channels.cache.find(channel => channel.name === supportbot.ReactionChannel)
|
|
||||||
|
|
||||||
if (!chan1) {
|
|
||||||
console.log('\u001b[33m', "[WARN] Ticket reaction panel is not setup, You can do so via the configuration file!")
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
chan1.messages.fetch(tickets.ReactionMessage_ID).catch(r => {
|
|
||||||
let embed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.ReactionMessage.replace(/%reaction_emoji%/g, supportbot.ReactionEmoji))
|
|
||||||
.setColor(supportbot.SuccessColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter);
|
|
||||||
|
|
||||||
if (supportbot.ReactionPanel_Description === true) {
|
|
||||||
embed.setDescription(supportbot.ReactionDescription)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.ReactionPanel_Thumbnail === true) {
|
|
||||||
embed.setThumbnail(supportbot.ReactionThumbnail)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.ReactionPanel_Image === true) {
|
|
||||||
embed.setImage(supportbot.ReactionImage)
|
|
||||||
}
|
|
||||||
|
|
||||||
bot.channels.cache.find(channel => channel.name === supportbot.ReactionChannel).send({
|
|
||||||
embed: embed
|
|
||||||
}).then(r => {
|
|
||||||
let data = {
|
|
||||||
"ReactionMessage_ID": `${r.id}`
|
|
||||||
}
|
|
||||||
let yamlStr = yaml.dump(data);
|
|
||||||
fs.writeFileSync('./storage/ticketreaction.yml', yamlStr, 'utf8');
|
|
||||||
|
|
||||||
r.react(supportbot.ReactionEmoji);
|
|
||||||
}).catch(e => {
|
|
||||||
console.log(e)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
};
|
|
||||||
@@ -1,105 +1,23 @@
|
|||||||
// ___ _ ___ _
|
// ___ _ ___ _
|
||||||
// / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
// / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||||
// \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
// \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||||
// <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
// <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||||
// |_| |_|
|
// |_| |_|
|
||||||
//
|
//
|
||||||
// SupportBot created by Emerald Services
|
// SupportBot created by Emerald Services
|
||||||
// Installed with MIT License
|
// Installed with MIT License
|
||||||
//
|
//
|
||||||
// Discord Support: https://emeraldsrv.dev/discord
|
// Discord Support: https://emeraldsrv.dev/discord
|
||||||
|
// Community Resources: https://emeraldsrv.dev/resources
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const bot = new Discord.Client();
|
|
||||||
|
|
||||||
bot.commands = new Discord.Collection();
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
const yaml = require('js-yaml');
|
const Client = require("./Structures/Client.js");
|
||||||
const supportbot = yaml.load(fs.readFileSync('./supportbot-config.yml', 'utf8'));
|
const client = new Client({});
|
||||||
|
|
||||||
const { promisify } = require("util");
|
client.start(supportbot.Token);
|
||||||
const readdir = promisify(require("fs").readdir);
|
|
||||||
|
|
||||||
String.prototype.toProperCase = function () {
|
|
||||||
return this.replace(
|
|
||||||
/([^\W_]+[^\s-]*) */g,
|
|
||||||
(txt) => txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase()
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
const init = async () => {
|
|
||||||
const evtFiles = await readdir("./events/");
|
|
||||||
|
|
||||||
console.info(`\u001b[36m`, `➢ SupportBot Events`);
|
|
||||||
console.info(` `);
|
|
||||||
|
|
||||||
evtFiles.forEach((file, i) => {
|
|
||||||
const eventName = file.split(".")[0];
|
|
||||||
const event = require(`./events/${file}`);
|
|
||||||
console.info(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[36m`, `#${i + 1} Event Loaded: ${eventName.toProperCase()} `);
|
|
||||||
|
|
||||||
bot.on(eventName, event.bind(null, bot));
|
|
||||||
delete require.cache[require.resolve(`./events/${file}`)];
|
|
||||||
});
|
|
||||||
|
|
||||||
console.info(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[36m`, `Successfully loaded ${evtFiles.length} events.`);
|
|
||||||
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`)
|
|
||||||
console.log(` `)
|
|
||||||
};
|
|
||||||
|
|
||||||
init();
|
|
||||||
|
|
||||||
fs.readdir("./commands/", (err, files) => {
|
|
||||||
|
|
||||||
console.info(`\u001b[36m`, `➢ SupportBot Commands`);
|
|
||||||
console.info(` `);
|
|
||||||
|
|
||||||
if (err) console.info(err, "error");
|
|
||||||
|
|
||||||
let jsfiles = files.filter((f) => f.split(".").pop() === "js");
|
|
||||||
|
|
||||||
if (jsfiles.length <= 0) {
|
|
||||||
console.log(`[${supportbot.Bot_Name}]: No commands found. Try to Re-download the resource`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
jsfiles.forEach((f, i) => {
|
|
||||||
let props = require(`./commands/${f}`);
|
|
||||||
|
|
||||||
console.info(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[36m`, `#${i + 1} Command Loaded: ${props.name.toProperCase()}`);
|
|
||||||
bot.commands.set(props.name, props);
|
|
||||||
});
|
|
||||||
|
|
||||||
console.info(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[36m`, `Loaded ${jsfiles.length} commands!`);
|
|
||||||
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`)
|
|
||||||
console.log(` `)
|
|
||||||
});
|
|
||||||
|
|
||||||
fs.readdir("./addons/", (err, files) => {
|
|
||||||
|
|
||||||
console.info(`\u001b[36m`, `➢ SupportBot Addons`);
|
|
||||||
console.info(` `);
|
|
||||||
|
|
||||||
if (err) console.info(err, "error");
|
|
||||||
|
|
||||||
let jsfiles = files.filter((f) => f.split(".").pop() === "js");
|
|
||||||
|
|
||||||
if (jsfiles.length <= 0) {
|
|
||||||
console.log(`[${supportbot.Bot_Name}]: No addons found. You can download addons from https://emeraldsrv.dev`);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
jsfiles.forEach((f, i) => {
|
|
||||||
let props = require(`./addons/${f}`);
|
|
||||||
|
|
||||||
console.info(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[36m`, `#${i + 1} Addon Loaded: ${props.name.toProperCase()}`);
|
|
||||||
bot.commands.set(props.name, props);
|
|
||||||
});
|
|
||||||
|
|
||||||
console.info(`\u001b[32m`, `[${supportbot.Bot_Name}]:`, `\u001b[36m`, `Loaded ${jsfiles.length} addons!`);
|
|
||||||
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`)
|
|
||||||
console.log(` `)
|
|
||||||
});
|
|
||||||
|
|
||||||
bot.login(supportbot.Token);
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
SupportBot Language Compatibility
|
|
||||||
|
|
||||||
In order to switch languages simple remove the current existig configuration file and replace it with one of the files here renamnig the file to "supportbot-config.yml" from (for example) "supportbot-config_es.yml" to home directory of SupportBot.
|
|
||||||
|
|
||||||
-> Delete the existing supportbot-config.yml file
|
|
||||||
-> Download the new file for whatever language
|
|
||||||
-> Upload the file to SupportBot and rename it to supportbot-config.yml
|
|
||||||
-> Job Done, restart the bot :wink:
|
|
||||||
@@ -1,310 +0,0 @@
|
|||||||
# ___ _ ___ _
|
|
||||||
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
|
||||||
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
|
||||||
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
|
||||||
# |_| |_|
|
|
||||||
#
|
|
||||||
# SupportBot created by Emerald Services
|
|
||||||
# Installed with MIT License
|
|
||||||
#
|
|
||||||
# Discord Support: https://emeraldsrv.dev/discord
|
|
||||||
|
|
||||||
SupportBot_Version: "7.1 pre-1"
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# General Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
Token: "BOT_TOKEN_HERE"
|
|
||||||
Prefix: "!!"
|
|
||||||
Bot_Name: "SupportBot"
|
|
||||||
|
|
||||||
DeleteMessages: true
|
|
||||||
# Should the bot delete command messages after executed?
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# Activity Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
BotActivity: "-help | SupportBot"
|
|
||||||
|
|
||||||
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 | The #1 Supportive Discord Bot"
|
|
||||||
|
|
||||||
ErrorColour: "#d12519"
|
|
||||||
SuccessColour: "#04b545"
|
|
||||||
WarningColour: "#fca117"
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# Help Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
HelpMenu: true # Do not change!
|
|
||||||
SendHelpPage: "channel" # Set to channel or dm
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# Role Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
AutoRole: true
|
|
||||||
AutoRole_Role: "Member"
|
|
||||||
LockdownRole: "@everyone"
|
|
||||||
|
|
||||||
Staff: "Staff"
|
|
||||||
Admin: "Admin"
|
|
||||||
TicketBlackListRole: "Blacklisted"
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# Tickets Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
# --- General Config ---
|
|
||||||
# --- Start ---
|
|
||||||
|
|
||||||
TicketCategory: "▬▬ TICKETS ▬▬"
|
|
||||||
TicketChannel: "ticket"
|
|
||||||
|
|
||||||
TicketLog: "ticket-logs"
|
|
||||||
TranscriptLog: "transcripts"
|
|
||||||
|
|
||||||
TranscriptTitle: "Ticket Transcript"
|
|
||||||
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.
|
|
||||||
|
|
||||||
# --- Panel Config ---
|
|
||||||
# --- Start ---
|
|
||||||
|
|
||||||
ReactionChannel: "create-ticket"
|
|
||||||
ReactionEmoji: "📩"
|
|
||||||
# For cusomt emojis: <:emoji_name:EMOJI_ID>
|
|
||||||
|
|
||||||
ReactionTickets: true
|
|
||||||
ReactionMessage: "React with %reaction_emoji% to create a Support Ticket!"
|
|
||||||
|
|
||||||
ReactionPanel_Description: true
|
|
||||||
ReactionDescription: "Create a support ticket to contact a member of staff."
|
|
||||||
|
|
||||||
ReactionPanel_Thumbnail: true
|
|
||||||
ReactionThumbnail: "https://hotemoji.com/images/dl/5/ticket-emoji-by-twitter.png"
|
|
||||||
|
|
||||||
ReactionPanel_Image: true
|
|
||||||
ReactionImage: "https://wallpapercave.com/wp/wp4462546.jpg"
|
|
||||||
|
|
||||||
# --- 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"
|
|
||||||
|
|
||||||
|
|
||||||
TicketLockReaction: "🔒"
|
|
||||||
TicketDeleteReaction: "⛔"
|
|
||||||
|
|
||||||
TranscriptSavedMessage: "📝 **Transcript Saved!**"
|
|
||||||
TicketLockMessage: "❌ **Ticket Locked!**"
|
|
||||||
TicketDeleteMessage: "⚠ **Ticket Deleting!**" # Tickets deleting after 5 seconds by default.
|
|
||||||
TicketDeleteTime: 5000 # Time must be set in miliseconds.
|
|
||||||
|
|
||||||
# --- Closing Config ---
|
|
||||||
# --- Start ---
|
|
||||||
|
|
||||||
ClosingTicket: ":warning: You have requested to close your support ticket."
|
|
||||||
ClosingConfirmation_Word: "confirm"
|
|
||||||
CloseConfirmation: true
|
|
||||||
|
|
||||||
# --- Departments Config ---
|
|
||||||
# --- Start ---
|
|
||||||
|
|
||||||
TicketDepartments: true
|
|
||||||
|
|
||||||
AllowStaff: true
|
|
||||||
# If set to true 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.
|
|
||||||
|
|
||||||
DepartmentEmoji_1: "🙋"
|
|
||||||
DepartmentEmoji_2: "💸"
|
|
||||||
DepartmentEmoji_3: "📗"
|
|
||||||
# Ticket emojis, the emojis are what users will need to react with inorder to proceed furthur if departments are enabled.
|
|
||||||
|
|
||||||
DepartmentTitle_1: "Support"
|
|
||||||
DepartmentTitle_2: "Billing"
|
|
||||||
DepartmentTitle_3: "Other"
|
|
||||||
# Ticket department title, This is the title for a ticket department to help users know what is available.
|
|
||||||
|
|
||||||
DepartmentRole_1: "Support"
|
|
||||||
DepartmentRole_2: "Admin"
|
|
||||||
DepartmentRole_3: "Support"
|
|
||||||
# Ticket roles are the roles that will be able to gain access to tickets depending on what department has been choosen.
|
|
||||||
|
|
||||||
# --------------------------------
|
|
||||||
# System Messages Configuration
|
|
||||||
# --------------------------------
|
|
||||||
|
|
||||||
# Available Placeholders:
|
|
||||||
# %guildname% - This displays the name of the discord server.
|
|
||||||
|
|
||||||
SystemMessages: true
|
|
||||||
SystemMessage_EmbedFooter: false
|
|
||||||
|
|
||||||
SystemMessage_Channel: "system-messages"
|
|
||||||
SystemMessage_Type: "embed"
|
|
||||||
# There are 2 types of how you can send system messages, 'normal' or 'embed'
|
|
||||||
|
|
||||||
SystemMessage_Icon: "USER"
|
|
||||||
# USER - This will display the user's icon of who joins.
|
|
||||||
# BOT - This will display the bot's icon when a someone joins.
|
|
||||||
|
|
||||||
Welcome_Title: "User Joined!"
|
|
||||||
WelcomeMessage: "Hello %member%, Welcome to %guildname%!"
|
|
||||||
# %member% define the user who joined and %guildnamne% defines the server name.
|
|
||||||
|
|
||||||
Leave_Title: "User Left!"
|
|
||||||
LeaveMessage: "Goodbye %member%, Thank you for visting %guildname%!"
|
|
||||||
# %member% define the user who left and %guildnamne% defines the server name.
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# Links Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
LinksTitle: "Server Links"
|
|
||||||
|
|
||||||
LINKS:
|
|
||||||
"Website": "https://www.example.com"
|
|
||||||
"Store": "https://store.example.com"
|
|
||||||
"Discord": "https://discord.gg/example"
|
|
||||||
# "Twitter": "https://twitter.com/example"
|
|
||||||
# "Add More": "Just follow this format!"
|
|
||||||
|
|
||||||
# --------------------------
|
|
||||||
# Suggestion Configuration
|
|
||||||
# --------------------------
|
|
||||||
|
|
||||||
SuggestionChannel: "suggestions"
|
|
||||||
SuggestionTitle: "Suggestion"
|
|
||||||
|
|
||||||
SuggestionStarter: "What would you like to suggest?"
|
|
||||||
SuggestReact_1: 👍
|
|
||||||
SuggestReact_2: 👎
|
|
||||||
|
|
||||||
# ----------------------------
|
|
||||||
# Announcement Configuration
|
|
||||||
# ----------------------------
|
|
||||||
|
|
||||||
AnnouncementChannel: "announcements"
|
|
||||||
AnnouncementTitle: "Servername Announcement"
|
|
||||||
AnnouncementIcon: "https://i.imgur.com/HbkZyB7.png"
|
|
||||||
|
|
||||||
AnnouncementStarter: "What would you like to announce?"
|
|
||||||
|
|
||||||
# --------------------------
|
|
||||||
# Moderation Configuration
|
|
||||||
# --------------------------
|
|
||||||
|
|
||||||
BanTitle: "User Banned!"
|
|
||||||
DaysBannedFor: 7
|
|
||||||
BanLogColour: "#D911B4"
|
|
||||||
|
|
||||||
KickTitle: "User Kicked!"
|
|
||||||
KickLogColour: "#D9B111"
|
|
||||||
|
|
||||||
ModThumbnail: "https://i.imgur.com/l6P3DF6.png"
|
|
||||||
ModLogChannel: "mod-logs"
|
|
||||||
|
|
||||||
PruneLogTitle: "Bulk Delete"
|
|
||||||
PruneThumbnail: "https://i.imgur.com/OAgW2vR.png"
|
|
||||||
PruneColour: "#1BA30C"
|
|
||||||
|
|
||||||
BlacklistTitle: "Blacklisted User"
|
|
||||||
BlacklistColour: "#000000"
|
|
||||||
|
|
||||||
# --------------------------
|
|
||||||
# Command Configuration
|
|
||||||
# --------------------------
|
|
||||||
|
|
||||||
# --- User Commands ---
|
|
||||||
|
|
||||||
HelpCommand: "help"
|
|
||||||
LinksCommand: "links"
|
|
||||||
PingCommand: "ping"
|
|
||||||
SuggestCommand: "suggest"
|
|
||||||
|
|
||||||
# --- Ticket Commands ---
|
|
||||||
|
|
||||||
NewTicket: "ticket"
|
|
||||||
CloseTicket: "close"
|
|
||||||
AddUser: "add"
|
|
||||||
RemoveUser: "remove"
|
|
||||||
RenameTicket: "rename"
|
|
||||||
|
|
||||||
# --- Staff/Admin Commands ---
|
|
||||||
|
|
||||||
BotSay: "say"
|
|
||||||
PurgeMessage: "purge"
|
|
||||||
|
|
||||||
AnnounceCommand: "announce"
|
|
||||||
BanUser: "ban"
|
|
||||||
KickUser: "kick"
|
|
||||||
BlacklistUser: "blacklist"
|
|
||||||
|
|
||||||
# --------------------------
|
|
||||||
# Messages Configuration
|
|
||||||
# --------------------------
|
|
||||||
|
|
||||||
# --- Command Messages ---
|
|
||||||
|
|
||||||
NewTicketDesc: "Create a new support ticket"
|
|
||||||
AnnounceDesc: "Create a server announcement"
|
|
||||||
CloseTicketDesc: "Close your support ticket"
|
|
||||||
LinksDesc: "View some important links"
|
|
||||||
PingDesc: "Get the bot's latency"
|
|
||||||
HelpDesc: "Get a list of all the commands"
|
|
||||||
RemoveUserDesc: "Remove a user from a support ticket"
|
|
||||||
AddUserDesc: "Add a user to a support ticket"
|
|
||||||
SuggestionDesc: "Create a server suggestion"
|
|
||||||
BotSayDesc: "Say something with the bot"
|
|
||||||
BanDesc: "Ban a member from this server."
|
|
||||||
KickDesc: "Kick a member from this server."
|
|
||||||
PurgeDesc: "Purge messages from the chat."
|
|
||||||
BlacklistDesc: "Decline a member to open a ticket"
|
|
||||||
|
|
||||||
# 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. This command is used when closing a ticket."
|
|
||||||
TicketExists: ":warning: This ticket cannot be opened, It already exists!"
|
|
||||||
Generated
+374
-434
@@ -1,74 +1,335 @@
|
|||||||
{
|
{
|
||||||
"name": "supportbot",
|
"name": "supportbot",
|
||||||
"version": "7.0.0",
|
"version": "7.4.2",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"packages": {
|
||||||
"@discordjs/collection": {
|
"": {
|
||||||
"version": "0.1.6",
|
"name": "supportbot",
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz",
|
"version": "7.4.2",
|
||||||
"integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ=="
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"discord.js": "^13.6.0",
|
||||||
|
"js-yaml": "^4.1.0"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"@discordjs/form-data": {
|
"node_modules/@discordjs/builders": {
|
||||||
|
"version": "0.11.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.11.0.tgz",
|
||||||
|
"integrity": "sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==",
|
||||||
|
"dependencies": {
|
||||||
|
"@sindresorhus/is": "^4.2.0",
|
||||||
|
"discord-api-types": "^0.26.0",
|
||||||
|
"ts-mixer": "^6.0.0",
|
||||||
|
"tslib": "^2.3.1",
|
||||||
|
"zod": "^3.11.6"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.0.0",
|
||||||
|
"npm": ">=7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@discordjs/collection": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.0.0",
|
||||||
|
"npm": ">=7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sapphire/async-queue": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-O5ND5Ljpef86X5oy8zXorQ754TMjWALcPSAgPBu4+76HLtDTrNoDyzU2uGE2G4A8Wv51u0MXHzGQ0WZ4GMtpIw==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=v14.0.0",
|
||||||
|
"npm": ">=7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@sindresorhus/is": {
|
||||||
|
"version": "4.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.4.0.tgz",
|
||||||
|
"integrity": "sha512-QppPM/8l3Mawvh4rn9CNEYIU9bxpXUCRMaX9yUpvBk1nMKusLKpfXGDEKExKaPhLzcn3lzil7pR6rnJ11HgeRQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=10"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sindresorhus/is?sponsor=1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/node": {
|
||||||
|
"version": "17.0.13",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.13.tgz",
|
||||||
|
"integrity": "sha512-Y86MAxASe25hNzlDbsviXl8jQHb0RDvKt4c40ZJQ1Don0AAL0STLZSs4N+6gLEO55pedy7r2cLwS+ZDxPm/2Bw=="
|
||||||
|
},
|
||||||
|
"node_modules/@types/node-fetch": {
|
||||||
|
"version": "2.5.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz",
|
||||||
|
"integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==",
|
||||||
|
"dependencies": {
|
||||||
|
"@types/node": "*",
|
||||||
|
"form-data": "^3.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/node-fetch/node_modules/form-data": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz",
|
||||||
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
"integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==",
|
||||||
"requires": {
|
"dependencies": {
|
||||||
"asynckit": "^0.4.0",
|
"asynckit": "^0.4.0",
|
||||||
"combined-stream": "^1.0.8",
|
"combined-stream": "^1.0.8",
|
||||||
"mime-types": "^2.1.12"
|
"mime-types": "^2.1.12"
|
||||||
}
|
|
||||||
},
|
|
||||||
"@tootallnate/once": {
|
|
||||||
"version": "1.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz",
|
|
||||||
"integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw=="
|
|
||||||
},
|
|
||||||
"abab": {
|
|
||||||
"version": "2.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz",
|
|
||||||
"integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q=="
|
|
||||||
},
|
|
||||||
"abort-controller": {
|
|
||||||
"version": "3.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz",
|
|
||||||
"integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==",
|
|
||||||
"requires": {
|
|
||||||
"event-target-shim": "^5.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"acorn": {
|
|
||||||
"version": "8.4.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz",
|
|
||||||
"integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA=="
|
|
||||||
},
|
|
||||||
"acorn-globals": {
|
|
||||||
"version": "6.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz",
|
|
||||||
"integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==",
|
|
||||||
"requires": {
|
|
||||||
"acorn": "^7.1.1",
|
|
||||||
"acorn-walk": "^7.1.1"
|
|
||||||
},
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@types/ws": {
|
||||||
|
"version": "8.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz",
|
||||||
|
"integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"acorn": {
|
"@types/node": "*"
|
||||||
"version": "7.4.1",
|
}
|
||||||
"resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz",
|
},
|
||||||
"integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A=="
|
"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/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.26.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz",
|
||||||
|
"integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">=12"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/discord.js": {
|
||||||
|
"version": "13.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.6.0.tgz",
|
||||||
|
"integrity": "sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==",
|
||||||
|
"dependencies": {
|
||||||
|
"@discordjs/builders": "^0.11.0",
|
||||||
|
"@discordjs/collection": "^0.4.0",
|
||||||
|
"@sapphire/async-queue": "^1.1.9",
|
||||||
|
"@types/node-fetch": "^2.5.12",
|
||||||
|
"@types/ws": "^8.2.2",
|
||||||
|
"discord-api-types": "^0.26.0",
|
||||||
|
"form-data": "^4.0.0",
|
||||||
|
"node-fetch": "^2.6.1",
|
||||||
|
"ws": "^8.4.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=16.6.0",
|
||||||
|
"npm": ">=7.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/form-data": {
|
||||||
|
"version": "4.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
||||||
|
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
||||||
|
"dependencies": {
|
||||||
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"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/mime-db": {
|
||||||
|
"version": "1.51.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz",
|
||||||
|
"integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/mime-types": {
|
||||||
|
"version": "2.1.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz",
|
||||||
|
"integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==",
|
||||||
|
"dependencies": {
|
||||||
|
"mime-db": "1.51.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/node-fetch": {
|
||||||
|
"version": "2.6.7",
|
||||||
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||||
|
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||||
|
"dependencies": {
|
||||||
|
"whatwg-url": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": "4.x || >=6.0.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"encoding": "^0.1.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"encoding": {
|
||||||
|
"optional": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"acorn-walk": {
|
"node_modules/tr46": {
|
||||||
"version": "7.2.0",
|
"version": "0.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||||
"integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA=="
|
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
||||||
},
|
},
|
||||||
"agent-base": {
|
"node_modules/ts-mixer": {
|
||||||
"version": "6.0.2",
|
"version": "6.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz",
|
||||||
"integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==",
|
"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/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.4.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.4.2.tgz",
|
||||||
|
"integrity": "sha512-Kbk4Nxyq7/ZWqr/tarI9yIt/+iNNFOjBXEWgTb4ydaNHBNGgvf2QHbS9fdfsndfjFlFwEd4Al+mw83YkaD10ZA==",
|
||||||
|
"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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/zod": {
|
||||||
|
"version": "3.11.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/zod/-/zod-3.11.6.tgz",
|
||||||
|
"integrity": "sha512-daZ80A81I3/9lIydI44motWe6n59kRBfNzTuS2bfzVh1nAXi667TOTWWtatxyG+fwgNUiagSj/CWZwRRbevJIg==",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/colinhacks"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@discordjs/builders": {
|
||||||
|
"version": "0.11.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.11.0.tgz",
|
||||||
|
"integrity": "sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"debug": "4"
|
"@sindresorhus/is": "^4.2.0",
|
||||||
|
"discord-api-types": "^0.26.0",
|
||||||
|
"ts-mixer": "^6.0.0",
|
||||||
|
"tslib": "^2.3.1",
|
||||||
|
"zod": "^3.11.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@discordjs/collection": {
|
||||||
|
"version": "0.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz",
|
||||||
|
"integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw=="
|
||||||
|
},
|
||||||
|
"@sapphire/async-queue": {
|
||||||
|
"version": "1.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.2.0.tgz",
|
||||||
|
"integrity": "sha512-O5ND5Ljpef86X5oy8zXorQ754TMjWALcPSAgPBu4+76HLtDTrNoDyzU2uGE2G4A8Wv51u0MXHzGQ0WZ4GMtpIw=="
|
||||||
|
},
|
||||||
|
"@sindresorhus/is": {
|
||||||
|
"version": "4.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.4.0.tgz",
|
||||||
|
"integrity": "sha512-QppPM/8l3Mawvh4rn9CNEYIU9bxpXUCRMaX9yUpvBk1nMKusLKpfXGDEKExKaPhLzcn3lzil7pR6rnJ11HgeRQ=="
|
||||||
|
},
|
||||||
|
"@types/node": {
|
||||||
|
"version": "17.0.13",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.13.tgz",
|
||||||
|
"integrity": "sha512-Y86MAxASe25hNzlDbsviXl8jQHb0RDvKt4c40ZJQ1Don0AAL0STLZSs4N+6gLEO55pedy7r2cLwS+ZDxPm/2Bw=="
|
||||||
|
},
|
||||||
|
"@types/node-fetch": {
|
||||||
|
"version": "2.5.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.5.12.tgz",
|
||||||
|
"integrity": "sha512-MKgC4dlq4kKNa/mYrwpKfzQMB5X3ee5U6fSprkKpToBqBmX4nFZL9cW5jl6sWn+xpRJ7ypWh2yyqqr8UUCstSw==",
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "*",
|
||||||
|
"form-data": "^3.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"form-data": {
|
||||||
|
"version": "3.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz",
|
||||||
|
"integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==",
|
||||||
|
"requires": {
|
||||||
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@types/ws": {
|
||||||
|
"version": "8.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz",
|
||||||
|
"integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==",
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"argparse": {
|
"argparse": {
|
||||||
@@ -81,11 +342,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
|
||||||
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k="
|
||||||
},
|
},
|
||||||
"browser-process-hrtime": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz",
|
|
||||||
"integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow=="
|
|
||||||
},
|
|
||||||
"combined-stream": {
|
"combined-stream": {
|
||||||
"version": "1.0.8",
|
"version": "1.0.8",
|
||||||
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||||
@@ -94,176 +350,42 @@
|
|||||||
"delayed-stream": "~1.0.0"
|
"delayed-stream": "~1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"cssom": {
|
|
||||||
"version": "0.4.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz",
|
|
||||||
"integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw=="
|
|
||||||
},
|
|
||||||
"cssstyle": {
|
|
||||||
"version": "2.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz",
|
|
||||||
"integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==",
|
|
||||||
"requires": {
|
|
||||||
"cssom": "~0.3.6"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"cssom": {
|
|
||||||
"version": "0.3.8",
|
|
||||||
"resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz",
|
|
||||||
"integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"data-urls": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==",
|
|
||||||
"requires": {
|
|
||||||
"abab": "^2.0.3",
|
|
||||||
"whatwg-mimetype": "^2.3.0",
|
|
||||||
"whatwg-url": "^8.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"debug": {
|
|
||||||
"version": "4.3.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz",
|
|
||||||
"integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==",
|
|
||||||
"requires": {
|
|
||||||
"ms": "2.1.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"decimal.js": {
|
|
||||||
"version": "10.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.3.1.tgz",
|
|
||||||
"integrity": "sha512-V0pfhfr8suzyPGOx3nmq4aHqabehUZn6Ch9kyFpV79TGDTWFmHqUqXdabR7QHqxzrYolF4+tVmJhUG4OURg5dQ=="
|
|
||||||
},
|
|
||||||
"deep-is": {
|
|
||||||
"version": "0.1.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz",
|
|
||||||
"integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ="
|
|
||||||
},
|
|
||||||
"delayed-stream": {
|
"delayed-stream": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
||||||
},
|
},
|
||||||
|
"discord-api-types": {
|
||||||
|
"version": "0.26.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz",
|
||||||
|
"integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ=="
|
||||||
|
},
|
||||||
"discord.js": {
|
"discord.js": {
|
||||||
"version": "12.5.3",
|
"version": "13.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.3.tgz",
|
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.6.0.tgz",
|
||||||
"integrity": "sha512-D3nkOa/pCkNyn6jLZnAiJApw2N9XrIsXUAdThf01i7yrEuqUmDGc7/CexVWwEcgbQR97XQ+mcnqJpmJ/92B4Aw==",
|
"integrity": "sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@discordjs/collection": "^0.1.6",
|
"@discordjs/builders": "^0.11.0",
|
||||||
"@discordjs/form-data": "^3.0.1",
|
"@discordjs/collection": "^0.4.0",
|
||||||
"abort-controller": "^3.0.0",
|
"@sapphire/async-queue": "^1.1.9",
|
||||||
|
"@types/node-fetch": "^2.5.12",
|
||||||
|
"@types/ws": "^8.2.2",
|
||||||
|
"discord-api-types": "^0.26.0",
|
||||||
|
"form-data": "^4.0.0",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"prism-media": "^1.2.9",
|
"ws": "^8.4.0"
|
||||||
"setimmediate": "^1.0.5",
|
|
||||||
"tweetnacl": "^1.0.3",
|
|
||||||
"ws": "^7.4.4"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"domexception": {
|
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==",
|
|
||||||
"requires": {
|
|
||||||
"webidl-conversions": "^5.0.0"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"webidl-conversions": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA=="
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"escodegen": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-mmHKys/C8BFUGI+MAWNcSYoORYLMdPzjrknd2Vc+bUsjN5bXcr8EhrNB+UTqfL1y3I9c4fw2ihgtMPQLBRiQxw==",
|
|
||||||
"requires": {
|
|
||||||
"esprima": "^4.0.1",
|
|
||||||
"estraverse": "^5.2.0",
|
|
||||||
"esutils": "^2.0.2",
|
|
||||||
"optionator": "^0.8.1",
|
|
||||||
"source-map": "~0.6.1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"esprima": {
|
|
||||||
"version": "4.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz",
|
|
||||||
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A=="
|
|
||||||
},
|
|
||||||
"estraverse": {
|
|
||||||
"version": "5.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz",
|
|
||||||
"integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ=="
|
|
||||||
},
|
|
||||||
"esutils": {
|
|
||||||
"version": "2.0.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
|
|
||||||
"integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g=="
|
|
||||||
},
|
|
||||||
"event-target-shim": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ=="
|
|
||||||
},
|
|
||||||
"fast-levenshtein": {
|
|
||||||
"version": "2.0.6",
|
|
||||||
"resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
|
|
||||||
"integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc="
|
|
||||||
},
|
|
||||||
"form-data": {
|
"form-data": {
|
||||||
"version": "3.0.1",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
||||||
"integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==",
|
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"asynckit": "^0.4.0",
|
"asynckit": "^0.4.0",
|
||||||
"combined-stream": "^1.0.8",
|
"combined-stream": "^1.0.8",
|
||||||
"mime-types": "^2.1.12"
|
"mime-types": "^2.1.12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"html-encoding-sniffer": {
|
|
||||||
"version": "2.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz",
|
|
||||||
"integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==",
|
|
||||||
"requires": {
|
|
||||||
"whatwg-encoding": "^1.0.5"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"http-proxy-agent": {
|
|
||||||
"version": "4.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz",
|
|
||||||
"integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==",
|
|
||||||
"requires": {
|
|
||||||
"@tootallnate/once": "1",
|
|
||||||
"agent-base": "6",
|
|
||||||
"debug": "4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"https-proxy-agent": {
|
|
||||||
"version": "5.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz",
|
|
||||||
"integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==",
|
|
||||||
"requires": {
|
|
||||||
"agent-base": "6",
|
|
||||||
"debug": "4"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"iconv-lite": {
|
|
||||||
"version": "0.4.24",
|
|
||||||
"resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
|
|
||||||
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
|
|
||||||
"requires": {
|
|
||||||
"safer-buffer": ">= 2.1.2 < 3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"is-potential-custom-element-name": {
|
|
||||||
"version": "1.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz",
|
|
||||||
"integrity": "sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ=="
|
|
||||||
},
|
|
||||||
"js-yaml": {
|
"js-yaml": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
||||||
@@ -272,248 +394,66 @@
|
|||||||
"argparse": "^2.0.1"
|
"argparse": "^2.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"jsdom": {
|
|
||||||
"version": "16.7.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz",
|
|
||||||
"integrity": "sha512-u9Smc2G1USStM+s/x1ru5Sxrl6mPYCbByG1U/hUmqaVsm4tbNyS7CicOSRyuGQYZhTu0h84qkZZQ/I+dzizSVw==",
|
|
||||||
"requires": {
|
|
||||||
"abab": "^2.0.5",
|
|
||||||
"acorn": "^8.2.4",
|
|
||||||
"acorn-globals": "^6.0.0",
|
|
||||||
"cssom": "^0.4.4",
|
|
||||||
"cssstyle": "^2.3.0",
|
|
||||||
"data-urls": "^2.0.0",
|
|
||||||
"decimal.js": "^10.2.1",
|
|
||||||
"domexception": "^2.0.1",
|
|
||||||
"escodegen": "^2.0.0",
|
|
||||||
"form-data": "^3.0.0",
|
|
||||||
"html-encoding-sniffer": "^2.0.1",
|
|
||||||
"http-proxy-agent": "^4.0.1",
|
|
||||||
"https-proxy-agent": "^5.0.0",
|
|
||||||
"is-potential-custom-element-name": "^1.0.1",
|
|
||||||
"nwsapi": "^2.2.0",
|
|
||||||
"parse5": "6.0.1",
|
|
||||||
"saxes": "^5.0.1",
|
|
||||||
"symbol-tree": "^3.2.4",
|
|
||||||
"tough-cookie": "^4.0.0",
|
|
||||||
"w3c-hr-time": "^1.0.2",
|
|
||||||
"w3c-xmlserializer": "^2.0.0",
|
|
||||||
"webidl-conversions": "^6.1.0",
|
|
||||||
"whatwg-encoding": "^1.0.5",
|
|
||||||
"whatwg-mimetype": "^2.3.0",
|
|
||||||
"whatwg-url": "^8.5.0",
|
|
||||||
"ws": "^7.4.6",
|
|
||||||
"xml-name-validator": "^3.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"levn": {
|
|
||||||
"version": "0.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz",
|
|
||||||
"integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=",
|
|
||||||
"requires": {
|
|
||||||
"prelude-ls": "~1.1.2",
|
|
||||||
"type-check": "~0.3.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"lodash": {
|
|
||||||
"version": "4.17.21",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz",
|
|
||||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg=="
|
|
||||||
},
|
|
||||||
"mime-db": {
|
"mime-db": {
|
||||||
"version": "1.48.0",
|
"version": "1.51.0",
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.48.0.tgz",
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz",
|
||||||
"integrity": "sha512-FM3QwxV+TnZYQ2aRqhlKBMHxk10lTbMt3bBkMAp54ddrNeVSfcQYOOKuGuy3Ddrm38I04If834fOUSq1yzslJQ=="
|
"integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g=="
|
||||||
},
|
},
|
||||||
"mime-types": {
|
"mime-types": {
|
||||||
"version": "2.1.31",
|
"version": "2.1.34",
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.31.tgz",
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz",
|
||||||
"integrity": "sha512-XGZnNzm3QvgKxa8dpzyhFTHmpP3l5YNusmne07VUOXxou9CqUqYa/HBy124RqtVh/O2pECas/MOcsDgpilPOPg==",
|
"integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"mime-db": "1.48.0"
|
"mime-db": "1.51.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ms": {
|
|
||||||
"version": "2.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
|
|
||||||
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
|
|
||||||
},
|
|
||||||
"node-fetch": {
|
"node-fetch": {
|
||||||
"version": "2.6.1",
|
"version": "2.6.7",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||||
"integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw=="
|
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||||
},
|
|
||||||
"nwsapi": {
|
|
||||||
"version": "2.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz",
|
|
||||||
"integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ=="
|
|
||||||
},
|
|
||||||
"optionator": {
|
|
||||||
"version": "0.8.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
|
|
||||||
"integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==",
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"deep-is": "~0.1.3",
|
"whatwg-url": "^5.0.0"
|
||||||
"fast-levenshtein": "~2.0.6",
|
|
||||||
"levn": "~0.3.0",
|
|
||||||
"prelude-ls": "~1.1.2",
|
|
||||||
"type-check": "~0.3.2",
|
|
||||||
"word-wrap": "~1.2.3"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"parse5": {
|
|
||||||
"version": "6.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz",
|
|
||||||
"integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw=="
|
|
||||||
},
|
|
||||||
"prelude-ls": {
|
|
||||||
"version": "1.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
|
|
||||||
"integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ="
|
|
||||||
},
|
|
||||||
"prism-media": {
|
|
||||||
"version": "1.3.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.3.1.tgz",
|
|
||||||
"integrity": "sha512-nyYAa3KB4qteJIqdguKmwxTJgy55xxUtkJ3uRnOvO5jO+frci+9zpRXw6QZVcfDeva3S654fU9+26P2OSTzjHw=="
|
|
||||||
},
|
|
||||||
"psl": {
|
|
||||||
"version": "1.8.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz",
|
|
||||||
"integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ=="
|
|
||||||
},
|
|
||||||
"punycode": {
|
|
||||||
"version": "2.1.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz",
|
|
||||||
"integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A=="
|
|
||||||
},
|
|
||||||
"safer-buffer": {
|
|
||||||
"version": "2.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
|
|
||||||
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
|
|
||||||
},
|
|
||||||
"saxes": {
|
|
||||||
"version": "5.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz",
|
|
||||||
"integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==",
|
|
||||||
"requires": {
|
|
||||||
"xmlchars": "^2.2.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"setimmediate": {
|
|
||||||
"version": "1.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz",
|
|
||||||
"integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU="
|
|
||||||
},
|
|
||||||
"source-map": {
|
|
||||||
"version": "0.6.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
|
||||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
|
||||||
"optional": true
|
|
||||||
},
|
|
||||||
"symbol-tree": {
|
|
||||||
"version": "3.2.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz",
|
|
||||||
"integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw=="
|
|
||||||
},
|
|
||||||
"tough-cookie": {
|
|
||||||
"version": "4.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-4.0.0.tgz",
|
|
||||||
"integrity": "sha512-tHdtEpQCMrc1YLrMaqXXcj6AxhYi/xgit6mZu1+EDWUn+qhUf8wMQoFIy9NXuq23zAwtcB0t/MjACGR18pcRbg==",
|
|
||||||
"requires": {
|
|
||||||
"psl": "^1.1.33",
|
|
||||||
"punycode": "^2.1.1",
|
|
||||||
"universalify": "^0.1.2"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tr46": {
|
"tr46": {
|
||||||
"version": "2.1.0",
|
"version": "0.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||||
"integrity": "sha512-15Ih7phfcdP5YxqiB+iDtLoaTz4Nd35+IiAv0kQ5FNKHzXgdWqPoTIqEDDJmXceQt4JZk6lVPT8lnDlPpGDppw==",
|
"integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o="
|
||||||
"requires": {
|
|
||||||
"punycode": "^2.1.1"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"tweetnacl": {
|
"ts-mixer": {
|
||||||
"version": "1.0.3",
|
"version": "6.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.0.tgz",
|
||||||
"integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw=="
|
"integrity": "sha512-nXIb1fvdY5CBSrDIblLn73NW0qRDk5yJ0Sk1qPBF560OdJfQp9jhl+0tzcY09OZ9U+6GpeoI9RjwoIKFIoB9MQ=="
|
||||||
},
|
},
|
||||||
"type-check": {
|
"tslib": {
|
||||||
"version": "0.3.2",
|
"version": "2.3.1",
|
||||||
"resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
"integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=",
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
"requires": {
|
|
||||||
"prelude-ls": "~1.1.2"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"universalify": {
|
|
||||||
"version": "0.1.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz",
|
|
||||||
"integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg=="
|
|
||||||
},
|
|
||||||
"w3c-hr-time": {
|
|
||||||
"version": "1.0.2",
|
|
||||||
"resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz",
|
|
||||||
"integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==",
|
|
||||||
"requires": {
|
|
||||||
"browser-process-hrtime": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"w3c-xmlserializer": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==",
|
|
||||||
"requires": {
|
|
||||||
"xml-name-validator": "^3.0.0"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"webidl-conversions": {
|
"webidl-conversions": {
|
||||||
"version": "6.1.0",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||||
"integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w=="
|
"integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE="
|
||||||
},
|
|
||||||
"whatwg-encoding": {
|
|
||||||
"version": "1.0.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz",
|
|
||||||
"integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==",
|
|
||||||
"requires": {
|
|
||||||
"iconv-lite": "0.4.24"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"whatwg-mimetype": {
|
|
||||||
"version": "2.3.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz",
|
|
||||||
"integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g=="
|
|
||||||
},
|
},
|
||||||
"whatwg-url": {
|
"whatwg-url": {
|
||||||
"version": "8.7.0",
|
"version": "5.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.7.0.tgz",
|
"resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz",
|
||||||
"integrity": "sha512-gAojqb/m9Q8a5IV96E3fHJM70AzCkgt4uXYX2O7EmuyOnLrViCQlsEBmF9UQIu3/aeAIp2U17rtbpZWNntQqdg==",
|
"integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=",
|
||||||
"requires": {
|
"requires": {
|
||||||
"lodash": "^4.7.0",
|
"tr46": "~0.0.3",
|
||||||
"tr46": "^2.1.0",
|
"webidl-conversions": "^3.0.0"
|
||||||
"webidl-conversions": "^6.1.0"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"word-wrap": {
|
|
||||||
"version": "1.2.3",
|
|
||||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
|
||||||
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ=="
|
|
||||||
},
|
|
||||||
"ws": {
|
"ws": {
|
||||||
"version": "7.5.1",
|
"version": "8.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-7.5.1.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.4.2.tgz",
|
||||||
"integrity": "sha512-2c6faOUH/nhoQN6abwMloF7Iyl0ZS2E9HGtsiLrWn0zOOMWlhtDmdf/uihDt6jnuCxgtwGBNy6Onsoy2s2O2Ow=="
|
"integrity": "sha512-Kbk4Nxyq7/ZWqr/tarI9yIt/+iNNFOjBXEWgTb4ydaNHBNGgvf2QHbS9fdfsndfjFlFwEd4Al+mw83YkaD10ZA==",
|
||||||
|
"requires": {}
|
||||||
},
|
},
|
||||||
"xml-name-validator": {
|
"zod": {
|
||||||
"version": "3.0.0",
|
"version": "3.11.6",
|
||||||
"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/zod/-/zod-3.11.6.tgz",
|
||||||
"integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw=="
|
"integrity": "sha512-daZ80A81I3/9lIydI44motWe6n59kRBfNzTuS2bfzVh1nAXi667TOTWWtatxyG+fwgNUiagSj/CWZwRRbevJIg=="
|
||||||
},
|
|
||||||
"xmlchars": {
|
|
||||||
"version": "2.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",
|
|
||||||
"integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw=="
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+14
-9
@@ -1,19 +1,24 @@
|
|||||||
{
|
{
|
||||||
"name": "supportbot",
|
"name": "supportbot",
|
||||||
"version": "7.1",
|
"version": "7.4.2",
|
||||||
"description": "SupportBot, a free open-source discord ticket application with ease of use.",
|
"description": "SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customization to match your own brand.",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"supportbot": "node index.js"
|
"start": "npm i && node index.js",
|
||||||
|
"test": "node index.js test"
|
||||||
|
},
|
||||||
|
"repository": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "git+https://github.com/Emerald-Services/SupportBot.git"
|
||||||
},
|
},
|
||||||
"keywords": [
|
|
||||||
"supportbot"
|
|
||||||
],
|
|
||||||
"author": "Emerald Services",
|
"author": "Emerald Services",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"bugs": {
|
||||||
|
"url": "https://github.com/Emerald-Services/SupportBot/issues"
|
||||||
|
},
|
||||||
|
"homepage": "https://github.com/Emerald-Services/SupportBot#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"discord.js": "^12.5.3",
|
"discord.js": "^13.6.0",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0"
|
||||||
"jsdom": "^16.7.0"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
{}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
ReactionMessage_ID: ''
|
|
||||||
@@ -1,300 +0,0 @@
|
|||||||
# ___ _ ___ _
|
|
||||||
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
|
||||||
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
|
||||||
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
|
||||||
# |_| |_|
|
|
||||||
#
|
|
||||||
# SupportBot created by Emerald Services
|
|
||||||
# Installed with MIT License
|
|
||||||
#
|
|
||||||
# Discord Support: https://emeraldsrv.dev/discord
|
|
||||||
|
|
||||||
SupportBot_Version: "7.1"
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# General Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
Token: "BOT_TOKEN_HERE"
|
|
||||||
Prefix: "!"
|
|
||||||
Bot_Name: "SupportBot"
|
|
||||||
|
|
||||||
DeleteMessages: true
|
|
||||||
# Should the bot delete command messages after executed?
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# Activity Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
BotActivity: "-help | SupportBot"
|
|
||||||
|
|
||||||
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 | The #1 Supportive Discord Bot"
|
|
||||||
|
|
||||||
ErrorColour: "#d12519"
|
|
||||||
SuccessColour: "#04b545"
|
|
||||||
WarningColour: "#fca117"
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# Help Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
HelpMenu: true # Do not change!
|
|
||||||
SendHelpPage: "channel" # Set to channel or dm
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# Role Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
AutoRole: true
|
|
||||||
AutoRole_Role: "Member"
|
|
||||||
LockdownRole: "@everyone"
|
|
||||||
|
|
||||||
Staff: "Staff"
|
|
||||||
Admin: "Admin"
|
|
||||||
TicketBlackListRole: "Blacklisted"
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# Tickets Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
# --- General Config ---
|
|
||||||
# --- Start ---
|
|
||||||
|
|
||||||
TicketCategory: "▬▬ TICKETS ▬▬"
|
|
||||||
TicketChannel: "ticket"
|
|
||||||
|
|
||||||
TicketLog: "ticket-logs"
|
|
||||||
TranscriptLog: "transcripts"
|
|
||||||
|
|
||||||
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.
|
|
||||||
|
|
||||||
# --- Panel Config ---
|
|
||||||
# --- Start ---
|
|
||||||
|
|
||||||
ReactionChannel: "create-ticket"
|
|
||||||
ReactionEmoji: "📩"
|
|
||||||
# For cusomt emojis: <:emoji_name:EMOJI_ID>
|
|
||||||
|
|
||||||
ReactionTickets: true
|
|
||||||
ReactionMessage: "React with %reaction_emoji% to create a Support Ticket!"
|
|
||||||
|
|
||||||
ReactionPanel_Description: true
|
|
||||||
ReactionDescription: "Create a support ticket to contact a member of staff."
|
|
||||||
|
|
||||||
ReactionPanel_Thumbnail: true
|
|
||||||
ReactionThumbnail: "https://hotemoji.com/images/dl/5/ticket-emoji-by-twitter.png"
|
|
||||||
|
|
||||||
ReactionPanel_Image: true
|
|
||||||
ReactionImage: "https://wallpapercave.com/wp/wp4462546.jpg"
|
|
||||||
|
|
||||||
# --- 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"
|
|
||||||
|
|
||||||
|
|
||||||
TicketLockReaction: "🔒"
|
|
||||||
TicketDeleteReaction: "⛔"
|
|
||||||
|
|
||||||
TranscriptSavedMessage: "📝 **Transcript Saved!**"
|
|
||||||
TicketLockMessage: "❌ **Ticket Locked!**"
|
|
||||||
TicketDeleteMessage: "⚠ **Ticket Deleting!**" # Tickets deleting after 5 seconds by default.
|
|
||||||
TicketDeleteTime: 5000 # Time must be set in miliseconds.
|
|
||||||
|
|
||||||
# --- Closing Config ---
|
|
||||||
# --- Start ---
|
|
||||||
|
|
||||||
ClosingTicket: ":warning: You have requested to close your support ticket."
|
|
||||||
ClosingConfirmation_Word: "confirm"
|
|
||||||
CloseConfirmation: true
|
|
||||||
|
|
||||||
# --------------------------------
|
|
||||||
# System Messages Configuration
|
|
||||||
# --------------------------------
|
|
||||||
|
|
||||||
# Available Placeholders:
|
|
||||||
# %guildname% - This displays the name of the discord server.
|
|
||||||
|
|
||||||
SystemMessages: true
|
|
||||||
SystemMessage_EmbedFooter: false
|
|
||||||
|
|
||||||
SystemMessage_Channel: "system-messages"
|
|
||||||
SystemMessage_Type: "embed"
|
|
||||||
# There are 2 types of how you can send system messages, 'normal' or 'embed'
|
|
||||||
|
|
||||||
SystemMessage_Icon: "USER"
|
|
||||||
# USER - This will display the user's icon of who joins.
|
|
||||||
# BOT - This will display the bot's icon when a someone joins.
|
|
||||||
# CUSTOM - This will allow you to use a custom image, set this below!
|
|
||||||
SystemMessageIcon_URL: "https://imgur.com/example.png"
|
|
||||||
|
|
||||||
Welcome_Title: "User Joined!"
|
|
||||||
WelcomeMessage: "Hello %member%, Welcome to %guildname%!"
|
|
||||||
# %member% define the user who joined and %guildnamne% defines the server name.
|
|
||||||
|
|
||||||
Leave_Title: "User Left!"
|
|
||||||
LeaveMessage: "Goodbye %member%, Thank you for visting %guildname%!"
|
|
||||||
# %member% define the user who left and %guildnamne% defines the server name.
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# Links Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
LinksTitle: "Server Links"
|
|
||||||
|
|
||||||
LINKS:
|
|
||||||
"Website": "https://www.example.com"
|
|
||||||
"Store": "https://store.example.com"
|
|
||||||
"Discord": "https://discord.gg/example"
|
|
||||||
# "Twitter": "https://twitter.com/example"
|
|
||||||
# "Add More": "Just follow this format!"
|
|
||||||
|
|
||||||
# --------------------------
|
|
||||||
# Suggestion Configuration
|
|
||||||
# --------------------------
|
|
||||||
|
|
||||||
SuggestionChannel: "suggestions"
|
|
||||||
SuggestionTitle: "Suggestion"
|
|
||||||
|
|
||||||
SuggestionStarter: "What would you like to suggest?"
|
|
||||||
SuggestReact_1: 👍
|
|
||||||
SuggestReact_2: 👎
|
|
||||||
|
|
||||||
SuggestionMessage_Icon: "USER"
|
|
||||||
# USER - This will display the user's icon of who joins.
|
|
||||||
# BOT - This will display the bot's icon when a someone joins.
|
|
||||||
# CUSTOM - This will allow you to use a custom image, set this below!
|
|
||||||
SuggestionIcon_URL: "https://imgur.com/example.png"
|
|
||||||
|
|
||||||
# ----------------------------
|
|
||||||
# Announcement Configuration
|
|
||||||
# ----------------------------
|
|
||||||
|
|
||||||
AnnouncementChannel: "announcements"
|
|
||||||
AnnouncementTitle: "Servername Announcement"
|
|
||||||
AnnouncementIcon: "https://i.imgur.com/HbkZyB7.png"
|
|
||||||
|
|
||||||
AnnouncementStarter: "What would you like to announce?"
|
|
||||||
|
|
||||||
# --------------------------
|
|
||||||
# Moderation Configuration
|
|
||||||
# --------------------------
|
|
||||||
|
|
||||||
ChatLog_Title: "Chat Log"
|
|
||||||
ChatLogChannel: "chat-logs"
|
|
||||||
ChatLogColour: "#1BA30C"
|
|
||||||
ChatLog_Thumbnail: "https://cdn.iconscout.com/icon/free/png-256/chat-2639493-2187526.png"
|
|
||||||
ChatLogSavedMessage: "📝 **Channel Transcript Saved!**"
|
|
||||||
|
|
||||||
BanTitle: "User Banned!"
|
|
||||||
DaysBannedFor: 7
|
|
||||||
BanLogColour: "#D911B4"
|
|
||||||
|
|
||||||
KickTitle: "User Kicked!"
|
|
||||||
KickLogColour: "#D9B111"
|
|
||||||
|
|
||||||
ModThumbnail: "https://i.imgur.com/l6P3DF6.png"
|
|
||||||
ModLogChannel: "mod-logs"
|
|
||||||
|
|
||||||
PruneLogTitle: "Bulk Delete"
|
|
||||||
PruneThumbnail: "https://i.imgur.com/OAgW2vR.png"
|
|
||||||
PruneColour: "#1BA30C"
|
|
||||||
|
|
||||||
BlacklistTitle: "Blacklisted User"
|
|
||||||
BlacklistColour: "#000000"
|
|
||||||
|
|
||||||
# --------------------------
|
|
||||||
# Command Configuration
|
|
||||||
# --------------------------
|
|
||||||
|
|
||||||
# --- User Commands ---
|
|
||||||
|
|
||||||
HelpCommand: "help"
|
|
||||||
LinksCommand: "links"
|
|
||||||
PingCommand: "ping"
|
|
||||||
SuggestCommand: "suggest"
|
|
||||||
|
|
||||||
# --- Ticket Commands ---
|
|
||||||
|
|
||||||
NewTicket: "ticket"
|
|
||||||
CloseTicket: "close"
|
|
||||||
AddUser: "add"
|
|
||||||
RemoveUser: "remove"
|
|
||||||
RenameTicket: "rename"
|
|
||||||
|
|
||||||
# --- Staff/Admin Commands ---
|
|
||||||
|
|
||||||
ChatLog: "transcript"
|
|
||||||
BotSay: "say"
|
|
||||||
PurgeMessage: "purge"
|
|
||||||
|
|
||||||
AnnounceCommand: "announce"
|
|
||||||
BanUser: "ban"
|
|
||||||
KickUser: "kick"
|
|
||||||
BlacklistUser: "blacklist"
|
|
||||||
|
|
||||||
# --------------------------
|
|
||||||
# Messages Configuration
|
|
||||||
# --------------------------
|
|
||||||
|
|
||||||
# --- Command Messages ---
|
|
||||||
|
|
||||||
BotSayDesc: "Say something with the bot"
|
|
||||||
ChatLogDesc: "Get a transcript of a channel"
|
|
||||||
NewTicketDesc: "Create a new support ticket"
|
|
||||||
AnnounceDesc: "Create a server announcement"
|
|
||||||
CloseTicketDesc: "Close your support ticket"
|
|
||||||
LinksDesc: "View some important links"
|
|
||||||
PingDesc: "Get the bot's latency"
|
|
||||||
HelpDesc: "Get a list of all the commands"
|
|
||||||
RemoveUserDesc: "Remove a user from a support ticket"
|
|
||||||
AddUserDesc: "Add a user to a support ticket"
|
|
||||||
SuggestionDesc: "Create a server suggestion"
|
|
||||||
BanDesc: "Ban a member from this server."
|
|
||||||
KickDesc: "Kick a member from this server."
|
|
||||||
PurgeDesc: "Purge messages from the chat."
|
|
||||||
BlacklistDesc: "Decline a member to open a ticket"
|
|
||||||
|
|
||||||
# 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. This command is used when closing a ticket."
|
|
||||||
TicketExists: ":warning: This ticket cannot be opened, It already exists!"
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
// SupportBot Utils
|
|
||||||
// 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/TicketID.json", "utf8"));
|
|
||||||
|
|
||||||
if (!ticketnumberID[guildId]) {
|
|
||||||
ticketnumberID[guildId] = {
|
|
||||||
id: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.writeFileSync("./storage/TicketID.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/TicketID.json", "utf8"));
|
|
||||||
|
|
||||||
ticketnumberID[guildId] = {
|
|
||||||
id: value
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.writeFileSync("./storage/TicketID.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
|
||||||
if (err) console.log(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
static reset(guildId) {
|
|
||||||
let ticketnumberID = JSON.parse(fs.readFileSync("./storage/TicketID.json", "utf8"));
|
|
||||||
|
|
||||||
ticketnumberID[guildId] = {
|
|
||||||
id: 0
|
|
||||||
}
|
|
||||||
|
|
||||||
fs.writeFileSync("./storage/TicketID.json", JSON.stringify(ticketnumberID, null, 4), err => {
|
|
||||||
if (err) console.log(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = TicketNumberID;
|
|
||||||
Reference in new issue
Block a user