Added 3 new settings in supportbot.yml for more customization

This commit is contained in:
BuildTools committed 2022-06-18 11:19:12 +09:30
1 parent eab11361cb
commit 38da72ca91
6 files changed
+2064 -16

No files matched your search

+5 -5
View File
@@ -154,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`
+10 -8
View File
@@ -311,14 +311,16 @@ module.exports = new Command({
interaction.guild interaction.guild
); );
await ticketChannel.setParent(TicketCat.id, { lockPermissions: false }); await ticketChannel.setParent(TicketCat.id, { lockPermissions: false });
await ticketChannel.send({ if (supportbot.AllowThanksForReachingOutMessage) {
embeds: [ await ticketChannel.send({
{ embeds: [
description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`, {
color: supportbot.EmbedColour, description: `> Thank for reaching out to the **${title} Department**. Please provide us information regarding your query.`,
}, color: supportbot.EmbedColour,
], },
}); ],
});
}
} }
if (supportbot.AllowTicketMentions) { if (supportbot.AllowTicketMentions) {
await ticketChannel.send("@here"); await ticketChannel.send("@here");
+8
View File
@@ -144,6 +144,14 @@ 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 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
DisableSuggestionsChannel: false
# Set to true to disable the requirement of the "SuggestionChannel"
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 ---
+3
View File
@@ -102,6 +102,9 @@ module.exports = new Event("ready", async (client, interaction) => {
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);
} }
+5 -3
View File
@@ -38,9 +38,11 @@ class Client extends Discord.Client {
} }
async start(token) { async start(token) {
const commandFiles = fs var tempCommandFiles = fs.readdirSync("./Commands").filter((file) => file.endsWith(".js"));
.readdirSync("./Commands") if (supportbot.DisableSuggestionsChannel) {
.filter((file) => file.endsWith(".js")); tempCommandFiles = tempCommandFiles.filter(item => item !== "suggest.js");
}
const commandFiles = tempCommandFiles;
const addonFiles = fs const addonFiles = fs
.readdirSync("./Addons") .readdirSync("./Addons")
+2033
View File
File diff suppressed because it is too large. Load diff