Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
44fbe9f2d6 | ||
|
|
29db6c7d67 | ||
|
|
69f0b00ed3 | ||
|
|
c1a1839457 | ||
|
|
dd4b53800e | ||
|
|
1fc94528fc | ||
|
|
bb1a817980 | ||
|
|
53305acbc7 | ||
|
|
d0f1bae0bd | ||
|
|
c0cf3b1bb7 | ||
|
|
ce67b668d5 | ||
|
|
3273cfd0e1 | ||
|
|
fd992a6514 | ||
|
|
550d681fe1 | ||
|
|
7d29226953 | ||
|
|
38da72ca91 | ||
|
|
eab11361cb | ||
|
|
b281bba36f | ||
|
|
5e38573aed | ||
|
|
da7b6d487c | ||
|
|
6bf4e5f4bb | ||
|
|
213f532a3c | ||
|
|
45bd88e4d2 | ||
|
|
4eb8658459 | ||
|
|
b37118fee2 | ||
|
|
026caba68a | ||
|
|
2003f8801a | ||
|
|
473bacf13a | ||
|
|
8b3f2bc61a | ||
|
|
3aa373c33c | ||
|
|
9b6263e583 | ||
|
|
3e066d08ce | ||
|
|
aa48e28162 | ||
|
|
dc660ed94a | ||
|
|
e02ecf9553 | ||
|
|
23acc0926f | ||
|
|
3fc1cd18d5 | ||
|
|
ebe29b403e | ||
|
|
dcba3312dd | ||
|
|
7fddeeec37 | ||
|
|
b5341b023f | ||
|
|
bbb7443ef2 | ||
|
|
22df347bb9 | ||
|
|
9aed6b8f35 | ||
|
|
9e7ec9f1bd | ||
|
|
373f43eac5 | ||
|
|
6c91b2791a |
No files matched your search
@@ -1,40 +0,0 @@
|
|||||||
---
|
|
||||||
name: "\U0001F41B Bug report"
|
|
||||||
about: Create a report to help us improve
|
|
||||||
title: "[BUG]"
|
|
||||||
labels: Bug
|
|
||||||
assignees: ""
|
|
||||||
---
|
|
||||||
|
|
||||||
**Describe the bug**
|
|
||||||
A clear and concise description of what the bug is.
|
|
||||||
|
|
||||||
**To Reproduce**
|
|
||||||
Steps to reproduce the behavior:
|
|
||||||
|
|
||||||
1. Go to '...'
|
|
||||||
2. Click on '....'
|
|
||||||
3. Scroll down to '....'
|
|
||||||
4. See error
|
|
||||||
|
|
||||||
**Expected behavior**
|
|
||||||
A clear and concise description of what you expected to happen.
|
|
||||||
|
|
||||||
**Screenshots**
|
|
||||||
If applicable, add screenshots to help explain your problem.
|
|
||||||
|
|
||||||
**Desktop (please complete the following information):**
|
|
||||||
|
|
||||||
- OS: [e.g. iOS]
|
|
||||||
- Browser [e.g. chrome, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Smartphone (please complete the following information):**
|
|
||||||
|
|
||||||
- Device: [e.g. iPhone6]
|
|
||||||
- OS: [e.g. iOS8.1]
|
|
||||||
- Browser [e.g. stock browser, safari]
|
|
||||||
- Version [e.g. 22]
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context about the problem here.
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
---
|
|
||||||
name: "❓Suggest an Idea?"
|
|
||||||
about: Suggest an idea for SupportBot?
|
|
||||||
title: "[SUGGESTION]"
|
|
||||||
labels: Suggestion
|
|
||||||
assignees: ""
|
|
||||||
---
|
|
||||||
|
|
||||||
**Is your feature request related to a problem? Please describe.**
|
|
||||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
|
||||||
|
|
||||||
**Describe the solution you'd like**
|
|
||||||
A clear and concise description of what you want to happen.
|
|
||||||
|
|
||||||
**Describe alternatives you've considered**
|
|
||||||
A clear and concise description of any alternative solutions or features you've considered.
|
|
||||||
|
|
||||||
**Additional context**
|
|
||||||
Add any other context or screenshots about the feature request here.
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
|
||||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
|
||||||
|
|
||||||
name: Node.js CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [dev, release]
|
|
||||||
pull_request:
|
|
||||||
branches: [dev, release]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
node-version: [16.x, 17.x]
|
|
||||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v2
|
|
||||||
- name: Use Node.js ${{ matrix.node-version }}
|
|
||||||
uses: actions/setup-node@v1
|
|
||||||
with:
|
|
||||||
node-version: ${{ matrix.node-version }}
|
|
||||||
- run: npm ci
|
|
||||||
- run: npm test
|
|
||||||
+2
-1
@@ -1 +1,2 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
.DS_Store
|
||||||
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
+7
-7
@@ -26,7 +26,7 @@ module.exports = new Command({
|
|||||||
permissions: ["SEND_MESSAGES"],
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
const { getRole, getChannel, getCategory } = interaction.client;
|
const { getRole } = interaction.client;
|
||||||
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
if (!SupportStaff || !Admin)
|
if (!SupportStaff || !Admin)
|
||||||
@@ -45,20 +45,20 @@ module.exports = new Command({
|
|||||||
!interaction.member.roles.cache.has(SupportStaff.id) &&
|
!interaction.member.roles.cache.has(SupportStaff.id) &&
|
||||||
!interaction.member.roles.cache.has(Admin.id)
|
!interaction.member.roles.cache.has(Admin.id)
|
||||||
)
|
)
|
||||||
return interaction.reply({ embeds: [NoPerms] });
|
return interaction.reply({ ephemeral: true, embeds: [NoPerms] });
|
||||||
|
|
||||||
let TicketData = await JSON.parse(
|
let TicketData = await JSON.parse(
|
||||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
);
|
);
|
||||||
let ticket = await TicketData.tickets.findIndex(
|
let ticket = await TicketData.tickets.findIndex(
|
||||||
(t) => t.id == interaction.channel.id
|
(t) => t.id === interaction.channel.id
|
||||||
);
|
);
|
||||||
if (ticket == -1) {
|
if (ticket === -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({ embeds: [Exists] });
|
return interaction.reply({ ephemeral: true, embeds: [Exists] });
|
||||||
}
|
}
|
||||||
|
|
||||||
let uMember = interaction.options.getUser("user");
|
let uMember = interaction.options.getUser("user");
|
||||||
@@ -71,7 +71,7 @@ module.exports = new Command({
|
|||||||
|
|
||||||
if (!uMember) return interaction.reply({ embeds: [UserNotExist] });
|
if (!uMember) return interaction.reply({ embeds: [UserNotExist] });
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.edit(uMember.id, {
|
await interaction.channel.permissionOverwrites.edit(uMember.id, {
|
||||||
VIEW_CHANNEL: true,
|
VIEW_CHANNEL: true,
|
||||||
});
|
});
|
||||||
const Complete = new Discord.MessageEmbed()
|
const Complete = new Discord.MessageEmbed()
|
||||||
|
|||||||
+48
-29
@@ -25,7 +25,7 @@ module.exports = new Command({
|
|||||||
permissions: ["SEND_MESSAGES"],
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
const { getRole, getChannel, getCategory } = interaction.client;
|
const { getRole, getChannel } = interaction.client;
|
||||||
if (supportbot.StaffOnly) {
|
if (supportbot.StaffOnly) {
|
||||||
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
@@ -51,13 +51,13 @@ module.exports = new Command({
|
|||||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
);
|
);
|
||||||
let TicketData = await tickets.tickets.findIndex(
|
let TicketData = await tickets.tickets.findIndex(
|
||||||
(t) => t.id == interaction.channel.id
|
(t) => t.id === interaction.channel.id
|
||||||
);
|
);
|
||||||
let ticket = tickets.tickets[TicketData];
|
let ticket = tickets.tickets[TicketData];
|
||||||
if (TicketData == -1) {
|
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.followUp({ embeds: [Exists] });
|
return interaction.followUp({ embeds: [Exists] });
|
||||||
}
|
}
|
||||||
@@ -81,8 +81,8 @@ module.exports = new Command({
|
|||||||
.setColor(supportbot.EmbedColour);
|
.setColor(supportbot.EmbedColour);
|
||||||
await interaction.followUp({ embeds: [CloseTicketRequest] });
|
await interaction.followUp({ embeds: [CloseTicketRequest] });
|
||||||
let filter = (m) =>
|
let filter = (m) =>
|
||||||
m.content.toLowerCase() == supportbot.ClosingConfirmation_Word &&
|
m.content.toLowerCase() === supportbot.ClosingConfirmation_Word &&
|
||||||
m.author.id == interaction.user.id;
|
m.author.id === interaction.user.id;
|
||||||
await interaction.channel.awaitMessages({
|
await interaction.channel.awaitMessages({
|
||||||
filter,
|
filter,
|
||||||
max: 1,
|
max: 1,
|
||||||
@@ -103,29 +103,42 @@ module.exports = new Command({
|
|||||||
const transcriptEmbed = new Discord.MessageEmbed()
|
const transcriptEmbed = new Discord.MessageEmbed()
|
||||||
.setTitle(supportbot.TranscriptTitle)
|
.setTitle(supportbot.TranscriptTitle)
|
||||||
.setColor(supportbot.EmbedColour)
|
.setColor(supportbot.EmbedColour)
|
||||||
.setFooter(supportbot.EmbedFooter)
|
.setFooter({
|
||||||
.addField(
|
text: supportbot.EmbedFooter,
|
||||||
"Ticket",
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
`${interaction.channel.name} (${interaction.channel.id})`
|
})
|
||||||
)
|
|
||||||
.addField("User", `${tUser}#${tUser.discriminator} (${tUser.id})`)
|
|
||||||
.addField("Closed By", interaction.user.tag)
|
|
||||||
.addField("Reason", reason);
|
|
||||||
const logEmbed = new Discord.MessageEmbed()
|
|
||||||
.setTitle(supportbot.TicketLog_Title)
|
|
||||||
.setColor(supportbot.EmbedColour)
|
|
||||||
.setFooter(supportbot.EmbedFooter)
|
|
||||||
.addField(
|
.addField(
|
||||||
"Ticket",
|
"Ticket",
|
||||||
`${interaction.channel.name} (${interaction.channel.id})`
|
`${interaction.channel.name} (${interaction.channel.id})`
|
||||||
)
|
)
|
||||||
.addField(
|
.addField(
|
||||||
"User",
|
"User",
|
||||||
`${tUser.username}#${tUser.discriminator} (${tUser.id})`
|
`${tUser?.username || "N/A"}#${tUser?.discriminator || "N/A"} (${
|
||||||
|
tUser?.id || ticket.user
|
||||||
|
})`
|
||||||
)
|
)
|
||||||
.addField("Closed By", interaction.user.tag)
|
.addField("Closed By", interaction.user.tag)
|
||||||
.addField("Reason", reason);
|
.addField("Reason", reason);
|
||||||
let msgs = await interaction.channel.messages.fetch();
|
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 = "";
|
let html = "";
|
||||||
|
|
||||||
msgs = msgs.sort((a, b) => a.createdTimestamp - b.createdTimestamp);
|
msgs = msgs.sort((a, b) => a.createdTimestamp - b.createdTimestamp);
|
||||||
@@ -141,11 +154,11 @@ module.exports = new Command({
|
|||||||
html += `-----<br><br>`;
|
html += `-----<br><br>`;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if (!(supportbot.DisableTicketLogChannel)) {
|
||||||
await logChannel.send({ embeds: [logEmbed] }).catch((err) => {
|
await logChannel.send({ embeds: [logEmbed] }).catch((err) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
let file = new Discord.MessageAttachment(
|
let file = new Discord.MessageAttachment(
|
||||||
Buffer.from(html),
|
Buffer.from(html),
|
||||||
`${interaction.channel.name}.html`
|
`${interaction.channel.name}.html`
|
||||||
@@ -155,18 +168,24 @@ module.exports = new Command({
|
|||||||
.catch(async (err) => {
|
.catch(async (err) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
await tUser
|
|
||||||
.send({ embeds: [transcriptEmbed], files: [file] })
|
if (supportbot.DMTranscripts) {
|
||||||
|
|
||||||
|
await tUser
|
||||||
|
?.send({ embeds: [transcriptEmbed], files: [file] })
|
||||||
.catch(async (err) => {
|
.catch(async (err) => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
if (ticket.subUsers) {
|
if (ticket.subUsers) {
|
||||||
ticket.subUsers.forEach(async (subUser) => {
|
ticket.subUsers.forEach(async (subUser) => {
|
||||||
interaction.client.users.cache
|
await interaction.client.users.cache
|
||||||
.get(subUser)
|
.get(subUser)
|
||||||
.send({ embeds: [transcriptEmbed], files: [file] });
|
?.send({ embeds: [transcriptEmbed], files: [file] });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
await interaction.channel.delete().catch(async (error) => {
|
await interaction.channel.delete().catch(async (error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
if (error.code !== Discord.Constants.APIErrors.UNKNOWN_CHANNEL) {
|
if (error.code !== Discord.Constants.APIErrors.UNKNOWN_CHANNEL) {
|
||||||
|
|||||||
+43
-3
@@ -20,18 +20,49 @@ module.exports = new Command({
|
|||||||
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,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permissions: ["SEND_MESSAGES"],
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
const { getRole, getChannel, getCategory } = interaction.client;
|
const { getRole } = interaction.client;
|
||||||
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
|
|
||||||
@@ -52,10 +83,19 @@ module.exports = new Command({
|
|||||||
) {
|
) {
|
||||||
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)
|
||||||
|
.setColor(EmbedColour)
|
||||||
|
.setThumbnail(EmbedThumbnail)
|
||||||
|
.setImage(EmbedImage)
|
||||||
|
if (EmbedFieldTitle && EmbedFieldContent) { EmbedMsg.addField(EmbedFieldTitle, EmbedFieldContent) };
|
||||||
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
embeds: [EmbedMsg],
|
embeds: [EmbedMsg],
|
||||||
|
|||||||
+13
-16
@@ -12,12 +12,6 @@ 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,
|
||||||
@@ -25,7 +19,7 @@ module.exports = new Command({
|
|||||||
permissions: ["SEND_MESSAGES"],
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
const { getRole, getChannel, getCategory } = interaction.client;
|
const { getRole } = interaction.client;
|
||||||
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
if (!SupportStaff || !Admin)
|
if (!SupportStaff || !Admin)
|
||||||
@@ -37,6 +31,11 @@ module.exports = new Command({
|
|||||||
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`;
|
||||||
|
botCommands += `**/${cmdconfig.UserInfoCommand}** ${cmdconfig.UserInfoCommandDesc}\n`;
|
||||||
|
|
||||||
|
if (supportbot.DisableSuggestions === false) {
|
||||||
|
botCommands += `**/${cmdconfig.SuggestCommand}** ${cmdconfig.SuggestCommandDesc}\n`;
|
||||||
|
}
|
||||||
|
|
||||||
let ticketCommands = "";
|
let ticketCommands = "";
|
||||||
ticketCommands += `**/${cmdconfig.OpenTicket}** ${cmdconfig.OpenTicketDesc}\n`;
|
ticketCommands += `**/${cmdconfig.OpenTicket}** ${cmdconfig.OpenTicketDesc}\n`;
|
||||||
@@ -45,6 +44,8 @@ module.exports = new Command({
|
|||||||
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`;
|
||||||
|
staffCommands += `**/${cmdconfig.UserInfoCommand}** ${cmdconfig.UserInfoCommandDesc}\n`;
|
||||||
|
staffCommands += `**/${cmdconfig.TranslateCommand}** ${cmdconfig.TranslateCommandDesc}\n`;
|
||||||
|
|
||||||
const HelpEmbed1 = new Discord.MessageEmbed()
|
const HelpEmbed1 = new Discord.MessageEmbed()
|
||||||
.setTitle(supportbot.Name + " Commands")
|
.setTitle(supportbot.Name + " Commands")
|
||||||
@@ -64,7 +65,10 @@ module.exports = new Command({
|
|||||||
)
|
)
|
||||||
|
|
||||||
.setColor(supportbot.EmbedColour)
|
.setColor(supportbot.EmbedColour)
|
||||||
.setFooter(supportbot.EmbedFooter, interaction.user.displayAvatarURL());
|
.setFooter({
|
||||||
|
text: supportbot.EmbedFooter,
|
||||||
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
|
});
|
||||||
|
|
||||||
if (
|
if (
|
||||||
interaction.member.roles.cache.has(SupportStaff.id) ||
|
interaction.member.roles.cache.has(SupportStaff.id) ||
|
||||||
@@ -77,16 +81,9 @@ module.exports = new Command({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (supportbot.SendHelpPage === "dm") {
|
|
||||||
interaction.user.reply({
|
|
||||||
embeds: [HelpEmbed1],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
if (supportbot.SendHelpPage === "channel") {
|
|
||||||
interaction.reply({
|
interaction.reply({
|
||||||
|
ephemeral: true,
|
||||||
embeds: [HelpEmbed1],
|
embeds: [HelpEmbed1],
|
||||||
});
|
});
|
||||||
}
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
+8
-14
@@ -12,12 +12,6 @@ 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,
|
||||||
@@ -32,7 +26,7 @@ module.exports = new Command({
|
|||||||
permissions: ["SEND_MESSAGES"],
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
const { getRole, getChannel, getCategory } = interaction.client;
|
const { getRole } = interaction.client;
|
||||||
let Staff = await getRole(supportbot.Staff, interaction.guild);
|
let Staff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
if (!Staff || !Admin)
|
if (!Staff || !Admin)
|
||||||
@@ -56,14 +50,14 @@ module.exports = new Command({
|
|||||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
);
|
);
|
||||||
let ticket = await TicketData.tickets.findIndex(
|
let ticket = await TicketData.tickets.findIndex(
|
||||||
(t) => t.id == interaction.channel.id
|
(t) => t.id === interaction.channel.id
|
||||||
);
|
);
|
||||||
if (ticket == -1) {
|
if (ticket === -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({ embeds: [Exists] });
|
return interaction.reply({ ephemeral: true, embeds: [Exists] });
|
||||||
}
|
}
|
||||||
|
|
||||||
let uMember = interaction.options.getUser("user");
|
let uMember = interaction.options.getUser("user");
|
||||||
@@ -74,9 +68,9 @@ module.exports = new Command({
|
|||||||
)
|
)
|
||||||
.setColor(supportbot.ErrorColour);
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
if (!uMember) return interaction.reply({ embeds: [UserNotExist] });
|
if (!uMember) return interaction.reply({ ephemeral: true, embeds: [UserNotExist] });
|
||||||
|
|
||||||
interaction.channel.permissionOverwrites.edit(uMember.id, {
|
await interaction.channel.permissionOverwrites.edit(uMember.id, {
|
||||||
VIEW_CHANNEL: false,
|
VIEW_CHANNEL: false,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -88,7 +82,7 @@ module.exports = new Command({
|
|||||||
interaction.reply({ embeds: [Complete] });
|
interaction.reply({ embeds: [Complete] });
|
||||||
TicketData.tickets[ticket].subUsers = TicketData.tickets[
|
TicketData.tickets[ticket].subUsers = TicketData.tickets[
|
||||||
ticket
|
ticket
|
||||||
].subUsers.filter((u) => u != uMember.id);
|
].subUsers.filter((u) => u !== uMember.id);
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
"./Data/TicketData.json",
|
"./Data/TicketData.json",
|
||||||
JSON.stringify(TicketData, null, 4),
|
JSON.stringify(TicketData, null, 4),
|
||||||
|
|||||||
+25
-7
@@ -1,5 +1,5 @@
|
|||||||
// SupportBot | Emerald Services
|
// SupportBot | Emerald Services
|
||||||
// Ping Command
|
// Suggest Command
|
||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
|
|
||||||
@@ -20,12 +20,13 @@ module.exports = new Command({
|
|||||||
name: "suggestion",
|
name: "suggestion",
|
||||||
description: "Create a Suggestion",
|
description: "Create a Suggestion",
|
||||||
type: "STRING",
|
type: "STRING",
|
||||||
|
required: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
permissions: ["SEND_MESSAGES"],
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
const { getRole, getChannel, getCategory } = interaction.client;
|
const { getChannel } = interaction.client;
|
||||||
const suggestChannel = await getChannel(
|
const suggestChannel = await getChannel(
|
||||||
supportbot.SuggestionChannel,
|
supportbot.SuggestionChannel,
|
||||||
interaction.guild
|
interaction.guild
|
||||||
@@ -33,7 +34,7 @@ module.exports = new Command({
|
|||||||
|
|
||||||
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] });
|
||||||
@@ -44,13 +45,26 @@ 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);
|
||||||
|
|
||||||
|
if (supportbot.SuggestionThreads) {
|
||||||
|
await suggestionMsg.startThread({
|
||||||
|
name: `Suggestion-releated Thread`,
|
||||||
|
autoArchiveDuration: 60,
|
||||||
|
type: 'GUILD_PUBLIC_THREAD',
|
||||||
|
reason: 'Suggestion-releated thread',
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const Submitted = new Discord.MessageEmbed()
|
const Submitted = new Discord.MessageEmbed()
|
||||||
@@ -61,6 +75,10 @@ module.exports = new Command({
|
|||||||
.addField("Sent to:", `<#${suggestChannel.id}>`)
|
.addField("Sent to:", `<#${suggestChannel.id}>`)
|
||||||
.setColor(supportbot.SuccessColour);
|
.setColor(supportbot.SuccessColour);
|
||||||
|
|
||||||
return interaction.reply({ embeds: [Submitted] });
|
return interaction.reply({
|
||||||
|
ephemeral: true,
|
||||||
|
embeds: [Submitted]
|
||||||
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
+80
-76
@@ -31,15 +31,22 @@ module.exports = new Command({
|
|||||||
permissions: ["SEND_MESSAGES"],
|
permissions: ["SEND_MESSAGES"],
|
||||||
|
|
||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
|
let disableCommand = true;
|
||||||
|
if (interaction.isCommand() && disableCommand)
|
||||||
|
return interaction.reply({
|
||||||
|
content: "This command is disabled",
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
let department = interaction.customId?.split("-")[1] || null;
|
||||||
let TicketData = await JSON.parse(
|
let TicketData = await JSON.parse(
|
||||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
);
|
);
|
||||||
const { getRole, getChannel, getCategory } = interaction.client;
|
const { getRole, getCategory } = interaction.client;
|
||||||
let User = interaction.guild.members.cache.get(interaction.user.id);
|
let User = interaction.guild.members.cache.get(interaction.user.id);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
supportbot.MaxAllowedTickets &&
|
supportbot.MaxAllowedTickets &&
|
||||||
TicketData.tickets.filter((t) => t.user == interaction.user.id && t.open)
|
TicketData.tickets.filter((t) => t.user === interaction.user.id && t.open)
|
||||||
.length >= supportbot.MaxAllowedTickets
|
.length >= supportbot.MaxAllowedTickets
|
||||||
) {
|
) {
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
@@ -73,39 +80,29 @@ module.exports = new Command({
|
|||||||
|
|
||||||
const TicketExists = new 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 await interaction.reply({ embeds: [TicketExists] });
|
return await interaction.reply({
|
||||||
|
embeds: [TicketExists],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
const Staff = await getRole(supportbot.Staff, interaction.guild);
|
const Staff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
const Admin = await getRole(supportbot.Admin, interaction.guild);
|
const Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
const DeptRole1 = await getRole(
|
if (!Staff || !Admin)
|
||||||
supportbot.DepartmentRole_1,
|
|
||||||
interaction.guild
|
|
||||||
);
|
|
||||||
const DeptRole2 = await getRole(
|
|
||||||
supportbot.DepartmentRole_2,
|
|
||||||
interaction.guild
|
|
||||||
);
|
|
||||||
const DeptRole3 = await getRole(
|
|
||||||
supportbot.DepartmentRole_3,
|
|
||||||
interaction.guild
|
|
||||||
);
|
|
||||||
if (!Staff || !Admin || !DeptRole1 || !DeptRole2 || !DeptRole3)
|
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
content:
|
content:
|
||||||
"Some roles seem to be missing!\nPlease check for errors when starting the bot.",
|
"Some roles seem to be missing!\nPlease check for errors when starting the bot.",
|
||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
});
|
});
|
||||||
const Author = interaction.user;
|
|
||||||
let TicketCategory = await getCategory(
|
let TicketCategory = await getCategory(
|
||||||
supportbot.TicketCategory,
|
supportbot.Departments[department].category,
|
||||||
interaction.guild
|
interaction.guild
|
||||||
);
|
);
|
||||||
const ticketChannel = await interaction.guild.channels.create(
|
const ticketChannel = await interaction.guild.channels.create(
|
||||||
@@ -119,9 +116,8 @@ module.exports = new Command({
|
|||||||
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: Author.id,
|
id: interaction.user.id,
|
||||||
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
||||||
deny: [Permissions.FLAGS.SEND_MESSAGES],
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: interaction.guild.id,
|
id: interaction.guild.id,
|
||||||
@@ -130,15 +126,20 @@ module.exports = new Command({
|
|||||||
],
|
],
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (supportbot.AllowStaff) {
|
if (supportbot.AllowAllStaff) {
|
||||||
ticketChannel.permissionOverwrites.edit(Staff.id, {
|
await ticketChannel.permissionOverwrites.edit(Staff.id, {
|
||||||
VIEW_CHANNEL: true,
|
VIEW_CHANNEL: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if (!department) {
|
||||||
|
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
||||||
|
SEND_MESSAGES: false,
|
||||||
|
});
|
||||||
|
}
|
||||||
await TicketData.tickets.push({
|
await TicketData.tickets.push({
|
||||||
id: ticketChannel.id,
|
id: ticketChannel.id,
|
||||||
name: ticketChannel.name,
|
name: ticketChannel.name,
|
||||||
user: Author.id,
|
user: interaction.user.id,
|
||||||
number: ticketNumberID,
|
number: ticketNumberID,
|
||||||
reason: TicketSubject,
|
reason: TicketSubject,
|
||||||
open: true,
|
open: true,
|
||||||
@@ -182,23 +183,23 @@ 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.") {
|
||||||
await 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 (!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 MessageButton()
|
const CloseButton = new MessageButton()
|
||||||
@@ -214,33 +215,16 @@ module.exports = new Command({
|
|||||||
.setEmoji(supportbot.TicketLockEmoji);
|
.setEmoji(supportbot.TicketLockEmoji);
|
||||||
|
|
||||||
const row2 = new MessageActionRow().addComponents(CloseButton, LockButton);
|
const row2 = new MessageActionRow().addComponents(CloseButton, LockButton);
|
||||||
|
if (!department) {
|
||||||
if (supportbot.TicketDepartments) {
|
|
||||||
try {
|
try {
|
||||||
const Department1Button = new MessageButton()
|
let buttons = await supportbot.Departments.map((x) =>
|
||||||
.setCustomId("Department1")
|
new MessageButton()
|
||||||
.setLabel(supportbot.DepartmentTitle_1)
|
.setCustomId("Department" + supportbot.Departments.indexOf(x))
|
||||||
.setStyle(supportbot.TicketDept1Colour)
|
.setLabel(x.title)
|
||||||
.setEmoji(supportbot.TicketDept1Emoji);
|
.setStyle(x.color)
|
||||||
|
.setEmoji(x.emoji)
|
||||||
const Department2Button = new MessageButton()
|
|
||||||
.setCustomId("Department2")
|
|
||||||
.setLabel(supportbot.DepartmentTitle_2)
|
|
||||||
.setStyle(supportbot.TicketDept2Colour)
|
|
||||||
.setEmoji(supportbot.TicketDept2Emoji);
|
|
||||||
|
|
||||||
const Department3Button = new MessageButton()
|
|
||||||
.setCustomId("Department3")
|
|
||||||
.setLabel(supportbot.DepartmentTitle_3)
|
|
||||||
.setStyle(supportbot.TicketDept3Colour)
|
|
||||||
.setEmoji(supportbot.TicketDept3Emoji);
|
|
||||||
|
|
||||||
const row = new MessageActionRow().addComponents(
|
|
||||||
Department1Button,
|
|
||||||
Department2Button,
|
|
||||||
Department3Button
|
|
||||||
);
|
);
|
||||||
|
const row = new MessageActionRow().addComponents(buttons);
|
||||||
const m = await ticketChannel.send({
|
const m = await ticketChannel.send({
|
||||||
embeds: [TicketMessage],
|
embeds: [TicketMessage],
|
||||||
components: [row],
|
components: [row],
|
||||||
@@ -256,13 +240,13 @@ module.exports = new Command({
|
|||||||
time: supportbot.Timeout * 60000,
|
time: supportbot.Timeout * 60000,
|
||||||
});
|
});
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (e.code == "INTERACTION_COLLECTOR_ERROR") {
|
if (e.code === "INTERACTION_COLLECTOR_ERROR") {
|
||||||
try {
|
try {
|
||||||
TicketData = await JSON.parse(
|
TicketData = await JSON.parse(
|
||||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||||
);
|
);
|
||||||
let ticket = await TicketData.tickets.findIndex(
|
let ticket = await TicketData.tickets.findIndex(
|
||||||
(t) => t.id == ticketChannel.id
|
(t) => t.id === ticketChannel.id
|
||||||
);
|
);
|
||||||
TicketData.tickets[ticket].open = false;
|
TicketData.tickets[ticket].open = false;
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
@@ -279,25 +263,14 @@ module.exports = new Command({
|
|||||||
return await ticketChannel.delete();
|
return await ticketChannel.delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
let role;
|
let num = collector.customId.split("Department")[1];
|
||||||
let title;
|
let role = getRole(supportbot.Departments[num].role, interaction.guild);
|
||||||
if (collector.customId === "Department1") {
|
let title = supportbot.Departments[num].title;
|
||||||
role = DeptRole1;
|
|
||||||
title = supportbot.DepartmentTitle_1;
|
|
||||||
}
|
|
||||||
if (collector.customId === "Department2") {
|
|
||||||
role = DeptRole2;
|
|
||||||
title = supportbot.DepartmentTitle_2;
|
|
||||||
}
|
|
||||||
if (collector.customId === "Department3") {
|
|
||||||
role = DeptRole3;
|
|
||||||
title = supportbot.DepartmentTitle_3;
|
|
||||||
}
|
|
||||||
|
|
||||||
ticketChannel.permissionOverwrites.edit(role.id, {
|
await ticketChannel.permissionOverwrites.edit(role.id, {
|
||||||
VIEW_CHANNEL: true,
|
VIEW_CHANNEL: true,
|
||||||
});
|
});
|
||||||
ticketChannel.permissionOverwrites.edit(Author.id, {
|
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
||||||
SEND_MESSAGES: true,
|
SEND_MESSAGES: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -319,7 +292,38 @@ module.exports = new Command({
|
|||||||
});
|
});
|
||||||
} catch (error) {}
|
} catch (error) {}
|
||||||
} else {
|
} else {
|
||||||
await 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,
|
||||||
|
interaction.guild
|
||||||
|
);
|
||||||
|
await ticketChannel.setParent(TicketCat.id, { lockPermissions: false });
|
||||||
|
if (supportbot.AllowThanksForReachingOutMessage) {
|
||||||
|
await ticketChannel.send({
|
||||||
|
embeds: [
|
||||||
|
{
|
||||||
|
description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`,
|
||||||
|
color: supportbot.EmbedColour,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (supportbot.AllowTicketMentions) {
|
||||||
|
await ticketChannel.send(supportbot.TicketRoleMention);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -0,0 +1,108 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// Translate Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/commands.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
const translate = require("@vitalets/google-translate-api");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.TranslateCommand, // Name of command
|
||||||
|
description: cmdconfig.TranslateCommandDesc, // Description of command
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
type: "STRING",
|
||||||
|
name: "language",
|
||||||
|
description: "A 2 letter language code",
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: "STRING",
|
||||||
|
name: "text",
|
||||||
|
description: "The text to translate",
|
||||||
|
required: true,
|
||||||
|
}, // The input text for the translation
|
||||||
|
],
|
||||||
|
permissions: ["SEND_MESSAGES"], // The permission the user/role at least requires
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
|
||||||
|
const { getRole } = interaction.client;
|
||||||
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
|
if (!SupportStaff || !Admin)
|
||||||
|
return interaction.reply(
|
||||||
|
"Some roles seem to be missing!\nPlease check the error logs."
|
||||||
|
);
|
||||||
|
|
||||||
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(
|
||||||
|
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
|
||||||
|
if (
|
||||||
|
!interaction.member.roles.cache.has(SupportStaff.id) &&
|
||||||
|
!interaction.member.roles.cache.has(Admin.id)
|
||||||
|
)
|
||||||
|
return interaction.reply({ embeds: [NoPerms] });
|
||||||
|
|
||||||
|
const { getChannel } = interaction.client;
|
||||||
|
let lang = interaction.options.getString("language"); // Grab choice of language code by user
|
||||||
|
let url = "https://www.science.co.il/language/Codes.php"; // URL to all available language codes
|
||||||
|
let text = await interaction.options.getString("text"); // Grab the text to translate by the user
|
||||||
|
let translatelog = await getChannel(
|
||||||
|
supportbot.TranslateLogChannel,
|
||||||
|
interaction.guild
|
||||||
|
); // Grab the set logging channel for translations
|
||||||
|
|
||||||
|
|
||||||
|
// Return message if user has provided an invalid language code
|
||||||
|
const result = await translate(text, { to: lang }).catch(async (err) => {
|
||||||
|
if (err && err.code == 400) {
|
||||||
|
await interaction.reply({
|
||||||
|
embeds: [
|
||||||
|
new Discord.MessageEmbed()
|
||||||
|
.setColor(supportbot.WarningColour)
|
||||||
|
.setTitle("Valid Language Codes")
|
||||||
|
.setURL(url)
|
||||||
|
.setDescription(
|
||||||
|
"Click the title to see which 2 letter language codes are valid."
|
||||||
|
),
|
||||||
|
],
|
||||||
|
ephemeral: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (!result) return;
|
||||||
|
|
||||||
|
// Embed containing language code, original text and translated text
|
||||||
|
let transembed = new Discord.MessageEmbed()
|
||||||
|
.setAuthor({ name: interaction.user.tag, iconURL: interaction.user.displayAvatarURL({ dynamic: true }) })
|
||||||
|
.setColor(supportbot.SuccessColour)
|
||||||
|
.setDescription(`**Translation to ${lang}**`)
|
||||||
|
.addFields(
|
||||||
|
{ name: "Original text", value: text },
|
||||||
|
{ name: "Translated text", value: result.text },
|
||||||
|
)
|
||||||
|
.setFooter({ text: `Author: ${interaction.user.id}` })
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
// Send embed [transembed] with translated message to channel
|
||||||
|
await interaction.reply({ embeds: [transembed] });
|
||||||
|
|
||||||
|
// Send embed [transembed] to logging channel
|
||||||
|
await translatelog.send({ embeds: [transembed] });
|
||||||
|
},
|
||||||
|
|
||||||
|
})
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
// SupportBot | Emerald Services
|
||||||
|
// User Info Command
|
||||||
|
|
||||||
|
const fs = require("fs");
|
||||||
|
const moment = require("moment");
|
||||||
|
|
||||||
|
const Discord = require("discord.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
const cmdconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/commands.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
const Command = require("../Structures/Command.js");
|
||||||
|
|
||||||
|
module.exports = new Command({
|
||||||
|
name: cmdconfig.UserInfoCommand, // Name of command
|
||||||
|
description: cmdconfig.UserInfoCommandDesc, // Description of command
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
type: "USER",
|
||||||
|
name: "user",
|
||||||
|
description: "The user you want to get info about.",
|
||||||
|
required: true,
|
||||||
|
}, // The user input
|
||||||
|
],
|
||||||
|
permissions: ["SEND_MESSAGES"], // The permission the user/role at least requires
|
||||||
|
|
||||||
|
async run(interaction) {
|
||||||
|
const { getRole } = interaction.client;
|
||||||
|
let SupportStaff = await getRole(supportbot.Staff, interaction.guild);
|
||||||
|
let Admin = await getRole(supportbot.Admin, interaction.guild);
|
||||||
|
if (!SupportStaff || !Admin)
|
||||||
|
return interaction.reply(
|
||||||
|
"Some roles seem to be missing!\nPlease check the error logs."
|
||||||
|
);
|
||||||
|
|
||||||
|
const NoPerms = new Discord.MessageEmbed()
|
||||||
|
.setTitle("Invalid Permissions!")
|
||||||
|
.setDescription(
|
||||||
|
`${supportbot.IncorrectPerms}\n\nRole Required: \`${supportbot.Staff}\` or \`${supportbot.Admin}\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.WarningColour);
|
||||||
|
|
||||||
|
if (
|
||||||
|
!interaction.member.roles.cache.has(SupportStaff.id) &&
|
||||||
|
!interaction.member.roles.cache.has(Admin.id)
|
||||||
|
)
|
||||||
|
return interaction.reply({ embeds: [NoPerms] });
|
||||||
|
|
||||||
|
let user = await interaction.options.getUser("user") || interaction.author; // Grab the mentioned user
|
||||||
|
let member = await interaction.guild.members.cache.get(user.id) // Check for user and his ID
|
||||||
|
|
||||||
|
const UserNotExist = new Discord.MessageEmbed()
|
||||||
|
.setTitle("User Not Found!")
|
||||||
|
.setDescription(
|
||||||
|
`${supportbot.UserNotFound}\n\nTry Again:\`/${cmdconfig.UserInfoCommand} <@!User_ID> or @User\``
|
||||||
|
)
|
||||||
|
.setColor(supportbot.ErrorColour);
|
||||||
|
|
||||||
|
if (!user) return interaction.reply({ embeds: [UserNotExist] });
|
||||||
|
|
||||||
|
// Flags a user/bot can have
|
||||||
|
const flags = {
|
||||||
|
DISCORD_EMPLOYEE: 'Discord Employee',
|
||||||
|
DISCORD_PARTNER: 'Discord Partner',
|
||||||
|
BUGHUNTER_LEVEL_1: 'Bug Hunter (Level 1)',
|
||||||
|
BUGHUNTER_LEVEL_2: 'Bug Hunter (Level 2)',
|
||||||
|
HYPESQUAD_EVENTS: 'HypeSquad Events',
|
||||||
|
HOUSE_BRAVERY: 'House of Bravery',
|
||||||
|
HOUSE_BRILLIANCE: 'House of Brilliance',
|
||||||
|
HOUSE_BALANCE: 'House of Balance',
|
||||||
|
EARLY_SUPPORTER: 'Early Supporter',
|
||||||
|
TEAM_USER: 'Team User',
|
||||||
|
SYSTEM: 'System',
|
||||||
|
VERIFIED_BOT: 'Verified Bot',
|
||||||
|
VERIFIED_DEVELOPER: 'Verified Bot Developer'
|
||||||
|
};
|
||||||
|
|
||||||
|
// Status message with icon
|
||||||
|
let status = {
|
||||||
|
online: "🟢Online",
|
||||||
|
idle: "🟡Idle",
|
||||||
|
dnd: "🔴Do Not Disturb",
|
||||||
|
offline: "⚫Offline"
|
||||||
|
};
|
||||||
|
|
||||||
|
const userFlags = user.flags.toArray();
|
||||||
|
|
||||||
|
// Embed containing the userinfo
|
||||||
|
let userembed = new Discord.MessageEmbed()
|
||||||
|
.setTitle(`User Info for User: ${user.tag}`)
|
||||||
|
.setThumbnail(member.displayAvatarURL({ dynamic: true, size: 512 }))
|
||||||
|
.setColor(member.roles.highest.hexColor)
|
||||||
|
.addFields(
|
||||||
|
{ name: "Name:", value: `${user.tag}\n<@${member.id}>`, inline: true },
|
||||||
|
{ name: "ID:", value: `${member.id}`, inline: true },
|
||||||
|
{ name: "Is Bot:", value: user.bot ? "Yes" : "No", inline: true },
|
||||||
|
{ name: "House/Badge:", value: `${userFlags.length ? userFlags.map(flag => flags[flag]).join("\n") : "None"}`, inline: true },
|
||||||
|
{ name: "Current Status:", value: `${status[member.presence ? member.presence.status : "offline"]}`, inline: true },
|
||||||
|
{ name: "Avatar URL:", value: `[Click Here](${member.displayAvatarURL()})`, inline: true },
|
||||||
|
{ name: "\u200b", value: "\u200b", inline: false}
|
||||||
|
)
|
||||||
|
.addFields(
|
||||||
|
{ name: "Creation Date:", value: `${moment(user.createdAt).format("MMMM Do YYYY, h:mm:ss a")}\n> ${moment(user.createdAt).startOf("day").fromNow()}`, inline: true },
|
||||||
|
{ name: "Joined Date:", value: `${moment(member.joinedAt).format("MMMM Do YYYY, h:mm:ss a")}\n> ${moment(member.joinedAt).startOf("day").fromNow()}`, inline: true },
|
||||||
|
{ name: "Roles Total:", value: `${member.roles.cache.size -1}`, inline: false },
|
||||||
|
{ name: "Highest Role:", value: `${member.roles.highest.id === interaction.guild.id ? "None" : member.roles.highest.toString()}`, inline: true },
|
||||||
|
{ name: "Roles:", value: `${member.roles.cache.map(r => r).join(" ").replace("@everyone", " ") || "None"}`, inline: false },
|
||||||
|
)
|
||||||
|
.setFooter({ text: supportbot.EmbedFooter })
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
// Send embed [userembed]
|
||||||
|
await interaction.reply({ embeds: [userembed] }).catch((err) => console.error("An error has occured: ", err));
|
||||||
|
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @INFO
|
||||||
|
* UserInfo command by Sypher#3415 | 321332200668790786
|
||||||
|
* @INFO
|
||||||
|
* Solely created for SupportBot | https://github.com/Emerald-Services/SupportBot/
|
||||||
|
**/
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
# Command Name Configuration
|
# Command Name Configuration
|
||||||
# -------------------------------
|
# -------------------------------
|
||||||
|
|
||||||
|
Blacklist: "blacklist"
|
||||||
TicketAdd: "add"
|
TicketAdd: "add"
|
||||||
TicketRemove: "remove"
|
TicketRemove: "remove"
|
||||||
OpenTicket: "ticket"
|
OpenTicket: "ticket"
|
||||||
@@ -23,13 +24,17 @@ PingCommand: "ping"
|
|||||||
HelpCommand: "help"
|
HelpCommand: "help"
|
||||||
EmbedCommand: "embed"
|
EmbedCommand: "embed"
|
||||||
SuggestCommand: "suggest"
|
SuggestCommand: "suggest"
|
||||||
|
TranslateCommand: "translate"
|
||||||
|
UserInfoCommand: "userinfo"
|
||||||
|
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
# Command Description Configuration
|
# Command Description Configuration
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
|
|
||||||
|
BlacklistDesc: "Blacklist a user from creating Tickets."
|
||||||
TicketAddDesc: "Add a user to a support ticket."
|
TicketAddDesc: "Add a user to a support ticket."
|
||||||
TicketRemoveDesc: "Remove a user from a support ticket."
|
TicketRemoveDesc: "Remove a user from a support ticket."
|
||||||
|
TranslateCommandDesc: "Translates the language provided, along with the abbreviation (2 char) long language code"
|
||||||
OpenTicketDesc: "Open a new support ticket."
|
OpenTicketDesc: "Open a new support ticket."
|
||||||
CloseTicketDesc: "Close your support ticket."
|
CloseTicketDesc: "Close your support ticket."
|
||||||
InfoCommandDesc: "Get information about the brand."
|
InfoCommandDesc: "Get information about the brand."
|
||||||
@@ -37,3 +42,4 @@ PingCommandDesc: "Pong!"
|
|||||||
HelpCommandDesc: "Get a list of all the commands."
|
HelpCommandDesc: "Get a list of all the commands."
|
||||||
EmbedCommandDesc: "Send a message as an embed."
|
EmbedCommandDesc: "Send a message as an embed."
|
||||||
SuggestCommandDesc: "Suggest a feature for the server."
|
SuggestCommandDesc: "Suggest a feature for the server."
|
||||||
|
UserInfoCommandDesc: "Get info about a user."
|
||||||
+126
-63
@@ -10,22 +10,20 @@
|
|||||||
# 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.4.0"
|
SupportBot_Version: "v7.7"
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# General Configuration
|
# General Configuration
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
Name: "SupportBot"
|
Name: "SupportBot"
|
||||||
Token: "BOT_TOKEN"
|
Token: "BOT_TOKEN HTTPS://DISCORD.COM/DEVELOPERS"
|
||||||
# Guild ID Ex: 123456789123456789
|
|
||||||
Guild: ""
|
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# Activity Configuration
|
# Activity Configuration
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
BotActivity: "Need Help? /ticket"
|
BotActivity: "Here to help!"
|
||||||
|
|
||||||
StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME"
|
StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME"
|
||||||
# Set The ActivityType to "STREAMING" for a streaming status!
|
# Set The ActivityType to "STREAMING" for a streaming status!
|
||||||
@@ -38,40 +36,73 @@ ActivityType: "PLAYING"
|
|||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
EmbedColour: "#f74343"
|
EmbedColour: "#f74343"
|
||||||
EmbedFooter: "SupportBot | An Advanced Ticket System"
|
EmbedFooter: "SupportBot | Developed by Emerald Services"
|
||||||
|
|
||||||
ErrorColour: "#d12519"
|
ErrorColour: "#d12519"
|
||||||
SuccessColour: "#04b545"
|
SuccessColour: "#04b545"
|
||||||
WarningColour: "#fca117"
|
WarningColour: "#fca117"
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# Information Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
InfoTitle: "Information"
|
|
||||||
AboutMe: "Hi, I'm SupportBot an advanced discord ticket bot with 100% customization! [Download](https://emeraldsrv.dev/download)"
|
|
||||||
|
|
||||||
InfoButtonText: "Visit Site"
|
|
||||||
InfoURL: "https://emeraldsrv.dev"
|
|
||||||
InfoColour: "#f74343"
|
|
||||||
|
|
||||||
# -------------------------
|
|
||||||
# Help Configuration
|
|
||||||
# -------------------------
|
|
||||||
|
|
||||||
SendHelpPage: "channel" # Set to channel or dm
|
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# Role Configuration
|
# Role Configuration
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
AutoRole: true
|
AutoRole: true
|
||||||
AutoRole_Role: "Member"
|
JoinRole: "Member"
|
||||||
|
|
||||||
Staff: "Staff"
|
Staff: "Staff"
|
||||||
Admin: "Admin"
|
Admin: "Admin"
|
||||||
TicketBlackListRole: "Blacklisted"
|
TicketBlackListRole: "Blacklisted"
|
||||||
|
|
||||||
|
# ----------------------------
|
||||||
|
# Join/Leave Configuration
|
||||||
|
# ----------------------------
|
||||||
|
|
||||||
|
Welcome: true
|
||||||
|
# set to false to disable joining logs
|
||||||
|
|
||||||
|
WelcomeChannel: "join-leave-logs"
|
||||||
|
WelcomeColour: "#f74343"
|
||||||
|
WelcomeTitle: "User Joined!"
|
||||||
|
WelcomeMessage: "%joined_user% has joined the server!"
|
||||||
|
# Available Placeholders:
|
||||||
|
# %joined_user% - Mentions the user who joined
|
||||||
|
|
||||||
|
EmbedWelcomeImage: true
|
||||||
|
EmbedWelcomeImageURL: "https://media.discordapp.net/attachments/958247876344025108/986777740738986094/unknown.png"
|
||||||
|
|
||||||
|
EmbedWelcomeThumbnail: "BOT"
|
||||||
|
# "USER" will display the user's profile picture.
|
||||||
|
# "BOT" will display the bot's profile picture.
|
||||||
|
# false to disable
|
||||||
|
|
||||||
|
Leave: true
|
||||||
|
# set to false to disable leaving logs
|
||||||
|
|
||||||
|
LeaveChannel: "join-leave-logs"
|
||||||
|
LeaveColour: "#f74343"
|
||||||
|
LeaveTitle: "User Left!"
|
||||||
|
LeaveMessage: "%joined_user% has left the server!"
|
||||||
|
# Available Placeholders:
|
||||||
|
# %joined_user% - Mentions the user who joined
|
||||||
|
|
||||||
|
EmbedLeaveImage: true
|
||||||
|
EmbedLeaveImageURL: "https://cdn.discordapp.com/attachments/958247876344025108/986778170223120384/unknown.png"
|
||||||
|
|
||||||
|
EmbedLeaveThumbnail: false
|
||||||
|
# "USER" will display the user's profile picture.
|
||||||
|
# "BOT" will display the bot's profile picture.
|
||||||
|
# false to disable
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Information Configuration
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
InfoTitle: "Information"
|
||||||
|
|
||||||
|
InfoButtonText: "Visit Site"
|
||||||
|
InfoURL: "https://emeraldsrv.dev"
|
||||||
|
InfoColour: "#f74343"
|
||||||
|
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
# Suggestions Configuration
|
# Suggestions Configuration
|
||||||
# ----------------------------
|
# ----------------------------
|
||||||
@@ -80,29 +111,49 @@ SuggestionChannel: "suggestions"
|
|||||||
SuggestionUpvote: "✅"
|
SuggestionUpvote: "✅"
|
||||||
SuggestionDownvote: "❌"
|
SuggestionDownvote: "❌"
|
||||||
|
|
||||||
|
SuggestionThreads: true
|
||||||
|
# set to false to disable threads being created from suggestions.
|
||||||
|
|
||||||
|
DisableSuggestions: false
|
||||||
|
# Set to true to disable the suggestions feature.
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Translate Configuration
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
TranslateLogChannel: "translations-log"
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# Tickets Configuration
|
# Tickets Configuration
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
TicketCategory: "Tickets"
|
|
||||||
TicketPrefix: "ticket-" # The prefix for ticket channel names
|
TicketPrefix: "ticket-" # The prefix for ticket channel names
|
||||||
|
|
||||||
TicketLog: "logs"
|
TicketLog: "ticket-data"
|
||||||
TranscriptLog: "transcripts"
|
TranscriptLog: "ticket-data"
|
||||||
|
|
||||||
|
DMTranscripts: true
|
||||||
TranscriptTitle: "Ticket Transcript"
|
TranscriptTitle: "Ticket Transcript"
|
||||||
TicketLog_Title: "Ticket Closed"
|
TicketLog_Title: "Ticket Closed"
|
||||||
TicketBlackListMessage: "You are not allowed to open a ticket"
|
TicketBlackListMessage: "You are not allowed to open a ticket"
|
||||||
|
TicketRoleMention: "@here"
|
||||||
|
# To ping a role: <@ROLE_ID>
|
||||||
|
|
||||||
MaxAllowedTickets: 2
|
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.
|
||||||
|
|
||||||
|
AllowThanksForReachingOutMessage: true
|
||||||
|
# Set to true to allow the "Thanks for reaching out Message" to be sent when the ticket is created
|
||||||
|
DisableTicketLogChannel: false
|
||||||
|
# Set to true to disable the requirement of the "TicketLog"
|
||||||
|
# Set to true to also disable the ticket logs to be sent in the "TicketLogs" channel
|
||||||
|
|
||||||
# --- Creation Config ---
|
# --- Creation Config ---
|
||||||
# --- Start ---
|
# --- Start ---
|
||||||
@@ -124,15 +175,51 @@ TicketCreatedAlert: ":ticket: Your support ticket has been created: <#%ticketid%
|
|||||||
AddedUser: "👍 <@%user%> has been added to this ticket"
|
AddedUser: "👍 <@%user%> has been added to this ticket"
|
||||||
RemovedUser: "👍 <@%user%> has been removed from this ticket"
|
RemovedUser: "👍 <@%user%> has been removed from this ticket"
|
||||||
|
|
||||||
# --- Buttons Config ---
|
# -------------------------
|
||||||
# --- Start ---
|
# Tickets Categories
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Timeout: 5
|
||||||
|
|
||||||
|
# Set to true to allow all staff to access the ticket
|
||||||
|
AllowAllStaff: false
|
||||||
|
|
||||||
|
# Ticket roles are the roles that will be able to gain access to tickets depending on what department has been chosen.
|
||||||
|
|
||||||
|
Departments:
|
||||||
|
- title: "Support"
|
||||||
|
role: "Staff"
|
||||||
|
color: "SECONDARY"
|
||||||
|
emoji: "1️⃣"
|
||||||
|
category: "Tickets"
|
||||||
|
|
||||||
|
- title: "Billing Support"
|
||||||
|
role: "Staff"
|
||||||
|
color: "SECONDARY"
|
||||||
|
emoji: "2️⃣"
|
||||||
|
category: "Tickets"
|
||||||
|
|
||||||
|
- title: "Admin Team"
|
||||||
|
role: "Admin"
|
||||||
|
color: "SECONDARY"
|
||||||
|
emoji: "3️⃣"
|
||||||
|
category: "Tickets"
|
||||||
|
|
||||||
|
# - title: "Other"
|
||||||
|
# role: "Staff"
|
||||||
|
# color: "SECONDARY"
|
||||||
|
# emoji: "3️⃣"
|
||||||
|
# category: "Tickets"
|
||||||
|
|
||||||
# Discord Button Colour Selection
|
# Discord Button Colour Selection
|
||||||
# PRIMARY - Blue
|
# PRIMARY - Blurple
|
||||||
# SECONDARY - Grey
|
# SECONDARY - Grey
|
||||||
# DANGER - Red
|
# DANGER - Red
|
||||||
# SUCCESS - Green
|
# SUCCESS - Green
|
||||||
|
|
||||||
|
# --- Buttons Config ---
|
||||||
|
# --- Start ---
|
||||||
|
|
||||||
LockTicketCategory: "Archive"
|
LockTicketCategory: "Archive"
|
||||||
|
|
||||||
TicketCloseEmoji: "❌"
|
TicketCloseEmoji: "❌"
|
||||||
@@ -143,47 +230,23 @@ TicketCloseColour: "DANGER"
|
|||||||
TicketDeleteColour: "DANGER"
|
TicketDeleteColour: "DANGER"
|
||||||
TicketLockColour: "PRIMARY"
|
TicketLockColour: "PRIMARY"
|
||||||
|
|
||||||
TicketDept1Colour: "PRIMARY"
|
# Discord Button Colour Selection
|
||||||
TicketDept2Colour: "PRIMARY"
|
# PRIMARY - Blue
|
||||||
TicketDept3Colour: "PRIMARY"
|
# SECONDARY - Grey
|
||||||
|
# DANGER - Red
|
||||||
TicketDept1Emoji: "1️⃣"
|
# SUCCESS - Green
|
||||||
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.
|
||||||
|
|
||||||
# --- Departments Config ---
|
|
||||||
# --- Start ---
|
|
||||||
|
|
||||||
TicketDepartments: true
|
|
||||||
# Delete the ticket if no department selected. TIME IN MINUTES
|
|
||||||
Timeout: 5
|
|
||||||
AllowStaff: true
|
|
||||||
# If set to false users with the "Staff" role will not be able to view tickets
|
|
||||||
# without a valid department role set below.
|
|
||||||
|
|
||||||
# Set to false to allow "Staff" to see tickets whether its a department for them or not.
|
|
||||||
|
|
||||||
DepartmentTitle_1: "General Support"
|
|
||||||
DepartmentTitle_2: "Billing Support"
|
|
||||||
DepartmentTitle_3: "Admin Team"
|
|
||||||
# Ticket department title, This is the title for a ticket department to help users know what is available.
|
|
||||||
|
|
||||||
DepartmentRole_1: "Support"
|
|
||||||
DepartmentRole_2: "Support"
|
|
||||||
DepartmentRole_3: "Admin"
|
|
||||||
# Ticket roles are the roles that will be able to gain access to tickets depending on what department has been chosen.
|
|
||||||
|
|
||||||
# --- Closing Config ---
|
# --- Closing Config ---
|
||||||
# --- Start ---
|
# --- Start ---
|
||||||
|
|
||||||
StaffOnly: true
|
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: true
|
||||||
|
|
||||||
# ---------------------------
|
# ---------------------------
|
||||||
# Error / Warning Messages
|
# Error / Warning Messages
|
||||||
|
|||||||
@@ -20,22 +20,15 @@ TicketPanel: true
|
|||||||
# Ticket Panel Message Configuration
|
# Ticket Panel Message Configuration
|
||||||
# ----------------------------------------
|
# ----------------------------------------
|
||||||
|
|
||||||
Channel: "create-ticket"
|
Channel: "ticket-creation"
|
||||||
ButtonEmoji: "📩"
|
|
||||||
ButtonLabel: "Open Ticket"
|
|
||||||
ButtonColour: "SUCCESS"
|
|
||||||
# Colour Options:
|
|
||||||
# -> PRIMARY - Blurple
|
|
||||||
# -> SECONDARY - Grey
|
|
||||||
# -> SUCCESS - Green
|
|
||||||
# -> DANGER - Red
|
|
||||||
|
|
||||||
PanelTitle: "Need Help? Create a Support Ticket."
|
PanelTitle: "Need Help? Create a Support Ticket."
|
||||||
|
PanelColour: "#f74343"
|
||||||
|
|
||||||
TicketPanel_Description: true
|
TicketPanel_Description: true
|
||||||
TicketPanel_Thumbnail: false
|
TicketPanel_Thumbnail: true
|
||||||
TicketPanel_Image: false
|
TicketPanel_Image: true
|
||||||
|
|
||||||
PanelMessage: "Click the button to open a new support ticket."
|
PanelMessage: "Click the button to open a new support ticket."
|
||||||
PanelThumbnail: "https://i.imgur.com/ieeZejl.png"
|
PanelThumbnail: "https://i.imgur.com/ieeZejl.png"
|
||||||
PanelImage: "https://i.imgur.com/5NkcmDq.png"
|
PanelImage: "https://i.imgur.com/5NkcmDq.png"
|
||||||
@@ -1,3 +1 @@
|
|||||||
{
|
{"tickets": [{}]}
|
||||||
"tickets": []
|
|
||||||
}
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"id": 0,
|
"id": 0,
|
||||||
"TicketPanelID": ""
|
"TicketPanelID": ""
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
const Event = require("../Structures/Event.js");
|
const Event = require("../Structures/Event.js");
|
||||||
module.exports = new Event("guildCreate", async (client, guild) => {
|
module.exports = new Event("guildCreate", async (client) => {
|
||||||
console.log(
|
console.log(
|
||||||
`\u001b[31m`,
|
`\u001b[31m`,
|
||||||
`${client.user.username} is not in the correct server set in your config. Please leave all other servers and restart the bot.`
|
`${client.user.username} is not in the correct server set in your config. Please leave all other servers and restart the bot.`
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
const Event = require("../Structures/Event.js");
|
const Event = require("../Structures/Event.js");
|
||||||
|
|
||||||
module.exports = new Event("guildDelete", async (client, guild) => {
|
module.exports = new Event("guildDelete", async (client) => {
|
||||||
console.log(
|
console.log(
|
||||||
`\u001b[31m`,
|
`\u001b[31m`,
|
||||||
`${client.user.username} is not in the correct server set in your config. Please join the server and restart the bot.`
|
`${client.user.username} is not in the correct server set in your config. Please join the server and restart the bot.`
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
|
||||||
|
const Discord = require('discord.js');
|
||||||
|
const fs = require("fs");
|
||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = new Event("guildMemberAdd", async (client, member, interaction, guild) => {
|
||||||
|
|
||||||
|
if (supportbot.Welcome) {
|
||||||
|
const WelcomeChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.WelcomeChannel)
|
||||||
|
|
||||||
|
const WelcomeEmbed = new Discord.MessageEmbed()
|
||||||
|
.setColor(supportbot.WelcomeColour)
|
||||||
|
.setTitle(supportbot.WelcomeTitle)
|
||||||
|
.setDescription(supportbot.WelcomeMessage.replace(/%joined_user%/g, member.user))
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
if (supportbot.EmbedWelcomeThumbnail === "BOT") {
|
||||||
|
WelcomeEmbed.setThumbnail(client.user.displayAvatarURL())
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.EmbedWelcomeThumbnail === "USER") {
|
||||||
|
WelcomeEmbed.setThumbnail(member.user.displayAvatarURL())
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.EmbedWelcomeImage) {
|
||||||
|
WelcomeEmbed.setImage(supportbot.EmbedWelcomeImageURL)
|
||||||
|
}
|
||||||
|
|
||||||
|
WelcomeChannel.send({
|
||||||
|
embeds: [WelcomeEmbed]
|
||||||
|
})
|
||||||
|
|
||||||
|
if (supportbot.AutoRole) {
|
||||||
|
var role = member.guild.roles.cache.find(role => role.name === supportbot.JoinRole);
|
||||||
|
member.roles.add(role);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`\u001b[32m`, `[+]`, `\u001b[33m`, `${member.user.username} joined the server!`)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
|
||||||
|
const Discord = require('discord.js');
|
||||||
|
const fs = require("fs");
|
||||||
|
const Event = require("../Structures/Event.js");
|
||||||
|
const yaml = require("js-yaml");
|
||||||
|
const supportbot = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/supportbot.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = new Event("guildMemberRemove", async (client, member, interaction, guild) => {
|
||||||
|
|
||||||
|
if (supportbot.Leave) {
|
||||||
|
const LeaveChannel = member.guild.channels.cache.find(channel => channel.name === supportbot.LeaveChannel)
|
||||||
|
|
||||||
|
const LeaveEmbed = new Discord.MessageEmbed()
|
||||||
|
.setColor(supportbot.LeaveColour)
|
||||||
|
.setTitle(supportbot.LeaveTitle)
|
||||||
|
.setDescription(supportbot.LeaveMessage.replace(/%joined_user%/g, member.user))
|
||||||
|
.setTimestamp();
|
||||||
|
|
||||||
|
if (supportbot.EmbedLeaveThumbnail === "BOT") {
|
||||||
|
LeaveEmbed.setThumbnail(client.user.displayAvatarURL())
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.EmbedLeaveThumbnail === "USER") {
|
||||||
|
LeaveEmbed.setThumbnail(member.user.displayAvatarURL())
|
||||||
|
}
|
||||||
|
|
||||||
|
if (supportbot.EmbedLeaveImage) {
|
||||||
|
LeaveEmbed.setImage(supportbot.EmbedLeaveImageURL)
|
||||||
|
}
|
||||||
|
|
||||||
|
LeaveChannel.send({
|
||||||
|
embeds: [LeaveEmbed]
|
||||||
|
})
|
||||||
|
|
||||||
|
console.log(`\u001b[31m`, `[-]`, `\u001b[33m`, `${member.user.username} joined the server!`)
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
+18
-13
@@ -15,7 +15,7 @@ const Event = require("../Structures/Event.js");
|
|||||||
module.exports = new Event("interactionCreate", async (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.guild) return;
|
if (interaction.user.bot || !interaction.guild) return;
|
||||||
@@ -29,7 +29,7 @@ module.exports = new Event("interactionCreate", async (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(
|
||||||
@@ -41,11 +41,13 @@ module.exports = new Event("interactionCreate", async (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;
|
||||||
@@ -65,7 +67,7 @@ module.exports = new Event("interactionCreate", async (client, interaction) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
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();
|
||||||
let Admin =
|
let Admin =
|
||||||
interaction.guild.roles.cache.find(
|
interaction.guild.roles.cache.find(
|
||||||
@@ -84,25 +86,28 @@ module.exports = new Event("interactionCreate", async (client, interaction) => {
|
|||||||
|
|
||||||
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")
|
||||||
@@ -116,7 +121,7 @@ module.exports = new Event("interactionCreate", async (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.reply({ embeds: [ArchiveEmbed] });
|
interaction.reply({ embeds: [ArchiveEmbed] });
|
||||||
interaction.message.edit({ components: [row] });
|
interaction.message.edit({ components: [row] });
|
||||||
|
|||||||
+61
-47
@@ -14,30 +14,39 @@ const panelconfig = yaml.load(
|
|||||||
|
|
||||||
const Event = require("../Structures/Event.js");
|
const Event = require("../Structures/Event.js");
|
||||||
|
|
||||||
module.exports = new Event("ready", async (client) => {
|
module.exports = new Event("ready", async (client, interaction) => {
|
||||||
const { getRole, getChannel, getCategory } = client;
|
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,
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`\u001b[32m`, `┏━━━┓╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓┏━━┓╋╋╋┏┓`);
|
console.log(`\u001b[107m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||||
console.log(`\u001b[32m`, `┃┏━┓┃╋╋╋╋╋╋╋╋╋╋╋╋┏┛┗┫┏┓┃╋╋┏┛┗┓`);
|
console.log(`\u001b[91m`, `┏━━━┓╋╋╋╋╋╋╋╋╋╋╋╋╋┏┓┏━━┓╋╋╋┏┓`);
|
||||||
console.log(`\u001b[32m`, `┃┗━━┳┓┏┳━━┳━━┳━━┳┻┓┏┫┗┛┗┳━┻┓┏┛`);
|
console.log(`\u001b[91m`, `┃┏━┓┃╋╋╋╋╋╋╋╋╋╋╋╋┏┛┗┫┏┓┃╋╋┏┛┗┓`);
|
||||||
console.log(`\u001b[32m`, `┗━━┓┃┃┃┃┏┓┃┏┓┃┏┓┃┏┫┃┃┏━┓┃┏┓┃┃`);
|
console.log(`\u001b[91m`, `┃┗━━┳┓┏┳━━┳━━┳━━┳┻┓┏┫┗┛┗┳━┻┓┏┛`);
|
||||||
console.log(`\u001b[32m`, `┃┗━┛┃┗┛┃┗┛┃┗┛┃┗┛┃┃┃┗┫┗━┛┃┗┛┃┗┓`);
|
console.log(`\u001b[91m`, `┗━━┓┃┃┃┃┏┓┃┏┓┃┏┓┃┏┫┃┃┏━┓┃┏┓┃┃`);
|
||||||
console.log(`\u001b[32m`, `┗━━━┻━━┫┏━┫┏━┻━━┻┛┗━┻━━━┻━━┻━┛`);
|
console.log(`\u001b[91m`, `┃┗━┛┃┗┛┃┗┛┃┗┛┃┗┛┃┃┃┗┫┗━┛┃┗┛┃┗┓`);
|
||||||
console.log(`\u001b[32m`, `┗╋╋╋╋╋╋╋┃┃╋┃┃`);
|
console.log(`\u001b[91m`, `┗━━━┻━━┫┏━┫┏━┻━━┻┛┗━┻━━━┻━━┻━┛`);
|
||||||
console.log(`\u001b[32m`, `╋╋╋╋╋╋╋┗┛╋┗┛`);
|
console.log(`\u001b[91m`, `┗╋╋╋╋╋╋╋┃┃╋┃┃`);
|
||||||
|
console.log(`\u001b[91m`, `╋╋╋╋╋╋╋┗┛╋┗┛`);
|
||||||
console.log(` `);
|
console.log(` `);
|
||||||
console.log(`\u001b[31m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
console.log(`\u001b[32m`, `――――――――――――――――――――――――――――――――――――――――――――`);
|
||||||
console.log(` `);
|
console.log(` `);
|
||||||
console.log(
|
console.log(
|
||||||
`\u001b[33m`,
|
`\u001b[33m`,
|
||||||
`${supportbot.Name} v${supportbot.SupportBot_Version}`,
|
`${supportbot.Name} | v${supportbot.SupportBot_Version}`,
|
||||||
`\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:`,
|
||||||
@@ -48,7 +57,7 @@ module.exports = new Event("ready", async (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`,
|
||||||
@@ -66,39 +75,37 @@ module.exports = new Event("ready", async (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 (
|
|
||||||
!supportbot.Guild ||
|
|
||||||
(await client.guilds.cache.size) !== 1 ||
|
|
||||||
(await client.guilds.cache.first().id) !== supportbot.Guild
|
|
||||||
) {
|
|
||||||
console.log(
|
|
||||||
`\u001b[31m`,
|
|
||||||
`${client.user.username} is not in the correct server set in your config. Please join the server and restart the bot.`
|
|
||||||
);
|
|
||||||
console.log(`\u001b[31m`, `${client.user.username} will now exit.`);
|
|
||||||
return process.exit(1);
|
|
||||||
}
|
|
||||||
const roles = [
|
const roles = [
|
||||||
supportbot.Admin,
|
supportbot.Admin,
|
||||||
supportbot.Staff,
|
supportbot.Staff,
|
||||||
supportbot.TicketBlackListRole,
|
supportbot.TicketBlackListRole,
|
||||||
supportbot.DepartmentRole_1,
|
|
||||||
supportbot.DepartmentRole_2,
|
|
||||||
supportbot.DepartmentRole_3,
|
|
||||||
];
|
];
|
||||||
if (supportbot.AutoRole) roles.push(supportbot.AutoRole_Role);
|
|
||||||
|
supportbot.Departments.forEach((department) => roles.push(department.role));
|
||||||
|
|
||||||
|
if (supportbot.AutoRole) roles.push(supportbot.JoinRole);
|
||||||
const channels = [
|
const channels = [
|
||||||
supportbot.SuggestionChannel,
|
supportbot.SuggestionChannel,
|
||||||
supportbot.TicketLog,
|
supportbot.TicketLog,
|
||||||
supportbot.TranscriptLog,
|
supportbot.TranscriptLog,
|
||||||
panelconfig.Channel,
|
panelconfig.Channel,
|
||||||
|
supportbot.WelcomeChannel,
|
||||||
|
supportbot.LeaveChannel,
|
||||||
|
supportbot.TranslateLogChannel
|
||||||
];
|
];
|
||||||
const categories = [supportbot.TicketCategory];
|
//const categories = [supportbot.TicketCategory];
|
||||||
|
|
||||||
const missingC = [];
|
const missingC = [];
|
||||||
const missingR = [];
|
const missingR = [];
|
||||||
const missingCat = [];
|
const missingCat = [];
|
||||||
for (let c of channels) {
|
for (let c of channels) {
|
||||||
|
if ((c === supportbot.SuggestionChannel && supportbot.DisableSuggestionsChannel) || c === supportbot.TicketLog && supportbot.DisableTicketLogChannel) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
const find = await getChannel(c, client.guilds.cache.first());
|
const find = await getChannel(c, client.guilds.cache.first());
|
||||||
if (!find) missingC.push(c);
|
if (!find) missingC.push(c);
|
||||||
}
|
}
|
||||||
@@ -106,10 +113,10 @@ module.exports = new Event("ready", async (client) => {
|
|||||||
const find = await getRole(r, client.guilds.cache.first());
|
const find = await getRole(r, client.guilds.cache.first());
|
||||||
if (!find) missingR.push(r);
|
if (!find) missingR.push(r);
|
||||||
}
|
}
|
||||||
for (let cat of categories) {
|
// for (let cat of categories) {
|
||||||
const find = await getCategory(cat, client.guilds.cache.first());
|
// const find = await getCategory(cat, client.guilds.cache.first());
|
||||||
if (!find) missingCat.push(cat);
|
// if (!find) missingCat.push(cat);
|
||||||
}
|
// }
|
||||||
|
|
||||||
if (missingR.length > 0) {
|
if (missingR.length > 0) {
|
||||||
console.log(
|
console.log(
|
||||||
@@ -137,8 +144,9 @@ module.exports = new Event("ready", async (client) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
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) {
|
||||||
@@ -153,11 +161,14 @@ module.exports = new Event("ready", async (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(panelconfig.PanelColour)
|
||||||
.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);
|
||||||
@@ -170,12 +181,15 @@ module.exports = new Event("ready", async (client) => {
|
|||||||
if (panelconfig.TicketPanel_Image) {
|
if (panelconfig.TicketPanel_Image) {
|
||||||
embed.setImage(panelconfig.PanelImage);
|
embed.setImage(panelconfig.PanelImage);
|
||||||
}
|
}
|
||||||
|
let button;
|
||||||
|
|
||||||
let button = new Discord.MessageButton()
|
button = supportbot.Departments.map((x) =>
|
||||||
.setLabel(panelconfig.ButtonLabel)
|
new Discord.MessageButton()
|
||||||
.setCustomId("openticket")
|
.setCustomId("department-" + supportbot.Departments.indexOf(x))
|
||||||
.setStyle(panelconfig.ButtonColour)
|
.setLabel(x.title)
|
||||||
.setEmoji(panelconfig.ButtonEmoji);
|
.setStyle(x.color)
|
||||||
|
.setEmoji(x.emoji)
|
||||||
|
);
|
||||||
|
|
||||||
let row = new Discord.MessageActionRow().addComponents(button);
|
let row = new Discord.MessageActionRow().addComponents(button);
|
||||||
|
|
||||||
@@ -187,7 +201,7 @@ module.exports = new Event("ready", async (client) => {
|
|||||||
.then((r) => {
|
.then((r) => {
|
||||||
let data = {
|
let data = {
|
||||||
id: panelid.id,
|
id: panelid.id,
|
||||||
TicketPanelID: `${r.id}`,
|
TicketPanelID: r.id,
|
||||||
};
|
};
|
||||||
fs.writeFileSync(
|
fs.writeFileSync(
|
||||||
"./Data/ticket-panel-id.json",
|
"./Data/ticket-panel-id.json",
|
||||||
@@ -196,8 +210,8 @@ module.exports = new Event("ready", async (client) => {
|
|||||||
);
|
);
|
||||||
})
|
})
|
||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.log("Raw" + e);
|
console.log("Raw: " + e);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
+21
@@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2022 Emerald Services
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
@@ -8,6 +8,5 @@ SupportBot is an open-sourced support system for discord. It's completely free t
|
|||||||
|
|
||||||
**|** [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 MC-Market](https://www.mc-market.org/resources/8940/) **|**
|
[Download via MC-Market](https://www.mc-market.org/resources/8940/) **|**
|
||||||
+13
-9
@@ -37,10 +37,14 @@ class Client extends Discord.Client {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
start(token) {
|
async start(token) {
|
||||||
const commandFiles = fs
|
var tempCommandFiles = fs.readdirSync("./Commands").filter((file) => file.endsWith(".js"));
|
||||||
.readdirSync("./Commands")
|
|
||||||
.filter((file) => file.endsWith(".js"));
|
if (supportbot.DisableSuggestions) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "suggest.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
const commandFiles = tempCommandFiles;
|
||||||
|
|
||||||
const addonFiles = fs
|
const addonFiles = fs
|
||||||
.readdirSync("./Addons")
|
.readdirSync("./Addons")
|
||||||
@@ -76,10 +80,10 @@ class Client extends Discord.Client {
|
|||||||
`\u001b[32;1m`,
|
`\u001b[32;1m`,
|
||||||
"Loaded"
|
"Loaded"
|
||||||
);
|
);
|
||||||
addon.commands.forEach((command) => {
|
addon.commands?.forEach((command) => {
|
||||||
this.commands.set(command.name, command);
|
this.commands.set(command.name, command);
|
||||||
});
|
});
|
||||||
addon.events.forEach((event) => {
|
addon.events?.forEach((event) => {
|
||||||
this.on(event.event, (...args) => event.run(this, ...args));
|
this.on(event.event, (...args) => event.run(this, ...args));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -89,7 +93,7 @@ class Client extends Discord.Client {
|
|||||||
// Slash Commands
|
// Slash Commands
|
||||||
|
|
||||||
this.once("ready", async () => {
|
this.once("ready", async () => {
|
||||||
await this.application?.commands.set(this.commands, supportbot.Guild);
|
await this.guilds.cache.first()?.commands.set(this.commands);
|
||||||
console.log(
|
console.log(
|
||||||
`\u001b[32;1m`,
|
`\u001b[32;1m`,
|
||||||
`Slash Commands Registered for ${this.guilds.cache.first().name}`
|
`Slash Commands Registered for ${this.guilds.cache.first().name}`
|
||||||
@@ -108,8 +112,8 @@ class Client extends Discord.Client {
|
|||||||
});
|
});
|
||||||
|
|
||||||
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
|
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
|
||||||
if (process.argv[2] != "test") {
|
if (process.argv[2] !== "test") {
|
||||||
this.login(token);
|
await this.login(token);
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
`\u001b[31;1m`,
|
`\u001b[31;1m`,
|
||||||
|
|||||||
@@ -1,19 +1,14 @@
|
|||||||
// SupportBot | Emerald Services
|
// SupportBot | Emerald Services
|
||||||
// Command Structure
|
// Command Structure
|
||||||
|
|
||||||
const fs = require("fs");
|
|
||||||
|
|
||||||
const yaml = require("js-yaml");
|
|
||||||
|
|
||||||
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.permissions = options.permissions;
|
this.permissions = options.permissions || [];
|
||||||
this.options = options.options || [];
|
this.options = options.options || [];
|
||||||
this.run = options.run;
|
this.run = options.run;
|
||||||
this.defaultPermission = true;
|
this.defaultPermission = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = Command;
|
module.exports = Command;
|
||||||
@@ -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
+848
-257
File diff suppressed because it is too large.
Load diff
+5
-3
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "supportbot",
|
"name": "supportbot",
|
||||||
"version": "7.4.1",
|
"version": "7.7b",
|
||||||
"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": {
|
||||||
@@ -18,7 +18,9 @@
|
|||||||
},
|
},
|
||||||
"homepage": "https://github.com/Emerald-Services/SupportBot#readme",
|
"homepage": "https://github.com/Emerald-Services/SupportBot#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"discord.js": "^13.3.1",
|
"@vitalets/google-translate-api": "^8.0.0",
|
||||||
"js-yaml": "^4.1.0"
|
"discord.js": "^13.6.0",
|
||||||
|
"js-yaml": "^4.1.0",
|
||||||
|
"moment": "^2.29.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user