8.0 Dev 1.2
Reworked configuration files & completed upgrade to V14
This commit is contained in:
1 parent
4e081358ff
commit
4eadef8b65
13 files changed
+372
-78
No files matched your search
@@ -29,14 +29,6 @@ module.exports = new Command({
|
|||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let disableCommand = true;
|
let disableCommand = true;
|
||||||
|
|
||||||
if (cmdconfig.TicketAdd.Enabled === false) {
|
|
||||||
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
|
|
||||||
return interaction.reply({
|
|
||||||
content: ":x: This command is `disabled`",
|
|
||||||
ephemeral: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const { getRole } = 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);
|
||||||
|
|||||||
@@ -28,14 +28,6 @@ module.exports = new Command({
|
|||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let disableCommand = true;
|
let disableCommand = true;
|
||||||
|
|
||||||
if (cmdconfig.CloseTicket.Enabled === false) {
|
|
||||||
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
|
|
||||||
return interaction.reply({
|
|
||||||
content: ":x: This command is `disabled`",
|
|
||||||
ephemeral: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const { getRole, getChannel } = 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);
|
||||||
|
|||||||
+1
-7
@@ -20,49 +20,43 @@ module.exports = new Command({
|
|||||||
{
|
{
|
||||||
name: "title",
|
name: "title",
|
||||||
description: "Embed Title",
|
description: "Embed Title",
|
||||||
type: "STRING",
|
|
||||||
type: Discord.ApplicationCommandOptionType.String,
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "message",
|
name: "message",
|
||||||
description: "Embed Message",
|
description: "Embed Message",
|
||||||
type: "STRING",
|
|
||||||
type: Discord.ApplicationCommandOptionType.String,
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "color",
|
name: "color",
|
||||||
description: "Embed HEX Color",
|
description: "Embed HEX Color",
|
||||||
type: "STRING",
|
|
||||||
type: Discord.ApplicationCommandOptionType.String,
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "fieldtitle",
|
name: "fieldtitle",
|
||||||
description: "Add an additional Embed Field",
|
description: "Add an additional Embed Field",
|
||||||
type: "STRING",
|
|
||||||
type: Discord.ApplicationCommandOptionType.String,
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "fieldcontent",
|
name: "fieldcontent",
|
||||||
description: "Add an additional Embed Field",
|
description: "Add an additional Embed Field",
|
||||||
type: "STRING",
|
|
||||||
type: Discord.ApplicationCommandOptionType.String,
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "thumbnail",
|
name: "thumbnail",
|
||||||
description: "Embed Thumbnail URL",
|
description: "Embed Thumbnail URL",
|
||||||
type: "STRING",
|
|
||||||
type: Discord.ApplicationCommandOptionType.String,
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "image",
|
name: "image",
|
||||||
description: "Embed Image URL",
|
description: "Embed Image URL",
|
||||||
type: "STRING",
|
|
||||||
type: Discord.ApplicationCommandOptionType.String,
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
required: false,
|
required: false,
|
||||||
},
|
},
|
||||||
|
|||||||
+3
-3
@@ -60,7 +60,7 @@ module.exports = new Command({
|
|||||||
const HelpEmbed1 = new Discord.EmbedBuilder()
|
const HelpEmbed1 = new Discord.EmbedBuilder()
|
||||||
.setTitle(supportbot.General.Name + " Commands")
|
.setTitle(supportbot.General.Name + " Commands")
|
||||||
.setThumbnail(interaction.user.displayAvatarURL())
|
.setThumbnail(interaction.user.displayAvatarURL())
|
||||||
.setColor(supportbot.GeneralColour)
|
.setColor(supportbot.Embed.Colours.General)
|
||||||
.addFields(
|
.addFields(
|
||||||
{
|
{
|
||||||
name: "🖥️ General Commands\n",
|
name: "🖥️ General Commands\n",
|
||||||
@@ -74,9 +74,9 @@ module.exports = new Command({
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
.setColor(supportbot.GeneralColour)
|
.setColor(supportbot.Embed.Colours.General)
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: supportbot.EmbedFooter,
|
text: supportbot.Embed.Footer,
|
||||||
iconURL: interaction.user.displayAvatarURL(),
|
iconURL: interaction.user.displayAvatarURL(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
+12
-15
@@ -11,6 +11,7 @@ const supportbot = yaml.load(
|
|||||||
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
|
||||||
|
|
||||||
const Command = require("../Structures/Command.js");
|
const Command = require("../Structures/Command.js");
|
||||||
|
const { channel } = require("diagnostics_channel");
|
||||||
|
|
||||||
module.exports = new Command({
|
module.exports = new Command({
|
||||||
name: cmdconfig.Suggestion.Command,
|
name: cmdconfig.Suggestion.Command,
|
||||||
@@ -20,7 +21,6 @@ module.exports = new Command({
|
|||||||
{
|
{
|
||||||
name: "suggestion",
|
name: "suggestion",
|
||||||
description: "Create a Suggestion",
|
description: "Create a Suggestion",
|
||||||
type: "STRING",
|
|
||||||
type: Discord.ApplicationCommandOptionType.String,
|
type: Discord.ApplicationCommandOptionType.String,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
@@ -30,15 +30,8 @@ module.exports = new Command({
|
|||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let disableCommand = true;
|
let disableCommand = true;
|
||||||
|
|
||||||
if (cmdconfig.Suggestion.Enabled === false) {
|
|
||||||
if (interaction.type === Discord.InteractionType.ApplicationCommand && disableCommand)
|
|
||||||
return interaction.reply({
|
|
||||||
content: ":x: This command is `disabled`",
|
|
||||||
ephemeral: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
const { getChannel } = interaction.client;
|
const { getChannel } = interaction.client;
|
||||||
|
|
||||||
const suggestChannel = await getChannel(
|
const suggestChannel = await getChannel(
|
||||||
supportbot.SuggestionChannel,
|
supportbot.SuggestionChannel,
|
||||||
interaction.guild
|
interaction.guild
|
||||||
@@ -54,8 +47,11 @@ module.exports = new Command({
|
|||||||
let suggestion = interaction.options.getString("suggestion");
|
let suggestion = interaction.options.getString("suggestion");
|
||||||
|
|
||||||
const SuggestEmbed = new Discord.EmbedBuilder()
|
const SuggestEmbed = new Discord.EmbedBuilder()
|
||||||
.addField("Suggestion", suggestion, true)
|
.addFields(
|
||||||
.addField("From", `<@${interaction.user.id}>`)
|
{ name: "Suggestion", value: suggestion, inline: true},
|
||||||
|
{ name: "From", value: `<@${interaction.user.id}>`},
|
||||||
|
)
|
||||||
|
|
||||||
.setThumbnail(interaction.user.displayAvatarURL())
|
.setThumbnail(interaction.user.displayAvatarURL())
|
||||||
.setFooter({
|
.setFooter({
|
||||||
text: supportbot.EmbedFooter,
|
text: supportbot.EmbedFooter,
|
||||||
@@ -64,6 +60,7 @@ module.exports = new Command({
|
|||||||
.setColor(supportbot.GeneralColour);
|
.setColor(supportbot.GeneralColour);
|
||||||
|
|
||||||
const suggestionMsg = await suggestChannel.send({ embeds: [SuggestEmbed] });
|
const suggestionMsg = await suggestChannel.send({ embeds: [SuggestEmbed] });
|
||||||
|
|
||||||
if (supportbot.SuggestionUpvote && supportbot.SuggestionDownvote) {
|
if (supportbot.SuggestionUpvote && supportbot.SuggestionDownvote) {
|
||||||
await suggestionMsg.react(supportbot.SuggestionUpvote);
|
await suggestionMsg.react(supportbot.SuggestionUpvote);
|
||||||
await suggestionMsg.react(supportbot.SuggestionDownvote);
|
await suggestionMsg.react(supportbot.SuggestionDownvote);
|
||||||
@@ -72,7 +69,7 @@ module.exports = new Command({
|
|||||||
await suggestionMsg.startThread({
|
await suggestionMsg.startThread({
|
||||||
name: `Suggestion-releated Thread`,
|
name: `Suggestion-releated Thread`,
|
||||||
autoArchiveDuration: 60,
|
autoArchiveDuration: 60,
|
||||||
type: 'GUILD_PUBLIC_THREAD',
|
type: Discord.ChannelType.GuildPublicThread,
|
||||||
reason: 'Suggestion-releated thread',
|
reason: 'Suggestion-releated thread',
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -81,10 +78,10 @@ module.exports = new Command({
|
|||||||
|
|
||||||
const Submitted = new Discord.EmbedBuilder()
|
const Submitted = new Discord.EmbedBuilder()
|
||||||
.setTitle("Suggestion Submitted!")
|
.setTitle("Suggestion Submitted!")
|
||||||
.setDescription(
|
.setDescription(`:white_check_mark: You have successfully submitted a suggestion.`)
|
||||||
`:white_check_mark: You have successfully submitted a suggestion.`
|
.addFields(
|
||||||
|
{ name: "Sent to:", value: `<#${suggestChannel.id}>`},
|
||||||
)
|
)
|
||||||
.addField("Sent to:", `<#${suggestChannel.id}>`)
|
|
||||||
.setColor(supportbot.SuccessColour);
|
.setColor(supportbot.SuccessColour);
|
||||||
|
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
|
|||||||
+18
-18
@@ -11,7 +11,10 @@ const {
|
|||||||
ApplicationCommandOptionType,
|
ApplicationCommandOptionType,
|
||||||
ApplicationCommandType,
|
ApplicationCommandType,
|
||||||
ButtonStyle,
|
ButtonStyle,
|
||||||
InteractionType
|
InteractionType,
|
||||||
|
DiscordAPIError,
|
||||||
|
ChannelType,
|
||||||
|
InteractionCollector
|
||||||
} = require("discord.js");
|
} = require("discord.js");
|
||||||
|
|
||||||
const yaml = require("js-yaml");
|
const yaml = require("js-yaml");
|
||||||
@@ -40,13 +43,7 @@ module.exports = new Command({
|
|||||||
async run(interaction) {
|
async run(interaction) {
|
||||||
let disableCommand = true;
|
let disableCommand = true;
|
||||||
|
|
||||||
if (cmdconfig.OpenTicket.Enabled === false) {
|
|
||||||
if (interaction.type === InteractionType.ApplicationCommand && disableCommand)
|
|
||||||
return interaction.reply({
|
|
||||||
content: ":x: This command is `disabled`",
|
|
||||||
ephemeral: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
let department = interaction.customId?.split("-")[1] || null;
|
let department = interaction.customId?.split("-")[1] || null;
|
||||||
let TicketData = await JSON.parse(
|
let TicketData = await JSON.parse(
|
||||||
@@ -55,6 +52,8 @@ module.exports = new Command({
|
|||||||
const { getRole, 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)
|
||||||
@@ -77,6 +76,7 @@ module.exports = new Command({
|
|||||||
ephemeral: true,
|
ephemeral: true,
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
|
|
||||||
if (User.roles.cache.has(supportbot.TicketMutedRole)) {
|
if (User.roles.cache.has(supportbot.TicketMutedRole)) {
|
||||||
return interaction.reply({
|
return interaction.reply({
|
||||||
content: supportbot.TicketMutedMessage,
|
content: supportbot.TicketMutedMessage,
|
||||||
@@ -89,7 +89,7 @@ module.exports = new Command({
|
|||||||
|
|
||||||
// Ticket Subject
|
// Ticket Subject
|
||||||
const TicketSubject =
|
const TicketSubject =
|
||||||
interaction.options?.getString("reason") || supportbot.NoTicketSubject;
|
interaction.options?.getString("reason") || supportbot.Tickets.Messages.InvalidSubject;
|
||||||
|
|
||||||
const TicketExists = new EmbedBuilder()
|
const TicketExists = new EmbedBuilder()
|
||||||
.setTitle("Ticket Exists!")
|
.setTitle("Ticket Exists!")
|
||||||
@@ -121,32 +121,32 @@ module.exports = new Command({
|
|||||||
const ticketChannel = await interaction.guild.channels.create(
|
const ticketChannel = await interaction.guild.channels.create(
|
||||||
`${supportbot.TicketPrefix}${ticketNumberID}`,
|
`${supportbot.TicketPrefix}${ticketNumberID}`,
|
||||||
{
|
{
|
||||||
type: "GUILD_TEXT",
|
type: ChannelType.GuildText,
|
||||||
parent: TicketCategory.id,
|
parent: TicketCategory.id,
|
||||||
permissionOverwrites: [
|
permissionOverwrites: [
|
||||||
{
|
{
|
||||||
id: Admin.id,
|
id: Admin.id,
|
||||||
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
allow: [PermissionsBitField.Flags.ViewChannel],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: interaction.user.id,
|
id: interaction.user.id,
|
||||||
allow: [Permissions.FLAGS.VIEW_CHANNEL],
|
allow: [PermissionsBitField.Flags.ViewChannel],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: interaction.guild.id,
|
id: interaction.guild.id,
|
||||||
deny: [Permissions.FLAGS.VIEW_CHANNEL],
|
deny: [PermissionsBitField.Flags.ViewChannel],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
if (supportbot.AllowAllStaff) {
|
if (supportbot.AllowAllStaff) {
|
||||||
await ticketChannel.permissionOverwrites.edit(Staff.id, {
|
await ticketChannel.permissionOverwrites.edit(Staff.id, {
|
||||||
VIEW_CHANNEL: true,
|
ViewChannel: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (!department) {
|
if (!department) {
|
||||||
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
||||||
SEND_MESSAGES: false,
|
SendMessages: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
await TicketData.tickets.push({
|
await TicketData.tickets.push({
|
||||||
@@ -281,10 +281,10 @@ module.exports = new Command({
|
|||||||
let title = supportbot.Departments[num].title;
|
let title = supportbot.Departments[num].title;
|
||||||
|
|
||||||
await ticketChannel.permissionOverwrites.edit(role.id, {
|
await ticketChannel.permissionOverwrites.edit(role.id, {
|
||||||
VIEW_CHANNEL: true,
|
ViewChannel: true,
|
||||||
});
|
});
|
||||||
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
await ticketChannel.permissionOverwrites.edit(interaction.user.id, {
|
||||||
SEND_MESSAGES: true,
|
SendMessages: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
await collector.reply({
|
await collector.reply({
|
||||||
@@ -316,7 +316,7 @@ module.exports = new Command({
|
|||||||
);
|
);
|
||||||
let title = supportbot.Departments[department].title;
|
let title = supportbot.Departments[department].title;
|
||||||
await ticketChannel.permissionOverwrites.edit(role.id, {
|
await ticketChannel.permissionOverwrites.edit(role.id, {
|
||||||
VIEW_CHANNEL: true,
|
ViewChannel: true,
|
||||||
});
|
});
|
||||||
let TicketCat = await getCategory(
|
let TicketCat = await getCategory(
|
||||||
supportbot.Departments[department].category,
|
supportbot.Departments[department].category,
|
||||||
|
|||||||
@@ -0,0 +1,181 @@
|
|||||||
|
# ___ _ ___ _
|
||||||
|
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||||
|
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||||
|
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||||
|
# |_| |_|
|
||||||
|
#
|
||||||
|
# SupportBot created by Emerald Development
|
||||||
|
# Installed with MIT License
|
||||||
|
#
|
||||||
|
# Discord Support: https://dsc.gg/emerald-dev
|
||||||
|
# Official Documentation: https://emeraldsrv.dev/wiki
|
||||||
|
# Third-Party Documentation: https://emeraldsrv.dev/third-party
|
||||||
|
|
||||||
|
SupportBot_Version: "v8.0 DEV-v1.2"
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# General
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
General:
|
||||||
|
Name: "SupportBot"
|
||||||
|
Token: "BOT TOKEN"
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Activity
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Activity:
|
||||||
|
Status: "SupportBot v8"
|
||||||
|
Type: "Watching"
|
||||||
|
# The Type can either be Playing, Watching, Listenin or Streaming.
|
||||||
|
StreamingURL: "https://www.twitch.tv/YOUR_TWITCH_NAME"
|
||||||
|
# Set The Type to "Streaming" for a streaming status!
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Embeds
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Embed:
|
||||||
|
Colours:
|
||||||
|
General: "#f74343"
|
||||||
|
Success: "#04b545"
|
||||||
|
Error: "#d12519"
|
||||||
|
Warn: "#fca117"
|
||||||
|
|
||||||
|
Footer: "SupportBot | Developed by Emerald Development"
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Roles
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Roles:
|
||||||
|
AutoRole:
|
||||||
|
Enabled: true
|
||||||
|
Roles: "Member"
|
||||||
|
|
||||||
|
StaffMember:
|
||||||
|
Staff: "Staff"
|
||||||
|
Admin: "Admin"
|
||||||
|
|
||||||
|
ModRoles:
|
||||||
|
Muted: "Muted"
|
||||||
|
Blacklisted: "Blacklisted"
|
||||||
|
|
||||||
|
# ----------------------------
|
||||||
|
# System Messages
|
||||||
|
# ----------------------------
|
||||||
|
|
||||||
|
Welcome:
|
||||||
|
Enabled: true
|
||||||
|
Channel: "welcome"
|
||||||
|
|
||||||
|
Leave:
|
||||||
|
Enabled: true
|
||||||
|
Channel: "leave"
|
||||||
|
|
||||||
|
# ----------------------------
|
||||||
|
# Suggestions
|
||||||
|
# ----------------------------
|
||||||
|
|
||||||
|
Suggestions:
|
||||||
|
Channel: "suggestions"
|
||||||
|
UpvoteEmoji: "✅"
|
||||||
|
DownvoteEmoji: "❌"
|
||||||
|
|
||||||
|
Threads:
|
||||||
|
Enabled: true
|
||||||
|
Title: "Suggestion-releated Thread"
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Tickets
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Ticket:
|
||||||
|
Channel: "ticket-" # The prefix for ticket channel names
|
||||||
|
TicketsPerUser: 2
|
||||||
|
RoleMention: "@here"
|
||||||
|
AllowMentions: true
|
||||||
|
DMTranscripts: true
|
||||||
|
# Set to true to allow the ticket to mention the author and the support team.
|
||||||
|
# Set false to dis-allow mentions within tickets.
|
||||||
|
TicketSubject: "description"
|
||||||
|
# "description" will display the ticket reason within the channel description
|
||||||
|
# "embed" will display the ticket reason within the ticket embed
|
||||||
|
AllowThanksForReachingOutMessage: true
|
||||||
|
# Set to true to allow the "Thanks for reaching out Message" to be sent when the ticket is created
|
||||||
|
Timeout: 5
|
||||||
|
AllowAllStaff: false
|
||||||
|
# Set to true to allow all staff to access the ticket
|
||||||
|
LockTicketCategory: "Archive"
|
||||||
|
|
||||||
|
Log:
|
||||||
|
TicketLog: "ticket-data"
|
||||||
|
TicketLog_Title: "Ticket Closed"
|
||||||
|
DisableTicketLogChannel: false
|
||||||
|
|
||||||
|
TranscriptLog: "ticket-data"
|
||||||
|
TranscriptTitle: "Ticket Transcript"
|
||||||
|
|
||||||
|
Close:
|
||||||
|
StaffOnly: true
|
||||||
|
# Set to false is anyone is able to close a ticket.
|
||||||
|
CloseConfirmation: true
|
||||||
|
Confirmation_Word: "confirm"
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Departments
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Departments:
|
||||||
|
- title: "Support"
|
||||||
|
role: "SupportBot Staff"
|
||||||
|
color: "Secondary"
|
||||||
|
emoji: "1️⃣"
|
||||||
|
category: "Tickets"
|
||||||
|
|
||||||
|
- title: "Billing Support"
|
||||||
|
role: "SupportBot Staff"
|
||||||
|
color: "Secondary"
|
||||||
|
emoji: "2️⃣"
|
||||||
|
category: "Tickets"
|
||||||
|
|
||||||
|
- title: "Admin Team"
|
||||||
|
role: "SupportBot Admin"
|
||||||
|
color: "Secondary"
|
||||||
|
emoji: "3️⃣"
|
||||||
|
category: "Tickets"
|
||||||
|
|
||||||
|
# - title: "Other"
|
||||||
|
# role: "Staff"
|
||||||
|
# color: "Secondary"
|
||||||
|
# emoji: "3️⃣"
|
||||||
|
# category: "Tickets"
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Buttons
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Buttons:
|
||||||
|
Tickets:
|
||||||
|
CloseEmoji: "❌"
|
||||||
|
CloseStyle: "Danger"
|
||||||
|
|
||||||
|
DeleteEmoji: "⛔"
|
||||||
|
DeleteStyle: "Danger"
|
||||||
|
|
||||||
|
LockEmoji: "🔒"
|
||||||
|
LockStyle: "Primary"
|
||||||
|
|
||||||
|
# Available Button Styles
|
||||||
|
# Primary - Blurple
|
||||||
|
# Secondary- Grey
|
||||||
|
# Danger - Red
|
||||||
|
# Success - Green
|
||||||
|
|
||||||
|
# -------------------------
|
||||||
|
# Misc
|
||||||
|
# -------------------------
|
||||||
|
|
||||||
|
Translate:
|
||||||
|
Log: "translations-log"
|
||||||
+13
-12
@@ -16,66 +16,67 @@
|
|||||||
Help:
|
Help:
|
||||||
Command: "help"
|
Command: "help"
|
||||||
Description: "Get a list of all the commands."
|
Description: "Get a list of all the commands."
|
||||||
Permission: ["SEND_MESSAGES"]
|
Permission: ["SendMessages"]
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Info:
|
Info:
|
||||||
Command: "info"
|
Command: "info"
|
||||||
Description: "Get information about the **ServerName**."
|
Description: "Get information about the **ServerName**."
|
||||||
Permission: ["SEND_MESSAGES"]
|
Permission: ["SendMessages"]
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
TicketAdd:
|
TicketAdd:
|
||||||
Command: "add"
|
Command: "add"
|
||||||
Description: "Add a user to a ticket."
|
Description: "Add a user to a ticket."
|
||||||
Permission: ["SEND_MESSAGES"]
|
Permission: ["SendMessages"]
|
||||||
Enabled: false
|
Enabled: false
|
||||||
|
|
||||||
TicketRemove:
|
TicketRemove:
|
||||||
Command: "remove"
|
Command: "remove"
|
||||||
Description: "Remove a user from a ticket."
|
Description: "Remove a user from a ticket."
|
||||||
Permission: ["SEND_MESSAGES"]
|
Permission: ["SendMessages"]
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
OpenTicket:
|
OpenTicket:
|
||||||
Command: "ticket"
|
Command: "ticket"
|
||||||
Description: "Create a support ticket."
|
Description: "Create a support ticket."
|
||||||
Permission: ["SEND_MESSAGES"]
|
Permission: ["SendMessages"]
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
CloseTicket:
|
CloseTicket:
|
||||||
Command: "close"
|
Command: "close"
|
||||||
Description: "Close a support ticket"
|
Description: "Close a support ticket"
|
||||||
Permission: ["SEND_MESSAGES"]
|
Permission: ["SendMessages"]
|
||||||
|
Enabled: true
|
||||||
|
|
||||||
Suggestion:
|
Suggestion:
|
||||||
Command: "suggest"
|
Command: "suggest"
|
||||||
Description: "Create a suggestion."
|
Description: "Create a suggestion."
|
||||||
Permission: ["SEND_MESSAGES"]
|
Permission: ["SendMessages"]
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Embed:
|
Embed:
|
||||||
Command: "embed"
|
Command: "embed"
|
||||||
Description: "Build a discord embed."
|
Description: "Build a discord embed."
|
||||||
Permission: ["SEND_MESSAGES"]
|
Permission: ["SendMessages"]
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Translate:
|
Translate:
|
||||||
Command: "translate"
|
Command: "translate"
|
||||||
Description: "Translate something to english"
|
Description: "Translate something to english"
|
||||||
Permission: ["SEND_MESSAGES"]
|
Permission: ["SendMessages"]
|
||||||
Enabled: true
|
Enabled: false
|
||||||
|
|
||||||
UserInfo:
|
UserInfo:
|
||||||
Command: "userinfo"
|
Command: "userinfo"
|
||||||
Description: "Get info about a user."
|
Description: "Get info about a user."
|
||||||
Permission: ["SEND_MESSAGES"]
|
Permission: ["SendMessages"]
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Ping:
|
Ping:
|
||||||
Command: "ping"
|
Command: "ping"
|
||||||
Description: "Pong."
|
Description: "Pong."
|
||||||
Permission: ["SEND_MESSAGES"]
|
Permission: ["SendMessages"]
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
# ---------------------------------------
|
# ---------------------------------------
|
||||||
|
|||||||
@@ -0,0 +1,83 @@
|
|||||||
|
# ___ _ ___ _
|
||||||
|
# / __> _ _ ___ ___ ___ _ _ _| |_ | . > ___ _| |_
|
||||||
|
# \__ \| | || . \| . \/ . \| '_> | | | . \/ . \ | |
|
||||||
|
# <___/`___|| _/| _/\___/|_| |_| |___/\___/ |_|
|
||||||
|
# |_| |_|
|
||||||
|
#
|
||||||
|
# SupportBot created by Emerald Services
|
||||||
|
# Installed with MIT License
|
||||||
|
#
|
||||||
|
# Discord Support: https://dsc.gg/emerald-dev
|
||||||
|
# Official Documentation: https://emeraldsrv.dev/wiki
|
||||||
|
# Third-Party Documentation: https://emeraldsrv.dev/third-party
|
||||||
|
#
|
||||||
|
# Messages Configuration
|
||||||
|
|
||||||
|
Info:
|
||||||
|
Title: "About Us"
|
||||||
|
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."
|
||||||
|
Button: "Visit Site"
|
||||||
|
URL: "https://emeraldsrv.dev"
|
||||||
|
Colour: "#f74343"
|
||||||
|
|
||||||
|
Welcome:
|
||||||
|
Embed:
|
||||||
|
Colour: "#f74343"
|
||||||
|
Title: "Welcome to ServerName"
|
||||||
|
Message: "> :smile: %joined_user% has just landed!"
|
||||||
|
Thumbnail: "BOT"
|
||||||
|
|
||||||
|
ImageEnabled: false
|
||||||
|
ImageURL: "https://animagelink.png/"
|
||||||
|
|
||||||
|
Leave:
|
||||||
|
Embed:
|
||||||
|
Colour: "#f74343"
|
||||||
|
Title: "Goodbye!"
|
||||||
|
Message: "> :slight_frown: %joined_user% has recently dropped out!"
|
||||||
|
Thumbnail: "BOT"
|
||||||
|
|
||||||
|
ImageEnabled: false
|
||||||
|
ImageURL: "https://animagelink.png/"
|
||||||
|
|
||||||
|
Ticket:
|
||||||
|
|
||||||
|
# Available Placeholders:
|
||||||
|
|
||||||
|
# %ticketusername% - User who created the ticket.
|
||||||
|
# <@%ticketauthor%> - Tags the user who created the ticket.
|
||||||
|
# <#%ticketid%> - Mentions the ticket channel.
|
||||||
|
|
||||||
|
TicketTitle: "Server Support | %ticketusername%"
|
||||||
|
TicketMessage: "> Hello <@%ticketauthor%>, Thank you for creating a support ticket\nPlease wait patiently whilst a member of our team reaches out to you."
|
||||||
|
TicketThumbnail: "https://images.emojiterra.com/google/android-pie/512px/1f39f.png"
|
||||||
|
TicketCreatedAlert: "> :ticket: Ticked Created: <#%ticketid%>"
|
||||||
|
|
||||||
|
# Available Placeholders:
|
||||||
|
|
||||||
|
# <@%user%> - Tags the user who was added to the ticket.
|
||||||
|
|
||||||
|
AddedUser: "> 👍 <@%user%> has been `Added` to the ticket"
|
||||||
|
RemovedUser: "> 👍 <@%user%> has been `Removed` from this ticket"
|
||||||
|
|
||||||
|
Blacklisted: "> :x: You are not allowed to open a ticket"
|
||||||
|
Mutede: "> :x: You are `Muted` and therefore not allowed to open any tickets"
|
||||||
|
InvalidSubject: "> No Reason Provided!"
|
||||||
|
|
||||||
|
TranscriptSavedMessage: "📝 **Transcript Saved!**"
|
||||||
|
TicketLockMessage: "❌ **Ticket Locked!**"
|
||||||
|
TicketDeleteMessage: "⚠ **Ticket Deleting!**"
|
||||||
|
|
||||||
|
ClosingText: "> :warning: You have requested to close your support ticket."
|
||||||
|
|
||||||
|
Error:
|
||||||
|
IncorrectPerms: "> :x: **Err!** You do not have the correct permissions to use this command."
|
||||||
|
InvalidChannel: "> :x: **Err!** Channel not found. Please create it!"
|
||||||
|
UserNotFound: "> :x: **Err!** This user doesn't exist, Are they in this server?"
|
||||||
|
NoValidTicket: "> :warning: You cannot execute this command here."
|
||||||
|
TicketExists: "> :warning: This ticket cannot be opened, It already exists!"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
+11
-2
@@ -11,7 +11,7 @@
|
|||||||
# Official Documentation: https://emeraldsrv.dev/wiki
|
# Official Documentation: https://emeraldsrv.dev/wiki
|
||||||
# Third-Party Documentation: https://emeraldsrv.dev/third-party
|
# Third-Party Documentation: https://emeraldsrv.dev/third-party
|
||||||
|
|
||||||
SupportBot_Version: "v8.0 DEV-v1.1"
|
SupportBot_Version: "v8.0 DEV-v1.2"
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# General Configuration
|
# General Configuration
|
||||||
@@ -19,7 +19,7 @@ SupportBot_Version: "v8.0 DEV-v1.1"
|
|||||||
|
|
||||||
General:
|
General:
|
||||||
Name: "SupportBot"
|
Name: "SupportBot"
|
||||||
Token: ""
|
Token: "BOT TOKEN"
|
||||||
|
|
||||||
# -------------------------
|
# -------------------------
|
||||||
# Activity Configuration
|
# Activity Configuration
|
||||||
@@ -36,6 +36,15 @@ Activity:
|
|||||||
# Embed Configuration
|
# Embed Configuration
|
||||||
# -------------------------
|
# -------------------------
|
||||||
|
|
||||||
|
Embed:
|
||||||
|
Colours:
|
||||||
|
General: "#f74343"
|
||||||
|
Success: "#04b545"
|
||||||
|
Error: "#d12519"
|
||||||
|
Warn: "#fca117"
|
||||||
|
|
||||||
|
Footer: "SupportBot | Developed by Emerald Development"
|
||||||
|
|
||||||
GeneralColour: "#f74343"
|
GeneralColour: "#f74343"
|
||||||
ErrorColour: "#d12519"
|
ErrorColour: "#d12519"
|
||||||
SuccessColour: "#04b545"
|
SuccessColour: "#04b545"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ TicketPanel: true
|
|||||||
# Ticket Panel Message Configuration
|
# Ticket Panel Message Configuration
|
||||||
# ----------------------------------------
|
# ----------------------------------------
|
||||||
|
|
||||||
Channel: "ticket-creation"
|
Channel: "create-ticket"
|
||||||
|
|
||||||
PanelTitle: "Need Help? Create a Support Ticket."
|
PanelTitle: "Need Help? Create a Support Ticket."
|
||||||
PanelColour: "#f74343"
|
PanelColour: "#f74343"
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"id": 4,
|
"id": 2,
|
||||||
"TicketPanelID": ""
|
"TicketPanelID": ""
|
||||||
}
|
}
|
||||||
+48
-3
@@ -7,10 +7,15 @@ const Discord = require("discord.js");
|
|||||||
const { GatewayIntentBits, Partials } = require('discord.js');
|
const { GatewayIntentBits, Partials } = 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")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const cmdconfig = yaml.load(
|
||||||
|
fs.readFileSync("./Configs/commands.yml", "utf8")
|
||||||
|
);
|
||||||
|
|
||||||
class Client extends Discord.Client {
|
class Client extends Discord.Client {
|
||||||
constructor() {
|
constructor() {
|
||||||
super({ intents: [GatewayIntentBits.Guilds], partials: [Partials.Channel] });
|
super({ intents: [GatewayIntentBits.Guilds], partials: [Partials.Channel] });
|
||||||
@@ -20,7 +25,7 @@ class Client extends Discord.Client {
|
|||||||
async getChannel(channel, guild) {
|
async getChannel(channel, guild) {
|
||||||
return guild.channels.cache.find(
|
return guild.channels.cache.find(
|
||||||
(c) =>
|
(c) =>
|
||||||
(c.type === "GUILD_TEXT" || c.type === "GUILD_NEWS") &&
|
(c.type === Discord.ChannelType.GuildText || c.type === Discord.ChannelType.GuildNews) &&
|
||||||
(c.id === channel || c.name.toLowerCase() === channel.toLowerCase())
|
(c.id === channel || c.name.toLowerCase() === channel.toLowerCase())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -32,7 +37,7 @@ class Client extends Discord.Client {
|
|||||||
async getCategory(category, guild) {
|
async getCategory(category, guild) {
|
||||||
return guild.channels.cache.find(
|
return guild.channels.cache.find(
|
||||||
(c) =>
|
(c) =>
|
||||||
c.type === "GUILD_CATEGORY" &&
|
c.type === Discord.ChannelType.GuildCategory &&
|
||||||
(c.id === category || c.name.toLowerCase() === category.toLowerCase())
|
(c.id === category || c.name.toLowerCase() === category.toLowerCase())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -40,10 +45,50 @@ class Client extends Discord.Client {
|
|||||||
async start(token) {
|
async start(token) {
|
||||||
var tempCommandFiles = fs.readdirSync("./Commands").filter((file) => file.endsWith(".js"));
|
var tempCommandFiles = fs.readdirSync("./Commands").filter((file) => file.endsWith(".js"));
|
||||||
|
|
||||||
if (supportbot.DisableSuggestions) {
|
if (cmdconfig.Suggestion.Enabled === false) {
|
||||||
tempCommandFiles = tempCommandFiles.filter(item => item !== "suggest.js");
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "suggest.js");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.Help.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "help.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.Info.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "info.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.TicketAdd.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "add.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.TicketRemove.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "remove.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.OpenTicket.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "ticket.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.CloseTicket.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "close.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.Embed.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "embed.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.Translate.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "translate.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.UserInfo.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "userinfo.js");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cmdconfig.Ping.Enabled === false) {
|
||||||
|
tempCommandFiles = tempCommandFiles.filter(item => item !== "Ping.js");
|
||||||
|
}
|
||||||
|
|
||||||
const commandFiles = tempCommandFiles;
|
const commandFiles = tempCommandFiles;
|
||||||
|
|
||||||
const addonFiles = fs
|
const addonFiles = fs
|
||||||
|
|||||||
Reference in new issue
Block a user