diff --git a/.DS_Store b/.DS_Store
new file mode 100644
index 0000000..1f0cfc9
Binary files /dev/null and b/.DS_Store differ
diff --git a/Commands/TicketAdd.js b/Commands/add.js
similarity index 92%
rename from Commands/TicketAdd.js
rename to Commands/add.js
index 21ce019..5aee916 100644
--- a/Commands/TicketAdd.js
+++ b/Commands/add.js
@@ -5,8 +5,10 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
-const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
+const 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");
@@ -56,9 +58,7 @@ module.exports = new Command({
interaction.member.roles.cache.has(SupportStaff.id) ||
interaction.member.roles.cache.has(Admins.id)
) {
- if (
- !interaction.channel.name.startsWith(`${supportbot.TicketChannel}-`)
- ) {
+ if (!interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
const Exists = new Discord.MessageEmbed()
.setTitle("No Ticket Found!")
.setDescription(`${supportbot.NoValidTicket}`)
diff --git a/Commands/closeticket.js b/Commands/close.js
similarity index 94%
rename from Commands/closeticket.js
rename to Commands/close.js
index c9ed693..2a29c8a 100644
--- a/Commands/closeticket.js
+++ b/Commands/close.js
@@ -5,8 +5,10 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
-const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
+const supportbot = yaml.load(
+ fs.readFileSync("./Configs/supportbot.yml", "utf8")
+);
+const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
const Command = require("../Structures/Command.js");
const TicketNumberID = require("../Structures/TicketID.js");
@@ -30,7 +32,7 @@ module.exports = new Command({
permission: "SEND_MESSAGES",
async run(interaction) {
- if (!interaction.channel.name.startsWith(`${supportbot.TicketChannel}-`)) {
+ if (!interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
const Exists = new Discord.MessageEmbed()
.setTitle("No Ticket Found!")
.setDescription(`${supportbot.NoValidTicket}`)
@@ -95,6 +97,7 @@ module.exports = new Command({
msgs = msgs.sort(
(a, b) => a.createdTimestamp - b.createdTimestamp
);
+ html += ``;
html += `Server Name: ${interaction.guild.name}
`;
html += `Ticket: ${ticketChannel.name}
`;
html += `Message: ${msgs.size} Messages
`;
@@ -180,6 +183,7 @@ module.exports = new Command({
msgs = msgs.sort(
(a, b) => a.createdTimestamp - b.createdTimestamp
);
+ html += ``;
html += `Server Name: ${interaction.guild.name}
`;
html += `Ticket: ${ticketChannel.name}
`;
html += `Message: ${msgs.size} Messages
`;
diff --git a/Commands/embed.js b/Commands/embed.js
index 7b6db55..9bff3a8 100644
--- a/Commands/embed.js
+++ b/Commands/embed.js
@@ -5,8 +5,10 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
-const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
+const 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");
@@ -15,22 +17,20 @@ module.exports = new Command({
description: cmdconfig.EmbedCommandDesc,
slashCommandOptions: [
{
- name: "title",
- description: "Embed Title",
- type: "STRING",
- },
+ name: "title",
+ description: "Embed Title",
+ type: "STRING",
+ },
{
name: "message",
description: "Embed Message",
type: "STRING",
},
-
],
permission: "SEND_MESSAGES",
async run(interaction) {
-
let SupportStaff =
interaction.guild.roles.cache.find(
(SupportTeam) => SupportTeam.name === supportbot.Staff
@@ -57,22 +57,18 @@ module.exports = new Command({
interaction.member.roles.cache.has(SupportStaff.id) ||
interaction.member.roles.cache.has(Admins.id)
) {
+ const EmbedTitle = interaction.options.getString("title");
+ const EmbedSubject = interaction.options.getString("message");
- const EmbedTitle = interaction.options.getString("title")
- const EmbedSubject = interaction.options.getString("message")
-
- const EmbedMsg = new Discord.MessageEmbed()
- .setTitle(EmbedTitle)
- .setDescription(EmbedSubject)
-
- interaction.reply({
- embeds: [EmbedMsg],
- });
+ const EmbedMsg = new Discord.MessageEmbed()
+ .setTitle(EmbedTitle)
+ .setDescription(EmbedSubject);
+ interaction.reply({
+ embeds: [EmbedMsg],
+ });
} else {
- return interaction.reply({ embeds: [NoPerms] });
+ return interaction.reply({ embeds: [NoPerms] });
}
-
},
-
});
diff --git a/Commands/help.js b/Commands/help.js
index 8df6568..bc02091 100644
--- a/Commands/help.js
+++ b/Commands/help.js
@@ -5,8 +5,10 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
-const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
+const 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");
diff --git a/Commands/info.js b/Commands/info.js
index 289ce07..b93dcf9 100644
--- a/Commands/info.js
+++ b/Commands/info.js
@@ -5,8 +5,10 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
-const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
+const 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");
diff --git a/Commands/ping.js b/Commands/ping.js
index 799b1f4..edf812d 100644
--- a/Commands/ping.js
+++ b/Commands/ping.js
@@ -5,8 +5,10 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
-const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
+const 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");
diff --git a/Commands/TicketRemove.js b/Commands/remove.js
similarity index 92%
rename from Commands/TicketRemove.js
rename to Commands/remove.js
index f5d673e..d062584 100644
--- a/Commands/TicketRemove.js
+++ b/Commands/remove.js
@@ -5,8 +5,10 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
-const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
+const 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");
@@ -56,9 +58,7 @@ module.exports = new Command({
interaction.member.roles.cache.has(SupportStaff.id) ||
interaction.member.roles.cache.has(Admins.id)
) {
- if (
- !interaction.channel.name.startsWith(`${supportbot.TicketChannel}-`)
- ) {
+ if (!interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
const Exists = new Discord.MessageEmbed()
.setTitle("No Ticket Found!")
.setDescription(`${supportbot.NoValidTicket}`)
diff --git a/Commands/suggest.js b/Commands/suggest.js
new file mode 100644
index 0000000..99a99bc
--- /dev/null
+++ b/Commands/suggest.js
@@ -0,0 +1,68 @@
+// SupportBot | Emerald Services
+// Ping Command
+
+const fs = require("fs");
+
+const Discord = require("discord.js");
+const yaml = require("js-yaml");
+const supportbot = yaml.load(
+ fs.readFileSync("./Configs/supportbot.yml", "utf8")
+);
+const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
+
+const Command = require("../Structures/Command.js");
+
+module.exports = new Command({
+ name: cmdconfig.SuggestCommand,
+ description: cmdconfig.SuggestCommandDesc,
+ slashCommandOptions: [
+ {
+ name: "suggestion",
+ description: "Create a Suggestion",
+ type: "STRING",
+ },
+ ],
+ permission: "SEND_MESSAGES",
+
+ async run(interaction) {
+ const suggestChannel =
+ interaction.guild.channels.cache.find(
+ (channel) => channel.name === supportbot.SuggestionChannel
+ ) ||
+ interaction.guild.channels.cache.find(
+ (channel) => channel.id === supportbot.SuggestionChannel
+ );
+
+ const NoChannel = new Discord.MessageEmbed()
+ .setTitle("Missing Channel!")
+ .setDescription(`${supportbot.InvalidChannel}`)
+ .setColor(supportbot.ErrorColour);
+
+ if (!suggestChannel) return interaction.reply({ embeds: [NoChannel] });
+
+ let suggestion = interaction.options.getString("suggestion");
+
+ const SuggestEmbed = new Discord.MessageEmbed()
+ .addField("Suggestion", suggestion, true)
+ .addField("From", `<@${interaction.user.id}>`)
+ .setThumbnail(interaction.user.displayAvatarURL())
+ .setFooter(supportbot.EmbedFooter, interaction.user.displayAvatarURL())
+ .setColor(supportbot.EmbedColour);
+
+ const suggestionMsg = await suggestChannel.send({ embeds: [SuggestEmbed] });
+ if (supportbot.SuggestionUpvote && supportbot.SuggestionDownvote) {
+ suggestionMsg.react(supportbot.SuggestionUpvote);
+ suggestionMsg.react(supportbot.SuggestionDownvote);
+ }
+
+ const Submitted = new Discord.MessageEmbed()
+ .setTitle("Suggestion Submitted!")
+ .setDescription(
+ `:white_check_mark: You have successfully submitted a suggestion.`
+ )
+ .addField("Sent to:", `<#${suggestChannel.id}>`)
+ .setColor(supportbot.SuccessColour);
+
+ return interaction.reply({ embeds: [Submitted] });
+ },
+});
diff --git a/Commands/ticket.js b/Commands/ticket.js
index f1a65d8..27329fd 100644
--- a/Commands/ticket.js
+++ b/Commands/ticket.js
@@ -5,8 +5,10 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
-const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
+const supportbot = yaml.load(
+ fs.readFileSync("./Configs/supportbot.yml", "utf8")
+);
+const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
const Command = require("../Structures/Command.js");
const TicketNumberID = require("../Structures/TicketID.js");
@@ -62,10 +64,9 @@ module.exports = new Command({
.setColor(supportbot.WarningColour);
if (
- interaction.guild.channels.cache.find(
- (ticketChannel) =>
- ticketChannel.name === `${supportbot.TicketChannel}-${ticketNumberID}`
- )
+ await interaction.guild.channels.cache.find((ticketChannel) => {
+ ticketChannel.name === `${supportbot.TicketPrefix}${ticketNumberID}`;
+ })
) {
return interaction.reply({ embeds: [TicketExists] });
}
@@ -113,7 +114,7 @@ module.exports = new Command({
const Author = interaction.user;
const Everyone = interaction.guild.id;
const ticketChannel = await interaction.guild.channels.create(
- `${supportbot.TicketChannel}-${ticketNumberID}`,
+ `${supportbot.TicketPrefix}${ticketNumberID}`,
{
type: "GUILD_TEXT",
}
diff --git a/Data/commands.yml b/Configs/commands.yml
similarity index 84%
rename from Data/commands.yml
rename to Configs/commands.yml
index 8edc372..1e56d35 100644
--- a/Data/commands.yml
+++ b/Configs/commands.yml
@@ -7,8 +7,8 @@
# SupportBot created by Emerald Services
# Installed with MIT License
#
-# Discord Support: https:#emeraldsrv.dev/discord
-# Community Resources: https:#emeraldsrv.dev/resources
+# Discord Support: https://emeraldsrv.dev/discord
+# Community Resources: https://emeraldsrv.dev/resources
# -------------------------------
# Command Name Configuration
@@ -22,6 +22,7 @@ InfoCommand: "info"
PingCommand: "ping"
HelpCommand: "help"
EmbedCommand: "embed"
+SuggestCommand: "suggest"
# ---------------------------------------
# Command Description Configuration
@@ -35,5 +36,4 @@ InfoCommandDesc: "Get information about the brand."
PingCommandDesc: "Pong!"
HelpCommandDesc: "Get a list of all the commands."
EmbedCommandDesc: "Send a message as an embed."
-
-
+SuggestCommandDesc: "Suggest a feature for the server."
diff --git a/Data/supportbot.yml b/Configs/supportbot.yml
similarity index 89%
rename from Data/supportbot.yml
rename to Configs/supportbot.yml
index a7f1cee..e76fa4f 100644
--- a/Data/supportbot.yml
+++ b/Configs/supportbot.yml
@@ -7,17 +7,17 @@
# SupportBot created by Emerald Services
# Installed with MIT License
#
-# Discord Support: https:#emeraldsrv.dev/discord
-# Community Resources: https:#emeraldsrv.dev/resources
+# Discord Support: https://emeraldsrv.dev/discord
+# Community Resources: https://emeraldsrv.dev/resources
-SupportBot_Version: "7.2 pre-3"
+SupportBot_Version: "7.2"
# -------------------------
# General Configuration
# -------------------------
Name: "SupportBot"
-Prefix: "!" # Everything uses the new Slash (/) Commands feature!
+# No Prefix, as everything uses the new Slash (/) Commands feature!
Token: "BOT_TOKEN"
# -------------------------
@@ -69,19 +69,25 @@ AutoRole: true
AutoRole_Role: "Member"
LockdownRole: "@everyone"
-Staff: "Support Team"
+Staff: "Staff"
Admin: "Project Developer"
TicketBlackListRole: "Blacklisted"
+# ----------------------------
+# Suggestions Configuration
+# ----------------------------
+
+SuggestionChannel: "suggestions"
+
# -------------------------
# Tickets Configuration
# -------------------------
-TicketCategory: "▬▬ TICKETS ▬▬"
-TicketChannel: "ticket"
+TicketCategory: "Tickets"
+TicketPrefix: "ticket-" # The prefix for ticket channel names
-TicketLog: "ticket-log"
-TranscriptLog: "ticket-data"
+TicketLog: "logs"
+TranscriptLog: "transcripts"
TranscriptTitle: "Ticket Transcript"
TicketLog_Title: "Ticket Log"
@@ -165,9 +171,9 @@ DepartmentTitle_2: "Billing Support"
DepartmentTitle_3: "Admin Team"
# Ticket department title, This is the title for a ticket department to help users know what is available.
-DepartmentRole_1: "Support Team"
-DepartmentRole_2: "Support Team"
-DepartmentRole_3: "Project Developer"
+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 ---
diff --git a/Data/ticket-panel.yml b/Configs/ticket-panel.yml
similarity index 89%
rename from Data/ticket-panel.yml
rename to Configs/ticket-panel.yml
index baeca8d..10f37bf 100644
--- a/Data/ticket-panel.yml
+++ b/Configs/ticket-panel.yml
@@ -7,8 +7,8 @@
# SupportBot created by Emerald Services
# Installed with MIT License
#
-# Discord Support: https:#emeraldsrv.dev/discord
-# Community Resources: https:#emeraldsrv.dev/resources
+# Discord Support: https://emeraldsrv.dev/discord
+# Community Resources: https://emeraldsrv.dev/resources
# -------------------------------
# Ticket Panel Configuration
diff --git a/Data/.DS_Store b/Data/.DS_Store
new file mode 100644
index 0000000..23c4cb2
Binary files /dev/null and b/Data/.DS_Store differ
diff --git a/Data/TicketData.json b/Data/TicketData.json
index 0967ef4..cf23c47 100644
--- a/Data/TicketData.json
+++ b/Data/TicketData.json
@@ -1 +1,5 @@
-{}
+{
+ "854057237495676938": {
+ "id": 2
+ }
+}
\ No newline at end of file
diff --git a/Events/interactionCreate.js b/Events/interactionCreate.js
index 7b06425..d7e67a1 100644
--- a/Events/interactionCreate.js
+++ b/Events/interactionCreate.js
@@ -5,8 +5,10 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
-const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
+const supportbot = yaml.load(
+ fs.readFileSync("./Configs/supportbot.yml", "utf8")
+);
+const cmdconfig = yaml.load(fs.readFileSync("./Configs/commands.yml", "utf8"));
const Event = require("../Structures/Event.js");
@@ -55,7 +57,7 @@ module.exports = new Event("interactionCreate", (client, interaction) => {
}
if (interaction.customId === "ticketclose") {
- if (interaction.channel.name.startsWith(`${supportbot.TicketChannel}-`)) {
+ if (interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
interaction.message.fetch();
interaction.deferUpdate();
const DeleteTicketEmbed = new Discord.MessageEmbed()
@@ -92,6 +94,7 @@ module.exports = new Event("interactionCreate", (client, interaction) => {
msgs = msgs.sort(
(a, b) => a.createdTimestamp - b.createdTimestamp
);
+ html += ``;
html += `Server Name: ${interaction.guild.name}
`;
html += `Ticket: ${ticketChannel.name}
`;
html += `Message: ${msgs.size} Messages
`;
@@ -124,7 +127,7 @@ module.exports = new Event("interactionCreate", (client, interaction) => {
}
}
if (interaction.customId === "ticketlock") {
- if (interaction.channel.name.startsWith(`${supportbot.TicketChannel}`)) {
+ if (interaction.channel.name.startsWith(`${supportbot.TicketPrefix}`)) {
interaction.message.fetch();
interaction.deferUpdate();
let Admin =
diff --git a/Events/messageReactionAdd.js b/Events/messageReactionAdd.js
deleted file mode 100644
index 22d20d6..0000000
--- a/Events/messageReactionAdd.js
+++ /dev/null
@@ -1,43 +0,0 @@
-// SupportBot | Emerald Services
-// Ready Event
-
-const fs = require("fs");
-
-const Discord = require("discord.js");
-const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
-const cmdconfig = yaml.load(fs.readFileSync("./Data/commands.yml", "utf8"));
-const panelconfig = yaml.load(
- fs.readFileSync("./Data/ticket-panel.yml", "utf8")
-);
-
-const Event = require("../Structures/Event.js");
-
-module.exports = new Event("messageReactionAdd", async (client) => {
- let message = {
- guild: reaction.message.channel.guild,
- author: user,
- content: "N/A",
- channel: reaction.message.channel,
- };
-
- if (panelconfig.TicketPanel) {
- if (reaction.message.id === panelconfig.TicketPanelID) {
- if (
- reaction.emoji.name == panelconfig.ButtonEmoji ||
- reaction.emoji.id == panelconfig.ButtonEmoji
- ) {
- await reaction.users.remove(user.id);
-
- try {
- const cmd = client.commands.get(cmdconfig.OpenTicket);
- if (!cmd) return;
-
- cmd.run(message, message.content);
- } catch (error) {
- console.error(error);
- }
- }
- }
- }
-});
diff --git a/Events/ready.js b/Events/ready.js
index 872e412..24bfa7f 100644
--- a/Events/ready.js
+++ b/Events/ready.js
@@ -5,9 +5,11 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
+const supportbot = yaml.load(
+ fs.readFileSync("./Configs/supportbot.yml", "utf8")
+);
const panelconfig = yaml.load(
- fs.readFileSync("./Data/ticket-panel.yml", "utf8")
+ fs.readFileSync("./Configs/ticket-panel.yml", "utf8")
);
const Event = require("../Structures/Event.js");
@@ -77,8 +79,8 @@ module.exports = new Event("ready", (client) => {
return false;
}
- const panelid = yaml.load(
- fs.readFileSync("./Data/ticket-panel-id.yml", "utf8")
+ const panelid = JSON.parse(
+ fs.readFileSync("./Data/ticket-panel-id.json", "utf8")
);
chan1.messages.fetch(panelid.TicketPanelID).catch(async (r) => {
@@ -115,8 +117,11 @@ module.exports = new Event("ready", (client) => {
let data = {
TicketPanelID: `${r.id}`,
};
- let yamlStr = yaml.dump(data);
- fs.writeFileSync("./Data/ticket-panel-id.yml", yamlStr, "utf8");
+ fs.writeFileSync(
+ "./Data/ticket-panel-id.json",
+ JSON.stringify(data),
+ "utf8"
+ );
})
.catch((e) => {
console.log("Raw" + e);
diff --git a/README.md b/README.md
index e69de29..01cd9e6 100644
--- a/README.md
+++ b/README.md
@@ -0,0 +1,13 @@
+
+
+## What is SupportBot?
+
+SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customisation to match your own brand.
+
+## Quick Links
+
+**|** [Discord](https://emeraldsrv.dev/discord) **|**
+[Hosting](https://emeraldsrv.dev/hosting) **|**
+[Documentation](https://docs.emeraldsrv.dev) **|**
+[Download via Polymart](https://polymart.org/resource/supportbot-1-discord-ticket-bot.518) **|**
+[Download via MC-Market](https://www.mc-market.org/resources/8940/) **|**
diff --git a/Structures/Addons.js b/Structures/Addons.js
index d5c8935..95b24f7 100644
--- a/Structures/Addons.js
+++ b/Structures/Addons.js
@@ -6,7 +6,9 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
+const supportbot = yaml.load(
+ fs.readFileSync("./Configs/supportbot.yml", "utf8")
+);
function RunFunction(interaction) {}
diff --git a/Structures/Client.js b/Structures/Client.js
index e37007d..e70422d 100644
--- a/Structures/Client.js
+++ b/Structures/Client.js
@@ -9,7 +9,9 @@ const Event = require("./Event.js");
const intents = new Discord.Intents(32767);
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
+const supportbot = yaml.load(
+ fs.readFileSync("./Configs/supportbot.yml", "utf8")
+);
class Client extends Discord.Client {
constructor() {
@@ -23,6 +25,12 @@ class Client extends Discord.Client {
.readdirSync("./Commands")
.filter((file) => file.endsWith(".js"));
+ const addonFiles = fs
+ .readdirSync("./Addons")
+ .filter((file) => file.endsWith(".js"));
+
+ const addons = addonFiles.map((file) => require(`../Addons/${file}`));
+
const commands = commandFiles.map((file) => require(`../Commands/${file}`));
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
@@ -32,26 +40,19 @@ class Client extends Discord.Client {
this.commands.set(cmd.name, cmd);
});
- console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
-
- // Addons
-
- const addonFiles = fs
- .readdirSync("./Addons")
- .filter((file) => file.endsWith(".js"));
-
- const addons = addonFiles.map((file) => require(`../Addons/${file}`));
-
- console.log(" ");
- console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬");
-
addons.forEach((addon) => {
- console.log(`\u001b[31;1m`, `${addon.name}`, `\u001b[32;1m`, "Loaded");
+ console.log(
+ `\u001b[33m`,
+ `[ADDON]`,
+ `\u001b[31;1m`,
+ `${addon.name}`,
+ `\u001b[32;1m`,
+ "Loaded"
+ );
this.commands.set(addon.name, addon);
});
- console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Addons ▬▬▬▬▬▬▬");
- console.log(" ");
+ console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Commands ▬▬▬▬▬▬▬");
// Slash Commands
@@ -63,17 +64,42 @@ class Client extends Discord.Client {
defaultPermission: true,
}));
+ const slashCommands1 = addons.map((addon) => ({
+ name: addon.name.toLowerCase(),
+ description: addon.description,
+ permissions: [],
+ options: addon.slashCommandOptions,
+ defaultPermission: true,
+ }));
+
this.removeAllListeners();
this.on("ready", async () => {
- const cmds = await this.application?.commands.set(slashCommands);
+ const allCommands = slashCommands.concat(slashCommands1);
+ await this.application?.commands.set(allCommands);
console.log(" ");
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Slash Command ▬▬▬▬▬▬▬"),
console.log(" ");
- cmds.forEach((cmd) =>
- console.log(`Slash Command ${cmd.name} registered`)
+ slashCommands.forEach((cmd) =>
+ console.log(
+ `\u001b[31;1m`,
+ `${cmd.name}`,
+ `\u001b[32;1m`,
+ `| Slash Command Registered`
+ )
+ );
+
+ slashCommands1.forEach((addon) =>
+ console.log(
+ `\u001b[33m`,
+ `[ADDON]`,
+ `\u001b[31;1m`,
+ `${addon.name}`,
+ `\u001b[32;1m`,
+ `| Slash Command Registered`
+ )
);
});
diff --git a/Structures/Command.js b/Structures/Command.js
index a075110..ba663b5 100644
--- a/Structures/Command.js
+++ b/Structures/Command.js
@@ -6,7 +6,9 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
+const supportbot = yaml.load(
+ fs.readFileSync("./Configs/supportbot.yml", "utf8")
+);
function RunFunction(interaction) {}
diff --git a/Structures/Event.js b/Structures/Event.js
index 8f81bf1..61e4381 100644
--- a/Structures/Event.js
+++ b/Structures/Event.js
@@ -6,7 +6,9 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
+const supportbot = yaml.load(
+ fs.readFileSync("./Configs/supportbot.yml", "utf8")
+);
function RunFunction(client, ...eventArgs) {}
diff --git a/Structures/TicketID.js b/Structures/TicketID.js
index e0f0d80..11c9d9f 100644
--- a/Structures/TicketID.js
+++ b/Structures/TicketID.js
@@ -9,7 +9,9 @@ const Client = require("./Client.js");
const Event = require("./Event.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
+const supportbot = yaml.load(
+ fs.readFileSync("./Configs/supportbot.yml", "utf8")
+);
class TicketNumberID {
static pad(guildId) {
diff --git a/index.js b/index.js
index ed48bb2..db39ccc 100644
--- a/index.js
+++ b/index.js
@@ -14,7 +14,9 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require("js-yaml");
-const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
+const supportbot = yaml.load(
+ fs.readFileSync("./Configs/supportbot.yml", "utf8")
+);
const Client = require("./Structures/Client.js");
const client = new Client({});
diff --git a/package-lock.json b/package-lock.json
index adbb482..96e00a2 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "supportbot",
- "version": "7.2.0",
+ "version": "7.3.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "supportbot",
- "version": "7.2.0",
+ "version": "7.3.0",
"license": "MIT",
"dependencies": {
"discord.js": "^13.2.0",
diff --git a/package.json b/package.json
index aa20175..d7e99f0 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "supportbot",
- "version": "7.2.0",
+ "version": "7.3.0",
"description": "SupportBot is an open-sourced support system for discord. It's completely free to use with high amounts of customization to match your own brand.",
"main": "index.js",
"scripts": {
@@ -8,14 +8,14 @@
},
"repository": {
"type": "git",
- "url": "git+https://github.com/1tzemerald/SupportBot.git"
+ "url": "git+https://github.com/Emerald-Services/SupportBot.git"
},
"author": "Emerald Services",
"license": "MIT",
"bugs": {
- "url": "https://github.com/1tzemerald/SupportBot/issues"
+ "url": "https://github.com/Emerald-Services/SupportBot/issues"
},
- "homepage": "https://github.com/1tzemerald/SupportBot#readme",
+ "homepage": "https://github.com/Emerald-Services/SupportBot#readme",
"dependencies": {
"discord.js": "^13.2.0",
"js-yaml": "^4.1.0"