From ebe29b403e49c1fd03241b8f86799c4cfd125dfd Mon Sep 17 00:00:00 2001 From: Noah Date: Sun, 30 Jan 2022 00:07:04 -0600 Subject: [PATCH] Prettier --- .github/workflows/node.js.yml | 2 +- Commands/add.js | 2 +- Commands/close.js | 6 +++--- Commands/embed.js | 2 +- Commands/help.js | 2 +- Commands/remove.js | 4 ++-- Commands/suggest.js | 2 +- Structures/Client.js | 40 +++++++++++++++++------------------ Structures/Command.js | 5 ----- 9 files changed, 30 insertions(+), 35 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index cd33b64..dac2401 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -1,4 +1,4 @@ -# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# This workflow will do a clean installation of node dependencies, build the source code and run tests across different versions of node # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions name: Node.js CI diff --git a/Commands/add.js b/Commands/add.js index 595aac4..acce3f2 100644 --- a/Commands/add.js +++ b/Commands/add.js @@ -26,7 +26,7 @@ module.exports = new Command({ permissions: ["SEND_MESSAGES"], async run(interaction) { - const { getRole} = interaction.client; + const { getRole } = interaction.client; let SupportStaff = await getRole(supportbot.Staff, interaction.guild); let Admin = await getRole(supportbot.Admin, interaction.guild); if (!SupportStaff || !Admin) diff --git a/Commands/close.js b/Commands/close.js index 1b52052..8f6d29a 100644 --- a/Commands/close.js +++ b/Commands/close.js @@ -25,7 +25,7 @@ module.exports = new Command({ permissions: ["SEND_MESSAGES"], async run(interaction) { - const { getRole, getChannel} = interaction.client; + const { getRole, getChannel } = interaction.client; if (supportbot.StaffOnly) { let SupportStaff = await getRole(supportbot.Staff, interaction.guild); let Admin = await getRole(supportbot.Admin, interaction.guild); @@ -163,8 +163,8 @@ module.exports = new Command({ if (ticket.subUsers) { ticket.subUsers.forEach(async (subUser) => { await interaction.client.users.cache - .get(subUser) - .send({embeds: [transcriptEmbed], files: [file]}); + .get(subUser) + .send({ embeds: [transcriptEmbed], files: [file] }); }); } await interaction.channel.delete().catch(async (error) => { diff --git a/Commands/embed.js b/Commands/embed.js index b49e249..2ad25b2 100644 --- a/Commands/embed.js +++ b/Commands/embed.js @@ -33,7 +33,7 @@ module.exports = new Command({ permissions: ["SEND_MESSAGES"], async run(interaction) { - const { getRole} = interaction.client; + const { getRole } = interaction.client; let SupportStaff = await getRole(supportbot.Staff, interaction.guild); let Admin = await getRole(supportbot.Admin, interaction.guild); diff --git a/Commands/help.js b/Commands/help.js index 0d83613..b913320 100644 --- a/Commands/help.js +++ b/Commands/help.js @@ -19,7 +19,7 @@ module.exports = new Command({ permissions: ["SEND_MESSAGES"], async run(interaction) { - const { getRole} = interaction.client; + const { getRole } = interaction.client; let SupportStaff = await getRole(supportbot.Staff, interaction.guild); let Admin = await getRole(supportbot.Admin, interaction.guild); if (!SupportStaff || !Admin) diff --git a/Commands/remove.js b/Commands/remove.js index 5120239..1abf2cf 100644 --- a/Commands/remove.js +++ b/Commands/remove.js @@ -26,7 +26,7 @@ module.exports = new Command({ permissions: ["SEND_MESSAGES"], async run(interaction) { - const { getRole} = interaction.client; + const { getRole } = interaction.client; let Staff = await getRole(supportbot.Staff, interaction.guild); let Admin = await getRole(supportbot.Admin, interaction.guild); if (!Staff || !Admin) @@ -71,7 +71,7 @@ module.exports = new Command({ if (!uMember) return interaction.reply({ embeds: [UserNotExist] }); await interaction.channel.permissionOverwrites.edit(uMember.id, { - VIEW_CHANNEL: false, + VIEW_CHANNEL: false, }); const Complete = new Discord.MessageEmbed() diff --git a/Commands/suggest.js b/Commands/suggest.js index 61cf9f4..e3363c1 100644 --- a/Commands/suggest.js +++ b/Commands/suggest.js @@ -26,7 +26,7 @@ module.exports = new Command({ permissions: ["SEND_MESSAGES"], async run(interaction) { - const { getChannel} = interaction.client; + const { getChannel } = interaction.client; const suggestChannel = await getChannel( supportbot.SuggestionChannel, interaction.guild diff --git a/Structures/Client.js b/Structures/Client.js index e9cf6a6..08520d3 100644 --- a/Structures/Client.js +++ b/Structures/Client.js @@ -39,12 +39,12 @@ class Client extends Discord.Client { async start(token) { const commandFiles = fs - .readdirSync("./Commands") - .filter((file) => file.endsWith(".js")); + .readdirSync("./Commands") + .filter((file) => file.endsWith(".js")); const addonFiles = fs - .readdirSync("./Addons") - .filter((file) => file.endsWith(".js")); + .readdirSync("./Addons") + .filter((file) => file.endsWith(".js")); const addons = addonFiles.map((file) => { let addon = require(`../Addons/${file}`); @@ -69,12 +69,12 @@ class Client extends Discord.Client { addons.forEach((addon) => { console.log( - `\u001b[33m`, - `[ADDON]`, - `\u001b[31;1m`, - `${addon.name}`, - `\u001b[32;1m`, - "Loaded" + `\u001b[33m`, + `[ADDON]`, + `\u001b[31;1m`, + `${addon.name}`, + `\u001b[32;1m`, + "Loaded" ); addon.commands.forEach((command) => { this.commands.set(command.name, command); @@ -91,8 +91,8 @@ class Client extends Discord.Client { this.once("ready", async () => { await this.application?.commands.set(this.commands, supportbot.Guild); console.log( - `\u001b[32;1m`, - `Slash Commands Registered for ${this.guilds.cache.first().name}` + `\u001b[32;1m`, + `Slash Commands Registered for ${this.guilds.cache.first().name}` ); }); @@ -100,20 +100,20 @@ class Client extends Discord.Client { console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬"); fs.readdirSync("./Events") - .filter((file) => file.endsWith(".js")) - .forEach((file) => { - const event = require(`../Events/${file}`); - console.log(`\u001b[31;1m`, `${event.event}`, `\u001b[32;1m`, "Loaded"); - this.on(event.event, (...args) => event.run(this, ...args)); - }); + .filter((file) => file.endsWith(".js")) + .forEach((file) => { + const event = require(`../Events/${file}`); + console.log(`\u001b[31;1m`, `${event.event}`, `\u001b[32;1m`, "Loaded"); + this.on(event.event, (...args) => event.run(this, ...args)); + }); console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬"); if (process.argv[2] !== "test") { await this.login(token); } else { console.log( - `\u001b[31;1m`, - "RUNNING IN TEST MODE, IF NOT INTENDED, PLEASE USE npm start" + `\u001b[31;1m`, + "RUNNING IN TEST MODE, IF NOT INTENDED, PLEASE USE npm start" ); } } diff --git a/Structures/Command.js b/Structures/Command.js index 1dfaffe..eae47be 100644 --- a/Structures/Command.js +++ b/Structures/Command.js @@ -1,10 +1,6 @@ // SupportBot | Emerald Services // Command Structure -const fs = require("fs"); - -const yaml = require("js-yaml"); - class Command { constructor(options) { this.name = options.name; @@ -15,5 +11,4 @@ class Command { this.defaultPermission = true; } } - module.exports = Command;