This commit is contained in:
Noah committed 2022-01-30 00:07:04 -06:00
1 parent dcba3312dd
commit ebe29b403e
9 files changed
+30 -35

No files matched your search

+1 -1
View File
@@ -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 # For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
name: Node.js CI name: Node.js CI
+1 -1
View File
@@ -26,7 +26,7 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"], permissions: ["SEND_MESSAGES"],
async run(interaction) { async run(interaction) {
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);
if (!SupportStaff || !Admin) if (!SupportStaff || !Admin)
+3 -3
View File
@@ -25,7 +25,7 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"], permissions: ["SEND_MESSAGES"],
async run(interaction) { async run(interaction) {
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);
let Admin = await getRole(supportbot.Admin, interaction.guild); let Admin = await getRole(supportbot.Admin, interaction.guild);
@@ -163,8 +163,8 @@ module.exports = new Command({
if (ticket.subUsers) { if (ticket.subUsers) {
ticket.subUsers.forEach(async (subUser) => { ticket.subUsers.forEach(async (subUser) => {
await interaction.client.users.cache await interaction.client.users.cache
.get(subUser) .get(subUser)
.send({embeds: [transcriptEmbed], files: [file]}); .send({ embeds: [transcriptEmbed], files: [file] });
}); });
} }
await interaction.channel.delete().catch(async (error) => { await interaction.channel.delete().catch(async (error) => {
+1 -1
View File
@@ -33,7 +33,7 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"], permissions: ["SEND_MESSAGES"],
async run(interaction) { async run(interaction) {
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);
+1 -1
View File
@@ -19,7 +19,7 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"], permissions: ["SEND_MESSAGES"],
async run(interaction) { async run(interaction) {
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);
if (!SupportStaff || !Admin) if (!SupportStaff || !Admin)
+2 -2
View File
@@ -26,7 +26,7 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"], permissions: ["SEND_MESSAGES"],
async run(interaction) { async run(interaction) {
const { getRole} = interaction.client; const { getRole } = interaction.client;
let Staff = await getRole(supportbot.Staff, interaction.guild); let Staff = await getRole(supportbot.Staff, interaction.guild);
let Admin = await getRole(supportbot.Admin, interaction.guild); let Admin = await getRole(supportbot.Admin, interaction.guild);
if (!Staff || !Admin) if (!Staff || !Admin)
@@ -71,7 +71,7 @@ module.exports = new Command({
if (!uMember) return interaction.reply({ embeds: [UserNotExist] }); if (!uMember) return interaction.reply({ embeds: [UserNotExist] });
await interaction.channel.permissionOverwrites.edit(uMember.id, { await interaction.channel.permissionOverwrites.edit(uMember.id, {
VIEW_CHANNEL: false, VIEW_CHANNEL: false,
}); });
const Complete = new Discord.MessageEmbed() const Complete = new Discord.MessageEmbed()
+1 -1
View File
@@ -26,7 +26,7 @@ module.exports = new Command({
permissions: ["SEND_MESSAGES"], permissions: ["SEND_MESSAGES"],
async run(interaction) { async run(interaction) {
const { getChannel} = interaction.client; const { getChannel } = interaction.client;
const suggestChannel = await getChannel( const suggestChannel = await getChannel(
supportbot.SuggestionChannel, supportbot.SuggestionChannel,
interaction.guild interaction.guild
+20 -20
View File
@@ -39,12 +39,12 @@ class Client extends Discord.Client {
async start(token) { async start(token) {
const commandFiles = fs const commandFiles = fs
.readdirSync("./Commands") .readdirSync("./Commands")
.filter((file) => file.endsWith(".js")); .filter((file) => file.endsWith(".js"));
const addonFiles = fs const addonFiles = fs
.readdirSync("./Addons") .readdirSync("./Addons")
.filter((file) => file.endsWith(".js")); .filter((file) => file.endsWith(".js"));
const addons = addonFiles.map((file) => { const addons = addonFiles.map((file) => {
let addon = require(`../Addons/${file}`); let addon = require(`../Addons/${file}`);
@@ -69,12 +69,12 @@ class Client extends Discord.Client {
addons.forEach((addon) => { addons.forEach((addon) => {
console.log( console.log(
`\u001b[33m`, `\u001b[33m`,
`[ADDON]`, `[ADDON]`,
`\u001b[31;1m`, `\u001b[31;1m`,
`${addon.name}`, `${addon.name}`,
`\u001b[32;1m`, `\u001b[32;1m`,
"Loaded" "Loaded"
); );
addon.commands.forEach((command) => { addon.commands.forEach((command) => {
this.commands.set(command.name, command); this.commands.set(command.name, command);
@@ -91,8 +91,8 @@ class Client extends Discord.Client {
this.once("ready", async () => { this.once("ready", async () => {
await this.application?.commands.set(this.commands, supportbot.Guild); await this.application?.commands.set(this.commands, supportbot.Guild);
console.log( console.log(
`\u001b[32;1m`, `\u001b[32;1m`,
`Slash Commands Registered for ${this.guilds.cache.first().name}` `Slash Commands Registered for ${this.guilds.cache.first().name}`
); );
}); });
@@ -100,20 +100,20 @@ class Client extends Discord.Client {
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬"); console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
fs.readdirSync("./Events") fs.readdirSync("./Events")
.filter((file) => file.endsWith(".js")) .filter((file) => file.endsWith(".js"))
.forEach((file) => { .forEach((file) => {
const event = require(`../Events/${file}`); const event = require(`../Events/${file}`);
console.log(`\u001b[31;1m`, `${event.event}`, `\u001b[32;1m`, "Loaded"); console.log(`\u001b[31;1m`, `${event.event}`, `\u001b[32;1m`, "Loaded");
this.on(event.event, (...args) => event.run(this, ...args)); this.on(event.event, (...args) => event.run(this, ...args));
}); });
console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬"); console.log(`\u001b[34;1m`, "▬▬▬▬▬▬▬ Events ▬▬▬▬▬▬▬");
if (process.argv[2] !== "test") { if (process.argv[2] !== "test") {
await this.login(token); await this.login(token);
} else { } else {
console.log( console.log(
`\u001b[31;1m`, `\u001b[31;1m`,
"RUNNING IN TEST MODE, IF NOT INTENDED, PLEASE USE npm start" "RUNNING IN TEST MODE, IF NOT INTENDED, PLEASE USE npm start"
); );
} }
} }
-5
View File
@@ -1,10 +1,6 @@
// SupportBot | Emerald Services // SupportBot | Emerald Services
// Command Structure // Command Structure
const fs = require("fs");
const yaml = require("js-yaml");
class Command { class Command {
constructor(options) { constructor(options) {
this.name = options.name; this.name = options.name;
@@ -15,5 +11,4 @@ class Command {
this.defaultPermission = true; this.defaultPermission = true;
} }
} }
module.exports = Command; module.exports = Command;