Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
213f532a3c | ||
|
|
45bd88e4d2 | ||
|
|
4eb8658459 | ||
|
|
b37118fee2 | ||
|
|
026caba68a | ||
|
|
2003f8801a | ||
|
|
473bacf13a | ||
|
|
8b3f2bc61a | ||
|
|
3aa373c33c | ||
|
|
9b6263e583 | ||
|
|
3e066d08ce | ||
|
|
aa48e28162 | ||
|
|
dc660ed94a | ||
|
|
e02ecf9553 | ||
|
|
23acc0926f | ||
|
|
3fc1cd18d5 | ||
|
|
ebe29b403e | ||
|
|
dcba3312dd | ||
|
|
7fddeeec37 | ||
|
|
b5341b023f | ||
|
|
bbb7443ef2 | ||
|
|
22df347bb9 | ||
|
|
9aed6b8f35 | ||
|
|
9e7ec9f1bd | ||
|
|
373f43eac5 | ||
|
|
6c91b2791a | ||
|
|
bde62a431f | ||
|
|
615a074540 | ||
|
|
09b335ac46 | ||
|
|
2701880c77 | ||
|
|
24c8f2fb38 | ||
|
|
c3ec158ac3 | ||
|
|
b3690222d0 | ||
|
|
4d7583785b | ||
|
|
17ad1a15db | ||
|
|
4c89de9e76 | ||
|
|
5f25af41f9 | ||
|
|
3a3ee357fc | ||
|
|
08a6d27903 | ||
|
|
33f7675aac | ||
|
|
1178a0a611 | ||
|
|
96ded77bec | ||
|
|
e83ca8cb2b | ||
|
|
e507176d39 | ||
|
|
4e554b8bee | ||
|
|
bc649caa99 | ||
|
|
f7a4c7b616 | ||
|
|
2c7be5882c | ||
|
|
6107d268f7 | ||
|
|
7760699155 | ||
|
|
acf349c72e | ||
|
|
8096e5b882 | ||
|
|
873cfc7dc2 | ||
|
|
038174bc7e | ||
|
|
14881096bb | ||
|
|
ed1905d8f4 | ||
|
|
72c0a2efa3 | ||
|
|
e599d48713 | ||
|
|
7f44634d4f | ||
|
|
44170caac6 | ||
|
|
adedfadd92 | ||
|
|
6b01d0c8fe | ||
|
|
d4d96f59ab | ||
|
|
a1bf7ed6bd | ||
|
|
306e20efc9 | ||
|
|
f593f6e0a8 | ||
|
|
74646a4318 | ||
|
|
8bfcba8832 | ||
|
|
4ba5621a4d | ||
|
|
1f928324c2 | ||
|
|
3771872cd2 | ||
|
|
f359a60343 | ||
|
|
f53afd7bc9 | ||
|
|
e7dcc2ab29 | ||
|
|
0118b9e591 | ||
|
|
ffe42f9777 | ||
|
|
5a467599e9 | ||
|
|
c56e78484a | ||
|
|
1ee0d4a09e | ||
|
|
ffdce5820b | ||
|
|
9fed504f37 | ||
|
|
6c5799be0d | ||
|
|
b6747a0340 | ||
|
|
cd6df02e30 | ||
|
|
edbef6a36f | ||
|
|
b6a0016f5f | ||
|
|
e740c17837 | ||
|
|
7eb949f109 | ||
|
|
02394e310d | ||
|
|
ef83832819 | ||
|
|
a82101ab30 | ||
|
|
007c78930e | ||
|
|
300c83512c | ||
|
|
b674872c56 | ||
|
|
12a7680275 | ||
|
|
c9cf7c942b | ||
|
|
8e0326c8f8 | ||
|
|
13972119a8 | ||
|
|
acf165a119 |
No files matched your search
@@ -3,8 +3,7 @@ name: "\U0001F41B Bug report"
|
|||||||
about: Create a report to help us improve
|
about: Create a report to help us improve
|
||||||
title: "[BUG]"
|
title: "[BUG]"
|
||||||
labels: Bug
|
labels: Bug
|
||||||
assignees: ''
|
assignees: ""
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Describe the bug**
|
**Describe the bug**
|
||||||
@@ -12,6 +11,7 @@ A clear and concise description of what the bug is.
|
|||||||
|
|
||||||
**To Reproduce**
|
**To Reproduce**
|
||||||
Steps to reproduce the behavior:
|
Steps to reproduce the behavior:
|
||||||
|
|
||||||
1. Go to '...'
|
1. Go to '...'
|
||||||
2. Click on '....'
|
2. Click on '....'
|
||||||
3. Scroll down to '....'
|
3. Scroll down to '....'
|
||||||
@@ -24,15 +24,17 @@ A clear and concise description of what you expected to happen.
|
|||||||
If applicable, add screenshots to help explain your problem.
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
**Desktop (please complete the following information):**
|
**Desktop (please complete the following information):**
|
||||||
- OS: [e.g. iOS]
|
|
||||||
- Browser [e.g. chrome, safari]
|
- OS: [e.g. iOS]
|
||||||
- Version [e.g. 22]
|
- Browser [e.g. chrome, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
**Smartphone (please complete the following information):**
|
**Smartphone (please complete the following information):**
|
||||||
- Device: [e.g. iPhone6]
|
|
||||||
- OS: [e.g. iOS8.1]
|
- Device: [e.g. iPhone6]
|
||||||
- Browser [e.g. stock browser, safari]
|
- OS: [e.g. iOS8.1]
|
||||||
- Version [e.g. 22]
|
- Browser [e.g. stock browser, safari]
|
||||||
|
- Version [e.g. 22]
|
||||||
|
|
||||||
**Additional context**
|
**Additional context**
|
||||||
Add any other context about the problem here.
|
Add any other context about the problem here.
|
||||||
@@ -3,8 +3,7 @@ name: "❓Suggest an Idea?"
|
|||||||
about: Suggest an idea for SupportBot?
|
about: Suggest an idea for SupportBot?
|
||||||
title: "[SUGGESTION]"
|
title: "[SUGGESTION]"
|
||||||
labels: Suggestion
|
labels: Suggestion
|
||||||
assignees: ''
|
assignees: ""
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
# 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:
|
||||||
@@ -15,7 +15,7 @@ jobs:
|
|||||||
|
|
||||||
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:
|
||||||
@@ -25,7 +25,4 @@ jobs:
|
|||||||
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
|
|
||||||
+30
-18
@@ -10,24 +10,36 @@ const supportbot = yaml.load(
|
|||||||
);
|
);
|
||||||
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
// Your Addon Config file! Saved in /Addons/Settings/YourAddonConfig.yml
|
// Your Addon Config file! Saved in /Addons/Configs/YourAddonConfig.yml
|
||||||
// const exampleaddon = yaml.load(fs.readFileSync('./Addons/Settings/YourAddonConfig.yml', 'utf8'));
|
// const config = yaml.load(fs.readFileSync('./Addons/Configs/YourAddonConfig.yml', 'utf8'));
|
||||||
|
|
||||||
const Command = require("../Structures/Command.js");
|
const { Command, Event } = require("../Structures/Addon");
|
||||||
|
|
||||||
module.exports = new Command({
|
module.exports.commands = [
|
||||||
name: "hello",
|
/*
|
||||||
description: "hello",
|
// EXAMPLE COMMAND
|
||||||
slashCommandOptions: [],
|
new Command({
|
||||||
permission: "SEND_MESSAGES",
|
name: "hello",
|
||||||
|
description: "hello",
|
||||||
|
options: [],
|
||||||
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
async run(interaction) {
|
||||||
|
const Embed = new Discord.MessageEmbed()
|
||||||
|
.setDescription("Hello World!")
|
||||||
|
.setColor(supportbot.InfoColour);
|
||||||
|
|
||||||
async run(interaction) {
|
interaction.reply({
|
||||||
const Embed = new Discord.MessageEmbed()
|
embeds: [Embed],
|
||||||
.setDescription("Hello World!")
|
});
|
||||||
.setColor(supportbot.InfoColour);
|
},
|
||||||
|
}),
|
||||||
interaction.reply({
|
*/
|
||||||
embeds: [Embed],
|
];
|
||||||
});
|
module.exports.events = [
|
||||||
},
|
/*
|
||||||
});
|
// EXAMPLE EVENT
|
||||||
|
new Event("ready", async (client) => {
|
||||||
|
console.log("Bot started!");
|
||||||
|
}),
|
||||||
|
*/
|
||||||
|
];
|
||||||
+52
-55
@@ -12,16 +12,10 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
|||||||
|
|
||||||
const Command = require("../Structures/Command.js");
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
async function asyncForEach(array, callback) {
|
|
||||||
for (let index = 0; index < array.length; index++) {
|
|
||||||
await callback(array[index], index, array);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.TicketAdd,
|
name: cmdconfig.TicketAdd,
|
||||||
description: cmdconfig.TicketAddDesc,
|
description: cmdconfig.TicketAddDesc,
|
||||||
slashCommandOptions: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "user",
|
name: "user",
|
||||||
description: "User to add",
|
description: "User to add",
|
||||||
@@ -29,22 +23,15 @@ module.exports = new Command({
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let SupportStaff =
|
const { getRole } = interaction.client;
|
||||||
interaction.guild.roles.cache.find(
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
(SupportTeam) => SupportTeam.name === supportbot.Staff
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
) ||
|
if (!SupportStaff || !Admin)
|
||||||
interaction.guild.roles.cache.find(
|
return interaction.reply(
|
||||||
(SupportTeam) => SupportTeam.id === supportbot.Staff
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
);
|
|
||||||
let Admins =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const NoPerms = new Discord.MessageEmbed()
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
@@ -55,41 +42,51 @@ module.exports = new Command({
|
|||||||
.setColor(supportbot.WarningColour);
|
.setColor(supportbot.WarningColour);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
interaction.member.roles.cache.has(SupportStaff.id) ||
|
!interaction.member.roles.cache.has(SupportStaff.id) &&
|
||||||
interaction.member.roles.cache.has(Admins.id)
|
!interaction.member.roles.cache.has(Admin.id)
|
||||||
) {
|
)
|
||||||
if (!interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
|
|
||||||
const Exists = new Discord.MessageEmbed()
|
|
||||||
.setTitle("No Ticket Found!")
|
|
||||||
.setDescription(`${supportbot.NoValidTicket}`)
|
|
||||||
.setColor(supportbot.WarningColour);
|
|
||||||
return interaction.reply({ embeds: [Exists] });
|
|
||||||
}
|
|
||||||
|
|
||||||
let uMember = interaction.options.getUser("user");
|
|
||||||
const UserNotExist = new Discord.MessageEmbed()
|
|
||||||
.setTitle("User Not Found!")
|
|
||||||
.setDescription(
|
|
||||||
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.TicketAdd} <user#0000>\``
|
|
||||||
)
|
|
||||||
.setColor(supportbot.ErrorColour);
|
|
||||||
|
|
||||||
if (!uMember) return interaction.reply({ embeds: [UserNotExist] });
|
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.edit(uMember, {
|
|
||||||
VIEW_CHANNEL: true,
|
|
||||||
READ_MESSAGE_HISTORY: true,
|
|
||||||
SEND_MESSAGES: true,
|
|
||||||
});
|
|
||||||
|
|
||||||
const Complete = new Discord.MessageEmbed()
|
|
||||||
.setTitle("User Added!")
|
|
||||||
.setDescription(supportbot.AddedUser.replace(/%user%/g, uMember.id))
|
|
||||||
.setTimestamp()
|
|
||||||
.setColor(supportbot.EmbedColour);
|
|
||||||
interaction.reply({ embeds: [Complete] });
|
|
||||||
} else {
|
|
||||||
return interaction.reply({ embeds: [NoPerms] });
|
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);
|
||||||
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
+156
-188
@@ -11,35 +11,67 @@ const supportbot = yaml.load(
|
|||||||
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
const Command = require("../Structures/Command.js");
|
const Command = require("../Structures/Command.js");
|
||||||
const TicketNumberID = require("../Structures/TicketID.js");
|
|
||||||
|
|
||||||
async function asyncForEach(array, callback) {
|
|
||||||
for (let index = 0; index < array.length; index++) {
|
|
||||||
await callback(array[index], index, array);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.CloseTicket,
|
name: cmdconfig.CloseTicket,
|
||||||
description: cmdconfig.CloseTicketDesc,
|
description: cmdconfig.CloseTicketDesc,
|
||||||
slashCommandOptions: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "reason",
|
name: "reason",
|
||||||
description: "Ticket Close Reason",
|
description: "Ticket Close Reason",
|
||||||
type: "STRING",
|
type: "STRING",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
if (!interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
|
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()
|
const Exists = new Discord.MessageEmbed()
|
||||||
.setTitle("No Ticket Found!")
|
.setTitle("No Ticket Found!")
|
||||||
.setDescription(`${supportbot.NoValidTicket}`)
|
.setDescription(supportbot.NoValidTicket)
|
||||||
.setColor(supportbot.WarningColour);
|
.setColor(supportbot.WarningColour);
|
||||||
return interaction.reply({ embed: Exists });
|
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) {
|
if (supportbot.CloseConfirmation) {
|
||||||
const CloseTicketRequest = new Discord.MessageEmbed()
|
const CloseTicketRequest = new Discord.MessageEmbed()
|
||||||
.setTitle(`**${supportbot.ClosingTicket}**`)
|
.setTitle(`**${supportbot.ClosingTicket}**`)
|
||||||
@@ -47,185 +79,121 @@ module.exports = new Command({
|
|||||||
`Please confirm by repeating the following word.. \`${supportbot.ClosingConfirmation_Word}\` `
|
`Please confirm by repeating the following word.. \`${supportbot.ClosingConfirmation_Word}\` `
|
||||||
)
|
)
|
||||||
.setColor(supportbot.EmbedColour);
|
.setColor(supportbot.EmbedColour);
|
||||||
|
await interaction.followUp({ embeds: [CloseTicketRequest] });
|
||||||
interaction
|
let filter = (m) =>
|
||||||
.reply(CloseTicketRequest)
|
m.content.toLowerCase() === supportbot.ClosingConfirmation_Word &&
|
||||||
.then((m) => {
|
m.author.id === interaction.user.id;
|
||||||
interaction.channel
|
await interaction.channel.awaitMessages({
|
||||||
.awaitMessages(
|
filter,
|
||||||
(response) =>
|
max: 1,
|
||||||
response.content.toLowerCase() ===
|
time: 20000,
|
||||||
supportbot.ClosingConfirmation_Word,
|
errors: ["time"],
|
||||||
{
|
});
|
||||||
max: 1,
|
|
||||||
time: 20000,
|
|
||||||
errors: ["time"],
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.then((collected) => {
|
|
||||||
let logChannel =
|
|
||||||
interaction.guild.channels.cache.find(
|
|
||||||
(channel) => channel.name === supportbot.TranscriptLog
|
|
||||||
) ||
|
|
||||||
interaction.guild.channels.cache.find(
|
|
||||||
(channel) => channel.id === supportbot.TranscriptLog
|
|
||||||
);
|
|
||||||
let user = interaction.user;
|
|
||||||
let reason =
|
|
||||||
interaction.options.getString("reason") ||
|
|
||||||
"No Reason Provided.";
|
|
||||||
|
|
||||||
let name = interaction.channel.name;
|
|
||||||
let ticketChannel = interaction.channel;
|
|
||||||
|
|
||||||
interaction
|
|
||||||
.reply(`**${supportbot.ClosingTicket}**`)
|
|
||||||
|
|
||||||
.then(() => {
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.TranscriptTitle)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.addField("Closed By", interaction.user.tag)
|
|
||||||
.addField("Reason", reason);
|
|
||||||
|
|
||||||
interaction.channel.interactions
|
|
||||||
.fetch({ limit: 100 })
|
|
||||||
.then((msgs) => {
|
|
||||||
let html = "";
|
|
||||||
|
|
||||||
msgs = msgs.sort(
|
|
||||||
(a, b) => a.createdTimestamp - b.createdTimestamp
|
|
||||||
);
|
|
||||||
html += `<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> ${ticketChannel.name}<br>`;
|
|
||||||
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
|
||||||
|
|
||||||
msgs.forEach((msg) => {
|
|
||||||
if (msg.content) {
|
|
||||||
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
|
|
||||||
html += `<strong>Message:</strong> ${msg.content}<br>`;
|
|
||||||
html += `-----<br><br>`;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
logChannel.send({ embeds: [logEmbed] }).catch((err) => {
|
|
||||||
interaction.reply(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
let file = new Discord.MessageAttachment(
|
|
||||||
Buffer.from(html),
|
|
||||||
`${name}.html`
|
|
||||||
);
|
|
||||||
logChannel
|
|
||||||
.send({ embeds: [logEmbed], files: [file] })
|
|
||||||
.catch((err) => {
|
|
||||||
interaction.reply(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
interaction.channel.delete().catch((error) => {
|
|
||||||
if (
|
|
||||||
error.code !==
|
|
||||||
Discord.Constants.APIErrors.UNKNOWN_CHANNEL
|
|
||||||
) {
|
|
||||||
console.error(
|
|
||||||
"Failed to delete the interaction:",
|
|
||||||
error
|
|
||||||
);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
interaction
|
|
||||||
.followUp({
|
|
||||||
content: "The request to close the ticket has timed out.",
|
|
||||||
})
|
|
||||||
.then((m2) => setTimeout(() => interaction.channel.delete(3000)));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
if (!supportbot.CloseConfirmation) {
|
tickets.tickets[TicketData].open = false;
|
||||||
let logChannel =
|
fs.writeFileSync(
|
||||||
interaction.guild.channels.cache.find(
|
"./Data/TicketData.json",
|
||||||
(channel) => channel.name === supportbot.TranscriptLog
|
JSON.stringify(tickets, null, 4),
|
||||||
) ||
|
(err) => {
|
||||||
interaction.guild.channels.cache.find(
|
if (err) console.error(err);
|
||||||
(channel) => channel.id === supportbot.TranscriptLog
|
}
|
||||||
);
|
);
|
||||||
let user = interaction.user;
|
await interaction.followUp(`**${supportbot.ClosingTicket}**`);
|
||||||
let reason =
|
const transcriptEmbed = new Discord.MessageEmbed()
|
||||||
(await interaction.options.getString("reason")) ||
|
.setTitle(supportbot.TranscriptTitle)
|
||||||
"No Reason Provided.";
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setFooter({
|
||||||
let name = interaction.channel.name;
|
text: supportbot.EmbedFooter,
|
||||||
let ticketChannel = interaction.channel;
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
|
||||||
interaction
|
|
||||||
.reply(`**${supportbot.ClosingTicket}**`)
|
|
||||||
|
|
||||||
.then(() => {
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.TranscriptTitle)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.addField("Closed By", interaction.user.tag)
|
|
||||||
.addField("Reason", reason);
|
|
||||||
|
|
||||||
interaction.channel.interactions
|
|
||||||
.fetch({ limit: 100 })
|
|
||||||
.then((msgs) => {
|
|
||||||
let html = "";
|
|
||||||
|
|
||||||
msgs = msgs.sort(
|
|
||||||
(a, b) => a.createdTimestamp - b.createdTimestamp
|
|
||||||
);
|
|
||||||
html += `<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> ${ticketChannel.name}<br>`;
|
|
||||||
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
|
||||||
|
|
||||||
msgs.forEach((msg) => {
|
|
||||||
if (msg.content) {
|
|
||||||
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
|
|
||||||
html += `<strong>Message:</strong> ${msg.content}<br>`;
|
|
||||||
html += `-----<br><br>`;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
logChannel.send({ embeds: [logEmbed] }).catch((err) => {
|
|
||||||
interaction.reply(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
let file = new Discord.MessageAttachment(
|
|
||||||
Buffer.from(html),
|
|
||||||
`${name}.html`
|
|
||||||
);
|
|
||||||
logChannel
|
|
||||||
.send({ embeds: [logEmbed], files: [file] })
|
|
||||||
.catch((err) => {
|
|
||||||
interaction.reply(err);
|
|
||||||
});
|
|
||||||
|
|
||||||
interaction.channel.delete().catch((error) => {
|
|
||||||
if (
|
|
||||||
error.code !== Discord.Constants.APIErrors.UNKNOWN_CHANNEL
|
|
||||||
) {
|
|
||||||
console.error("Failed to delete the interaction:", error);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.addField(
|
||||||
interaction
|
"Ticket",
|
||||||
.followUp({
|
`${interaction.channel.name} (${interaction.channel.id})`
|
||||||
content: "The request to close the ticket has timed out.",
|
)
|
||||||
})
|
.addField(
|
||||||
.then((m2) => setTimeout(() => interaction.channel.delete(3000)));
|
"User",
|
||||||
|
`${tUser?.username || "N/A"}#${tUser?.discriminator || "N/A"} (${
|
||||||
|
tUser?.id || ticket.user
|
||||||
|
})`
|
||||||
|
)
|
||||||
|
.addField("Closed By", interaction.user.tag)
|
||||||
|
.addField("Reason", reason);
|
||||||
|
const logEmbed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(supportbot.TicketLog_Title)
|
||||||
|
.setColor(supportbot.EmbedColour)
|
||||||
|
.setFooter({
|
||||||
|
text: supportbot.EmbedFooter,
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
})
|
||||||
|
.addField(
|
||||||
|
"Ticket",
|
||||||
|
`${interaction.channel.name} (${interaction.channel.id})`
|
||||||
|
)
|
||||||
|
.addField(
|
||||||
|
"User",
|
||||||
|
`${tUser?.username || "N/A"}#${tUser?.discriminator || "N/A"} (${
|
||||||
|
tUser?.id || ticket.user
|
||||||
|
})`
|
||||||
|
)
|
||||||
|
.addField("Closed By", interaction.user.tag)
|
||||||
|
.addField("Reason", reason);
|
||||||
|
let msgs = await interaction.channel.messages.fetch({ limit: 100 });
|
||||||
|
let html = "";
|
||||||
|
|
||||||
|
msgs = msgs.sort((a, b) => a.createdTimestamp - b.createdTimestamp);
|
||||||
|
html += `<style>* {background-color: #2c2f33;color: #fff;font-family: Arial, Helvetica, sans-serif;}</style>`;
|
||||||
|
html += `<strong>Server Name:</strong> ${interaction.guild.name}<br>`;
|
||||||
|
html += `<strong>Ticket:</strong> ${interaction.channel.name}<br>`;
|
||||||
|
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
||||||
|
|
||||||
|
await msgs.forEach((msg) => {
|
||||||
|
if (msg.content) {
|
||||||
|
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
|
||||||
|
html += `<strong>Message:</strong> ${msg.content}<br>`;
|
||||||
|
html += `-----<br><br>`;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await logChannel.send({ embeds: [logEmbed] }).catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
|
||||||
|
let file = new Discord.MessageAttachment(
|
||||||
|
Buffer.from(html),
|
||||||
|
`${interaction.channel.name}.html`
|
||||||
|
);
|
||||||
|
await transcriptChannel
|
||||||
|
.send({ embeds: [transcriptEmbed], files: [file] })
|
||||||
|
.catch(async (err) => {
|
||||||
|
console.error(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (supportbot.DMTranscripts) {
|
||||||
|
|
||||||
|
await tUser
|
||||||
|
?.send({ embeds: [transcriptEmbed], files: [file] })
|
||||||
|
.catch(async (err) => {
|
||||||
|
console.error(err);
|
||||||
|
});
|
||||||
|
if (ticket.subUsers) {
|
||||||
|
ticket.subUsers.forEach(async (subUser) => {
|
||||||
|
await interaction.client.users.cache
|
||||||
|
.get(subUser)
|
||||||
|
?.send({ embeds: [transcriptEmbed], files: [file] });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
await interaction.channel.delete().catch(async (error) => {
|
||||||
|
console.error(error);
|
||||||
|
if (error.code !== Discord.Constants.APIErrors.UNKNOWN_CHANNEL) {
|
||||||
|
console.error("Failed to delete the interaction:", error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
+57
-18
@@ -15,37 +15,67 @@ const Command = require("../Structures/Command.js");
|
|||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.EmbedCommand,
|
name: cmdconfig.EmbedCommand,
|
||||||
description: cmdconfig.EmbedCommandDesc,
|
description: cmdconfig.EmbedCommandDesc,
|
||||||
slashCommandOptions: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "title",
|
name: "title",
|
||||||
description: "Embed Title",
|
description: "Embed Title",
|
||||||
type: "STRING",
|
type: "STRING",
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
name: "message",
|
name: "message",
|
||||||
description: "Embed Message",
|
description: "Embed Message",
|
||||||
type: "STRING",
|
type: "STRING",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "color",
|
||||||
|
description: "Embed HEX Color",
|
||||||
|
type: "STRING",
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "fieldtitle",
|
||||||
|
description: "Add an additional Embed Field",
|
||||||
|
type: "STRING",
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "fieldcontent",
|
||||||
|
description: "Add an additional Embed Field",
|
||||||
|
type: "STRING",
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "thumbnail",
|
||||||
|
description: "Embed Thumbnail URL",
|
||||||
|
type: "STRING",
|
||||||
|
required: false,
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "image",
|
||||||
|
description: "Embed Image URL",
|
||||||
|
type: "STRING",
|
||||||
|
required: false,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let SupportStaff =
|
const { getRole } = interaction.client;
|
||||||
interaction.guild.roles.cache.find(
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
(SupportTeam) => SupportTeam.name === supportbot.Staff
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(SupportTeam) => SupportTeam.id === supportbot.Staff
|
|
||||||
);
|
|
||||||
let Admins =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
|
||||||
);
|
|
||||||
|
|
||||||
|
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()
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
.setTitle("Invalid Permissions!")
|
.setTitle("Invalid Permissions!")
|
||||||
.setDescription(
|
.setDescription(
|
||||||
@@ -55,14 +85,23 @@ module.exports = new Command({
|
|||||||
|
|
||||||
if (
|
if (
|
||||||
interaction.member.roles.cache.has(SupportStaff.id) ||
|
interaction.member.roles.cache.has(SupportStaff.id) ||
|
||||||
interaction.member.roles.cache.has(Admins.id)
|
interaction.member.roles.cache.has(Admin.id)
|
||||||
) {
|
) {
|
||||||
const EmbedTitle = interaction.options.getString("title");
|
const EmbedTitle = interaction.options.getString("title");
|
||||||
const EmbedSubject = interaction.options.getString("message");
|
const EmbedSubject = interaction.options.getString("message");
|
||||||
|
const EmbedColour = interaction.options.getString("color");
|
||||||
|
const EmbedThumbnail = interaction.options.getString("thumbnail");
|
||||||
|
const EmbedImage = interaction.options.getString("image");
|
||||||
|
const EmbedFieldContent = interaction.options.getString("fieldcontent");
|
||||||
|
const EmbedFieldTitle = interaction.options.getString("fieldtitle");
|
||||||
|
|
||||||
const EmbedMsg = new Discord.MessageEmbed()
|
const EmbedMsg = new Discord.MessageEmbed()
|
||||||
.setTitle(EmbedTitle)
|
.setTitle(EmbedTitle)
|
||||||
.setDescription(EmbedSubject);
|
.setDescription(EmbedSubject)
|
||||||
|
.addField(EmbedFieldTitle, EmbedFieldContent)
|
||||||
|
.setColor(EmbedColour)
|
||||||
|
.setThumbnail(EmbedThumbnail)
|
||||||
|
.setImage(EmbedImage);
|
||||||
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
embeds: [EmbedMsg],
|
embeds: [EmbedMsg],
|
||||||
|
|||||||
+57
-74
@@ -12,95 +12,78 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
|||||||
|
|
||||||
const Command = require("../Structures/Command.js");
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
async function asyncForEach(array, callback) {
|
|
||||||
for (let index = 0; index < array.length; index++) {
|
|
||||||
await callback(array[index], index, array);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.HelpCommand,
|
name: cmdconfig.HelpCommand,
|
||||||
description: cmdconfig.HelpCommandDesc,
|
description: cmdconfig.HelpCommandDesc,
|
||||||
slashCommandOptions: [],
|
options: [],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let SupportStaff =
|
const { getRole } = interaction.client;
|
||||||
interaction.guild.roles.cache.find(
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
(adminRole) => adminRole.name === supportbot.Staff
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
) ||
|
if (!SupportStaff || !Admin)
|
||||||
interaction.guild.roles.cache.find(
|
return interaction.reply(
|
||||||
(staffRole) => staffRole.id === supportbot.Staff
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
);
|
|
||||||
let AdminStaff =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(adminRole) => adminRole.name === supportbot.Admin
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(adminRole) => adminRole.id === supportbot.Admin
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if (supportbot.HelpMenu) {
|
let botCommands = "";
|
||||||
let botCommands = "";
|
botCommands += `**/${cmdconfig.HelpCommand}** ${cmdconfig.HelpCommandDesc}\n`;
|
||||||
botCommands += `**/${cmdconfig.HelpCommand}** ${cmdconfig.HelpCommandDesc}\n`;
|
botCommands += `**/${cmdconfig.InfoCommand}** ${cmdconfig.InfoCommandDesc}\n`;
|
||||||
botCommands += `**/${cmdconfig.InfoCommand}** ${cmdconfig.InfoCommandDesc}\n`;
|
botCommands += `**/${cmdconfig.PingCommand}** ${cmdconfig.PingCommandDesc}\n`;
|
||||||
botCommands += `**/${cmdconfig.PingCommand}** ${cmdconfig.PingCommandDesc}\n`;
|
|
||||||
|
|
||||||
let ticketCommands = "";
|
let ticketCommands = "";
|
||||||
ticketCommands += `**/${cmdconfig.OpenTicket}** ${cmdconfig.OpenTicketDesc}\n`;
|
ticketCommands += `**/${cmdconfig.OpenTicket}** ${cmdconfig.OpenTicketDesc}\n`;
|
||||||
ticketCommands += `**/${cmdconfig.CloseTicket}** ${cmdconfig.CloseTicketDesc}\n`;
|
ticketCommands += `**/${cmdconfig.CloseTicket}** ${cmdconfig.CloseTicketDesc}\n`;
|
||||||
|
|
||||||
let staffCommands = "";
|
let staffCommands = "";
|
||||||
staffCommands += `**/${cmdconfig.TicketAdd}** ${cmdconfig.TicketAddDesc}\n`;
|
staffCommands += `**/${cmdconfig.TicketAdd}** ${cmdconfig.TicketAddDesc}\n`;
|
||||||
staffCommands += `**/${cmdconfig.TicketRemove}** ${cmdconfig.TicketRemoveDesc}\n`;
|
staffCommands += `**/${cmdconfig.TicketRemove}** ${cmdconfig.TicketRemoveDesc}\n`;
|
||||||
|
|
||||||
const HelpEmbed1 = new Discord.MessageEmbed()
|
const HelpEmbed1 = new Discord.MessageEmbed()
|
||||||
.setTitle(supportbot.Name + " Commands")
|
.setTitle(supportbot.Name + " Commands")
|
||||||
.setThumbnail(interaction.user.displayAvatarURL())
|
.setThumbnail(interaction.user.displayAvatarURL())
|
||||||
|
|
||||||
.addFields(
|
.addFields(
|
||||||
{
|
{
|
||||||
name: "🖥️ General Commands\n",
|
name: "🖥️ General Commands\n",
|
||||||
value: `${botCommands}\n`,
|
value: `${botCommands}\n`,
|
||||||
inline: false,
|
inline: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "🎫 Support Commands\n",
|
name: "🎫 Support Commands\n",
|
||||||
value: `${ticketCommands}\n`,
|
value: `${ticketCommands}\n`,
|
||||||
inline: false,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter, interaction.user.displayAvatarURL());
|
|
||||||
|
|
||||||
if (interaction.member.roles.cache.has(SupportStaff.id)) {
|
|
||||||
HelpEmbed1.addFields({
|
|
||||||
name: "🔐 Staff Commands\n",
|
|
||||||
value: `${staffCommands}\n`,
|
|
||||||
inline: false,
|
inline: false,
|
||||||
});
|
|
||||||
} else {
|
|
||||||
if (interaction.member.roles.cache.has(AdminStaff.id)) {
|
|
||||||
HelpEmbed1.addFields({
|
|
||||||
name: "🔐 Staff Commands\n",
|
|
||||||
value: `${staffCommands}\n`,
|
|
||||||
inline: false,
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
)
|
||||||
|
|
||||||
if (supportbot.SendHelpPage === "dm") {
|
.setColor(supportbot.EmbedColour)
|
||||||
interaction.user.reply({
|
.setFooter({
|
||||||
embeds: [HelpEmbed1],
|
text: supportbot.EmbedFooter,
|
||||||
});
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
}
|
});
|
||||||
|
|
||||||
if (supportbot.SendHelpPage === "channel") {
|
if (
|
||||||
interaction.reply({
|
interaction.member.roles.cache.has(SupportStaff.id) ||
|
||||||
embeds: [HelpEmbed1],
|
interaction.member.roles.cache.has(Admin.id)
|
||||||
});
|
) {
|
||||||
}
|
HelpEmbed1.addFields({
|
||||||
|
name: "🔐 Staff Commands\n",
|
||||||
|
value: `${staffCommands}\n`,
|
||||||
|
inline: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.SendHelpPage === "dm") {
|
||||||
|
interaction.user.send({
|
||||||
|
embeds: [HelpEmbed1],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.SendHelpPage === "channel") {
|
||||||
|
interaction.reply({
|
||||||
|
embeds: [HelpEmbed1],
|
||||||
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
+2
-2
@@ -15,8 +15,8 @@ const Command = require("../Structures/Command.js");
|
|||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.InfoCommand,
|
name: cmdconfig.InfoCommand,
|
||||||
description: cmdconfig.InfoCommandDesc,
|
description: cmdconfig.InfoCommandDesc,
|
||||||
slashCommandOptions: [],
|
options: [],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
const InfoButton = new Discord.MessageButton()
|
const InfoButton = new Discord.MessageButton()
|
||||||
|
|||||||
+2
-2
@@ -15,8 +15,8 @@ const Command = require("../Structures/Command.js");
|
|||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.PingCommand,
|
name: cmdconfig.PingCommand,
|
||||||
description: cmdconfig.PingCommandDesc,
|
description: cmdconfig.PingCommandDesc,
|
||||||
slashCommandOptions: [],
|
options: [],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
const PingEmbed = new Discord.MessageEmbed()
|
const PingEmbed = new Discord.MessageEmbed()
|
||||||
|
|||||||
+54
-55
@@ -12,16 +12,10 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
|||||||
|
|
||||||
const Command = require("../Structures/Command.js");
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
async function asyncForEach(array, callback) {
|
|
||||||
for (let index = 0; index < array.length; index++) {
|
|
||||||
await callback(array[index], index, array);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.TicketRemove,
|
name: cmdconfig.TicketRemove,
|
||||||
description: cmdconfig.TicketRemoveDesc,
|
description: cmdconfig.TicketRemoveDesc,
|
||||||
slashCommandOptions: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "user",
|
name: "user",
|
||||||
description: "User to remove",
|
description: "User to remove",
|
||||||
@@ -29,22 +23,15 @@ module.exports = new Command({
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let SupportStaff =
|
const { getRole } = interaction.client;
|
||||||
interaction.guild.roles.cache.find(
|
let Staff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
(SupportTeam) => SupportTeam.name === supportbot.Staff
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
) ||
|
if (!Staff || !Admin)
|
||||||
interaction.guild.roles.cache.find(
|
return interaction.reply(
|
||||||
(SupportTeam) => SupportTeam.id === supportbot.Staff
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot."
|
||||||
);
|
|
||||||
let Admins =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
|
||||||
);
|
);
|
||||||
|
|
||||||
const NoPerms = new Discord.MessageEmbed()
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
@@ -55,41 +42,53 @@ module.exports = new Command({
|
|||||||
.setColor(supportbot.WarningColour);
|
.setColor(supportbot.WarningColour);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
interaction.member.roles.cache.has(SupportStaff.id) ||
|
!interaction.member.roles.cache.has(Staff.id) &&
|
||||||
interaction.member.roles.cache.has(Admins.id)
|
!interaction.member.roles.cache.has(Admin.id)
|
||||||
) {
|
)
|
||||||
if (!interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
|
|
||||||
const Exists = new Discord.MessageEmbed()
|
|
||||||
.setTitle("No Ticket Found!")
|
|
||||||
.setDescription(`${supportbot.NoValidTicket}`)
|
|
||||||
.setColor(supportbot.WarningColour);
|
|
||||||
return interaction.reply({ embeds: [Exists] });
|
|
||||||
}
|
|
||||||
|
|
||||||
let uMember = interaction.options.getUser("user");
|
|
||||||
const UserNotExist = new Discord.MessageEmbed()
|
|
||||||
.setTitle("User Not Found!")
|
|
||||||
.setDescription(
|
|
||||||
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.TicketRemove} <user#0000>\``
|
|
||||||
)
|
|
||||||
.setColor(supportbot.ErrorColour);
|
|
||||||
|
|
||||||
if (!uMember) return interaction.reply({ embeds: [UserNotExist] });
|
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.edit(uMember, {
|
|
||||||
VIEW_CHANNEL: false,
|
|
||||||
READ_MESSAGE_HISTORY: false,
|
|
||||||
SEND_MESSAGES: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
const Complete = new Discord.MessageEmbed()
|
|
||||||
.setTitle("User Removed!")
|
|
||||||
.setDescription(supportbot.RemovedUser.replace(/%user%/g, uMember.id))
|
|
||||||
.setTimestamp()
|
|
||||||
.setColor(supportbot.EmbedColour);
|
|
||||||
interaction.reply({ embeds: [Complete] });
|
|
||||||
} else {
|
|
||||||
return interaction.reply({ embeds: [NoPerms] });
|
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);
|
||||||
|
}
|
||||||
|
);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
+15
-13
@@ -15,27 +15,26 @@ const Command = require("../Structures/Command.js");
|
|||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.SuggestCommand,
|
name: cmdconfig.SuggestCommand,
|
||||||
description: cmdconfig.SuggestCommandDesc,
|
description: cmdconfig.SuggestCommandDesc,
|
||||||
slashCommandOptions: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "suggestion",
|
name: "suggestion",
|
||||||
description: "Create a Suggestion",
|
description: "Create a Suggestion",
|
||||||
type: "STRING",
|
type: "STRING",
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
const suggestChannel =
|
const { getChannel } = interaction.client;
|
||||||
interaction.guild.channels.cache.find(
|
const suggestChannel = await getChannel(
|
||||||
(channel) => channel.name === supportbot.SuggestionChannel
|
supportbot.SuggestionChannel,
|
||||||
) ||
|
interaction.guild
|
||||||
interaction.guild.channels.cache.find(
|
);
|
||||||
(channel) => channel.id === supportbot.SuggestionChannel
|
|
||||||
);
|
|
||||||
|
|
||||||
const NoChannel = new Discord.MessageEmbed()
|
const NoChannel = new Discord.MessageEmbed()
|
||||||
.setTitle("Missing Channel!")
|
.setTitle("Missing Channel!")
|
||||||
.setDescription(`${supportbot.InvalidChannel}`)
|
.setDescription(supportbot.InvalidChannel)
|
||||||
.setColor(supportbot.ErrorColour);
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
if (!suggestChannel) return interaction.reply({ embeds: [NoChannel] });
|
if (!suggestChannel) return interaction.reply({ embeds: [NoChannel] });
|
||||||
@@ -46,13 +45,16 @@ module.exports = new Command({
|
|||||||
.addField("Suggestion", suggestion, true)
|
.addField("Suggestion", suggestion, true)
|
||||||
.addField("From", `<@${interaction.user.id}>`)
|
.addField("From", `<@${interaction.user.id}>`)
|
||||||
.setThumbnail(interaction.user.displayAvatarURL())
|
.setThumbnail(interaction.user.displayAvatarURL())
|
||||||
.setFooter(supportbot.EmbedFooter, interaction.user.displayAvatarURL())
|
.setFooter({
|
||||||
|
text: supportbot.EmbedFooter,
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
})
|
||||||
.setColor(supportbot.EmbedColour);
|
.setColor(supportbot.EmbedColour);
|
||||||
|
|
||||||
const suggestionMsg = await suggestChannel.send({ embeds: [SuggestEmbed] });
|
const suggestionMsg = await suggestChannel.send({ embeds: [SuggestEmbed] });
|
||||||
if (supportbot.SuggestionUpvote && supportbot.SuggestionDownvote) {
|
if (supportbot.SuggestionUpvote && supportbot.SuggestionDownvote) {
|
||||||
suggestionMsg.react(supportbot.SuggestionUpvote);
|
await suggestionMsg.react(supportbot.SuggestionUpvote);
|
||||||
suggestionMsg.react(supportbot.SuggestionDownvote);
|
await suggestionMsg.react(supportbot.SuggestionDownvote);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Submitted = new Discord.MessageEmbed()
|
const Submitted = new Discord.MessageEmbed()
|
||||||
|
|||||||
+224
-258
@@ -3,7 +3,12 @@
|
|||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const {
|
||||||
|
MessageEmbed,
|
||||||
|
Permissions,
|
||||||
|
MessageButton,
|
||||||
|
MessageActionRow,
|
||||||
|
} = require("discord.js");
|
||||||
const yaml = require("js-yaml");
|
const yaml = require("js-yaml");
|
||||||
const supportbot = yaml.load(
|
const supportbot = yaml.load(
|
||||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
@@ -13,167 +18,158 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
|||||||
const Command = require("../Structures/Command.js");
|
const Command = require("../Structures/Command.js");
|
||||||
const TicketNumberID = require("../Structures/TicketID.js");
|
const TicketNumberID = require("../Structures/TicketID.js");
|
||||||
|
|
||||||
async function asyncForEach(array, callback) {
|
|
||||||
for (let index = 0; index < array.length; index++) {
|
|
||||||
await callback(array[index], index, array);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.OpenTicket,
|
name: cmdconfig.OpenTicket,
|
||||||
description: cmdconfig.OpenTicketDesc,
|
description: cmdconfig.OpenTicketDesc,
|
||||||
slashCommandOptions: [
|
options: [
|
||||||
{
|
{
|
||||||
name: "reason",
|
name: "reason",
|
||||||
description: "Ticket Reason",
|
description: "Ticket Reason",
|
||||||
type: "STRING",
|
type: "STRING",
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permission: "SEND_MESSAGES",
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let reactionUser = interaction.guild.members.cache.get(interaction.user.id);
|
let disableCommand = true;
|
||||||
|
if (interaction.isCommand() && disableCommand)
|
||||||
|
return interaction.reply({
|
||||||
|
content: "This command is disabled",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
let department = interaction.customId?.split("-")[1] || null;
|
||||||
|
let TicketData = await JSON.parse(
|
||||||
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
|
);
|
||||||
|
const { getRole, getCategory } = interaction.client;
|
||||||
|
let User = interaction.guild.members.cache.get(interaction.user.id);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
reactionUser.roles.cache.find(
|
supportbot.MaxAllowedTickets &&
|
||||||
(role) => role.name === supportbot.TicketBlackListRole
|
TicketData.tickets.filter((t) => t.user === interaction.user.id && t.open)
|
||||||
) ||
|
.length >= supportbot.MaxAllowedTickets
|
||||||
reactionUser.roles.cache.find(
|
) {
|
||||||
(role) => role.id === supportbot.TicketBlackListRole
|
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
|
return interaction.reply({
|
||||||
.reply({
|
content: supportbot.TicketBlackListMessage,
|
||||||
content: `<@${interaction.user.id}> ${supportbot.TicketBlackListMessage}`,
|
ephemeral: true,
|
||||||
})
|
});
|
||||||
.then((msg) => {
|
|
||||||
setTimeout(() => msg.delete(), 3500);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ticket ID
|
// Ticket ID
|
||||||
let ticketNumberID = TicketNumberID.pad(interaction.guild.id);
|
let ticketNumberID = await TicketNumberID.pad();
|
||||||
|
|
||||||
// Ticket Subject
|
// Ticket Subject
|
||||||
const TicketSubject =
|
const TicketSubject =
|
||||||
interaction.options?.getString("reason") || supportbot.NoTicketSubject;
|
interaction.options?.getString("reason") || supportbot.NoTicketSubject;
|
||||||
|
|
||||||
const TicketExists = new Discord.MessageEmbed()
|
const TicketExists = new MessageEmbed()
|
||||||
.setTitle("Ticket Exists!")
|
.setTitle("Ticket Exists!")
|
||||||
.setDescription(`${supportbot.TicketExists}`)
|
.setDescription(supportbot.TicketExists);
|
||||||
.setColor(supportbot.WarningColour);
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
await interaction.guild.channels.cache.find((ticketChannel) => {
|
await interaction.guild.channels.cache.find(
|
||||||
ticketChannel.name === `${supportbot.TicketPrefix}${ticketNumberID}`;
|
(ticketChannel) =>
|
||||||
})
|
ticketChannel.name === `${supportbot.TicketPrefix}${ticketNumberID}`
|
||||||
|
)
|
||||||
) {
|
) {
|
||||||
return interaction.reply({ embeds: [TicketExists] });
|
return await interaction.reply({
|
||||||
|
embeds: [TicketExists],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
const Staff =
|
const Staff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
interaction.guild.roles.cache.find(
|
const Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
(SupportTeam) => SupportTeam.name === supportbot.Staff
|
if (!Staff || !Admin)
|
||||||
) ||
|
return interaction.reply({
|
||||||
interaction.guild.roles.cache.find(
|
content:
|
||||||
(SupportTeam) => SupportTeam.id === supportbot.Staff
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot.",
|
||||||
);
|
ephemeral: true,
|
||||||
const Admins =
|
});
|
||||||
interaction.guild.roles.cache.find(
|
let TicketCategory = await getCategory(
|
||||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
supportbot.Departments[department].category || supportbot.TicketCategory,
|
||||||
) ||
|
interaction.guild
|
||||||
interaction.guild.roles.cache.find(
|
);
|
||||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
|
||||||
);
|
|
||||||
const DeptRole1 =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(DepartmentRole) =>
|
|
||||||
DepartmentRole.name === `${supportbot.DepartmentRole_1}`
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(DepartmentRole) =>
|
|
||||||
DepartmentRole.id === `${supportbot.DepartmentRole_1}`
|
|
||||||
);
|
|
||||||
const DeptRole2 =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(DepartmentRole) =>
|
|
||||||
DepartmentRole.name === `${supportbot.DepartmentRole_2}`
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(DepartmentRole) =>
|
|
||||||
DepartmentRole.id === `${supportbot.DepartmentRole_2}`
|
|
||||||
);
|
|
||||||
const DeptRole3 =
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(DepartmentRole) =>
|
|
||||||
DepartmentRole.name === `${supportbot.DepartmentRole_3}`
|
|
||||||
) ||
|
|
||||||
interaction.guild.roles.cache.find(
|
|
||||||
(DepartmentRole) =>
|
|
||||||
DepartmentRole.id === `${supportbot.DepartmentRole_3}`
|
|
||||||
);
|
|
||||||
const Author = interaction.user;
|
|
||||||
const Everyone = interaction.guild.id;
|
|
||||||
const ticketChannel = await interaction.guild.channels.create(
|
const ticketChannel = await interaction.guild.channels.create(
|
||||||
`${supportbot.TicketPrefix}${ticketNumberID}`,
|
`${supportbot.TicketPrefix}${ticketNumberID}`,
|
||||||
{
|
{
|
||||||
type: "GUILD_TEXT",
|
type: "GUILD_TEXT",
|
||||||
|
parent: TicketCategory.id,
|
||||||
|
permissionOverwrites: [
|
||||||
|
{
|
||||||
|
id: Admin.id,
|
||||||
|
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: interaction.user.id,
|
||||||
|
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: interaction.guild.id,
|
||||||
|
deny: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
|
);
|
||||||
|
if (supportbot.AllowAllStaff) {
|
||||||
|
await ticketChannel.permissionOverwrites.edit(Staff.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (supportbot.TicketDepartments && !department) {
|
||||||
|
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
||||||
|
SEND_MESSAGES: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
await TicketData.tickets.push({
|
||||||
|
id: ticketChannel.id,
|
||||||
|
name: ticketChannel.name,
|
||||||
|
user: interaction.user.id,
|
||||||
|
number: ticketNumberID,
|
||||||
|
reason: TicketSubject,
|
||||||
|
open: true,
|
||||||
|
subUsers: [],
|
||||||
|
});
|
||||||
|
fs.writeFileSync(
|
||||||
|
"./Data/TicketData.json",
|
||||||
|
JSON.stringify(TicketData, null, 4),
|
||||||
|
(err) => {
|
||||||
|
if (err) console.error(err);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (
|
const CreatedTicket = new MessageEmbed()
|
||||||
interaction.channel.name === supportbot.ReactionChannel ||
|
.setDescription(
|
||||||
interaction.channel.id === supportbot.ReactionChannel
|
supportbot.TicketCreatedAlert.replace(
|
||||||
) {
|
/%ticketauthor%/g,
|
||||||
const CreatedTicket = new Discord.MessageEmbed()
|
interaction.user.id
|
||||||
.setDescription(
|
|
||||||
supportbot.TicketCreatedAlert.replace(
|
|
||||||
/%ticketauthor%/g,
|
|
||||||
interaction.user.id
|
|
||||||
)
|
|
||||||
.replace(/%ticketid%/g, ticketChannel.id)
|
|
||||||
.replace(/%ticketusername%/g, interaction.user.username)
|
|
||||||
)
|
)
|
||||||
.setColor(supportbot.EmbedColour);
|
.replace(/%ticketid%/g, ticketChannel.id)
|
||||||
interaction.reply({ embeds: [CreatedTicket], ephemeral: true });
|
.replace(/%ticketusername%/g, interaction.user.username)
|
||||||
} else {
|
)
|
||||||
const CreatedTicket = new Discord.MessageEmbed()
|
.setColor(supportbot.EmbedColour);
|
||||||
.setDescription(
|
await interaction.reply({ embeds: [CreatedTicket], ephemeral: true });
|
||||||
supportbot.TicketCreatedAlert.replace(
|
|
||||||
/%ticketauthor%/g,
|
|
||||||
interaction.user.id
|
|
||||||
)
|
|
||||||
.replace(/%ticketid%/g, ticketChannel.id)
|
|
||||||
.replace(/%ticketusername%/g, interaction.user.username)
|
|
||||||
)
|
|
||||||
.setColor(supportbot.EmbedColour);
|
|
||||||
interaction.reply({ embeds: [CreatedTicket], ephemeral: true });
|
|
||||||
}
|
|
||||||
let AllowArr = [Staff, Staff, Admins, Author];
|
|
||||||
await asyncForEach(AllowArr, (index) => {
|
|
||||||
ticketChannel.permissionOverwrites.create(index, { VIEW_CHANNEL: true });
|
|
||||||
});
|
|
||||||
|
|
||||||
let DenyArr = [Everyone];
|
|
||||||
await asyncForEach(DenyArr, (index) => {
|
|
||||||
ticketChannel.permissionOverwrites.create(index, { VIEW_CHANNEL: false });
|
|
||||||
});
|
|
||||||
|
|
||||||
let TicketCategory =
|
|
||||||
interaction.guild.channels.cache.find(
|
|
||||||
(category) => category.name === supportbot.TicketCategory
|
|
||||||
) ||
|
|
||||||
interaction.guild.channels.cache.find(
|
|
||||||
(category) => category.id === supportbot.TicketCategory
|
|
||||||
);
|
|
||||||
if (TicketCategory) {
|
|
||||||
ticketChannel.setParent(TicketCategory.id);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.AllowTicketMentions) {
|
if (supportbot.AllowTicketMentions) {
|
||||||
ticketChannel.send({ content: `${interaction.user}` });
|
await ticketChannel.send(`${interaction.user}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
const TicketMessage = new Discord.MessageEmbed()
|
const TicketMessage = new MessageEmbed()
|
||||||
.setTitle(
|
.setTitle(
|
||||||
supportbot.Ticket_Title.replace(/%ticketauthor%/g, interaction.user.id)
|
supportbot.Ticket_Title.replace(/%ticketauthor%/g, interaction.user.id)
|
||||||
.replace(/%ticketid%/g, ticketChannel.id)
|
.replace(/%ticketid%/g, ticketChannel.id)
|
||||||
@@ -187,176 +183,146 @@ module.exports = new Command({
|
|||||||
.setColor(supportbot.EmbedColour);
|
.setColor(supportbot.EmbedColour);
|
||||||
|
|
||||||
if (supportbot.TicketSubject === "embed") {
|
if (supportbot.TicketSubject === "embed") {
|
||||||
if (TicketSubject != "No Reason Provided.") {
|
if (TicketSubject !== "No Reason Provided.") {
|
||||||
TicketMessage.addFields({ name: "Reason", value: TicketSubject });
|
TicketMessage.addFields({ name: "Reason", value: TicketSubject });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (supportbot.TicketSubject === "description") {
|
if (supportbot.TicketSubject === "description") {
|
||||||
if (TicketSubject != "No Reason Provided.") {
|
if (TicketSubject !== "No Reason Provided.") {
|
||||||
ticketChannel.setTopic(
|
await ticketChannel.setTopic(
|
||||||
`Reason: ${TicketSubject} - User ID: ${interaction.user.id} - Ticket: ${ticketChannel.name}`
|
`Reason: ${TicketSubject} - User ID: ${interaction.user.id} - Ticket: ${ticketChannel.name}`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (supportbot.TicketDepartments) {
|
if (supportbot.TicketDepartments && !department) {
|
||||||
TicketMessage.addFields({
|
TicketMessage.addFields({
|
||||||
name: "Departments",
|
name: "Departments",
|
||||||
value: ` **${supportbot.DepartmentTitle_1}**\n **${supportbot.DepartmentTitle_2}**\n **${supportbot.DepartmentTitle_3}**`,
|
value: ` **${supportbot.Departments.map((X) => X.title).join("\n")}**`,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
const CloseButton = new Discord.MessageButton()
|
const CloseButton = new MessageButton()
|
||||||
.setCustomId("ticketclose")
|
.setCustomId("ticketclose")
|
||||||
.setLabel("Close")
|
.setLabel("Close")
|
||||||
.setStyle(supportbot.TicketCloseColour)
|
.setStyle(supportbot.TicketCloseColour)
|
||||||
.setEmoji(supportbot.TicketCloseEmoji);
|
.setEmoji(supportbot.TicketCloseEmoji);
|
||||||
|
|
||||||
const LockButton = new Discord.MessageButton()
|
const LockButton = new MessageButton()
|
||||||
.setCustomId("ticketlock")
|
.setCustomId("ticketlock")
|
||||||
.setLabel("Lock")
|
.setLabel("Lock")
|
||||||
.setStyle(supportbot.TicketLockColour)
|
.setStyle(supportbot.TicketLockColour)
|
||||||
.setEmoji(supportbot.TicketLockEmoji);
|
.setEmoji(supportbot.TicketLockEmoji);
|
||||||
|
|
||||||
const row2 = new Discord.MessageActionRow().addComponents(
|
const row2 = new MessageActionRow().addComponents(CloseButton, LockButton);
|
||||||
CloseButton,
|
if (supportbot.TicketDepartments && !department) {
|
||||||
LockButton
|
try {
|
||||||
);
|
let buttons = await supportbot.Departments.map((x) =>
|
||||||
|
new MessageButton()
|
||||||
if (supportbot.TicketDepartments) {
|
.setCustomId("Department" + supportbot.Departments.indexOf(x))
|
||||||
let DenyArr = [DeptRole1, DeptRole2, DeptRole3];
|
.setLabel(x.title)
|
||||||
await asyncForEach(DenyArr, (index) => {
|
.setStyle(x.color)
|
||||||
ticketChannel.permissionOverwrites.create(index, {
|
.setEmoji(x.emoji)
|
||||||
VIEW_CHANNEL: false,
|
);
|
||||||
|
const row = new MessageActionRow().addComponents(buttons);
|
||||||
|
const m = await ticketChannel.send({
|
||||||
|
embeds: [TicketMessage],
|
||||||
|
components: [row],
|
||||||
});
|
});
|
||||||
});
|
|
||||||
const Department1Button = new Discord.MessageButton()
|
|
||||||
.setCustomId("Department1")
|
|
||||||
.setLabel(`${supportbot.DepartmentTitle_1}`)
|
|
||||||
.setStyle(supportbot.TicketDept1Colour)
|
|
||||||
.setEmoji(supportbot.TicketDept1Emoji);
|
|
||||||
|
|
||||||
const Department2Button = new Discord.MessageButton()
|
let collector;
|
||||||
.setCustomId("Department2")
|
try {
|
||||||
.setLabel(`${supportbot.DepartmentTitle_2}`)
|
const filter = (i) => i.user.id === interaction.user.id;
|
||||||
.setStyle(supportbot.TicketDept2Colour)
|
collector = await m.awaitMessageComponent({
|
||||||
.setEmoji(supportbot.TicketDept2Emoji);
|
filter,
|
||||||
|
max: 1,
|
||||||
const Department3Button = new Discord.MessageButton()
|
componentType: "BUTTON",
|
||||||
.setCustomId("Department3")
|
time: supportbot.Timeout * 60000,
|
||||||
.setLabel(`${supportbot.DepartmentTitle_3}`)
|
|
||||||
.setStyle(supportbot.TicketDept3Colour)
|
|
||||||
.setEmoji(supportbot.TicketDept3Emoji);
|
|
||||||
|
|
||||||
const row = new Discord.MessageActionRow().addComponents(
|
|
||||||
Department1Button,
|
|
||||||
Department2Button,
|
|
||||||
Department3Button
|
|
||||||
);
|
|
||||||
|
|
||||||
const m = await ticketChannel.send({
|
|
||||||
embeds: [TicketMessage],
|
|
||||||
components: [row],
|
|
||||||
});
|
|
||||||
|
|
||||||
const filter = (i) => {
|
|
||||||
i.deferUpdate();
|
|
||||||
return i.user.id === interaction.user.id;
|
|
||||||
};
|
|
||||||
const collector = m.createMessageComponentCollector({
|
|
||||||
filter,
|
|
||||||
max: 1,
|
|
||||||
componentType: "BUTTON",
|
|
||||||
time: 60000,
|
|
||||||
});
|
|
||||||
|
|
||||||
collector.on("collect", async (i) => {
|
|
||||||
if (i.customId === "Department1") {
|
|
||||||
ticketChannel.permissionOverwrites.edit(DeptRole1, {
|
|
||||||
VIEW_CHANNEL: true,
|
|
||||||
READ_MESSAGE_HISTORY: true,
|
|
||||||
SEND_MESSAGES: true,
|
|
||||||
});
|
});
|
||||||
|
} catch (e) {
|
||||||
if (!supportbot.AllowStaff) {
|
if (e.code === "INTERACTION_COLLECTOR_ERROR") {
|
||||||
ticketChannel.permissionOverwrites.edit(Staff, {
|
try {
|
||||||
VIEW_CHANNEL: false,
|
TicketData = await JSON.parse(
|
||||||
READ_MESSAGE_HISTORY: false,
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
SEND_MESSAGES: false,
|
);
|
||||||
});
|
let ticket = await TicketData.tickets.findIndex(
|
||||||
}
|
(t) => t.id === ticketChannel.id
|
||||||
|
);
|
||||||
const Department1 = new Discord.MessageEmbed()
|
TicketData.tickets[ticket].open = false;
|
||||||
.setDescription(
|
fs.writeFileSync(
|
||||||
`> Thank for reaching out to the **${supportbot.DepartmentTitle_1} Department**. Please provide us information regarding your query.`
|
"./Data/TicketData.json",
|
||||||
)
|
JSON.stringify(TicketData, null, 4),
|
||||||
.setColor(supportbot.EmbedColour);
|
(err) => {
|
||||||
ticketChannel.send({ embeds: [Department1] });
|
if (err) console.error(err);
|
||||||
|
}
|
||||||
if (supportbot.AllowTicketMentions) {
|
);
|
||||||
ticketChannel.send({ content: `@here` });
|
interaction.user.send(
|
||||||
|
"Your ticket has timed out. Please open a new one, and select a department."
|
||||||
|
);
|
||||||
|
} catch (e) {}
|
||||||
|
return await ticketChannel.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i.message.edit({ embeds: [TicketMessage], components: [row2] });
|
let num = collector.customId.split("Department")[1];
|
||||||
|
let role = getRole(supportbot.Departments[num].role, interaction.guild);
|
||||||
|
let title = supportbot.Departments[num].title;
|
||||||
|
|
||||||
if (i.customId === "Department2") {
|
await ticketChannel.permissionOverwrites.edit(role.id, {
|
||||||
ticketChannel.permissionOverwrites.edit(DeptRole2, {
|
VIEW_CHANNEL: true,
|
||||||
VIEW_CHANNEL: true,
|
});
|
||||||
READ_MESSAGE_HISTORY: true,
|
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
||||||
SEND_MESSAGES: true,
|
SEND_MESSAGES: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!supportbot.AllowStaff) {
|
await collector.reply({
|
||||||
ticketChannel.permissionOverwrites.edit(Staff, {
|
embeds: [
|
||||||
VIEW_CHANNEL: false,
|
{
|
||||||
READ_MESSAGE_HISTORY: false,
|
description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`,
|
||||||
SEND_MESSAGES: false,
|
color: supportbot.EmbedColour,
|
||||||
});
|
},
|
||||||
}
|
],
|
||||||
|
});
|
||||||
|
|
||||||
const Department2 = new Discord.MessageEmbed()
|
if (supportbot.AllowTicketMentions) {
|
||||||
.setDescription(
|
await ticketChannel.send("@here");
|
||||||
`> Thank for reaching out to the **${supportbot.DepartmentTitle_2} Department**. Please provide us information regarding your query.`
|
|
||||||
)
|
|
||||||
.setColor(supportbot.EmbedColour);
|
|
||||||
ticketChannel.send({ embeds: [Department2] });
|
|
||||||
|
|
||||||
if (supportbot.AllowTicketMentions) {
|
|
||||||
ticketChannel.send({ content: `@here` });
|
|
||||||
}
|
|
||||||
|
|
||||||
i.message.edit({ embeds: [TicketMessage], components: [row2] });
|
|
||||||
}
|
}
|
||||||
if (i.customId === "Department3") {
|
await collector.message.edit({
|
||||||
ticketChannel.permissionOverwrites.edit(DeptRole3, {
|
embeds: [TicketMessage],
|
||||||
VIEW_CHANNEL: true,
|
components: [row2],
|
||||||
READ_MESSAGE_HISTORY: true,
|
});
|
||||||
SEND_MESSAGES: true,
|
} catch (error) {}
|
||||||
});
|
|
||||||
|
|
||||||
if (!supportbot.AllowStaff) {
|
|
||||||
ticketChannel.permissionOverwrites.edit(Staff, {
|
|
||||||
VIEW_CHANNEL: false,
|
|
||||||
READ_MESSAGE_HISTORY: false,
|
|
||||||
SEND_MESSAGES: false,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const Department3 = new Discord.MessageEmbed()
|
|
||||||
.setDescription(
|
|
||||||
`> Thank for reaching out to the **${supportbot.DepartmentTitle_3} Department**. Please provide us information regarding your query.`
|
|
||||||
)
|
|
||||||
.setColor(supportbot.EmbedColour);
|
|
||||||
ticketChannel.send({ embeds: [Department3] });
|
|
||||||
|
|
||||||
if (supportbot.AllowTicketMentions) {
|
|
||||||
ticketChannel.send({ content: `@here` });
|
|
||||||
}
|
|
||||||
i.message.edit({ embeds: [TicketMessage], components: [row2] });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
ticketChannel.send({ embeds: [TicketMessage], components: [row2] });
|
await ticketChannel.send({
|
||||||
|
embeds: [TicketMessage],
|
||||||
|
components: [row2],
|
||||||
|
});
|
||||||
|
if (department) {
|
||||||
|
let role = await getRole(
|
||||||
|
supportbot.Departments[department].role,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
let title = supportbot.Departments[department].title;
|
||||||
|
await ticketChannel.permissionOverwrites.edit(role.id, {
|
||||||
|
VIEW_CHANNEL: true,
|
||||||
|
});
|
||||||
|
let TicketCat = await getCategory(
|
||||||
|
supportbot.Departments[department].category ||
|
||||||
|
supportbot.TicketCategory,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
await ticketChannel.setParent(TicketCat.id, { lockPermissions: false });
|
||||||
|
await ticketChannel.send({
|
||||||
|
embeds: [
|
||||||
|
{
|
||||||
|
description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`,
|
||||||
|
color: supportbot.EmbedColour,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (supportbot.AllowTicketMentions) {
|
||||||
|
await ticketChannel.send("@here");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
+34
-37
@@ -10,14 +10,13 @@
|
|||||||
# Discord Support: https://emeraldsrv.dev/discord
|
# Discord Support: https://emeraldsrv.dev/discord
|
||||||
# Community Resources: https://emeraldsrv.dev/resources
|
# Community Resources: https://emeraldsrv.dev/resources
|
||||||
|
|
||||||
SupportBot_Version: "7.3.1"
|
SupportBot_Version: "7.5"
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# General Configuration
|
# General Configuration
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
Name: "SupportBot"
|
Name: "SupportBot"
|
||||||
# No Prefix, as everything uses the new Slash (/) Commands feature!
|
|
||||||
Token: "BOT_TOKEN"
|
Token: "BOT_TOKEN"
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
@@ -58,7 +57,6 @@ InfoColour: "#f74343"
|
|||||||
# Help Configuration
|
# Help Configuration
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
HelpMenu: true # Do not change!
|
|
||||||
SendHelpPage: "channel" # Set to channel or dm
|
SendHelpPage: "channel" # Set to channel or dm
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
@@ -67,7 +65,6 @@ SendHelpPage: "channel" # Set to channel or dm
|
|||||||
|
|
||||||
AutoRole: true
|
AutoRole: true
|
||||||
AutoRole_Role: "Member"
|
AutoRole_Role: "Member"
|
||||||
LockdownRole: "@everyone"
|
|
||||||
|
|
||||||
Staff: "Staff"
|
Staff: "Staff"
|
||||||
Admin: "Admin"
|
Admin: "Admin"
|
||||||
@@ -85,23 +82,26 @@ SuggestionDownvote: "❌"
|
|||||||
# Tickets Configuration
|
# Tickets Configuration
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
TicketCategory: "Tickets"
|
TicketCategory: "Tickets" # Only for tickets without a category
|
||||||
TicketPrefix: "ticket-" # The prefix for ticket channel names
|
TicketPrefix: "ticket-" # The prefix for ticket channel names
|
||||||
|
|
||||||
TicketLog: "logs"
|
TicketLog: "ticket-logs"
|
||||||
TranscriptLog: "transcripts"
|
TranscriptLog: "transcripts"
|
||||||
|
|
||||||
|
DMTranscripts: true
|
||||||
TranscriptTitle: "Ticket Transcript"
|
TranscriptTitle: "Ticket Transcript"
|
||||||
TicketLog_Title: "Ticket Log"
|
TicketLog_Title: "Ticket Closed"
|
||||||
TicketBlackListMessage: "You are not allowed to open a ticket"
|
TicketBlackListMessage: "You are not allowed to open a ticket"
|
||||||
|
|
||||||
|
MaxAllowedTickets: 2
|
||||||
|
|
||||||
TicketSubject: "description"
|
TicketSubject: "description"
|
||||||
# "description" will displays the ticket reason within the channel description
|
# "description" will display the ticket reason within the channel description
|
||||||
# "embed" will displays the ticket reason within the ticket embed
|
# "embed" will display the ticket reason within the ticket embed
|
||||||
|
|
||||||
AllowTicketMentions: true
|
AllowTicketMentions: true
|
||||||
# Set to true to allow the ticket to mention the author and the support team.
|
# Set to true to allow the ticket to mention the author and the support team.
|
||||||
# Set to false to dis-allow mentions within tickets.
|
# Set false to dis-allow mentions within tickets.
|
||||||
|
|
||||||
# --- Creation Config ---
|
# --- Creation Config ---
|
||||||
# --- Start ---
|
# --- Start ---
|
||||||
@@ -127,13 +127,11 @@ RemovedUser: "👍 <@%user%> has been removed from this ticket"
|
|||||||
# --- Start ---
|
# --- Start ---
|
||||||
|
|
||||||
# Discord Button Colour Selection
|
# Discord Button Colour Selection
|
||||||
# PRIMARY - Blurple
|
# PRIMARY - Blue
|
||||||
|
# SECONDARY - Grey
|
||||||
# DANGER - Red
|
# DANGER - Red
|
||||||
# SUCCESS - Green
|
# SUCCESS - Green
|
||||||
# Secondary - Grey
|
|
||||||
|
|
||||||
TicketLockReaction: "🔒"
|
|
||||||
TicketDeleteReaction: "⛔"
|
|
||||||
LockTicketCategory: "Archive"
|
LockTicketCategory: "Archive"
|
||||||
|
|
||||||
TicketCloseEmoji: "❌"
|
TicketCloseEmoji: "❌"
|
||||||
@@ -144,43 +142,42 @@ TicketCloseColour: "DANGER"
|
|||||||
TicketDeleteColour: "DANGER"
|
TicketDeleteColour: "DANGER"
|
||||||
TicketLockColour: "PRIMARY"
|
TicketLockColour: "PRIMARY"
|
||||||
|
|
||||||
TicketDept1Colour: "PRIMARY"
|
|
||||||
TicketDept2Colour: "PRIMARY"
|
|
||||||
TicketDept3Colour: "PRIMARY"
|
|
||||||
|
|
||||||
TicketDept1Emoji: "1️⃣"
|
|
||||||
TicketDept2Emoji: "2️⃣"
|
|
||||||
TicketDept3Emoji: "3️⃣"
|
|
||||||
|
|
||||||
TranscriptSavedMessage: "📝 **Transcript Saved!**"
|
TranscriptSavedMessage: "📝 **Transcript Saved!**"
|
||||||
TicketLockMessage: "❌ **Ticket Locked!**"
|
TicketLockMessage: "❌ **Ticket Locked!**"
|
||||||
TicketDeleteMessage: "⚠ **Ticket Deleting!**" # Tickets deleting after 5 seconds by default.
|
TicketDeleteMessage: "⚠ **Ticket Deleting!**" # Tickets deleting after 5 seconds by default.
|
||||||
TicketDeleteTime: 5000 # Time must be set in milliseconds.
|
|
||||||
|
|
||||||
# --- Departments Config ---
|
# --- Departments Config ---
|
||||||
# --- Start ---
|
# --- Start ---
|
||||||
|
|
||||||
TicketDepartments: true
|
TicketDepartments: true
|
||||||
|
# Delete the ticket if no department selected. TIME IN MINUTES
|
||||||
|
Timeout: 5
|
||||||
|
# Set to true to allow all staff to access the ticket
|
||||||
|
AllowAllStaff: false
|
||||||
|
|
||||||
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.
|
# Ticket roles are the roles that will be able to gain access to tickets depending on what department has been chosen.
|
||||||
|
|
||||||
|
Departments:
|
||||||
|
- title: "General Support"
|
||||||
|
role: "Support"
|
||||||
|
color: "PRIMARY"
|
||||||
|
emoji: "1️⃣"
|
||||||
|
category: "Tickets"
|
||||||
|
- title: "Billing Support"
|
||||||
|
role: "Support"
|
||||||
|
color: "PRIMARY"
|
||||||
|
emoji: "2️⃣"
|
||||||
|
category: "Billing"
|
||||||
|
- title: "Admin Team"
|
||||||
|
role: "Admin"
|
||||||
|
color: "PRIMARY"
|
||||||
|
emoji: "3️⃣"
|
||||||
|
category: "Tickets"
|
||||||
|
|
||||||
# --- Closing Config ---
|
# --- Closing Config ---
|
||||||
# --- Start ---
|
# --- Start ---
|
||||||
|
|
||||||
|
StaffOnly: true
|
||||||
ClosingTicket: ":warning: You have requested to close your support ticket."
|
ClosingTicket: ":warning: You have requested to close your support ticket."
|
||||||
ClosingConfirmation_Word: "confirm"
|
ClosingConfirmation_Word: "confirm"
|
||||||
CloseConfirmation: false
|
CloseConfirmation: false
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ ButtonEmoji: "📩"
|
|||||||
ButtonLabel: "Open Ticket"
|
ButtonLabel: "Open Ticket"
|
||||||
ButtonColour: "SUCCESS"
|
ButtonColour: "SUCCESS"
|
||||||
# Colour Options:
|
# Colour Options:
|
||||||
# -> PRIMARY - Blurple
|
# -> PRIMARY - Purple
|
||||||
# -> SECONDARY - Grey
|
# -> SECONDARY - Grey
|
||||||
# -> SUCCESS - Green
|
# -> SUCCESS - Green
|
||||||
# -> DANGER - Red
|
# -> DANGER - Red
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
{
|
{
|
||||||
"854057237495676938": {
|
"tickets": []
|
||||||
"id": 2
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,3 +1 @@
|
|||||||
{
|
{"id":0,"TicketPanelID":"947337678720999458"}
|
||||||
"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,32 @@
|
|||||||
|
|
||||||
|
const Discord = require('discord.js');
|
||||||
|
const fs = require("fs");
|
||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = new Event("guildMemberAdd", async (client, member, interaction, guild) => {
|
||||||
|
|
||||||
|
const WelcomeChannel = interaction.guild.channels.get(supportbot.WelcomeChannel)
|
||||||
|
|
||||||
|
const WelcomeEmbed = new Discord.MessageEmbed()
|
||||||
|
.setColor(supportbot.WelcomeColour)
|
||||||
|
.setTitle(supportbot.WelcomeTitle)
|
||||||
|
.setDescription(supportbot.WelcomeMessage.replace(/%joined_user%/g, member.user))
|
||||||
|
.setThumbnail(member.user.displayAvatarURL())
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
member.guild.channels.cache.get(
|
||||||
|
supportbot.WelcomeChannel).send({
|
||||||
|
embeds: [WelcomeEmbed]
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const WelcomeMsg = await WelcomeChannel.send({
|
||||||
|
embeds: [WelcomeEmbed]
|
||||||
|
});
|
||||||
|
|
||||||
|
});
|
||||||
+33
-85
@@ -12,14 +12,13 @@ const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
|||||||
|
|
||||||
const Event = require("../Structures/Event.js");
|
const Event = require("../Structures/Event.js");
|
||||||
|
|
||||||
module.exports = new Event("interactionCreate", (client, interaction) => {
|
module.exports = new Event("interactionCreate", async (client, interaction) => {
|
||||||
if (interaction.isCommand()) {
|
if (interaction.isCommand()) {
|
||||||
const command = client.commands.find(
|
const command = client.commands.find(
|
||||||
(cmd) => cmd.name.toLowerCase() == interaction.commandName
|
(cmd) => cmd.name.toLowerCase() === interaction.commandName
|
||||||
);
|
);
|
||||||
|
|
||||||
if (interaction.user.bot || !interaction.isCommand() || !interaction.guild)
|
if (interaction.user.bot || !interaction.guild) return;
|
||||||
return;
|
|
||||||
|
|
||||||
const NotValid = new Discord.MessageEmbed()
|
const NotValid = new Discord.MessageEmbed()
|
||||||
.setDescription(`:x: \`Invalid Command\` `)
|
.setDescription(`:x: \`Invalid Command\` `)
|
||||||
@@ -30,7 +29,7 @@ module.exports = new Event("interactionCreate", (client, interaction) => {
|
|||||||
embeds: [NotValid],
|
embeds: [NotValid],
|
||||||
});
|
});
|
||||||
|
|
||||||
const permission = interaction.member.permissions.has(command.permission);
|
const permission = interaction.member.permissions.has(command.permissions);
|
||||||
|
|
||||||
const ValidPerms = new Discord.MessageEmbed()
|
const ValidPerms = new Discord.MessageEmbed()
|
||||||
.setDescription(
|
.setDescription(
|
||||||
@@ -42,11 +41,13 @@ module.exports = new Event("interactionCreate", (client, interaction) => {
|
|||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
embeds: [ValidPerms],
|
embeds: [ValidPerms],
|
||||||
});
|
});
|
||||||
interaction.user = interaction.user;
|
|
||||||
command.run(interaction);
|
command.run(interaction);
|
||||||
}
|
}
|
||||||
if (interaction.isButton()) {
|
if (interaction.isButton()) {
|
||||||
if (interaction.customId === "openticket") {
|
if (
|
||||||
|
interaction.customId === "openticket" ||
|
||||||
|
interaction.customId.includes("department-")
|
||||||
|
) {
|
||||||
try {
|
try {
|
||||||
const cmd = client.commands.get(cmdconfig.OpenTicket);
|
const cmd = client.commands.get(cmdconfig.OpenTicket);
|
||||||
if (!cmd) return;
|
if (!cmd) return;
|
||||||
@@ -57,79 +58,17 @@ module.exports = new Event("interactionCreate", (client, interaction) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (interaction.customId === "ticketclose") {
|
if (interaction.customId === "ticketclose") {
|
||||||
if (interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
|
try {
|
||||||
interaction.message.fetch();
|
const cmd = client.commands.get(cmdconfig.CloseTicket);
|
||||||
interaction.deferUpdate();
|
if (!cmd) return;
|
||||||
const DeleteTicketEmbed = new Discord.MessageEmbed()
|
cmd.run(interaction);
|
||||||
.setDescription(supportbot.TicketDeleteMessage)
|
} catch (error) {
|
||||||
.setColor(supportbot.EmbedColour);
|
console.error(error);
|
||||||
interaction.channel.send({ embeds: [DeleteTicketEmbed] });
|
|
||||||
|
|
||||||
let logChannel =
|
|
||||||
interaction.guild.channels.cache.find(
|
|
||||||
(channel) => channel.name === supportbot.TranscriptLog
|
|
||||||
) ||
|
|
||||||
interaction.guild.channels.cache.find(
|
|
||||||
(channel) => channel.id === supportbot.TranscriptLog
|
|
||||||
);
|
|
||||||
|
|
||||||
let user = interaction.user;
|
|
||||||
let name = interaction.channel.name;
|
|
||||||
let ticketChannel = interaction.channel;
|
|
||||||
let reason = "No Reason Provided.";
|
|
||||||
|
|
||||||
interaction.channel
|
|
||||||
.send({ content: `**${supportbot.ClosingTicket}**` })
|
|
||||||
.then(() => {
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.TranscriptTitle)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.addField("Closed By", user.username)
|
|
||||||
.addField("Reason", reason);
|
|
||||||
|
|
||||||
interaction.channel.messages.fetch({ limit: 100 }).then((msgs) => {
|
|
||||||
let html = "";
|
|
||||||
|
|
||||||
msgs = msgs.sort(
|
|
||||||
(a, b) => a.createdTimestamp - b.createdTimestamp
|
|
||||||
);
|
|
||||||
html += `<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> ${ticketChannel.name}<br>`;
|
|
||||||
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
|
||||||
|
|
||||||
msgs.forEach((msg) => {
|
|
||||||
if (msg.content) {
|
|
||||||
html += `<strong>User:</strong> ${msg.author.tag}<br>`;
|
|
||||||
html += `<strong>Message:</strong> ${msg.content}<br>`;
|
|
||||||
html += `-----<br><br>`;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
const TranscriptSavedEmbed = new Discord.MessageEmbed()
|
|
||||||
.setDescription(supportbot.TranscriptSavedMessage)
|
|
||||||
.setColor(supportbot.SuccessColour);
|
|
||||||
interaction.channel.send({ embeds: [TranscriptSavedEmbed] });
|
|
||||||
|
|
||||||
let file = new Discord.MessageAttachment(
|
|
||||||
Buffer.from(html),
|
|
||||||
`${name}.html`
|
|
||||||
);
|
|
||||||
logChannel.send({ embeds: [logEmbed], files: [file] });
|
|
||||||
|
|
||||||
setTimeout(
|
|
||||||
() => interaction.channel.delete(),
|
|
||||||
supportbot.TicketDeleteTime
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (interaction.customId === "ticketlock") {
|
if (interaction.customId === "ticketlock") {
|
||||||
if (interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
|
if (interaction.channel.name.startsWith(supportbot.TicketPrefix)) {
|
||||||
interaction.message.fetch();
|
interaction.message.fetch();
|
||||||
interaction.deferUpdate();
|
|
||||||
let Admin =
|
let Admin =
|
||||||
interaction.guild.roles.cache.find(
|
interaction.guild.roles.cache.find(
|
||||||
(AdminUser) => AdminUser.name === supportbot.Admin
|
(AdminUser) => AdminUser.name === supportbot.Admin
|
||||||
@@ -137,29 +76,38 @@ module.exports = new Event("interactionCreate", (client, interaction) => {
|
|||||||
interaction.guild.roles.cache.find(
|
interaction.guild.roles.cache.find(
|
||||||
(AdminUser) => AdminUser.id === supportbot.Admin
|
(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 all = interaction.channel.permissionOverwrites.cache;
|
||||||
|
|
||||||
let parent =
|
let parent =
|
||||||
interaction.guild.channels.cache.find(
|
interaction.guild.channels.cache.find(
|
||||||
(c) => c.name === `${supportbot.LockTicketCategory}`
|
(c) => c.name === supportbot.LockTicketCategory
|
||||||
) ||
|
) ||
|
||||||
interaction.guild.channels.cache.find(
|
interaction.guild.channels.cache.find(
|
||||||
(c) => c.id === `${supportbot.LockTicketCategory}`
|
(c) => c.id === supportbot.LockTicketCategory
|
||||||
);
|
);
|
||||||
if (parent) {
|
if (parent) {
|
||||||
interaction.channel.setParent(parent.id);
|
await interaction.channel.setParent(parent.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
all.forEach((perm) => {
|
all.forEach((perm) => {
|
||||||
interaction.channel.permissionOverwrites.delete(perm.id);
|
interaction.channel.permissionOverwrites.delete(perm.id);
|
||||||
});
|
});
|
||||||
interaction.channel.permissionOverwrites.create(Admin.id, {
|
await interaction.channel.permissionOverwrites.create(Admin.id, {
|
||||||
VIEW_CHANNEL: true,
|
VIEW_CHANNEL: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.create(interaction.guild.id, {
|
await interaction.channel.permissionOverwrites.create(
|
||||||
VIEW_CHANNEL: false,
|
interaction.guild.id,
|
||||||
});
|
{
|
||||||
|
VIEW_CHANNEL: false,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
const ticketDeleteButton = new Discord.MessageButton()
|
const ticketDeleteButton = new Discord.MessageButton()
|
||||||
.setCustomId("ticketclose")
|
.setCustomId("ticketclose")
|
||||||
@@ -173,9 +121,9 @@ module.exports = new Event("interactionCreate", (client, interaction) => {
|
|||||||
const ArchiveEmbed = new Discord.MessageEmbed()
|
const ArchiveEmbed = new Discord.MessageEmbed()
|
||||||
.setTitle("Archived")
|
.setTitle("Archived")
|
||||||
.setDescription(`Archived ${interaction.channel.name}`)
|
.setDescription(`Archived ${interaction.channel.name}`)
|
||||||
.setColor(`${supportbot.SuccessColour}`);
|
.setColor(supportbot.SuccessColour);
|
||||||
|
|
||||||
interaction.channel.send({ embeds: [ArchiveEmbed] });
|
interaction.reply({ embeds: [ArchiveEmbed] });
|
||||||
interaction.message.edit({ components: [row] });
|
interaction.message.edit({ components: [row] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+104
-15
@@ -14,7 +14,8 @@ const panelconfig = yaml.load(
|
|||||||
|
|
||||||
const Event = require("../Structures/Event.js");
|
const Event = require("../Structures/Event.js");
|
||||||
|
|
||||||
module.exports = new Event("ready", (client) => {
|
module.exports = new Event("ready", async (client, interaction) => {
|
||||||
|
const { getRole, getChannel, getCategory } = client;
|
||||||
client.user.setActivity(supportbot.BotActivity, {
|
client.user.setActivity(supportbot.BotActivity, {
|
||||||
type: supportbot.ActivityType,
|
type: supportbot.ActivityType,
|
||||||
url: supportbot.StreamingURL,
|
url: supportbot.StreamingURL,
|
||||||
@@ -37,6 +38,14 @@ module.exports = new Event("ready", (client) => {
|
|||||||
`\u001b[36m`,
|
`\u001b[36m`,
|
||||||
`Connected to Discord`
|
`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(
|
console.log(
|
||||||
`\u001b[33m`,
|
`\u001b[33m`,
|
||||||
`Resources:`,
|
`Resources:`,
|
||||||
@@ -47,7 +56,7 @@ module.exports = new Event("ready", (client) => {
|
|||||||
`\u001b[33m`,
|
`\u001b[33m`,
|
||||||
`Documentation:`,
|
`Documentation:`,
|
||||||
`\u001b[36m`,
|
`\u001b[36m`,
|
||||||
`https://supportbot.emeraldsrv.dev`
|
`https://emeraldsrv.dev/wiki/supportbot`
|
||||||
);
|
);
|
||||||
console.log(
|
console.log(
|
||||||
`\u001b[33m`,
|
`\u001b[33m`,
|
||||||
@@ -65,10 +74,76 @@ module.exports = new Event("ready", (client) => {
|
|||||||
console.log(`\u001b[37m`, `SupportBot proudly created by Emerald Services`);
|
console.log(`\u001b[37m`, `SupportBot proudly created by Emerald Services`);
|
||||||
console.log(` `);
|
console.log(` `);
|
||||||
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||||
|
if (client.guilds.cache.size !== 1) {
|
||||||
|
console.log(
|
||||||
|
`\u001b[31m`,
|
||||||
|
`${client.user.username} must be in only 1 server. Please join this server, leave any others, 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,
|
||||||
|
];
|
||||||
|
if (supportbot.TicketDepartments) {
|
||||||
|
supportbot.Departments.forEach((department) => roles.push(department.role));
|
||||||
|
}
|
||||||
|
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) {
|
if (panelconfig.TicketPanel) {
|
||||||
let chan1 = client.channels.cache.find(
|
let chan1 = await client.getChannel(
|
||||||
(channel) => channel.name === panelconfig.Channel
|
panelconfig.Channel,
|
||||||
|
client.guilds.cache.first()
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!chan1) {
|
if (!chan1) {
|
||||||
@@ -83,11 +158,14 @@ module.exports = new Event("ready", (client) => {
|
|||||||
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
||||||
);
|
);
|
||||||
|
|
||||||
chan1.messages.fetch(panelid.TicketPanelID).catch(async (r) => {
|
chan1.messages.fetch(panelid.TicketPanelID).catch(async () => {
|
||||||
let embed = new Discord.MessageEmbed()
|
let embed = new Discord.MessageEmbed()
|
||||||
.setTitle(`${panelconfig.PanelTitle}`)
|
.setTitle(panelconfig.PanelTitle)
|
||||||
.setColor(supportbot.SuccessColour)
|
.setColor(supportbot.SuccessColour)
|
||||||
.setFooter(supportbot.EmbedFooter);
|
.setFooter({
|
||||||
|
text: supportbot.EmbedFooter,
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
});
|
||||||
|
|
||||||
if (panelconfig.TicketPanel_Description) {
|
if (panelconfig.TicketPanel_Description) {
|
||||||
embed.setDescription(panelconfig.PanelMessage);
|
embed.setDescription(panelconfig.PanelMessage);
|
||||||
@@ -100,12 +178,22 @@ module.exports = new Event("ready", (client) => {
|
|||||||
if (panelconfig.TicketPanel_Image) {
|
if (panelconfig.TicketPanel_Image) {
|
||||||
embed.setImage(panelconfig.PanelImage);
|
embed.setImage(panelconfig.PanelImage);
|
||||||
}
|
}
|
||||||
|
let button;
|
||||||
let button = new Discord.MessageButton()
|
if (supportbot.TicketDepartments) {
|
||||||
.setLabel(panelconfig.ButtonLabel)
|
button = supportbot.Departments.map((x) =>
|
||||||
.setCustomId("openticket")
|
new Discord.MessageButton()
|
||||||
.setStyle(panelconfig.ButtonColour);
|
.setCustomId("department-" + supportbot.Departments.indexOf(x))
|
||||||
|
.setLabel(x.title)
|
||||||
|
.setStyle(x.color)
|
||||||
|
.setEmoji(x.emoji)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
button = new Discord.MessageButton()
|
||||||
|
.setLabel(panelconfig.ButtonLabel)
|
||||||
|
.setCustomId("openticket")
|
||||||
|
.setStyle(panelconfig.ButtonColour)
|
||||||
|
.setEmoji(panelconfig.ButtonEmoji);
|
||||||
|
}
|
||||||
let row = new Discord.MessageActionRow().addComponents(button);
|
let row = new Discord.MessageActionRow().addComponents(button);
|
||||||
|
|
||||||
await chan1
|
await chan1
|
||||||
@@ -115,7 +203,8 @@ module.exports = new Event("ready", (client) => {
|
|||||||
})
|
})
|
||||||
.then((r) => {
|
.then((r) => {
|
||||||
let data = {
|
let data = {
|
||||||
TicketPanelID: `${r.id}`,
|
id: panelid.id,
|
||||||
|
TicketPanelID: r.id,
|
||||||
};
|
};
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
"./Data/ticket-panel-id.json",
|
"./Data/ticket-panel-id.json",
|
||||||
@@ -124,7 +213,7 @@ module.exports = new Event("ready", (client) => {
|
|||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log("Raw" + e);
|
console.log("Raw: " + e);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
|
|
||||||
## 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 };
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
// SupportBot | Emerald Services
|
|
||||||
// Addon Structure
|
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
|
|
||||||
const yaml = require("js-yaml");
|
|
||||||
const supportbot = yaml.load(
|
|
||||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
|
||||||
);
|
|
||||||
|
|
||||||
function RunFunction(interaction) {}
|
|
||||||
|
|
||||||
class Addon {
|
|
||||||
constructor(options) {
|
|
||||||
this.name = options.name;
|
|
||||||
this.description = options.description;
|
|
||||||
this.permission = options.permission;
|
|
||||||
this.slashCommandOptions = options.slashCommandOptions || [];
|
|
||||||
this.run = options.run;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = Addon;
|
|
||||||
+52
-55
@@ -4,8 +4,6 @@
|
|||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
const Discord = require("discord.js");
|
||||||
const Command = require("./Command.js");
|
|
||||||
const Event = require("./Event.js");
|
|
||||||
const intents = new Discord.Intents(32767);
|
const intents = new Discord.Intents(32767);
|
||||||
|
|
||||||
const yaml = require("js-yaml");
|
const yaml = require("js-yaml");
|
||||||
@@ -19,8 +17,27 @@ class Client extends Discord.Client {
|
|||||||
|
|
||||||
this.commands = new Discord.Collection();
|
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())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
start(token) {
|
async start(token) {
|
||||||
const commandFiles = fs
|
const commandFiles = fs
|
||||||
.readdirSync("./Commands")
|
.readdirSync("./Commands")
|
||||||
.filter((file) => file.endsWith(".js"));
|
.filter((file) => file.endsWith(".js"));
|
||||||
@@ -29,10 +46,15 @@ class Client extends Discord.Client {
|
|||||||
.readdirSync("./Addons")
|
.readdirSync("./Addons")
|
||||||
.filter((file) => file.endsWith(".js"));
|
.filter((file) => file.endsWith(".js"));
|
||||||
|
|
||||||
const addons = addonFiles.map((file) => require(`../Addons/${file}`));
|
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}`));
|
const commands = commandFiles.map((file) => require(`../Commands/${file}`));
|
||||||
|
|
||||||
|
// Commands
|
||||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
commands.forEach((cmd) => {
|
commands.forEach((cmd) => {
|
||||||
@@ -40,6 +62,11 @@ class Client extends Discord.Client {
|
|||||||
this.commands.set(cmd.name, cmd);
|
this.commands.set(cmd.name, cmd);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
||||||
|
// Addons
|
||||||
|
console.log(" ");
|
||||||
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
addons.forEach((addon) => {
|
addons.forEach((addon) => {
|
||||||
console.log(
|
console.log(
|
||||||
`\u001b[33m`,
|
`\u001b[33m`,
|
||||||
@@ -49,57 +76,23 @@ class Client extends Discord.Client {
|
|||||||
`\u001b[32;1m`,
|
`\u001b[32;1m`,
|
||||||
"Loaded"
|
"Loaded"
|
||||||
);
|
);
|
||||||
this.commands.set(addon.name, addon);
|
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`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬");
|
||||||
|
|
||||||
// Slash Commands
|
// Slash Commands
|
||||||
|
|
||||||
const slashCommands = commands.map((cmd) => ({
|
this.once("ready", async () => {
|
||||||
name: cmd.name.toLowerCase(),
|
await this.guilds.cache.first()?.commands.set(this.commands);
|
||||||
description: cmd.description,
|
console.log(
|
||||||
permissions: [],
|
`\u001b[32;1m`,
|
||||||
options: cmd.slashCommandOptions,
|
`Slash Commands Registered for ${this.guilds.cache.first().name}`
|
||||||
defaultPermission: true,
|
|
||||||
}));
|
|
||||||
|
|
||||||
const slashCommands1 = addons.map((addon) => ({
|
|
||||||
name: addon.name.toLowerCase(),
|
|
||||||
description: addon.description,
|
|
||||||
permissions: [],
|
|
||||||
options: addon.slashCommandOptions,
|
|
||||||
defaultPermission: true,
|
|
||||||
}));
|
|
||||||
|
|
||||||
this.removeAllListeners();
|
|
||||||
|
|
||||||
this.on("ready", async () => {
|
|
||||||
const allCommands = slashCommands.concat(slashCommands1);
|
|
||||||
await this.application?.commands.set(allCommands);
|
|
||||||
|
|
||||||
console.log(" ");
|
|
||||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Slash Command ▬▬▬▬▬▬▬"),
|
|
||||||
console.log(" ");
|
|
||||||
|
|
||||||
slashCommands.forEach((cmd) =>
|
|
||||||
console.log(
|
|
||||||
`\u001b[31;1m`,
|
|
||||||
`${cmd.name}`,
|
|
||||||
`\u001b[32;1m`,
|
|
||||||
`| Slash Command Registered`
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
slashCommands1.forEach((addon) =>
|
|
||||||
console.log(
|
|
||||||
`\u001b[33m`,
|
|
||||||
`[ADDON]`,
|
|
||||||
`\u001b[31;1m`,
|
|
||||||
`${addon.name}`,
|
|
||||||
`\u001b[32;1m`,
|
|
||||||
`| Slash Command Registered`
|
|
||||||
)
|
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -111,14 +104,18 @@ class Client extends Discord.Client {
|
|||||||
.forEach((file) => {
|
.forEach((file) => {
|
||||||
const event = require(`../Events/${file}`);
|
const event = require(`../Events/${file}`);
|
||||||
console.log(`\u001b[31;1m`, `${event.event}`, `\u001b[32;1m`, "Loaded");
|
console.log(`\u001b[31;1m`, `${event.event}`, `\u001b[32;1m`, "Loaded");
|
||||||
|
this.on(event.event, (...args) => event.run(this, ...args));
|
||||||
this.on(event.event, event.run.bind(null, this));
|
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
|
||||||
console.log(" ");
|
if (process.argv[2] !== "test") {
|
||||||
|
await this.login(token);
|
||||||
this.login(token);
|
} else {
|
||||||
|
console.log(
|
||||||
|
`\u001b[31;1m`,
|
||||||
|
"RUNNING IN TEST MODE, IF NOT INTENDED, PLEASE USE npm start"
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-14
@@ -1,25 +1,14 @@
|
|||||||
// SupportBot | Emerald Services
|
// SupportBot | Emerald Services
|
||||||
// Command Structure
|
// Command Structure
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
|
|
||||||
const yaml = require("js-yaml");
|
|
||||||
const supportbot = yaml.load(
|
|
||||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
|
||||||
);
|
|
||||||
|
|
||||||
function RunFunction(interaction) {}
|
|
||||||
|
|
||||||
class Command {
|
class Command {
|
||||||
constructor(options) {
|
constructor(options) {
|
||||||
this.name = options.name;
|
this.name = options.name;
|
||||||
this.description = options.description;
|
this.description = options.description;
|
||||||
this.permission = options.permission;
|
this.permissions = options.permissions || [];
|
||||||
this.slashCommandOptions = options.slashCommandOptions || [];
|
this.options = options.options || [];
|
||||||
this.run = options.run;
|
this.run = options.run;
|
||||||
|
this.defaultPermission = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Command;
|
module.exports = Command;
|
||||||
+2
-14
@@ -1,21 +1,9 @@
|
|||||||
// SupportBot | Emerald Services
|
// SupportBot | Emerald Services
|
||||||
// Event Structure
|
// Event Structure
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
|
|
||||||
const yaml = require("js-yaml");
|
|
||||||
const supportbot = yaml.load(
|
|
||||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
|
||||||
);
|
|
||||||
|
|
||||||
function RunFunction(client, ...eventArgs) {}
|
|
||||||
|
|
||||||
class Event {
|
class Event {
|
||||||
constructor(event, runFunction) {
|
constructor(event, run) {
|
||||||
this.event = event;
|
this.event = event;
|
||||||
this.run = runFunction;
|
this.run = run;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+19
-64
@@ -3,89 +3,44 @@
|
|||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const Command = require("./Command.js");
|
|
||||||
const Client = require("./Client.js");
|
|
||||||
const Event = require("./Event.js");
|
|
||||||
|
|
||||||
const yaml = require("js-yaml");
|
|
||||||
const supportbot = yaml.load(
|
|
||||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
|
||||||
);
|
|
||||||
|
|
||||||
class TicketNumberID {
|
class TicketNumberID {
|
||||||
static pad(guildId) {
|
static async pad() {
|
||||||
let n = this.get(guildId) + "";
|
let num = await this.get();
|
||||||
let z = "0";
|
let n = num + "";
|
||||||
let width = 4;
|
await this.set(num + 1);
|
||||||
setTimeout(() => {
|
return n.length >= 4 ? n : new Array(4 - n.length + 1).join("0") + n;
|
||||||
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) {
|
static async get() {
|
||||||
let ticketnumberID = JSON.parse(
|
let ticketnumberID = await JSON.parse(
|
||||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
||||||
);
|
);
|
||||||
|
if (!ticketnumberID.id) {
|
||||||
if (!ticketnumberID[guildId]) {
|
return this.set(0);
|
||||||
ticketnumberID[guildId] = {
|
|
||||||
id: 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
fs.writeFileSync(
|
|
||||||
"./Data/TicketData.json",
|
|
||||||
JSON.stringify(ticketnumberID, null, 4),
|
|
||||||
(err) => {
|
|
||||||
if (err) console.log(err);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
} else {
|
} else {
|
||||||
return ticketnumberID[guildId].id;
|
return ticketnumberID.id;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static set(guildId, value) {
|
static async set(value) {
|
||||||
let ticketnumberID = JSON.parse(
|
let ticketnumberID = await JSON.parse(
|
||||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
|
||||||
);
|
);
|
||||||
|
|
||||||
ticketnumberID[guildId] = {
|
ticketnumberID.id = value;
|
||||||
id: value,
|
|
||||||
};
|
|
||||||
|
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
"./Data/TicketData.json",
|
"./Data/ticket-panel-id.json",
|
||||||
JSON.stringify(ticketnumberID, null, 4),
|
JSON.stringify(ticketnumberID, null, 4),
|
||||||
(err) => {
|
(err) => {
|
||||||
if (err) console.log(err);
|
if (err) console.error(err);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static reset(guildId) {
|
static async reset() {
|
||||||
let ticketnumberID = JSON.parse(
|
return await this.set(0);
|
||||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
|
||||||
);
|
|
||||||
|
|
||||||
ticketnumberID[guildId] = {
|
|
||||||
id: 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
fs.writeFileSync(
|
|
||||||
"./Data/TicketData.json",
|
|
||||||
JSON.stringify(ticketnumberID, null, 4),
|
|
||||||
(err) => {
|
|
||||||
if (err) console.log(err);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@
|
|||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
const Discord = require("discord.js");
|
|
||||||
const yaml = require("js-yaml");
|
const yaml = require("js-yaml");
|
||||||
const supportbot = yaml.load(
|
const supportbot = yaml.load(
|
||||||
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
|||||||
Generated
+187
-254
@@ -1,54 +1,81 @@
|
|||||||
{
|
{
|
||||||
"name": "supportbot",
|
"name": "supportbot",
|
||||||
"version": "7.3.0",
|
"version": "7.4.2",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "supportbot",
|
"name": "supportbot",
|
||||||
"version": "7.3.0",
|
"version": "7.4.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"discord.js": "^13.2.0",
|
"discord.js": "^13.6.0",
|
||||||
"js-yaml": "^4.1.0"
|
"js-yaml": "^4.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@discordjs/builders": {
|
"node_modules/@discordjs/builders": {
|
||||||
"version": "0.6.0",
|
"version": "0.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.11.0.tgz",
|
||||||
"integrity": "sha512-mH3Gx61LKk2CD05laCI9K5wp+a3NyASHDUGx83DGJFkqJlRlSV5WMJNY6RS37A5SjqDtGMF4wVR9jzFaqShe6Q==",
|
"integrity": "sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@sindresorhus/is": "^4.0.1",
|
"@sindresorhus/is": "^4.2.0",
|
||||||
"discord-api-types": "^0.22.0",
|
"discord-api-types": "^0.26.0",
|
||||||
"ow": "^0.27.0",
|
|
||||||
"ts-mixer": "^6.0.0",
|
"ts-mixer": "^6.0.0",
|
||||||
"tslib": "^2.3.1"
|
"tslib": "^2.3.1",
|
||||||
|
"zod": "^3.11.6"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0",
|
"node": ">=16.0.0",
|
||||||
"npm": ">=7.0.0"
|
"npm": ">=7.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@discordjs/builders/node_modules/discord-api-types": {
|
|
||||||
"version": "0.22.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
|
||||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=12"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@discordjs/collection": {
|
"node_modules/@discordjs/collection": {
|
||||||
"version": "0.2.1",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz",
|
||||||
"integrity": "sha512-vhxqzzM8gkomw0TYRF3tgx7SwElzUlXT/Aa41O7mOcyN6wIJfj5JmDWaO5XGKsGSsNx7F3i5oIlrucCCWV1Nog==",
|
"integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=14.0.0"
|
"node": ">=16.0.0",
|
||||||
|
"npm": ">=7.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@discordjs/form-data": {
|
"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.17",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.17.tgz",
|
||||||
|
"integrity": "sha512-e8PUNQy1HgJGV3iU/Bp2+D/DXh3PYeyli8LgIwsQcs1Ar1LoaWHSIT6Rw+H2rNJmiq6SNWiDytfx8+gYj7wDHw=="
|
||||||
|
},
|
||||||
|
"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==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"asynckit": "^0.4.0",
|
"asynckit": "^0.4.0",
|
||||||
"combined-stream": "^1.0.8",
|
"combined-stream": "^1.0.8",
|
||||||
@@ -58,35 +85,10 @@
|
|||||||
"node": ">= 6"
|
"node": ">= 6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@sapphire/async-queue": {
|
|
||||||
"version": "1.1.7",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.7.tgz",
|
|
||||||
"integrity": "sha512-EBRERa9NqK/EV6DIPBVtjjdHBsu/DSdMuYAydmoIyIPONzp0UAxf2G6JGJ52WkiONtPRx6KNuqB5Q8dm14fwyw==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=v14.0.0",
|
|
||||||
"npm": ">=7.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@sindresorhus/is": {
|
|
||||||
"version": "4.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz",
|
|
||||||
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sindresorhus/is?sponsor=1"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/@types/node": {
|
|
||||||
"version": "16.11.4",
|
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.4.tgz",
|
|
||||||
"integrity": "sha512-TMgXmy0v2xWyuCSCJM6NCna2snndD8yvQF67J29ipdzMcsPa9u+o0tjF5+EQNdhcuZplYuouYqpc4zcd5I6amQ=="
|
|
||||||
},
|
|
||||||
"node_modules/@types/ws": {
|
"node_modules/@types/ws": {
|
||||||
"version": "8.2.0",
|
"version": "8.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz",
|
||||||
"integrity": "sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg==",
|
"integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
@@ -101,14 +103,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="
|
||||||
},
|
},
|
||||||
"node_modules/callsites": {
|
|
||||||
"version": "3.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
|
||||||
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=6"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/combined-stream": {
|
"node_modules/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",
|
||||||
@@ -129,52 +123,44 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/discord-api-types": {
|
"node_modules/discord-api-types": {
|
||||||
"version": "0.23.1",
|
"version": "0.26.1",
|
||||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
|
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz",
|
||||||
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ==",
|
"integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/discord.js": {
|
"node_modules/discord.js": {
|
||||||
"version": "13.2.0",
|
"version": "13.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.6.0.tgz",
|
||||||
"integrity": "sha512-nyxUvL8wuQG38zx13wUMkpcA8koFszyiXdkSLwwM9opKW2LC2H5gD0cTZxImeJ6GtEnKPWT8xBiE8lLBmbNIhw==",
|
"integrity": "sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/builders": "^0.6.0",
|
"@discordjs/builders": "^0.11.0",
|
||||||
"@discordjs/collection": "^0.2.1",
|
"@discordjs/collection": "^0.4.0",
|
||||||
"@discordjs/form-data": "^3.0.1",
|
"@sapphire/async-queue": "^1.1.9",
|
||||||
"@sapphire/async-queue": "^1.1.5",
|
"@types/node-fetch": "^2.5.12",
|
||||||
"@types/ws": "^8.2.0",
|
"@types/ws": "^8.2.2",
|
||||||
"discord-api-types": "^0.23.1",
|
"discord-api-types": "^0.26.0",
|
||||||
|
"form-data": "^4.0.0",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"ws": "^8.2.3"
|
"ws": "^8.4.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.6.0",
|
"node": ">=16.6.0",
|
||||||
"npm": ">=7.0.0"
|
"npm": ">=7.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/dot-prop": {
|
"node_modules/form-data": {
|
||||||
"version": "6.0.1",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
||||||
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
|
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"is-obj": "^2.0.0"
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10"
|
"node": ">= 6"
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/is-obj": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=8"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/js-yaml": {
|
"node_modules/js-yaml": {
|
||||||
@@ -188,58 +174,42 @@
|
|||||||
"js-yaml": "bin/js-yaml.js"
|
"js-yaml": "bin/js-yaml.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/lodash.isequal": {
|
|
||||||
"version": "4.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
|
|
||||||
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
|
|
||||||
},
|
|
||||||
"node_modules/mime-db": {
|
"node_modules/mime-db": {
|
||||||
"version": "1.50.0",
|
"version": "1.51.0",
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz",
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz",
|
||||||
"integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A==",
|
"integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.6"
|
"node": ">= 0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/mime-types": {
|
"node_modules/mime-types": {
|
||||||
"version": "2.1.33",
|
"version": "2.1.34",
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz",
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz",
|
||||||
"integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==",
|
"integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"mime-db": "1.50.0"
|
"mime-db": "1.51.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">= 0.6"
|
"node": ">= 0.6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/node-fetch": {
|
"node_modules/node-fetch": {
|
||||||
"version": "2.6.5",
|
"version": "2.6.7",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||||
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
|
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"whatwg-url": "^5.0.0"
|
"whatwg-url": "^5.0.0"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": "4.x || >=6.0.0"
|
"node": "4.x || >=6.0.0"
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/ow": {
|
|
||||||
"version": "0.27.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz",
|
|
||||||
"integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"@sindresorhus/is": "^4.0.1",
|
|
||||||
"callsites": "^3.1.0",
|
|
||||||
"dot-prop": "^6.0.1",
|
|
||||||
"lodash.isequal": "^4.5.0",
|
|
||||||
"type-fest": "^1.2.1",
|
|
||||||
"vali-date": "^1.0.0"
|
|
||||||
},
|
},
|
||||||
"engines": {
|
"peerDependencies": {
|
||||||
"node": ">=12"
|
"encoding": "^0.1.0"
|
||||||
},
|
},
|
||||||
"funding": {
|
"peerDependenciesMeta": {
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"encoding": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/tr46": {
|
"node_modules/tr46": {
|
||||||
@@ -257,25 +227,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
},
|
},
|
||||||
"node_modules/type-fest": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
|
|
||||||
"integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA==",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=10"
|
|
||||||
},
|
|
||||||
"funding": {
|
|
||||||
"url": "https://github.com/sponsors/sindresorhus"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/vali-date": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY=",
|
|
||||||
"engines": {
|
|
||||||
"node": ">=0.10.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/webidl-conversions": {
|
"node_modules/webidl-conversions": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||||
@@ -291,9 +242,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ws": {
|
"node_modules/ws": {
|
||||||
"version": "8.2.3",
|
"version": "8.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz",
|
||||||
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
|
"integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=10.0.0"
|
"node": ">=10.0.0"
|
||||||
},
|
},
|
||||||
@@ -309,62 +260,74 @@
|
|||||||
"optional": true
|
"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": {
|
"dependencies": {
|
||||||
"@discordjs/builders": {
|
"@discordjs/builders": {
|
||||||
"version": "0.6.0",
|
"version": "0.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-0.11.0.tgz",
|
||||||
"integrity": "sha512-mH3Gx61LKk2CD05laCI9K5wp+a3NyASHDUGx83DGJFkqJlRlSV5WMJNY6RS37A5SjqDtGMF4wVR9jzFaqShe6Q==",
|
"integrity": "sha512-ZTB8yJdJKrKlq44dpWkNUrAtEJEq0gqpb7ASdv4vmq6/mZal5kOv312hQ56I/vxwMre+VIkoHquNUAfnTbiYtg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@sindresorhus/is": "^4.0.1",
|
"@sindresorhus/is": "^4.2.0",
|
||||||
"discord-api-types": "^0.22.0",
|
"discord-api-types": "^0.26.0",
|
||||||
"ow": "^0.27.0",
|
|
||||||
"ts-mixer": "^6.0.0",
|
"ts-mixer": "^6.0.0",
|
||||||
"tslib": "^2.3.1"
|
"tslib": "^2.3.1",
|
||||||
},
|
"zod": "^3.11.6"
|
||||||
"dependencies": {
|
|
||||||
"discord-api-types": {
|
|
||||||
"version": "0.22.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.22.0.tgz",
|
|
||||||
"integrity": "sha512-l8yD/2zRbZItUQpy7ZxBJwaLX/Bs2TGaCthRppk8Sw24LOIWg12t9JEreezPoYD0SQcC2htNNo27kYEpYW/Srg=="
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@discordjs/collection": {
|
"@discordjs/collection": {
|
||||||
"version": "0.2.1",
|
"version": "0.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.4.0.tgz",
|
||||||
"integrity": "sha512-vhxqzzM8gkomw0TYRF3tgx7SwElzUlXT/Aa41O7mOcyN6wIJfj5JmDWaO5XGKsGSsNx7F3i5oIlrucCCWV1Nog=="
|
"integrity": "sha512-zmjq+l/rV35kE6zRrwe8BHqV78JvIh2ybJeZavBi5NySjWXqN3hmmAKg7kYMMXSeiWtSsMoZ/+MQi0DiQWy2lw=="
|
||||||
},
|
|
||||||
"@discordjs/form-data": {
|
|
||||||
"version": "3.0.1",
|
|
||||||
"resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz",
|
|
||||||
"integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==",
|
|
||||||
"requires": {
|
|
||||||
"asynckit": "^0.4.0",
|
|
||||||
"combined-stream": "^1.0.8",
|
|
||||||
"mime-types": "^2.1.12"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"@sapphire/async-queue": {
|
"@sapphire/async-queue": {
|
||||||
"version": "1.1.7",
|
"version": "1.2.0",
|
||||||
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.1.7.tgz",
|
"resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.2.0.tgz",
|
||||||
"integrity": "sha512-EBRERa9NqK/EV6DIPBVtjjdHBsu/DSdMuYAydmoIyIPONzp0UAxf2G6JGJ52WkiONtPRx6KNuqB5Q8dm14fwyw=="
|
"integrity": "sha512-O5ND5Ljpef86X5oy8zXorQ754TMjWALcPSAgPBu4+76HLtDTrNoDyzU2uGE2G4A8Wv51u0MXHzGQ0WZ4GMtpIw=="
|
||||||
},
|
},
|
||||||
"@sindresorhus/is": {
|
"@sindresorhus/is": {
|
||||||
"version": "4.2.0",
|
"version": "4.4.0",
|
||||||
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.4.0.tgz",
|
||||||
"integrity": "sha512-VkE3KLBmJwcCaVARtQpfuKcKv8gcBmUubrfHGF84dXuuW6jgsRYxPtzcIhPyK9WAPpRt2/xY6zkD9MnRaJzSyw=="
|
"integrity": "sha512-QppPM/8l3Mawvh4rn9CNEYIU9bxpXUCRMaX9yUpvBk1nMKusLKpfXGDEKExKaPhLzcn3lzil7pR6rnJ11HgeRQ=="
|
||||||
},
|
},
|
||||||
"@types/node": {
|
"@types/node": {
|
||||||
"version": "16.11.4",
|
"version": "17.0.17",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.4.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.17.tgz",
|
||||||
"integrity": "sha512-TMgXmy0v2xWyuCSCJM6NCna2snndD8yvQF67J29ipdzMcsPa9u+o0tjF5+EQNdhcuZplYuouYqpc4zcd5I6amQ=="
|
"integrity": "sha512-e8PUNQy1HgJGV3iU/Bp2+D/DXh3PYeyli8LgIwsQcs1Ar1LoaWHSIT6Rw+H2rNJmiq6SNWiDytfx8+gYj7wDHw=="
|
||||||
|
},
|
||||||
|
"@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": {
|
"@types/ws": {
|
||||||
"version": "8.2.0",
|
"version": "8.2.2",
|
||||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.2.2.tgz",
|
||||||
"integrity": "sha512-cyeefcUCgJlEk+hk2h3N+MqKKsPViQgF5boi9TTHSK+PoR9KWBb/C5ccPcDyAqgsbAYHTwulch725DV84+pSpg==",
|
"integrity": "sha512-NOn5eIcgWLOo6qW8AcuLZ7G8PycXu0xTxxkS6Q18VWFxgPUSOwV0pBj2a/4viNZVu25i7RIB7GttdkAIUUXOOg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
@@ -379,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="
|
||||||
},
|
},
|
||||||
"callsites": {
|
|
||||||
"version": "3.1.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz",
|
|
||||||
"integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ=="
|
|
||||||
},
|
|
||||||
"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",
|
||||||
@@ -398,38 +356,36 @@
|
|||||||
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
"integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk="
|
||||||
},
|
},
|
||||||
"discord-api-types": {
|
"discord-api-types": {
|
||||||
"version": "0.23.1",
|
"version": "0.26.1",
|
||||||
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.23.1.tgz",
|
"resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.26.1.tgz",
|
||||||
"integrity": "sha512-igWmn+45mzXRWNEPU25I/pr8MwxHb767wAr51oy3VRLRcTlp5ADBbrBR0lq3SA1Rfw3MtM4TQu1xo3kxscfVdQ=="
|
"integrity": "sha512-T5PdMQ+Y1MEECYMV5wmyi9VEYPagEDEi4S0amgsszpWY0VB9JJ/hEvM6BgLhbdnKky4gfmZEXtEEtojN8ZKJQQ=="
|
||||||
},
|
},
|
||||||
"discord.js": {
|
"discord.js": {
|
||||||
"version": "13.2.0",
|
"version": "13.6.0",
|
||||||
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/discord.js/-/discord.js-13.6.0.tgz",
|
||||||
"integrity": "sha512-nyxUvL8wuQG38zx13wUMkpcA8koFszyiXdkSLwwM9opKW2LC2H5gD0cTZxImeJ6GtEnKPWT8xBiE8lLBmbNIhw==",
|
"integrity": "sha512-tXNR8zgsEPxPBvGk3AQjJ9ljIIC6/LOPjzKwpwz8Y1Q2X66Vi3ZqFgRHYwnHKC0jC0F+l4LzxlhmOJsBZDNg9g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@discordjs/builders": "^0.6.0",
|
"@discordjs/builders": "^0.11.0",
|
||||||
"@discordjs/collection": "^0.2.1",
|
"@discordjs/collection": "^0.4.0",
|
||||||
"@discordjs/form-data": "^3.0.1",
|
"@sapphire/async-queue": "^1.1.9",
|
||||||
"@sapphire/async-queue": "^1.1.5",
|
"@types/node-fetch": "^2.5.12",
|
||||||
"@types/ws": "^8.2.0",
|
"@types/ws": "^8.2.2",
|
||||||
"discord-api-types": "^0.23.1",
|
"discord-api-types": "^0.26.0",
|
||||||
|
"form-data": "^4.0.0",
|
||||||
"node-fetch": "^2.6.1",
|
"node-fetch": "^2.6.1",
|
||||||
"ws": "^8.2.3"
|
"ws": "^8.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"dot-prop": {
|
"form-data": {
|
||||||
"version": "6.0.1",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-6.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
|
||||||
"integrity": "sha512-tE7ztYzXHIeyvc7N+hR3oi7FIbf/NIjVP9hmAt3yMXzrQ072/fpjGLx2GxNxGxUl5V73MEqYzioOMoVhGMJ5cA==",
|
"integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"is-obj": "^2.0.0"
|
"asynckit": "^0.4.0",
|
||||||
|
"combined-stream": "^1.0.8",
|
||||||
|
"mime-types": "^2.1.12"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"is-obj": {
|
|
||||||
"version": "2.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz",
|
|
||||||
"integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w=="
|
|
||||||
},
|
|
||||||
"js-yaml": {
|
"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",
|
||||||
@@ -438,45 +394,27 @@
|
|||||||
"argparse": "^2.0.1"
|
"argparse": "^2.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"lodash.isequal": {
|
|
||||||
"version": "4.5.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
|
|
||||||
"integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA="
|
|
||||||
},
|
|
||||||
"mime-db": {
|
"mime-db": {
|
||||||
"version": "1.50.0",
|
"version": "1.51.0",
|
||||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.50.0.tgz",
|
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.51.0.tgz",
|
||||||
"integrity": "sha512-9tMZCDlYHqeERXEHO9f/hKfNXhre5dK2eE/krIvUjZbS2KPcqGDfNShIWS1uW9XOTKQKqK6qbeOci18rbfW77A=="
|
"integrity": "sha512-5y8A56jg7XVQx2mbv1lu49NR4dokRnhZYTtL+KGfaa27uq4pSTXkwQkFJl4pkRMyNFz/EtYDSkiiEHx3F7UN6g=="
|
||||||
},
|
},
|
||||||
"mime-types": {
|
"mime-types": {
|
||||||
"version": "2.1.33",
|
"version": "2.1.34",
|
||||||
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.33.tgz",
|
"resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.34.tgz",
|
||||||
"integrity": "sha512-plLElXp7pRDd0bNZHw+nMd52vRYjLwQjygaNg7ddJ2uJtTlmnTCjWuPKxVu6//AdaRuME84SvLW91sIkBqGT0g==",
|
"integrity": "sha512-6cP692WwGIs9XXdOO4++N+7qjqv0rqxxVvJ3VHPh/Sc9mVZcQP+ZGhkKiTvWMQRr2tbHkJP/Yn7Y0npb3ZBs4A==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"mime-db": "1.50.0"
|
"mime-db": "1.51.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node-fetch": {
|
"node-fetch": {
|
||||||
"version": "2.6.5",
|
"version": "2.6.7",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.5.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz",
|
||||||
"integrity": "sha512-mmlIVHJEu5rnIxgEgez6b9GgWXbkZj5YZ7fx+2r94a2E+Uirsp6HsPTPlomfdHtpt/B0cdKviwkoaM6pyvUOpQ==",
|
"integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"whatwg-url": "^5.0.0"
|
"whatwg-url": "^5.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ow": {
|
|
||||||
"version": "0.27.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/ow/-/ow-0.27.0.tgz",
|
|
||||||
"integrity": "sha512-SGnrGUbhn4VaUGdU0EJLMwZWSupPmF46hnTRII7aCLCrqixTAC5eKo8kI4/XXf1eaaI8YEVT+3FeGNJI9himAQ==",
|
|
||||||
"requires": {
|
|
||||||
"@sindresorhus/is": "^4.0.1",
|
|
||||||
"callsites": "^3.1.0",
|
|
||||||
"dot-prop": "^6.0.1",
|
|
||||||
"lodash.isequal": "^4.5.0",
|
|
||||||
"type-fest": "^1.2.1",
|
|
||||||
"vali-date": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"tr46": {
|
"tr46": {
|
||||||
"version": "0.0.3",
|
"version": "0.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz",
|
||||||
@@ -492,16 +430,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz",
|
||||||
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
"integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw=="
|
||||||
},
|
},
|
||||||
"type-fest": {
|
|
||||||
"version": "1.4.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-1.4.0.tgz",
|
|
||||||
"integrity": "sha512-yGSza74xk0UG8k+pLh5oeoYirvIiWo5t0/o3zHHAO2tRDiZcxWP7fywNlXhqb6/r6sWvwi+RsyQMWhVLe4BVuA=="
|
|
||||||
},
|
|
||||||
"vali-date": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/vali-date/-/vali-date-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-G5BKWWCfsyjvB4E4Qgk09rhnCaY="
|
|
||||||
},
|
|
||||||
"webidl-conversions": {
|
"webidl-conversions": {
|
||||||
"version": "3.0.1",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz",
|
||||||
@@ -517,10 +445,15 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"ws": {
|
"ws": {
|
||||||
"version": "8.2.3",
|
"version": "8.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz",
|
||||||
"integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==",
|
"integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==",
|
||||||
"requires": {}
|
"requires": {}
|
||||||
|
},
|
||||||
|
"zod": {
|
||||||
|
"version": "3.11.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/zod/-/zod-3.11.6.tgz",
|
||||||
|
"integrity": "sha512-daZ80A81I3/9lIydI44motWe6n59kRBfNzTuS2bfzVh1nAXi667TOTWWtatxyG+fwgNUiagSj/CWZwRRbevJIg=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
+4
-3
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "supportbot",
|
"name": "supportbot",
|
||||||
"version": "7.3.0",
|
"version": "7.4.2",
|
||||||
"description": "SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customization to match your own brand.",
|
"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": {
|
||||||
"start": "npm i && node index.js"
|
"start": "npm i && node index.js",
|
||||||
|
"test": "node index.js test"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
@@ -17,7 +18,7 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/Emerald-Services/SupportBot#readme",
|
"homepage": "https://github.com/Emerald-Services/SupportBot#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"discord.js": "^13.2.0",
|
"discord.js": "^13.6.0",
|
||||||
"js-yaml": "^4.1.0"
|
"js-yaml": "^4.1.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user