Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4cd3ecf81f |
No files matched your search
@@ -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}`)
|
||||
@@ -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 += `<style>* {background-color: #2c2f33;color: #fff;font-family: Arial, Helvetica, sans-serif;}</style>`;
|
||||
html += `<strong>Server Name:</strong> ${interaction.guild.name}<br>`;
|
||||
html += `<strong>Ticket:</strong> ${ticketChannel.name}<br>`;
|
||||
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
||||
@@ -180,6 +183,7 @@ module.exports = new Command({
|
||||
msgs = msgs.sort(
|
||||
(a, b) => a.createdTimestamp - b.createdTimestamp
|
||||
);
|
||||
html += `<style>* {background-color: #2c2f33;color: #fff;font-family: Arial, Helvetica, sans-serif;}</style>`;
|
||||
html += `<strong>Server Name:</strong> ${interaction.guild.name}<br>`;
|
||||
html += `<strong>Ticket:</strong> ${ticketChannel.name}<br>`;
|
||||
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
||||
+17
-21
@@ -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] });
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
});
|
||||
+4
-2
@@ -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");
|
||||
|
||||
|
||||
+4
-2
@@ -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");
|
||||
|
||||
|
||||
+4
-2
@@ -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");
|
||||
|
||||
|
||||
@@ -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}`)
|
||||
@@ -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] });
|
||||
},
|
||||
});
|
||||
+8
-7
@@ -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",
|
||||
}
|
||||
|
||||
@@ -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."
|
||||
@@ -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 ---
|
||||
@@ -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
|
||||
Vendored
BIN
Binary file not shown.
@@ -1 +1,5 @@
|
||||
{}
|
||||
{
|
||||
"854057237495676938": {
|
||||
"id": 2
|
||||
}
|
||||
}
|
||||
@@ -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 += `<style>* {background-color: #2c2f33;color: #fff;font-family: Arial, Helvetica, sans-serif;}</style>`;
|
||||
html += `<strong>Server Name:</strong> ${interaction.guild.name}<br>`;
|
||||
html += `<strong>Ticket:</strong> ${ticketChannel.name}<br>`;
|
||||
html += `<strong>Message:</strong> ${msgs.size} Messages<br><br><br>`;
|
||||
@@ -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 =
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
+11
-6
@@ -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);
|
||||
|
||||
@@ -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/) **|**
|
||||
@@ -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) {}
|
||||
|
||||
|
||||
+46
-20
@@ -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`
|
||||
)
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@@ -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) {}
|
||||
|
||||
|
||||
+3
-1
@@ -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) {}
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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({});
|
||||
|
||||
Generated
+2
-2
@@ -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",
|
||||
|
||||
+4
-4
@@ -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"
|
||||
|
||||
Reference in new issue
Block a user